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