ngx-strata 0.4.3-beta.2 → 0.4.4
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/assets/styles/components/input-field.scss +84 -5
- package/assets/styles/components/item.scss +13 -2
- package/assets/styles/components/modal.scss +5 -3
- package/dist/strata/strata.css +1 -1
- package/fesm2022/ngx-strata.mjs +100 -8
- package/fesm2022/ngx-strata.mjs.map +1 -1
- package/package.json +1 -1
- package/skills/ngx-strata/components/input-field.md +9 -2
- package/types/ngx-strata.d.ts +18 -4
package/package.json
CHANGED
|
@@ -16,13 +16,20 @@ 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
|
+
- `[disabled] (boolean)`: Disables the input field, styling the wrapper, label, affixes, and propagating to native input/textarea.
|
|
22
|
+
- `[maxLength] (number)`: Enforces max character length on the native input/textarea.
|
|
23
|
+
- `[showCharacterCounter] (boolean)`: Displays the character counter right-aligned below the input.
|
|
24
|
+
- `[characterCounterFormatter] ((current: number, max?: number) => string)`: Custom formatter function for counter text.
|
|
19
25
|
|
|
20
26
|
> **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
27
|
## Usage Example
|
|
22
28
|
|
|
23
29
|
```html
|
|
24
|
-
<st-input-field>
|
|
25
|
-
<
|
|
30
|
+
<st-input-field [maxLength]="50" [showCharacterCounter]="true">
|
|
31
|
+
<label for="userName">Name</label>
|
|
32
|
+
<input id="userName" type="text" stInput placeholder="Enter your name" [(ngModel)]="userName" />
|
|
26
33
|
</st-input-field>
|
|
27
34
|
```
|
|
28
35
|
|
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,32 @@ 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
|
+
disabled: _angular_core.InputSignalWithTransform<boolean | undefined, unknown>;
|
|
549
|
+
maxLength: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
550
|
+
showCharacterCounter: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
551
|
+
characterCounterFormatter: _angular_core.InputSignal<((current: number, max?: number) => string) | undefined>;
|
|
547
552
|
iconComponents: _angular_core.Signal<readonly StrataIconComponent[]>;
|
|
548
553
|
inputField: _angular_core.Signal<StrataNativeInputRefDirective | undefined>;
|
|
549
554
|
private pendingFocus;
|
|
555
|
+
readonly currentLength: _angular_core.WritableSignal<number>;
|
|
556
|
+
private readonly nativeMaxLength;
|
|
557
|
+
readonly nativeDisabled: _angular_core.WritableSignal<boolean>;
|
|
558
|
+
readonly effectiveMaxLength: _angular_core.Signal<number | undefined>;
|
|
559
|
+
readonly effectiveDisabled: _angular_core.Signal<boolean>;
|
|
560
|
+
readonly counterText: _angular_core.Signal<string>;
|
|
550
561
|
constructor();
|
|
551
562
|
ngAfterViewInit(): void;
|
|
563
|
+
ngAfterContentChecked(): void;
|
|
564
|
+
onNativeInput(): void;
|
|
552
565
|
focus(): void;
|
|
553
566
|
blur(): void;
|
|
554
|
-
get nativeInput(): HTMLInputElement | undefined;
|
|
567
|
+
get nativeInput(): HTMLInputElement | HTMLTextAreaElement | undefined;
|
|
568
|
+
private syncNativeState;
|
|
555
569
|
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>;
|
|
570
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrataInputFieldComponent, "st-input-field", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "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
571
|
}
|
|
558
572
|
|
|
559
573
|
declare class StrataAutoResizeDirective implements AfterViewInit, OnChanges {
|