matcha-components 20.15.0 → 20.16.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/fesm2022/matcha-components.mjs +8167 -0
- package/fesm2022/matcha-components.mjs.map +1 -0
- package/index.d.ts +2030 -0
- package/package.json +19 -6
- package/assets/open_in_new.png +0 -0
- package/index.ts +0 -1
- package/ng-package.json +0 -7
- package/src/documentation/components/matcha-drawer.mdx +0 -469
- package/src/documentation/foundation/borders/border-radius.mdx +0 -145
- package/src/documentation/foundation/borders/border-size.mdx +0 -111
- package/src/documentation/foundation/borders/border-style.mdx +0 -144
- package/src/documentation/foundation/colors/all-colors.mdx +0 -153
- package/src/documentation/foundation/colors/base/amber.mdx +0 -235
- package/src/documentation/foundation/colors/base/blue.mdx +0 -235
- package/src/documentation/foundation/colors/base/cyan.mdx +0 -235
- package/src/documentation/foundation/colors/base/deep-orange.mdx +0 -235
- package/src/documentation/foundation/colors/base/deep-purple.mdx +0 -235
- package/src/documentation/foundation/colors/base/green.mdx +0 -235
- package/src/documentation/foundation/colors/base/indigo.mdx +0 -235
- package/src/documentation/foundation/colors/base/light-blue.mdx +0 -235
- package/src/documentation/foundation/colors/base/light-green.mdx +0 -235
- package/src/documentation/foundation/colors/base/lime.mdx +0 -235
- package/src/documentation/foundation/colors/base/orange.mdx +0 -235
- package/src/documentation/foundation/colors/base/pink.mdx +0 -235
- package/src/documentation/foundation/colors/base/purple.mdx +0 -235
- package/src/documentation/foundation/colors/base/red.mdx +0 -235
- package/src/documentation/foundation/colors/base/teal.mdx +0 -235
- package/src/documentation/foundation/colors/base/yellow.mdx +0 -235
- package/src/documentation/foundation/colors/surface-colors.mdx +0 -93
- package/src/documentation/foundation/colors/theme/accent.mdx +0 -235
- package/src/documentation/foundation/colors/theme/primary.mdx +0 -235
- package/src/documentation/foundation/colors/theme/warn.mdx +0 -235
- package/src/documentation/foundation/displays/display-block.mdx +0 -134
- package/src/documentation/foundation/displays/display-flex.mdx +0 -134
- package/src/documentation/foundation/displays/display-grid.mdx +0 -134
- package/src/documentation/foundation/displays/display-inline-block.mdx +0 -134
- package/src/documentation/foundation/displays/display-inline-flex.mdx +0 -134
- package/src/documentation/foundation/displays/display-inline.mdx +0 -134
- package/src/documentation/foundation/displays/display-none.mdx +0 -134
- package/src/documentation/foundation/displays/display-table-cell.mdx +0 -134
- package/src/documentation/foundation/displays/display-table-row.mdx +0 -134
- package/src/documentation/foundation/displays/display-table.mdx +0 -134
- package/src/documentation/foundation/flexbox/flexbox.mdx +0 -420
- package/src/documentation/foundation/opacity/opacity.mdx +0 -104
- package/src/documentation/foundation/position/alignment.mdx +0 -148
- package/src/documentation/foundation/sizes/height/heights.mdx +0 -96
- package/src/documentation/foundation/sizes/height/max-heights.mdx +0 -96
- package/src/documentation/foundation/sizes/height/min-heights.mdx +0 -96
- package/src/documentation/foundation/sizes/width/max-width.mdx +0 -95
- package/src/documentation/foundation/sizes/width/min-width.mdx +0 -96
- package/src/documentation/foundation/sizes/width/widths.mdx +0 -96
- package/src/documentation/foundation/spacing/margins.mdx +0 -227
- package/src/documentation/foundation/spacing/paddings.mdx +0 -225
- package/src/documentation/foundation/typography/colors.mdx +0 -26
- package/src/documentation/foundation/typography/font-size.mdx +0 -57
- package/src/documentation/foundation/typography/font-weight.mdx +0 -85
- package/src/documentation/foundation/typography/letter-spacing.mdx +0 -35
- package/src/documentation/foundation/typography/line-clamp.mdx +0 -145
- package/src/documentation/foundation/typography/line-height.mdx +0 -52
- package/src/documentation/foundation/typography/message-box.mdx +0 -43
- package/src/documentation/foundation/typography/paragraph.mdx +0 -165
- package/src/documentation/foundation/typography/text-align.mdx +0 -22
- package/src/documentation/foundation/typography/text-styles.mdx +0 -88
- package/src/documentation/presentation.mdx +0 -591
- package/src/documentation/services/matcha-breakpoint-observer.mdx +0 -310
- package/src/documentation/tokens/animations.mdx +0 -116
- package/src/documentation/tokens/breakpoints.mdx +0 -57
- package/src/documentation/tokens/colors.mdx +0 -1884
- package/src/documentation/tokens/elevations.mdx +0 -50
- package/src/documentation/tokens/sizes.mdx +0 -150
- package/src/lib/matcha-accordion/accordion/accordion.component.html +0 -1
- package/src/lib/matcha-accordion/accordion/accordion.component.scss +0 -0
- package/src/lib/matcha-accordion/accordion/accordion.component.ts +0 -72
- package/src/lib/matcha-accordion/accordion-content/accordion-content.component.html +0 -1
- package/src/lib/matcha-accordion/accordion-content/accordion-content.component.scss +0 -0
- package/src/lib/matcha-accordion/accordion-content/accordion-content.component.ts +0 -11
- package/src/lib/matcha-accordion/accordion-header/accordion-header.component.html +0 -1
- package/src/lib/matcha-accordion/accordion-header/accordion-header.component.scss +0 -0
- package/src/lib/matcha-accordion/accordion-header/accordion-header.component.ts +0 -11
- package/src/lib/matcha-accordion/accordion-item/accordion-item.component.html +0 -13
- package/src/lib/matcha-accordion/accordion-item/accordion-item.component.scss +0 -0
- package/src/lib/matcha-accordion/accordion-item/accordion-item.component.ts +0 -63
- package/src/lib/matcha-accordion/accordion.module.ts +0 -37
- package/src/lib/matcha-accordion/accordion.stories.ts +0 -108
- package/src/lib/matcha-animations/animations.ts +0 -406
- package/src/lib/matcha-autocomplete/README.md +0 -185
- package/src/lib/matcha-autocomplete/matcha-autocomplete.component.html +0 -13
- package/src/lib/matcha-autocomplete/matcha-autocomplete.component.ts +0 -238
- package/src/lib/matcha-autocomplete/matcha-autocomplete.directive.ts +0 -153
- package/src/lib/matcha-autocomplete/matcha-autocomplete.module.ts +0 -30
- package/src/lib/matcha-autocomplete/matcha-autocomplete.stories.ts +0 -172
- package/src/lib/matcha-avatar/avatar/avatar.component.html +0 -29
- package/src/lib/matcha-avatar/avatar/avatar.component.scss +0 -0
- package/src/lib/matcha-avatar/avatar/avatar.component.ts +0 -78
- package/src/lib/matcha-avatar/avatar.module.ts +0 -17
- package/src/lib/matcha-badge/badge.argtypes.ts +0 -77
- package/src/lib/matcha-badge/badge.directive.ts +0 -12
- package/src/lib/matcha-badge/badge.mdx +0 -69
- package/src/lib/matcha-badge/badge.module.ts +0 -9
- package/src/lib/matcha-badge/badge.stories.ts +0 -79
- package/src/lib/matcha-breakpoint-observable/breakpoint-observable.module.ts +0 -23
- package/src/lib/matcha-breakpoint-observable/breakpoint-observer.service.ts +0 -215
- package/src/lib/matcha-breakpoint-observable/index.ts +0 -2
- package/src/lib/matcha-button/button/button.component.html +0 -1
- package/src/lib/matcha-button/button/button.component.scss +0 -0
- package/src/lib/matcha-button/button/button.component.ts +0 -182
- package/src/lib/matcha-button/button.argtypes.ts +0 -105
- package/src/lib/matcha-button/button.module.ts +0 -10
- package/src/lib/matcha-button/button.stories.ts +0 -552
- package/src/lib/matcha-button-toggle/button-toggle/button-toggle.component.html +0 -8
- 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 +0 -87
- package/src/lib/matcha-button-toggle/button-toggle.module.ts +0 -16
- package/src/lib/matcha-button-toggle/button-toggle.stories.ts +0 -106
- package/src/lib/matcha-card/card/card.component.html +0 -1
- package/src/lib/matcha-card/card/card.component.scss +0 -0
- package/src/lib/matcha-card/card/card.component.ts +0 -86
- package/src/lib/matcha-card/card-argtype.ts +0 -54
- package/src/lib/matcha-card/card.module.ts +0 -22
- package/src/lib/matcha-card/card.stories.ts +0 -339
- package/src/lib/matcha-checkbox/checkbox/checkbox.component.html +0 -19
- package/src/lib/matcha-checkbox/checkbox/checkbox.component.scss +0 -0
- package/src/lib/matcha-checkbox/checkbox/checkbox.component.ts +0 -79
- package/src/lib/matcha-checkbox/checkbox.module.ts +0 -15
- package/src/lib/matcha-checkbox/checkbox.stories.ts +0 -391
- package/src/lib/matcha-components.module.ts +0 -149
- package/src/lib/matcha-date-range/date-range/date-range.component.html +0 -3
- 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 +0 -100
- package/src/lib/matcha-date-range/date-range.module.ts +0 -14
- package/src/lib/matcha-divider/divider/divider.component.html +0 -1
- package/src/lib/matcha-divider/divider/divider.component.scss +0 -0
- package/src/lib/matcha-divider/divider/divider.component.ts +0 -50
- package/src/lib/matcha-divider/divider.argtypes.ts +0 -57
- package/src/lib/matcha-divider/divider.mdx +0 -107
- package/src/lib/matcha-divider/divider.module.ts +0 -14
- package/src/lib/matcha-divider/divider.stories.ts +0 -44
- package/src/lib/matcha-drawer/drawer/drawer.component.html +0 -43
- package/src/lib/matcha-drawer/drawer/drawer.component.ts +0 -358
- package/src/lib/matcha-drawer/drawer-container/drawer-container.component.html +0 -3
- package/src/lib/matcha-drawer/drawer-container/drawer-container.component.ts +0 -36
- package/src/lib/matcha-drawer/drawer-content/drawer-content.component.html +0 -3
- package/src/lib/matcha-drawer/drawer-content/drawer-content.component.ts +0 -24
- package/src/lib/matcha-drawer/drawer.module.ts +0 -28
- package/src/lib/matcha-drop-list/directives/drag-handle.directive.ts +0 -22
- package/src/lib/matcha-drop-list/directives/drag.directive.ts +0 -369
- package/src/lib/matcha-drop-list/drop-list/drop-list.component.html +0 -27
- package/src/lib/matcha-drop-list/drop-list/drop-list.component.ts +0 -380
- package/src/lib/matcha-drop-list/drop-list-argtype.ts +0 -56
- package/src/lib/matcha-drop-list/drop-list.module.ts +0 -27
- package/src/lib/matcha-drop-list/drop-list.stories.ts +0 -314
- package/src/lib/matcha-drop-list/services/drop-list.service.ts +0 -30
- package/src/lib/matcha-elevation/elevation.argtypes.ts +0 -16
- package/src/lib/matcha-elevation/elevation.directive.ts +0 -30
- package/src/lib/matcha-elevation/elevation.module.ts +0 -10
- package/src/lib/matcha-elevation/elevation.stories.ts +0 -60
- package/src/lib/matcha-form-field/form-field.argtype.ts +0 -21
- package/src/lib/matcha-form-field/form-field.stories.ts +0 -45
- package/src/lib/matcha-form-field/matcha-error/matcha-error.component.html +0 -4
- 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 +0 -9
- package/src/lib/matcha-form-field/matcha-form-field/matcha-form-field.component.html +0 -19
- 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 +0 -30
- package/src/lib/matcha-form-field/matcha-form-field.module.ts +0 -13
- package/src/lib/matcha-form-field/matcha-label/matcha-label.component.html +0 -7
- 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 +0 -11
- package/src/lib/matcha-grid/grid-argtype.ts +0 -67
- package/src/lib/matcha-grid/grid.component.html +0 -3
- package/src/lib/matcha-grid/grid.component.scss +0 -0
- package/src/lib/matcha-grid/grid.component.ts +0 -114
- package/src/lib/matcha-grid/grid.mdx +0 -60
- package/src/lib/matcha-grid/grid.module.ts +0 -10
- package/src/lib/matcha-grid/grid.stories.ts +0 -125
- package/src/lib/matcha-highlight/copy-button/copy-button.component.html +0 -12
- package/src/lib/matcha-highlight/copy-button/copy-button.component.scss +0 -28
- package/src/lib/matcha-highlight/copy-button/copy-button.component.ts +0 -127
- package/src/lib/matcha-highlight/highlight.component.ts +0 -237
- package/src/lib/matcha-highlight/highlight.module.ts +0 -24
- package/src/lib/matcha-highlight/prism-init.ts +0 -11
- package/src/lib/matcha-highlight/prism-languages.ts +0 -5
- package/src/lib/matcha-highlight/prismjs/components/index.js +0 -82
- package/src/lib/matcha-highlight/prismjs/components/prism-abap.js +0 -48
- package/src/lib/matcha-highlight/prismjs/components/prism-abap.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-abnf.js +0 -54
- package/src/lib/matcha-highlight/prismjs/components/prism-abnf.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-actionscript.js +0 -17
- package/src/lib/matcha-highlight/prismjs/components/prism-actionscript.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-ada.js +0 -19
- package/src/lib/matcha-highlight/prismjs/components/prism-ada.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-apacheconf.js +0 -47
- package/src/lib/matcha-highlight/prismjs/components/prism-apacheconf.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-apl.js +0 -32
- package/src/lib/matcha-highlight/prismjs/components/prism-apl.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-applescript.js +0 -20
- package/src/lib/matcha-highlight/prismjs/components/prism-applescript.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-arduino.js +0 -5
- package/src/lib/matcha-highlight/prismjs/components/prism-arduino.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-arff.js +0 -10
- package/src/lib/matcha-highlight/prismjs/components/prism-arff.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-asciidoc.js +0 -234
- package/src/lib/matcha-highlight/prismjs/components/prism-asciidoc.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-asm6502.js +0 -28
- package/src/lib/matcha-highlight/prismjs/components/prism-asm6502.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-aspnet.js +0 -36
- package/src/lib/matcha-highlight/prismjs/components/prism-aspnet.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-autohotkey.js +0 -27
- package/src/lib/matcha-highlight/prismjs/components/prism-autohotkey.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-autoit.js +0 -34
- package/src/lib/matcha-highlight/prismjs/components/prism-autoit.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-basic.js +0 -17
- package/src/lib/matcha-highlight/prismjs/components/prism-basic.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-batch.js +0 -99
- package/src/lib/matcha-highlight/prismjs/components/prism-batch.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-bison.js +0 -39
- package/src/lib/matcha-highlight/prismjs/components/prism-bison.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-bnf.js +0 -21
- package/src/lib/matcha-highlight/prismjs/components/prism-bnf.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-brainfuck.js +0 -20
- package/src/lib/matcha-highlight/prismjs/components/prism-brainfuck.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-bro.js +0 -48
- package/src/lib/matcha-highlight/prismjs/components/prism-bro.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-cil.js +0 -27
- package/src/lib/matcha-highlight/prismjs/components/prism-cil.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-clike.js +0 -30
- package/src/lib/matcha-highlight/prismjs/components/prism-clike.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-clojure.js +0 -13
- package/src/lib/matcha-highlight/prismjs/components/prism-clojure.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-cmake.js +0 -29
- package/src/lib/matcha-highlight/prismjs/components/prism-cmake.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-coffeescript.js +0 -92
- package/src/lib/matcha-highlight/prismjs/components/prism-coffeescript.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-core.js +0 -553
- package/src/lib/matcha-highlight/prismjs/components/prism-core.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-crystal.js +0 -51
- package/src/lib/matcha-highlight/prismjs/components/prism-crystal.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-csp.js +0 -25
- package/src/lib/matcha-highlight/prismjs/components/prism-csp.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-css-extras.js +0 -70
- package/src/lib/matcha-highlight/prismjs/components/prism-css-extras.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-css.js +0 -51
- package/src/lib/matcha-highlight/prismjs/components/prism-css.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-d.js +0 -64
- package/src/lib/matcha-highlight/prismjs/components/prism-d.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-dart.js +0 -24
- package/src/lib/matcha-highlight/prismjs/components/prism-dart.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-django.js +0 -60
- package/src/lib/matcha-highlight/prismjs/components/prism-django.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-docker.js +0 -11
- package/src/lib/matcha-highlight/prismjs/components/prism-docker.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-ebnf.js +0 -22
- package/src/lib/matcha-highlight/prismjs/components/prism-ebnf.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-eiffel.js +0 -37
- package/src/lib/matcha-highlight/prismjs/components/prism-eiffel.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-ejs.js +0 -24
- package/src/lib/matcha-highlight/prismjs/components/prism-ejs.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-elixir.js +0 -93
- package/src/lib/matcha-highlight/prismjs/components/prism-elixir.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-elm.js +0 -44
- package/src/lib/matcha-highlight/prismjs/components/prism-elm.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-erb.js +0 -20
- package/src/lib/matcha-highlight/prismjs/components/prism-erb.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-erlang.js +0 -44
- package/src/lib/matcha-highlight/prismjs/components/prism-erlang.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-flow.js +0 -35
- package/src/lib/matcha-highlight/prismjs/components/prism-flow.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-fortran.js +0 -40
- package/src/lib/matcha-highlight/prismjs/components/prism-fortran.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-fsharp.js +0 -67
- package/src/lib/matcha-highlight/prismjs/components/prism-fsharp.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-gcode.js +0 -15
- package/src/lib/matcha-highlight/prismjs/components/prism-gcode.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-gedcom.js +0 -28
- package/src/lib/matcha-highlight/prismjs/components/prism-gedcom.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-gherkin.js +0 -79
- package/src/lib/matcha-highlight/prismjs/components/prism-gherkin.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-git.js +0 -68
- package/src/lib/matcha-highlight/prismjs/components/prism-git.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-glsl.js +0 -16
- package/src/lib/matcha-highlight/prismjs/components/prism-glsl.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-gml.js +0 -7
- package/src/lib/matcha-highlight/prismjs/components/prism-gml.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-go.js +0 -12
- package/src/lib/matcha-highlight/prismjs/components/prism-go.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-graphql.js +0 -31
- package/src/lib/matcha-highlight/prismjs/components/prism-graphql.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-groovy.js +0 -65
- package/src/lib/matcha-highlight/prismjs/components/prism-groovy.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-haml.js +0 -154
- package/src/lib/matcha-highlight/prismjs/components/prism-haml.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-handlebars.js +0 -37
- package/src/lib/matcha-highlight/prismjs/components/prism-handlebars.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-haskell.js +0 -38
- package/src/lib/matcha-highlight/prismjs/components/prism-haskell.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-haxe.js +0 -45
- package/src/lib/matcha-highlight/prismjs/components/prism-haxe.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-hcl.js +0 -65
- package/src/lib/matcha-highlight/prismjs/components/prism-hcl.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-hpkp.js +0 -20
- package/src/lib/matcha-highlight/prismjs/components/prism-hpkp.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-hsts.js +0 -20
- package/src/lib/matcha-highlight/prismjs/components/prism-hsts.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-http.js +0 -79
- package/src/lib/matcha-highlight/prismjs/components/prism-http.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-ichigojam.js +0 -15
- package/src/lib/matcha-highlight/prismjs/components/prism-ichigojam.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-icon.js +0 -20
- package/src/lib/matcha-highlight/prismjs/components/prism-icon.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-inform7.js +0 -61
- package/src/lib/matcha-highlight/prismjs/components/prism-inform7.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-ini.js +0 -11
- package/src/lib/matcha-highlight/prismjs/components/prism-ini.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-io.js +0 -31
- package/src/lib/matcha-highlight/prismjs/components/prism-io.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-j.js +0 -25
- package/src/lib/matcha-highlight/prismjs/components/prism-j.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-javadoc.js +0 -54
- package/src/lib/matcha-highlight/prismjs/components/prism-javadoc.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-javadoclike.js +0 -86
- package/src/lib/matcha-highlight/prismjs/components/prism-javadoclike.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-javascript.js +0 -86
- package/src/lib/matcha-highlight/prismjs/components/prism-javascript.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-javastacktrace.js +0 -93
- package/src/lib/matcha-highlight/prismjs/components/prism-javastacktrace.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-jolie.js +0 -55
- package/src/lib/matcha-highlight/prismjs/components/prism-jolie.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-js-extras.js +0 -104
- package/src/lib/matcha-highlight/prismjs/components/prism-js-extras.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-jsdoc.js +0 -73
- package/src/lib/matcha-highlight/prismjs/components/prism-jsdoc.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-json5.js +0 -23
- package/src/lib/matcha-highlight/prismjs/components/prism-json5.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-jsonp.js +0 -7
- package/src/lib/matcha-highlight/prismjs/components/prism-jsonp.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-jsx.js +0 -126
- package/src/lib/matcha-highlight/prismjs/components/prism-jsx.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-julia.js +0 -12
- package/src/lib/matcha-highlight/prismjs/components/prism-julia.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-keyman.js +0 -14
- package/src/lib/matcha-highlight/prismjs/components/prism-keyman.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-kotlin.js +0 -62
- package/src/lib/matcha-highlight/prismjs/components/prism-kotlin.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-latex.js +0 -61
- package/src/lib/matcha-highlight/prismjs/components/prism-latex.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-less.js +0 -54
- package/src/lib/matcha-highlight/prismjs/components/prism-less.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-liquid.js +0 -12
- package/src/lib/matcha-highlight/prismjs/components/prism-liquid.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-lisp.js +0 -197
- package/src/lib/matcha-highlight/prismjs/components/prism-lisp.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-livescript.js +0 -119
- package/src/lib/matcha-highlight/prismjs/components/prism-livescript.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-lolcode.js +0 -55
- package/src/lib/matcha-highlight/prismjs/components/prism-lolcode.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-lua.js +0 -20
- package/src/lib/matcha-highlight/prismjs/components/prism-lua.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-makefile.js +0 -34
- package/src/lib/matcha-highlight/prismjs/components/prism-makefile.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-markdown.js +0 -227
- package/src/lib/matcha-highlight/prismjs/components/prism-markdown.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-markup-templating.js +0 -123
- package/src/lib/matcha-highlight/prismjs/components/prism-markup-templating.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-markup.js +0 -100
- package/src/lib/matcha-highlight/prismjs/components/prism-markup.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-matlab.js +0 -16
- package/src/lib/matcha-highlight/prismjs/components/prism-matlab.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-mel.js +0 -43
- package/src/lib/matcha-highlight/prismjs/components/prism-mel.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-mizar.js +0 -12
- package/src/lib/matcha-highlight/prismjs/components/prism-mizar.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-monkey.js +0 -31
- package/src/lib/matcha-highlight/prismjs/components/prism-monkey.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-n1ql.js +0 -18
- package/src/lib/matcha-highlight/prismjs/components/prism-n1ql.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-n4js.js +0 -14
- package/src/lib/matcha-highlight/prismjs/components/prism-n4js.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-nand2tetris-hdl.js +0 -9
- package/src/lib/matcha-highlight/prismjs/components/prism-nand2tetris-hdl.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-nasm.js +0 -24
- package/src/lib/matcha-highlight/prismjs/components/prism-nasm.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-nginx.js +0 -11
- package/src/lib/matcha-highlight/prismjs/components/prism-nginx.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-nim.js +0 -33
- package/src/lib/matcha-highlight/prismjs/components/prism-nim.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-nix.js +0 -40
- package/src/lib/matcha-highlight/prismjs/components/prism-nix.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-nsis.js +0 -29
- package/src/lib/matcha-highlight/prismjs/components/prism-nsis.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-objectivec.js +0 -7
- package/src/lib/matcha-highlight/prismjs/components/prism-objectivec.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-ocaml.js +0 -27
- package/src/lib/matcha-highlight/prismjs/components/prism-ocaml.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-opencl.js +0 -49
- package/src/lib/matcha-highlight/prismjs/components/prism-opencl.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-oz.js +0 -25
- package/src/lib/matcha-highlight/prismjs/components/prism-oz.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-parigp.js +0 -30
- package/src/lib/matcha-highlight/prismjs/components/prism-parigp.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-parser.js +0 -73
- package/src/lib/matcha-highlight/prismjs/components/prism-parser.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-pascal.js +0 -55
- package/src/lib/matcha-highlight/prismjs/components/prism-pascal.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-php-extras.js +0 -11
- package/src/lib/matcha-highlight/prismjs/components/prism-php-extras.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-phpdoc.js +0 -27
- package/src/lib/matcha-highlight/prismjs/components/prism-phpdoc.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-plsql.js +0 -26
- package/src/lib/matcha-highlight/prismjs/components/prism-plsql.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-powershell.js +0 -60
- package/src/lib/matcha-highlight/prismjs/components/prism-powershell.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-processing.js +0 -18
- package/src/lib/matcha-highlight/prismjs/components/prism-processing.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-prolog.js +0 -20
- package/src/lib/matcha-highlight/prismjs/components/prism-prolog.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-properties.js +0 -9
- package/src/lib/matcha-highlight/prismjs/components/prism-properties.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-protobuf.js +0 -8
- package/src/lib/matcha-highlight/prismjs/components/prism-protobuf.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-pug.js +0 -193
- package/src/lib/matcha-highlight/prismjs/components/prism-pug.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-puppet.js +0 -136
- package/src/lib/matcha-highlight/prismjs/components/prism-puppet.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-pure.js +0 -79
- package/src/lib/matcha-highlight/prismjs/components/prism-pure.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-q.js +0 -51
- package/src/lib/matcha-highlight/prismjs/components/prism-q.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-qore.js +0 -20
- package/src/lib/matcha-highlight/prismjs/components/prism-qore.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-r.js +0 -22
- package/src/lib/matcha-highlight/prismjs/components/prism-r.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-reason.js +0 -32
- package/src/lib/matcha-highlight/prismjs/components/prism-reason.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-regex.js +0 -97
- package/src/lib/matcha-highlight/prismjs/components/prism-regex.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-renpy.js +0 -29
- package/src/lib/matcha-highlight/prismjs/components/prism-renpy.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-rest.js +0 -205
- package/src/lib/matcha-highlight/prismjs/components/prism-rest.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-rip.js +0 -32
- package/src/lib/matcha-highlight/prismjs/components/prism-rip.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-roboconf.js +0 -27
- package/src/lib/matcha-highlight/prismjs/components/prism-roboconf.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-ruby.js +0 -143
- package/src/lib/matcha-highlight/prismjs/components/prism-ruby.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-rust.js +0 -68
- package/src/lib/matcha-highlight/prismjs/components/prism-rust.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-sas.js +0 -34
- package/src/lib/matcha-highlight/prismjs/components/prism-sas.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-scala.js +0 -18
- package/src/lib/matcha-highlight/prismjs/components/prism-scala.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-scheme.js +0 -33
- package/src/lib/matcha-highlight/prismjs/components/prism-scheme.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-smalltalk.js +0 -31
- package/src/lib/matcha-highlight/prismjs/components/prism-smalltalk.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-smarty.js +0 -87
- package/src/lib/matcha-highlight/prismjs/components/prism-smarty.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-soy.js +0 -96
- package/src/lib/matcha-highlight/prismjs/components/prism-soy.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-sql.js +0 -24
- package/src/lib/matcha-highlight/prismjs/components/prism-sql.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-stylus.js +0 -111
- package/src/lib/matcha-highlight/prismjs/components/prism-stylus.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-swift.js +0 -25
- package/src/lib/matcha-highlight/prismjs/components/prism-swift.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-t4-cs.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-t4-cs.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-t4-templating.js +0 -49
- package/src/lib/matcha-highlight/prismjs/components/prism-t4-templating.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-t4-vb.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-t4-vb.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-tap.js +0 -20
- package/src/lib/matcha-highlight/prismjs/components/prism-tap.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-tcl.js +0 -46
- package/src/lib/matcha-highlight/prismjs/components/prism-tcl.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-textile.js +0 -260
- package/src/lib/matcha-highlight/prismjs/components/prism-textile.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-toml.js +0 -43
- package/src/lib/matcha-highlight/prismjs/components/prism-toml.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-tsx.js +0 -2
- package/src/lib/matcha-highlight/prismjs/components/prism-tsx.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-tt2.js +0 -56
- package/src/lib/matcha-highlight/prismjs/components/prism-tt2.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-twig.js +0 -46
- package/src/lib/matcha-highlight/prismjs/components/prism-twig.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-vala.js +0 -74
- package/src/lib/matcha-highlight/prismjs/components/prism-vala.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-vbnet.js +0 -15
- package/src/lib/matcha-highlight/prismjs/components/prism-vbnet.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-velocity.js +0 -72
- package/src/lib/matcha-highlight/prismjs/components/prism-velocity.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-verilog.js +0 -20
- package/src/lib/matcha-highlight/prismjs/components/prism-verilog.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-vhdl.js +0 -23
- package/src/lib/matcha-highlight/prismjs/components/prism-vhdl.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-vim.js +0 -10
- package/src/lib/matcha-highlight/prismjs/components/prism-vim.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-visual-basic.js +0 -34
- package/src/lib/matcha-highlight/prismjs/components/prism-visual-basic.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-wasm.js +0 -31
- package/src/lib/matcha-highlight/prismjs/components/prism-wasm.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-wiki.js +0 -81
- package/src/lib/matcha-highlight/prismjs/components/prism-wiki.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-xeora.js +0 -114
- package/src/lib/matcha-highlight/prismjs/components/prism-xeora.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-xojo.js +0 -20
- package/src/lib/matcha-highlight/prismjs/components/prism-xojo.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-xquery.js +0 -164
- package/src/lib/matcha-highlight/prismjs/components/prism-xquery.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components/prism-yaml.js +0 -47
- package/src/lib/matcha-highlight/prismjs/components/prism-yaml.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/components.js +0 -2
- package/src/lib/matcha-highlight/prismjs/components.json +0 -1031
- package/src/lib/matcha-highlight/prismjs/plugins/autolinker/prism-autolinker.css +0 -3
- package/src/lib/matcha-highlight/prismjs/plugins/autolinker/prism-autolinker.js +0 -81
- package/src/lib/matcha-highlight/prismjs/plugins/autolinker/prism-autolinker.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/autoloader/prism-autoloader.js +0 -214
- package/src/lib/matcha-highlight/prismjs/plugins/autoloader/prism-autoloader.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/command-line/prism-command-line.css +0 -33
- package/src/lib/matcha-highlight/prismjs/plugins/command-line/prism-command-line.js +0 -139
- package/src/lib/matcha-highlight/prismjs/plugins/command-line/prism-command-line.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard.js +0 -75
- package/src/lib/matcha-highlight/prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/custom-class/prism-custom-class.js +0 -31
- package/src/lib/matcha-highlight/prismjs/plugins/custom-class/prism-custom-class.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/data-uri-highlight/prism-data-uri-highlight.js +0 -98
- package/src/lib/matcha-highlight/prismjs/plugins/data-uri-highlight/prism-data-uri-highlight.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/file-highlight/prism-file-highlight.js +0 -105
- package/src/lib/matcha-highlight/prismjs/plugins/file-highlight/prism-file-highlight.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/highlight-keywords/prism-highlight-keywords.js +0 -17
- package/src/lib/matcha-highlight/prismjs/plugins/highlight-keywords/prism-highlight-keywords.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/jsonp-highlight/prism-jsonp-highlight.js +0 -206
- package/src/lib/matcha-highlight/prismjs/plugins/jsonp-highlight/prism-jsonp-highlight.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/keep-markup/prism-keep-markup.js +0 -99
- package/src/lib/matcha-highlight/prismjs/plugins/keep-markup/prism-keep-markup.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/line-highlight/prism-line-highlight.css +0 -49
- package/src/lib/matcha-highlight/prismjs/plugins/line-highlight/prism-line-highlight.js +0 -181
- package/src/lib/matcha-highlight/prismjs/plugins/line-highlight/prism-line-highlight.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/line-numbers/prism-line-numbers.css +0 -41
- package/src/lib/matcha-highlight/prismjs/plugins/line-numbers/prism-line-numbers.js +0 -168
- package/src/lib/matcha-highlight/prismjs/plugins/line-numbers/prism-line-numbers.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.js +0 -190
- package/src/lib/matcha-highlight/prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/previewers/prism-previewers.css +0 -242
- package/src/lib/matcha-highlight/prismjs/plugins/previewers/prism-previewers.js +0 -708
- package/src/lib/matcha-highlight/prismjs/plugins/previewers/prism-previewers.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js +0 -21
- package/src/lib/matcha-highlight/prismjs/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/show-invisibles/prism-show-invisibles.css +0 -34
- package/src/lib/matcha-highlight/prismjs/plugins/show-invisibles/prism-show-invisibles.js +0 -84
- package/src/lib/matcha-highlight/prismjs/plugins/show-invisibles/prism-show-invisibles.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/show-language/prism-show-language.js +0 -46
- package/src/lib/matcha-highlight/prismjs/plugins/show-language/prism-show-language.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/toolbar/prism-toolbar.css +0 -58
- package/src/lib/matcha-highlight/prismjs/plugins/toolbar/prism-toolbar.js +0 -149
- package/src/lib/matcha-highlight/prismjs/plugins/toolbar/prism-toolbar.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/unescaped-markup/prism-unescaped-markup.css +0 -10
- package/src/lib/matcha-highlight/prismjs/plugins/unescaped-markup/prism-unescaped-markup.js +0 -44
- package/src/lib/matcha-highlight/prismjs/plugins/unescaped-markup/prism-unescaped-markup.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/plugins/wpd/prism-wpd.css +0 -11
- package/src/lib/matcha-highlight/prismjs/plugins/wpd/prism-wpd.js +0 -169
- package/src/lib/matcha-highlight/prismjs/plugins/wpd/prism-wpd.min.js +0 -1
- package/src/lib/matcha-highlight/prismjs/prism.d.ts +0 -4
- package/src/lib/matcha-highlight/prismjs/prism.js +0 -960
- package/src/lib/matcha-highlight/prismjs/themes/prism-coy.css +0 -226
- package/src/lib/matcha-highlight/prismjs/themes/prism-dark.css +0 -129
- package/src/lib/matcha-highlight/prismjs/themes/prism-funky.css +0 -117
- package/src/lib/matcha-highlight/prismjs/themes/prism-okaidia.css +0 -123
- package/src/lib/matcha-highlight/prismjs/themes/prism-solarizedlight.css +0 -150
- package/src/lib/matcha-highlight/prismjs/themes/prism-tomorrow.css +0 -122
- package/src/lib/matcha-highlight/prismjs/themes/prism-twilight.css +0 -199
- package/src/lib/matcha-highlight/prismjs/themes/prism.css +0 -139
- package/src/lib/matcha-hint-text/hint/hint-text.component.html +0 -4
- package/src/lib/matcha-hint-text/hint/hint-text.component.scss +0 -0
- package/src/lib/matcha-hint-text/hint/hint-text.component.ts +0 -31
- package/src/lib/matcha-hint-text/hint.module.ts +0 -15
- package/src/lib/matcha-hint-text/hint.stories.ts +0 -52
- package/src/lib/matcha-icon/icon-argtype.ts +0 -36
- package/src/lib/matcha-icon/icon.component.html +0 -3
- package/src/lib/matcha-icon/icon.component.scss +0 -0
- package/src/lib/matcha-icon/icon.component.ts +0 -34
- package/src/lib/matcha-icon/icon.mdx +0 -58
- package/src/lib/matcha-icon/icon.module.ts +0 -11
- package/src/lib/matcha-icon/icon.stories.ts +0 -431
- 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 +0 -49
- 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 +0 -165
- package/src/lib/matcha-infinite-scroll/matcha-infinite-scroll.module.ts +0 -14
- package/src/lib/matcha-input/input.argtypes.ts +0 -39
- package/src/lib/matcha-input/input.directive.ts +0 -12
- package/src/lib/matcha-input/input.mdx +0 -73
- package/src/lib/matcha-input/input.module.ts +0 -9
- package/src/lib/matcha-input/input.stories.ts +0 -97
- package/src/lib/matcha-input-phone/all-countries.ts +0 -1366
- package/src/lib/matcha-input-phone/input-phone.argtypes.ts +0 -83
- package/src/lib/matcha-input-phone/input-phone.component.html +0 -33
- package/src/lib/matcha-input-phone/input-phone.component.spec.ts +0 -23
- package/src/lib/matcha-input-phone/input-phone.component.ts +0 -267
- package/src/lib/matcha-input-phone/input-phone.module.ts +0 -22
- package/src/lib/matcha-input-phone/input-phone.stories.ts +0 -85
- package/src/lib/matcha-input-phone/lib/custom-keyboard-event.ts +0 -21
- package/src/lib/matcha-input-phone/lib/ngx-mask-applier.service.ts +0 -1073
- package/src/lib/matcha-input-phone/lib/ngx-mask-expression.enum.ts +0 -43
- package/src/lib/matcha-input-phone/lib/ngx-mask.config.ts +0 -132
- package/src/lib/matcha-input-phone/lib/ngx-mask.directive.ts +0 -1187
- package/src/lib/matcha-input-phone/lib/ngx-mask.module.ts +0 -55
- package/src/lib/matcha-input-phone/lib/ngx-mask.pipe.ts +0 -131
- package/src/lib/matcha-input-phone/lib/ngx-mask.providers.ts +0 -42
- package/src/lib/matcha-input-phone/lib/ngx-mask.service.ts +0 -832
- package/src/lib/matcha-lazyload/lazyload/lazyload.component.html +0 -1
- package/src/lib/matcha-lazyload/lazyload/lazyload.component.scss +0 -0
- package/src/lib/matcha-lazyload/lazyload/lazyload.component.ts +0 -48
- package/src/lib/matcha-lazyload/lazyload-data/lazyload-data.component.html +0 -1
- package/src/lib/matcha-lazyload/lazyload-data/lazyload-data.component.scss +0 -0
- package/src/lib/matcha-lazyload/lazyload-data/lazyload-data.component.ts +0 -172
- package/src/lib/matcha-lazyload/lazyload.module.ts +0 -14
- package/src/lib/matcha-masonry/masonry/masonry.component.html +0 -3
- package/src/lib/matcha-masonry/masonry/masonry.component.scss +0 -0
- package/src/lib/matcha-masonry/masonry/masonry.component.ts +0 -45
- package/src/lib/matcha-masonry/masonry.argtype.ts +0 -97
- package/src/lib/matcha-masonry/masonry.mdx +0 -133
- package/src/lib/matcha-masonry/masonry.module.ts +0 -10
- package/src/lib/matcha-masonry/masonry.stories.ts +0 -64
- package/src/lib/matcha-menu/menu.argtypes.ts +0 -111
- package/src/lib/matcha-menu/menu.component.html +0 -3
- package/src/lib/matcha-menu/menu.component.scss +0 -0
- package/src/lib/matcha-menu/menu.component.spec.ts +0 -23
- package/src/lib/matcha-menu/menu.component.ts +0 -48
- package/src/lib/matcha-menu/menu.directive.ts +0 -39
- package/src/lib/matcha-menu/menu.mdx +0 -59
- package/src/lib/matcha-menu/menu.module.ts +0 -19
- package/src/lib/matcha-menu/menu.stories.ts +0 -122
- package/src/lib/matcha-modal/exemplo/exemple-modal-content.component.html +0 -34
- package/src/lib/matcha-modal/exemplo/exemple-modal-content.component.ts +0 -44
- package/src/lib/matcha-modal/exemplo/exemple-modal.component.html +0 -46
- package/src/lib/matcha-modal/exemplo/exemple-modal.component.ts +0 -34
- package/src/lib/matcha-modal/matcha-modal.module.ts +0 -45
- package/src/lib/matcha-modal/modal/modal.component.html +0 -3
- package/src/lib/matcha-modal/modal/modal.component.scss +0 -0
- package/src/lib/matcha-modal/modal/modal.component.ts +0 -67
- package/src/lib/matcha-modal/modal-content/modal-content.component.html +0 -9
- package/src/lib/matcha-modal/modal-content/modal-content.component.scss +0 -0
- package/src/lib/matcha-modal/modal-content/modal-content.component.ts +0 -11
- package/src/lib/matcha-modal/modal-footer/modal-footer.component.html +0 -8
- package/src/lib/matcha-modal/modal-footer/modal-footer.component.scss +0 -0
- package/src/lib/matcha-modal/modal-footer/modal-footer.component.ts +0 -32
- package/src/lib/matcha-modal/modal-header/modal-header.component.html +0 -13
- package/src/lib/matcha-modal/modal-header/modal-header.component.scss +0 -0
- package/src/lib/matcha-modal/modal-header/modal-header.component.ts +0 -11
- package/src/lib/matcha-modal/modal-options/modal-options.component.html +0 -3
- package/src/lib/matcha-modal/modal-options/modal-options.component.scss +0 -0
- package/src/lib/matcha-modal/modal-options/modal-options.component.ts +0 -11
- package/src/lib/matcha-modal/modal.service.ts +0 -47
- package/src/lib/matcha-modal/modal.stories.argtypes.ts +0 -56
- package/src/lib/matcha-modal/modal.stories.ts +0 -333
- package/src/lib/matcha-modal/model/IMatchaModalComponent.ts +0 -1
- package/src/lib/matcha-modal/overlay.service.ts +0 -138
- package/src/lib/matcha-option/README.md +0 -144
- package/src/lib/matcha-option/matcha-option-parent.interface.ts +0 -22
- package/src/lib/matcha-option/matcha-option.component.ts +0 -93
- package/src/lib/matcha-option/matcha-option.module.ts +0 -17
- package/src/lib/matcha-option/matcha-option.stories.ts +0 -127
- package/src/lib/matcha-overflow-draggable/matcha-overflow-draggable.component.html +0 -3
- package/src/lib/matcha-overflow-draggable/matcha-overflow-draggable.component.scss +0 -0
- package/src/lib/matcha-overflow-draggable/matcha-overflow-draggable.component.ts +0 -56
- package/src/lib/matcha-page-layout/page-layout.component.html +0 -18
- package/src/lib/matcha-page-layout/page-layout.component.scss +0 -5
- package/src/lib/matcha-page-layout/page-layout.component.ts +0 -11
- package/src/lib/matcha-page-layout/page-layout.module.ts +0 -19
- package/src/lib/matcha-paginator/paginator/page-event.interface.ts +0 -13
- package/src/lib/matcha-paginator/paginator/paginator.component.html +0 -59
- package/src/lib/matcha-paginator/paginator/paginator.component.scss +0 -0
- package/src/lib/matcha-paginator/paginator/paginator.component.ts +0 -154
- package/src/lib/matcha-paginator/paginator-intl.service.ts +0 -39
- package/src/lib/matcha-paginator/paginator.module.ts +0 -13
- package/src/lib/matcha-panel/matcha-panel.component.ts +0 -223
- package/src/lib/matcha-panel/matcha-panel.module.ts +0 -17
- package/src/lib/matcha-progress-bar/progress-bar.argtype.ts +0 -48
- package/src/lib/matcha-progress-bar/progress-bar.directive.ts +0 -17
- package/src/lib/matcha-progress-bar/progress-bar.mdx +0 -95
- package/src/lib/matcha-progress-bar/progress-bar.module.ts +0 -14
- package/src/lib/matcha-progress-bar/progress-bar.stories.ts +0 -89
- package/src/lib/matcha-radio/radio/radio.component.html +0 -20
- package/src/lib/matcha-radio/radio/radio.component.scss +0 -0
- package/src/lib/matcha-radio/radio/radio.component.ts +0 -84
- package/src/lib/matcha-radio/radio.module.ts +0 -16
- package/src/lib/matcha-radio/radio.stories.ts +0 -175
- package/src/lib/matcha-ripple/ripple.directive.ts +0 -71
- package/src/lib/matcha-ripple/ripple.module.ts +0 -16
- package/src/lib/matcha-select/matcha-select.component.html +0 -30
- package/src/lib/matcha-select/matcha-select.component.scss +0 -3
- package/src/lib/matcha-select/matcha-select.component.ts +0 -467
- package/src/lib/matcha-select/matcha-select.directive.ts +0 -147
- package/src/lib/matcha-select/matcha-select.module.ts +0 -23
- package/src/lib/matcha-sidenav/sidenav.argtypes.ts +0 -60
- package/src/lib/matcha-sidenav/sidenav.directive.ts +0 -12
- package/src/lib/matcha-sidenav/sidenav.mdx +0 -57
- package/src/lib/matcha-sidenav/sidenav.module.ts +0 -10
- package/src/lib/matcha-sidenav/sidenav.stories.ts +0 -79
- package/src/lib/matcha-skeleton/skeleton/skeleton.component.html +0 -70
- package/src/lib/matcha-skeleton/skeleton/skeleton.component.scss +0 -0
- package/src/lib/matcha-skeleton/skeleton/skeleton.component.ts +0 -36
- package/src/lib/matcha-skeleton/skeleton-argtype.ts +0 -67
- package/src/lib/matcha-skeleton/skeleton.module.ts +0 -11
- package/src/lib/matcha-skeleton/skeleton.stories.ts +0 -74
- package/src/lib/matcha-slide-toggle/slide-toggle/slide-toggle.component.html +0 -15
- 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 +0 -96
- package/src/lib/matcha-slide-toggle/slide-toggle.module.ts +0 -18
- package/src/lib/matcha-slide-toggle/slide-toggle.stories.ts +0 -78
- package/src/lib/matcha-slider/matcha-slider.directive.ts +0 -17
- package/src/lib/matcha-slider/slider.argtypes.ts +0 -76
- package/src/lib/matcha-slider/slider.mdx +0 -45
- package/src/lib/matcha-slider/slider.module.ts +0 -12
- package/src/lib/matcha-slider/slider.stories.ts +0 -149
- package/src/lib/matcha-snackbar/snack-bar-overview-example.component.ts +0 -22
- package/src/lib/matcha-snackbar/snack-bar-overview-example.css +0 -3
- package/src/lib/matcha-snackbar/snack-bar-overview-example.html +0 -11
- package/src/lib/matcha-snackbar/snack-bar.argtypes.ts +0 -11
- package/src/lib/matcha-snackbar/snack-bar.directive.ts +0 -12
- package/src/lib/matcha-snackbar/snack-bar.mdx +0 -53
- package/src/lib/matcha-snackbar/snack-bar.module.ts +0 -10
- package/src/lib/matcha-snackbar/snack-bar.stories.ts +0 -34
- package/src/lib/matcha-sort-header/example/sort-overview-example.component.ts +0 -66
- package/src/lib/matcha-sort-header/example/sort-overview-example.css +0 -3
- package/src/lib/matcha-sort-header/example/sort-overview-example.html +0 -21
- package/src/lib/matcha-sort-header/sort-header.argtypes.ts +0 -11
- package/src/lib/matcha-sort-header/sort-header.directive.ts +0 -17
- package/src/lib/matcha-sort-header/sort-header.mdx +0 -78
- package/src/lib/matcha-sort-header/sort-header.module.ts +0 -10
- package/src/lib/matcha-sort-header/sort-header.stories.ts +0 -34
- package/src/lib/matcha-spin/spin/spin.component.html +0 -27
- package/src/lib/matcha-spin/spin/spin.component.scss +0 -0
- package/src/lib/matcha-spin/spin/spin.component.ts +0 -70
- package/src/lib/matcha-spin/spin.module.ts +0 -16
- package/src/lib/matcha-spin/spin.stories.ts +0 -85
- package/src/lib/matcha-spinner/spinner/spinner.component.html +0 -29
- package/src/lib/matcha-spinner/spinner/spinner.component.scss +0 -1
- package/src/lib/matcha-spinner/spinner/spinner.component.ts +0 -74
- package/src/lib/matcha-spinner/spinner.module.ts +0 -15
- package/src/lib/matcha-spinner/spinner.stories.ts +0 -85
- package/src/lib/matcha-stepper/next-step.diretive.ts +0 -21
- package/src/lib/matcha-stepper/prev-step.diretive.ts +0 -21
- package/src/lib/matcha-stepper/step/step.component.ts +0 -11
- package/src/lib/matcha-stepper/step-content.diretive.ts +0 -9
- package/src/lib/matcha-stepper/stepper/stepper.component.ts +0 -20
- package/src/lib/matcha-stepper/stepper-content/stepper-content.component.ts +0 -38
- package/src/lib/matcha-stepper/stepper-controller/stepper-controller.component.html +0 -8
- package/src/lib/matcha-stepper/stepper-controller/stepper-controller.component.ts +0 -26
- package/src/lib/matcha-stepper/stepper.argtypes.ts +0 -74
- package/src/lib/matcha-stepper/stepper.module.ts +0 -32
- package/src/lib/matcha-stepper/stepper.service.ts +0 -50
- package/src/lib/matcha-stepper/stepper.stories.ts +0 -117
- package/src/lib/matcha-table/example/table-basic-example.component.ts +0 -36
- package/src/lib/matcha-table/example/table-basic-example.css +0 -0
- package/src/lib/matcha-table/example/table-basic-example.html +0 -35
- package/src/lib/matcha-table/table.argtypes.ts +0 -11
- package/src/lib/matcha-table/table.directive.ts +0 -17
- package/src/lib/matcha-table/table.mdx +0 -78
- package/src/lib/matcha-table/table.module.ts +0 -10
- package/src/lib/matcha-table/table.stories.ts +0 -34
- package/src/lib/matcha-tabs/tab-item/tab-item.component.html +0 -1
- package/src/lib/matcha-tabs/tab-item/tab-item.component.scss +0 -0
- package/src/lib/matcha-tabs/tab-item/tab-item.component.ts +0 -19
- package/src/lib/matcha-tabs/tabs/tabs.component.html +0 -22
- package/src/lib/matcha-tabs/tabs/tabs.component.scss +0 -0
- package/src/lib/matcha-tabs/tabs/tabs.component.ts +0 -58
- package/src/lib/matcha-tabs/tabs.module.ts +0 -19
- package/src/lib/matcha-tabs/tabs.stories.ts +0 -98
- package/src/lib/matcha-time/time/time.component.html +0 -3
- package/src/lib/matcha-time/time/time.component.scss +0 -0
- package/src/lib/matcha-time/time/time.component.ts +0 -141
- package/src/lib/matcha-time/time.module.ts +0 -14
- package/src/lib/matcha-time/time.stories.ts +0 -244
- package/src/lib/matcha-title/title/title.component.html +0 -8
- package/src/lib/matcha-title/title/title.component.scss +0 -5
- package/src/lib/matcha-title/title/title.component.ts +0 -73
- package/src/lib/matcha-title/title.argtypes.ts +0 -69
- package/src/lib/matcha-title/title.module.ts +0 -10
- package/src/lib/matcha-title/title.stories.ts +0 -132
- package/src/lib/matcha-toolbar/toolbar/toolbar.component.html +0 -54
- package/src/lib/matcha-toolbar/toolbar/toolbar.component.scss +0 -0
- package/src/lib/matcha-toolbar/toolbar/toolbar.component.ts +0 -43
- package/src/lib/matcha-toolbar/toolbar-button/toolbar-button.component.html +0 -8
- package/src/lib/matcha-toolbar/toolbar-button/toolbar-button.component.scss +0 -0
- package/src/lib/matcha-toolbar/toolbar-button/toolbar-button.component.ts +0 -21
- package/src/lib/matcha-toolbar/toolbar-content/toolbar-content.component.html +0 -8
- package/src/lib/matcha-toolbar/toolbar-content/toolbar-content.component.scss +0 -0
- package/src/lib/matcha-toolbar/toolbar-content/toolbar-content.component.ts +0 -9
- package/src/lib/matcha-toolbar/toolbar-custom-button/toolbar-custom-button.component.html +0 -6
- 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 +0 -10
- package/src/lib/matcha-toolbar/toolbar-main-button/toolbar-main-button.component.html +0 -11
- 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 +0 -15
- package/src/lib/matcha-toolbar/toolbar.argtypes.ts +0 -27
- package/src/lib/matcha-toolbar/toolbar.module.ts +0 -36
- package/src/lib/matcha-toolbar/toolbar.stories.ts +0 -131
- package/src/lib/matcha-tooltip/tooltip.argtypes.ts +0 -58
- package/src/lib/matcha-tooltip/tooltip.directive.ts +0 -158
- package/src/lib/matcha-tooltip/tooltip.module.ts +0 -11
- package/src/lib/matcha-tooltip/tooltip.stories.ts +0 -259
- package/src/lib/postcss.config.js +0 -6
- package/src/public-api.ts +0 -180
- package/tsconfig.lib.json +0 -18
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
|
@@ -1,1073 +0,0 @@
|
|
|
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
|
-
}
|