ngx-dynamic-entity 1.9.0 → 1.9.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.
Files changed (2) hide show
  1. package/README.md +34 -1
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -27,6 +27,7 @@ No Angular Material required. This package has no dependency on Material or the
27
27
  - **Entity references & cascades** — consumer-registered loaders, parent→child dropdown filtering, and `autoPatch` record copying.
28
28
  - **21 field types** — each a standalone component, registered explicitly so unused types are never bundled.
29
29
  - **Fully translatable** — config text is `LocalizedText`; the library's own buttons and empty states resolve through `uiText`.
30
+ - **Configurable masking and dates** — `MASKED_PLACEHOLDER` replaces the `XXXXXXXXX` literal; `setDateFormatters` in `@dynamic-entity/core` replaces the browser-locale date punctuation.
30
31
 
31
32
  ---
32
33
 
@@ -94,6 +95,38 @@ be generated from it. See [i18n](../../EXTENDING.md#validation-messages-and-i18n
94
95
 
95
96
  ---
96
97
 
98
+ ## 🎭 Masked placeholder and dates
99
+
100
+ A masked field shows `XXXXXXXXX` unless you replace it. The real value stays in the control
101
+ either way — see [Security](#-security).
102
+
103
+ ```typescript
104
+ import { ApplicationConfig } from '@angular/core';
105
+ import { MASKED_PLACEHOLDER, provideNgxDynamicEntity } from 'ngx-dynamic-entity';
106
+
107
+ export const maskedPlaceholderConfig: ApplicationConfig = {
108
+ providers: [
109
+ provideNgxDynamicEntity({}),
110
+ { provide: MASKED_PLACEHOLDER, useValue: '••••••••' },
111
+ ],
112
+ };
113
+ ```
114
+
115
+ `date` / `datetime` / `time` still format in the browser's locale. To use the form's
116
+ `language`, or a fixed format, call `setDateFormatters` from `@dynamic-entity/core`:
117
+
118
+ ```typescript
119
+ import { setDateFormatters } from '@dynamic-entity/core';
120
+
121
+ setDateFormatters({
122
+ date: (value, lang) => value.toLocaleDateString(lang ?? []),
123
+ });
124
+ ```
125
+
126
+ A partial object overrides one kind; `setDateFormatters()` restores the defaults.
127
+
128
+ ---
129
+
97
130
  ## 💡 Usage
98
131
 
99
132
  ```html
@@ -196,7 +229,7 @@ This applies in both directions — `initialData` is read with it and `formSubmi
196
229
 
197
230
  ## 🔐 Security
198
231
 
199
- `userRoles`, `EntityPermissions`, and `maskData` affect **rendering only**. A masked field displays `XXXXXXXXX` while the real value stays in the form control and is included in the `formSubmit` payload. Enforce authorization on the server and never send a user data they may not see.
232
+ `userRoles`, `EntityPermissions`, and `maskData` affect **rendering only**. A masked field displays `XXXXXXXXX` by default (`MASKED_PLACEHOLDER` overrides the text) while the real value stays in the form control and is included in the `formSubmit` payload. Enforce authorization on the server and never send a user data they may not see.
200
233
 
201
234
  ---
202
235
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-dynamic-entity",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Angular standalone UI library for rendering dynamic entity forms.",
5
5
  "//typings": "Local workspace resolution only: ng-packagr 21 writes types/ngx-dynamic-entity.d.ts into dist/package.json. Do NOT add a 'main' field here — ng-packagr does not generate one, so it would be copied verbatim and resolve wrongly in the published package.",
6
6
  "typings": "types/ngx-dynamic-entity.d.ts",
@@ -8,7 +8,7 @@
8
8
  "@angular/common": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
9
9
  "@angular/core": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
10
10
  "@angular/forms": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
11
- "@dynamic-entity/core": "^1.9.0",
11
+ "@dynamic-entity/core": "^1.9.1",
12
12
  "rxjs": "^7.0.0"
13
13
  },
14
14
  "keywords": [