ngx-strata 0.4.3-beta.2 → 0.4.3
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/package.json
CHANGED
|
@@ -16,13 +16,19 @@ This file contains the AI documentation for the `input-field` feature and its re
|
|
|
16
16
|
## InputField (`<st-input-field>`)
|
|
17
17
|
- **Selector**: `st-input-field`
|
|
18
18
|
- **Imports**: `StrataInputFieldComponent`
|
|
19
|
+
- **Inputs**:
|
|
20
|
+
- `[size] ('sm' | 'md' | 'lg')`: Sizing variant. Default `'md'`.
|
|
21
|
+
- `[maxLength] (number)`: Enforces max character length on the native input/textarea.
|
|
22
|
+
- `[showCharacterCounter] (boolean)`: Displays the character counter right-aligned below the input.
|
|
23
|
+
- `[characterCounterFormatter] ((current: number, max?: number) => string)`: Custom formatter function for counter text.
|
|
19
24
|
|
|
20
25
|
> **Note to AI Agents**: Prioritize using these components over raw HTML equivalents. Use modern Angular Signals (input(), input.required(), and output()) for all data/event bindings. Do not use legacy @Input() or @Output() decorators.
|
|
21
26
|
## Usage Example
|
|
22
27
|
|
|
23
28
|
```html
|
|
24
|
-
<st-input-field>
|
|
25
|
-
<
|
|
29
|
+
<st-input-field [maxLength]="50" [showCharacterCounter]="true">
|
|
30
|
+
<label for="userName">Name</label>
|
|
31
|
+
<input id="userName" type="text" stInput placeholder="Enter your name" [(ngModel)]="userName" />
|
|
26
32
|
</st-input-field>
|
|
27
33
|
```
|
|
28
34
|
|
package/types/ngx-strata.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { OnInit, OnDestroy, AfterContentInit, EnvironmentProviders, InjectionToken, Provider, PipeTransform, ElementRef, OnChanges, TemplateRef, Renderer2, AfterViewInit, SimpleChanges, Type, ViewContainerRef, QueryList, OutputEmitterRef } from '@angular/core';
|
|
2
|
+
import { OnInit, OnDestroy, AfterContentInit, EnvironmentProviders, InjectionToken, Provider, PipeTransform, ElementRef, OnChanges, TemplateRef, Renderer2, AfterViewInit, AfterContentChecked, SimpleChanges, Type, ViewContainerRef, QueryList, OutputEmitterRef } from '@angular/core';
|
|
3
3
|
import { Placement } from '@floating-ui/dom';
|
|
4
4
|
import * as _angular_platform_browser from '@angular/platform-browser';
|
|
5
5
|
import { SafeHtml, DomSanitizer } from '@angular/platform-browser';
|
|
@@ -542,18 +542,29 @@ declare class StrataNativeInputRefDirective {
|
|
|
542
542
|
}
|
|
543
543
|
|
|
544
544
|
type InputFieldSize = 'sm' | 'md' | 'lg';
|
|
545
|
-
declare class StrataInputFieldComponent implements AfterViewInit {
|
|
545
|
+
declare class StrataInputFieldComponent implements AfterViewInit, AfterContentChecked {
|
|
546
|
+
private readonly hostElement;
|
|
546
547
|
size: _angular_core.InputSignal<InputFieldSize>;
|
|
548
|
+
maxLength: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
549
|
+
showCharacterCounter: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
550
|
+
characterCounterFormatter: _angular_core.InputSignal<((current: number, max?: number) => string) | undefined>;
|
|
547
551
|
iconComponents: _angular_core.Signal<readonly StrataIconComponent[]>;
|
|
548
552
|
inputField: _angular_core.Signal<StrataNativeInputRefDirective | undefined>;
|
|
549
553
|
private pendingFocus;
|
|
554
|
+
readonly currentLength: _angular_core.WritableSignal<number>;
|
|
555
|
+
private readonly nativeMaxLength;
|
|
556
|
+
readonly effectiveMaxLength: _angular_core.Signal<number | undefined>;
|
|
557
|
+
readonly counterText: _angular_core.Signal<string>;
|
|
550
558
|
constructor();
|
|
551
559
|
ngAfterViewInit(): void;
|
|
560
|
+
ngAfterContentChecked(): void;
|
|
561
|
+
onNativeInput(): void;
|
|
552
562
|
focus(): void;
|
|
553
563
|
blur(): void;
|
|
554
|
-
get nativeInput(): HTMLInputElement | undefined;
|
|
564
|
+
get nativeInput(): HTMLInputElement | HTMLTextAreaElement | undefined;
|
|
565
|
+
private syncNativeState;
|
|
555
566
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrataInputFieldComponent, never>;
|
|
556
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrataInputFieldComponent, "st-input-field", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, ["iconComponents", "inputField"], ["label", "[prefix]", "input,textarea", "[suffix]"], true, never>;
|
|
567
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrataInputFieldComponent, "st-input-field", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "showCharacterCounter": { "alias": "showCharacterCounter"; "required": false; "isSignal": true; }; "characterCounterFormatter": { "alias": "characterCounterFormatter"; "required": false; "isSignal": true; }; }, {}, ["iconComponents", "inputField"], ["label", "[prefix]", "input,textarea", "[suffix]"], true, never>;
|
|
557
568
|
}
|
|
558
569
|
|
|
559
570
|
declare class StrataAutoResizeDirective implements AfterViewInit, OnChanges {
|