matcha-components 20.13.0 → 20.15.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 (810) hide show
  1. package/assets/open_in_new.png +0 -0
  2. package/index.ts +1 -0
  3. package/ng-package.json +7 -0
  4. package/package.json +6 -19
  5. package/src/documentation/components/matcha-drawer.mdx +469 -0
  6. package/src/documentation/foundation/borders/border-radius.mdx +145 -0
  7. package/src/documentation/foundation/borders/border-size.mdx +111 -0
  8. package/src/documentation/foundation/borders/border-style.mdx +144 -0
  9. package/src/documentation/foundation/colors/all-colors.mdx +153 -0
  10. package/src/documentation/foundation/colors/base/amber.mdx +235 -0
  11. package/src/documentation/foundation/colors/base/blue.mdx +235 -0
  12. package/src/documentation/foundation/colors/base/cyan.mdx +235 -0
  13. package/src/documentation/foundation/colors/base/deep-orange.mdx +235 -0
  14. package/src/documentation/foundation/colors/base/deep-purple.mdx +235 -0
  15. package/src/documentation/foundation/colors/base/green.mdx +235 -0
  16. package/src/documentation/foundation/colors/base/indigo.mdx +235 -0
  17. package/src/documentation/foundation/colors/base/light-blue.mdx +235 -0
  18. package/src/documentation/foundation/colors/base/light-green.mdx +235 -0
  19. package/src/documentation/foundation/colors/base/lime.mdx +235 -0
  20. package/src/documentation/foundation/colors/base/orange.mdx +235 -0
  21. package/src/documentation/foundation/colors/base/pink.mdx +235 -0
  22. package/src/documentation/foundation/colors/base/purple.mdx +235 -0
  23. package/src/documentation/foundation/colors/base/red.mdx +235 -0
  24. package/src/documentation/foundation/colors/base/teal.mdx +235 -0
  25. package/src/documentation/foundation/colors/base/yellow.mdx +235 -0
  26. package/src/documentation/foundation/colors/surface-colors.mdx +93 -0
  27. package/src/documentation/foundation/colors/theme/accent.mdx +235 -0
  28. package/src/documentation/foundation/colors/theme/primary.mdx +235 -0
  29. package/src/documentation/foundation/colors/theme/warn.mdx +235 -0
  30. package/src/documentation/foundation/displays/display-block.mdx +134 -0
  31. package/src/documentation/foundation/displays/display-flex.mdx +134 -0
  32. package/src/documentation/foundation/displays/display-grid.mdx +134 -0
  33. package/src/documentation/foundation/displays/display-inline-block.mdx +134 -0
  34. package/src/documentation/foundation/displays/display-inline-flex.mdx +134 -0
  35. package/src/documentation/foundation/displays/display-inline.mdx +134 -0
  36. package/src/documentation/foundation/displays/display-none.mdx +134 -0
  37. package/src/documentation/foundation/displays/display-table-cell.mdx +134 -0
  38. package/src/documentation/foundation/displays/display-table-row.mdx +134 -0
  39. package/src/documentation/foundation/displays/display-table.mdx +134 -0
  40. package/src/documentation/foundation/flexbox/flexbox.mdx +420 -0
  41. package/src/documentation/foundation/opacity/opacity.mdx +104 -0
  42. package/src/documentation/foundation/position/alignment.mdx +148 -0
  43. package/src/documentation/foundation/sizes/height/heights.mdx +96 -0
  44. package/src/documentation/foundation/sizes/height/max-heights.mdx +96 -0
  45. package/src/documentation/foundation/sizes/height/min-heights.mdx +96 -0
  46. package/src/documentation/foundation/sizes/width/max-width.mdx +95 -0
  47. package/src/documentation/foundation/sizes/width/min-width.mdx +96 -0
  48. package/src/documentation/foundation/sizes/width/widths.mdx +96 -0
  49. package/src/documentation/foundation/spacing/margins.mdx +227 -0
  50. package/src/documentation/foundation/spacing/paddings.mdx +225 -0
  51. package/src/documentation/foundation/typography/colors.mdx +26 -0
  52. package/src/documentation/foundation/typography/font-size.mdx +57 -0
  53. package/src/documentation/foundation/typography/font-weight.mdx +85 -0
  54. package/src/documentation/foundation/typography/letter-spacing.mdx +35 -0
  55. package/src/documentation/foundation/typography/line-clamp.mdx +145 -0
  56. package/src/documentation/foundation/typography/line-height.mdx +52 -0
  57. package/src/documentation/foundation/typography/message-box.mdx +43 -0
  58. package/src/documentation/foundation/typography/paragraph.mdx +165 -0
  59. package/src/documentation/foundation/typography/text-align.mdx +22 -0
  60. package/src/documentation/foundation/typography/text-styles.mdx +88 -0
  61. package/src/documentation/presentation.mdx +591 -0
  62. package/src/documentation/services/matcha-breakpoint-observer.mdx +310 -0
  63. package/src/documentation/tokens/animations.mdx +116 -0
  64. package/src/documentation/tokens/breakpoints.mdx +57 -0
  65. package/src/documentation/tokens/colors.mdx +1884 -0
  66. package/src/documentation/tokens/elevations.mdx +50 -0
  67. package/src/documentation/tokens/sizes.mdx +150 -0
  68. package/src/lib/matcha-accordion/accordion/accordion.component.html +1 -0
  69. package/src/lib/matcha-accordion/accordion/accordion.component.scss +0 -0
  70. package/src/lib/matcha-accordion/accordion/accordion.component.ts +72 -0
  71. package/src/lib/matcha-accordion/accordion-content/accordion-content.component.html +1 -0
  72. package/src/lib/matcha-accordion/accordion-content/accordion-content.component.scss +0 -0
  73. package/src/lib/matcha-accordion/accordion-content/accordion-content.component.ts +11 -0
  74. package/src/lib/matcha-accordion/accordion-header/accordion-header.component.html +1 -0
  75. package/src/lib/matcha-accordion/accordion-header/accordion-header.component.scss +0 -0
  76. package/src/lib/matcha-accordion/accordion-header/accordion-header.component.ts +11 -0
  77. package/src/lib/matcha-accordion/accordion-item/accordion-item.component.html +13 -0
  78. package/src/lib/matcha-accordion/accordion-item/accordion-item.component.scss +0 -0
  79. package/src/lib/matcha-accordion/accordion-item/accordion-item.component.ts +63 -0
  80. package/src/lib/matcha-accordion/accordion.module.ts +37 -0
  81. package/src/lib/matcha-accordion/accordion.stories.ts +108 -0
  82. package/src/lib/matcha-animations/animations.ts +406 -0
  83. package/src/lib/matcha-autocomplete/README.md +185 -0
  84. package/src/lib/matcha-autocomplete/matcha-autocomplete.component.html +13 -0
  85. package/src/lib/matcha-autocomplete/matcha-autocomplete.component.ts +238 -0
  86. package/src/lib/matcha-autocomplete/matcha-autocomplete.directive.ts +153 -0
  87. package/src/lib/matcha-autocomplete/matcha-autocomplete.module.ts +30 -0
  88. package/src/lib/matcha-autocomplete/matcha-autocomplete.stories.ts +172 -0
  89. package/src/lib/matcha-avatar/avatar/avatar.component.html +29 -0
  90. package/src/lib/matcha-avatar/avatar/avatar.component.scss +0 -0
  91. package/src/lib/matcha-avatar/avatar/avatar.component.ts +78 -0
  92. package/src/lib/matcha-avatar/avatar.module.ts +17 -0
  93. package/src/lib/matcha-badge/badge.argtypes.ts +77 -0
  94. package/src/lib/matcha-badge/badge.directive.ts +12 -0
  95. package/src/lib/matcha-badge/badge.mdx +69 -0
  96. package/src/lib/matcha-badge/badge.module.ts +9 -0
  97. package/src/lib/matcha-badge/badge.stories.ts +79 -0
  98. package/src/lib/matcha-breakpoint-observable/breakpoint-observable.module.ts +23 -0
  99. package/src/lib/matcha-breakpoint-observable/breakpoint-observer.service.ts +215 -0
  100. package/src/lib/matcha-breakpoint-observable/index.ts +2 -0
  101. package/src/lib/matcha-button/button/button.component.html +1 -0
  102. package/src/lib/matcha-button/button/button.component.scss +0 -0
  103. package/src/lib/matcha-button/button/button.component.ts +182 -0
  104. package/src/lib/matcha-button/button.argtypes.ts +105 -0
  105. package/src/lib/matcha-button/button.module.ts +10 -0
  106. package/src/lib/matcha-button/button.stories.ts +552 -0
  107. package/src/lib/matcha-button-toggle/button-toggle/button-toggle.component.html +8 -0
  108. package/src/lib/matcha-button-toggle/button-toggle/button-toggle.component.scss +0 -0
  109. package/src/lib/matcha-button-toggle/button-toggle/button-toggle.component.ts +87 -0
  110. package/src/lib/matcha-button-toggle/button-toggle.module.ts +16 -0
  111. package/src/lib/matcha-button-toggle/button-toggle.stories.ts +106 -0
  112. package/src/lib/matcha-card/card/card.component.html +1 -0
  113. package/src/lib/matcha-card/card/card.component.scss +0 -0
  114. package/src/lib/matcha-card/card/card.component.ts +86 -0
  115. package/src/lib/matcha-card/card-argtype.ts +54 -0
  116. package/src/lib/matcha-card/card.module.ts +22 -0
  117. package/src/lib/matcha-card/card.stories.ts +339 -0
  118. package/src/lib/matcha-checkbox/checkbox/checkbox.component.html +19 -0
  119. package/src/lib/matcha-checkbox/checkbox/checkbox.component.scss +0 -0
  120. package/src/lib/matcha-checkbox/checkbox/checkbox.component.ts +79 -0
  121. package/src/lib/matcha-checkbox/checkbox.module.ts +15 -0
  122. package/src/lib/matcha-checkbox/checkbox.stories.ts +391 -0
  123. package/src/lib/matcha-components.module.ts +149 -0
  124. package/src/lib/matcha-date-range/date-range/date-range.component.html +3 -0
  125. package/src/lib/matcha-date-range/date-range/date-range.component.scss +0 -0
  126. package/src/lib/matcha-date-range/date-range/date-range.component.ts +100 -0
  127. package/src/lib/matcha-date-range/date-range.module.ts +14 -0
  128. package/src/lib/matcha-divider/divider/divider.component.html +1 -0
  129. package/src/lib/matcha-divider/divider/divider.component.scss +0 -0
  130. package/src/lib/matcha-divider/divider/divider.component.ts +50 -0
  131. package/src/lib/matcha-divider/divider.argtypes.ts +57 -0
  132. package/src/lib/matcha-divider/divider.mdx +107 -0
  133. package/src/lib/matcha-divider/divider.module.ts +14 -0
  134. package/src/lib/matcha-divider/divider.stories.ts +44 -0
  135. package/src/lib/matcha-drawer/drawer/drawer.component.html +43 -0
  136. package/src/lib/matcha-drawer/drawer/drawer.component.ts +358 -0
  137. package/src/lib/matcha-drawer/drawer-container/drawer-container.component.html +3 -0
  138. package/src/lib/matcha-drawer/drawer-container/drawer-container.component.ts +36 -0
  139. package/src/lib/matcha-drawer/drawer-content/drawer-content.component.html +3 -0
  140. package/src/lib/matcha-drawer/drawer-content/drawer-content.component.ts +24 -0
  141. package/src/lib/matcha-drawer/drawer.module.ts +28 -0
  142. package/src/lib/matcha-drop-list/directives/drag-handle.directive.ts +22 -0
  143. package/src/lib/matcha-drop-list/directives/drag.directive.ts +369 -0
  144. package/src/lib/matcha-drop-list/drop-list/drop-list.component.html +27 -0
  145. package/src/lib/matcha-drop-list/drop-list/drop-list.component.ts +380 -0
  146. package/src/lib/matcha-drop-list/drop-list-argtype.ts +56 -0
  147. package/src/lib/matcha-drop-list/drop-list.module.ts +27 -0
  148. package/src/lib/matcha-drop-list/drop-list.stories.ts +314 -0
  149. package/src/lib/matcha-drop-list/services/drop-list.service.ts +30 -0
  150. package/src/lib/matcha-elevation/elevation.argtypes.ts +16 -0
  151. package/src/lib/matcha-elevation/elevation.directive.ts +30 -0
  152. package/src/lib/matcha-elevation/elevation.module.ts +10 -0
  153. package/src/lib/matcha-elevation/elevation.stories.ts +60 -0
  154. package/src/lib/matcha-form-field/form-field.argtype.ts +21 -0
  155. package/src/lib/matcha-form-field/form-field.stories.ts +45 -0
  156. package/src/lib/matcha-form-field/matcha-error/matcha-error.component.html +4 -0
  157. package/src/lib/matcha-form-field/matcha-error/matcha-error.component.scss +0 -0
  158. package/src/lib/matcha-form-field/matcha-error/matcha-error.component.ts +9 -0
  159. package/src/lib/matcha-form-field/matcha-form-field/matcha-form-field.component.html +19 -0
  160. package/src/lib/matcha-form-field/matcha-form-field/matcha-form-field.component.scss +0 -0
  161. package/src/lib/matcha-form-field/matcha-form-field/matcha-form-field.component.ts +30 -0
  162. package/src/lib/matcha-form-field/matcha-form-field.module.ts +13 -0
  163. package/src/lib/matcha-form-field/matcha-label/matcha-label.component.html +7 -0
  164. package/src/lib/matcha-form-field/matcha-label/matcha-label.component.scss +0 -0
  165. package/src/lib/matcha-form-field/matcha-label/matcha-label.component.ts +11 -0
  166. package/src/lib/matcha-grid/grid-argtype.ts +67 -0
  167. package/src/lib/matcha-grid/grid.component.html +3 -0
  168. package/src/lib/matcha-grid/grid.component.scss +0 -0
  169. package/src/lib/matcha-grid/grid.component.ts +114 -0
  170. package/src/lib/matcha-grid/grid.mdx +60 -0
  171. package/src/lib/matcha-grid/grid.module.ts +10 -0
  172. package/src/lib/matcha-grid/grid.stories.ts +125 -0
  173. package/src/lib/matcha-highlight/copy-button/copy-button.component.html +12 -0
  174. package/src/lib/matcha-highlight/copy-button/copy-button.component.scss +28 -0
  175. package/src/lib/matcha-highlight/copy-button/copy-button.component.ts +127 -0
  176. package/src/lib/matcha-highlight/highlight.component.ts +237 -0
  177. package/src/lib/matcha-highlight/highlight.module.ts +24 -0
  178. package/src/lib/matcha-highlight/prism-init.ts +11 -0
  179. package/src/lib/matcha-highlight/prism-languages.ts +5 -0
  180. package/src/lib/matcha-highlight/prismjs/components/index.js +82 -0
  181. package/src/lib/matcha-highlight/prismjs/components/prism-abap.js +48 -0
  182. package/src/lib/matcha-highlight/prismjs/components/prism-abap.min.js +1 -0
  183. package/src/lib/matcha-highlight/prismjs/components/prism-abnf.js +54 -0
  184. package/src/lib/matcha-highlight/prismjs/components/prism-abnf.min.js +1 -0
  185. package/src/lib/matcha-highlight/prismjs/components/prism-actionscript.js +17 -0
  186. package/src/lib/matcha-highlight/prismjs/components/prism-actionscript.min.js +1 -0
  187. package/src/lib/matcha-highlight/prismjs/components/prism-ada.js +19 -0
  188. package/src/lib/matcha-highlight/prismjs/components/prism-ada.min.js +1 -0
  189. package/src/lib/matcha-highlight/prismjs/components/prism-apacheconf.js +47 -0
  190. package/src/lib/matcha-highlight/prismjs/components/prism-apacheconf.min.js +1 -0
  191. package/src/lib/matcha-highlight/prismjs/components/prism-apl.js +32 -0
  192. package/src/lib/matcha-highlight/prismjs/components/prism-apl.min.js +1 -0
  193. package/src/lib/matcha-highlight/prismjs/components/prism-applescript.js +20 -0
  194. package/src/lib/matcha-highlight/prismjs/components/prism-applescript.min.js +1 -0
  195. package/src/lib/matcha-highlight/prismjs/components/prism-arduino.js +5 -0
  196. package/src/lib/matcha-highlight/prismjs/components/prism-arduino.min.js +1 -0
  197. package/src/lib/matcha-highlight/prismjs/components/prism-arff.js +10 -0
  198. package/src/lib/matcha-highlight/prismjs/components/prism-arff.min.js +1 -0
  199. package/src/lib/matcha-highlight/prismjs/components/prism-asciidoc.js +234 -0
  200. package/src/lib/matcha-highlight/prismjs/components/prism-asciidoc.min.js +1 -0
  201. package/src/lib/matcha-highlight/prismjs/components/prism-asm6502.js +28 -0
  202. package/src/lib/matcha-highlight/prismjs/components/prism-asm6502.min.js +1 -0
  203. package/src/lib/matcha-highlight/prismjs/components/prism-aspnet.js +36 -0
  204. package/src/lib/matcha-highlight/prismjs/components/prism-aspnet.min.js +1 -0
  205. package/src/lib/matcha-highlight/prismjs/components/prism-autohotkey.js +27 -0
  206. package/src/lib/matcha-highlight/prismjs/components/prism-autohotkey.min.js +1 -0
  207. package/src/lib/matcha-highlight/prismjs/components/prism-autoit.js +34 -0
  208. package/src/lib/matcha-highlight/prismjs/components/prism-autoit.min.js +1 -0
  209. package/src/lib/matcha-highlight/prismjs/components/prism-basic.js +17 -0
  210. package/src/lib/matcha-highlight/prismjs/components/prism-basic.min.js +1 -0
  211. package/src/lib/matcha-highlight/prismjs/components/prism-batch.js +99 -0
  212. package/src/lib/matcha-highlight/prismjs/components/prism-batch.min.js +1 -0
  213. package/src/lib/matcha-highlight/prismjs/components/prism-bison.js +39 -0
  214. package/src/lib/matcha-highlight/prismjs/components/prism-bison.min.js +1 -0
  215. package/src/lib/matcha-highlight/prismjs/components/prism-bnf.js +21 -0
  216. package/src/lib/matcha-highlight/prismjs/components/prism-bnf.min.js +1 -0
  217. package/src/lib/matcha-highlight/prismjs/components/prism-brainfuck.js +20 -0
  218. package/src/lib/matcha-highlight/prismjs/components/prism-brainfuck.min.js +1 -0
  219. package/src/lib/matcha-highlight/prismjs/components/prism-bro.js +48 -0
  220. package/src/lib/matcha-highlight/prismjs/components/prism-bro.min.js +1 -0
  221. package/src/lib/matcha-highlight/prismjs/components/prism-cil.js +27 -0
  222. package/src/lib/matcha-highlight/prismjs/components/prism-cil.min.js +1 -0
  223. package/src/lib/matcha-highlight/prismjs/components/prism-clike.js +30 -0
  224. package/src/lib/matcha-highlight/prismjs/components/prism-clike.min.js +1 -0
  225. package/src/lib/matcha-highlight/prismjs/components/prism-clojure.js +13 -0
  226. package/src/lib/matcha-highlight/prismjs/components/prism-clojure.min.js +1 -0
  227. package/src/lib/matcha-highlight/prismjs/components/prism-cmake.js +29 -0
  228. package/src/lib/matcha-highlight/prismjs/components/prism-cmake.min.js +1 -0
  229. package/src/lib/matcha-highlight/prismjs/components/prism-coffeescript.js +92 -0
  230. package/src/lib/matcha-highlight/prismjs/components/prism-coffeescript.min.js +1 -0
  231. package/src/lib/matcha-highlight/prismjs/components/prism-core.js +553 -0
  232. package/src/lib/matcha-highlight/prismjs/components/prism-core.min.js +1 -0
  233. package/src/lib/matcha-highlight/prismjs/components/prism-crystal.js +51 -0
  234. package/src/lib/matcha-highlight/prismjs/components/prism-crystal.min.js +1 -0
  235. package/src/lib/matcha-highlight/prismjs/components/prism-csp.js +25 -0
  236. package/src/lib/matcha-highlight/prismjs/components/prism-csp.min.js +1 -0
  237. package/src/lib/matcha-highlight/prismjs/components/prism-css-extras.js +70 -0
  238. package/src/lib/matcha-highlight/prismjs/components/prism-css-extras.min.js +1 -0
  239. package/src/lib/matcha-highlight/prismjs/components/prism-css.js +51 -0
  240. package/src/lib/matcha-highlight/prismjs/components/prism-css.min.js +1 -0
  241. package/src/lib/matcha-highlight/prismjs/components/prism-d.js +64 -0
  242. package/src/lib/matcha-highlight/prismjs/components/prism-d.min.js +1 -0
  243. package/src/lib/matcha-highlight/prismjs/components/prism-dart.js +24 -0
  244. package/src/lib/matcha-highlight/prismjs/components/prism-dart.min.js +1 -0
  245. package/src/lib/matcha-highlight/prismjs/components/prism-django.js +60 -0
  246. package/src/lib/matcha-highlight/prismjs/components/prism-django.min.js +1 -0
  247. package/src/lib/matcha-highlight/prismjs/components/prism-docker.js +11 -0
  248. package/src/lib/matcha-highlight/prismjs/components/prism-docker.min.js +1 -0
  249. package/src/lib/matcha-highlight/prismjs/components/prism-ebnf.js +22 -0
  250. package/src/lib/matcha-highlight/prismjs/components/prism-ebnf.min.js +1 -0
  251. package/src/lib/matcha-highlight/prismjs/components/prism-eiffel.js +37 -0
  252. package/src/lib/matcha-highlight/prismjs/components/prism-eiffel.min.js +1 -0
  253. package/src/lib/matcha-highlight/prismjs/components/prism-ejs.js +24 -0
  254. package/src/lib/matcha-highlight/prismjs/components/prism-ejs.min.js +1 -0
  255. package/src/lib/matcha-highlight/prismjs/components/prism-elixir.js +93 -0
  256. package/src/lib/matcha-highlight/prismjs/components/prism-elixir.min.js +1 -0
  257. package/src/lib/matcha-highlight/prismjs/components/prism-elm.js +44 -0
  258. package/src/lib/matcha-highlight/prismjs/components/prism-elm.min.js +1 -0
  259. package/src/lib/matcha-highlight/prismjs/components/prism-erb.js +20 -0
  260. package/src/lib/matcha-highlight/prismjs/components/prism-erb.min.js +1 -0
  261. package/src/lib/matcha-highlight/prismjs/components/prism-erlang.js +44 -0
  262. package/src/lib/matcha-highlight/prismjs/components/prism-erlang.min.js +1 -0
  263. package/src/lib/matcha-highlight/prismjs/components/prism-flow.js +35 -0
  264. package/src/lib/matcha-highlight/prismjs/components/prism-flow.min.js +1 -0
  265. package/src/lib/matcha-highlight/prismjs/components/prism-fortran.js +40 -0
  266. package/src/lib/matcha-highlight/prismjs/components/prism-fortran.min.js +1 -0
  267. package/src/lib/matcha-highlight/prismjs/components/prism-fsharp.js +67 -0
  268. package/src/lib/matcha-highlight/prismjs/components/prism-fsharp.min.js +1 -0
  269. package/src/lib/matcha-highlight/prismjs/components/prism-gcode.js +15 -0
  270. package/src/lib/matcha-highlight/prismjs/components/prism-gcode.min.js +1 -0
  271. package/src/lib/matcha-highlight/prismjs/components/prism-gedcom.js +28 -0
  272. package/src/lib/matcha-highlight/prismjs/components/prism-gedcom.min.js +1 -0
  273. package/src/lib/matcha-highlight/prismjs/components/prism-gherkin.js +79 -0
  274. package/src/lib/matcha-highlight/prismjs/components/prism-gherkin.min.js +1 -0
  275. package/src/lib/matcha-highlight/prismjs/components/prism-git.js +68 -0
  276. package/src/lib/matcha-highlight/prismjs/components/prism-git.min.js +1 -0
  277. package/src/lib/matcha-highlight/prismjs/components/prism-glsl.js +16 -0
  278. package/src/lib/matcha-highlight/prismjs/components/prism-glsl.min.js +1 -0
  279. package/src/lib/matcha-highlight/prismjs/components/prism-gml.js +7 -0
  280. package/src/lib/matcha-highlight/prismjs/components/prism-gml.min.js +1 -0
  281. package/src/lib/matcha-highlight/prismjs/components/prism-go.js +12 -0
  282. package/src/lib/matcha-highlight/prismjs/components/prism-go.min.js +1 -0
  283. package/src/lib/matcha-highlight/prismjs/components/prism-graphql.js +31 -0
  284. package/src/lib/matcha-highlight/prismjs/components/prism-graphql.min.js +1 -0
  285. package/src/lib/matcha-highlight/prismjs/components/prism-groovy.js +65 -0
  286. package/src/lib/matcha-highlight/prismjs/components/prism-groovy.min.js +1 -0
  287. package/src/lib/matcha-highlight/prismjs/components/prism-haml.js +154 -0
  288. package/src/lib/matcha-highlight/prismjs/components/prism-haml.min.js +1 -0
  289. package/src/lib/matcha-highlight/prismjs/components/prism-handlebars.js +37 -0
  290. package/src/lib/matcha-highlight/prismjs/components/prism-handlebars.min.js +1 -0
  291. package/src/lib/matcha-highlight/prismjs/components/prism-haskell.js +38 -0
  292. package/src/lib/matcha-highlight/prismjs/components/prism-haskell.min.js +1 -0
  293. package/src/lib/matcha-highlight/prismjs/components/prism-haxe.js +45 -0
  294. package/src/lib/matcha-highlight/prismjs/components/prism-haxe.min.js +1 -0
  295. package/src/lib/matcha-highlight/prismjs/components/prism-hcl.js +65 -0
  296. package/src/lib/matcha-highlight/prismjs/components/prism-hcl.min.js +1 -0
  297. package/src/lib/matcha-highlight/prismjs/components/prism-hpkp.js +20 -0
  298. package/src/lib/matcha-highlight/prismjs/components/prism-hpkp.min.js +1 -0
  299. package/src/lib/matcha-highlight/prismjs/components/prism-hsts.js +20 -0
  300. package/src/lib/matcha-highlight/prismjs/components/prism-hsts.min.js +1 -0
  301. package/src/lib/matcha-highlight/prismjs/components/prism-http.js +79 -0
  302. package/src/lib/matcha-highlight/prismjs/components/prism-http.min.js +1 -0
  303. package/src/lib/matcha-highlight/prismjs/components/prism-ichigojam.js +15 -0
  304. package/src/lib/matcha-highlight/prismjs/components/prism-ichigojam.min.js +1 -0
  305. package/src/lib/matcha-highlight/prismjs/components/prism-icon.js +20 -0
  306. package/src/lib/matcha-highlight/prismjs/components/prism-icon.min.js +1 -0
  307. package/src/lib/matcha-highlight/prismjs/components/prism-inform7.js +61 -0
  308. package/src/lib/matcha-highlight/prismjs/components/prism-inform7.min.js +1 -0
  309. package/src/lib/matcha-highlight/prismjs/components/prism-ini.js +11 -0
  310. package/src/lib/matcha-highlight/prismjs/components/prism-ini.min.js +1 -0
  311. package/src/lib/matcha-highlight/prismjs/components/prism-io.js +31 -0
  312. package/src/lib/matcha-highlight/prismjs/components/prism-io.min.js +1 -0
  313. package/src/lib/matcha-highlight/prismjs/components/prism-j.js +25 -0
  314. package/src/lib/matcha-highlight/prismjs/components/prism-j.min.js +1 -0
  315. package/src/lib/matcha-highlight/prismjs/components/prism-javadoc.js +54 -0
  316. package/src/lib/matcha-highlight/prismjs/components/prism-javadoc.min.js +1 -0
  317. package/src/lib/matcha-highlight/prismjs/components/prism-javadoclike.js +86 -0
  318. package/src/lib/matcha-highlight/prismjs/components/prism-javadoclike.min.js +1 -0
  319. package/src/lib/matcha-highlight/prismjs/components/prism-javascript.js +86 -0
  320. package/src/lib/matcha-highlight/prismjs/components/prism-javascript.min.js +1 -0
  321. package/src/lib/matcha-highlight/prismjs/components/prism-javastacktrace.js +93 -0
  322. package/src/lib/matcha-highlight/prismjs/components/prism-javastacktrace.min.js +1 -0
  323. package/src/lib/matcha-highlight/prismjs/components/prism-jolie.js +55 -0
  324. package/src/lib/matcha-highlight/prismjs/components/prism-jolie.min.js +1 -0
  325. package/src/lib/matcha-highlight/prismjs/components/prism-js-extras.js +104 -0
  326. package/src/lib/matcha-highlight/prismjs/components/prism-js-extras.min.js +1 -0
  327. package/src/lib/matcha-highlight/prismjs/components/prism-jsdoc.js +73 -0
  328. package/src/lib/matcha-highlight/prismjs/components/prism-jsdoc.min.js +1 -0
  329. package/src/lib/matcha-highlight/prismjs/components/prism-json5.js +23 -0
  330. package/src/lib/matcha-highlight/prismjs/components/prism-json5.min.js +1 -0
  331. package/src/lib/matcha-highlight/prismjs/components/prism-jsonp.js +7 -0
  332. package/src/lib/matcha-highlight/prismjs/components/prism-jsonp.min.js +1 -0
  333. package/src/lib/matcha-highlight/prismjs/components/prism-jsx.js +126 -0
  334. package/src/lib/matcha-highlight/prismjs/components/prism-jsx.min.js +1 -0
  335. package/src/lib/matcha-highlight/prismjs/components/prism-julia.js +12 -0
  336. package/src/lib/matcha-highlight/prismjs/components/prism-julia.min.js +1 -0
  337. package/src/lib/matcha-highlight/prismjs/components/prism-keyman.js +14 -0
  338. package/src/lib/matcha-highlight/prismjs/components/prism-keyman.min.js +1 -0
  339. package/src/lib/matcha-highlight/prismjs/components/prism-kotlin.js +62 -0
  340. package/src/lib/matcha-highlight/prismjs/components/prism-kotlin.min.js +1 -0
  341. package/src/lib/matcha-highlight/prismjs/components/prism-latex.js +61 -0
  342. package/src/lib/matcha-highlight/prismjs/components/prism-latex.min.js +1 -0
  343. package/src/lib/matcha-highlight/prismjs/components/prism-less.js +54 -0
  344. package/src/lib/matcha-highlight/prismjs/components/prism-less.min.js +1 -0
  345. package/src/lib/matcha-highlight/prismjs/components/prism-liquid.js +12 -0
  346. package/src/lib/matcha-highlight/prismjs/components/prism-liquid.min.js +1 -0
  347. package/src/lib/matcha-highlight/prismjs/components/prism-lisp.js +197 -0
  348. package/src/lib/matcha-highlight/prismjs/components/prism-lisp.min.js +1 -0
  349. package/src/lib/matcha-highlight/prismjs/components/prism-livescript.js +119 -0
  350. package/src/lib/matcha-highlight/prismjs/components/prism-livescript.min.js +1 -0
  351. package/src/lib/matcha-highlight/prismjs/components/prism-lolcode.js +55 -0
  352. package/src/lib/matcha-highlight/prismjs/components/prism-lolcode.min.js +1 -0
  353. package/src/lib/matcha-highlight/prismjs/components/prism-lua.js +20 -0
  354. package/src/lib/matcha-highlight/prismjs/components/prism-lua.min.js +1 -0
  355. package/src/lib/matcha-highlight/prismjs/components/prism-makefile.js +34 -0
  356. package/src/lib/matcha-highlight/prismjs/components/prism-makefile.min.js +1 -0
  357. package/src/lib/matcha-highlight/prismjs/components/prism-markdown.js +227 -0
  358. package/src/lib/matcha-highlight/prismjs/components/prism-markdown.min.js +1 -0
  359. package/src/lib/matcha-highlight/prismjs/components/prism-markup-templating.js +123 -0
  360. package/src/lib/matcha-highlight/prismjs/components/prism-markup-templating.min.js +1 -0
  361. package/src/lib/matcha-highlight/prismjs/components/prism-markup.js +100 -0
  362. package/src/lib/matcha-highlight/prismjs/components/prism-markup.min.js +1 -0
  363. package/src/lib/matcha-highlight/prismjs/components/prism-matlab.js +16 -0
  364. package/src/lib/matcha-highlight/prismjs/components/prism-matlab.min.js +1 -0
  365. package/src/lib/matcha-highlight/prismjs/components/prism-mel.js +43 -0
  366. package/src/lib/matcha-highlight/prismjs/components/prism-mel.min.js +1 -0
  367. package/src/lib/matcha-highlight/prismjs/components/prism-mizar.js +12 -0
  368. package/src/lib/matcha-highlight/prismjs/components/prism-mizar.min.js +1 -0
  369. package/src/lib/matcha-highlight/prismjs/components/prism-monkey.js +31 -0
  370. package/src/lib/matcha-highlight/prismjs/components/prism-monkey.min.js +1 -0
  371. package/src/lib/matcha-highlight/prismjs/components/prism-n1ql.js +18 -0
  372. package/src/lib/matcha-highlight/prismjs/components/prism-n1ql.min.js +1 -0
  373. package/src/lib/matcha-highlight/prismjs/components/prism-n4js.js +14 -0
  374. package/src/lib/matcha-highlight/prismjs/components/prism-n4js.min.js +1 -0
  375. package/src/lib/matcha-highlight/prismjs/components/prism-nand2tetris-hdl.js +9 -0
  376. package/src/lib/matcha-highlight/prismjs/components/prism-nand2tetris-hdl.min.js +1 -0
  377. package/src/lib/matcha-highlight/prismjs/components/prism-nasm.js +24 -0
  378. package/src/lib/matcha-highlight/prismjs/components/prism-nasm.min.js +1 -0
  379. package/src/lib/matcha-highlight/prismjs/components/prism-nginx.js +11 -0
  380. package/src/lib/matcha-highlight/prismjs/components/prism-nginx.min.js +1 -0
  381. package/src/lib/matcha-highlight/prismjs/components/prism-nim.js +33 -0
  382. package/src/lib/matcha-highlight/prismjs/components/prism-nim.min.js +1 -0
  383. package/src/lib/matcha-highlight/prismjs/components/prism-nix.js +40 -0
  384. package/src/lib/matcha-highlight/prismjs/components/prism-nix.min.js +1 -0
  385. package/src/lib/matcha-highlight/prismjs/components/prism-nsis.js +29 -0
  386. package/src/lib/matcha-highlight/prismjs/components/prism-nsis.min.js +1 -0
  387. package/src/lib/matcha-highlight/prismjs/components/prism-objectivec.js +7 -0
  388. package/src/lib/matcha-highlight/prismjs/components/prism-objectivec.min.js +1 -0
  389. package/src/lib/matcha-highlight/prismjs/components/prism-ocaml.js +27 -0
  390. package/src/lib/matcha-highlight/prismjs/components/prism-ocaml.min.js +1 -0
  391. package/src/lib/matcha-highlight/prismjs/components/prism-opencl.js +49 -0
  392. package/src/lib/matcha-highlight/prismjs/components/prism-opencl.min.js +1 -0
  393. package/src/lib/matcha-highlight/prismjs/components/prism-oz.js +25 -0
  394. package/src/lib/matcha-highlight/prismjs/components/prism-oz.min.js +1 -0
  395. package/src/lib/matcha-highlight/prismjs/components/prism-parigp.js +30 -0
  396. package/src/lib/matcha-highlight/prismjs/components/prism-parigp.min.js +1 -0
  397. package/src/lib/matcha-highlight/prismjs/components/prism-parser.js +73 -0
  398. package/src/lib/matcha-highlight/prismjs/components/prism-parser.min.js +1 -0
  399. package/src/lib/matcha-highlight/prismjs/components/prism-pascal.js +55 -0
  400. package/src/lib/matcha-highlight/prismjs/components/prism-pascal.min.js +1 -0
  401. package/src/lib/matcha-highlight/prismjs/components/prism-php-extras.js +11 -0
  402. package/src/lib/matcha-highlight/prismjs/components/prism-php-extras.min.js +1 -0
  403. package/src/lib/matcha-highlight/prismjs/components/prism-phpdoc.js +27 -0
  404. package/src/lib/matcha-highlight/prismjs/components/prism-phpdoc.min.js +1 -0
  405. package/src/lib/matcha-highlight/prismjs/components/prism-plsql.js +26 -0
  406. package/src/lib/matcha-highlight/prismjs/components/prism-plsql.min.js +1 -0
  407. package/src/lib/matcha-highlight/prismjs/components/prism-powershell.js +60 -0
  408. package/src/lib/matcha-highlight/prismjs/components/prism-powershell.min.js +1 -0
  409. package/src/lib/matcha-highlight/prismjs/components/prism-processing.js +18 -0
  410. package/src/lib/matcha-highlight/prismjs/components/prism-processing.min.js +1 -0
  411. package/src/lib/matcha-highlight/prismjs/components/prism-prolog.js +20 -0
  412. package/src/lib/matcha-highlight/prismjs/components/prism-prolog.min.js +1 -0
  413. package/src/lib/matcha-highlight/prismjs/components/prism-properties.js +9 -0
  414. package/src/lib/matcha-highlight/prismjs/components/prism-properties.min.js +1 -0
  415. package/src/lib/matcha-highlight/prismjs/components/prism-protobuf.js +8 -0
  416. package/src/lib/matcha-highlight/prismjs/components/prism-protobuf.min.js +1 -0
  417. package/src/lib/matcha-highlight/prismjs/components/prism-pug.js +193 -0
  418. package/src/lib/matcha-highlight/prismjs/components/prism-pug.min.js +1 -0
  419. package/src/lib/matcha-highlight/prismjs/components/prism-puppet.js +136 -0
  420. package/src/lib/matcha-highlight/prismjs/components/prism-puppet.min.js +1 -0
  421. package/src/lib/matcha-highlight/prismjs/components/prism-pure.js +79 -0
  422. package/src/lib/matcha-highlight/prismjs/components/prism-pure.min.js +1 -0
  423. package/src/lib/matcha-highlight/prismjs/components/prism-q.js +51 -0
  424. package/src/lib/matcha-highlight/prismjs/components/prism-q.min.js +1 -0
  425. package/src/lib/matcha-highlight/prismjs/components/prism-qore.js +20 -0
  426. package/src/lib/matcha-highlight/prismjs/components/prism-qore.min.js +1 -0
  427. package/src/lib/matcha-highlight/prismjs/components/prism-r.js +22 -0
  428. package/src/lib/matcha-highlight/prismjs/components/prism-r.min.js +1 -0
  429. package/src/lib/matcha-highlight/prismjs/components/prism-reason.js +32 -0
  430. package/src/lib/matcha-highlight/prismjs/components/prism-reason.min.js +1 -0
  431. package/src/lib/matcha-highlight/prismjs/components/prism-regex.js +97 -0
  432. package/src/lib/matcha-highlight/prismjs/components/prism-regex.min.js +1 -0
  433. package/src/lib/matcha-highlight/prismjs/components/prism-renpy.js +29 -0
  434. package/src/lib/matcha-highlight/prismjs/components/prism-renpy.min.js +1 -0
  435. package/src/lib/matcha-highlight/prismjs/components/prism-rest.js +205 -0
  436. package/src/lib/matcha-highlight/prismjs/components/prism-rest.min.js +1 -0
  437. package/src/lib/matcha-highlight/prismjs/components/prism-rip.js +32 -0
  438. package/src/lib/matcha-highlight/prismjs/components/prism-rip.min.js +1 -0
  439. package/src/lib/matcha-highlight/prismjs/components/prism-roboconf.js +27 -0
  440. package/src/lib/matcha-highlight/prismjs/components/prism-roboconf.min.js +1 -0
  441. package/src/lib/matcha-highlight/prismjs/components/prism-ruby.js +143 -0
  442. package/src/lib/matcha-highlight/prismjs/components/prism-ruby.min.js +1 -0
  443. package/src/lib/matcha-highlight/prismjs/components/prism-rust.js +68 -0
  444. package/src/lib/matcha-highlight/prismjs/components/prism-rust.min.js +1 -0
  445. package/src/lib/matcha-highlight/prismjs/components/prism-sas.js +34 -0
  446. package/src/lib/matcha-highlight/prismjs/components/prism-sas.min.js +1 -0
  447. package/src/lib/matcha-highlight/prismjs/components/prism-scala.js +18 -0
  448. package/src/lib/matcha-highlight/prismjs/components/prism-scala.min.js +1 -0
  449. package/src/lib/matcha-highlight/prismjs/components/prism-scheme.js +33 -0
  450. package/src/lib/matcha-highlight/prismjs/components/prism-scheme.min.js +1 -0
  451. package/src/lib/matcha-highlight/prismjs/components/prism-smalltalk.js +31 -0
  452. package/src/lib/matcha-highlight/prismjs/components/prism-smalltalk.min.js +1 -0
  453. package/src/lib/matcha-highlight/prismjs/components/prism-smarty.js +87 -0
  454. package/src/lib/matcha-highlight/prismjs/components/prism-smarty.min.js +1 -0
  455. package/src/lib/matcha-highlight/prismjs/components/prism-soy.js +96 -0
  456. package/src/lib/matcha-highlight/prismjs/components/prism-soy.min.js +1 -0
  457. package/src/lib/matcha-highlight/prismjs/components/prism-sql.js +24 -0
  458. package/src/lib/matcha-highlight/prismjs/components/prism-sql.min.js +1 -0
  459. package/src/lib/matcha-highlight/prismjs/components/prism-stylus.js +111 -0
  460. package/src/lib/matcha-highlight/prismjs/components/prism-stylus.min.js +1 -0
  461. package/src/lib/matcha-highlight/prismjs/components/prism-swift.js +25 -0
  462. package/src/lib/matcha-highlight/prismjs/components/prism-swift.min.js +1 -0
  463. package/src/lib/matcha-highlight/prismjs/components/prism-t4-cs.js +1 -0
  464. package/src/lib/matcha-highlight/prismjs/components/prism-t4-cs.min.js +1 -0
  465. package/src/lib/matcha-highlight/prismjs/components/prism-t4-templating.js +49 -0
  466. package/src/lib/matcha-highlight/prismjs/components/prism-t4-templating.min.js +1 -0
  467. package/src/lib/matcha-highlight/prismjs/components/prism-t4-vb.js +1 -0
  468. package/src/lib/matcha-highlight/prismjs/components/prism-t4-vb.min.js +1 -0
  469. package/src/lib/matcha-highlight/prismjs/components/prism-tap.js +20 -0
  470. package/src/lib/matcha-highlight/prismjs/components/prism-tap.min.js +1 -0
  471. package/src/lib/matcha-highlight/prismjs/components/prism-tcl.js +46 -0
  472. package/src/lib/matcha-highlight/prismjs/components/prism-tcl.min.js +1 -0
  473. package/src/lib/matcha-highlight/prismjs/components/prism-textile.js +260 -0
  474. package/src/lib/matcha-highlight/prismjs/components/prism-textile.min.js +1 -0
  475. package/src/lib/matcha-highlight/prismjs/components/prism-toml.js +43 -0
  476. package/src/lib/matcha-highlight/prismjs/components/prism-toml.min.js +1 -0
  477. package/src/lib/matcha-highlight/prismjs/components/prism-tsx.js +2 -0
  478. package/src/lib/matcha-highlight/prismjs/components/prism-tsx.min.js +1 -0
  479. package/src/lib/matcha-highlight/prismjs/components/prism-tt2.js +56 -0
  480. package/src/lib/matcha-highlight/prismjs/components/prism-tt2.min.js +1 -0
  481. package/src/lib/matcha-highlight/prismjs/components/prism-twig.js +46 -0
  482. package/src/lib/matcha-highlight/prismjs/components/prism-twig.min.js +1 -0
  483. package/src/lib/matcha-highlight/prismjs/components/prism-vala.js +74 -0
  484. package/src/lib/matcha-highlight/prismjs/components/prism-vala.min.js +1 -0
  485. package/src/lib/matcha-highlight/prismjs/components/prism-vbnet.js +15 -0
  486. package/src/lib/matcha-highlight/prismjs/components/prism-vbnet.min.js +1 -0
  487. package/src/lib/matcha-highlight/prismjs/components/prism-velocity.js +72 -0
  488. package/src/lib/matcha-highlight/prismjs/components/prism-velocity.min.js +1 -0
  489. package/src/lib/matcha-highlight/prismjs/components/prism-verilog.js +20 -0
  490. package/src/lib/matcha-highlight/prismjs/components/prism-verilog.min.js +1 -0
  491. package/src/lib/matcha-highlight/prismjs/components/prism-vhdl.js +23 -0
  492. package/src/lib/matcha-highlight/prismjs/components/prism-vhdl.min.js +1 -0
  493. package/src/lib/matcha-highlight/prismjs/components/prism-vim.js +10 -0
  494. package/src/lib/matcha-highlight/prismjs/components/prism-vim.min.js +1 -0
  495. package/src/lib/matcha-highlight/prismjs/components/prism-visual-basic.js +34 -0
  496. package/src/lib/matcha-highlight/prismjs/components/prism-visual-basic.min.js +1 -0
  497. package/src/lib/matcha-highlight/prismjs/components/prism-wasm.js +31 -0
  498. package/src/lib/matcha-highlight/prismjs/components/prism-wasm.min.js +1 -0
  499. package/src/lib/matcha-highlight/prismjs/components/prism-wiki.js +81 -0
  500. package/src/lib/matcha-highlight/prismjs/components/prism-wiki.min.js +1 -0
  501. package/src/lib/matcha-highlight/prismjs/components/prism-xeora.js +114 -0
  502. package/src/lib/matcha-highlight/prismjs/components/prism-xeora.min.js +1 -0
  503. package/src/lib/matcha-highlight/prismjs/components/prism-xojo.js +20 -0
  504. package/src/lib/matcha-highlight/prismjs/components/prism-xojo.min.js +1 -0
  505. package/src/lib/matcha-highlight/prismjs/components/prism-xquery.js +164 -0
  506. package/src/lib/matcha-highlight/prismjs/components/prism-xquery.min.js +1 -0
  507. package/src/lib/matcha-highlight/prismjs/components/prism-yaml.js +47 -0
  508. package/src/lib/matcha-highlight/prismjs/components/prism-yaml.min.js +1 -0
  509. package/src/lib/matcha-highlight/prismjs/components.js +2 -0
  510. package/src/lib/matcha-highlight/prismjs/components.json +1031 -0
  511. package/src/lib/matcha-highlight/prismjs/plugins/autolinker/prism-autolinker.css +3 -0
  512. package/src/lib/matcha-highlight/prismjs/plugins/autolinker/prism-autolinker.js +81 -0
  513. package/src/lib/matcha-highlight/prismjs/plugins/autolinker/prism-autolinker.min.js +1 -0
  514. package/src/lib/matcha-highlight/prismjs/plugins/autoloader/prism-autoloader.js +214 -0
  515. package/src/lib/matcha-highlight/prismjs/plugins/autoloader/prism-autoloader.min.js +1 -0
  516. package/src/lib/matcha-highlight/prismjs/plugins/command-line/prism-command-line.css +33 -0
  517. package/src/lib/matcha-highlight/prismjs/plugins/command-line/prism-command-line.js +139 -0
  518. package/src/lib/matcha-highlight/prismjs/plugins/command-line/prism-command-line.min.js +1 -0
  519. package/src/lib/matcha-highlight/prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard.js +75 -0
  520. package/src/lib/matcha-highlight/prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js +1 -0
  521. package/src/lib/matcha-highlight/prismjs/plugins/custom-class/prism-custom-class.js +31 -0
  522. package/src/lib/matcha-highlight/prismjs/plugins/custom-class/prism-custom-class.min.js +1 -0
  523. package/src/lib/matcha-highlight/prismjs/plugins/data-uri-highlight/prism-data-uri-highlight.js +98 -0
  524. package/src/lib/matcha-highlight/prismjs/plugins/data-uri-highlight/prism-data-uri-highlight.min.js +1 -0
  525. package/src/lib/matcha-highlight/prismjs/plugins/file-highlight/prism-file-highlight.js +105 -0
  526. package/src/lib/matcha-highlight/prismjs/plugins/file-highlight/prism-file-highlight.min.js +1 -0
  527. package/src/lib/matcha-highlight/prismjs/plugins/highlight-keywords/prism-highlight-keywords.js +17 -0
  528. package/src/lib/matcha-highlight/prismjs/plugins/highlight-keywords/prism-highlight-keywords.min.js +1 -0
  529. package/src/lib/matcha-highlight/prismjs/plugins/jsonp-highlight/prism-jsonp-highlight.js +206 -0
  530. package/src/lib/matcha-highlight/prismjs/plugins/jsonp-highlight/prism-jsonp-highlight.min.js +1 -0
  531. package/src/lib/matcha-highlight/prismjs/plugins/keep-markup/prism-keep-markup.js +99 -0
  532. package/src/lib/matcha-highlight/prismjs/plugins/keep-markup/prism-keep-markup.min.js +1 -0
  533. package/src/lib/matcha-highlight/prismjs/plugins/line-highlight/prism-line-highlight.css +49 -0
  534. package/src/lib/matcha-highlight/prismjs/plugins/line-highlight/prism-line-highlight.js +181 -0
  535. package/src/lib/matcha-highlight/prismjs/plugins/line-highlight/prism-line-highlight.min.js +1 -0
  536. package/src/lib/matcha-highlight/prismjs/plugins/line-numbers/prism-line-numbers.css +41 -0
  537. package/src/lib/matcha-highlight/prismjs/plugins/line-numbers/prism-line-numbers.js +168 -0
  538. package/src/lib/matcha-highlight/prismjs/plugins/line-numbers/prism-line-numbers.min.js +1 -0
  539. package/src/lib/matcha-highlight/prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.js +190 -0
  540. package/src/lib/matcha-highlight/prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.min.js +1 -0
  541. package/src/lib/matcha-highlight/prismjs/plugins/previewers/prism-previewers.css +242 -0
  542. package/src/lib/matcha-highlight/prismjs/plugins/previewers/prism-previewers.js +708 -0
  543. package/src/lib/matcha-highlight/prismjs/plugins/previewers/prism-previewers.min.js +1 -0
  544. package/src/lib/matcha-highlight/prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js +21 -0
  545. package/src/lib/matcha-highlight/prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.min.js +1 -0
  546. package/src/lib/matcha-highlight/prismjs/plugins/show-invisibles/prism-show-invisibles.css +34 -0
  547. package/src/lib/matcha-highlight/prismjs/plugins/show-invisibles/prism-show-invisibles.js +84 -0
  548. package/src/lib/matcha-highlight/prismjs/plugins/show-invisibles/prism-show-invisibles.min.js +1 -0
  549. package/src/lib/matcha-highlight/prismjs/plugins/show-language/prism-show-language.js +46 -0
  550. package/src/lib/matcha-highlight/prismjs/plugins/show-language/prism-show-language.min.js +1 -0
  551. package/src/lib/matcha-highlight/prismjs/plugins/toolbar/prism-toolbar.css +58 -0
  552. package/src/lib/matcha-highlight/prismjs/plugins/toolbar/prism-toolbar.js +149 -0
  553. package/src/lib/matcha-highlight/prismjs/plugins/toolbar/prism-toolbar.min.js +1 -0
  554. package/src/lib/matcha-highlight/prismjs/plugins/unescaped-markup/prism-unescaped-markup.css +10 -0
  555. package/src/lib/matcha-highlight/prismjs/plugins/unescaped-markup/prism-unescaped-markup.js +44 -0
  556. package/src/lib/matcha-highlight/prismjs/plugins/unescaped-markup/prism-unescaped-markup.min.js +1 -0
  557. package/src/lib/matcha-highlight/prismjs/plugins/wpd/prism-wpd.css +11 -0
  558. package/src/lib/matcha-highlight/prismjs/plugins/wpd/prism-wpd.js +169 -0
  559. package/src/lib/matcha-highlight/prismjs/plugins/wpd/prism-wpd.min.js +1 -0
  560. package/src/lib/matcha-highlight/prismjs/prism.d.ts +4 -0
  561. package/src/lib/matcha-highlight/prismjs/prism.js +960 -0
  562. package/src/lib/matcha-highlight/prismjs/themes/prism-coy.css +226 -0
  563. package/src/lib/matcha-highlight/prismjs/themes/prism-dark.css +129 -0
  564. package/src/lib/matcha-highlight/prismjs/themes/prism-funky.css +117 -0
  565. package/src/lib/matcha-highlight/prismjs/themes/prism-okaidia.css +123 -0
  566. package/src/lib/matcha-highlight/prismjs/themes/prism-solarizedlight.css +150 -0
  567. package/src/lib/matcha-highlight/prismjs/themes/prism-tomorrow.css +122 -0
  568. package/src/lib/matcha-highlight/prismjs/themes/prism-twilight.css +199 -0
  569. package/src/lib/matcha-highlight/prismjs/themes/prism.css +139 -0
  570. package/src/lib/matcha-hint-text/hint/hint-text.component.html +4 -0
  571. package/src/lib/matcha-hint-text/hint/hint-text.component.scss +0 -0
  572. package/src/lib/matcha-hint-text/hint/hint-text.component.ts +31 -0
  573. package/src/lib/matcha-hint-text/hint.module.ts +15 -0
  574. package/src/lib/matcha-hint-text/hint.stories.ts +52 -0
  575. package/src/lib/matcha-icon/icon-argtype.ts +36 -0
  576. package/src/lib/matcha-icon/icon.component.html +3 -0
  577. package/src/lib/matcha-icon/icon.component.scss +0 -0
  578. package/src/lib/matcha-icon/icon.component.ts +34 -0
  579. package/src/lib/matcha-icon/icon.mdx +58 -0
  580. package/src/lib/matcha-icon/icon.module.ts +11 -0
  581. package/src/lib/matcha-icon/icon.stories.ts +431 -0
  582. package/src/lib/matcha-infinite-scroll/matcha-infinite-scroll/matcha-infinite-scroll.component.html +0 -0
  583. package/src/lib/matcha-infinite-scroll/matcha-infinite-scroll/matcha-infinite-scroll.component.scss +0 -0
  584. package/src/lib/matcha-infinite-scroll/matcha-infinite-scroll/matcha-infinite-scroll.component.ts +49 -0
  585. package/src/lib/matcha-infinite-scroll/matcha-infinite-scroll-data/matcha-infinite-scroll-data.component.html +0 -0
  586. package/src/lib/matcha-infinite-scroll/matcha-infinite-scroll-data/matcha-infinite-scroll-data.component.scss +0 -0
  587. package/src/lib/matcha-infinite-scroll/matcha-infinite-scroll-data/matcha-infinite-scroll-data.component.ts +165 -0
  588. package/src/lib/matcha-infinite-scroll/matcha-infinite-scroll.module.ts +14 -0
  589. package/src/lib/matcha-input/input.argtypes.ts +39 -0
  590. package/src/lib/matcha-input/input.directive.ts +12 -0
  591. package/src/lib/matcha-input/input.mdx +73 -0
  592. package/src/lib/matcha-input/input.module.ts +9 -0
  593. package/src/lib/matcha-input/input.stories.ts +97 -0
  594. package/src/lib/matcha-input-phone/all-countries.ts +1366 -0
  595. package/src/lib/matcha-input-phone/input-phone.argtypes.ts +83 -0
  596. package/src/lib/matcha-input-phone/input-phone.component.html +33 -0
  597. package/src/lib/matcha-input-phone/input-phone.component.spec.ts +23 -0
  598. package/src/lib/matcha-input-phone/input-phone.component.ts +267 -0
  599. package/src/lib/matcha-input-phone/input-phone.module.ts +22 -0
  600. package/src/lib/matcha-input-phone/input-phone.stories.ts +85 -0
  601. package/src/lib/matcha-input-phone/lib/custom-keyboard-event.ts +21 -0
  602. package/src/lib/matcha-input-phone/lib/ngx-mask-applier.service.ts +1073 -0
  603. package/src/lib/matcha-input-phone/lib/ngx-mask-expression.enum.ts +43 -0
  604. package/src/lib/matcha-input-phone/lib/ngx-mask.config.ts +132 -0
  605. package/src/lib/matcha-input-phone/lib/ngx-mask.directive.ts +1187 -0
  606. package/src/lib/matcha-input-phone/lib/ngx-mask.module.ts +55 -0
  607. package/src/lib/matcha-input-phone/lib/ngx-mask.pipe.ts +131 -0
  608. package/src/lib/matcha-input-phone/lib/ngx-mask.providers.ts +42 -0
  609. package/src/lib/matcha-input-phone/lib/ngx-mask.service.ts +832 -0
  610. package/src/lib/matcha-lazyload/lazyload/lazyload.component.html +1 -0
  611. package/src/lib/matcha-lazyload/lazyload/lazyload.component.scss +0 -0
  612. package/src/lib/matcha-lazyload/lazyload/lazyload.component.ts +48 -0
  613. package/src/lib/matcha-lazyload/lazyload-data/lazyload-data.component.html +1 -0
  614. package/src/lib/matcha-lazyload/lazyload-data/lazyload-data.component.scss +0 -0
  615. package/src/lib/matcha-lazyload/lazyload-data/lazyload-data.component.ts +172 -0
  616. package/src/lib/matcha-lazyload/lazyload.module.ts +14 -0
  617. package/src/lib/matcha-masonry/masonry/masonry.component.html +3 -0
  618. package/src/lib/matcha-masonry/masonry/masonry.component.scss +0 -0
  619. package/src/lib/matcha-masonry/masonry/masonry.component.ts +45 -0
  620. package/src/lib/matcha-masonry/masonry.argtype.ts +97 -0
  621. package/src/lib/matcha-masonry/masonry.mdx +133 -0
  622. package/src/lib/matcha-masonry/masonry.module.ts +10 -0
  623. package/src/lib/matcha-masonry/masonry.stories.ts +64 -0
  624. package/src/lib/matcha-menu/menu.argtypes.ts +111 -0
  625. package/src/lib/matcha-menu/menu.component.html +3 -0
  626. package/src/lib/matcha-menu/menu.component.scss +0 -0
  627. package/src/lib/matcha-menu/menu.component.spec.ts +23 -0
  628. package/src/lib/matcha-menu/menu.component.ts +48 -0
  629. package/src/lib/matcha-menu/menu.directive.ts +39 -0
  630. package/src/lib/matcha-menu/menu.mdx +59 -0
  631. package/src/lib/matcha-menu/menu.module.ts +19 -0
  632. package/src/lib/matcha-menu/menu.stories.ts +122 -0
  633. package/src/lib/matcha-modal/exemplo/exemple-modal-content.component.html +34 -0
  634. package/src/lib/matcha-modal/exemplo/exemple-modal-content.component.ts +44 -0
  635. package/src/lib/matcha-modal/exemplo/exemple-modal.component.html +46 -0
  636. package/src/lib/matcha-modal/exemplo/exemple-modal.component.ts +34 -0
  637. package/src/lib/matcha-modal/matcha-modal.module.ts +45 -0
  638. package/src/lib/matcha-modal/modal/modal.component.html +3 -0
  639. package/src/lib/matcha-modal/modal/modal.component.scss +0 -0
  640. package/src/lib/matcha-modal/modal/modal.component.ts +67 -0
  641. package/src/lib/matcha-modal/modal-content/modal-content.component.html +9 -0
  642. package/src/lib/matcha-modal/modal-content/modal-content.component.scss +0 -0
  643. package/src/lib/matcha-modal/modal-content/modal-content.component.ts +11 -0
  644. package/src/lib/matcha-modal/modal-footer/modal-footer.component.html +8 -0
  645. package/src/lib/matcha-modal/modal-footer/modal-footer.component.scss +0 -0
  646. package/src/lib/matcha-modal/modal-footer/modal-footer.component.ts +32 -0
  647. package/src/lib/matcha-modal/modal-header/modal-header.component.html +13 -0
  648. package/src/lib/matcha-modal/modal-header/modal-header.component.scss +0 -0
  649. package/src/lib/matcha-modal/modal-header/modal-header.component.ts +11 -0
  650. package/src/lib/matcha-modal/modal-options/modal-options.component.html +3 -0
  651. package/src/lib/matcha-modal/modal-options/modal-options.component.scss +0 -0
  652. package/src/lib/matcha-modal/modal-options/modal-options.component.ts +11 -0
  653. package/src/lib/matcha-modal/modal.service.ts +47 -0
  654. package/src/lib/matcha-modal/modal.stories.argtypes.ts +56 -0
  655. package/src/lib/matcha-modal/modal.stories.ts +333 -0
  656. package/src/lib/matcha-modal/model/IMatchaModalComponent.ts +1 -0
  657. package/src/lib/matcha-modal/overlay.service.ts +138 -0
  658. package/src/lib/matcha-option/README.md +144 -0
  659. package/src/lib/matcha-option/matcha-option-parent.interface.ts +22 -0
  660. package/src/lib/matcha-option/matcha-option.component.ts +93 -0
  661. package/src/lib/matcha-option/matcha-option.module.ts +17 -0
  662. package/src/lib/matcha-option/matcha-option.stories.ts +127 -0
  663. package/src/lib/matcha-overflow-draggable/matcha-overflow-draggable.component.html +3 -0
  664. package/src/lib/matcha-overflow-draggable/matcha-overflow-draggable.component.scss +0 -0
  665. package/src/lib/matcha-overflow-draggable/matcha-overflow-draggable.component.ts +56 -0
  666. package/src/lib/matcha-page-layout/page-layout.component.html +18 -0
  667. package/src/lib/matcha-page-layout/page-layout.component.scss +5 -0
  668. package/src/lib/matcha-page-layout/page-layout.component.ts +11 -0
  669. package/src/lib/matcha-page-layout/page-layout.module.ts +19 -0
  670. package/src/lib/matcha-paginator/paginator/page-event.interface.ts +13 -0
  671. package/src/lib/matcha-paginator/paginator/paginator.component.html +59 -0
  672. package/src/lib/matcha-paginator/paginator/paginator.component.scss +0 -0
  673. package/src/lib/matcha-paginator/paginator/paginator.component.ts +154 -0
  674. package/src/lib/matcha-paginator/paginator-intl.service.ts +39 -0
  675. package/src/lib/matcha-paginator/paginator.module.ts +13 -0
  676. package/src/lib/matcha-panel/matcha-panel.component.ts +223 -0
  677. package/src/lib/matcha-panel/matcha-panel.module.ts +17 -0
  678. package/src/lib/matcha-progress-bar/progress-bar.argtype.ts +48 -0
  679. package/src/lib/matcha-progress-bar/progress-bar.directive.ts +17 -0
  680. package/src/lib/matcha-progress-bar/progress-bar.mdx +95 -0
  681. package/src/lib/matcha-progress-bar/progress-bar.module.ts +14 -0
  682. package/src/lib/matcha-progress-bar/progress-bar.stories.ts +89 -0
  683. package/src/lib/matcha-radio/radio/radio.component.html +20 -0
  684. package/src/lib/matcha-radio/radio/radio.component.scss +0 -0
  685. package/src/lib/matcha-radio/radio/radio.component.ts +84 -0
  686. package/src/lib/matcha-radio/radio.module.ts +16 -0
  687. package/src/lib/matcha-radio/radio.stories.ts +175 -0
  688. package/src/lib/matcha-ripple/ripple.directive.ts +71 -0
  689. package/src/lib/matcha-ripple/ripple.module.ts +16 -0
  690. package/src/lib/matcha-select/matcha-select.component.html +30 -0
  691. package/src/lib/matcha-select/matcha-select.component.scss +3 -0
  692. package/src/lib/matcha-select/matcha-select.component.ts +467 -0
  693. package/src/lib/matcha-select/matcha-select.directive.ts +147 -0
  694. package/src/lib/matcha-select/matcha-select.module.ts +23 -0
  695. package/src/lib/matcha-sidenav/sidenav.argtypes.ts +60 -0
  696. package/src/lib/matcha-sidenav/sidenav.directive.ts +12 -0
  697. package/src/lib/matcha-sidenav/sidenav.mdx +57 -0
  698. package/src/lib/matcha-sidenav/sidenav.module.ts +10 -0
  699. package/src/lib/matcha-sidenav/sidenav.stories.ts +79 -0
  700. package/src/lib/matcha-skeleton/skeleton/skeleton.component.html +70 -0
  701. package/src/lib/matcha-skeleton/skeleton/skeleton.component.scss +0 -0
  702. package/src/lib/matcha-skeleton/skeleton/skeleton.component.ts +36 -0
  703. package/src/lib/matcha-skeleton/skeleton-argtype.ts +67 -0
  704. package/src/lib/matcha-skeleton/skeleton.module.ts +11 -0
  705. package/src/lib/matcha-skeleton/skeleton.stories.ts +74 -0
  706. package/src/lib/matcha-slide-toggle/slide-toggle/slide-toggle.component.html +15 -0
  707. package/src/lib/matcha-slide-toggle/slide-toggle/slide-toggle.component.scss +0 -0
  708. package/src/lib/matcha-slide-toggle/slide-toggle/slide-toggle.component.ts +96 -0
  709. package/src/lib/matcha-slide-toggle/slide-toggle.module.ts +18 -0
  710. package/src/lib/matcha-slide-toggle/slide-toggle.stories.ts +78 -0
  711. package/src/lib/matcha-slider/matcha-slider.directive.ts +17 -0
  712. package/src/lib/matcha-slider/slider.argtypes.ts +76 -0
  713. package/src/lib/matcha-slider/slider.mdx +45 -0
  714. package/src/lib/matcha-slider/slider.module.ts +12 -0
  715. package/src/lib/matcha-slider/slider.stories.ts +149 -0
  716. package/src/lib/matcha-snackbar/snack-bar-overview-example.component.ts +22 -0
  717. package/src/lib/matcha-snackbar/snack-bar-overview-example.css +3 -0
  718. package/src/lib/matcha-snackbar/snack-bar-overview-example.html +11 -0
  719. package/src/lib/matcha-snackbar/snack-bar.argtypes.ts +11 -0
  720. package/src/lib/matcha-snackbar/snack-bar.directive.ts +12 -0
  721. package/src/lib/matcha-snackbar/snack-bar.mdx +53 -0
  722. package/src/lib/matcha-snackbar/snack-bar.module.ts +10 -0
  723. package/src/lib/matcha-snackbar/snack-bar.stories.ts +34 -0
  724. package/src/lib/matcha-sort-header/example/sort-overview-example.component.ts +66 -0
  725. package/src/lib/matcha-sort-header/example/sort-overview-example.css +3 -0
  726. package/src/lib/matcha-sort-header/example/sort-overview-example.html +21 -0
  727. package/src/lib/matcha-sort-header/sort-header.argtypes.ts +11 -0
  728. package/src/lib/matcha-sort-header/sort-header.directive.ts +17 -0
  729. package/src/lib/matcha-sort-header/sort-header.mdx +78 -0
  730. package/src/lib/matcha-sort-header/sort-header.module.ts +10 -0
  731. package/src/lib/matcha-sort-header/sort-header.stories.ts +34 -0
  732. package/src/lib/matcha-spin/spin/spin.component.html +27 -0
  733. package/src/lib/matcha-spin/spin/spin.component.scss +0 -0
  734. package/src/lib/matcha-spin/spin/spin.component.ts +70 -0
  735. package/src/lib/matcha-spin/spin.module.ts +16 -0
  736. package/src/lib/matcha-spin/spin.stories.ts +85 -0
  737. package/src/lib/matcha-spinner/spinner/spinner.component.html +29 -0
  738. package/src/lib/matcha-spinner/spinner/spinner.component.scss +1 -0
  739. package/src/lib/matcha-spinner/spinner/spinner.component.ts +74 -0
  740. package/src/lib/matcha-spinner/spinner.module.ts +15 -0
  741. package/src/lib/matcha-spinner/spinner.stories.ts +85 -0
  742. package/src/lib/matcha-stepper/next-step.diretive.ts +21 -0
  743. package/src/lib/matcha-stepper/prev-step.diretive.ts +21 -0
  744. package/src/lib/matcha-stepper/step/step.component.ts +11 -0
  745. package/src/lib/matcha-stepper/step-content.diretive.ts +9 -0
  746. package/src/lib/matcha-stepper/stepper/stepper.component.ts +20 -0
  747. package/src/lib/matcha-stepper/stepper-content/stepper-content.component.ts +38 -0
  748. package/src/lib/matcha-stepper/stepper-controller/stepper-controller.component.html +8 -0
  749. package/src/lib/matcha-stepper/stepper-controller/stepper-controller.component.ts +26 -0
  750. package/src/lib/matcha-stepper/stepper.argtypes.ts +74 -0
  751. package/src/lib/matcha-stepper/stepper.module.ts +32 -0
  752. package/src/lib/matcha-stepper/stepper.service.ts +50 -0
  753. package/src/lib/matcha-stepper/stepper.stories.ts +117 -0
  754. package/src/lib/matcha-table/example/table-basic-example.component.ts +36 -0
  755. package/src/lib/matcha-table/example/table-basic-example.css +0 -0
  756. package/src/lib/matcha-table/example/table-basic-example.html +35 -0
  757. package/src/lib/matcha-table/table.argtypes.ts +11 -0
  758. package/src/lib/matcha-table/table.directive.ts +17 -0
  759. package/src/lib/matcha-table/table.mdx +78 -0
  760. package/src/lib/matcha-table/table.module.ts +10 -0
  761. package/src/lib/matcha-table/table.stories.ts +34 -0
  762. package/src/lib/matcha-tabs/tab-item/tab-item.component.html +1 -0
  763. package/src/lib/matcha-tabs/tab-item/tab-item.component.scss +0 -0
  764. package/src/lib/matcha-tabs/tab-item/tab-item.component.ts +19 -0
  765. package/src/lib/matcha-tabs/tabs/tabs.component.html +22 -0
  766. package/src/lib/matcha-tabs/tabs/tabs.component.scss +0 -0
  767. package/src/lib/matcha-tabs/tabs/tabs.component.ts +58 -0
  768. package/src/lib/matcha-tabs/tabs.module.ts +19 -0
  769. package/src/lib/matcha-tabs/tabs.stories.ts +98 -0
  770. package/src/lib/matcha-time/time/time.component.html +3 -0
  771. package/src/lib/matcha-time/time/time.component.scss +0 -0
  772. package/src/lib/matcha-time/time/time.component.ts +141 -0
  773. package/src/lib/matcha-time/time.module.ts +14 -0
  774. package/src/lib/matcha-time/time.stories.ts +244 -0
  775. package/src/lib/matcha-title/title/title.component.html +8 -0
  776. package/src/lib/matcha-title/title/title.component.scss +5 -0
  777. package/src/lib/matcha-title/title/title.component.ts +73 -0
  778. package/src/lib/matcha-title/title.argtypes.ts +69 -0
  779. package/src/lib/matcha-title/title.module.ts +10 -0
  780. package/src/lib/matcha-title/title.stories.ts +132 -0
  781. package/src/lib/matcha-toolbar/toolbar/toolbar.component.html +54 -0
  782. package/src/lib/matcha-toolbar/toolbar/toolbar.component.scss +0 -0
  783. package/src/lib/matcha-toolbar/toolbar/toolbar.component.ts +43 -0
  784. package/src/lib/matcha-toolbar/toolbar-button/toolbar-button.component.html +8 -0
  785. package/src/lib/matcha-toolbar/toolbar-button/toolbar-button.component.scss +0 -0
  786. package/src/lib/matcha-toolbar/toolbar-button/toolbar-button.component.ts +21 -0
  787. package/src/lib/matcha-toolbar/toolbar-content/toolbar-content.component.html +8 -0
  788. package/src/lib/matcha-toolbar/toolbar-content/toolbar-content.component.scss +0 -0
  789. package/src/lib/matcha-toolbar/toolbar-content/toolbar-content.component.ts +9 -0
  790. package/src/lib/matcha-toolbar/toolbar-custom-button/toolbar-custom-button.component.html +6 -0
  791. package/src/lib/matcha-toolbar/toolbar-custom-button/toolbar-custom-button.component.scss +0 -0
  792. package/src/lib/matcha-toolbar/toolbar-custom-button/toolbar-custom-button.component.ts +10 -0
  793. package/src/lib/matcha-toolbar/toolbar-main-button/toolbar-main-button.component.html +11 -0
  794. package/src/lib/matcha-toolbar/toolbar-main-button/toolbar-main-button.component.scss +0 -0
  795. package/src/lib/matcha-toolbar/toolbar-main-button/toolbar-main-button.component.ts +15 -0
  796. package/src/lib/matcha-toolbar/toolbar.argtypes.ts +27 -0
  797. package/src/lib/matcha-toolbar/toolbar.module.ts +36 -0
  798. package/src/lib/matcha-toolbar/toolbar.stories.ts +131 -0
  799. package/src/lib/matcha-tooltip/tooltip.argtypes.ts +58 -0
  800. package/src/lib/matcha-tooltip/tooltip.directive.ts +158 -0
  801. package/src/lib/matcha-tooltip/tooltip.module.ts +11 -0
  802. package/src/lib/matcha-tooltip/tooltip.stories.ts +259 -0
  803. package/src/lib/postcss.config.js +6 -0
  804. package/src/public-api.ts +180 -0
  805. package/tsconfig.lib.json +18 -0
  806. package/tsconfig.lib.prod.json +10 -0
  807. package/tsconfig.spec.json +14 -0
  808. package/fesm2022/matcha-components.mjs +0 -6792
  809. package/fesm2022/matcha-components.mjs.map +0 -1
  810. package/index.d.ts +0 -1800
@@ -0,0 +1,1187 @@
1
+
2
+ import { OnChanges, SimpleChanges, DOCUMENT } from '@angular/core';
3
+ import { signal, input, output, Directive, HostListener, inject } from '@angular/core';
4
+ import {
5
+ ControlValueAccessor,
6
+ FormControl,
7
+ ValidationErrors,
8
+ Validator,
9
+ } from '@angular/forms';
10
+ import { NG_VALIDATORS, NG_VALUE_ACCESSOR } from '@angular/forms';
11
+
12
+ import { CustomKeyboardEvent } from './custom-keyboard-event';
13
+ import { NgxMaskConfig } from './ngx-mask.config';
14
+ import { NGX_MASK_CONFIG, timeMasks, withoutValidation } from './ngx-mask.config';
15
+ import { NgxMaskService } from './ngx-mask.service';
16
+ import { MaskExpression } from './ngx-mask-expression.enum';
17
+
18
+ import { forwardRef } from '@angular/core';
19
+
20
+ @Directive({
21
+ selector: 'input[mask], textarea[mask]',
22
+ standalone: false,
23
+ providers: [
24
+ {
25
+ provide: NG_VALUE_ACCESSOR,
26
+ useExisting: forwardRef(() => NgxMaskDirective),
27
+ multi: true,
28
+ },
29
+ {
30
+ provide: NG_VALIDATORS,
31
+ useExisting: forwardRef(() => NgxMaskDirective),
32
+ multi: true,
33
+ },
34
+ NgxMaskService,
35
+ ],
36
+ exportAs: 'mask,ngxMask',
37
+ })
38
+ export class NgxMaskDirective implements ControlValueAccessor, OnChanges, Validator {
39
+ public mask = input<string | undefined | null>('');
40
+ public specialCharacters = input<NgxMaskConfig['specialCharacters']>([]);
41
+ public patterns = input<NgxMaskConfig['patterns']>({});
42
+ public prefix = input<NgxMaskConfig['prefix']>('');
43
+ public suffix = input<NgxMaskConfig['suffix']>('');
44
+ public thousandSeparator = input<NgxMaskConfig['thousandSeparator']>(' ');
45
+ public decimalMarker = input<NgxMaskConfig['decimalMarker']>('.');
46
+ public dropSpecialCharacters = input<NgxMaskConfig['dropSpecialCharacters'] | null>(null);
47
+ public hiddenInput = input<NgxMaskConfig['hiddenInput'] | null>(null);
48
+ public showMaskTyped = input<NgxMaskConfig['showMaskTyped'] | null>(null);
49
+ public placeHolderCharacter = input<NgxMaskConfig['placeHolderCharacter'] | null>(null);
50
+ public shownMaskExpression = input<NgxMaskConfig['shownMaskExpression'] | null>(null);
51
+ public clearIfNotMatch = input<NgxMaskConfig['clearIfNotMatch'] | null>(null);
52
+ public validation = input<NgxMaskConfig['validation'] | null>(null);
53
+ public separatorLimit = input<NgxMaskConfig['separatorLimit'] | null>('');
54
+ public allowNegativeNumbers = input<NgxMaskConfig['allowNegativeNumbers'] | null>(null);
55
+ public leadZeroDateTime = input<NgxMaskConfig['leadZeroDateTime'] | null>(null);
56
+ public leadZero = input<NgxMaskConfig['leadZero'] | null>(null);
57
+ public triggerOnMaskChange = input<NgxMaskConfig['triggerOnMaskChange'] | null>(null);
58
+ public apm = input<NgxMaskConfig['apm'] | null>(null);
59
+ public inputTransformFn = input<NgxMaskConfig['inputTransformFn'] | null>(null);
60
+ public outputTransformFn = input<NgxMaskConfig['outputTransformFn'] | null>(null);
61
+ public keepCharacterPositions = input<NgxMaskConfig['keepCharacterPositions'] | null>(null);
62
+ public instantPrefix = input<NgxMaskConfig['instantPrefix'] | null>(null);
63
+
64
+ public maskFilled = output<void>();
65
+
66
+ private _maskValue = signal<string>('');
67
+ private _inputValue = signal<string>('');
68
+ private _position = signal<number | null>(null);
69
+ private _code = signal<string>('');
70
+ private _maskExpressionArray = signal<string[]>([]);
71
+ private _justPasted = signal<boolean>(false);
72
+ private _isFocused = signal<boolean>(false);
73
+ /**For IME composition event */
74
+ private _isComposing = signal<boolean>(false);
75
+
76
+ public _maskService = inject(NgxMaskService, { self: true });
77
+
78
+ private readonly document = inject(DOCUMENT);
79
+
80
+ protected _config = inject<NgxMaskConfig>(NGX_MASK_CONFIG);
81
+
82
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
83
+ public onChange = (_: any) => {};
84
+
85
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
86
+ public onTouch = () => {};
87
+
88
+ public ngOnChanges(changes: SimpleChanges): void {
89
+ const {
90
+ mask,
91
+ specialCharacters,
92
+ patterns,
93
+ prefix,
94
+ suffix,
95
+ thousandSeparator,
96
+ decimalMarker,
97
+ dropSpecialCharacters,
98
+ hiddenInput,
99
+ showMaskTyped,
100
+ placeHolderCharacter,
101
+ shownMaskExpression,
102
+ clearIfNotMatch,
103
+ validation,
104
+ separatorLimit,
105
+ allowNegativeNumbers,
106
+ leadZeroDateTime,
107
+ leadZero,
108
+ triggerOnMaskChange,
109
+ apm,
110
+ inputTransformFn,
111
+ outputTransformFn,
112
+ keepCharacterPositions,
113
+ instantPrefix,
114
+ } = changes;
115
+ if (mask) {
116
+ if (mask.currentValue !== mask.previousValue && !mask.firstChange) {
117
+ this._maskService.maskChanged = true;
118
+ }
119
+ if (mask.currentValue && mask.currentValue.split(MaskExpression.OR).length > 1) {
120
+ this._maskExpressionArray.set(
121
+ mask.currentValue.split(MaskExpression.OR).sort((a: string, b: string) => {
122
+ return a.length - b.length;
123
+ })
124
+ );
125
+ this._setMask();
126
+ } else {
127
+ this._maskExpressionArray.set([]);
128
+ this._maskValue.set(mask.currentValue || MaskExpression.EMPTY_STRING);
129
+ this._maskService.maskExpression = this._maskValue();
130
+ }
131
+ }
132
+ if (specialCharacters) {
133
+ if (!specialCharacters.currentValue || !Array.isArray(specialCharacters.currentValue)) {
134
+ return;
135
+ } else {
136
+ this._maskService.specialCharacters = specialCharacters.currentValue || [];
137
+ }
138
+ }
139
+ if (allowNegativeNumbers) {
140
+ this._maskService.allowNegativeNumbers = allowNegativeNumbers.currentValue;
141
+ if (this._maskService.allowNegativeNumbers) {
142
+ this._maskService.specialCharacters = this._maskService.specialCharacters.filter(
143
+ (c: string) => c !== MaskExpression.MINUS
144
+ );
145
+ }
146
+ }
147
+ // Only overwrite the mask available patterns if a pattern has actually been passed in
148
+ if (patterns && patterns.currentValue) {
149
+ this._maskService.patterns = patterns.currentValue;
150
+ }
151
+ if (apm && apm.currentValue) {
152
+ this._maskService.apm = apm.currentValue;
153
+ }
154
+
155
+ if (instantPrefix) {
156
+ this._maskService.instantPrefix = instantPrefix.currentValue;
157
+ }
158
+ if (prefix) {
159
+ this._maskService.prefix = prefix.currentValue;
160
+ }
161
+ if (suffix) {
162
+ this._maskService.suffix = suffix.currentValue;
163
+ }
164
+ if (thousandSeparator) {
165
+ this._maskService.thousandSeparator = thousandSeparator.currentValue;
166
+ if (thousandSeparator.previousValue && thousandSeparator.currentValue) {
167
+ const previousDecimalMarker = this._maskService.decimalMarker;
168
+
169
+ if (thousandSeparator.currentValue === this._maskService.decimalMarker) {
170
+ this._maskService.decimalMarker =
171
+ thousandSeparator.currentValue === MaskExpression.COMMA
172
+ ? MaskExpression.DOT
173
+ : MaskExpression.COMMA;
174
+ }
175
+ if (this._maskService.dropSpecialCharacters === true) {
176
+ this._maskService.specialCharacters = this._config.specialCharacters;
177
+ }
178
+ if (
179
+ typeof previousDecimalMarker === 'string' &&
180
+ typeof this._maskService.decimalMarker === 'string'
181
+ ) {
182
+ this._inputValue.set(
183
+ this._inputValue()
184
+ .split(thousandSeparator.previousValue)
185
+ .join('')
186
+ .replace(previousDecimalMarker, this._maskService.decimalMarker)
187
+ );
188
+ this._maskService.actualValue = this._inputValue();
189
+ }
190
+ this._maskService.writingValue = true;
191
+ }
192
+ }
193
+ if (decimalMarker) {
194
+ this._maskService.decimalMarker = decimalMarker.currentValue;
195
+ }
196
+ if (dropSpecialCharacters) {
197
+ this._maskService.dropSpecialCharacters = dropSpecialCharacters.currentValue;
198
+ }
199
+ if (hiddenInput) {
200
+ this._maskService.hiddenInput = hiddenInput.currentValue;
201
+ if (hiddenInput.previousValue === true && hiddenInput.currentValue === false) {
202
+ this._inputValue.set(this._maskService.actualValue);
203
+ }
204
+ }
205
+ if (showMaskTyped) {
206
+ this._maskService.showMaskTyped = showMaskTyped.currentValue;
207
+ if (
208
+ showMaskTyped.previousValue === false &&
209
+ showMaskTyped.currentValue === true &&
210
+ this._isFocused()
211
+ ) {
212
+ requestAnimationFrame(() => {
213
+ this._maskService._elementRef?.nativeElement.click();
214
+ });
215
+ }
216
+ }
217
+ if (placeHolderCharacter) {
218
+ this._maskService.placeHolderCharacter = placeHolderCharacter.currentValue;
219
+ }
220
+ if (shownMaskExpression) {
221
+ this._maskService.shownMaskExpression = shownMaskExpression.currentValue;
222
+ }
223
+ if (clearIfNotMatch) {
224
+ this._maskService.clearIfNotMatch = clearIfNotMatch.currentValue;
225
+ }
226
+ if (validation) {
227
+ this._maskService.validation = validation.currentValue;
228
+ }
229
+ if (separatorLimit) {
230
+ this._maskService.separatorLimit = separatorLimit.currentValue;
231
+ }
232
+ if (leadZeroDateTime) {
233
+ this._maskService.leadZeroDateTime = leadZeroDateTime.currentValue;
234
+ }
235
+ if (leadZero) {
236
+ this._maskService.leadZero = leadZero.currentValue;
237
+ }
238
+ if (triggerOnMaskChange) {
239
+ this._maskService.triggerOnMaskChange = triggerOnMaskChange.currentValue;
240
+ }
241
+ if (inputTransformFn) {
242
+ this._maskService.inputTransformFn = inputTransformFn.currentValue;
243
+ }
244
+ if (outputTransformFn) {
245
+ this._maskService.outputTransformFn = outputTransformFn.currentValue;
246
+ }
247
+ if (keepCharacterPositions) {
248
+ this._maskService.keepCharacterPositions = keepCharacterPositions.currentValue;
249
+ }
250
+ this._applyMask();
251
+ }
252
+
253
+ public validate({ value }: FormControl): ValidationErrors | null {
254
+ const processedValue: string = typeof value === 'number' ? String(value) : value;
255
+ const maskValue = this._maskValue();
256
+
257
+ if (!this._maskService.validation || !maskValue) {
258
+ return null;
259
+ }
260
+ if (this._maskService.ipError) {
261
+ return this._createValidationError(processedValue);
262
+ }
263
+ if (this._maskService.cpfCnpjError) {
264
+ return this._createValidationError(processedValue);
265
+ }
266
+ if (maskValue.startsWith(MaskExpression.SEPARATOR)) {
267
+ return null;
268
+ }
269
+ if (withoutValidation.includes(maskValue)) {
270
+ return null;
271
+ }
272
+ if (this._maskService.clearIfNotMatch) {
273
+ return null;
274
+ }
275
+ if (timeMasks.includes(maskValue)) {
276
+ return this._validateTime(processedValue);
277
+ }
278
+ if (maskValue === MaskExpression.EMAIL_MASK) {
279
+ const emailPattern = /^[^@]+@[^@]+\.[^@]+$/;
280
+
281
+ if (!emailPattern.test(processedValue) && processedValue) {
282
+ return this._createValidationError(processedValue);
283
+ } else {
284
+ return null;
285
+ }
286
+ }
287
+ if (processedValue && processedValue.length >= 1) {
288
+ let counterOfOpt = 0;
289
+
290
+ if (
291
+ maskValue.includes(MaskExpression.CURLY_BRACKETS_LEFT) &&
292
+ maskValue.includes(MaskExpression.CURLY_BRACKETS_RIGHT)
293
+ ) {
294
+ const lengthInsideCurlyBrackets = maskValue.slice(
295
+ maskValue.indexOf(MaskExpression.CURLY_BRACKETS_LEFT) + 1,
296
+ maskValue.indexOf(MaskExpression.CURLY_BRACKETS_RIGHT)
297
+ );
298
+
299
+ return lengthInsideCurlyBrackets === String(processedValue.length)
300
+ ? null
301
+ : this._createValidationError(processedValue);
302
+ }
303
+ if (maskValue.startsWith(MaskExpression.PERCENT)) {
304
+ return null;
305
+ }
306
+ for (const key in this._maskService.patterns) {
307
+ if (this._maskService.patterns[key]?.optional) {
308
+ if (maskValue.indexOf(key) !== maskValue.lastIndexOf(key)) {
309
+ const opt: string = maskValue
310
+ .split(MaskExpression.EMPTY_STRING)
311
+ .filter((i: string) => i === key)
312
+ .join(MaskExpression.EMPTY_STRING);
313
+ counterOfOpt += opt.length;
314
+ } else if (maskValue.indexOf(key) !== -1) {
315
+ counterOfOpt++;
316
+ }
317
+ if (
318
+ maskValue.indexOf(key) !== -1 &&
319
+ processedValue.length >= maskValue.indexOf(key)
320
+ ) {
321
+ return null;
322
+ }
323
+ if (counterOfOpt === maskValue.length) {
324
+ return null;
325
+ }
326
+ }
327
+ }
328
+ if (
329
+ (maskValue.indexOf(MaskExpression.SYMBOL_STAR) > 1 &&
330
+ processedValue.length < maskValue.indexOf(MaskExpression.SYMBOL_STAR)) ||
331
+ (maskValue.indexOf(MaskExpression.SYMBOL_QUESTION) > 1 &&
332
+ processedValue.length < maskValue.indexOf(MaskExpression.SYMBOL_QUESTION))
333
+ ) {
334
+ return this._createValidationError(processedValue);
335
+ }
336
+ if (
337
+ maskValue.indexOf(MaskExpression.SYMBOL_STAR) === -1 ||
338
+ maskValue.indexOf(MaskExpression.SYMBOL_QUESTION) === -1
339
+ ) {
340
+ const array = maskValue.split('*');
341
+ const length: number = this._maskService.dropSpecialCharacters
342
+ ? maskValue.length -
343
+ this._maskService.checkDropSpecialCharAmount(maskValue) -
344
+ counterOfOpt
345
+ : this.prefix()
346
+ ? maskValue.length + this.prefix().length - counterOfOpt
347
+ : maskValue.length - counterOfOpt;
348
+
349
+ if (array.length === 1) {
350
+ if (processedValue.length < length) {
351
+ return this._createValidationError(processedValue);
352
+ }
353
+ }
354
+ if (array.length > 1) {
355
+ const lastIndexArray = array[array.length - 1];
356
+ if (
357
+ lastIndexArray &&
358
+ this._maskService.specialCharacters.includes(lastIndexArray[0] as string) &&
359
+ String(processedValue).includes(lastIndexArray[0] ?? '') &&
360
+ !this.dropSpecialCharacters()
361
+ ) {
362
+ const special = value.split(lastIndexArray[0]);
363
+ return special[special.length - 1].length === lastIndexArray.length - 1
364
+ ? null
365
+ : this._createValidationError(processedValue);
366
+ } else if (
367
+ ((lastIndexArray &&
368
+ !this._maskService.specialCharacters.includes(
369
+ lastIndexArray[0] as string
370
+ )) ||
371
+ !lastIndexArray ||
372
+ this._maskService.dropSpecialCharacters) &&
373
+ processedValue.length >= length - 1
374
+ ) {
375
+ return null;
376
+ } else {
377
+ return this._createValidationError(processedValue);
378
+ }
379
+ }
380
+ }
381
+ if (
382
+ maskValue.indexOf(MaskExpression.SYMBOL_STAR) === 1 ||
383
+ maskValue.indexOf(MaskExpression.SYMBOL_QUESTION) === 1
384
+ ) {
385
+ return null;
386
+ }
387
+ }
388
+ if (value) {
389
+ this.maskFilled.emit();
390
+ return null;
391
+ }
392
+ return null;
393
+ }
394
+
395
+ @HostListener('paste')
396
+ public onPaste() {
397
+ this._justPasted.set(true);
398
+ }
399
+
400
+ @HostListener('focus', ['$event']) public onFocus() {
401
+ this._isFocused.set(true);
402
+ }
403
+
404
+ @HostListener('ngModelChange', ['$event'])
405
+ public onModelChange(value: string | undefined | null | number): void {
406
+ // on form reset we need to update the actualValue
407
+ if (
408
+ (value === MaskExpression.EMPTY_STRING ||
409
+ value === null ||
410
+ typeof value === 'undefined') &&
411
+ this._maskService.actualValue
412
+ ) {
413
+ this._maskService.actualValue = this._maskService.getActualValue(
414
+ MaskExpression.EMPTY_STRING
415
+ );
416
+ }
417
+ }
418
+
419
+ @HostListener('input', ['$event'])
420
+ public onInput(e: CustomKeyboardEvent): void {
421
+ // If IME is composing text, we wait for the composed text.
422
+ if (this._isComposing()) {
423
+ return;
424
+ }
425
+ const el: HTMLInputElement = e.target as HTMLInputElement;
426
+
427
+ const transformedValue = this._maskService.inputTransformFn
428
+ ? this._maskService.inputTransformFn(el.value)
429
+ : el.value;
430
+
431
+ if (el.type !== 'number') {
432
+ if (typeof transformedValue === 'string' || typeof transformedValue === 'number') {
433
+ el.value = transformedValue.toString();
434
+
435
+ this._inputValue.set(el.value);
436
+ this._setMask();
437
+
438
+ if (!this._maskValue()) {
439
+ this.onChange(el.value);
440
+ return;
441
+ }
442
+
443
+ let position: number =
444
+ el.selectionStart === 1
445
+ ? (el.selectionStart as number) + this._maskService.prefix.length
446
+ : (el.selectionStart as number);
447
+
448
+ if (
449
+ this.showMaskTyped() &&
450
+ this.keepCharacterPositions() &&
451
+ this._maskService.placeHolderCharacter.length === 1
452
+ ) {
453
+ const suffix = this.suffix();
454
+ const prefix = this.prefix();
455
+ const inputSymbol = el.value.slice(position - 1, position);
456
+ const prefixLength = prefix.length;
457
+ const checkSymbols: boolean = this._maskService._checkSymbolMask(
458
+ inputSymbol,
459
+ this._maskService.maskExpression[position - 1 - prefixLength] ??
460
+ MaskExpression.EMPTY_STRING
461
+ );
462
+
463
+ const checkSpecialCharacter: boolean = this._maskService._checkSymbolMask(
464
+ inputSymbol,
465
+ this._maskService.maskExpression[position + 1 - prefixLength] ??
466
+ MaskExpression.EMPTY_STRING
467
+ );
468
+ const selectRangeBackspace: boolean =
469
+ this._maskService.selStart === this._maskService.selEnd;
470
+ const selStart = Number(this._maskService.selStart) - prefixLength;
471
+ const selEnd = Number(this._maskService.selEnd) - prefixLength;
472
+
473
+ const backspaceOrDelete =
474
+ this._code() === MaskExpression.BACKSPACE ||
475
+ this._code() === MaskExpression.DELETE;
476
+
477
+ if (backspaceOrDelete) {
478
+ if (!selectRangeBackspace) {
479
+ if (this._maskService.selStart === prefixLength) {
480
+ this._maskService.actualValue = `${prefix}${this._maskService.maskIsShown.slice(0, selEnd)}${this._inputValue().split(prefix).join('')}`;
481
+ } else if (
482
+ this._maskService.selStart ===
483
+ this._maskService.maskIsShown.length + prefixLength
484
+ ) {
485
+ this._maskService.actualValue = `${this._inputValue()}${this._maskService.maskIsShown.slice(selStart, selEnd)}`;
486
+ } else {
487
+ this._maskService.actualValue = `${prefix}${this._inputValue()
488
+ .split(prefix)
489
+ .join('')
490
+ .slice(
491
+ 0,
492
+ selStart
493
+ )}${this._maskService.maskIsShown.slice(selStart, selEnd)}${this._maskService.actualValue.slice(
494
+ selEnd + prefixLength,
495
+ this._maskService.maskIsShown.length + prefixLength
496
+ )}${suffix}`;
497
+ }
498
+ } else if (
499
+ !this._maskService.specialCharacters.includes(
500
+ this._maskService.maskExpression.slice(
501
+ position - prefixLength,
502
+ position + 1 - prefixLength
503
+ )
504
+ ) &&
505
+ selectRangeBackspace
506
+ ) {
507
+ if (selStart === 1 && prefix) {
508
+ this._maskService.actualValue = `${prefix}${this._maskService.placeHolderCharacter}${el.value
509
+ .split(prefix)
510
+ .join('')
511
+ .split(suffix)
512
+ .join('')}${suffix}`;
513
+
514
+ position = position - 1;
515
+ } else {
516
+ const part1 = el.value.substring(0, position);
517
+ const part2 = el.value.substring(position);
518
+ this._maskService.actualValue = `${part1}${this._maskService.placeHolderCharacter}${part2}`;
519
+ }
520
+ }
521
+ position = this._code() === MaskExpression.DELETE ? position + 1 : position;
522
+ }
523
+ if (!backspaceOrDelete) {
524
+ if (!checkSymbols && !checkSpecialCharacter && selectRangeBackspace) {
525
+ position = Number(el.selectionStart) - 1;
526
+ } else if (
527
+ this._maskService.specialCharacters.includes(
528
+ el.value.slice(position, position + 1)
529
+ ) &&
530
+ checkSpecialCharacter &&
531
+ !this._maskService.specialCharacters.includes(
532
+ el.value.slice(position + 1, position + 2)
533
+ )
534
+ ) {
535
+ this._maskService.actualValue = `${el.value.slice(0, position - 1)}${el.value.slice(position, position + 1)}${inputSymbol}${el.value.slice(position + 2)}`;
536
+ position = position + 1;
537
+ } else if (checkSymbols) {
538
+ if (el.value.length === 1 && position === 1) {
539
+ this._maskService.actualValue = `${prefix}${inputSymbol}${this._maskService.maskIsShown.slice(
540
+ 1,
541
+ this._maskService.maskIsShown.length
542
+ )}${suffix}`;
543
+ } else {
544
+ this._maskService.actualValue = `${el.value.slice(0, position - 1)}${inputSymbol}${el.value
545
+ .slice(position + 1)
546
+ .split(suffix)
547
+ .join('')}${suffix}`;
548
+ }
549
+ } else if (
550
+ prefix &&
551
+ el.value.length === 1 &&
552
+ position - prefixLength === 1 &&
553
+ this._maskService._checkSymbolMask(
554
+ el.value,
555
+ this._maskService.maskExpression[position - 1 - prefixLength] ??
556
+ MaskExpression.EMPTY_STRING
557
+ )
558
+ ) {
559
+ this._maskService.actualValue = `${prefix}${el.value}${this._maskService.maskIsShown.slice(
560
+ 1,
561
+ this._maskService.maskIsShown.length
562
+ )}${suffix}`;
563
+ }
564
+ }
565
+ }
566
+
567
+ let caretShift = 0;
568
+ let backspaceShift = false;
569
+ if (this._code() === MaskExpression.DELETE && MaskExpression.SEPARATOR) {
570
+ this._maskService.deletedSpecialCharacter = true;
571
+ }
572
+ if (
573
+ this._inputValue().length >= this._maskService.maskExpression.length - 1 &&
574
+ this._code() !== MaskExpression.BACKSPACE &&
575
+ this._maskService.maskExpression === MaskExpression.DAYS_MONTHS_YEARS &&
576
+ position < 10
577
+ ) {
578
+ const inputSymbol = this._inputValue().slice(position - 1, position);
579
+ el.value =
580
+ this._inputValue().slice(0, position - 1) +
581
+ inputSymbol +
582
+ this._inputValue().slice(position + 1);
583
+ }
584
+ if (
585
+ this._maskService.maskExpression === MaskExpression.DAYS_MONTHS_YEARS &&
586
+ this.leadZeroDateTime()
587
+ ) {
588
+ if (
589
+ (position < 3 && Number(el.value) > 31 && Number(el.value) < 40) ||
590
+ (position === 5 && Number(el.value.slice(3, 5)) > 12)
591
+ ) {
592
+ position = position + 2;
593
+ }
594
+ }
595
+ if (
596
+ this._maskService.maskExpression === MaskExpression.HOURS_MINUTES_SECONDS &&
597
+ this.apm()
598
+ ) {
599
+ if (this._justPasted() && el.value.slice(0, 2) === MaskExpression.DOUBLE_ZERO) {
600
+ el.value = el.value.slice(1, 2) + el.value.slice(2, el.value.length);
601
+ }
602
+ el.value =
603
+ el.value === MaskExpression.DOUBLE_ZERO
604
+ ? MaskExpression.NUMBER_ZERO
605
+ : el.value;
606
+ }
607
+
608
+ this._maskService.applyValueChanges(
609
+ position,
610
+ this._justPasted(),
611
+ this._code() === MaskExpression.BACKSPACE ||
612
+ this._code() === MaskExpression.DELETE,
613
+ (shift: number, _backspaceShift: boolean) => {
614
+ this._justPasted.set(false);
615
+ caretShift = shift;
616
+ backspaceShift = _backspaceShift;
617
+ }
618
+ );
619
+ // only set the selection if the element is active
620
+ if (this._getActiveElement() !== el) {
621
+ return;
622
+ }
623
+
624
+ if (this._maskService.plusOnePosition) {
625
+ position = position + 1;
626
+ this._maskService.plusOnePosition = false;
627
+ }
628
+ // update position after applyValueChanges to prevent cursor on wrong position when it has an array of maskExpression
629
+ if (this._maskExpressionArray().length) {
630
+ if (this._code() === MaskExpression.BACKSPACE) {
631
+ const specialChartMinusOne = this.specialCharacters().includes(
632
+ this._maskService.actualValue.slice(position - 1, position)
633
+ );
634
+ const allowFewMaskChangeMask =
635
+ this._maskService.removeMask(this._inputValue())?.length ===
636
+ this._maskService.removeMask(this._maskService.maskExpression)?.length;
637
+
638
+ const specialChartPlusOne = this.specialCharacters().includes(
639
+ this._maskService.actualValue.slice(position, position + 1)
640
+ );
641
+ if (allowFewMaskChangeMask && !specialChartPlusOne) {
642
+ position = (el.selectionStart as number) + 1;
643
+ } else {
644
+ position = specialChartMinusOne ? position - 1 : position;
645
+ }
646
+ } else {
647
+ position =
648
+ el.selectionStart === 1
649
+ ? (el.selectionStart as number) + this._maskService.prefix.length
650
+ : (el.selectionStart as number);
651
+ }
652
+ }
653
+ this._position.set(
654
+ this._position() === 1 && this._inputValue().length === 1
655
+ ? null
656
+ : this._position()
657
+ );
658
+ let positionToApply: number = this._position()
659
+ ? this._inputValue().length + position + caretShift
660
+ : position +
661
+ (this._code() === MaskExpression.BACKSPACE && !backspaceShift
662
+ ? 0
663
+ : caretShift);
664
+ if (positionToApply > this._getActualInputLength()) {
665
+ positionToApply =
666
+ el.value === this._maskService.decimalMarker && el.value.length === 1
667
+ ? this._getActualInputLength() + 1
668
+ : this._getActualInputLength();
669
+ }
670
+ if (positionToApply < 0) {
671
+ positionToApply = 0;
672
+ }
673
+ el.setSelectionRange(positionToApply, positionToApply);
674
+ this._position.set(null);
675
+ } else {
676
+ // eslint-disable-next-line no-console
677
+ console.warn(
678
+ 'Ngx-mask writeValue work with string | number, your current value:',
679
+ typeof transformedValue
680
+ );
681
+ }
682
+ } else {
683
+ if (!this._maskValue()) {
684
+ this.onChange(el.value);
685
+ return;
686
+ }
687
+ this._maskService.applyValueChanges(
688
+ el.value.length,
689
+ this._justPasted(),
690
+ this._code() === MaskExpression.BACKSPACE || this._code() === MaskExpression.DELETE
691
+ );
692
+ }
693
+ }
694
+
695
+ // IME starts
696
+ @HostListener('compositionstart', ['$event'])
697
+ public onCompositionStart(): void {
698
+ this._isComposing.set(true);
699
+ }
700
+
701
+ // IME completes
702
+ @HostListener('compositionend', ['$event'])
703
+ public onCompositionEnd(e: CustomKeyboardEvent): void {
704
+ this._isComposing.set(false);
705
+ this._justPasted.set(true);
706
+ this.onInput(e);
707
+ }
708
+
709
+ @HostListener('blur', ['$event'])
710
+ public onBlur(e: CustomKeyboardEvent): void {
711
+ if (this._maskValue()) {
712
+ const el: HTMLInputElement = e.target as HTMLInputElement;
713
+ if (
714
+ this._maskService.leadZero &&
715
+ el.value.length > 0 &&
716
+ typeof this._maskService.decimalMarker === 'string'
717
+ ) {
718
+ const maskExpression = this._maskService.maskExpression;
719
+ const decimalMarker = this._maskService.decimalMarker as string;
720
+ const suffix = this._maskService.suffix;
721
+ const precision = Number(
722
+ this._maskService.maskExpression.slice(
723
+ maskExpression.length - 1,
724
+ maskExpression.length
725
+ )
726
+ );
727
+
728
+ if (precision > 0) {
729
+ el.value = suffix ? el.value.split(suffix).join('') : el.value;
730
+ const decimalPart = el.value.split(decimalMarker)[1] as string;
731
+
732
+ el.value = el.value.includes(decimalMarker)
733
+ ? el.value +
734
+ MaskExpression.NUMBER_ZERO.repeat(precision - decimalPart.length) +
735
+ suffix
736
+ : el.value +
737
+ decimalMarker +
738
+ MaskExpression.NUMBER_ZERO.repeat(precision) +
739
+ suffix;
740
+ this._maskService.actualValue = el.value;
741
+ }
742
+ }
743
+ this._maskService.clearIfNotMatchFn();
744
+ }
745
+ this._isFocused.set(false);
746
+ this.onTouch();
747
+ }
748
+
749
+ @HostListener('click', ['$event'])
750
+ public onClick(e: MouseEvent | CustomKeyboardEvent): void {
751
+ if (!this._maskValue()) {
752
+ return;
753
+ }
754
+
755
+ const el: HTMLInputElement = e.target as HTMLInputElement;
756
+ const posStart = 0;
757
+ const posEnd = 0;
758
+
759
+ if (
760
+ el !== null &&
761
+ el.selectionStart !== null &&
762
+ el.selectionStart === el.selectionEnd &&
763
+ el.selectionStart > this._maskService.prefix.length &&
764
+ (e as any).keyCode !== 38
765
+ ) {
766
+ if (this._maskService.showMaskTyped && !this.keepCharacterPositions()) {
767
+ // We are showing the mask in the input
768
+ this._maskService.maskIsShown = this._maskService.showMaskInInput();
769
+ if (
770
+ el.setSelectionRange &&
771
+ this._maskService.prefix + this._maskService.maskIsShown === el.value
772
+ ) {
773
+ // the input ONLY contains the mask, so position the cursor at the start
774
+ el.focus();
775
+ el.setSelectionRange(posStart, posEnd);
776
+ } else {
777
+ // the input contains some characters already
778
+ if (el.selectionStart > this._maskService.actualValue.length) {
779
+ // if the user clicked beyond our value's length, position the cursor at the end of our value
780
+ el.setSelectionRange(
781
+ this._maskService.actualValue.length,
782
+ this._maskService.actualValue.length
783
+ );
784
+ }
785
+ }
786
+ }
787
+ }
788
+ const nextValue: string | null =
789
+ el &&
790
+ (el.value === this._maskService.prefix
791
+ ? this._maskService.prefix + this._maskService.maskIsShown
792
+ : el.value);
793
+
794
+ /** Fix of cursor position jumping to end in most browsers no matter where cursor is inserted onFocus */
795
+ if (el && el.value !== nextValue) {
796
+ el.value = nextValue;
797
+ }
798
+ /** fix of cursor position with prefix when mouse click occur */
799
+ if (
800
+ el &&
801
+ el.type !== 'number' &&
802
+ ((el.selectionStart as number) || (el.selectionEnd as number)) <=
803
+ this._maskService.prefix.length
804
+ ) {
805
+ const specialCharactersAtTheStart =
806
+ this._maskService.maskExpression.match(
807
+ new RegExp(
808
+ `^[${this._maskService.specialCharacters.map((c) => `\\${c}`).join('')}]+`
809
+ )
810
+ )?.[0].length || 0;
811
+
812
+ el.selectionStart = this._maskService.prefix.length + specialCharactersAtTheStart;
813
+ return;
814
+ }
815
+ /** select only inserted text */
816
+ if (el && (el.selectionEnd as number) > this._getActualInputLength()) {
817
+ el.selectionEnd = this._getActualInputLength();
818
+ }
819
+ }
820
+
821
+ @HostListener('keydown', ['$event'])
822
+ public onKeyDown(e: CustomKeyboardEvent): void {
823
+ if (!this._maskValue()) {
824
+ return;
825
+ }
826
+
827
+ if (this._isComposing()) {
828
+ // User finalize their choice from IME composition, so trigger onInput() for the composed text.
829
+ if (e.key === 'Enter') {
830
+ this.onCompositionEnd(e);
831
+ }
832
+ return;
833
+ }
834
+
835
+ this._code.set(e.code ? e.code : e.key);
836
+ const el: HTMLInputElement = e.target as HTMLInputElement;
837
+ this._inputValue.set(el.value);
838
+ this._setMask();
839
+
840
+ if (el.type !== 'number') {
841
+ if (e.key === MaskExpression.ARROW_UP) {
842
+ e.preventDefault();
843
+ }
844
+ if (
845
+ e.key === MaskExpression.ARROW_LEFT ||
846
+ e.key === MaskExpression.BACKSPACE ||
847
+ e.key === MaskExpression.DELETE
848
+ ) {
849
+ if (e.key === MaskExpression.BACKSPACE && el.value.length === 0) {
850
+ el.selectionStart = el.selectionEnd;
851
+ }
852
+ if (e.key === MaskExpression.BACKSPACE && (el.selectionStart as number) !== 0) {
853
+ const prefixLength = this.prefix().length;
854
+ // If specialChars is false, (shouldn't ever happen) then set to the defaults
855
+ const specialCharacters = this.specialCharacters().length
856
+ ? this.specialCharacters()
857
+ : this._config.specialCharacters;
858
+
859
+ if (prefixLength > 1 && (el.selectionStart as number) <= prefixLength) {
860
+ el.setSelectionRange(prefixLength, el.selectionEnd);
861
+ } else {
862
+ if (
863
+ this._inputValue().length !== (el.selectionStart as number) &&
864
+ (el.selectionStart as number) !== 1
865
+ ) {
866
+ while (
867
+ specialCharacters.includes(
868
+ (
869
+ this._inputValue()[(el.selectionStart as number) - 1] ??
870
+ MaskExpression.EMPTY_STRING
871
+ ).toString()
872
+ ) &&
873
+ ((prefixLength >= 1 &&
874
+ (el.selectionStart as number) > prefixLength) ||
875
+ prefixLength === 0)
876
+ ) {
877
+ el.setSelectionRange(
878
+ (el.selectionStart as number) - 1,
879
+ el.selectionEnd
880
+ );
881
+ }
882
+ }
883
+ }
884
+ }
885
+ this.checkSelectionOnDeletion(el);
886
+ if (
887
+ this._maskService.prefix.length &&
888
+ (el.selectionStart as number) <= this._maskService.prefix.length &&
889
+ (el.selectionEnd as number) <= this._maskService.prefix.length
890
+ ) {
891
+ e.preventDefault();
892
+ }
893
+ const cursorStart: number | null = el.selectionStart;
894
+ if (
895
+ e.key === MaskExpression.BACKSPACE &&
896
+ !el.readOnly &&
897
+ cursorStart === 0 &&
898
+ el.selectionEnd === el.value.length &&
899
+ el.value.length !== 0
900
+ ) {
901
+ this._position.set(
902
+ this._maskService.prefix ? this._maskService.prefix.length : 0
903
+ );
904
+ this._maskService.applyMask(
905
+ this._maskService.prefix,
906
+ this._maskService.maskExpression,
907
+ this._position() as number
908
+ );
909
+ }
910
+ }
911
+ if (
912
+ !!this.suffix() &&
913
+ this.suffix().length > 1 &&
914
+ this._inputValue().length - this.suffix().length < (el.selectionStart as number)
915
+ ) {
916
+ el.setSelectionRange(
917
+ this._inputValue().length - this.suffix().length,
918
+ this._inputValue().length
919
+ );
920
+ } else if (
921
+ (e.code === 'KeyA' && e.ctrlKey) ||
922
+ (e.code === 'KeyA' && e.metaKey) // Cmd + A (Mac)
923
+ ) {
924
+ el.setSelectionRange(0, this._getActualInputLength());
925
+ e.preventDefault();
926
+ }
927
+ this._maskService.selStart = el.selectionStart;
928
+ this._maskService.selEnd = el.selectionEnd;
929
+ }
930
+ }
931
+
932
+ /** It writes the value in the input */
933
+ public async writeValue(controlValue: unknown): Promise<void> {
934
+ let value = controlValue;
935
+ const inputTransformFn = this._maskService.inputTransformFn;
936
+ if (typeof value === 'object' && value !== null && 'value' in value) {
937
+ if ('disable' in value) {
938
+ this.setDisabledState(Boolean(value.disable));
939
+ }
940
+
941
+ value = value.value;
942
+ }
943
+ if (value !== null) {
944
+ value = inputTransformFn ? inputTransformFn(value) : value;
945
+ }
946
+ if (
947
+ typeof value === 'string' ||
948
+ typeof value === 'number' ||
949
+ value === null ||
950
+ typeof value === 'undefined'
951
+ ) {
952
+ if (value === null || typeof value === 'undefined' || value === '') {
953
+ this._maskService.currentValue = '';
954
+ this._maskService.previousValue = '';
955
+ }
956
+
957
+ let inputValue: string | number | null | undefined = value;
958
+ if (
959
+ typeof inputValue === 'number' ||
960
+ this._maskValue().startsWith(MaskExpression.SEPARATOR)
961
+ ) {
962
+ inputValue = String(inputValue);
963
+ const localeDecimalMarker = this._maskService.currentLocaleDecimalMarker();
964
+ if (!Array.isArray(this._maskService.decimalMarker)) {
965
+ inputValue =
966
+ this._maskService.decimalMarker !== localeDecimalMarker
967
+ ? inputValue.replace(
968
+ localeDecimalMarker,
969
+ this._maskService.decimalMarker
970
+ )
971
+ : inputValue;
972
+ }
973
+
974
+ if (
975
+ this._maskService.leadZero &&
976
+ inputValue &&
977
+ this.mask() &&
978
+ this.dropSpecialCharacters() !== false
979
+ ) {
980
+ inputValue = this._maskService._checkPrecision(
981
+ this._maskService.maskExpression,
982
+ inputValue as string
983
+ );
984
+ }
985
+
986
+ if (
987
+ this._maskService.decimalMarker === MaskExpression.COMMA ||
988
+ (Array.isArray(this._maskService.decimalMarker) &&
989
+ this._maskService.thousandSeparator === MaskExpression.DOT)
990
+ ) {
991
+ inputValue = inputValue
992
+ .toString()
993
+ .replace(MaskExpression.DOT, MaskExpression.COMMA);
994
+ }
995
+ if (this.mask()?.startsWith(MaskExpression.SEPARATOR) && this.leadZero()) {
996
+ requestAnimationFrame(() => {
997
+ this._maskService.applyMask(
998
+ inputValue?.toString() ?? '',
999
+ this._maskService.maskExpression
1000
+ );
1001
+ });
1002
+ }
1003
+ this._maskService.isNumberValue = true;
1004
+ }
1005
+
1006
+ if (typeof inputValue !== 'string' || value === null || typeof value === 'undefined') {
1007
+ inputValue = '';
1008
+ }
1009
+
1010
+ this._inputValue.set(inputValue);
1011
+ this._setMask();
1012
+
1013
+ if (
1014
+ (inputValue && this._maskService.maskExpression) ||
1015
+ (this._maskService.maskExpression &&
1016
+ (this._maskService.prefix || this._maskService.showMaskTyped))
1017
+ ) {
1018
+ // Let the service we know we are writing value so that triggering onChange function won't happen during applyMask
1019
+ this._maskService.writingValue = true;
1020
+
1021
+ this._maskService.formElementProperty = [
1022
+ 'value',
1023
+ this._maskService.applyMask(inputValue, this._maskService.maskExpression),
1024
+ ];
1025
+ // Let the service know we've finished writing value
1026
+ this._maskService.writingValue = false;
1027
+ } else {
1028
+ this._maskService.formElementProperty = ['value', inputValue];
1029
+ }
1030
+ this._inputValue.set(inputValue);
1031
+ } else {
1032
+ // eslint-disable-next-line no-console
1033
+ console.warn(
1034
+ 'Ngx-mask writeValue work with string | number, your current value:',
1035
+ typeof value
1036
+ );
1037
+ }
1038
+ }
1039
+
1040
+ public registerOnChange(fn: typeof this.onChange): void {
1041
+ this._maskService.onChange = this.onChange = fn;
1042
+ }
1043
+
1044
+ public registerOnTouched(fn: typeof this.onTouch): void {
1045
+ this.onTouch = fn;
1046
+ }
1047
+
1048
+ private _getActiveElement(document: DocumentOrShadowRoot = this.document): Element | null {
1049
+ const shadowRootEl = document?.activeElement?.shadowRoot;
1050
+ if (!shadowRootEl?.activeElement) {
1051
+ return document.activeElement;
1052
+ } else {
1053
+ return this._getActiveElement(shadowRootEl);
1054
+ }
1055
+ }
1056
+
1057
+ public checkSelectionOnDeletion(el: HTMLInputElement): void {
1058
+ const prefixLength = this.prefix().length;
1059
+ const suffixLength = this.suffix().length;
1060
+ const inputValueLength = this._inputValue().length;
1061
+
1062
+ el.selectionStart = Math.min(
1063
+ Math.max(prefixLength, el.selectionStart as number),
1064
+ inputValueLength - suffixLength
1065
+ );
1066
+ el.selectionEnd = Math.min(
1067
+ Math.max(prefixLength, el.selectionEnd as number),
1068
+ inputValueLength - suffixLength
1069
+ );
1070
+ }
1071
+
1072
+ /** It disables the input element */
1073
+ public setDisabledState(isDisabled: boolean): void {
1074
+ this._maskService.formElementProperty = ['disabled', isDisabled];
1075
+ }
1076
+
1077
+ private _applyMask(): any {
1078
+ this._maskService.maskExpression = this._maskService._repeatPatternSymbols(
1079
+ this._maskValue() || ''
1080
+ );
1081
+ this._maskService.formElementProperty = [
1082
+ 'value',
1083
+ this._maskService.applyMask(this._inputValue(), this._maskService.maskExpression),
1084
+ ];
1085
+ }
1086
+
1087
+ private _validateTime(value: string): ValidationErrors | null {
1088
+ const rowMaskLen: number = this._maskValue()
1089
+ .split(MaskExpression.EMPTY_STRING)
1090
+ .filter((s: string) => s !== ':').length;
1091
+ if (!value) {
1092
+ return null; // Don't validate empty values to allow for optional form control
1093
+ }
1094
+
1095
+ if (
1096
+ (+(value[value.length - 1] ?? -1) === 0 && value.length < rowMaskLen) ||
1097
+ value.length <= rowMaskLen - 2
1098
+ ) {
1099
+ return this._createValidationError(value);
1100
+ }
1101
+
1102
+ return null;
1103
+ }
1104
+
1105
+ private _getActualInputLength() {
1106
+ return (
1107
+ this._maskService.actualValue.length ||
1108
+ this._maskService.actualValue.length + this._maskService.prefix.length
1109
+ );
1110
+ }
1111
+
1112
+ private _createValidationError(actualValue: string): ValidationErrors {
1113
+ return {
1114
+ mask: {
1115
+ requiredMask: this._maskValue(),
1116
+ actualValue,
1117
+ },
1118
+ };
1119
+ }
1120
+
1121
+ private _setMask() {
1122
+ this._maskExpressionArray().some((mask): boolean | void => {
1123
+ const specialChart: boolean = mask
1124
+ .split(MaskExpression.EMPTY_STRING)
1125
+ .some((char) => this._maskService.specialCharacters.includes(char));
1126
+ if (
1127
+ (specialChart &&
1128
+ this._inputValue() &&
1129
+ this._areAllCharactersInEachStringSame(this._maskExpressionArray())) ||
1130
+ mask.includes(MaskExpression.CURLY_BRACKETS_LEFT)
1131
+ ) {
1132
+ const test =
1133
+ this._maskService.removeMask(this._inputValue())?.length <=
1134
+ this._maskService.removeMask(mask)?.length;
1135
+ if (test) {
1136
+ const maskValue = mask.includes(MaskExpression.CURLY_BRACKETS_LEFT)
1137
+ ? this._maskService._repeatPatternSymbols(mask)
1138
+ : mask;
1139
+ this._maskValue.set(maskValue);
1140
+ this._maskService.maskExpression = maskValue;
1141
+ return test;
1142
+ } else {
1143
+ const expression =
1144
+ this._maskExpressionArray()[this._maskExpressionArray().length - 1] ??
1145
+ MaskExpression.EMPTY_STRING;
1146
+
1147
+ const maskValue = expression.includes(MaskExpression.CURLY_BRACKETS_LEFT)
1148
+ ? this._maskService._repeatPatternSymbols(expression)
1149
+ : expression;
1150
+ this._maskValue.set(maskValue);
1151
+ this._maskService.maskExpression = maskValue;
1152
+ }
1153
+ } else {
1154
+ const cleanMask = this._maskService.removeMask(mask);
1155
+ const check: boolean = this._maskService
1156
+ .removeMask(this._inputValue())
1157
+ ?.split(MaskExpression.EMPTY_STRING)
1158
+ .every((character, index) => {
1159
+ const indexMask = cleanMask.charAt(index);
1160
+ return this._maskService._checkSymbolMask(character, indexMask);
1161
+ });
1162
+
1163
+ if (check || this._justPasted()) {
1164
+ this._maskValue.set(mask);
1165
+ this._maskService.maskExpression = mask;
1166
+ return check;
1167
+ }
1168
+ }
1169
+ });
1170
+ }
1171
+
1172
+ private _areAllCharactersInEachStringSame(array: string[]): boolean {
1173
+ const specialCharacters = this._maskService.specialCharacters;
1174
+
1175
+ function removeSpecialCharacters(str: string): string {
1176
+ const regex = new RegExp(`[${specialCharacters.map((ch) => `\\${ch}`).join('')}]`, 'g');
1177
+ return str.replace(regex, '');
1178
+ }
1179
+
1180
+ const processedArr = array.map(removeSpecialCharacters);
1181
+
1182
+ return processedArr.every((str) => {
1183
+ const uniqueCharacters = new Set(str);
1184
+ return uniqueCharacters.size === 1;
1185
+ });
1186
+ }
1187
+ }