Skip to content

Commit 329d9e8

Browse files
authored
Merge pull request #1140 from udos86/development
14.0.0
2 parents d0d35ac + 6af52dd commit 329d9e8

File tree

5 files changed

+10
-31
lines changed

5 files changed

+10
-31
lines changed

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
`angular2-text-mask` has finally been replaced with `ngx-mask`
1313

1414
This means from now text masking is only available to UI components that use a built-in
15-
mask feature or *do not* already apply a custom `ControlValueAccessor` (Material)
15+
mask feature or *do not* already apply a custom `ControlValueAccessor` like Material.
1616

1717
In order to integrate `ngx-mask` properly, a `maskConfig` property has been added to `DynamicInputModel` while the type of `mask` has been
1818
narrowed to `string`.

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,17 +1195,16 @@ ngOnInit() {
11951195

11961196
## Text Masks
11971197

1198-
Whenever an `<input>` element needs to be filled in a predefined value format, text masks make a nice form enhancement to guide the user.
1198+
Whenever an `<input>` element needs to be filled in a predefined format, text masks can make a nice form enhancement.
11991199

1200-
Since Angular does not deliver an appropriate feature by default, NG Dynamic Forms integrates an external [**Text Mask directive**](https://github.com/text-mask/text-mask).
1200+
Since Angular does not deliver an appropriate feature by default, NG Dynamic Forms integrates [**ngx-mask**](https://github.com/JsDaddy/ngx-mask).
12011201

1202-
That's why most UI packages demand one additional peer dependency to be installed:
1202+
That's why some UI packages demand one additional peer dependency to be installed:
12031203
```
12041204
npm install ngx-mask --save
12051205
```
12061206

12071207
You're now capable of adding a `mask` property to any `DynamicInputModel` according to [Text Mask docs](https://github.com/text-mask/text-mask/blob/master/componentDocumentation.md#mask):
1208-
12091208
```typescript
12101209
new DynamicInputModel({
12111210
id: "maskedInput",
@@ -1214,7 +1213,7 @@ new DynamicInputModel({
12141213
})
12151214
```
12161215

1217-
You can also pass a function as the mask. The function will receive the user input at every change. The function is expected to return a mask array as described above.[Text Mask Addons](https://github.com/text-mask/text-mask/tree/master/addons/)
1216+
Furthermore, you can add additional configuration via `maskConfig` according to the ngx-mask
12181217
```typescript
12191218
new DynamicInputModel({
12201219
id: "maskedInput",
@@ -1226,8 +1225,8 @@ new DynamicInputModel({
12261225
})
12271226
```
12281227

1229-
Please note that some UI libraries like Kendo UI come with their own text mask implementation that may rely on a different text mask string / regex representation.
1230-
1228+
**Note:** Angular does not support adding multiple custom value accessors to the same input element. Thus, this feature is **not** available to libraries like Material that already do apply a custom value accessor by default.
1229+
In cases like Prime NG where a component library natively provides some text mask mechanism, NG Dynamic Forms maps the mask configuration to the built-in api.
12311230

12321231
## Autocompletion
12331232

projects/ng-dynamic-forms/ui-foundation/ng-package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"amdId": "@ng-dynamic-forms/ui-foundation",
99
"umdModuleIds": {
1010
"@ng-dynamic-forms/core": "ngDynamicForms.core",
11-
"ngx-mask": "ngx--mask"
11+
"ngx-mask": "ngx-mask"
1212
}
1313
}
1414
}

projects/ng-dynamic-forms/ui-material/ng-package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"umdId": "ngDynamicForms.ui.material",
88
"amdId": "@ng-dynamic-forms/ui-material",
99
"umdModuleIds": {
10-
"@ng-dynamic-forms/core": "ngDynamicForms.core"
10+
"@ng-dynamic-forms/core": "ngDynamicForms.core",
11+
"ngx-mask": "ngx-mask"
1112
}
1213
}
1314
}

0 commit comments

Comments
 (0)