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,1073 @@
|
|
|
1
|
+
import { inject, Injectable } from '@angular/core';
|
|
2
|
+
import { NgxMaskConfig } from './ngx-mask.config';
|
|
3
|
+
import { NGX_MASK_CONFIG } from './ngx-mask.config';
|
|
4
|
+
import { MaskExpression } from './ngx-mask-expression.enum';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class NgxMaskApplierService {
|
|
8
|
+
protected _config = inject<NgxMaskConfig>(NGX_MASK_CONFIG);
|
|
9
|
+
|
|
10
|
+
public dropSpecialCharacters: NgxMaskConfig['dropSpecialCharacters'] =
|
|
11
|
+
this._config.dropSpecialCharacters;
|
|
12
|
+
|
|
13
|
+
public hiddenInput: NgxMaskConfig['hiddenInput'] = this._config.hiddenInput;
|
|
14
|
+
|
|
15
|
+
public clearIfNotMatch: NgxMaskConfig['clearIfNotMatch'] = this._config.clearIfNotMatch;
|
|
16
|
+
|
|
17
|
+
public specialCharacters: NgxMaskConfig['specialCharacters'] = this._config.specialCharacters;
|
|
18
|
+
|
|
19
|
+
public patterns: NgxMaskConfig['patterns'] = this._config.patterns;
|
|
20
|
+
|
|
21
|
+
public prefix: NgxMaskConfig['prefix'] = this._config.prefix || '';
|
|
22
|
+
|
|
23
|
+
public suffix: NgxMaskConfig['suffix'] = this._config.suffix || '';
|
|
24
|
+
|
|
25
|
+
public thousandSeparator: NgxMaskConfig['thousandSeparator'] = this._config.thousandSeparator || '';
|
|
26
|
+
|
|
27
|
+
public decimalMarker: NgxMaskConfig['decimalMarker'] = this._config.decimalMarker || '';
|
|
28
|
+
|
|
29
|
+
public customPattern!: NgxMaskConfig['patterns'];
|
|
30
|
+
|
|
31
|
+
public showMaskTyped: NgxMaskConfig['showMaskTyped'] = this._config.showMaskTyped;
|
|
32
|
+
|
|
33
|
+
public placeHolderCharacter: NgxMaskConfig['placeHolderCharacter'] =
|
|
34
|
+
this._config.placeHolderCharacter;
|
|
35
|
+
|
|
36
|
+
public validation: NgxMaskConfig['validation'] = this._config.validation;
|
|
37
|
+
|
|
38
|
+
public separatorLimit: NgxMaskConfig['separatorLimit'] = this._config.separatorLimit;
|
|
39
|
+
|
|
40
|
+
public allowNegativeNumbers: NgxMaskConfig['allowNegativeNumbers'] =
|
|
41
|
+
this._config.allowNegativeNumbers;
|
|
42
|
+
|
|
43
|
+
public leadZeroDateTime: NgxMaskConfig['leadZeroDateTime'] = this._config.leadZeroDateTime;
|
|
44
|
+
|
|
45
|
+
public leadZero: NgxMaskConfig['leadZero'] = this._config.leadZero;
|
|
46
|
+
|
|
47
|
+
public apm: NgxMaskConfig['apm'] = this._config.apm;
|
|
48
|
+
|
|
49
|
+
public inputTransformFn: NgxMaskConfig['inputTransformFn'] | null =
|
|
50
|
+
this._config.inputTransformFn;
|
|
51
|
+
|
|
52
|
+
public outputTransformFn: NgxMaskConfig['outputTransformFn'] | null =
|
|
53
|
+
this._config.outputTransformFn;
|
|
54
|
+
|
|
55
|
+
public keepCharacterPositions: NgxMaskConfig['keepCharacterPositions'] =
|
|
56
|
+
this._config.keepCharacterPositions;
|
|
57
|
+
|
|
58
|
+
public instantPrefix: NgxMaskConfig['instantPrefix'] = this._config.instantPrefix;
|
|
59
|
+
|
|
60
|
+
public triggerOnMaskChange: NgxMaskConfig['triggerOnMaskChange'] =
|
|
61
|
+
this._config.triggerOnMaskChange;
|
|
62
|
+
|
|
63
|
+
private _shift = new Set<number>();
|
|
64
|
+
|
|
65
|
+
public plusOnePosition = false;
|
|
66
|
+
|
|
67
|
+
public maskExpression = '';
|
|
68
|
+
|
|
69
|
+
public actualValue = '';
|
|
70
|
+
|
|
71
|
+
public showKeepCharacterExp = '';
|
|
72
|
+
|
|
73
|
+
public shownMaskExpression: NgxMaskConfig['shownMaskExpression'] =
|
|
74
|
+
this._config.shownMaskExpression;
|
|
75
|
+
|
|
76
|
+
public deletedSpecialCharacter = false;
|
|
77
|
+
|
|
78
|
+
public ipError?: boolean;
|
|
79
|
+
|
|
80
|
+
public cpfCnpjError?: boolean;
|
|
81
|
+
|
|
82
|
+
public applyMask(
|
|
83
|
+
inputValue: string | object | boolean | null | undefined,
|
|
84
|
+
maskExpression: string,
|
|
85
|
+
position = 0,
|
|
86
|
+
justPasted = false,
|
|
87
|
+
backspaced = false,
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
89
|
+
cb: (...args: any[]) => any = () => {}
|
|
90
|
+
): string {
|
|
91
|
+
if (!maskExpression || typeof inputValue !== 'string') {
|
|
92
|
+
return MaskExpression.EMPTY_STRING;
|
|
93
|
+
}
|
|
94
|
+
let cursor = 0;
|
|
95
|
+
let result = '';
|
|
96
|
+
let multi = false;
|
|
97
|
+
let backspaceShift = false;
|
|
98
|
+
let shift = 1;
|
|
99
|
+
let stepBack = false;
|
|
100
|
+
let processedValue = inputValue;
|
|
101
|
+
let processedPosition = position;
|
|
102
|
+
|
|
103
|
+
if (processedValue.slice(0, this.prefix.length) === this.prefix) {
|
|
104
|
+
processedValue = processedValue.slice(this.prefix.length, processedValue.length);
|
|
105
|
+
}
|
|
106
|
+
if (!!this.suffix && processedValue.length > 0) {
|
|
107
|
+
processedValue = this.checkAndRemoveSuffix(processedValue);
|
|
108
|
+
}
|
|
109
|
+
if (processedValue === '(' && this.prefix) {
|
|
110
|
+
processedValue = '';
|
|
111
|
+
}
|
|
112
|
+
const inputArray: string[] = processedValue.toString().split(MaskExpression.EMPTY_STRING);
|
|
113
|
+
if (
|
|
114
|
+
this.allowNegativeNumbers &&
|
|
115
|
+
processedValue.slice(cursor, cursor + 1) === MaskExpression.MINUS
|
|
116
|
+
) {
|
|
117
|
+
result += processedValue.slice(cursor, cursor + 1);
|
|
118
|
+
}
|
|
119
|
+
if (maskExpression === MaskExpression.IP) {
|
|
120
|
+
const valuesIP = processedValue.split(MaskExpression.DOT);
|
|
121
|
+
this.ipError = this._validIP(valuesIP);
|
|
122
|
+
|
|
123
|
+
// eslint-disable-next-line no-param-reassign
|
|
124
|
+
maskExpression = '099.099.099.099';
|
|
125
|
+
}
|
|
126
|
+
const arr: string[] = [];
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
128
|
+
for (let i = 0; i < processedValue.length; i++) {
|
|
129
|
+
if (processedValue[i]?.match('\\d')) {
|
|
130
|
+
arr.push(processedValue[i] ?? MaskExpression.EMPTY_STRING);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (maskExpression === MaskExpression.CPF_CNPJ) {
|
|
134
|
+
this.cpfCnpjError = arr.length !== 11 && arr.length !== 14;
|
|
135
|
+
if (arr.length > 11) {
|
|
136
|
+
// eslint-disable-next-line no-param-reassign
|
|
137
|
+
maskExpression = '00.000.000/0000-00';
|
|
138
|
+
} else {
|
|
139
|
+
// eslint-disable-next-line no-param-reassign
|
|
140
|
+
maskExpression = '000.000.000-00';
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (maskExpression.startsWith(MaskExpression.PERCENT)) {
|
|
144
|
+
if (
|
|
145
|
+
processedValue.match('[a-z]|[A-Z]') ||
|
|
146
|
+
// eslint-disable-next-line no-useless-escape
|
|
147
|
+
(processedValue.match(/[-!$%^&*()_+|~=`{}\[\]:";'<>?,\/.]/) && !backspaced)
|
|
148
|
+
) {
|
|
149
|
+
processedValue = this._stripToDecimal(processedValue);
|
|
150
|
+
const precision: number = this.getPrecision(maskExpression);
|
|
151
|
+
|
|
152
|
+
processedValue = this.checkInputPrecision(
|
|
153
|
+
processedValue,
|
|
154
|
+
precision,
|
|
155
|
+
this.decimalMarker
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
const decimalMarker =
|
|
159
|
+
typeof this.decimalMarker === 'string' ? this.decimalMarker : MaskExpression.DOT;
|
|
160
|
+
if (
|
|
161
|
+
processedValue.indexOf(decimalMarker) > 0 &&
|
|
162
|
+
!this.percentage(processedValue.substring(0, processedValue.indexOf(decimalMarker)))
|
|
163
|
+
) {
|
|
164
|
+
let base: string = processedValue.substring(
|
|
165
|
+
0,
|
|
166
|
+
processedValue.indexOf(decimalMarker) - 1
|
|
167
|
+
);
|
|
168
|
+
if (
|
|
169
|
+
this.allowNegativeNumbers &&
|
|
170
|
+
processedValue.slice(cursor, cursor + 1) === MaskExpression.MINUS &&
|
|
171
|
+
!backspaced
|
|
172
|
+
) {
|
|
173
|
+
base = processedValue.substring(0, processedValue.indexOf(decimalMarker));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
processedValue = `${base}${processedValue.substring(
|
|
177
|
+
processedValue.indexOf(decimalMarker),
|
|
178
|
+
processedValue.length
|
|
179
|
+
)}`;
|
|
180
|
+
}
|
|
181
|
+
let value = '';
|
|
182
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
183
|
+
this.allowNegativeNumbers &&
|
|
184
|
+
processedValue.slice(cursor, cursor + 1) === MaskExpression.MINUS
|
|
185
|
+
? (value = `${MaskExpression.MINUS}${processedValue.slice(cursor + 1, cursor + processedValue.length)}`)
|
|
186
|
+
: (value = processedValue);
|
|
187
|
+
if (this.percentage(value)) {
|
|
188
|
+
result = this._splitPercentZero(processedValue);
|
|
189
|
+
} else {
|
|
190
|
+
result = this._splitPercentZero(
|
|
191
|
+
processedValue.substring(0, processedValue.length - 1)
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
} else if (maskExpression.startsWith(MaskExpression.SEPARATOR)) {
|
|
195
|
+
if (
|
|
196
|
+
processedValue.match('[wа-яА-Я]') ||
|
|
197
|
+
processedValue.match('[ЁёА-я]') ||
|
|
198
|
+
processedValue.match('[a-z]|[A-Z]') ||
|
|
199
|
+
processedValue.match(/[-@#!$%\\^&*()_£¬'+|~=`{}\]:";<>.?/]/) ||
|
|
200
|
+
processedValue.match('[^A-Za-z0-9,]')
|
|
201
|
+
) {
|
|
202
|
+
processedValue = this._stripToDecimal(processedValue);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const precision: number = this.getPrecision(maskExpression);
|
|
206
|
+
let decimalMarker = this.decimalMarker;
|
|
207
|
+
|
|
208
|
+
if (Array.isArray(this.decimalMarker)) {
|
|
209
|
+
if (
|
|
210
|
+
this.actualValue.includes(this.decimalMarker[0]) ||
|
|
211
|
+
this.actualValue.includes(this.decimalMarker[1])
|
|
212
|
+
) {
|
|
213
|
+
decimalMarker = this.actualValue.includes(this.decimalMarker[0])
|
|
214
|
+
? this.decimalMarker[0]
|
|
215
|
+
: this.decimalMarker[1];
|
|
216
|
+
} else {
|
|
217
|
+
decimalMarker = this.decimalMarker.find(
|
|
218
|
+
(dm) => dm !== this.thousandSeparator
|
|
219
|
+
) as '.' | ',';
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (backspaced) {
|
|
224
|
+
const { decimalMarkerIndex, nonZeroIndex } = this._findFirstNonZeroAndDecimalIndex(
|
|
225
|
+
processedValue,
|
|
226
|
+
decimalMarker as '.' | ','
|
|
227
|
+
);
|
|
228
|
+
const zeroIndexMinus = processedValue[0] === MaskExpression.MINUS;
|
|
229
|
+
const zeroIndexNumberZero = processedValue[0] === MaskExpression.NUMBER_ZERO;
|
|
230
|
+
const zeroIndexDecimalMarker = processedValue[0] === decimalMarker;
|
|
231
|
+
const firstIndexDecimalMarker = processedValue[1] === decimalMarker;
|
|
232
|
+
|
|
233
|
+
if (
|
|
234
|
+
(zeroIndexDecimalMarker && !nonZeroIndex) ||
|
|
235
|
+
(zeroIndexMinus && firstIndexDecimalMarker && !nonZeroIndex) ||
|
|
236
|
+
(zeroIndexNumberZero && !decimalMarkerIndex && !nonZeroIndex)
|
|
237
|
+
) {
|
|
238
|
+
processedValue = MaskExpression.NUMBER_ZERO;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (
|
|
242
|
+
decimalMarkerIndex &&
|
|
243
|
+
nonZeroIndex &&
|
|
244
|
+
zeroIndexMinus &&
|
|
245
|
+
processedPosition === 1
|
|
246
|
+
) {
|
|
247
|
+
if (decimalMarkerIndex < nonZeroIndex || decimalMarkerIndex > nonZeroIndex) {
|
|
248
|
+
processedValue = MaskExpression.MINUS + processedValue.slice(nonZeroIndex);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (!decimalMarkerIndex && nonZeroIndex && processedValue.length > nonZeroIndex) {
|
|
253
|
+
processedValue = zeroIndexMinus
|
|
254
|
+
? MaskExpression.MINUS + processedValue.slice(nonZeroIndex)
|
|
255
|
+
: processedValue.slice(nonZeroIndex);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (decimalMarkerIndex && nonZeroIndex && processedPosition === 0) {
|
|
259
|
+
if (decimalMarkerIndex < nonZeroIndex) {
|
|
260
|
+
processedValue = processedValue.slice(decimalMarkerIndex - 1);
|
|
261
|
+
}
|
|
262
|
+
if (decimalMarkerIndex > nonZeroIndex) {
|
|
263
|
+
processedValue = processedValue.slice(nonZeroIndex);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (precision === 0) {
|
|
269
|
+
processedValue = this.allowNegativeNumbers
|
|
270
|
+
? processedValue.length > 2 &&
|
|
271
|
+
processedValue[0] === MaskExpression.MINUS &&
|
|
272
|
+
processedValue[1] === MaskExpression.NUMBER_ZERO &&
|
|
273
|
+
processedValue[2] !== this.thousandSeparator &&
|
|
274
|
+
processedValue[2] !== MaskExpression.COMMA &&
|
|
275
|
+
processedValue[2] !== MaskExpression.DOT
|
|
276
|
+
? '-' + processedValue.slice(2, processedValue.length)
|
|
277
|
+
: processedValue[0] === MaskExpression.NUMBER_ZERO &&
|
|
278
|
+
processedValue.length > 1 &&
|
|
279
|
+
processedValue[1] !== this.thousandSeparator &&
|
|
280
|
+
processedValue[1] !== MaskExpression.COMMA &&
|
|
281
|
+
processedValue[1] !== MaskExpression.DOT
|
|
282
|
+
? processedValue.slice(1, processedValue.length)
|
|
283
|
+
: processedValue
|
|
284
|
+
: processedValue.length > 1 &&
|
|
285
|
+
processedValue[0] === MaskExpression.NUMBER_ZERO &&
|
|
286
|
+
processedValue[1] !== this.thousandSeparator &&
|
|
287
|
+
processedValue[1] !== MaskExpression.COMMA &&
|
|
288
|
+
processedValue[1] !== MaskExpression.DOT
|
|
289
|
+
? processedValue.slice(1, processedValue.length)
|
|
290
|
+
: processedValue;
|
|
291
|
+
} else {
|
|
292
|
+
if (
|
|
293
|
+
processedValue[0] === decimalMarker &&
|
|
294
|
+
processedValue.length > 1 &&
|
|
295
|
+
!backspaced
|
|
296
|
+
) {
|
|
297
|
+
processedValue =
|
|
298
|
+
MaskExpression.NUMBER_ZERO +
|
|
299
|
+
processedValue.slice(0, processedValue.length + 1);
|
|
300
|
+
this.plusOnePosition = true;
|
|
301
|
+
}
|
|
302
|
+
if (
|
|
303
|
+
processedValue[0] === MaskExpression.NUMBER_ZERO &&
|
|
304
|
+
processedValue[1] !== decimalMarker &&
|
|
305
|
+
processedValue[1] !== this.thousandSeparator &&
|
|
306
|
+
!backspaced
|
|
307
|
+
) {
|
|
308
|
+
processedValue =
|
|
309
|
+
processedValue.length > 1
|
|
310
|
+
? processedValue.slice(0, 1) +
|
|
311
|
+
decimalMarker +
|
|
312
|
+
processedValue.slice(1, processedValue.length + 1)
|
|
313
|
+
: processedValue;
|
|
314
|
+
this.plusOnePosition = true;
|
|
315
|
+
}
|
|
316
|
+
if (
|
|
317
|
+
this.allowNegativeNumbers &&
|
|
318
|
+
!backspaced &&
|
|
319
|
+
processedValue[0] === MaskExpression.MINUS &&
|
|
320
|
+
(processedValue[1] === decimalMarker ||
|
|
321
|
+
processedValue[1] === MaskExpression.NUMBER_ZERO)
|
|
322
|
+
) {
|
|
323
|
+
processedValue =
|
|
324
|
+
processedValue[1] === decimalMarker && processedValue.length > 2
|
|
325
|
+
? processedValue.slice(0, 1) +
|
|
326
|
+
MaskExpression.NUMBER_ZERO +
|
|
327
|
+
processedValue.slice(1, processedValue.length)
|
|
328
|
+
: processedValue[1] === MaskExpression.NUMBER_ZERO &&
|
|
329
|
+
processedValue.length > 2 &&
|
|
330
|
+
processedValue[2] !== decimalMarker
|
|
331
|
+
? processedValue.slice(0, 2) +
|
|
332
|
+
decimalMarker +
|
|
333
|
+
processedValue.slice(2, processedValue.length)
|
|
334
|
+
: processedValue;
|
|
335
|
+
this.plusOnePosition = true;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// TODO: we had different rexexps here for the different cases... but tests dont seam to bother - check this
|
|
340
|
+
// separator: no COMMA, dot-sep: no SPACE, COMMA OK, comma-sep: no SPACE, COMMA OK
|
|
341
|
+
|
|
342
|
+
const thousandSeparatorCharEscaped: string = this._charToRegExpExpression(
|
|
343
|
+
this.thousandSeparator
|
|
344
|
+
);
|
|
345
|
+
let invalidChars: string = '@#!$%^&*()_+|~=`{}\\[\\]:\\s,\\.";<>?\\/'.replace(
|
|
346
|
+
thousandSeparatorCharEscaped,
|
|
347
|
+
''
|
|
348
|
+
);
|
|
349
|
+
//.replace(decimalMarkerEscaped, '');
|
|
350
|
+
if (Array.isArray(this.decimalMarker)) {
|
|
351
|
+
for (const marker of this.decimalMarker) {
|
|
352
|
+
invalidChars = invalidChars.replace(
|
|
353
|
+
this._charToRegExpExpression(marker),
|
|
354
|
+
MaskExpression.EMPTY_STRING
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
} else {
|
|
358
|
+
invalidChars = invalidChars.replace(
|
|
359
|
+
this._charToRegExpExpression(this.decimalMarker),
|
|
360
|
+
''
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
const invalidCharRegexp = new RegExp('[' + invalidChars + ']');
|
|
365
|
+
if (processedValue.match(invalidCharRegexp)) {
|
|
366
|
+
processedValue = processedValue.substring(0, processedValue.length - 1);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
processedValue = this.checkInputPrecision(
|
|
370
|
+
processedValue,
|
|
371
|
+
precision,
|
|
372
|
+
this.decimalMarker
|
|
373
|
+
);
|
|
374
|
+
const strForSep: string = processedValue.replace(
|
|
375
|
+
new RegExp(thousandSeparatorCharEscaped, 'g'),
|
|
376
|
+
''
|
|
377
|
+
);
|
|
378
|
+
|
|
379
|
+
result = this._formatWithSeparators(
|
|
380
|
+
strForSep,
|
|
381
|
+
this.thousandSeparator,
|
|
382
|
+
this.decimalMarker,
|
|
383
|
+
precision
|
|
384
|
+
);
|
|
385
|
+
|
|
386
|
+
const commaShift: number =
|
|
387
|
+
result.indexOf(MaskExpression.COMMA) - processedValue.indexOf(MaskExpression.COMMA);
|
|
388
|
+
const shiftStep: number = result.length - processedValue.length;
|
|
389
|
+
const backspacedDecimalMarkerWithSeparatorLimit =
|
|
390
|
+
backspaced && result.length < inputValue.length && this.separatorLimit;
|
|
391
|
+
|
|
392
|
+
if (
|
|
393
|
+
(result[processedPosition - 1] === this.thousandSeparator ||
|
|
394
|
+
result[processedPosition - this.prefix.length]) &&
|
|
395
|
+
this.prefix &&
|
|
396
|
+
backspaced
|
|
397
|
+
) {
|
|
398
|
+
processedPosition = processedPosition - 1;
|
|
399
|
+
} else if (
|
|
400
|
+
(shiftStep > 0 && result[processedPosition] !== this.thousandSeparator) ||
|
|
401
|
+
backspacedDecimalMarkerWithSeparatorLimit
|
|
402
|
+
) {
|
|
403
|
+
backspaceShift = true;
|
|
404
|
+
let _shift = 0;
|
|
405
|
+
do {
|
|
406
|
+
this._shift.add(processedPosition + _shift);
|
|
407
|
+
_shift++;
|
|
408
|
+
} while (_shift < shiftStep);
|
|
409
|
+
} else if (
|
|
410
|
+
result[processedPosition - 1] === this.thousandSeparator ||
|
|
411
|
+
shiftStep === -4 ||
|
|
412
|
+
shiftStep === -3 ||
|
|
413
|
+
result[processedPosition] === this.thousandSeparator
|
|
414
|
+
) {
|
|
415
|
+
this._shift.clear();
|
|
416
|
+
this._shift.add(processedPosition - 1);
|
|
417
|
+
} else if (
|
|
418
|
+
(commaShift !== 0 &&
|
|
419
|
+
processedPosition > 0 &&
|
|
420
|
+
!(
|
|
421
|
+
result.indexOf(MaskExpression.COMMA) >= processedPosition &&
|
|
422
|
+
processedPosition > 3
|
|
423
|
+
)) ||
|
|
424
|
+
(!(
|
|
425
|
+
result.indexOf(MaskExpression.DOT) >= processedPosition && processedPosition > 3
|
|
426
|
+
) &&
|
|
427
|
+
shiftStep <= 0)
|
|
428
|
+
) {
|
|
429
|
+
this._shift.clear();
|
|
430
|
+
backspaceShift = true;
|
|
431
|
+
shift = shiftStep;
|
|
432
|
+
|
|
433
|
+
processedPosition += shiftStep;
|
|
434
|
+
this._shift.add(processedPosition);
|
|
435
|
+
} else {
|
|
436
|
+
this._shift.clear();
|
|
437
|
+
}
|
|
438
|
+
} else {
|
|
439
|
+
for (
|
|
440
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
441
|
+
let i = 0, inputSymbol: string = inputArray[0]!;
|
|
442
|
+
i < inputArray.length;
|
|
443
|
+
i++, inputSymbol = inputArray[i] ?? MaskExpression.EMPTY_STRING
|
|
444
|
+
) {
|
|
445
|
+
if (cursor === maskExpression.length) {
|
|
446
|
+
break;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
const symbolStarInPattern: boolean = MaskExpression.SYMBOL_STAR in this.patterns;
|
|
450
|
+
if (
|
|
451
|
+
this._checkSymbolMask(
|
|
452
|
+
inputSymbol,
|
|
453
|
+
maskExpression[cursor] ?? MaskExpression.EMPTY_STRING
|
|
454
|
+
) &&
|
|
455
|
+
maskExpression[cursor + 1] === MaskExpression.SYMBOL_QUESTION
|
|
456
|
+
) {
|
|
457
|
+
result += inputSymbol;
|
|
458
|
+
cursor += 2;
|
|
459
|
+
} else if (
|
|
460
|
+
maskExpression[cursor + 1] === MaskExpression.SYMBOL_STAR &&
|
|
461
|
+
multi &&
|
|
462
|
+
this._checkSymbolMask(
|
|
463
|
+
inputSymbol,
|
|
464
|
+
maskExpression[cursor + 2] ?? MaskExpression.EMPTY_STRING
|
|
465
|
+
)
|
|
466
|
+
) {
|
|
467
|
+
result += inputSymbol;
|
|
468
|
+
cursor += 3;
|
|
469
|
+
multi = false;
|
|
470
|
+
} else if (
|
|
471
|
+
this._checkSymbolMask(
|
|
472
|
+
inputSymbol,
|
|
473
|
+
maskExpression[cursor] ?? MaskExpression.EMPTY_STRING
|
|
474
|
+
) &&
|
|
475
|
+
maskExpression[cursor + 1] === MaskExpression.SYMBOL_STAR &&
|
|
476
|
+
!symbolStarInPattern
|
|
477
|
+
) {
|
|
478
|
+
result += inputSymbol;
|
|
479
|
+
multi = true;
|
|
480
|
+
} else if (
|
|
481
|
+
maskExpression[cursor + 1] === MaskExpression.SYMBOL_QUESTION &&
|
|
482
|
+
this._checkSymbolMask(
|
|
483
|
+
inputSymbol,
|
|
484
|
+
maskExpression[cursor + 2] ?? MaskExpression.EMPTY_STRING
|
|
485
|
+
)
|
|
486
|
+
) {
|
|
487
|
+
result += inputSymbol;
|
|
488
|
+
cursor += 3;
|
|
489
|
+
} else if (
|
|
490
|
+
this._checkSymbolMask(
|
|
491
|
+
inputSymbol,
|
|
492
|
+
maskExpression[cursor] ?? MaskExpression.EMPTY_STRING
|
|
493
|
+
)
|
|
494
|
+
) {
|
|
495
|
+
if (maskExpression[cursor] === MaskExpression.HOURS) {
|
|
496
|
+
if (this.apm ? Number(inputSymbol) > 9 : Number(inputSymbol) > 2) {
|
|
497
|
+
processedPosition = !this.leadZeroDateTime
|
|
498
|
+
? processedPosition + 1
|
|
499
|
+
: processedPosition;
|
|
500
|
+
cursor += 1;
|
|
501
|
+
this._shiftStep(cursor);
|
|
502
|
+
i--;
|
|
503
|
+
if (this.leadZeroDateTime) {
|
|
504
|
+
result += '0';
|
|
505
|
+
}
|
|
506
|
+
continue;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
if (maskExpression[cursor] === MaskExpression.HOUR) {
|
|
510
|
+
if (
|
|
511
|
+
this.apm
|
|
512
|
+
? (result.length === 1 && Number(result) > 1) ||
|
|
513
|
+
(result === '1' && Number(inputSymbol) > 2) ||
|
|
514
|
+
(processedValue.slice(cursor - 1, cursor).length === 1 &&
|
|
515
|
+
Number(processedValue.slice(cursor - 1, cursor)) > 2) ||
|
|
516
|
+
(processedValue.slice(cursor - 1, cursor) === '1' &&
|
|
517
|
+
Number(inputSymbol) > 2)
|
|
518
|
+
: (result === '2' && Number(inputSymbol) > 3) ||
|
|
519
|
+
((result.slice(cursor - 2, cursor) === '2' ||
|
|
520
|
+
result.slice(cursor - 3, cursor) === '2' ||
|
|
521
|
+
result.slice(cursor - 4, cursor) === '2' ||
|
|
522
|
+
result.slice(cursor - 1, cursor) === '2') &&
|
|
523
|
+
Number(inputSymbol) > 3 &&
|
|
524
|
+
cursor > 10)
|
|
525
|
+
) {
|
|
526
|
+
processedPosition = processedPosition + 1;
|
|
527
|
+
cursor += 1;
|
|
528
|
+
i--;
|
|
529
|
+
continue;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
if (
|
|
533
|
+
maskExpression[cursor] === MaskExpression.MINUTE ||
|
|
534
|
+
maskExpression[cursor] === MaskExpression.SECOND
|
|
535
|
+
) {
|
|
536
|
+
if (Number(inputSymbol) > 5) {
|
|
537
|
+
processedPosition = !this.leadZeroDateTime
|
|
538
|
+
? processedPosition + 1
|
|
539
|
+
: processedPosition;
|
|
540
|
+
cursor += 1;
|
|
541
|
+
this._shiftStep(cursor);
|
|
542
|
+
i--;
|
|
543
|
+
if (this.leadZeroDateTime) {
|
|
544
|
+
result += '0';
|
|
545
|
+
}
|
|
546
|
+
continue;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
const daysCount = 31;
|
|
550
|
+
const inputValueCursor = processedValue[cursor] as string;
|
|
551
|
+
const inputValueCursorPlusOne = processedValue[cursor + 1] as string;
|
|
552
|
+
const inputValueCursorPlusTwo = processedValue[cursor + 2] as string;
|
|
553
|
+
const inputValueCursorMinusOne = processedValue[cursor - 1] as string;
|
|
554
|
+
const inputValueCursorMinusTwo = processedValue[cursor - 2] as string;
|
|
555
|
+
const inputValueSliceMinusThreeMinusOne = processedValue.slice(
|
|
556
|
+
cursor - 3,
|
|
557
|
+
cursor - 1
|
|
558
|
+
);
|
|
559
|
+
const inputValueSliceMinusOnePlusOne = processedValue.slice(
|
|
560
|
+
cursor - 1,
|
|
561
|
+
cursor + 1
|
|
562
|
+
);
|
|
563
|
+
const inputValueSliceCursorPlusTwo = processedValue.slice(cursor, cursor + 2);
|
|
564
|
+
const inputValueSliceMinusTwoCursor = processedValue.slice(cursor - 2, cursor);
|
|
565
|
+
if (maskExpression[cursor] === MaskExpression.DAY) {
|
|
566
|
+
const maskStartWithMonth =
|
|
567
|
+
maskExpression.slice(0, 2) === MaskExpression.MONTHS;
|
|
568
|
+
const startWithMonthInput: boolean =
|
|
569
|
+
maskExpression.slice(0, 2) === MaskExpression.MONTHS &&
|
|
570
|
+
this.specialCharacters.includes(inputValueCursorMinusTwo);
|
|
571
|
+
if (
|
|
572
|
+
(Number(inputSymbol) > 3 && this.leadZeroDateTime) ||
|
|
573
|
+
(!maskStartWithMonth &&
|
|
574
|
+
(Number(inputValueSliceCursorPlusTwo) > daysCount ||
|
|
575
|
+
Number(inputValueSliceMinusOnePlusOne) > daysCount ||
|
|
576
|
+
this.specialCharacters.includes(inputValueCursorPlusOne))) ||
|
|
577
|
+
(startWithMonthInput
|
|
578
|
+
? Number(inputValueSliceMinusOnePlusOne) > daysCount ||
|
|
579
|
+
(!this.specialCharacters.includes(inputValueCursor) &&
|
|
580
|
+
this.specialCharacters.includes(inputValueCursorPlusTwo)) ||
|
|
581
|
+
this.specialCharacters.includes(inputValueCursor)
|
|
582
|
+
: Number(inputValueSliceCursorPlusTwo) > daysCount ||
|
|
583
|
+
(this.specialCharacters.includes(inputValueCursorPlusOne) &&
|
|
584
|
+
!backspaced))
|
|
585
|
+
) {
|
|
586
|
+
processedPosition = !this.leadZeroDateTime
|
|
587
|
+
? processedPosition + 1
|
|
588
|
+
: processedPosition;
|
|
589
|
+
cursor += 1;
|
|
590
|
+
this._shiftStep(cursor);
|
|
591
|
+
i--;
|
|
592
|
+
|
|
593
|
+
if (this.leadZeroDateTime) {
|
|
594
|
+
result += '0';
|
|
595
|
+
}
|
|
596
|
+
continue;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
if (maskExpression[cursor] === MaskExpression.MONTH) {
|
|
600
|
+
const monthsCount = 12;
|
|
601
|
+
// mask without day
|
|
602
|
+
const withoutDays: boolean =
|
|
603
|
+
cursor === 0 &&
|
|
604
|
+
(Number(inputSymbol) > 2 ||
|
|
605
|
+
Number(inputValueSliceCursorPlusTwo) > monthsCount ||
|
|
606
|
+
(this.specialCharacters.includes(inputValueCursorPlusOne) &&
|
|
607
|
+
!backspaced));
|
|
608
|
+
// day<10 && month<12 for input
|
|
609
|
+
const specialChart = maskExpression.slice(cursor + 2, cursor + 3);
|
|
610
|
+
const day1monthInput: boolean =
|
|
611
|
+
inputValueSliceMinusThreeMinusOne.includes(specialChart) &&
|
|
612
|
+
maskExpression.includes('d0') &&
|
|
613
|
+
((this.specialCharacters.includes(inputValueCursorMinusTwo) &&
|
|
614
|
+
Number(inputValueSliceMinusOnePlusOne) > monthsCount &&
|
|
615
|
+
!this.specialCharacters.includes(inputValueCursor)) ||
|
|
616
|
+
this.specialCharacters.includes(inputValueCursor));
|
|
617
|
+
// month<12 && day<10 for input
|
|
618
|
+
const day2monthInput: boolean =
|
|
619
|
+
Number(inputValueSliceMinusThreeMinusOne) <= daysCount &&
|
|
620
|
+
!this.specialCharacters.includes(
|
|
621
|
+
inputValueSliceMinusThreeMinusOne as string
|
|
622
|
+
) &&
|
|
623
|
+
this.specialCharacters.includes(inputValueCursorMinusOne) &&
|
|
624
|
+
(Number(inputValueSliceCursorPlusTwo) > monthsCount ||
|
|
625
|
+
this.specialCharacters.includes(inputValueCursorPlusOne));
|
|
626
|
+
// cursor === 5 && without days
|
|
627
|
+
const day2monthInputDot: boolean =
|
|
628
|
+
(Number(inputValueSliceCursorPlusTwo) > monthsCount && cursor === 5) ||
|
|
629
|
+
(this.specialCharacters.includes(inputValueCursorPlusOne) &&
|
|
630
|
+
cursor === 5);
|
|
631
|
+
// // day<10 && month<12 for paste whole data
|
|
632
|
+
const day1monthPaste: boolean =
|
|
633
|
+
Number(inputValueSliceMinusThreeMinusOne) > daysCount &&
|
|
634
|
+
!this.specialCharacters.includes(
|
|
635
|
+
inputValueSliceMinusThreeMinusOne as string
|
|
636
|
+
) &&
|
|
637
|
+
!this.specialCharacters.includes(
|
|
638
|
+
inputValueSliceMinusTwoCursor as string
|
|
639
|
+
) &&
|
|
640
|
+
Number(inputValueSliceMinusTwoCursor) > monthsCount &&
|
|
641
|
+
maskExpression.includes('d0');
|
|
642
|
+
// 10<day<31 && month<12 for paste whole data
|
|
643
|
+
const day2monthPaste: boolean =
|
|
644
|
+
Number(inputValueSliceMinusThreeMinusOne) <= daysCount &&
|
|
645
|
+
!this.specialCharacters.includes(
|
|
646
|
+
inputValueSliceMinusThreeMinusOne as string
|
|
647
|
+
) &&
|
|
648
|
+
!this.specialCharacters.includes(inputValueCursorMinusOne) &&
|
|
649
|
+
Number(inputValueSliceMinusOnePlusOne) > monthsCount;
|
|
650
|
+
if (
|
|
651
|
+
(Number(inputSymbol) > 1 && this.leadZeroDateTime) ||
|
|
652
|
+
withoutDays ||
|
|
653
|
+
day1monthInput ||
|
|
654
|
+
day2monthPaste ||
|
|
655
|
+
day1monthPaste ||
|
|
656
|
+
day2monthInput ||
|
|
657
|
+
(day2monthInputDot && !this.leadZeroDateTime)
|
|
658
|
+
) {
|
|
659
|
+
processedPosition = !this.leadZeroDateTime
|
|
660
|
+
? processedPosition + 1
|
|
661
|
+
: processedPosition;
|
|
662
|
+
cursor += 1;
|
|
663
|
+
this._shiftStep(cursor);
|
|
664
|
+
i--;
|
|
665
|
+
if (this.leadZeroDateTime) {
|
|
666
|
+
result += '0';
|
|
667
|
+
}
|
|
668
|
+
continue;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
result += inputSymbol;
|
|
672
|
+
cursor++;
|
|
673
|
+
} else if (
|
|
674
|
+
this.specialCharacters.includes(inputSymbol) &&
|
|
675
|
+
maskExpression[cursor] === inputSymbol
|
|
676
|
+
) {
|
|
677
|
+
result += inputSymbol;
|
|
678
|
+
cursor++;
|
|
679
|
+
} else if (
|
|
680
|
+
this.specialCharacters.indexOf(
|
|
681
|
+
maskExpression[cursor] ?? MaskExpression.EMPTY_STRING
|
|
682
|
+
) !== -1
|
|
683
|
+
) {
|
|
684
|
+
result += maskExpression[cursor];
|
|
685
|
+
cursor++;
|
|
686
|
+
this._shiftStep(cursor);
|
|
687
|
+
i--;
|
|
688
|
+
} else if (
|
|
689
|
+
maskExpression[cursor] === MaskExpression.NUMBER_NINE &&
|
|
690
|
+
this.showMaskTyped
|
|
691
|
+
) {
|
|
692
|
+
this._shiftStep(cursor);
|
|
693
|
+
} else if (
|
|
694
|
+
this.patterns[maskExpression[cursor] ?? MaskExpression.EMPTY_STRING] &&
|
|
695
|
+
this.patterns[maskExpression[cursor] ?? MaskExpression.EMPTY_STRING]?.optional
|
|
696
|
+
) {
|
|
697
|
+
if (
|
|
698
|
+
!!inputArray[cursor] &&
|
|
699
|
+
maskExpression !== '099.099.099.099' &&
|
|
700
|
+
maskExpression !== '000.000.000-00' &&
|
|
701
|
+
maskExpression !== '00.000.000/0000-00' &&
|
|
702
|
+
!maskExpression.match(/^9+\.0+$/) &&
|
|
703
|
+
!this.patterns[maskExpression[cursor] ?? MaskExpression.EMPTY_STRING]
|
|
704
|
+
?.optional
|
|
705
|
+
) {
|
|
706
|
+
result += inputArray[cursor];
|
|
707
|
+
}
|
|
708
|
+
if (
|
|
709
|
+
maskExpression.includes(
|
|
710
|
+
MaskExpression.NUMBER_NINE + MaskExpression.SYMBOL_STAR
|
|
711
|
+
) &&
|
|
712
|
+
maskExpression.includes(
|
|
713
|
+
MaskExpression.NUMBER_ZERO + MaskExpression.SYMBOL_STAR
|
|
714
|
+
)
|
|
715
|
+
) {
|
|
716
|
+
cursor++;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
cursor++;
|
|
720
|
+
i--;
|
|
721
|
+
} else if (
|
|
722
|
+
this.maskExpression[cursor + 1] === MaskExpression.SYMBOL_STAR &&
|
|
723
|
+
this._findSpecialChar(
|
|
724
|
+
this.maskExpression[cursor + 2] ?? MaskExpression.EMPTY_STRING
|
|
725
|
+
) &&
|
|
726
|
+
this._findSpecialChar(inputSymbol) === this.maskExpression[cursor + 2] &&
|
|
727
|
+
multi
|
|
728
|
+
) {
|
|
729
|
+
cursor += 3;
|
|
730
|
+
result += inputSymbol;
|
|
731
|
+
} else if (
|
|
732
|
+
this.maskExpression[cursor + 1] === MaskExpression.SYMBOL_QUESTION &&
|
|
733
|
+
this._findSpecialChar(
|
|
734
|
+
this.maskExpression[cursor + 2] ?? MaskExpression.EMPTY_STRING
|
|
735
|
+
) &&
|
|
736
|
+
this._findSpecialChar(inputSymbol) === this.maskExpression[cursor + 2] &&
|
|
737
|
+
multi
|
|
738
|
+
) {
|
|
739
|
+
cursor += 3;
|
|
740
|
+
result += inputSymbol;
|
|
741
|
+
} else if (
|
|
742
|
+
this.showMaskTyped &&
|
|
743
|
+
this.specialCharacters.indexOf(inputSymbol) < 0 &&
|
|
744
|
+
inputSymbol !== this.placeHolderCharacter &&
|
|
745
|
+
this.placeHolderCharacter.length === 1
|
|
746
|
+
) {
|
|
747
|
+
stepBack = true;
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
if (
|
|
752
|
+
result[processedPosition - 1] &&
|
|
753
|
+
result.length + 1 === maskExpression.length &&
|
|
754
|
+
this.specialCharacters.indexOf(
|
|
755
|
+
maskExpression[maskExpression.length - 1] ?? MaskExpression.EMPTY_STRING
|
|
756
|
+
) !== -1
|
|
757
|
+
) {
|
|
758
|
+
result += maskExpression[maskExpression.length - 1];
|
|
759
|
+
}
|
|
760
|
+
let newPosition: number = processedPosition + 1;
|
|
761
|
+
|
|
762
|
+
while (this._shift.has(newPosition)) {
|
|
763
|
+
shift++;
|
|
764
|
+
newPosition++;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
let actualShift: number =
|
|
768
|
+
justPasted && !maskExpression.startsWith(MaskExpression.SEPARATOR)
|
|
769
|
+
? cursor
|
|
770
|
+
: this._shift.has(processedPosition)
|
|
771
|
+
? shift
|
|
772
|
+
: 0;
|
|
773
|
+
if (stepBack) {
|
|
774
|
+
actualShift--;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
cb(actualShift, backspaceShift);
|
|
778
|
+
if (shift < 0) {
|
|
779
|
+
this._shift.clear();
|
|
780
|
+
}
|
|
781
|
+
let onlySpecial = false;
|
|
782
|
+
if (backspaced) {
|
|
783
|
+
onlySpecial = inputArray.every((char) => this.specialCharacters.includes(char));
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
let res = `${this.prefix}${onlySpecial ? MaskExpression.EMPTY_STRING : result}${
|
|
787
|
+
this.showMaskTyped ? '' : this.suffix
|
|
788
|
+
}`;
|
|
789
|
+
|
|
790
|
+
if (result.length === 0) {
|
|
791
|
+
res = this.instantPrefix ? `${this.prefix}${result}` : `${result}`;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
const isSpecialCharacterMaskFirstSymbol =
|
|
795
|
+
processedValue.length === 1 &&
|
|
796
|
+
this.specialCharacters.includes(maskExpression[0] as string) &&
|
|
797
|
+
processedValue !== maskExpression[0];
|
|
798
|
+
|
|
799
|
+
if (
|
|
800
|
+
!this._checkSymbolMask(processedValue, maskExpression[1] as string) &&
|
|
801
|
+
isSpecialCharacterMaskFirstSymbol
|
|
802
|
+
) {
|
|
803
|
+
return '';
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
if (result.includes(MaskExpression.MINUS) && this.prefix && this.allowNegativeNumbers) {
|
|
807
|
+
if (backspaced && result === MaskExpression.MINUS) {
|
|
808
|
+
return '';
|
|
809
|
+
}
|
|
810
|
+
res = `${MaskExpression.MINUS}${this.prefix}${result
|
|
811
|
+
.split(MaskExpression.MINUS)
|
|
812
|
+
.join(MaskExpression.EMPTY_STRING)}${this.suffix}`;
|
|
813
|
+
}
|
|
814
|
+
return res;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
public _findDropSpecialChar(inputSymbol: string): undefined | string {
|
|
818
|
+
if (Array.isArray(this.dropSpecialCharacters)) {
|
|
819
|
+
return this.dropSpecialCharacters.find((val: string) => val === inputSymbol);
|
|
820
|
+
}
|
|
821
|
+
return this._findSpecialChar(inputSymbol);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
public _findSpecialChar(inputSymbol: string): undefined | string {
|
|
825
|
+
return this.specialCharacters.find((val: string) => val === inputSymbol);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
public _checkSymbolMask(inputSymbol: string, maskSymbol: string): boolean {
|
|
829
|
+
this.patterns = this.customPattern ? this.customPattern : this.patterns;
|
|
830
|
+
return (
|
|
831
|
+
(this.patterns?.[maskSymbol]?.pattern &&
|
|
832
|
+
this.patterns?.[maskSymbol]?.pattern.test(inputSymbol)) ??
|
|
833
|
+
false
|
|
834
|
+
);
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
private _formatWithSeparators = (
|
|
838
|
+
str: string,
|
|
839
|
+
thousandSeparatorChar: string,
|
|
840
|
+
decimalChars: string | string[],
|
|
841
|
+
precision: number
|
|
842
|
+
) => {
|
|
843
|
+
let x: string[] = [];
|
|
844
|
+
let decimalChar = '';
|
|
845
|
+
|
|
846
|
+
if (Array.isArray(decimalChars)) {
|
|
847
|
+
const regExp = new RegExp(
|
|
848
|
+
decimalChars.map((v) => ('[\\^$.|?*+()'.indexOf(v) >= 0 ? `\\${v}` : v)).join('|')
|
|
849
|
+
);
|
|
850
|
+
x = str.split(regExp);
|
|
851
|
+
decimalChar = str.match(regExp)?.[0] ?? MaskExpression.EMPTY_STRING;
|
|
852
|
+
} else {
|
|
853
|
+
x = str.split(decimalChars);
|
|
854
|
+
decimalChar = decimalChars;
|
|
855
|
+
}
|
|
856
|
+
const decimals: string =
|
|
857
|
+
x.length > 1 ? `${decimalChar}${x[1]}` : MaskExpression.EMPTY_STRING;
|
|
858
|
+
let res: string = x[0] ?? MaskExpression.EMPTY_STRING;
|
|
859
|
+
const separatorLimit: string = this.separatorLimit.replace(
|
|
860
|
+
/\s/g,
|
|
861
|
+
MaskExpression.EMPTY_STRING
|
|
862
|
+
);
|
|
863
|
+
if (separatorLimit && +separatorLimit) {
|
|
864
|
+
if (res[0] === MaskExpression.MINUS) {
|
|
865
|
+
res = `-${res.slice(1, res.length).slice(0, separatorLimit.length)}`;
|
|
866
|
+
} else {
|
|
867
|
+
res = res.slice(0, separatorLimit.length);
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
const rgx = /(\d+)(\d{3})/;
|
|
871
|
+
|
|
872
|
+
while (thousandSeparatorChar && rgx.test(res)) {
|
|
873
|
+
res = res.replace(rgx, '$1' + thousandSeparatorChar + '$2');
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
if (typeof precision === 'undefined') {
|
|
877
|
+
return res + decimals;
|
|
878
|
+
} else if (precision === 0) {
|
|
879
|
+
return res;
|
|
880
|
+
}
|
|
881
|
+
return res + decimals.substring(0, precision + 1);
|
|
882
|
+
};
|
|
883
|
+
|
|
884
|
+
private percentage = (str: string): boolean => {
|
|
885
|
+
const sanitizedStr = str.replace(',', '.');
|
|
886
|
+
const value = Number(
|
|
887
|
+
this.allowNegativeNumbers && str.includes(MaskExpression.MINUS)
|
|
888
|
+
? sanitizedStr.slice(1, str.length)
|
|
889
|
+
: sanitizedStr
|
|
890
|
+
);
|
|
891
|
+
|
|
892
|
+
return !isNaN(value) && value >= 0 && value <= 100;
|
|
893
|
+
};
|
|
894
|
+
|
|
895
|
+
public getPrecision = (maskExpression: string): number => {
|
|
896
|
+
const x: string[] = maskExpression.split(MaskExpression.DOT);
|
|
897
|
+
if (x.length > 1) {
|
|
898
|
+
return Number(x[x.length - 1]);
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
return Infinity;
|
|
902
|
+
};
|
|
903
|
+
|
|
904
|
+
private checkAndRemoveSuffix = (inputValue: string): string => {
|
|
905
|
+
for (let i = this.suffix?.length - 1; i >= 0; i--) {
|
|
906
|
+
const substr = this.suffix.substring(i, this.suffix?.length);
|
|
907
|
+
if (
|
|
908
|
+
inputValue.includes(substr) &&
|
|
909
|
+
i !== this.suffix?.length - 1 &&
|
|
910
|
+
(i - 1 < 0 ||
|
|
911
|
+
!inputValue.includes(this.suffix.substring(i - 1, this.suffix?.length)))
|
|
912
|
+
) {
|
|
913
|
+
return inputValue.replace(substr, MaskExpression.EMPTY_STRING);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
return inputValue;
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
private checkInputPrecision = (
|
|
920
|
+
inputValue: string,
|
|
921
|
+
precision: number,
|
|
922
|
+
decimalMarker: NgxMaskConfig['decimalMarker']
|
|
923
|
+
): string => {
|
|
924
|
+
let processedInputValue = inputValue;
|
|
925
|
+
let processedDecimalMarker = decimalMarker;
|
|
926
|
+
|
|
927
|
+
if (precision < Infinity) {
|
|
928
|
+
// TODO need think about decimalMarker
|
|
929
|
+
if (Array.isArray(processedDecimalMarker)) {
|
|
930
|
+
const marker = processedDecimalMarker.find((dm) => dm !== this.thousandSeparator);
|
|
931
|
+
|
|
932
|
+
processedDecimalMarker = marker ? marker : processedDecimalMarker[0];
|
|
933
|
+
}
|
|
934
|
+
const precisionRegEx = new RegExp(
|
|
935
|
+
this._charToRegExpExpression(processedDecimalMarker) + `\\d{${precision}}.*$`
|
|
936
|
+
);
|
|
937
|
+
const precisionMatch: RegExpMatchArray | null =
|
|
938
|
+
processedInputValue.match(precisionRegEx);
|
|
939
|
+
const precisionMatchLength: number = (precisionMatch && precisionMatch[0]?.length) ?? 0;
|
|
940
|
+
if (precisionMatchLength - 1 > precision) {
|
|
941
|
+
const diff = precisionMatchLength - 1 - precision;
|
|
942
|
+
|
|
943
|
+
processedInputValue = processedInputValue.substring(
|
|
944
|
+
0,
|
|
945
|
+
processedInputValue.length - diff
|
|
946
|
+
);
|
|
947
|
+
}
|
|
948
|
+
if (
|
|
949
|
+
precision === 0 &&
|
|
950
|
+
this._compareOrIncludes(
|
|
951
|
+
processedInputValue[processedInputValue.length - 1],
|
|
952
|
+
processedDecimalMarker,
|
|
953
|
+
this.thousandSeparator
|
|
954
|
+
)
|
|
955
|
+
) {
|
|
956
|
+
processedInputValue = processedInputValue.substring(
|
|
957
|
+
0,
|
|
958
|
+
processedInputValue.length - 1
|
|
959
|
+
);
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
return processedInputValue;
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
private _stripToDecimal(str: string): string {
|
|
966
|
+
return str
|
|
967
|
+
.split(MaskExpression.EMPTY_STRING)
|
|
968
|
+
.filter((i: string, idx: number) => {
|
|
969
|
+
const isDecimalMarker =
|
|
970
|
+
typeof this.decimalMarker === 'string'
|
|
971
|
+
? i === this.decimalMarker
|
|
972
|
+
: // TODO (inepipenko) use utility type
|
|
973
|
+
this.decimalMarker.includes(
|
|
974
|
+
i as MaskExpression.COMMA | MaskExpression.DOT
|
|
975
|
+
);
|
|
976
|
+
return (
|
|
977
|
+
i.match('^-?\\d') ||
|
|
978
|
+
i === this.thousandSeparator ||
|
|
979
|
+
isDecimalMarker ||
|
|
980
|
+
(i === MaskExpression.MINUS && idx === 0 && this.allowNegativeNumbers)
|
|
981
|
+
);
|
|
982
|
+
})
|
|
983
|
+
.join(MaskExpression.EMPTY_STRING);
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
private _charToRegExpExpression(char: string): string {
|
|
987
|
+
// if (Array.isArray(char)) {
|
|
988
|
+
// return char.map((v) => ('[\\^$.|?*+()'.indexOf(v) >= 0 ? `\\${v}` : v)).join('|');
|
|
989
|
+
// }
|
|
990
|
+
if (char) {
|
|
991
|
+
const charsToEscape = '[\\^$.|?*+()';
|
|
992
|
+
return char === ' ' ? '\\s' : charsToEscape.indexOf(char) >= 0 ? `\\${char}` : char;
|
|
993
|
+
}
|
|
994
|
+
return char;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
private _shiftStep(cursor: number) {
|
|
998
|
+
this._shift.add(cursor + this.prefix.length || 0);
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
protected _compareOrIncludes<T>(value: T, comparedValue: T | T[], excludedValue: T): boolean {
|
|
1002
|
+
return Array.isArray(comparedValue)
|
|
1003
|
+
? comparedValue.filter((v) => v !== excludedValue).includes(value)
|
|
1004
|
+
: value === comparedValue;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
private _validIP(valuesIP: string[]): boolean {
|
|
1008
|
+
return !(
|
|
1009
|
+
valuesIP.length === 4 &&
|
|
1010
|
+
!valuesIP.some((value: string, index: number) => {
|
|
1011
|
+
if (valuesIP.length !== index + 1) {
|
|
1012
|
+
return value === MaskExpression.EMPTY_STRING || Number(value) > 255;
|
|
1013
|
+
}
|
|
1014
|
+
return value === MaskExpression.EMPTY_STRING || Number(value.substring(0, 3)) > 255;
|
|
1015
|
+
})
|
|
1016
|
+
);
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
private _splitPercentZero(value: string): string {
|
|
1020
|
+
if (value === MaskExpression.MINUS && this.allowNegativeNumbers) {
|
|
1021
|
+
return value;
|
|
1022
|
+
}
|
|
1023
|
+
const decimalIndex =
|
|
1024
|
+
typeof this.decimalMarker === 'string'
|
|
1025
|
+
? value.indexOf(this.decimalMarker)
|
|
1026
|
+
: value.indexOf(MaskExpression.DOT);
|
|
1027
|
+
const emptyOrMinus =
|
|
1028
|
+
this.allowNegativeNumbers && value.includes(MaskExpression.MINUS) ? '-' : '';
|
|
1029
|
+
if (decimalIndex === -1) {
|
|
1030
|
+
const parsedValue = parseInt(emptyOrMinus ? value.slice(1, value.length) : value, 10);
|
|
1031
|
+
return isNaN(parsedValue)
|
|
1032
|
+
? MaskExpression.EMPTY_STRING
|
|
1033
|
+
: `${emptyOrMinus}${parsedValue}`;
|
|
1034
|
+
} else {
|
|
1035
|
+
const integerPart = parseInt(value.replace('-', '').substring(0, decimalIndex), 10);
|
|
1036
|
+
const decimalPart = value.substring(decimalIndex + 1);
|
|
1037
|
+
const integerString = isNaN(integerPart) ? '' : integerPart.toString();
|
|
1038
|
+
|
|
1039
|
+
const decimal =
|
|
1040
|
+
typeof this.decimalMarker === 'string' ? this.decimalMarker : MaskExpression.DOT;
|
|
1041
|
+
|
|
1042
|
+
return integerString === MaskExpression.EMPTY_STRING
|
|
1043
|
+
? MaskExpression.EMPTY_STRING
|
|
1044
|
+
: `${emptyOrMinus}${integerString}${decimal}${decimalPart}`;
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
private _findFirstNonZeroAndDecimalIndex(inputString: string, decimalMarker: '.' | ',') {
|
|
1049
|
+
let decimalMarkerIndex: number | null = null;
|
|
1050
|
+
let nonZeroIndex: number | null = null;
|
|
1051
|
+
|
|
1052
|
+
for (let i = 0; i < inputString.length; i++) {
|
|
1053
|
+
const char = inputString[i];
|
|
1054
|
+
|
|
1055
|
+
if (char === decimalMarker && decimalMarkerIndex === null) {
|
|
1056
|
+
decimalMarkerIndex = i;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
if (char && char >= '1' && char <= '9' && nonZeroIndex === null) {
|
|
1060
|
+
nonZeroIndex = i;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
if (decimalMarkerIndex !== null && nonZeroIndex !== null) {
|
|
1064
|
+
break;
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
return {
|
|
1069
|
+
decimalMarkerIndex,
|
|
1070
|
+
nonZeroIndex,
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
}
|