ngx-core-components 0.3.1 → 0.3.2
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/ai/ai-chat/ai-chat.component.d.ts +31 -0
- package/ai/ai-chat/models.d.ts +36 -0
- package/ai/index.d.ts +5 -0
- package/ai/public-api.d.ts +2 -0
- package/charts/gantt-chart/gantt-chart.component.d.ts +30 -1
- package/charts/gantt-chart/models/gantt-config.model.d.ts +2 -0
- package/fesm2022/ngx-core-components-ai.mjs +496 -0
- package/fesm2022/ngx-core-components-ai.mjs.map +1 -0
- package/fesm2022/ngx-core-components-charts.mjs +221 -7
- package/fesm2022/ngx-core-components-charts.mjs.map +1 -1
- package/fesm2022/ngx-core-components-inputs.mjs +72 -9
- package/fesm2022/ngx-core-components-inputs.mjs.map +1 -1
- package/fesm2022/ngx-core-components.mjs +1 -0
- package/fesm2022/ngx-core-components.mjs.map +1 -1
- package/inputs/numeric-textbox/numeric-textbox.component.d.ts +9 -1
- package/inputs/textbox/textbox.component.d.ts +5 -1
- package/package.json +5 -1
- package/public-api.d.ts +2 -0
|
@@ -16,15 +16,28 @@ class TextBoxComponent {
|
|
|
16
16
|
showCharCount = input(false);
|
|
17
17
|
prefixIcon = input('');
|
|
18
18
|
suffixIcon = input('');
|
|
19
|
+
passwordToggle = input(false);
|
|
19
20
|
valueChange = output();
|
|
20
21
|
focusChange = output();
|
|
21
22
|
isFocused = signal(false);
|
|
23
|
+
showPassword = signal(false);
|
|
22
24
|
_cvaValue = signal('');
|
|
23
25
|
_cvaActive = false;
|
|
24
26
|
_onChange = () => { };
|
|
25
27
|
_onTouched = () => { };
|
|
26
28
|
/** Merges reactive-form value (CVA) with template binding (input()). CVA takes precedence. */
|
|
27
29
|
_displayValue = computed(() => this._cvaActive ? this._cvaValue() : this.value());
|
|
30
|
+
_currentType = computed(() => {
|
|
31
|
+
if (this.type() === 'password' && this.showPassword()) {
|
|
32
|
+
return 'text';
|
|
33
|
+
}
|
|
34
|
+
return this.type();
|
|
35
|
+
});
|
|
36
|
+
togglePasswordVisibility() {
|
|
37
|
+
if (this.disabled())
|
|
38
|
+
return;
|
|
39
|
+
this.showPassword.update(v => !v);
|
|
40
|
+
}
|
|
28
41
|
onInput(e) {
|
|
29
42
|
const v = e.target.value;
|
|
30
43
|
this._cvaValue.set(v);
|
|
@@ -61,7 +74,7 @@ class TextBoxComponent {
|
|
|
61
74
|
// reactive-form disable/enable is handled at the FormControl level.
|
|
62
75
|
}
|
|
63
76
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TextBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
64
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: TextBoxComponent, isStandalone: true, selector: "ngx-textbox", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, showCharCount: { classPropertyName: "showCharCount", publicName: "showCharCount", isSignal: true, isRequired: false, transformFunction: null }, prefixIcon: { classPropertyName: "prefixIcon", publicName: "prefixIcon", isSignal: true, isRequired: false, transformFunction: null }, suffixIcon: { classPropertyName: "suffixIcon", publicName: "suffixIcon", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", focusChange: "focusChange" }, providers: [
|
|
77
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: TextBoxComponent, isStandalone: true, selector: "ngx-textbox", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, showCharCount: { classPropertyName: "showCharCount", publicName: "showCharCount", isSignal: true, isRequired: false, transformFunction: null }, prefixIcon: { classPropertyName: "prefixIcon", publicName: "prefixIcon", isSignal: true, isRequired: false, transformFunction: null }, suffixIcon: { classPropertyName: "suffixIcon", publicName: "suffixIcon", isSignal: true, isRequired: false, transformFunction: null }, passwordToggle: { classPropertyName: "passwordToggle", publicName: "passwordToggle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", focusChange: "focusChange" }, providers: [
|
|
65
78
|
{
|
|
66
79
|
provide: NG_VALUE_ACCESSOR,
|
|
67
80
|
useExisting: forwardRef(() => TextBoxComponent),
|
|
@@ -78,7 +91,7 @@ class TextBoxComponent {
|
|
|
78
91
|
}
|
|
79
92
|
<input
|
|
80
93
|
class="ngx-textbox-input"
|
|
81
|
-
[type]="
|
|
94
|
+
[type]="_currentType()"
|
|
82
95
|
[value]="_displayValue()"
|
|
83
96
|
[placeholder]="isFocused() || !label() ? placeholder() : ''"
|
|
84
97
|
[disabled]="disabled()"
|
|
@@ -89,6 +102,15 @@ class TextBoxComponent {
|
|
|
89
102
|
(focus)="onFocus()"
|
|
90
103
|
(blur)="onBlur()"
|
|
91
104
|
/>
|
|
105
|
+
@if (type() === 'password' && passwordToggle() && !disabled()) {
|
|
106
|
+
<button class="ngx-textbox-password-toggle" type="button" (click)="togglePasswordVisibility()" [attr.aria-label]="showPassword() ? 'Hide password' : 'Show password'">
|
|
107
|
+
@if (showPassword()) {
|
|
108
|
+
<svg viewBox="0 0 24 24" style="width: 16px; height: 16px; fill: currentColor;"><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.82l2.92 2.92C21.06 15.39 22 13.79 22 12c0-4.27-4.02-8-10-8-1.64 0-3.2.28-4.63.78l2.81 2.81c.56-.23 1.17-.36 1.82-.36zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.47 5.7c-2.76 0-5-2.24-5-5v-.06l8.06 8.06c-.92.35-1.92.56-3.06.56z"/></svg>
|
|
109
|
+
} @else {
|
|
110
|
+
<svg viewBox="0 0 24 24" style="width: 16px; height: 16px; fill: currentColor;"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>
|
|
111
|
+
}
|
|
112
|
+
</button>
|
|
113
|
+
}
|
|
92
114
|
@if (clearable() && !!_displayValue() && !disabled() && !readonly()) {
|
|
93
115
|
<button class="ngx-textbox-clear" type="button" (click)="clearValue()" aria-label="Clear">✕</button>
|
|
94
116
|
}
|
|
@@ -105,7 +127,7 @@ class TextBoxComponent {
|
|
|
105
127
|
<div class="ngx-textbox-hint">{{ hint() }}</div>
|
|
106
128
|
}
|
|
107
129
|
</div>
|
|
108
|
-
`, isInline: true, styles: [":host{display:block}.ngx-textbox{position:relative;font-family:inherit}.ngx-textbox-label{display:block;font-size:13px;color:var(--ngx-input-label, #6c757d);margin-bottom:4px;font-weight:500;transition:all .15s}.ngx-textbox-wrap{position:relative;border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 4px);background:var(--ngx-input-bg, #fff);transition:border-color .15s,box-shadow .15s}.focused .ngx-textbox-wrap{border-color:var(--ngx-input-focus, #4a90d9);box-shadow:0 0 0 2px #4a90d92e}.has-error .ngx-textbox-wrap{border-color:var(--ngx-input-error, #e74c3c)}.has-error.focused .ngx-textbox-wrap{box-shadow:0 0 0 2px #e74c3c2e}.disabled .ngx-textbox-wrap{background:var(--ngx-input-disabled-bg, #f8f9fa);cursor:not-allowed}.ngx-textbox-input{display:block;width:100%;padding:8px 12px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text, #212529);font-family:inherit}.ngx-textbox-input:disabled{cursor:not-allowed;color:#adb5bd}.ngx-textbox-error{font-size:12px;color:var(--ngx-input-error, #e74c3c);margin-top:4px}.ngx-textbox-hint{font-size:12px;color:var(--ngx-input-label, #6c757d);margin-top:4px}.ngx-textbox-affix{display:flex;align-items:center;padding:0 10px;color:#6c757d;font-size:14px;flex-shrink:0}.ngx-textbox-clear{background:none;border:none;cursor:pointer;color:#adb5bd;font-size:12px;padding:0 8px;line-height:1;display:flex;align-items:center;flex-shrink:0}.ngx-textbox-clear:hover{color:#495057}.ngx-textbox-charcount{font-size:11px;color:#adb5bd;margin-top:3px;text-align:right}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
130
|
+
`, isInline: true, styles: [":host{display:block}.ngx-textbox{position:relative;font-family:inherit}.ngx-textbox-label{display:block;font-size:13px;color:var(--ngx-input-label, #6c757d);margin-bottom:4px;font-weight:500;transition:all .15s}.ngx-textbox-wrap{position:relative;border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 4px);background:var(--ngx-input-bg, #fff);transition:border-color .15s,box-shadow .15s}.focused .ngx-textbox-wrap{border-color:var(--ngx-input-focus, #4a90d9);box-shadow:0 0 0 2px #4a90d92e}.has-error .ngx-textbox-wrap{border-color:var(--ngx-input-error, #e74c3c)}.has-error.focused .ngx-textbox-wrap{box-shadow:0 0 0 2px #e74c3c2e}.disabled .ngx-textbox-wrap{background:var(--ngx-input-disabled-bg, #f8f9fa);cursor:not-allowed}.ngx-textbox-input{display:block;width:100%;padding:8px 12px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text, #212529);font-family:inherit}.ngx-textbox-input:disabled{cursor:not-allowed;color:#adb5bd}.ngx-textbox-error{font-size:12px;color:var(--ngx-input-error, #e74c3c);margin-top:4px}.ngx-textbox-hint{font-size:12px;color:var(--ngx-input-label, #6c757d);margin-top:4px}.ngx-textbox-affix{display:flex;align-items:center;padding:0 10px;color:#6c757d;font-size:14px;flex-shrink:0}.ngx-textbox-clear{background:none;border:none;cursor:pointer;color:#adb5bd;font-size:12px;padding:0 8px;line-height:1;display:flex;align-items:center;flex-shrink:0}.ngx-textbox-clear:hover{color:#495057}.ngx-textbox-password-toggle{background:none;border:none;cursor:pointer;color:#adb5bd;font-size:14px;padding:0 8px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.ngx-textbox-password-toggle:hover{color:#495057}.ngx-textbox-charcount{font-size:11px;color:#adb5bd;margin-top:3px;text-align:right}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
109
131
|
}
|
|
110
132
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TextBoxComponent, decorators: [{
|
|
111
133
|
type: Component,
|
|
@@ -126,7 +148,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
126
148
|
}
|
|
127
149
|
<input
|
|
128
150
|
class="ngx-textbox-input"
|
|
129
|
-
[type]="
|
|
151
|
+
[type]="_currentType()"
|
|
130
152
|
[value]="_displayValue()"
|
|
131
153
|
[placeholder]="isFocused() || !label() ? placeholder() : ''"
|
|
132
154
|
[disabled]="disabled()"
|
|
@@ -137,6 +159,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
137
159
|
(focus)="onFocus()"
|
|
138
160
|
(blur)="onBlur()"
|
|
139
161
|
/>
|
|
162
|
+
@if (type() === 'password' && passwordToggle() && !disabled()) {
|
|
163
|
+
<button class="ngx-textbox-password-toggle" type="button" (click)="togglePasswordVisibility()" [attr.aria-label]="showPassword() ? 'Hide password' : 'Show password'">
|
|
164
|
+
@if (showPassword()) {
|
|
165
|
+
<svg viewBox="0 0 24 24" style="width: 16px; height: 16px; fill: currentColor;"><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.82l2.92 2.92C21.06 15.39 22 13.79 22 12c0-4.27-4.02-8-10-8-1.64 0-3.2.28-4.63.78l2.81 2.81c.56-.23 1.17-.36 1.82-.36zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.47 5.7c-2.76 0-5-2.24-5-5v-.06l8.06 8.06c-.92.35-1.92.56-3.06.56z"/></svg>
|
|
166
|
+
} @else {
|
|
167
|
+
<svg viewBox="0 0 24 24" style="width: 16px; height: 16px; fill: currentColor;"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>
|
|
168
|
+
}
|
|
169
|
+
</button>
|
|
170
|
+
}
|
|
140
171
|
@if (clearable() && !!_displayValue() && !disabled() && !readonly()) {
|
|
141
172
|
<button class="ngx-textbox-clear" type="button" (click)="clearValue()" aria-label="Clear">✕</button>
|
|
142
173
|
}
|
|
@@ -153,7 +184,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
153
184
|
<div class="ngx-textbox-hint">{{ hint() }}</div>
|
|
154
185
|
}
|
|
155
186
|
</div>
|
|
156
|
-
`, styles: [":host{display:block}.ngx-textbox{position:relative;font-family:inherit}.ngx-textbox-label{display:block;font-size:13px;color:var(--ngx-input-label, #6c757d);margin-bottom:4px;font-weight:500;transition:all .15s}.ngx-textbox-wrap{position:relative;border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 4px);background:var(--ngx-input-bg, #fff);transition:border-color .15s,box-shadow .15s}.focused .ngx-textbox-wrap{border-color:var(--ngx-input-focus, #4a90d9);box-shadow:0 0 0 2px #4a90d92e}.has-error .ngx-textbox-wrap{border-color:var(--ngx-input-error, #e74c3c)}.has-error.focused .ngx-textbox-wrap{box-shadow:0 0 0 2px #e74c3c2e}.disabled .ngx-textbox-wrap{background:var(--ngx-input-disabled-bg, #f8f9fa);cursor:not-allowed}.ngx-textbox-input{display:block;width:100%;padding:8px 12px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text, #212529);font-family:inherit}.ngx-textbox-input:disabled{cursor:not-allowed;color:#adb5bd}.ngx-textbox-error{font-size:12px;color:var(--ngx-input-error, #e74c3c);margin-top:4px}.ngx-textbox-hint{font-size:12px;color:var(--ngx-input-label, #6c757d);margin-top:4px}.ngx-textbox-affix{display:flex;align-items:center;padding:0 10px;color:#6c757d;font-size:14px;flex-shrink:0}.ngx-textbox-clear{background:none;border:none;cursor:pointer;color:#adb5bd;font-size:12px;padding:0 8px;line-height:1;display:flex;align-items:center;flex-shrink:0}.ngx-textbox-clear:hover{color:#495057}.ngx-textbox-charcount{font-size:11px;color:#adb5bd;margin-top:3px;text-align:right}\n"] }]
|
|
187
|
+
`, styles: [":host{display:block}.ngx-textbox{position:relative;font-family:inherit}.ngx-textbox-label{display:block;font-size:13px;color:var(--ngx-input-label, #6c757d);margin-bottom:4px;font-weight:500;transition:all .15s}.ngx-textbox-wrap{position:relative;border:1px solid var(--ngx-input-border, #ced4da);border-radius:var(--ngx-input-radius, 4px);background:var(--ngx-input-bg, #fff);transition:border-color .15s,box-shadow .15s}.focused .ngx-textbox-wrap{border-color:var(--ngx-input-focus, #4a90d9);box-shadow:0 0 0 2px #4a90d92e}.has-error .ngx-textbox-wrap{border-color:var(--ngx-input-error, #e74c3c)}.has-error.focused .ngx-textbox-wrap{box-shadow:0 0 0 2px #e74c3c2e}.disabled .ngx-textbox-wrap{background:var(--ngx-input-disabled-bg, #f8f9fa);cursor:not-allowed}.ngx-textbox-input{display:block;width:100%;padding:8px 12px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text, #212529);font-family:inherit}.ngx-textbox-input:disabled{cursor:not-allowed;color:#adb5bd}.ngx-textbox-error{font-size:12px;color:var(--ngx-input-error, #e74c3c);margin-top:4px}.ngx-textbox-hint{font-size:12px;color:var(--ngx-input-label, #6c757d);margin-top:4px}.ngx-textbox-affix{display:flex;align-items:center;padding:0 10px;color:#6c757d;font-size:14px;flex-shrink:0}.ngx-textbox-clear{background:none;border:none;cursor:pointer;color:#adb5bd;font-size:12px;padding:0 8px;line-height:1;display:flex;align-items:center;flex-shrink:0}.ngx-textbox-clear:hover{color:#495057}.ngx-textbox-password-toggle{background:none;border:none;cursor:pointer;color:#adb5bd;font-size:14px;padding:0 8px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.ngx-textbox-password-toggle:hover{color:#495057}.ngx-textbox-charcount{font-size:11px;color:#adb5bd;margin-top:3px;text-align:right}\n"] }]
|
|
157
188
|
}] });
|
|
158
189
|
|
|
159
190
|
class CheckboxComponent {
|
|
@@ -1626,6 +1657,8 @@ class NumericTextBoxComponent {
|
|
|
1626
1657
|
suffix = input('');
|
|
1627
1658
|
focused = signal(false);
|
|
1628
1659
|
valueChange = output();
|
|
1660
|
+
onChangeFn = () => { };
|
|
1661
|
+
onTouchedFn = () => { };
|
|
1629
1662
|
constructor() {
|
|
1630
1663
|
effect(() => {
|
|
1631
1664
|
this.currentValue.set(this.clamp(this.value()));
|
|
@@ -1642,6 +1675,10 @@ class NumericTextBoxComponent {
|
|
|
1642
1675
|
this.setValue(nextValue);
|
|
1643
1676
|
}
|
|
1644
1677
|
}
|
|
1678
|
+
onBlur() {
|
|
1679
|
+
this.focused.set(false);
|
|
1680
|
+
this.onTouchedFn();
|
|
1681
|
+
}
|
|
1645
1682
|
onKeyDown(event) {
|
|
1646
1683
|
if (this.disabled()) {
|
|
1647
1684
|
return;
|
|
@@ -1659,13 +1696,33 @@ class NumericTextBoxComponent {
|
|
|
1659
1696
|
setValue(v) {
|
|
1660
1697
|
const clamped = this.clamp(v);
|
|
1661
1698
|
this.currentValue.set(clamped);
|
|
1699
|
+
this.onChangeFn(clamped);
|
|
1662
1700
|
this.valueChange.emit(clamped);
|
|
1663
1701
|
}
|
|
1664
1702
|
clamp(value) {
|
|
1665
1703
|
return Math.max(this.min(), Math.min(this.max(), value));
|
|
1666
1704
|
}
|
|
1705
|
+
// ControlValueAccessor implementation
|
|
1706
|
+
writeValue(val) {
|
|
1707
|
+
this.currentValue.set(this.clamp(val ?? 0));
|
|
1708
|
+
}
|
|
1709
|
+
registerOnChange(fn) {
|
|
1710
|
+
this.onChangeFn = fn;
|
|
1711
|
+
}
|
|
1712
|
+
registerOnTouched(fn) {
|
|
1713
|
+
this.onTouchedFn = fn;
|
|
1714
|
+
}
|
|
1715
|
+
setDisabledState(_isDisabled) {
|
|
1716
|
+
// Handled at form control template level
|
|
1717
|
+
}
|
|
1667
1718
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: NumericTextBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1668
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: NumericTextBoxComponent, isStandalone: true, selector: "ngx-numeric-textbox", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" },
|
|
1719
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: NumericTextBoxComponent, isStandalone: true, selector: "ngx-numeric-textbox", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, providers: [
|
|
1720
|
+
{
|
|
1721
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1722
|
+
useExisting: forwardRef(() => NumericTextBoxComponent),
|
|
1723
|
+
multi: true
|
|
1724
|
+
}
|
|
1725
|
+
], ngImport: i0, template: `
|
|
1669
1726
|
<div class="ngx-numeric" [class.disabled]="disabled()">
|
|
1670
1727
|
@if (label()) { <label class="numeric-label">{{ label() }}</label> }
|
|
1671
1728
|
<div class="numeric-input-wrap" [class.focused]="focused()">
|
|
@@ -1674,7 +1731,7 @@ class NumericTextBoxComponent {
|
|
|
1674
1731
|
type="number" class="numeric-input"
|
|
1675
1732
|
[min]="min()" [max]="max()" [step]="step()"
|
|
1676
1733
|
[value]="currentValue()" [disabled]="disabled()" [placeholder]="placeholder()"
|
|
1677
|
-
(focus)="focused.set(true)" (blur)="
|
|
1734
|
+
(focus)="focused.set(true)" (blur)="onBlur()"
|
|
1678
1735
|
(keydown)="onKeyDown($event)"
|
|
1679
1736
|
(change)="onChange($event)"
|
|
1680
1737
|
/>
|
|
@@ -1689,7 +1746,13 @@ class NumericTextBoxComponent {
|
|
|
1689
1746
|
}
|
|
1690
1747
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: NumericTextBoxComponent, decorators: [{
|
|
1691
1748
|
type: Component,
|
|
1692
|
-
args: [{ selector: 'ngx-numeric-textbox', standalone: true,
|
|
1749
|
+
args: [{ selector: 'ngx-numeric-textbox', standalone: true, providers: [
|
|
1750
|
+
{
|
|
1751
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1752
|
+
useExisting: forwardRef(() => NumericTextBoxComponent),
|
|
1753
|
+
multi: true
|
|
1754
|
+
}
|
|
1755
|
+
], template: `
|
|
1693
1756
|
<div class="ngx-numeric" [class.disabled]="disabled()">
|
|
1694
1757
|
@if (label()) { <label class="numeric-label">{{ label() }}</label> }
|
|
1695
1758
|
<div class="numeric-input-wrap" [class.focused]="focused()">
|
|
@@ -1698,7 +1761,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1698
1761
|
type="number" class="numeric-input"
|
|
1699
1762
|
[min]="min()" [max]="max()" [step]="step()"
|
|
1700
1763
|
[value]="currentValue()" [disabled]="disabled()" [placeholder]="placeholder()"
|
|
1701
|
-
(focus)="focused.set(true)" (blur)="
|
|
1764
|
+
(focus)="focused.set(true)" (blur)="onBlur()"
|
|
1702
1765
|
(keydown)="onKeyDown($event)"
|
|
1703
1766
|
(change)="onChange($event)"
|
|
1704
1767
|
/>
|