@fuse_ui/input 0.0.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.
- package/README.md +7 -0
- package/fesm2022/fuse_ui-input.mjs +140 -0
- package/fesm2022/fuse_ui-input.mjs.map +1 -0
- package/package.json +60 -0
- package/types/fuse_ui-input.d.ts +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, model, signal, computed, forwardRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
|
|
5
|
+
class FuseInputComponent {
|
|
6
|
+
// ─── Public @Input() API ────────────────────────────────────────────────────
|
|
7
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
8
|
+
type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
9
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
10
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
11
|
+
helperText = input('', ...(ngDevMode ? [{ debugName: "helperText" }] : /* istanbul ignore next */ []));
|
|
12
|
+
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
13
|
+
hasError = input(false, ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
14
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
15
|
+
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
16
|
+
// ─── Internal signal state ──────────────────────────────────────────────────
|
|
17
|
+
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
18
|
+
isDisabled = signal(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
19
|
+
isFocused = signal(false, ...(ngDevMode ? [{ debugName: "isFocused" }] : /* istanbul ignore next */ []));
|
|
20
|
+
// ─── CVA callbacks ──────────────────────────────────────────────────────────
|
|
21
|
+
onChange = () => { };
|
|
22
|
+
onTouched = () => { };
|
|
23
|
+
// ─── Derived ────────────────────────────────────────────────────────────────
|
|
24
|
+
showError = computed(() => this.hasError() || !!this.errorMessage(), ...(ngDevMode ? [{ debugName: "showError" }] : /* istanbul ignore next */ []));
|
|
25
|
+
// ─── ControlValueAccessor ────────────────────────────────────────────────────
|
|
26
|
+
writeValue(v) {
|
|
27
|
+
this.value.set(v ?? '');
|
|
28
|
+
}
|
|
29
|
+
registerOnChange(fn) {
|
|
30
|
+
this.onChange = fn;
|
|
31
|
+
}
|
|
32
|
+
registerOnTouched(fn) {
|
|
33
|
+
this.onTouched = fn;
|
|
34
|
+
}
|
|
35
|
+
setDisabledState(disabled) {
|
|
36
|
+
this.isDisabled.set(disabled);
|
|
37
|
+
}
|
|
38
|
+
// ─── Event handlers ─────────────────────────────────────────────────────────
|
|
39
|
+
handleInput(event) {
|
|
40
|
+
const v = event.target.value;
|
|
41
|
+
this.value.set(v);
|
|
42
|
+
this.onChange(v);
|
|
43
|
+
}
|
|
44
|
+
handleFocus() {
|
|
45
|
+
this.isFocused.set(true);
|
|
46
|
+
}
|
|
47
|
+
handleBlur() {
|
|
48
|
+
this.isFocused.set(false);
|
|
49
|
+
this.onTouched();
|
|
50
|
+
}
|
|
51
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FuseInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
52
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: FuseInputComponent, isStandalone: true, selector: "fuse-input", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, helperText: { classPropertyName: "helperText", publicName: "helperText", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, hasError: { classPropertyName: "hasError", publicName: "hasError", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
53
|
+
{
|
|
54
|
+
provide: NG_VALUE_ACCESSOR,
|
|
55
|
+
useExisting: forwardRef(() => FuseInputComponent),
|
|
56
|
+
multi: true,
|
|
57
|
+
},
|
|
58
|
+
], ngImport: i0, template: "<div\n class=\"fuse-input\"\n [class.fuse-input--sm]=\"size() === 'sm'\"\n [class.fuse-input--md]=\"size() === 'md'\"\n [class.fuse-input--lg]=\"size() === 'lg'\"\n [class.fuse-input--error]=\"showError()\"\n [class.fuse-input--focused]=\"isFocused()\"\n [class.fuse-input--disabled]=\"isDisabled()\"\n [class.fuse-input--readonly]=\"readonly()\">\n\n @if (label()) {\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -->\n <label class=\"fuse-input__label\" [class.fuse-input__label--required]=\"required()\">\n {{ label() }}\n </label>\n }\n\n <div class=\"fuse-input__wrapper\">\n <span class=\"fuse-input__prefix\">\n <ng-content select=\"[fusePrefix]\"></ng-content>\n </span>\n\n <input\n class=\"fuse-input__field\"\n [type]=\"type()\"\n [placeholder]=\"placeholder()\"\n [required]=\"required()\"\n [readonly]=\"readonly()\"\n [disabled]=\"isDisabled()\"\n [value]=\"value()\"\n (input)=\"handleInput($event)\"\n (focus)=\"handleFocus()\"\n (blur)=\"handleBlur()\" />\n\n <span class=\"fuse-input__suffix\">\n <ng-content select=\"[fuseSuffix]\"></ng-content>\n </span>\n </div>\n\n @if (showError() && errorMessage()) {\n <span class=\"fuse-input__error\" role=\"alert\">\n {{ errorMessage() }}\n </span>\n }\n\n @if (helperText() && !showError()) {\n <span class=\"fuse-input__helper\">\n {{ helperText() }}\n </span>\n }\n</div>\n", styles: [":host{--fuse-input-bg: var(--fuse-color-bg-surface);--fuse-input-border: var(--fuse-color-border-default);--fuse-input-border-focus: var(--fuse-color-border-focus);--fuse-input-border-error: var(--fuse-color-border-error);--fuse-input-radius: var(--fuse-radius-md);--fuse-input-color: var(--fuse-color-text-primary);--fuse-input-placeholder: var(--fuse-color-text-disabled);--fuse-input-font-size: var(--fuse-font-size-md);--fuse-input-py: var(--fuse-spacing-2);--fuse-input-px: var(--fuse-spacing-3);display:block}:host-context(.ios){--fuse-input-radius: var(--fuse-radius-lg)}:host-context(.md){--fuse-input-radius: var(--fuse-radius-sm)}.fuse-input{display:flex;flex-direction:column;gap:var(--fuse-spacing-1)}.fuse-input__label{font-size:var(--fuse-font-size-sm);font-weight:var(--fuse-font-weight-medium);color:var(--fuse-input-color);line-height:1.25}.fuse-input__label--required:after{content:\" *\";color:var(--fuse-color-danger)}.fuse-input__wrapper{display:flex;align-items:center;background:var(--fuse-input-bg);border:1.5px solid var(--fuse-input-border);border-radius:var(--fuse-input-radius);transition:border-color .15s,box-shadow .15s;overflow:hidden}.fuse-input--focused .fuse-input__wrapper{border-color:var(--fuse-input-border-focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--fuse-color-primary) 25%,transparent)}.fuse-input--error .fuse-input__wrapper{border-color:var(--fuse-input-border-error);box-shadow:0 0 0 3px color-mix(in srgb,var(--fuse-color-danger) 25%,transparent)}.fuse-input--disabled .fuse-input__wrapper{opacity:.5;cursor:not-allowed}.fuse-input--readonly .fuse-input__wrapper{background:var(--fuse-color-bg-muted, var(--fuse-color-bg-surface))}.fuse-input__field{flex:1;min-width:0;padding:var(--fuse-input-py) var(--fuse-input-px);font-size:var(--fuse-input-font-size);color:var(--fuse-input-color);background:transparent;border:none;outline:none;font-family:inherit;line-height:1.5}.fuse-input__field::placeholder{color:var(--fuse-input-placeholder)}.fuse-input__field:disabled{cursor:not-allowed}.fuse-input__field[readonly]{cursor:default}.fuse-input__prefix,.fuse-input__suffix{display:contents}.fuse-input__prefix:not(:empty),.fuse-input__suffix:not(:empty){display:flex;align-items:center;flex-shrink:0;padding:0 var(--fuse-spacing-2);color:var(--fuse-color-text-secondary, var(--fuse-input-color))}.fuse-input--sm{--fuse-input-py: var(--fuse-spacing-1);--fuse-input-px: var(--fuse-spacing-2);--fuse-input-font-size: var(--fuse-font-size-sm)}.fuse-input--lg{--fuse-input-py: var(--fuse-spacing-3);--fuse-input-px: var(--fuse-spacing-4);--fuse-input-font-size: var(--fuse-font-size-lg)}.fuse-input__error{font-size:var(--fuse-font-size-sm);color:var(--fuse-color-danger);line-height:1.25}.fuse-input__helper{font-size:var(--fuse-font-size-sm);color:var(--fuse-color-text-secondary, var(--fuse-input-placeholder));line-height:1.25}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
59
|
+
}
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FuseInputComponent, decorators: [{
|
|
61
|
+
type: Component,
|
|
62
|
+
args: [{ selector: 'fuse-input', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
63
|
+
{
|
|
64
|
+
provide: NG_VALUE_ACCESSOR,
|
|
65
|
+
useExisting: forwardRef(() => FuseInputComponent),
|
|
66
|
+
multi: true,
|
|
67
|
+
},
|
|
68
|
+
], template: "<div\n class=\"fuse-input\"\n [class.fuse-input--sm]=\"size() === 'sm'\"\n [class.fuse-input--md]=\"size() === 'md'\"\n [class.fuse-input--lg]=\"size() === 'lg'\"\n [class.fuse-input--error]=\"showError()\"\n [class.fuse-input--focused]=\"isFocused()\"\n [class.fuse-input--disabled]=\"isDisabled()\"\n [class.fuse-input--readonly]=\"readonly()\">\n\n @if (label()) {\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -->\n <label class=\"fuse-input__label\" [class.fuse-input__label--required]=\"required()\">\n {{ label() }}\n </label>\n }\n\n <div class=\"fuse-input__wrapper\">\n <span class=\"fuse-input__prefix\">\n <ng-content select=\"[fusePrefix]\"></ng-content>\n </span>\n\n <input\n class=\"fuse-input__field\"\n [type]=\"type()\"\n [placeholder]=\"placeholder()\"\n [required]=\"required()\"\n [readonly]=\"readonly()\"\n [disabled]=\"isDisabled()\"\n [value]=\"value()\"\n (input)=\"handleInput($event)\"\n (focus)=\"handleFocus()\"\n (blur)=\"handleBlur()\" />\n\n <span class=\"fuse-input__suffix\">\n <ng-content select=\"[fuseSuffix]\"></ng-content>\n </span>\n </div>\n\n @if (showError() && errorMessage()) {\n <span class=\"fuse-input__error\" role=\"alert\">\n {{ errorMessage() }}\n </span>\n }\n\n @if (helperText() && !showError()) {\n <span class=\"fuse-input__helper\">\n {{ helperText() }}\n </span>\n }\n</div>\n", styles: [":host{--fuse-input-bg: var(--fuse-color-bg-surface);--fuse-input-border: var(--fuse-color-border-default);--fuse-input-border-focus: var(--fuse-color-border-focus);--fuse-input-border-error: var(--fuse-color-border-error);--fuse-input-radius: var(--fuse-radius-md);--fuse-input-color: var(--fuse-color-text-primary);--fuse-input-placeholder: var(--fuse-color-text-disabled);--fuse-input-font-size: var(--fuse-font-size-md);--fuse-input-py: var(--fuse-spacing-2);--fuse-input-px: var(--fuse-spacing-3);display:block}:host-context(.ios){--fuse-input-radius: var(--fuse-radius-lg)}:host-context(.md){--fuse-input-radius: var(--fuse-radius-sm)}.fuse-input{display:flex;flex-direction:column;gap:var(--fuse-spacing-1)}.fuse-input__label{font-size:var(--fuse-font-size-sm);font-weight:var(--fuse-font-weight-medium);color:var(--fuse-input-color);line-height:1.25}.fuse-input__label--required:after{content:\" *\";color:var(--fuse-color-danger)}.fuse-input__wrapper{display:flex;align-items:center;background:var(--fuse-input-bg);border:1.5px solid var(--fuse-input-border);border-radius:var(--fuse-input-radius);transition:border-color .15s,box-shadow .15s;overflow:hidden}.fuse-input--focused .fuse-input__wrapper{border-color:var(--fuse-input-border-focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--fuse-color-primary) 25%,transparent)}.fuse-input--error .fuse-input__wrapper{border-color:var(--fuse-input-border-error);box-shadow:0 0 0 3px color-mix(in srgb,var(--fuse-color-danger) 25%,transparent)}.fuse-input--disabled .fuse-input__wrapper{opacity:.5;cursor:not-allowed}.fuse-input--readonly .fuse-input__wrapper{background:var(--fuse-color-bg-muted, var(--fuse-color-bg-surface))}.fuse-input__field{flex:1;min-width:0;padding:var(--fuse-input-py) var(--fuse-input-px);font-size:var(--fuse-input-font-size);color:var(--fuse-input-color);background:transparent;border:none;outline:none;font-family:inherit;line-height:1.5}.fuse-input__field::placeholder{color:var(--fuse-input-placeholder)}.fuse-input__field:disabled{cursor:not-allowed}.fuse-input__field[readonly]{cursor:default}.fuse-input__prefix,.fuse-input__suffix{display:contents}.fuse-input__prefix:not(:empty),.fuse-input__suffix:not(:empty){display:flex;align-items:center;flex-shrink:0;padding:0 var(--fuse-spacing-2);color:var(--fuse-color-text-secondary, var(--fuse-input-color))}.fuse-input--sm{--fuse-input-py: var(--fuse-spacing-1);--fuse-input-px: var(--fuse-spacing-2);--fuse-input-font-size: var(--fuse-font-size-sm)}.fuse-input--lg{--fuse-input-py: var(--fuse-spacing-3);--fuse-input-px: var(--fuse-spacing-4);--fuse-input-font-size: var(--fuse-font-size-lg)}.fuse-input__error{font-size:var(--fuse-font-size-sm);color:var(--fuse-color-danger);line-height:1.25}.fuse-input__helper{font-size:var(--fuse-font-size-sm);color:var(--fuse-color-text-secondary, var(--fuse-input-placeholder));line-height:1.25}\n"] }]
|
|
69
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], helperText: [{ type: i0.Input, args: [{ isSignal: true, alias: "helperText", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], hasError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasError", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
70
|
+
|
|
71
|
+
class FuseTextareaComponent {
|
|
72
|
+
// ─── Public @Input() API ────────────────────────────────────────────────────
|
|
73
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
74
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
75
|
+
helperText = input('', ...(ngDevMode ? [{ debugName: "helperText" }] : /* istanbul ignore next */ []));
|
|
76
|
+
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
77
|
+
hasError = input(false, ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
78
|
+
rows = input(3, ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
79
|
+
maxLength = input(null, ...(ngDevMode ? [{ debugName: "maxLength" }] : /* istanbul ignore next */ []));
|
|
80
|
+
autoResize = input(false, ...(ngDevMode ? [{ debugName: "autoResize" }] : /* istanbul ignore next */ []));
|
|
81
|
+
// ─── Internal signal state ──────────────────────────────────────────────────
|
|
82
|
+
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
83
|
+
isDisabled = signal(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
84
|
+
// ─── CVA callbacks ──────────────────────────────────────────────────────────
|
|
85
|
+
onChange = () => { };
|
|
86
|
+
onTouched = () => { };
|
|
87
|
+
// ─── Derived ────────────────────────────────────────────────────────────────
|
|
88
|
+
showError = computed(() => this.hasError() || !!this.errorMessage(), ...(ngDevMode ? [{ debugName: "showError" }] : /* istanbul ignore next */ []));
|
|
89
|
+
// ─── ControlValueAccessor ────────────────────────────────────────────────────
|
|
90
|
+
writeValue(v) {
|
|
91
|
+
this.value.set(v ?? '');
|
|
92
|
+
}
|
|
93
|
+
registerOnChange(fn) {
|
|
94
|
+
this.onChange = fn;
|
|
95
|
+
}
|
|
96
|
+
registerOnTouched(fn) {
|
|
97
|
+
this.onTouched = fn;
|
|
98
|
+
}
|
|
99
|
+
setDisabledState(disabled) {
|
|
100
|
+
this.isDisabled.set(disabled);
|
|
101
|
+
}
|
|
102
|
+
// ─── Event handlers ─────────────────────────────────────────────────────────
|
|
103
|
+
onInput(event) {
|
|
104
|
+
const el = event.target;
|
|
105
|
+
this.value.set(el.value);
|
|
106
|
+
this.onChange(el.value);
|
|
107
|
+
if (this.autoResize()) {
|
|
108
|
+
el.style.height = 'auto';
|
|
109
|
+
el.style.height = el.scrollHeight + 'px';
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
onBlur() {
|
|
113
|
+
this.onTouched();
|
|
114
|
+
}
|
|
115
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FuseTextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
116
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: FuseTextareaComponent, isStandalone: true, selector: "fuse-textarea", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, helperText: { classPropertyName: "helperText", publicName: "helperText", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, hasError: { classPropertyName: "hasError", publicName: "hasError", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, autoResize: { classPropertyName: "autoResize", publicName: "autoResize", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
117
|
+
{
|
|
118
|
+
provide: NG_VALUE_ACCESSOR,
|
|
119
|
+
useExisting: forwardRef(() => FuseTextareaComponent),
|
|
120
|
+
multi: true,
|
|
121
|
+
},
|
|
122
|
+
], ngImport: i0, template: "<div\n class=\"fuse-textarea\"\n [class.fuse-textarea--error]=\"showError()\"\n [class.fuse-textarea--disabled]=\"isDisabled()\"\n [class.fuse-textarea--auto-resize]=\"autoResize()\">\n\n @if (label()) {\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -->\n <label class=\"fuse-textarea__label\">{{ label() }}</label>\n }\n\n <textarea\n class=\"fuse-textarea__field\"\n [rows]=\"rows()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"isDisabled()\"\n [attr.maxlength]=\"maxLength()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\">\n </textarea>\n\n @if (maxLength()) {\n <div class=\"fuse-textarea__count\">\n <span [class.fuse-textarea__count--over]=\"value().length > maxLength()!\">\n {{ value().length }}\n </span>\n / {{ maxLength() }}\n </div>\n }\n\n @if (showError() && errorMessage()) {\n <span class=\"fuse-textarea__error\" role=\"alert\">\n {{ errorMessage() }}\n </span>\n }\n\n @if (helperText() && !showError()) {\n <span class=\"fuse-textarea__helper\">\n {{ helperText() }}\n </span>\n }\n</div>\n", styles: [":host{--fuse-textarea-bg: var(--fuse-color-bg-surface);--fuse-textarea-border: var(--fuse-color-border-default);--fuse-textarea-border-focus: var(--fuse-color-border-focus);--fuse-textarea-border-error: var(--fuse-color-border-error);--fuse-textarea-radius: var(--fuse-radius-md);--fuse-textarea-color: var(--fuse-color-text-primary);--fuse-textarea-placeholder: var(--fuse-color-text-disabled);--fuse-textarea-font-size: var(--fuse-font-size-md);--fuse-textarea-py: var(--fuse-spacing-2);--fuse-textarea-px: var(--fuse-spacing-3);display:block}:host-context(.ios){--fuse-textarea-radius: var(--fuse-radius-lg)}:host-context(.md){--fuse-textarea-radius: var(--fuse-radius-sm)}.fuse-textarea{display:flex;flex-direction:column;gap:var(--fuse-spacing-1)}.fuse-textarea__label{font-size:var(--fuse-font-size-sm);font-weight:var(--fuse-font-weight-medium);color:var(--fuse-textarea-color);line-height:1.25}.fuse-textarea__field{width:100%;padding:var(--fuse-textarea-py) var(--fuse-textarea-px);font-size:var(--fuse-textarea-font-size);font-family:inherit;color:var(--fuse-textarea-color);background:var(--fuse-textarea-bg);border:1.5px solid var(--fuse-textarea-border);border-radius:var(--fuse-textarea-radius);resize:vertical;outline:none;line-height:1.5;box-sizing:border-box;transition:border-color .15s,box-shadow .15s}.fuse-textarea__field::placeholder{color:var(--fuse-textarea-placeholder)}.fuse-textarea__field:focus{border-color:var(--fuse-textarea-border-focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--fuse-color-primary) 25%,transparent)}.fuse-textarea__field:disabled{opacity:.5;cursor:not-allowed;resize:none}.fuse-textarea--error .fuse-textarea__field{border-color:var(--fuse-textarea-border-error)}.fuse-textarea--error .fuse-textarea__field:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--fuse-color-danger) 25%,transparent)}.fuse-textarea--auto-resize .fuse-textarea__field{resize:none;overflow-y:hidden}.fuse-textarea__count{font-size:var(--fuse-font-size-sm);color:var(--fuse-color-text-secondary, var(--fuse-textarea-placeholder));text-align:right;line-height:1.25}.fuse-textarea__count--over{color:var(--fuse-color-danger);font-weight:var(--fuse-font-weight-medium)}.fuse-textarea__error{font-size:var(--fuse-font-size-sm);color:var(--fuse-color-danger);line-height:1.25}.fuse-textarea__helper{font-size:var(--fuse-font-size-sm);color:var(--fuse-color-text-secondary, var(--fuse-textarea-placeholder));line-height:1.25}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
123
|
+
}
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FuseTextareaComponent, decorators: [{
|
|
125
|
+
type: Component,
|
|
126
|
+
args: [{ selector: 'fuse-textarea', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
127
|
+
{
|
|
128
|
+
provide: NG_VALUE_ACCESSOR,
|
|
129
|
+
useExisting: forwardRef(() => FuseTextareaComponent),
|
|
130
|
+
multi: true,
|
|
131
|
+
},
|
|
132
|
+
], template: "<div\n class=\"fuse-textarea\"\n [class.fuse-textarea--error]=\"showError()\"\n [class.fuse-textarea--disabled]=\"isDisabled()\"\n [class.fuse-textarea--auto-resize]=\"autoResize()\">\n\n @if (label()) {\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -->\n <label class=\"fuse-textarea__label\">{{ label() }}</label>\n }\n\n <textarea\n class=\"fuse-textarea__field\"\n [rows]=\"rows()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"isDisabled()\"\n [attr.maxlength]=\"maxLength()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\">\n </textarea>\n\n @if (maxLength()) {\n <div class=\"fuse-textarea__count\">\n <span [class.fuse-textarea__count--over]=\"value().length > maxLength()!\">\n {{ value().length }}\n </span>\n / {{ maxLength() }}\n </div>\n }\n\n @if (showError() && errorMessage()) {\n <span class=\"fuse-textarea__error\" role=\"alert\">\n {{ errorMessage() }}\n </span>\n }\n\n @if (helperText() && !showError()) {\n <span class=\"fuse-textarea__helper\">\n {{ helperText() }}\n </span>\n }\n</div>\n", styles: [":host{--fuse-textarea-bg: var(--fuse-color-bg-surface);--fuse-textarea-border: var(--fuse-color-border-default);--fuse-textarea-border-focus: var(--fuse-color-border-focus);--fuse-textarea-border-error: var(--fuse-color-border-error);--fuse-textarea-radius: var(--fuse-radius-md);--fuse-textarea-color: var(--fuse-color-text-primary);--fuse-textarea-placeholder: var(--fuse-color-text-disabled);--fuse-textarea-font-size: var(--fuse-font-size-md);--fuse-textarea-py: var(--fuse-spacing-2);--fuse-textarea-px: var(--fuse-spacing-3);display:block}:host-context(.ios){--fuse-textarea-radius: var(--fuse-radius-lg)}:host-context(.md){--fuse-textarea-radius: var(--fuse-radius-sm)}.fuse-textarea{display:flex;flex-direction:column;gap:var(--fuse-spacing-1)}.fuse-textarea__label{font-size:var(--fuse-font-size-sm);font-weight:var(--fuse-font-weight-medium);color:var(--fuse-textarea-color);line-height:1.25}.fuse-textarea__field{width:100%;padding:var(--fuse-textarea-py) var(--fuse-textarea-px);font-size:var(--fuse-textarea-font-size);font-family:inherit;color:var(--fuse-textarea-color);background:var(--fuse-textarea-bg);border:1.5px solid var(--fuse-textarea-border);border-radius:var(--fuse-textarea-radius);resize:vertical;outline:none;line-height:1.5;box-sizing:border-box;transition:border-color .15s,box-shadow .15s}.fuse-textarea__field::placeholder{color:var(--fuse-textarea-placeholder)}.fuse-textarea__field:focus{border-color:var(--fuse-textarea-border-focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--fuse-color-primary) 25%,transparent)}.fuse-textarea__field:disabled{opacity:.5;cursor:not-allowed;resize:none}.fuse-textarea--error .fuse-textarea__field{border-color:var(--fuse-textarea-border-error)}.fuse-textarea--error .fuse-textarea__field:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--fuse-color-danger) 25%,transparent)}.fuse-textarea--auto-resize .fuse-textarea__field{resize:none;overflow-y:hidden}.fuse-textarea__count{font-size:var(--fuse-font-size-sm);color:var(--fuse-color-text-secondary, var(--fuse-textarea-placeholder));text-align:right;line-height:1.25}.fuse-textarea__count--over{color:var(--fuse-color-danger);font-weight:var(--fuse-font-weight-medium)}.fuse-textarea__error{font-size:var(--fuse-font-size-sm);color:var(--fuse-color-danger);line-height:1.25}.fuse-textarea__helper{font-size:var(--fuse-font-size-sm);color:var(--fuse-color-text-secondary, var(--fuse-textarea-placeholder));line-height:1.25}\n"] }]
|
|
133
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], helperText: [{ type: i0.Input, args: [{ isSignal: true, alias: "helperText", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], hasError: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasError", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], autoResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoResize", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Generated bundle index. Do not edit.
|
|
137
|
+
*/
|
|
138
|
+
|
|
139
|
+
export { FuseInputComponent, FuseTextareaComponent };
|
|
140
|
+
//# sourceMappingURL=fuse_ui-input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fuse_ui-input.mjs","sources":["../../../../packages/input/src/lib/input/fuse-input.component.ts","../../../../packages/input/src/lib/input/fuse-input.component.html","../../../../packages/input/src/lib/textarea/fuse-textarea.component.ts","../../../../packages/input/src/lib/textarea/fuse-textarea.component.html","../../../../packages/input/src/fuse_ui-input.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n forwardRef,\n input,\n model,\n signal,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR,\n} from '@angular/forms';\n\n@Component({\n selector: 'fuse-input',\n standalone: true,\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './fuse-input.component.html',\n styleUrl: './fuse-input.component.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => FuseInputComponent),\n multi: true,\n },\n ],\n})\nexport class FuseInputComponent implements ControlValueAccessor {\n // ─── Public @Input() API ────────────────────────────────────────────────────\n\n readonly label = input('');\n readonly type = input('text');\n readonly placeholder = input('');\n readonly required = input(false);\n readonly helperText = input('');\n readonly errorMessage = input('');\n readonly hasError = input(false);\n readonly size = input<'sm' | 'md' | 'lg'>('md');\n readonly readonly = input(false);\n\n // ─── Internal signal state ──────────────────────────────────────────────────\n\n readonly value = model<string>('');\n protected readonly isDisabled = signal(false);\n protected readonly isFocused = signal(false);\n\n // ─── CVA callbacks ──────────────────────────────────────────────────────────\n\n private onChange: (v: string) => void = () => {};\n private onTouched: () => void = () => {};\n\n // ─── Derived ────────────────────────────────────────────────────────────────\n\n protected readonly showError = computed(() =>\n this.hasError() || !!this.errorMessage()\n );\n\n // ─── ControlValueAccessor ────────────────────────────────────────────────────\n\n writeValue(v: string): void {\n this.value.set(v ?? '');\n }\n\n registerOnChange(fn: (v: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(disabled: boolean): void {\n this.isDisabled.set(disabled);\n }\n\n // ─── Event handlers ─────────────────────────────────────────────────────────\n\n handleInput(event: Event): void {\n const v = (event.target as HTMLInputElement).value;\n this.value.set(v);\n this.onChange(v);\n }\n\n handleFocus(): void {\n this.isFocused.set(true);\n }\n\n handleBlur(): void {\n this.isFocused.set(false);\n this.onTouched();\n }\n}\n","<div\n class=\"fuse-input\"\n [class.fuse-input--sm]=\"size() === 'sm'\"\n [class.fuse-input--md]=\"size() === 'md'\"\n [class.fuse-input--lg]=\"size() === 'lg'\"\n [class.fuse-input--error]=\"showError()\"\n [class.fuse-input--focused]=\"isFocused()\"\n [class.fuse-input--disabled]=\"isDisabled()\"\n [class.fuse-input--readonly]=\"readonly()\">\n\n @if (label()) {\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -->\n <label class=\"fuse-input__label\" [class.fuse-input__label--required]=\"required()\">\n {{ label() }}\n </label>\n }\n\n <div class=\"fuse-input__wrapper\">\n <span class=\"fuse-input__prefix\">\n <ng-content select=\"[fusePrefix]\"></ng-content>\n </span>\n\n <input\n class=\"fuse-input__field\"\n [type]=\"type()\"\n [placeholder]=\"placeholder()\"\n [required]=\"required()\"\n [readonly]=\"readonly()\"\n [disabled]=\"isDisabled()\"\n [value]=\"value()\"\n (input)=\"handleInput($event)\"\n (focus)=\"handleFocus()\"\n (blur)=\"handleBlur()\" />\n\n <span class=\"fuse-input__suffix\">\n <ng-content select=\"[fuseSuffix]\"></ng-content>\n </span>\n </div>\n\n @if (showError() && errorMessage()) {\n <span class=\"fuse-input__error\" role=\"alert\">\n {{ errorMessage() }}\n </span>\n }\n\n @if (helperText() && !showError()) {\n <span class=\"fuse-input__helper\">\n {{ helperText() }}\n </span>\n }\n</div>\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n forwardRef,\n input,\n model,\n signal,\n} from '@angular/core';\nimport {\n ControlValueAccessor,\n NG_VALUE_ACCESSOR,\n} from '@angular/forms';\n\n@Component({\n selector: 'fuse-textarea',\n standalone: true,\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './fuse-textarea.component.html',\n styleUrl: './fuse-textarea.component.scss',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => FuseTextareaComponent),\n multi: true,\n },\n ],\n})\nexport class FuseTextareaComponent implements ControlValueAccessor {\n // ─── Public @Input() API ────────────────────────────────────────────────────\n\n readonly label = input('');\n readonly placeholder = input('');\n readonly helperText = input('');\n readonly errorMessage = input('');\n readonly hasError = input(false);\n readonly rows = input(3);\n readonly maxLength = input<number | null>(null);\n readonly autoResize = input(false);\n\n // ─── Internal signal state ──────────────────────────────────────────────────\n\n readonly value = model<string>('');\n protected readonly isDisabled = signal(false);\n\n // ─── CVA callbacks ──────────────────────────────────────────────────────────\n\n private onChange: (v: string) => void = () => {};\n private onTouched: () => void = () => {};\n\n // ─── Derived ────────────────────────────────────────────────────────────────\n\n protected readonly showError = computed(() =>\n this.hasError() || !!this.errorMessage()\n );\n\n // ─── ControlValueAccessor ────────────────────────────────────────────────────\n\n writeValue(v: string): void {\n this.value.set(v ?? '');\n }\n\n registerOnChange(fn: (v: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(disabled: boolean): void {\n this.isDisabled.set(disabled);\n }\n\n // ─── Event handlers ─────────────────────────────────────────────────────────\n\n protected onInput(event: Event): void {\n const el = event.target as HTMLTextAreaElement;\n this.value.set(el.value);\n this.onChange(el.value);\n if (this.autoResize()) {\n el.style.height = 'auto';\n el.style.height = el.scrollHeight + 'px';\n }\n }\n\n protected onBlur(): void {\n this.onTouched();\n }\n}\n","<div\n class=\"fuse-textarea\"\n [class.fuse-textarea--error]=\"showError()\"\n [class.fuse-textarea--disabled]=\"isDisabled()\"\n [class.fuse-textarea--auto-resize]=\"autoResize()\">\n\n @if (label()) {\n <!-- eslint-disable-next-line @angular-eslint/template/label-has-associated-control -->\n <label class=\"fuse-textarea__label\">{{ label() }}</label>\n }\n\n <textarea\n class=\"fuse-textarea__field\"\n [rows]=\"rows()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"isDisabled()\"\n [attr.maxlength]=\"maxLength()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\">\n </textarea>\n\n @if (maxLength()) {\n <div class=\"fuse-textarea__count\">\n <span [class.fuse-textarea__count--over]=\"value().length > maxLength()!\">\n {{ value().length }}\n </span>\n / {{ maxLength() }}\n </div>\n }\n\n @if (showError() && errorMessage()) {\n <span class=\"fuse-textarea__error\" role=\"alert\">\n {{ errorMessage() }}\n </span>\n }\n\n @if (helperText() && !showError()) {\n <span class=\"fuse-textarea__helper\">\n {{ helperText() }}\n </span>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MA6Ba,kBAAkB,CAAA;;AAGpB,IAAA,KAAK,GAAG,KAAK,CAAC,EAAE,4EAAC;AACjB,IAAA,IAAI,GAAG,KAAK,CAAC,MAAM,2EAAC;AACpB,IAAA,WAAW,GAAG,KAAK,CAAC,EAAE,kFAAC;AACvB,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,+EAAC;AACvB,IAAA,UAAU,GAAG,KAAK,CAAC,EAAE,iFAAC;AACtB,IAAA,YAAY,GAAG,KAAK,CAAC,EAAE,mFAAC;AACxB,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,+EAAC;AACvB,IAAA,IAAI,GAAG,KAAK,CAAqB,IAAI,2EAAC;AACtC,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,+EAAC;;AAIvB,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;AACf,IAAA,UAAU,GAAG,MAAM,CAAC,KAAK,iFAAC;AAC1B,IAAA,SAAS,GAAG,MAAM,CAAC,KAAK,gFAAC;;AAIpC,IAAA,QAAQ,GAAwB,MAAK,EAAE,CAAC;AACxC,IAAA,SAAS,GAAe,MAAK,EAAE,CAAC;;AAIrB,IAAA,SAAS,GAAG,QAAQ,CAAC,MACtC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,gF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+
"name": "@fuse_ui/input",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [
|
|
9
|
+
"fuse-ui",
|
|
10
|
+
"angular",
|
|
11
|
+
"ionic",
|
|
12
|
+
"ionic8",
|
|
13
|
+
"angular18",
|
|
14
|
+
"angular19",
|
|
15
|
+
"angular20",
|
|
16
|
+
"angular21",
|
|
17
|
+
"ui-components",
|
|
18
|
+
"design-system",
|
|
19
|
+
"css-variables",
|
|
20
|
+
"signals",
|
|
21
|
+
"standalone",
|
|
22
|
+
"multi-theme",
|
|
23
|
+
"dark-mode",
|
|
24
|
+
"fluid-typography",
|
|
25
|
+
"animated"
|
|
26
|
+
],
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@angular/core": ">=18.0.0",
|
|
29
|
+
"@angular/common": ">=18.0.0",
|
|
30
|
+
"rxjs": ">=7.4.0",
|
|
31
|
+
"@angular/forms": "21.1.1"
|
|
32
|
+
},
|
|
33
|
+
"peerDependenciesMeta": {
|
|
34
|
+
"@ionic/angular": {
|
|
35
|
+
"optional": true
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"sideEffects": [
|
|
39
|
+
"*.css",
|
|
40
|
+
"**/*.scss"
|
|
41
|
+
],
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=20.0.0"
|
|
44
|
+
},
|
|
45
|
+
"module": "fesm2022/fuse_ui-input.mjs",
|
|
46
|
+
"typings": "types/fuse_ui-input.d.ts",
|
|
47
|
+
"exports": {
|
|
48
|
+
"./package.json": {
|
|
49
|
+
"default": "./package.json"
|
|
50
|
+
},
|
|
51
|
+
".": {
|
|
52
|
+
"types": "./types/fuse_ui-input.d.ts",
|
|
53
|
+
"default": "./fesm2022/fuse_ui-input.mjs"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"type": "module",
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"tslib": "^2.3.0"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
+
|
|
4
|
+
declare class FuseInputComponent implements ControlValueAccessor {
|
|
5
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
6
|
+
readonly type: _angular_core.InputSignal<string>;
|
|
7
|
+
readonly placeholder: _angular_core.InputSignal<string>;
|
|
8
|
+
readonly required: _angular_core.InputSignal<boolean>;
|
|
9
|
+
readonly helperText: _angular_core.InputSignal<string>;
|
|
10
|
+
readonly errorMessage: _angular_core.InputSignal<string>;
|
|
11
|
+
readonly hasError: _angular_core.InputSignal<boolean>;
|
|
12
|
+
readonly size: _angular_core.InputSignal<"sm" | "md" | "lg">;
|
|
13
|
+
readonly readonly: _angular_core.InputSignal<boolean>;
|
|
14
|
+
readonly value: _angular_core.ModelSignal<string>;
|
|
15
|
+
protected readonly isDisabled: _angular_core.WritableSignal<boolean>;
|
|
16
|
+
protected readonly isFocused: _angular_core.WritableSignal<boolean>;
|
|
17
|
+
private onChange;
|
|
18
|
+
private onTouched;
|
|
19
|
+
protected readonly showError: _angular_core.Signal<boolean>;
|
|
20
|
+
writeValue(v: string): void;
|
|
21
|
+
registerOnChange(fn: (v: string) => void): void;
|
|
22
|
+
registerOnTouched(fn: () => void): void;
|
|
23
|
+
setDisabledState(disabled: boolean): void;
|
|
24
|
+
handleInput(event: Event): void;
|
|
25
|
+
handleFocus(): void;
|
|
26
|
+
handleBlur(): void;
|
|
27
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FuseInputComponent, never>;
|
|
28
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FuseInputComponent, "fuse-input", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "hasError": { "alias": "hasError"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, ["[fusePrefix]", "[fuseSuffix]"], true, never>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare class FuseTextareaComponent implements ControlValueAccessor {
|
|
32
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
33
|
+
readonly placeholder: _angular_core.InputSignal<string>;
|
|
34
|
+
readonly helperText: _angular_core.InputSignal<string>;
|
|
35
|
+
readonly errorMessage: _angular_core.InputSignal<string>;
|
|
36
|
+
readonly hasError: _angular_core.InputSignal<boolean>;
|
|
37
|
+
readonly rows: _angular_core.InputSignal<number>;
|
|
38
|
+
readonly maxLength: _angular_core.InputSignal<number | null>;
|
|
39
|
+
readonly autoResize: _angular_core.InputSignal<boolean>;
|
|
40
|
+
readonly value: _angular_core.ModelSignal<string>;
|
|
41
|
+
protected readonly isDisabled: _angular_core.WritableSignal<boolean>;
|
|
42
|
+
private onChange;
|
|
43
|
+
private onTouched;
|
|
44
|
+
protected readonly showError: _angular_core.Signal<boolean>;
|
|
45
|
+
writeValue(v: string): void;
|
|
46
|
+
registerOnChange(fn: (v: string) => void): void;
|
|
47
|
+
registerOnTouched(fn: () => void): void;
|
|
48
|
+
setDisabledState(disabled: boolean): void;
|
|
49
|
+
protected onInput(event: Event): void;
|
|
50
|
+
protected onBlur(): void;
|
|
51
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FuseTextareaComponent, never>;
|
|
52
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FuseTextareaComponent, "fuse-textarea", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "helperText": { "alias": "helperText"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "hasError": { "alias": "hasError"; "required": false; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "autoResize": { "alias": "autoResize"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { FuseInputComponent, FuseTextareaComponent };
|