ng-hub-ui-forms 22.11.0 → 22.12.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/README.md CHANGED
@@ -183,6 +183,42 @@ Project a leading / trailing icon **inside** the field, emit a debounced term on
183
183
  - Affixes use logical CSS properties, so `start`/`end` follow the writing direction and **flip automatically under `dir="rtl"`**.
184
184
  - `(search)` fires `debounceTime` ms after typing stops (`0` = every keystroke); identical consecutive terms are skipped, and `valueChange` stays synchronous.
185
185
 
186
+ #### Password fields
187
+
188
+ `type="password"` renders a masked field with an integrated reveal toggle inside the input group (a trailing addon, not a detached button):
189
+
190
+ ```html
191
+ <hub-input
192
+ formControlName="password"
193
+ type="password"
194
+ label="Password"
195
+ autocomplete="new-password"
196
+ passwordStrength
197
+ />
198
+ ```
199
+
200
+ - `[(passwordRevealed)]` — two-way model for the reveal state; drive it externally or read it.
201
+ - `passwordToggle` (default `true`) — set to `false` to hide the integrated toggle button.
202
+ - `hideOnBlur` (default `true`) — a revealed password re-masks automatically once focus leaves the field.
203
+ - `capsLockWarning` (default `true`) — shows a hint under the field while Caps Lock is active.
204
+ - `passwordStrength` (default `false`) — opt-in 4-segment strength meter, scored by the exported `scorePasswordStrength` heuristic (length ≥ 8, mixed case, digit, symbol) unless overridden.
205
+ - `autocomplete` — native attribute for password managers, e.g. `current-password` / `new-password`.
206
+ - Readonly password fields stay masked (they no longer force `type="text"`); an explicit toggle click can still reveal them.
207
+
208
+ Labels and the strength scorer are localizable app-wide via `provideHubForms`:
209
+
210
+ ```ts
211
+ provideHubForms({
212
+ password: {
213
+ showPasswordLabel: 'Show password',
214
+ hidePasswordLabel: 'Hide password',
215
+ capsLockWarning: 'Caps Lock is on',
216
+ strengthLabels: ['Weak', 'Fair', 'Good', 'Strong'],
217
+ strengthFn: (value) => myCustomScorer(value) // optional, 0-4
218
+ }
219
+ });
220
+ ```
221
+
186
222
  ### Select
187
223
 
188
224
  ```html
@@ -66,10 +66,10 @@ class HubSignalFieldControl {
66
66
  /** Whether the field should render its invalid state (touched and holding errors). */
67
67
  isInvalid = computed(() => this.touched() && this.errors().length > 0, /* @ts-ignore */
68
68
  ...(ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []));
69
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: HubSignalFieldControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
70
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: HubSignalFieldControl, isStandalone: true, inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0 });
69
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: HubSignalFieldControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
70
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.1", type: HubSignalFieldControl, isStandalone: true, inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0 });
71
71
  }
72
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: HubSignalFieldControl, decorators: [{
72
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: HubSignalFieldControl, decorators: [{
73
73
  type: Directive
74
74
  }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }, { type: i0.Output, args: ["valueChange"] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }] } });
75
75