ngx-mask 14.2.4 → 15.0.1

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/README.md CHANGED
@@ -1,7 +1,11 @@
1
- <a href="https://jsdaddy.github.io/ngx-mask">
2
- <h1 align="center">ngx-mask</h1>
1
+ <a href="http://jsdaddy.io/img/logo.png">
2
+ <h1 align="center">NGX MASK</h1>
3
3
  </a>
4
4
 
5
+ <p align="center">
6
+ NGX MASK is the best directive to solve masking input with needed pattern
7
+ </p>
8
+
5
9
  [![CI](https://github.com/JsDaddy/ngx-mask/actions/workflows/main.yml/badge.svg?branch=develop)](https://github.com/JsDaddy/ngx-mask/actions/workflows/main.yml)
6
10
  [![npm](https://img.shields.io/npm/v/ngx-mask.svg)](https://www.npmjs.com/package/ngx-mask)
7
11
  [![npm downloads](https://img.shields.io/npm/dt/ngx-mask.svg)](https://npmjs.org/ngx-mask)
@@ -23,8 +27,90 @@ You can also try our [NGX COPYPASTE](https://www.npmjs.com/package/ngx-copypaste
23
27
  $ npm install --save ngx-mask
24
28
  ```
25
29
 
26
- ## Quickstart
30
+ ## Quickstart if ngx-mask version >= 15.0.0
31
+
32
+ Import **ngx-mask** directive, pipe and provide NgxMask providers with `provideNgxMask` function.
33
+
34
+ ### With default config options application level
35
+
36
+ ```typescript
37
+ bootstrapApplication(AppComponent, {
38
+ providers: [
39
+ (...)
40
+ provideEnvironmentNgxMask(),
41
+ (...)
42
+ ],
43
+ }).catch((err) => console.error(err));
44
+ ````
45
+
46
+ ### Passing your own mask config options
47
+
48
+ ```typescript
49
+ import { IConfig } from 'ngx-mask'
50
+
51
+ const maskConfig: Partial<IConfig> = {
52
+ validation: false,
53
+ };
54
+
55
+ bootstrapApplication(AppComponent, {
56
+ providers: [
57
+ (...)
58
+ provideEnvironmentNgxMask(maskConfig),
59
+ (...)
60
+ ],
61
+ }).catch((err) => console.error(err));
62
+ ```
63
+
64
+ ### Using a function to configure:
27
65
 
66
+ ```typescript
67
+ const maskConfigFunction: () => Partial<IConfig> = () => {
68
+ return {
69
+ validation: false,
70
+ };
71
+ };
72
+
73
+ bootstrapApplication(AppComponent, {
74
+ providers: [
75
+ (...)
76
+ provideEnvironmentNgxMask(maskConfigFunction),
77
+ (...)
78
+ ],
79
+ }).catch((err) => console.error(err));
80
+ ```
81
+
82
+ ### With config options feature level
83
+ ```typescript
84
+ @Component({
85
+ selector: 'my-feature',
86
+ templateUrl: './my-feature.component.html',
87
+ styleUrls: ['./my-feature.component.css'],
88
+ standalone: true,
89
+ imports: [NgxMaskDirective, (...)],
90
+ providers: [
91
+ (...)
92
+ provideNgxMask(),
93
+ (...)
94
+ ],
95
+ })
96
+ export class MyFeatureComponent {}
97
+ ```
98
+
99
+ Then, import directive, pipe to needed standalone component and just define masks in inputs.
100
+ ### With Angular modules
101
+
102
+ ```typescript
103
+ @NgModule({
104
+ imports: [
105
+ NgxMaskDirective, NgxMaskPipe
106
+ ],
107
+ providers: [provideNgxMask()]
108
+ })
109
+ ```
110
+
111
+ ## Quickstart if ngx-mask version < 15.0.0
112
+
113
+ For version ngx-mask < 15.0.0
28
114
  Import **ngx-mask** module in Angular app.
29
115
 
30
116
  ### With default mask config options
@@ -75,7 +161,7 @@ const maskConfigFunction: () => Partial<IConfig> = () => {
75
161
 
76
162
  Then, just define masks in inputs.
77
163
 
78
- ### Usage
164
+ ## Usage
79
165
 
80
166
  ```html
81
167
  <input type="text" mask="<here goes your mask>" />
@@ -89,21 +175,17 @@ or
89
175
 
90
176
  Also, you can use mask pipe.
91
177
 
92
- ### Usage
93
-
94
178
  ```html
95
179
  <span>{{phone | mask: '(000) 000-0000'}}</span>
96
180
  ```
97
181
 
98
182
  For separator you can add thousandSeparator
99
183
 
100
- ### Usage
101
-
102
184
  ```html
103
185
  <span>{{value | mask: 'separator':','}}</span>
104
186
  ```
105
187
 
106
- #### Examples
188
+ ### Examples
107
189
 
108
190
  | mask | example |
109
191
  | -------------- | -------------- |
package/esm2020/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- export * from './lib/ngx-mask.module';
2
- export * from './lib/mask.directive';
3
- export * from './lib/mask.pipe';
4
- export * from './lib/mask.service';
5
- export * from './lib/mask-applier.service';
6
- export * from './lib/config';
1
+ export * from './lib/ngx-mask.providers';
2
+ export * from './lib/ngx-mask.directive';
3
+ export * from './lib/ngx-mask.pipe';
4
+ export * from './lib/ngx-mask.service';
5
+ export * from './lib/ngx-mask-applier.service';
6
+ export * from './lib/ngx-mask.config';
7
7
  export * from './lib/custom-keyboard-event';
8
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9uZ3gtbWFzay1saWIvc3JjL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyxzQkFBc0IsQ0FBQztBQUNyQyxjQUFjLGlCQUFpQixDQUFDO0FBQ2hDLGNBQWMsb0JBQW9CLENBQUM7QUFDbkMsY0FBYyw0QkFBNEIsQ0FBQztBQUMzQyxjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLDZCQUE2QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9saWIvbmd4LW1hc2subW9kdWxlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL21hc2suZGlyZWN0aXZlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL21hc2sucGlwZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9tYXNrLnNlcnZpY2UnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvbWFzay1hcHBsaWVyLnNlcnZpY2UnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvY29uZmlnJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2N1c3RvbS1rZXlib2FyZC1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