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.
- package/assets/open_in_new.png +0 -0
- package/index.ts +1 -0
- package/ng-package.json +7 -0
- package/package.json +6 -19
- package/src/documentation/components/matcha-drawer.mdx +469 -0
- package/src/documentation/foundation/borders/border-radius.mdx +145 -0
- package/src/documentation/foundation/borders/border-size.mdx +111 -0
- package/src/documentation/foundation/borders/border-style.mdx +144 -0
- package/src/documentation/foundation/colors/all-colors.mdx +153 -0
- package/src/documentation/foundation/colors/base/amber.mdx +235 -0
- package/src/documentation/foundation/colors/base/blue.mdx +235 -0
- package/src/documentation/foundation/colors/base/cyan.mdx +235 -0
- package/src/documentation/foundation/colors/base/deep-orange.mdx +235 -0
- package/src/documentation/foundation/colors/base/deep-purple.mdx +235 -0
- package/src/documentation/foundation/colors/base/green.mdx +235 -0
- package/src/documentation/foundation/colors/base/indigo.mdx +235 -0
- package/src/documentation/foundation/colors/base/light-blue.mdx +235 -0
- package/src/documentation/foundation/colors/base/light-green.mdx +235 -0
- package/src/documentation/foundation/colors/base/lime.mdx +235 -0
- package/src/documentation/foundation/colors/base/orange.mdx +235 -0
- package/src/documentation/foundation/colors/base/pink.mdx +235 -0
- package/src/documentation/foundation/colors/base/purple.mdx +235 -0
- package/src/documentation/foundation/colors/base/red.mdx +235 -0
- package/src/documentation/foundation/colors/base/teal.mdx +235 -0
- package/src/documentation/foundation/colors/base/yellow.mdx +235 -0
- package/src/documentation/foundation/colors/surface-colors.mdx +93 -0
- package/src/documentation/foundation/colors/theme/accent.mdx +235 -0
- package/src/documentation/foundation/colors/theme/primary.mdx +235 -0
- package/src/documentation/foundation/colors/theme/warn.mdx +235 -0
- package/src/documentation/foundation/displays/display-block.mdx +134 -0
- package/src/documentation/foundation/displays/display-flex.mdx +134 -0
- package/src/documentation/foundation/displays/display-grid.mdx +134 -0
- package/src/documentation/foundation/displays/display-inline-block.mdx +134 -0
- package/src/documentation/foundation/displays/display-inline-flex.mdx +134 -0
- package/src/documentation/foundation/displays/display-inline.mdx +134 -0
- package/src/documentation/foundation/displays/display-none.mdx +134 -0
- package/src/documentation/foundation/displays/display-table-cell.mdx +134 -0
- package/src/documentation/foundation/displays/display-table-row.mdx +134 -0
- package/src/documentation/foundation/displays/display-table.mdx +134 -0
- package/src/documentation/foundation/flexbox/flexbox.mdx +420 -0
- package/src/documentation/foundation/opacity/opacity.mdx +104 -0
- package/src/documentation/foundation/position/alignment.mdx +148 -0
- package/src/documentation/foundation/sizes/height/heights.mdx +96 -0
- package/src/documentation/foundation/sizes/height/max-heights.mdx +96 -0
- package/src/documentation/foundation/sizes/height/min-heights.mdx +96 -0
- package/src/documentation/foundation/sizes/width/max-width.mdx +95 -0
- package/src/documentation/foundation/sizes/width/min-width.mdx +96 -0
- package/src/documentation/foundation/sizes/width/widths.mdx +96 -0
- package/src/documentation/foundation/spacing/margins.mdx +227 -0
- package/src/documentation/foundation/spacing/paddings.mdx +225 -0
- package/src/documentation/foundation/typography/colors.mdx +26 -0
- package/src/documentation/foundation/typography/font-size.mdx +57 -0
- package/src/documentation/foundation/typography/font-weight.mdx +85 -0
- package/src/documentation/foundation/typography/letter-spacing.mdx +35 -0
- package/src/documentation/foundation/typography/line-clamp.mdx +145 -0
- package/src/documentation/foundation/typography/line-height.mdx +52 -0
- package/src/documentation/foundation/typography/message-box.mdx +43 -0
- package/src/documentation/foundation/typography/paragraph.mdx +165 -0
- package/src/documentation/foundation/typography/text-align.mdx +22 -0
- package/src/documentation/foundation/typography/text-styles.mdx +88 -0
- package/src/documentation/presentation.mdx +591 -0
- package/src/documentation/services/matcha-breakpoint-observer.mdx +310 -0
- package/src/documentation/tokens/animations.mdx +116 -0
- package/src/documentation/tokens/breakpoints.mdx +57 -0
- package/src/documentation/tokens/colors.mdx +1884 -0
- package/src/documentation/tokens/elevations.mdx +50 -0
- package/src/documentation/tokens/sizes.mdx +150 -0
- package/src/lib/matcha-accordion/accordion/accordion.component.html +1 -0
- package/src/lib/matcha-accordion/accordion/accordion.component.scss +0 -0
- package/src/lib/matcha-accordion/accordion/accordion.component.ts +72 -0
- package/src/lib/matcha-accordion/accordion-content/accordion-content.component.html +1 -0
- package/src/lib/matcha-accordion/accordion-content/accordion-content.component.scss +0 -0
- package/src/lib/matcha-accordion/accordion-content/accordion-content.component.ts +11 -0
- package/src/lib/matcha-accordion/accordion-header/accordion-header.component.html +1 -0
- package/src/lib/matcha-accordion/accordion-header/accordion-header.component.scss +0 -0
- package/src/lib/matcha-accordion/accordion-header/accordion-header.component.ts +11 -0
- package/src/lib/matcha-accordion/accordion-item/accordion-item.component.html +13 -0
- package/src/lib/matcha-accordion/accordion-item/accordion-item.component.scss +0 -0
- package/src/lib/matcha-accordion/accordion-item/accordion-item.component.ts +63 -0
- package/src/lib/matcha-accordion/accordion.module.ts +37 -0
- package/src/lib/matcha-accordion/accordion.stories.ts +108 -0
- package/src/lib/matcha-animations/animations.ts +406 -0
- package/src/lib/matcha-autocomplete/README.md +185 -0
- package/src/lib/matcha-autocomplete/matcha-autocomplete.component.html +13 -0
- package/src/lib/matcha-autocomplete/matcha-autocomplete.component.ts +238 -0
- package/src/lib/matcha-autocomplete/matcha-autocomplete.directive.ts +153 -0
- package/src/lib/matcha-autocomplete/matcha-autocomplete.module.ts +30 -0
- package/src/lib/matcha-autocomplete/matcha-autocomplete.stories.ts +172 -0
- package/src/lib/matcha-avatar/avatar/avatar.component.html +29 -0
- package/src/lib/matcha-avatar/avatar/avatar.component.scss +0 -0
- package/src/lib/matcha-avatar/avatar/avatar.component.ts +78 -0
- package/src/lib/matcha-avatar/avatar.module.ts +17 -0
- package/src/lib/matcha-badge/badge.argtypes.ts +77 -0
- package/src/lib/matcha-badge/badge.directive.ts +12 -0
- package/src/lib/matcha-badge/badge.mdx +69 -0
- package/src/lib/matcha-badge/badge.module.ts +9 -0
- package/src/lib/matcha-badge/badge.stories.ts +79 -0
- package/src/lib/matcha-breakpoint-observable/breakpoint-observable.module.ts +23 -0
- package/src/lib/matcha-breakpoint-observable/breakpoint-observer.service.ts +215 -0
- package/src/lib/matcha-breakpoint-observable/index.ts +2 -0
- package/src/lib/matcha-button/button/button.component.html +1 -0
- package/src/lib/matcha-button/button/button.component.scss +0 -0
- package/src/lib/matcha-button/button/button.component.ts +182 -0
- package/src/lib/matcha-button/button.argtypes.ts +105 -0
- package/src/lib/matcha-button/button.module.ts +10 -0
- package/src/lib/matcha-button/button.stories.ts +552 -0
- package/src/lib/matcha-button-toggle/button-toggle/button-toggle.component.html +8 -0
- package/src/lib/matcha-button-toggle/button-toggle/button-toggle.component.scss +0 -0
- package/src/lib/matcha-button-toggle/button-toggle/button-toggle.component.ts +87 -0
- package/src/lib/matcha-button-toggle/button-toggle.module.ts +16 -0
- package/src/lib/matcha-button-toggle/button-toggle.stories.ts +106 -0
- package/src/lib/matcha-card/card/card.component.html +1 -0
- package/src/lib/matcha-card/card/card.component.scss +0 -0
- package/src/lib/matcha-card/card/card.component.ts +86 -0
- package/src/lib/matcha-card/card-argtype.ts +54 -0
- package/src/lib/matcha-card/card.module.ts +22 -0
- package/src/lib/matcha-card/card.stories.ts +339 -0
- package/src/lib/matcha-checkbox/checkbox/checkbox.component.html +19 -0
- package/src/lib/matcha-checkbox/checkbox/checkbox.component.scss +0 -0
- package/src/lib/matcha-checkbox/checkbox/checkbox.component.ts +79 -0
- package/src/lib/matcha-checkbox/checkbox.module.ts +15 -0
- package/src/lib/matcha-checkbox/checkbox.stories.ts +391 -0
- package/src/lib/matcha-components.module.ts +149 -0
- package/src/lib/matcha-date-range/date-range/date-range.component.html +3 -0
- package/src/lib/matcha-date-range/date-range/date-range.component.scss +0 -0
- package/src/lib/matcha-date-range/date-range/date-range.component.ts +100 -0
- package/src/lib/matcha-date-range/date-range.module.ts +14 -0
- package/src/lib/matcha-divider/divider/divider.component.html +1 -0
- package/src/lib/matcha-divider/divider/divider.component.scss +0 -0
- package/src/lib/matcha-divider/divider/divider.component.ts +50 -0
- package/src/lib/matcha-divider/divider.argtypes.ts +57 -0
- package/src/lib/matcha-divider/divider.mdx +107 -0
- package/src/lib/matcha-divider/divider.module.ts +14 -0
- package/src/lib/matcha-divider/divider.stories.ts +44 -0
- package/src/lib/matcha-drawer/drawer/drawer.component.html +43 -0
- package/src/lib/matcha-drawer/drawer/drawer.component.ts +358 -0
- package/src/lib/matcha-drawer/drawer-container/drawer-container.component.html +3 -0
- package/src/lib/matcha-drawer/drawer-container/drawer-container.component.ts +36 -0
- package/src/lib/matcha-drawer/drawer-content/drawer-content.component.html +3 -0
- package/src/lib/matcha-drawer/drawer-content/drawer-content.component.ts +24 -0
- package/src/lib/matcha-drawer/drawer.module.ts +28 -0
- package/src/lib/matcha-drop-list/directives/drag-handle.directive.ts +22 -0
- package/src/lib/matcha-drop-list/directives/drag.directive.ts +369 -0
- package/src/lib/matcha-drop-list/drop-list/drop-list.component.html +27 -0
- package/src/lib/matcha-drop-list/drop-list/drop-list.component.ts +380 -0
- package/src/lib/matcha-drop-list/drop-list-argtype.ts +56 -0
- package/src/lib/matcha-drop-list/drop-list.module.ts +27 -0
- package/src/lib/matcha-drop-list/drop-list.stories.ts +314 -0
- package/src/lib/matcha-drop-list/services/drop-list.service.ts +30 -0
- package/src/lib/matcha-elevation/elevation.argtypes.ts +16 -0
- package/src/lib/matcha-elevation/elevation.directive.ts +30 -0
- package/src/lib/matcha-elevation/elevation.module.ts +10 -0
- package/src/lib/matcha-elevation/elevation.stories.ts +60 -0
- package/src/lib/matcha-form-field/form-field.argtype.ts +21 -0
- package/src/lib/matcha-form-field/form-field.stories.ts +45 -0
- package/src/lib/matcha-form-field/matcha-error/matcha-error.component.html +4 -0
- package/src/lib/matcha-form-field/matcha-error/matcha-error.component.scss +0 -0
- package/src/lib/matcha-form-field/matcha-error/matcha-error.component.ts +9 -0
- package/src/lib/matcha-form-field/matcha-form-field/matcha-form-field.component.html +19 -0
- package/src/lib/matcha-form-field/matcha-form-field/matcha-form-field.component.scss +0 -0
- package/src/lib/matcha-form-field/matcha-form-field/matcha-form-field.component.ts +30 -0
- package/src/lib/matcha-form-field/matcha-form-field.module.ts +13 -0
- package/src/lib/matcha-form-field/matcha-label/matcha-label.component.html +7 -0
- package/src/lib/matcha-form-field/matcha-label/matcha-label.component.scss +0 -0
- package/src/lib/matcha-form-field/matcha-label/matcha-label.component.ts +11 -0
- package/src/lib/matcha-grid/grid-argtype.ts +67 -0
- package/src/lib/matcha-grid/grid.component.html +3 -0
- package/src/lib/matcha-grid/grid.component.scss +0 -0
- package/src/lib/matcha-grid/grid.component.ts +114 -0
- package/src/lib/matcha-grid/grid.mdx +60 -0
- package/src/lib/matcha-grid/grid.module.ts +10 -0
- package/src/lib/matcha-grid/grid.stories.ts +125 -0
- package/src/lib/matcha-highlight/copy-button/copy-button.component.html +12 -0
- package/src/lib/matcha-highlight/copy-button/copy-button.component.scss +28 -0
- package/src/lib/matcha-highlight/copy-button/copy-button.component.ts +127 -0
- package/src/lib/matcha-highlight/highlight.component.ts +237 -0
- package/src/lib/matcha-highlight/highlight.module.ts +24 -0
- package/src/lib/matcha-highlight/prism-init.ts +11 -0
- package/src/lib/matcha-highlight/prism-languages.ts +5 -0
- package/src/lib/matcha-highlight/prismjs/components/index.js +82 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-abap.js +48 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-abap.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-abnf.js +54 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-abnf.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-actionscript.js +17 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-actionscript.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-ada.js +19 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-ada.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-apacheconf.js +47 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-apacheconf.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-apl.js +32 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-apl.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-applescript.js +20 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-applescript.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-arduino.js +5 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-arduino.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-arff.js +10 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-arff.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-asciidoc.js +234 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-asciidoc.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-asm6502.js +28 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-asm6502.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-aspnet.js +36 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-aspnet.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-autohotkey.js +27 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-autohotkey.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-autoit.js +34 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-autoit.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-basic.js +17 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-basic.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-batch.js +99 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-batch.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-bison.js +39 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-bison.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-bnf.js +21 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-bnf.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-brainfuck.js +20 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-brainfuck.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-bro.js +48 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-bro.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-cil.js +27 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-cil.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-clike.js +30 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-clike.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-clojure.js +13 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-clojure.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-cmake.js +29 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-cmake.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-coffeescript.js +92 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-coffeescript.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-core.js +553 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-core.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-crystal.js +51 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-crystal.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-csp.js +25 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-csp.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-css-extras.js +70 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-css-extras.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-css.js +51 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-css.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-d.js +64 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-d.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-dart.js +24 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-dart.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-django.js +60 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-django.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-docker.js +11 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-docker.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-ebnf.js +22 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-ebnf.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-eiffel.js +37 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-eiffel.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-ejs.js +24 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-ejs.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-elixir.js +93 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-elixir.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-elm.js +44 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-elm.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-erb.js +20 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-erb.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-erlang.js +44 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-erlang.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-flow.js +35 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-flow.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-fortran.js +40 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-fortran.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-fsharp.js +67 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-fsharp.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-gcode.js +15 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-gcode.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-gedcom.js +28 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-gedcom.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-gherkin.js +79 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-gherkin.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-git.js +68 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-git.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-glsl.js +16 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-glsl.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-gml.js +7 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-gml.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-go.js +12 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-go.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-graphql.js +31 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-graphql.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-groovy.js +65 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-groovy.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-haml.js +154 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-haml.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-handlebars.js +37 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-handlebars.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-haskell.js +38 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-haskell.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-haxe.js +45 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-haxe.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-hcl.js +65 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-hcl.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-hpkp.js +20 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-hpkp.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-hsts.js +20 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-hsts.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-http.js +79 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-http.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-ichigojam.js +15 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-ichigojam.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-icon.js +20 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-icon.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-inform7.js +61 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-inform7.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-ini.js +11 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-ini.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-io.js +31 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-io.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-j.js +25 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-j.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-javadoc.js +54 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-javadoc.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-javadoclike.js +86 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-javadoclike.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-javascript.js +86 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-javascript.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-javastacktrace.js +93 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-javastacktrace.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-jolie.js +55 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-jolie.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-js-extras.js +104 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-js-extras.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-jsdoc.js +73 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-jsdoc.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-json5.js +23 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-json5.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-jsonp.js +7 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-jsonp.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-jsx.js +126 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-jsx.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-julia.js +12 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-julia.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-keyman.js +14 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-keyman.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-kotlin.js +62 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-kotlin.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-latex.js +61 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-latex.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-less.js +54 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-less.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-liquid.js +12 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-liquid.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-lisp.js +197 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-lisp.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-livescript.js +119 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-livescript.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-lolcode.js +55 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-lolcode.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-lua.js +20 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-lua.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-makefile.js +34 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-makefile.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-markdown.js +227 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-markdown.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-markup-templating.js +123 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-markup-templating.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-markup.js +100 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-markup.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-matlab.js +16 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-matlab.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-mel.js +43 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-mel.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-mizar.js +12 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-mizar.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-monkey.js +31 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-monkey.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-n1ql.js +18 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-n1ql.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-n4js.js +14 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-n4js.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-nand2tetris-hdl.js +9 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-nand2tetris-hdl.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-nasm.js +24 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-nasm.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-nginx.js +11 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-nginx.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-nim.js +33 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-nim.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-nix.js +40 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-nix.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-nsis.js +29 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-nsis.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-objectivec.js +7 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-objectivec.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-ocaml.js +27 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-ocaml.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-opencl.js +49 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-opencl.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-oz.js +25 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-oz.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-parigp.js +30 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-parigp.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-parser.js +73 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-parser.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-pascal.js +55 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-pascal.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-php-extras.js +11 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-php-extras.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-phpdoc.js +27 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-phpdoc.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-plsql.js +26 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-plsql.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-powershell.js +60 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-powershell.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-processing.js +18 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-processing.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-prolog.js +20 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-prolog.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-properties.js +9 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-properties.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-protobuf.js +8 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-protobuf.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-pug.js +193 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-pug.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-puppet.js +136 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-puppet.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-pure.js +79 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-pure.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-q.js +51 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-q.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-qore.js +20 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-qore.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-r.js +22 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-r.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-reason.js +32 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-reason.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-regex.js +97 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-regex.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-renpy.js +29 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-renpy.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-rest.js +205 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-rest.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-rip.js +32 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-rip.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-roboconf.js +27 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-roboconf.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-ruby.js +143 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-ruby.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-rust.js +68 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-rust.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-sas.js +34 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-sas.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-scala.js +18 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-scala.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-scheme.js +33 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-scheme.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-smalltalk.js +31 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-smalltalk.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-smarty.js +87 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-smarty.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-soy.js +96 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-soy.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-sql.js +24 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-sql.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-stylus.js +111 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-stylus.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-swift.js +25 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-swift.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-t4-cs.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-t4-cs.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-t4-templating.js +49 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-t4-templating.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-t4-vb.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-t4-vb.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-tap.js +20 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-tap.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-tcl.js +46 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-tcl.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-textile.js +260 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-textile.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-toml.js +43 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-toml.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-tsx.js +2 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-tsx.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-tt2.js +56 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-tt2.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-twig.js +46 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-twig.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-vala.js +74 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-vala.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-vbnet.js +15 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-vbnet.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-velocity.js +72 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-velocity.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-verilog.js +20 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-verilog.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-vhdl.js +23 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-vhdl.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-vim.js +10 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-vim.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-visual-basic.js +34 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-visual-basic.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-wasm.js +31 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-wasm.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-wiki.js +81 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-wiki.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-xeora.js +114 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-xeora.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-xojo.js +20 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-xojo.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-xquery.js +164 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-xquery.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-yaml.js +47 -0
- package/src/lib/matcha-highlight/prismjs/components/prism-yaml.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/components.js +2 -0
- package/src/lib/matcha-highlight/prismjs/components.json +1031 -0
- package/src/lib/matcha-highlight/prismjs/plugins/autolinker/prism-autolinker.css +3 -0
- package/src/lib/matcha-highlight/prismjs/plugins/autolinker/prism-autolinker.js +81 -0
- package/src/lib/matcha-highlight/prismjs/plugins/autolinker/prism-autolinker.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/autoloader/prism-autoloader.js +214 -0
- package/src/lib/matcha-highlight/prismjs/plugins/autoloader/prism-autoloader.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/command-line/prism-command-line.css +33 -0
- package/src/lib/matcha-highlight/prismjs/plugins/command-line/prism-command-line.js +139 -0
- package/src/lib/matcha-highlight/prismjs/plugins/command-line/prism-command-line.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard.js +75 -0
- package/src/lib/matcha-highlight/prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/custom-class/prism-custom-class.js +31 -0
- package/src/lib/matcha-highlight/prismjs/plugins/custom-class/prism-custom-class.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/data-uri-highlight/prism-data-uri-highlight.js +98 -0
- package/src/lib/matcha-highlight/prismjs/plugins/data-uri-highlight/prism-data-uri-highlight.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/file-highlight/prism-file-highlight.js +105 -0
- package/src/lib/matcha-highlight/prismjs/plugins/file-highlight/prism-file-highlight.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/highlight-keywords/prism-highlight-keywords.js +17 -0
- package/src/lib/matcha-highlight/prismjs/plugins/highlight-keywords/prism-highlight-keywords.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/jsonp-highlight/prism-jsonp-highlight.js +206 -0
- package/src/lib/matcha-highlight/prismjs/plugins/jsonp-highlight/prism-jsonp-highlight.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/keep-markup/prism-keep-markup.js +99 -0
- package/src/lib/matcha-highlight/prismjs/plugins/keep-markup/prism-keep-markup.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/line-highlight/prism-line-highlight.css +49 -0
- package/src/lib/matcha-highlight/prismjs/plugins/line-highlight/prism-line-highlight.js +181 -0
- package/src/lib/matcha-highlight/prismjs/plugins/line-highlight/prism-line-highlight.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/line-numbers/prism-line-numbers.css +41 -0
- package/src/lib/matcha-highlight/prismjs/plugins/line-numbers/prism-line-numbers.js +168 -0
- package/src/lib/matcha-highlight/prismjs/plugins/line-numbers/prism-line-numbers.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.js +190 -0
- package/src/lib/matcha-highlight/prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/previewers/prism-previewers.css +242 -0
- package/src/lib/matcha-highlight/prismjs/plugins/previewers/prism-previewers.js +708 -0
- package/src/lib/matcha-highlight/prismjs/plugins/previewers/prism-previewers.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js +21 -0
- package/src/lib/matcha-highlight/prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/show-invisibles/prism-show-invisibles.css +34 -0
- package/src/lib/matcha-highlight/prismjs/plugins/show-invisibles/prism-show-invisibles.js +84 -0
- package/src/lib/matcha-highlight/prismjs/plugins/show-invisibles/prism-show-invisibles.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/show-language/prism-show-language.js +46 -0
- package/src/lib/matcha-highlight/prismjs/plugins/show-language/prism-show-language.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/toolbar/prism-toolbar.css +58 -0
- package/src/lib/matcha-highlight/prismjs/plugins/toolbar/prism-toolbar.js +149 -0
- package/src/lib/matcha-highlight/prismjs/plugins/toolbar/prism-toolbar.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/unescaped-markup/prism-unescaped-markup.css +10 -0
- package/src/lib/matcha-highlight/prismjs/plugins/unescaped-markup/prism-unescaped-markup.js +44 -0
- package/src/lib/matcha-highlight/prismjs/plugins/unescaped-markup/prism-unescaped-markup.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/plugins/wpd/prism-wpd.css +11 -0
- package/src/lib/matcha-highlight/prismjs/plugins/wpd/prism-wpd.js +169 -0
- package/src/lib/matcha-highlight/prismjs/plugins/wpd/prism-wpd.min.js +1 -0
- package/src/lib/matcha-highlight/prismjs/prism.d.ts +4 -0
- package/src/lib/matcha-highlight/prismjs/prism.js +960 -0
- package/src/lib/matcha-highlight/prismjs/themes/prism-coy.css +226 -0
- package/src/lib/matcha-highlight/prismjs/themes/prism-dark.css +129 -0
- package/src/lib/matcha-highlight/prismjs/themes/prism-funky.css +117 -0
- package/src/lib/matcha-highlight/prismjs/themes/prism-okaidia.css +123 -0
- package/src/lib/matcha-highlight/prismjs/themes/prism-solarizedlight.css +150 -0
- package/src/lib/matcha-highlight/prismjs/themes/prism-tomorrow.css +122 -0
- package/src/lib/matcha-highlight/prismjs/themes/prism-twilight.css +199 -0
- package/src/lib/matcha-highlight/prismjs/themes/prism.css +139 -0
- package/src/lib/matcha-hint-text/hint/hint-text.component.html +4 -0
- package/src/lib/matcha-hint-text/hint/hint-text.component.scss +0 -0
- package/src/lib/matcha-hint-text/hint/hint-text.component.ts +31 -0
- package/src/lib/matcha-hint-text/hint.module.ts +15 -0
- package/src/lib/matcha-hint-text/hint.stories.ts +52 -0
- package/src/lib/matcha-icon/icon-argtype.ts +36 -0
- package/src/lib/matcha-icon/icon.component.html +3 -0
- package/src/lib/matcha-icon/icon.component.scss +0 -0
- package/src/lib/matcha-icon/icon.component.ts +34 -0
- package/src/lib/matcha-icon/icon.mdx +58 -0
- package/src/lib/matcha-icon/icon.module.ts +11 -0
- package/src/lib/matcha-icon/icon.stories.ts +431 -0
- package/src/lib/matcha-infinite-scroll/matcha-infinite-scroll/matcha-infinite-scroll.component.html +0 -0
- package/src/lib/matcha-infinite-scroll/matcha-infinite-scroll/matcha-infinite-scroll.component.scss +0 -0
- package/src/lib/matcha-infinite-scroll/matcha-infinite-scroll/matcha-infinite-scroll.component.ts +49 -0
- package/src/lib/matcha-infinite-scroll/matcha-infinite-scroll-data/matcha-infinite-scroll-data.component.html +0 -0
- package/src/lib/matcha-infinite-scroll/matcha-infinite-scroll-data/matcha-infinite-scroll-data.component.scss +0 -0
- package/src/lib/matcha-infinite-scroll/matcha-infinite-scroll-data/matcha-infinite-scroll-data.component.ts +165 -0
- package/src/lib/matcha-infinite-scroll/matcha-infinite-scroll.module.ts +14 -0
- package/src/lib/matcha-input/input.argtypes.ts +39 -0
- package/src/lib/matcha-input/input.directive.ts +12 -0
- package/src/lib/matcha-input/input.mdx +73 -0
- package/src/lib/matcha-input/input.module.ts +9 -0
- package/src/lib/matcha-input/input.stories.ts +97 -0
- package/src/lib/matcha-input-phone/all-countries.ts +1366 -0
- package/src/lib/matcha-input-phone/input-phone.argtypes.ts +83 -0
- package/src/lib/matcha-input-phone/input-phone.component.html +33 -0
- package/src/lib/matcha-input-phone/input-phone.component.spec.ts +23 -0
- package/src/lib/matcha-input-phone/input-phone.component.ts +267 -0
- package/src/lib/matcha-input-phone/input-phone.module.ts +22 -0
- package/src/lib/matcha-input-phone/input-phone.stories.ts +85 -0
- package/src/lib/matcha-input-phone/lib/custom-keyboard-event.ts +21 -0
- package/src/lib/matcha-input-phone/lib/ngx-mask-applier.service.ts +1073 -0
- package/src/lib/matcha-input-phone/lib/ngx-mask-expression.enum.ts +43 -0
- package/src/lib/matcha-input-phone/lib/ngx-mask.config.ts +132 -0
- package/src/lib/matcha-input-phone/lib/ngx-mask.directive.ts +1187 -0
- package/src/lib/matcha-input-phone/lib/ngx-mask.module.ts +55 -0
- package/src/lib/matcha-input-phone/lib/ngx-mask.pipe.ts +131 -0
- package/src/lib/matcha-input-phone/lib/ngx-mask.providers.ts +42 -0
- package/src/lib/matcha-input-phone/lib/ngx-mask.service.ts +832 -0
- package/src/lib/matcha-lazyload/lazyload/lazyload.component.html +1 -0
- package/src/lib/matcha-lazyload/lazyload/lazyload.component.scss +0 -0
- package/src/lib/matcha-lazyload/lazyload/lazyload.component.ts +48 -0
- package/src/lib/matcha-lazyload/lazyload-data/lazyload-data.component.html +1 -0
- package/src/lib/matcha-lazyload/lazyload-data/lazyload-data.component.scss +0 -0
- package/src/lib/matcha-lazyload/lazyload-data/lazyload-data.component.ts +172 -0
- package/src/lib/matcha-lazyload/lazyload.module.ts +14 -0
- package/src/lib/matcha-masonry/masonry/masonry.component.html +3 -0
- package/src/lib/matcha-masonry/masonry/masonry.component.scss +0 -0
- package/src/lib/matcha-masonry/masonry/masonry.component.ts +45 -0
- package/src/lib/matcha-masonry/masonry.argtype.ts +97 -0
- package/src/lib/matcha-masonry/masonry.mdx +133 -0
- package/src/lib/matcha-masonry/masonry.module.ts +10 -0
- package/src/lib/matcha-masonry/masonry.stories.ts +64 -0
- package/src/lib/matcha-menu/menu.argtypes.ts +111 -0
- package/src/lib/matcha-menu/menu.component.html +3 -0
- package/src/lib/matcha-menu/menu.component.scss +0 -0
- package/src/lib/matcha-menu/menu.component.spec.ts +23 -0
- package/src/lib/matcha-menu/menu.component.ts +48 -0
- package/src/lib/matcha-menu/menu.directive.ts +39 -0
- package/src/lib/matcha-menu/menu.mdx +59 -0
- package/src/lib/matcha-menu/menu.module.ts +19 -0
- package/src/lib/matcha-menu/menu.stories.ts +122 -0
- package/src/lib/matcha-modal/exemplo/exemple-modal-content.component.html +34 -0
- package/src/lib/matcha-modal/exemplo/exemple-modal-content.component.ts +44 -0
- package/src/lib/matcha-modal/exemplo/exemple-modal.component.html +46 -0
- package/src/lib/matcha-modal/exemplo/exemple-modal.component.ts +34 -0
- package/src/lib/matcha-modal/matcha-modal.module.ts +45 -0
- package/src/lib/matcha-modal/modal/modal.component.html +3 -0
- package/src/lib/matcha-modal/modal/modal.component.scss +0 -0
- package/src/lib/matcha-modal/modal/modal.component.ts +67 -0
- package/src/lib/matcha-modal/modal-content/modal-content.component.html +9 -0
- package/src/lib/matcha-modal/modal-content/modal-content.component.scss +0 -0
- package/src/lib/matcha-modal/modal-content/modal-content.component.ts +11 -0
- package/src/lib/matcha-modal/modal-footer/modal-footer.component.html +8 -0
- package/src/lib/matcha-modal/modal-footer/modal-footer.component.scss +0 -0
- package/src/lib/matcha-modal/modal-footer/modal-footer.component.ts +32 -0
- package/src/lib/matcha-modal/modal-header/modal-header.component.html +13 -0
- package/src/lib/matcha-modal/modal-header/modal-header.component.scss +0 -0
- package/src/lib/matcha-modal/modal-header/modal-header.component.ts +11 -0
- package/src/lib/matcha-modal/modal-options/modal-options.component.html +3 -0
- package/src/lib/matcha-modal/modal-options/modal-options.component.scss +0 -0
- package/src/lib/matcha-modal/modal-options/modal-options.component.ts +11 -0
- package/src/lib/matcha-modal/modal.service.ts +47 -0
- package/src/lib/matcha-modal/modal.stories.argtypes.ts +56 -0
- package/src/lib/matcha-modal/modal.stories.ts +333 -0
- package/src/lib/matcha-modal/model/IMatchaModalComponent.ts +1 -0
- package/src/lib/matcha-modal/overlay.service.ts +138 -0
- package/src/lib/matcha-option/README.md +144 -0
- package/src/lib/matcha-option/matcha-option-parent.interface.ts +22 -0
- package/src/lib/matcha-option/matcha-option.component.ts +93 -0
- package/src/lib/matcha-option/matcha-option.module.ts +17 -0
- package/src/lib/matcha-option/matcha-option.stories.ts +127 -0
- package/src/lib/matcha-overflow-draggable/matcha-overflow-draggable.component.html +3 -0
- package/src/lib/matcha-overflow-draggable/matcha-overflow-draggable.component.scss +0 -0
- package/src/lib/matcha-overflow-draggable/matcha-overflow-draggable.component.ts +56 -0
- package/src/lib/matcha-page-layout/page-layout.component.html +18 -0
- package/src/lib/matcha-page-layout/page-layout.component.scss +5 -0
- package/src/lib/matcha-page-layout/page-layout.component.ts +11 -0
- package/src/lib/matcha-page-layout/page-layout.module.ts +19 -0
- package/src/lib/matcha-paginator/paginator/page-event.interface.ts +13 -0
- package/src/lib/matcha-paginator/paginator/paginator.component.html +59 -0
- package/src/lib/matcha-paginator/paginator/paginator.component.scss +0 -0
- package/src/lib/matcha-paginator/paginator/paginator.component.ts +154 -0
- package/src/lib/matcha-paginator/paginator-intl.service.ts +39 -0
- package/src/lib/matcha-paginator/paginator.module.ts +13 -0
- package/src/lib/matcha-panel/matcha-panel.component.ts +223 -0
- package/src/lib/matcha-panel/matcha-panel.module.ts +17 -0
- package/src/lib/matcha-progress-bar/progress-bar.argtype.ts +48 -0
- package/src/lib/matcha-progress-bar/progress-bar.directive.ts +17 -0
- package/src/lib/matcha-progress-bar/progress-bar.mdx +95 -0
- package/src/lib/matcha-progress-bar/progress-bar.module.ts +14 -0
- package/src/lib/matcha-progress-bar/progress-bar.stories.ts +89 -0
- package/src/lib/matcha-radio/radio/radio.component.html +20 -0
- package/src/lib/matcha-radio/radio/radio.component.scss +0 -0
- package/src/lib/matcha-radio/radio/radio.component.ts +84 -0
- package/src/lib/matcha-radio/radio.module.ts +16 -0
- package/src/lib/matcha-radio/radio.stories.ts +175 -0
- package/src/lib/matcha-ripple/ripple.directive.ts +71 -0
- package/src/lib/matcha-ripple/ripple.module.ts +16 -0
- package/src/lib/matcha-select/matcha-select.component.html +30 -0
- package/src/lib/matcha-select/matcha-select.component.scss +3 -0
- package/src/lib/matcha-select/matcha-select.component.ts +467 -0
- package/src/lib/matcha-select/matcha-select.directive.ts +147 -0
- package/src/lib/matcha-select/matcha-select.module.ts +23 -0
- package/src/lib/matcha-sidenav/sidenav.argtypes.ts +60 -0
- package/src/lib/matcha-sidenav/sidenav.directive.ts +12 -0
- package/src/lib/matcha-sidenav/sidenav.mdx +57 -0
- package/src/lib/matcha-sidenav/sidenav.module.ts +10 -0
- package/src/lib/matcha-sidenav/sidenav.stories.ts +79 -0
- package/src/lib/matcha-skeleton/skeleton/skeleton.component.html +70 -0
- package/src/lib/matcha-skeleton/skeleton/skeleton.component.scss +0 -0
- package/src/lib/matcha-skeleton/skeleton/skeleton.component.ts +36 -0
- package/src/lib/matcha-skeleton/skeleton-argtype.ts +67 -0
- package/src/lib/matcha-skeleton/skeleton.module.ts +11 -0
- package/src/lib/matcha-skeleton/skeleton.stories.ts +74 -0
- package/src/lib/matcha-slide-toggle/slide-toggle/slide-toggle.component.html +15 -0
- package/src/lib/matcha-slide-toggle/slide-toggle/slide-toggle.component.scss +0 -0
- package/src/lib/matcha-slide-toggle/slide-toggle/slide-toggle.component.ts +96 -0
- package/src/lib/matcha-slide-toggle/slide-toggle.module.ts +18 -0
- package/src/lib/matcha-slide-toggle/slide-toggle.stories.ts +78 -0
- package/src/lib/matcha-slider/matcha-slider.directive.ts +17 -0
- package/src/lib/matcha-slider/slider.argtypes.ts +76 -0
- package/src/lib/matcha-slider/slider.mdx +45 -0
- package/src/lib/matcha-slider/slider.module.ts +12 -0
- package/src/lib/matcha-slider/slider.stories.ts +149 -0
- package/src/lib/matcha-snackbar/snack-bar-overview-example.component.ts +22 -0
- package/src/lib/matcha-snackbar/snack-bar-overview-example.css +3 -0
- package/src/lib/matcha-snackbar/snack-bar-overview-example.html +11 -0
- package/src/lib/matcha-snackbar/snack-bar.argtypes.ts +11 -0
- package/src/lib/matcha-snackbar/snack-bar.directive.ts +12 -0
- package/src/lib/matcha-snackbar/snack-bar.mdx +53 -0
- package/src/lib/matcha-snackbar/snack-bar.module.ts +10 -0
- package/src/lib/matcha-snackbar/snack-bar.stories.ts +34 -0
- package/src/lib/matcha-sort-header/example/sort-overview-example.component.ts +66 -0
- package/src/lib/matcha-sort-header/example/sort-overview-example.css +3 -0
- package/src/lib/matcha-sort-header/example/sort-overview-example.html +21 -0
- package/src/lib/matcha-sort-header/sort-header.argtypes.ts +11 -0
- package/src/lib/matcha-sort-header/sort-header.directive.ts +17 -0
- package/src/lib/matcha-sort-header/sort-header.mdx +78 -0
- package/src/lib/matcha-sort-header/sort-header.module.ts +10 -0
- package/src/lib/matcha-sort-header/sort-header.stories.ts +34 -0
- package/src/lib/matcha-spin/spin/spin.component.html +27 -0
- package/src/lib/matcha-spin/spin/spin.component.scss +0 -0
- package/src/lib/matcha-spin/spin/spin.component.ts +70 -0
- package/src/lib/matcha-spin/spin.module.ts +16 -0
- package/src/lib/matcha-spin/spin.stories.ts +85 -0
- package/src/lib/matcha-spinner/spinner/spinner.component.html +29 -0
- package/src/lib/matcha-spinner/spinner/spinner.component.scss +1 -0
- package/src/lib/matcha-spinner/spinner/spinner.component.ts +74 -0
- package/src/lib/matcha-spinner/spinner.module.ts +15 -0
- package/src/lib/matcha-spinner/spinner.stories.ts +85 -0
- package/src/lib/matcha-stepper/next-step.diretive.ts +21 -0
- package/src/lib/matcha-stepper/prev-step.diretive.ts +21 -0
- package/src/lib/matcha-stepper/step/step.component.ts +11 -0
- package/src/lib/matcha-stepper/step-content.diretive.ts +9 -0
- package/src/lib/matcha-stepper/stepper/stepper.component.ts +20 -0
- package/src/lib/matcha-stepper/stepper-content/stepper-content.component.ts +38 -0
- package/src/lib/matcha-stepper/stepper-controller/stepper-controller.component.html +8 -0
- package/src/lib/matcha-stepper/stepper-controller/stepper-controller.component.ts +26 -0
- package/src/lib/matcha-stepper/stepper.argtypes.ts +74 -0
- package/src/lib/matcha-stepper/stepper.module.ts +32 -0
- package/src/lib/matcha-stepper/stepper.service.ts +50 -0
- package/src/lib/matcha-stepper/stepper.stories.ts +117 -0
- package/src/lib/matcha-table/example/table-basic-example.component.ts +36 -0
- package/src/lib/matcha-table/example/table-basic-example.css +0 -0
- package/src/lib/matcha-table/example/table-basic-example.html +35 -0
- package/src/lib/matcha-table/table.argtypes.ts +11 -0
- package/src/lib/matcha-table/table.directive.ts +17 -0
- package/src/lib/matcha-table/table.mdx +78 -0
- package/src/lib/matcha-table/table.module.ts +10 -0
- package/src/lib/matcha-table/table.stories.ts +34 -0
- package/src/lib/matcha-tabs/tab-item/tab-item.component.html +1 -0
- package/src/lib/matcha-tabs/tab-item/tab-item.component.scss +0 -0
- package/src/lib/matcha-tabs/tab-item/tab-item.component.ts +19 -0
- package/src/lib/matcha-tabs/tabs/tabs.component.html +22 -0
- package/src/lib/matcha-tabs/tabs/tabs.component.scss +0 -0
- package/src/lib/matcha-tabs/tabs/tabs.component.ts +58 -0
- package/src/lib/matcha-tabs/tabs.module.ts +19 -0
- package/src/lib/matcha-tabs/tabs.stories.ts +98 -0
- package/src/lib/matcha-time/time/time.component.html +3 -0
- package/src/lib/matcha-time/time/time.component.scss +0 -0
- package/src/lib/matcha-time/time/time.component.ts +141 -0
- package/src/lib/matcha-time/time.module.ts +14 -0
- package/src/lib/matcha-time/time.stories.ts +244 -0
- package/src/lib/matcha-title/title/title.component.html +8 -0
- package/src/lib/matcha-title/title/title.component.scss +5 -0
- package/src/lib/matcha-title/title/title.component.ts +73 -0
- package/src/lib/matcha-title/title.argtypes.ts +69 -0
- package/src/lib/matcha-title/title.module.ts +10 -0
- package/src/lib/matcha-title/title.stories.ts +132 -0
- package/src/lib/matcha-toolbar/toolbar/toolbar.component.html +54 -0
- package/src/lib/matcha-toolbar/toolbar/toolbar.component.scss +0 -0
- package/src/lib/matcha-toolbar/toolbar/toolbar.component.ts +43 -0
- package/src/lib/matcha-toolbar/toolbar-button/toolbar-button.component.html +8 -0
- package/src/lib/matcha-toolbar/toolbar-button/toolbar-button.component.scss +0 -0
- package/src/lib/matcha-toolbar/toolbar-button/toolbar-button.component.ts +21 -0
- package/src/lib/matcha-toolbar/toolbar-content/toolbar-content.component.html +8 -0
- package/src/lib/matcha-toolbar/toolbar-content/toolbar-content.component.scss +0 -0
- package/src/lib/matcha-toolbar/toolbar-content/toolbar-content.component.ts +9 -0
- package/src/lib/matcha-toolbar/toolbar-custom-button/toolbar-custom-button.component.html +6 -0
- package/src/lib/matcha-toolbar/toolbar-custom-button/toolbar-custom-button.component.scss +0 -0
- package/src/lib/matcha-toolbar/toolbar-custom-button/toolbar-custom-button.component.ts +10 -0
- package/src/lib/matcha-toolbar/toolbar-main-button/toolbar-main-button.component.html +11 -0
- package/src/lib/matcha-toolbar/toolbar-main-button/toolbar-main-button.component.scss +0 -0
- package/src/lib/matcha-toolbar/toolbar-main-button/toolbar-main-button.component.ts +15 -0
- package/src/lib/matcha-toolbar/toolbar.argtypes.ts +27 -0
- package/src/lib/matcha-toolbar/toolbar.module.ts +36 -0
- package/src/lib/matcha-toolbar/toolbar.stories.ts +131 -0
- package/src/lib/matcha-tooltip/tooltip.argtypes.ts +58 -0
- package/src/lib/matcha-tooltip/tooltip.directive.ts +158 -0
- package/src/lib/matcha-tooltip/tooltip.module.ts +11 -0
- package/src/lib/matcha-tooltip/tooltip.stories.ts +259 -0
- package/src/lib/postcss.config.js +6 -0
- package/src/public-api.ts +180 -0
- package/tsconfig.lib.json +18 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/fesm2022/matcha-components.mjs +0 -6792
- package/fesm2022/matcha-components.mjs.map +0 -1
- package/index.d.ts +0 -1800
|
@@ -0,0 +1,832 @@
|
|
|
1
|
+
import { ElementRef, inject, Injectable, Renderer2, DOCUMENT } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import type { NgxMaskConfig } from './ngx-mask.config';
|
|
5
|
+
import { NGX_MASK_CONFIG } from './ngx-mask.config';
|
|
6
|
+
import { NgxMaskApplierService } from './ngx-mask-applier.service';
|
|
7
|
+
import { MaskExpression } from './ngx-mask-expression.enum';
|
|
8
|
+
|
|
9
|
+
@Injectable()
|
|
10
|
+
export class NgxMaskService extends NgxMaskApplierService {
|
|
11
|
+
public isNumberValue = false;
|
|
12
|
+
public maskIsShown = '';
|
|
13
|
+
public selStart: number | null = null;
|
|
14
|
+
public selEnd: number | null = null;
|
|
15
|
+
public maskChanged = false;
|
|
16
|
+
public maskExpressionArray: string[] = [];
|
|
17
|
+
public previousValue = '';
|
|
18
|
+
public currentValue = '';
|
|
19
|
+
/**
|
|
20
|
+
* Whether we are currently in writeValue function, in this case when applying the mask we don't want to trigger onChange function,
|
|
21
|
+
* since writeValue should be a one way only process of writing the DOM value based on the Angular model value.
|
|
22
|
+
*/
|
|
23
|
+
public writingValue = false;
|
|
24
|
+
|
|
25
|
+
private _emitValue = false;
|
|
26
|
+
private _start!: number;
|
|
27
|
+
private _end!: number;
|
|
28
|
+
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
30
|
+
public onChange = (_: any) => {};
|
|
31
|
+
|
|
32
|
+
public readonly _elementRef = inject(ElementRef, { optional: true });
|
|
33
|
+
|
|
34
|
+
private readonly document = inject(DOCUMENT);
|
|
35
|
+
|
|
36
|
+
protected override _config = inject<NgxMaskConfig>(NGX_MASK_CONFIG);
|
|
37
|
+
|
|
38
|
+
private readonly _renderer = inject(Renderer2, { optional: true });
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Applies the mask to the input value.
|
|
42
|
+
* @param inputValue The input value to be masked.
|
|
43
|
+
* @param maskExpression The mask expression to apply.
|
|
44
|
+
* @param position The position in the input value.
|
|
45
|
+
* @param justPasted Whether the value was just pasted.
|
|
46
|
+
* @param backspaced Whether the value was backspaced.
|
|
47
|
+
* @param cb Callback function.
|
|
48
|
+
* @returns The masked value.
|
|
49
|
+
*/
|
|
50
|
+
public override applyMask(
|
|
51
|
+
inputValue: string,
|
|
52
|
+
maskExpression: string,
|
|
53
|
+
position = 0,
|
|
54
|
+
justPasted = false,
|
|
55
|
+
backspaced = false,
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
57
|
+
cb: (...args: any[]) => any = () => {}
|
|
58
|
+
): string {
|
|
59
|
+
// If no mask expression, return the input value or the actual value
|
|
60
|
+
if (!maskExpression) {
|
|
61
|
+
return inputValue !== this.actualValue ? this.actualValue : inputValue;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Show mask in input if required
|
|
65
|
+
this.maskIsShown = this.showMaskTyped
|
|
66
|
+
? this.showMaskInInput()
|
|
67
|
+
: MaskExpression.EMPTY_STRING;
|
|
68
|
+
|
|
69
|
+
// Handle specific mask expressions
|
|
70
|
+
if (this.maskExpression === MaskExpression.IP && this.showMaskTyped) {
|
|
71
|
+
this.maskIsShown = this.showMaskInInput(inputValue || MaskExpression.HASH);
|
|
72
|
+
}
|
|
73
|
+
if (this.maskExpression === MaskExpression.CPF_CNPJ && this.showMaskTyped) {
|
|
74
|
+
this.maskIsShown = this.showMaskInInput(inputValue || MaskExpression.HASH);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Handle empty input value with mask typed
|
|
78
|
+
if (!inputValue && this.showMaskTyped) {
|
|
79
|
+
this.formControlResult(this.prefix);
|
|
80
|
+
return `${this.prefix}${this.maskIsShown}${this.suffix}`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const getSymbol: string =
|
|
84
|
+
!!inputValue && typeof this.selStart === 'number'
|
|
85
|
+
? (inputValue[this.selStart] ?? MaskExpression.EMPTY_STRING)
|
|
86
|
+
: MaskExpression.EMPTY_STRING;
|
|
87
|
+
let newInputValue = '';
|
|
88
|
+
let newPosition = position;
|
|
89
|
+
|
|
90
|
+
// Handle hidden input or input with asterisk symbol
|
|
91
|
+
if (
|
|
92
|
+
(this.hiddenInput ||
|
|
93
|
+
(inputValue && inputValue.indexOf(MaskExpression.SYMBOL_STAR) >= 0)) &&
|
|
94
|
+
!this.writingValue
|
|
95
|
+
) {
|
|
96
|
+
let actualResult: string[] =
|
|
97
|
+
inputValue && inputValue.length === 1
|
|
98
|
+
? inputValue.split(MaskExpression.EMPTY_STRING)
|
|
99
|
+
: this.actualValue.split(MaskExpression.EMPTY_STRING);
|
|
100
|
+
|
|
101
|
+
// Handle backspace
|
|
102
|
+
if (backspaced) {
|
|
103
|
+
actualResult = actualResult
|
|
104
|
+
.slice(0, position)
|
|
105
|
+
.concat(actualResult.slice(position + 1));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Remove mask if showMaskTyped is true
|
|
109
|
+
if (this.showMaskTyped) {
|
|
110
|
+
// eslint-disable-next-line no-param-reassign
|
|
111
|
+
inputValue = this.removeMask(inputValue);
|
|
112
|
+
actualResult = this.removeMask(actualResult.join('')).split(
|
|
113
|
+
MaskExpression.EMPTY_STRING
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Handle selection start and end
|
|
118
|
+
if (typeof this.selStart === 'object' && typeof this.selEnd === 'object') {
|
|
119
|
+
this.selStart = Number(this.selStart);
|
|
120
|
+
this.selEnd = Number(this.selEnd);
|
|
121
|
+
} else {
|
|
122
|
+
if (inputValue !== MaskExpression.EMPTY_STRING && actualResult.length) {
|
|
123
|
+
if (typeof this.selStart === 'number' && typeof this.selEnd === 'number') {
|
|
124
|
+
if (inputValue.length > actualResult.length) {
|
|
125
|
+
actualResult.splice(this.selStart, 0, getSymbol);
|
|
126
|
+
} else if (inputValue.length < actualResult.length) {
|
|
127
|
+
if (actualResult.length - inputValue.length === 1) {
|
|
128
|
+
if (backspaced) {
|
|
129
|
+
actualResult.splice(this.selStart - 1, 1);
|
|
130
|
+
} else {
|
|
131
|
+
actualResult.splice(inputValue.length - 1, 1);
|
|
132
|
+
}
|
|
133
|
+
} else {
|
|
134
|
+
actualResult.splice(this.selStart, this.selEnd - this.selStart);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
actualResult = [];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Remove mask if showMaskTyped is true and hiddenInput is false
|
|
144
|
+
if (this.showMaskTyped && !this.hiddenInput) {
|
|
145
|
+
newInputValue = this.removeMask(inputValue);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Handle actual value length
|
|
149
|
+
if (this.actualValue.length) {
|
|
150
|
+
if (actualResult.length < inputValue.length) {
|
|
151
|
+
newInputValue = this.shiftTypedSymbols(
|
|
152
|
+
actualResult.join(MaskExpression.EMPTY_STRING)
|
|
153
|
+
);
|
|
154
|
+
} else if (actualResult.length === inputValue.length) {
|
|
155
|
+
newInputValue = actualResult.join(MaskExpression.EMPTY_STRING);
|
|
156
|
+
} else {
|
|
157
|
+
newInputValue = inputValue;
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
newInputValue = inputValue;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Handle just pasted input
|
|
165
|
+
if (justPasted && (this.hiddenInput || !this.hiddenInput)) {
|
|
166
|
+
newInputValue = inputValue;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Handle backspace with special characters
|
|
170
|
+
if (
|
|
171
|
+
backspaced &&
|
|
172
|
+
this.specialCharacters.indexOf(
|
|
173
|
+
this.maskExpression[newPosition] ?? MaskExpression.EMPTY_STRING
|
|
174
|
+
) !== -1 &&
|
|
175
|
+
this.showMaskTyped &&
|
|
176
|
+
!this.prefix
|
|
177
|
+
) {
|
|
178
|
+
newInputValue = this.currentValue;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Handle deleted special character
|
|
182
|
+
if (this.deletedSpecialCharacter && newPosition) {
|
|
183
|
+
if (
|
|
184
|
+
this.specialCharacters.includes(
|
|
185
|
+
this.actualValue.slice(newPosition, newPosition + 1)
|
|
186
|
+
)
|
|
187
|
+
) {
|
|
188
|
+
newPosition = newPosition + 1;
|
|
189
|
+
} else if (
|
|
190
|
+
maskExpression.slice(newPosition - 1, newPosition + 1) !== MaskExpression.MONTHS
|
|
191
|
+
) {
|
|
192
|
+
newPosition = newPosition - 2;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
this.deletedSpecialCharacter = false;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Remove mask if showMaskTyped is true and placeHolderCharacter length is 1
|
|
199
|
+
if (
|
|
200
|
+
this.showMaskTyped &&
|
|
201
|
+
this.placeHolderCharacter.length === 1 &&
|
|
202
|
+
!this.leadZeroDateTime
|
|
203
|
+
) {
|
|
204
|
+
newInputValue = this.removeMask(newInputValue);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Handle mask changed
|
|
208
|
+
if (this.maskChanged) {
|
|
209
|
+
newInputValue = inputValue;
|
|
210
|
+
} else {
|
|
211
|
+
newInputValue =
|
|
212
|
+
Boolean(newInputValue) && newInputValue.length ? newInputValue : inputValue;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Handle showMaskTyped and keepCharacterPositions
|
|
216
|
+
if (
|
|
217
|
+
this.showMaskTyped &&
|
|
218
|
+
this.keepCharacterPositions &&
|
|
219
|
+
this.actualValue &&
|
|
220
|
+
!justPasted &&
|
|
221
|
+
!this.writingValue
|
|
222
|
+
) {
|
|
223
|
+
const value = this.dropSpecialCharacters
|
|
224
|
+
? this.removeMask(this.actualValue)
|
|
225
|
+
: this.actualValue;
|
|
226
|
+
this.formControlResult(value);
|
|
227
|
+
return this.actualValue
|
|
228
|
+
? this.actualValue
|
|
229
|
+
: `${this.prefix}${this.maskIsShown}${this.suffix}`;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Apply the mask using the parent class method
|
|
233
|
+
const result: string = super.applyMask(
|
|
234
|
+
newInputValue,
|
|
235
|
+
maskExpression,
|
|
236
|
+
newPosition,
|
|
237
|
+
justPasted,
|
|
238
|
+
backspaced,
|
|
239
|
+
cb
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
this.actualValue = this.getActualValue(result);
|
|
243
|
+
|
|
244
|
+
// handle some separator implications:
|
|
245
|
+
// a.) adjust decimalMarker default (. -> ,) if thousandSeparator is a dot
|
|
246
|
+
if (
|
|
247
|
+
this.thousandSeparator === MaskExpression.DOT &&
|
|
248
|
+
this.decimalMarker === MaskExpression.DOT
|
|
249
|
+
) {
|
|
250
|
+
this.decimalMarker = MaskExpression.COMMA;
|
|
251
|
+
}
|
|
252
|
+
// b) remove decimal marker from list of special characters to mask
|
|
253
|
+
if (
|
|
254
|
+
this.maskExpression.startsWith(MaskExpression.SEPARATOR) &&
|
|
255
|
+
this.dropSpecialCharacters === true
|
|
256
|
+
) {
|
|
257
|
+
this.specialCharacters = this.specialCharacters.filter(
|
|
258
|
+
(item: string) =>
|
|
259
|
+
!this._compareOrIncludes(item, this.decimalMarker, this.thousandSeparator) //item !== this.decimalMarker, // !
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Update previous and current values
|
|
264
|
+
if (result || result === '') {
|
|
265
|
+
this.previousValue = this.currentValue;
|
|
266
|
+
this.currentValue = result;
|
|
267
|
+
|
|
268
|
+
this._emitValue =
|
|
269
|
+
this.previousValue !== this.currentValue ||
|
|
270
|
+
(newInputValue !== this.currentValue && this.writingValue) ||
|
|
271
|
+
(this.previousValue === this.currentValue && justPasted);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// Propagate the input value back to the Angular model
|
|
275
|
+
// eslint-disable-next-line no-unused-expressions,@typescript-eslint/no-unused-expressions
|
|
276
|
+
this._emitValue ? this.formControlResult(result) : '';
|
|
277
|
+
|
|
278
|
+
// Handle hidden input and showMaskTyped
|
|
279
|
+
if (!this.showMaskTyped || (this.showMaskTyped && this.hiddenInput)) {
|
|
280
|
+
if (this.hiddenInput) {
|
|
281
|
+
return `${this.hideInput(result, this.maskExpression)}${this.maskIsShown.slice(result.length)}`;
|
|
282
|
+
}
|
|
283
|
+
return result;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const resLen: number = result.length;
|
|
287
|
+
const prefNmask = `${this.prefix}${this.maskIsShown}${this.suffix}`;
|
|
288
|
+
|
|
289
|
+
// Handle specific mask expressions
|
|
290
|
+
if (this.maskExpression.includes(MaskExpression.HOURS)) {
|
|
291
|
+
const countSkipedSymbol = this._numberSkipedSymbols(result);
|
|
292
|
+
return `${result}${prefNmask.slice(resLen + countSkipedSymbol)}`;
|
|
293
|
+
} else if (
|
|
294
|
+
this.maskExpression === MaskExpression.IP ||
|
|
295
|
+
this.maskExpression === MaskExpression.CPF_CNPJ
|
|
296
|
+
) {
|
|
297
|
+
return `${result}${prefNmask}`;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return `${result}${prefNmask.slice(resLen)}`;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// get the number of characters that were shifted
|
|
304
|
+
private _numberSkipedSymbols(value: string): number {
|
|
305
|
+
const regex = /(^|\D)(\d\D)/g;
|
|
306
|
+
let match = regex.exec(value);
|
|
307
|
+
let countSkipedSymbol = 0;
|
|
308
|
+
while (match != null) {
|
|
309
|
+
countSkipedSymbol += 1;
|
|
310
|
+
match = regex.exec(value);
|
|
311
|
+
}
|
|
312
|
+
return countSkipedSymbol;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
public applyValueChanges(
|
|
316
|
+
position: number,
|
|
317
|
+
justPasted: boolean,
|
|
318
|
+
backspaced: boolean,
|
|
319
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
320
|
+
cb: (...args: any[]) => any = () => {}
|
|
321
|
+
): void {
|
|
322
|
+
const formElement = this._elementRef?.nativeElement;
|
|
323
|
+
if (!formElement) {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
formElement.value = this.applyMask(
|
|
328
|
+
formElement.value,
|
|
329
|
+
this.maskExpression,
|
|
330
|
+
position,
|
|
331
|
+
justPasted,
|
|
332
|
+
backspaced,
|
|
333
|
+
cb
|
|
334
|
+
);
|
|
335
|
+
if (formElement === this._getActiveElement()) {
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
this.clearIfNotMatchFn();
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
public hideInput(inputValue: string, maskExpression: string): string {
|
|
342
|
+
return inputValue
|
|
343
|
+
.split(MaskExpression.EMPTY_STRING)
|
|
344
|
+
.map((curr: string, index: number) => {
|
|
345
|
+
if (
|
|
346
|
+
this.patterns &&
|
|
347
|
+
this.patterns[maskExpression[index] ?? MaskExpression.EMPTY_STRING] &&
|
|
348
|
+
this.patterns[maskExpression[index] ?? MaskExpression.EMPTY_STRING]?.symbol
|
|
349
|
+
) {
|
|
350
|
+
return this.patterns[maskExpression[index] ?? MaskExpression.EMPTY_STRING]
|
|
351
|
+
?.symbol;
|
|
352
|
+
}
|
|
353
|
+
return curr;
|
|
354
|
+
})
|
|
355
|
+
.join(MaskExpression.EMPTY_STRING);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// this function is not necessary, it checks result against maskExpression
|
|
359
|
+
public getActualValue(res: string): string {
|
|
360
|
+
const compare: string[] = res
|
|
361
|
+
.split(MaskExpression.EMPTY_STRING)
|
|
362
|
+
.filter((symbol: string, i: number) => {
|
|
363
|
+
const maskChar = this.maskExpression[i] ?? MaskExpression.EMPTY_STRING;
|
|
364
|
+
return (
|
|
365
|
+
this._checkSymbolMask(symbol, maskChar) ||
|
|
366
|
+
(this.specialCharacters.includes(maskChar) && symbol === maskChar)
|
|
367
|
+
);
|
|
368
|
+
});
|
|
369
|
+
if (compare.join(MaskExpression.EMPTY_STRING) === res) {
|
|
370
|
+
return compare.join(MaskExpression.EMPTY_STRING);
|
|
371
|
+
}
|
|
372
|
+
return res;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
public shiftTypedSymbols(inputValue: string): string {
|
|
376
|
+
let symbolToReplace = '';
|
|
377
|
+
const newInputValue: (string | undefined)[] =
|
|
378
|
+
(inputValue &&
|
|
379
|
+
inputValue
|
|
380
|
+
.split(MaskExpression.EMPTY_STRING)
|
|
381
|
+
.map((currSymbol: string, index: number) => {
|
|
382
|
+
if (
|
|
383
|
+
this.specialCharacters.includes(
|
|
384
|
+
inputValue[index + 1] ?? MaskExpression.EMPTY_STRING
|
|
385
|
+
) &&
|
|
386
|
+
inputValue[index + 1] !== this.maskExpression[index + 1]
|
|
387
|
+
) {
|
|
388
|
+
symbolToReplace = currSymbol;
|
|
389
|
+
return inputValue[index + 1];
|
|
390
|
+
}
|
|
391
|
+
if (symbolToReplace.length) {
|
|
392
|
+
const replaceSymbol: string = symbolToReplace;
|
|
393
|
+
symbolToReplace = MaskExpression.EMPTY_STRING;
|
|
394
|
+
return replaceSymbol;
|
|
395
|
+
}
|
|
396
|
+
return currSymbol;
|
|
397
|
+
})) ||
|
|
398
|
+
[];
|
|
399
|
+
return newInputValue.join(MaskExpression.EMPTY_STRING);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Convert number value to string
|
|
404
|
+
* 3.1415 -> '3.1415'
|
|
405
|
+
* 1e-7 -> '0.0000001'
|
|
406
|
+
*/
|
|
407
|
+
public numberToString(value: number | string): string {
|
|
408
|
+
if (
|
|
409
|
+
(!value && value !== 0) ||
|
|
410
|
+
(this.maskExpression.startsWith(MaskExpression.SEPARATOR) &&
|
|
411
|
+
(this.leadZero || !this.dropSpecialCharacters)) ||
|
|
412
|
+
(this.maskExpression.startsWith(MaskExpression.SEPARATOR) &&
|
|
413
|
+
this.separatorLimit.length > 14 &&
|
|
414
|
+
String(value).length > 14)
|
|
415
|
+
) {
|
|
416
|
+
return String(value);
|
|
417
|
+
}
|
|
418
|
+
return Number(value)
|
|
419
|
+
.toLocaleString('fullwide', {
|
|
420
|
+
useGrouping: false,
|
|
421
|
+
maximumFractionDigits: 20,
|
|
422
|
+
})
|
|
423
|
+
.replace(`/${MaskExpression.MINUS}/`, MaskExpression.MINUS);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
public showMaskInInput(inputVal?: string): string {
|
|
427
|
+
if (this.showMaskTyped && !!this.shownMaskExpression) {
|
|
428
|
+
if (this.maskExpression.length !== this.shownMaskExpression.length) {
|
|
429
|
+
throw new Error('Mask expression must match mask placeholder length');
|
|
430
|
+
} else {
|
|
431
|
+
return this.shownMaskExpression;
|
|
432
|
+
}
|
|
433
|
+
} else if (this.showMaskTyped) {
|
|
434
|
+
if (inputVal) {
|
|
435
|
+
if (this.maskExpression === MaskExpression.IP) {
|
|
436
|
+
return this._checkForIp(inputVal);
|
|
437
|
+
}
|
|
438
|
+
if (this.maskExpression === MaskExpression.CPF_CNPJ) {
|
|
439
|
+
return this._checkForCpfCnpj(inputVal);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
if (this.placeHolderCharacter.length === this.maskExpression.length) {
|
|
443
|
+
return this.placeHolderCharacter;
|
|
444
|
+
}
|
|
445
|
+
return this.maskExpression.replace(/\w/g, this.placeHolderCharacter);
|
|
446
|
+
}
|
|
447
|
+
return '';
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
public clearIfNotMatchFn(): void {
|
|
451
|
+
const formElement = this._elementRef?.nativeElement;
|
|
452
|
+
if (!formElement) {
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
if (
|
|
456
|
+
this.clearIfNotMatch &&
|
|
457
|
+
this.prefix.length + this.maskExpression.length + this.suffix.length !==
|
|
458
|
+
formElement.value.replace(this.placeHolderCharacter, MaskExpression.EMPTY_STRING)
|
|
459
|
+
.length
|
|
460
|
+
) {
|
|
461
|
+
this.formElementProperty = ['value', MaskExpression.EMPTY_STRING];
|
|
462
|
+
this.applyMask('', this.maskExpression);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
public set formElementProperty([name, value]: [string, string | boolean]) {
|
|
467
|
+
if (!this._renderer || !this._elementRef) {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
//[TODO]: andriikamaldinov1 find better solution
|
|
471
|
+
Promise.resolve().then(() =>
|
|
472
|
+
this._renderer?.setProperty(this._elementRef?.nativeElement, name, value)
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
public checkDropSpecialCharAmount(mask: string): number {
|
|
477
|
+
const chars: string[] = mask
|
|
478
|
+
.split(MaskExpression.EMPTY_STRING)
|
|
479
|
+
.filter((item: string) => this._findDropSpecialChar(item));
|
|
480
|
+
return chars.length;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
public removeMask(inputValue: string): string {
|
|
484
|
+
return this._removeMask(
|
|
485
|
+
this._removeSuffix(this._removePrefix(inputValue)),
|
|
486
|
+
this.specialCharacters.concat('_').concat(this.placeHolderCharacter)
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
private _checkForIp(inputVal: string): string {
|
|
491
|
+
if (inputVal === MaskExpression.HASH) {
|
|
492
|
+
return `${this.placeHolderCharacter}.${this.placeHolderCharacter}.${this.placeHolderCharacter}.${this.placeHolderCharacter}`;
|
|
493
|
+
}
|
|
494
|
+
const arr: string[] = [];
|
|
495
|
+
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
496
|
+
for (let i = 0; i < inputVal.length; i++) {
|
|
497
|
+
const value = inputVal[i] ?? MaskExpression.EMPTY_STRING;
|
|
498
|
+
if (!value) {
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
501
|
+
if (value.match('\\d')) {
|
|
502
|
+
arr.push(value);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
if (arr.length <= 3) {
|
|
506
|
+
return `${this.placeHolderCharacter}.${this.placeHolderCharacter}.${this.placeHolderCharacter}`;
|
|
507
|
+
}
|
|
508
|
+
if (arr.length > 3 && arr.length <= 6) {
|
|
509
|
+
return `${this.placeHolderCharacter}.${this.placeHolderCharacter}`;
|
|
510
|
+
}
|
|
511
|
+
if (arr.length > 6 && arr.length <= 9) {
|
|
512
|
+
return this.placeHolderCharacter;
|
|
513
|
+
}
|
|
514
|
+
if (arr.length > 9 && arr.length <= 12) {
|
|
515
|
+
return '';
|
|
516
|
+
}
|
|
517
|
+
return '';
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
private _checkForCpfCnpj(inputVal: string): string {
|
|
521
|
+
const cpf =
|
|
522
|
+
`${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` +
|
|
523
|
+
`.${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` +
|
|
524
|
+
`.${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` +
|
|
525
|
+
`-${this.placeHolderCharacter}${this.placeHolderCharacter}`;
|
|
526
|
+
const cnpj =
|
|
527
|
+
`${this.placeHolderCharacter}${this.placeHolderCharacter}` +
|
|
528
|
+
`.${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` +
|
|
529
|
+
`.${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` +
|
|
530
|
+
`/${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}${this.placeHolderCharacter}` +
|
|
531
|
+
`-${this.placeHolderCharacter}${this.placeHolderCharacter}`;
|
|
532
|
+
|
|
533
|
+
if (inputVal === MaskExpression.HASH) {
|
|
534
|
+
return cpf;
|
|
535
|
+
}
|
|
536
|
+
const arr: string[] = [];
|
|
537
|
+
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
538
|
+
for (let i = 0; i < inputVal.length; i++) {
|
|
539
|
+
const value = inputVal[i] ?? MaskExpression.EMPTY_STRING;
|
|
540
|
+
if (!value) {
|
|
541
|
+
continue;
|
|
542
|
+
}
|
|
543
|
+
if (value.match('\\d')) {
|
|
544
|
+
arr.push(value);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
if (arr.length <= 3) {
|
|
548
|
+
return cpf.slice(arr.length, cpf.length);
|
|
549
|
+
}
|
|
550
|
+
if (arr.length > 3 && arr.length <= 6) {
|
|
551
|
+
return cpf.slice(arr.length + 1, cpf.length);
|
|
552
|
+
}
|
|
553
|
+
if (arr.length > 6 && arr.length <= 9) {
|
|
554
|
+
return cpf.slice(arr.length + 2, cpf.length);
|
|
555
|
+
}
|
|
556
|
+
if (arr.length > 9 && arr.length < 11) {
|
|
557
|
+
return cpf.slice(arr.length + 3, cpf.length);
|
|
558
|
+
}
|
|
559
|
+
if (arr.length === 11) {
|
|
560
|
+
return '';
|
|
561
|
+
}
|
|
562
|
+
if (arr.length === 12) {
|
|
563
|
+
if (inputVal.length === 17) {
|
|
564
|
+
return cnpj.slice(16, cnpj.length);
|
|
565
|
+
}
|
|
566
|
+
return cnpj.slice(15, cnpj.length);
|
|
567
|
+
}
|
|
568
|
+
if (arr.length > 12 && arr.length <= 14) {
|
|
569
|
+
return cnpj.slice(arr.length + 4, cnpj.length);
|
|
570
|
+
}
|
|
571
|
+
return '';
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Recursively determine the current active element by navigating the Shadow DOM until the Active Element is found.
|
|
576
|
+
*/
|
|
577
|
+
private _getActiveElement(document: DocumentOrShadowRoot = this.document): Element | null {
|
|
578
|
+
const shadowRootEl = document?.activeElement?.shadowRoot;
|
|
579
|
+
if (!shadowRootEl?.activeElement) {
|
|
580
|
+
return document.activeElement;
|
|
581
|
+
} else {
|
|
582
|
+
return this._getActiveElement(shadowRootEl);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* Propogates the input value back to the Angular model by triggering the onChange function. It won't do this if writingValue
|
|
588
|
+
* is true. If that is true it means we are currently in the writeValue function, which is supposed to only update the actual
|
|
589
|
+
* DOM element based on the Angular model value. It should be a one way process, i.e. writeValue should not be modifying the Angular
|
|
590
|
+
* model value too. Therefore, we don't trigger onChange in this scenario.
|
|
591
|
+
* @param inputValue the current form input value
|
|
592
|
+
*/
|
|
593
|
+
private formControlResult(inputValue: string): void {
|
|
594
|
+
const outputTransformFn = this.outputTransformFn
|
|
595
|
+
? this.outputTransformFn
|
|
596
|
+
: (v: unknown) => v;
|
|
597
|
+
this.writingValue = false;
|
|
598
|
+
this.maskChanged = false;
|
|
599
|
+
if (Array.isArray(this.dropSpecialCharacters)) {
|
|
600
|
+
this.onChange(
|
|
601
|
+
outputTransformFn(
|
|
602
|
+
this._toNumber(
|
|
603
|
+
this._checkSymbols(
|
|
604
|
+
this._removeMask(
|
|
605
|
+
this._removeSuffix(this._removePrefix(inputValue)),
|
|
606
|
+
this.dropSpecialCharacters
|
|
607
|
+
)
|
|
608
|
+
)
|
|
609
|
+
)
|
|
610
|
+
)
|
|
611
|
+
);
|
|
612
|
+
} else if (
|
|
613
|
+
this.dropSpecialCharacters ||
|
|
614
|
+
(!this.dropSpecialCharacters && this.prefix === inputValue)
|
|
615
|
+
) {
|
|
616
|
+
this.onChange(
|
|
617
|
+
outputTransformFn(
|
|
618
|
+
this._toNumber(
|
|
619
|
+
this._checkSymbols(this._removeSuffix(this._removePrefix(inputValue)))
|
|
620
|
+
)
|
|
621
|
+
)
|
|
622
|
+
);
|
|
623
|
+
} else {
|
|
624
|
+
this.onChange(outputTransformFn(this._toNumber(inputValue)));
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
private _toNumber(value: string | number | undefined | null) {
|
|
629
|
+
if (!this.isNumberValue || value === MaskExpression.EMPTY_STRING) {
|
|
630
|
+
return value;
|
|
631
|
+
}
|
|
632
|
+
if (
|
|
633
|
+
this.maskExpression.startsWith(MaskExpression.SEPARATOR) &&
|
|
634
|
+
(this.leadZero || !this.dropSpecialCharacters)
|
|
635
|
+
) {
|
|
636
|
+
return value;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
if (String(value).length > 14 && this.maskExpression.startsWith(MaskExpression.SEPARATOR)) {
|
|
640
|
+
return String(value);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
const num = Number(value);
|
|
644
|
+
if (this.maskExpression.startsWith(MaskExpression.SEPARATOR) && Number.isNaN(num)) {
|
|
645
|
+
const val = String(value).replace(',', '.');
|
|
646
|
+
return Number(val);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
return Number.isNaN(num) ? value : num;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
private _removeMask(value: string, specialCharactersForRemove: string[]): string {
|
|
653
|
+
if (
|
|
654
|
+
this.maskExpression.startsWith(MaskExpression.PERCENT) &&
|
|
655
|
+
value.includes(MaskExpression.DOT)
|
|
656
|
+
) {
|
|
657
|
+
return value;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
return value
|
|
661
|
+
? value.replace(
|
|
662
|
+
this._regExpForRemove(specialCharactersForRemove),
|
|
663
|
+
MaskExpression.EMPTY_STRING
|
|
664
|
+
)
|
|
665
|
+
: value;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
private _removePrefix(value: string): string {
|
|
669
|
+
if (!this.prefix) {
|
|
670
|
+
return value;
|
|
671
|
+
}
|
|
672
|
+
return value ? value.replace(this.prefix, MaskExpression.EMPTY_STRING) : value;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
private _removeSuffix(value: string): string {
|
|
676
|
+
if (!this.suffix) {
|
|
677
|
+
return value;
|
|
678
|
+
}
|
|
679
|
+
return value ? value.replace(this.suffix, MaskExpression.EMPTY_STRING) : value;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
private _retrieveSeparatorValue(result: string): string {
|
|
683
|
+
let specialCharacters = Array.isArray(this.dropSpecialCharacters)
|
|
684
|
+
? this.specialCharacters.filter((v) => {
|
|
685
|
+
return (this.dropSpecialCharacters as string[]).includes(v);
|
|
686
|
+
})
|
|
687
|
+
: this.specialCharacters;
|
|
688
|
+
if (
|
|
689
|
+
!this.deletedSpecialCharacter &&
|
|
690
|
+
this._checkPatternForSpace() &&
|
|
691
|
+
result.includes(MaskExpression.WHITE_SPACE) &&
|
|
692
|
+
this.maskExpression.includes(MaskExpression.SYMBOL_STAR)
|
|
693
|
+
) {
|
|
694
|
+
specialCharacters = specialCharacters.filter(
|
|
695
|
+
(char) => char !== MaskExpression.WHITE_SPACE
|
|
696
|
+
);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
return this._removeMask(result, specialCharacters as string[]);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
private _regExpForRemove(specialCharactersForRemove: string[]): RegExp {
|
|
703
|
+
return new RegExp(
|
|
704
|
+
specialCharactersForRemove.map((item: string) => `\\${item}`).join('|'),
|
|
705
|
+
'gi'
|
|
706
|
+
);
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
private _replaceDecimalMarkerToDot(value: string): string {
|
|
710
|
+
const markers = Array.isArray(this.decimalMarker)
|
|
711
|
+
? this.decimalMarker
|
|
712
|
+
: [this.decimalMarker];
|
|
713
|
+
|
|
714
|
+
return value.replace(this._regExpForRemove(markers), MaskExpression.DOT);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
public _checkSymbols(result: string): string | number | undefined | null {
|
|
718
|
+
let processedResult = result;
|
|
719
|
+
|
|
720
|
+
if (processedResult === MaskExpression.EMPTY_STRING) {
|
|
721
|
+
return processedResult;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
if (
|
|
725
|
+
this.maskExpression.startsWith(MaskExpression.PERCENT) &&
|
|
726
|
+
this.decimalMarker === MaskExpression.COMMA
|
|
727
|
+
) {
|
|
728
|
+
processedResult = processedResult.replace(MaskExpression.COMMA, MaskExpression.DOT);
|
|
729
|
+
}
|
|
730
|
+
const separatorPrecision: number | null = this._retrieveSeparatorPrecision(
|
|
731
|
+
this.maskExpression
|
|
732
|
+
);
|
|
733
|
+
|
|
734
|
+
const separatorValue: string =
|
|
735
|
+
this.specialCharacters.length === 0
|
|
736
|
+
? this._retrieveSeparatorValue(processedResult)
|
|
737
|
+
: this._replaceDecimalMarkerToDot(this._retrieveSeparatorValue(processedResult));
|
|
738
|
+
|
|
739
|
+
if (!this.isNumberValue) {
|
|
740
|
+
return separatorValue;
|
|
741
|
+
}
|
|
742
|
+
if (separatorPrecision) {
|
|
743
|
+
if (processedResult === this.decimalMarker) {
|
|
744
|
+
return null;
|
|
745
|
+
}
|
|
746
|
+
if (separatorValue.length > 14) {
|
|
747
|
+
return String(separatorValue);
|
|
748
|
+
}
|
|
749
|
+
return this._checkPrecision(this.maskExpression, separatorValue);
|
|
750
|
+
} else {
|
|
751
|
+
return separatorValue;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
private _checkPatternForSpace(): boolean {
|
|
756
|
+
for (const key in this.patterns) {
|
|
757
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
758
|
+
if (this.patterns[key] && this.patterns[key]?.hasOwnProperty('pattern')) {
|
|
759
|
+
const patternString = this.patterns[key]?.pattern.toString();
|
|
760
|
+
const pattern = this.patterns[key]?.pattern;
|
|
761
|
+
if (
|
|
762
|
+
(patternString?.includes(MaskExpression.WHITE_SPACE) as boolean) &&
|
|
763
|
+
pattern?.test(this.maskExpression)
|
|
764
|
+
) {
|
|
765
|
+
return true;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
return false;
|
|
770
|
+
}
|
|
771
|
+
// TODO should think about helpers or separting decimal precision to own property
|
|
772
|
+
private _retrieveSeparatorPrecision(maskExpretion: string): number | null {
|
|
773
|
+
const matcher: RegExpMatchArray | null = maskExpretion.match(
|
|
774
|
+
new RegExp(`^separator\\.([^d]*)`)
|
|
775
|
+
);
|
|
776
|
+
return matcher ? Number(matcher[1]) : null;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
public _checkPrecision(separatorExpression: string, separatorValue: string): number | string {
|
|
780
|
+
const separatorPrecision = this.getPrecision(separatorExpression);
|
|
781
|
+
let value = separatorValue;
|
|
782
|
+
|
|
783
|
+
if (
|
|
784
|
+
separatorExpression.indexOf('2') > 0 ||
|
|
785
|
+
(this.leadZero && Number(separatorPrecision) > 0)
|
|
786
|
+
) {
|
|
787
|
+
if (this.decimalMarker === MaskExpression.COMMA && this.leadZero) {
|
|
788
|
+
value = value.replace(',', '.');
|
|
789
|
+
}
|
|
790
|
+
return this.leadZero
|
|
791
|
+
? Number(value).toFixed(Number(separatorPrecision))
|
|
792
|
+
: Number(value).toFixed(2);
|
|
793
|
+
}
|
|
794
|
+
return this.numberToString(value);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
public _repeatPatternSymbols(maskExp: string): string {
|
|
798
|
+
return (
|
|
799
|
+
(maskExp.match(/{[0-9]+}/) &&
|
|
800
|
+
maskExp
|
|
801
|
+
.split(MaskExpression.EMPTY_STRING)
|
|
802
|
+
.reduce((accum: string, currVal: string, index: number): string => {
|
|
803
|
+
this._start =
|
|
804
|
+
currVal === MaskExpression.CURLY_BRACKETS_LEFT ? index : this._start;
|
|
805
|
+
if (currVal !== MaskExpression.CURLY_BRACKETS_RIGHT) {
|
|
806
|
+
return this._findSpecialChar(currVal) ? accum + currVal : accum;
|
|
807
|
+
}
|
|
808
|
+
this._end = index;
|
|
809
|
+
const repeatNumber = Number(maskExp.slice(this._start + 1, this._end));
|
|
810
|
+
const replaceWith: string = new Array(repeatNumber + 1).join(
|
|
811
|
+
maskExp[this._start - 1]
|
|
812
|
+
);
|
|
813
|
+
if (
|
|
814
|
+
maskExp.slice(0, this._start).length > 1 &&
|
|
815
|
+
maskExp.includes(MaskExpression.LETTER_S)
|
|
816
|
+
) {
|
|
817
|
+
const symbols = maskExp.slice(0, this._start - 1);
|
|
818
|
+
return symbols.includes(MaskExpression.CURLY_BRACKETS_LEFT)
|
|
819
|
+
? accum + replaceWith
|
|
820
|
+
: symbols + accum + replaceWith;
|
|
821
|
+
} else {
|
|
822
|
+
return accum + replaceWith;
|
|
823
|
+
}
|
|
824
|
+
}, '')) ||
|
|
825
|
+
maskExp
|
|
826
|
+
);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
public currentLocaleDecimalMarker(): string {
|
|
830
|
+
return (1.1).toLocaleString().substring(1, 2);
|
|
831
|
+
}
|
|
832
|
+
}
|