ngx-core-components 0.3.17 → 0.3.19
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-audio-wave/ai-audio-wave.component.d.ts +18 -4
- package/ai/ai-chat/ai-chat.component.d.ts +35 -2
- package/ai/ai-chat/models.d.ts +6 -0
- package/ai/ai-code-editor/ai-code-editor.component.d.ts +15 -1
- package/ai/ai-rag-inspector/ai-rag-inspector.component.d.ts +22 -0
- package/ai/ai-rag-inspector/models.d.ts +15 -0
- package/ai/public-api.d.ts +2 -0
- package/buttons/button/button.component.d.ts +15 -1
- package/charts/bubble-chart/bubble-chart.component.d.ts +75 -0
- package/charts/public-api.d.ts +4 -0
- package/charts/sunburst-chart/sunburst-chart.component.d.ts +63 -0
- package/fesm2022/ngx-core-components-ai.mjs +910 -48
- package/fesm2022/ngx-core-components-ai.mjs.map +1 -1
- package/fesm2022/ngx-core-components-buttons.mjs +113 -16
- package/fesm2022/ngx-core-components-buttons.mjs.map +1 -1
- package/fesm2022/ngx-core-components-charts.mjs +940 -1
- package/fesm2022/ngx-core-components-charts.mjs.map +1 -1
- package/fesm2022/ngx-core-components-inputs.mjs +746 -213
- package/fesm2022/ngx-core-components-inputs.mjs.map +1 -1
- package/fesm2022/ngx-core-components-views.mjs +422 -2
- package/fesm2022/ngx-core-components-views.mjs.map +1 -1
- package/fesm2022/ngx-core-components.mjs +2 -2
- package/fesm2022/ngx-core-components.mjs.map +1 -1
- package/inputs/checkbox/checkbox.component.d.ts +6 -2
- package/inputs/date-range-picker/date-range-picker.component.d.ts +1 -1
- package/inputs/file-preview/file-preview.component.d.ts +1 -1
- package/inputs/numeric-textbox/numeric-textbox.component.d.ts +5 -1
- package/inputs/radio/radio-group.component.d.ts +12 -2
- package/inputs/rating/rating.component.d.ts +17 -4
- package/inputs/segmented-control/segmented-control.component.d.ts +2 -2
- package/inputs/switch/switch.component.d.ts +14 -4
- package/inputs/textarea/textarea.component.d.ts +3 -1
- package/inputs/textbox/textbox.component.d.ts +4 -1
- package/package.json +1 -1
- package/public-api.d.ts +6 -2
- package/views/calendar/calendar.component.d.ts +54 -0
- package/views/public-api.d.ts +2 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, signal, computed, forwardRef, ChangeDetectionStrategy, Component, inject, ElementRef, HostListener,
|
|
2
|
+
import { input, output, signal, computed, forwardRef, ChangeDetectionStrategy, Component, inject, ElementRef, HostListener, model, effect, ViewChild } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
5
5
|
import { CommonModule } from '@angular/common';
|
|
@@ -19,6 +19,8 @@ class TextBoxComponent {
|
|
|
19
19
|
prefixIcon = input('');
|
|
20
20
|
suffixIcon = input('');
|
|
21
21
|
passwordToggle = input(false);
|
|
22
|
+
// Enterprise status state
|
|
23
|
+
status = input('default');
|
|
22
24
|
valueChange = output();
|
|
23
25
|
focusChange = output();
|
|
24
26
|
isFocused = signal(false);
|
|
@@ -27,6 +29,12 @@ class TextBoxComponent {
|
|
|
27
29
|
_cvaActive = false;
|
|
28
30
|
_onChange = () => { };
|
|
29
31
|
_onTouched = () => { };
|
|
32
|
+
_id = 'ngx-txt-' + Math.random().toString(36).substring(2, 9);
|
|
33
|
+
_resolvedStatus = computed(() => {
|
|
34
|
+
if (this.error())
|
|
35
|
+
return 'error';
|
|
36
|
+
return this.status();
|
|
37
|
+
});
|
|
30
38
|
/** Merges reactive-form value (CVA) with template binding (input()). CVA takes precedence. */
|
|
31
39
|
_displayValue = computed(() => this._cvaActive ? this._cvaValue() : this.value());
|
|
32
40
|
_currentType = computed(() => {
|
|
@@ -76,18 +84,19 @@ class TextBoxComponent {
|
|
|
76
84
|
// reactive-form disable/enable is handled at the FormControl level.
|
|
77
85
|
}
|
|
78
86
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TextBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
79
|
-
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: [
|
|
87
|
+
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 }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", focusChange: "focusChange" }, providers: [
|
|
80
88
|
{
|
|
81
89
|
provide: NG_VALUE_ACCESSOR,
|
|
82
90
|
useExisting: forwardRef(() => TextBoxComponent),
|
|
83
91
|
multi: true,
|
|
84
92
|
},
|
|
85
93
|
], ngImport: i0, template: `
|
|
86
|
-
<div class="ngx-textbox" [class.focused]="isFocused()" [class.has-error]="
|
|
94
|
+
<div class="ngx-textbox" [class.focused]="isFocused()" [class.has-error]="_resolvedStatus() === 'error'" [class.disabled]="disabled()">
|
|
87
95
|
@if (label()) {
|
|
88
|
-
<label class="ngx-textbox-label"
|
|
96
|
+
<label class="ngx-textbox-label">{{ label() }}</label>
|
|
89
97
|
}
|
|
90
|
-
<div class="ngx-textbox-wrap">
|
|
98
|
+
<div class="ngx-textbox-wrap" [class]="'status-' + _resolvedStatus()">
|
|
99
|
+
<ng-content select="[prefix]" />
|
|
91
100
|
@if (prefixIcon()) {
|
|
92
101
|
<span class="ngx-textbox-affix ngx-textbox-prefix" aria-hidden="true">{{ prefixIcon() }}</span>
|
|
93
102
|
}
|
|
@@ -99,11 +108,27 @@ class TextBoxComponent {
|
|
|
99
108
|
[disabled]="disabled()"
|
|
100
109
|
[readOnly]="readonly()"
|
|
101
110
|
[attr.maxlength]="maxlength() > 0 ? maxlength() : null"
|
|
102
|
-
[attr.aria-invalid]="
|
|
111
|
+
[attr.aria-invalid]="_resolvedStatus() === 'error' ? 'true' : null"
|
|
103
112
|
(input)="onInput($event)"
|
|
104
113
|
(focus)="onFocus()"
|
|
105
114
|
(blur)="onBlur()"
|
|
106
115
|
/>
|
|
116
|
+
|
|
117
|
+
<!-- Status Indicator Icons -->
|
|
118
|
+
@if (_resolvedStatus() === 'success') {
|
|
119
|
+
<span class="status-icon status-icon-success" aria-hidden="true">
|
|
120
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>
|
|
121
|
+
</span>
|
|
122
|
+
} @else if (_resolvedStatus() === 'warning') {
|
|
123
|
+
<span class="status-icon status-icon-warning" aria-hidden="true">
|
|
124
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>
|
|
125
|
+
</span>
|
|
126
|
+
} @else if (_resolvedStatus() === 'error') {
|
|
127
|
+
<span class="status-icon status-icon-error" aria-hidden="true">
|
|
128
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
|
129
|
+
</span>
|
|
130
|
+
}
|
|
131
|
+
|
|
107
132
|
@if (type() === 'password' && passwordToggle() && !disabled()) {
|
|
108
133
|
<button class="ngx-textbox-password-toggle" type="button" (click)="togglePasswordVisibility()" [attr.aria-label]="showPassword() ? 'Hide password' : 'Show password'">
|
|
109
134
|
@if (showPassword()) {
|
|
@@ -119,17 +144,22 @@ class TextBoxComponent {
|
|
|
119
144
|
@if (suffixIcon()) {
|
|
120
145
|
<span class="ngx-textbox-affix ngx-textbox-suffix" aria-hidden="true">{{ suffixIcon() }}</span>
|
|
121
146
|
}
|
|
147
|
+
<ng-content select="[suffix]" />
|
|
148
|
+
</div>
|
|
149
|
+
<div class="ngx-textbox-footer">
|
|
150
|
+
@if (error()) {
|
|
151
|
+
<div class="ngx-textbox-error" [attr.id]="'err-' + _id">{{ error() }}</div>
|
|
152
|
+
} @else if (hint()) {
|
|
153
|
+
<div class="ngx-textbox-hint">{{ hint() }}</div>
|
|
154
|
+
} @else {
|
|
155
|
+
<div></div>
|
|
156
|
+
}
|
|
157
|
+
@if (maxlength() > 0 && showCharCount()) {
|
|
158
|
+
<div class="ngx-textbox-charcount">{{ _displayValue().length }} / {{ maxlength() }}</div>
|
|
159
|
+
}
|
|
122
160
|
</div>
|
|
123
|
-
@if (maxlength() > 0 && showCharCount()) {
|
|
124
|
-
<div class="ngx-textbox-charcount">{{ _displayValue().length }} / {{ maxlength() }}</div>
|
|
125
|
-
}
|
|
126
|
-
@if (error()) {
|
|
127
|
-
<div class="ngx-textbox-error">{{ error() }}</div>
|
|
128
|
-
} @else if (hint()) {
|
|
129
|
-
<div class="ngx-textbox-hint">{{ hint() }}</div>
|
|
130
|
-
}
|
|
131
161
|
</div>
|
|
132
|
-
`, isInline: true, styles: [":host{display:block}.ngx-textbox{position:relative;font-family:inherit}.ngx-textbox-label{display:
|
|
162
|
+
`, isInline: true, styles: [":host{display:block;--ngx-input-bg: #ffffff;--ngx-input-text: #0f172a;--ngx-input-border: #cbd5e1;--ngx-input-focus-border: #4f46e5;--ngx-input-focus-shadow: 0 0 0 3px rgba(79, 70, 229, .15);--ngx-input-disabled-bg: #f1f5f9;--ngx-input-label: #475569;--ngx-input-label-active: #4f46e5;--ngx-input-placeholder: #94a3b8;--ngx-input-success-border: #10b981;--ngx-input-success-shadow: 0 0 0 3px rgba(16, 185, 129, .15);--ngx-input-warning-border: #f59e0b;--ngx-input-warning-shadow: 0 0 0 3px rgba(245, 158, 11, .15);--ngx-input-error-border: #ef4444;--ngx-input-error-shadow: 0 0 0 3px rgba(239, 68, 68, .15)}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-input-bg: #0f172a;--ngx-input-text: #f8fafc;--ngx-input-border: #334155;--ngx-input-focus-border: #818cf8;--ngx-input-focus-shadow: 0 0 0 3px rgba(129, 140, 248, .25);--ngx-input-disabled-bg: #1e293b;--ngx-input-label: #94a3b8;--ngx-input-label-active: #818cf8;--ngx-input-placeholder: #475569;--ngx-input-success-border: #34d399;--ngx-input-success-shadow: 0 0 0 3px rgba(52, 211, 153, .25);--ngx-input-warning-border: #fbbf24;--ngx-input-warning-shadow: 0 0 0 3px rgba(251, 191, 36, .25);--ngx-input-error-border: #f87171;--ngx-input-error-shadow: 0 0 0 3px rgba(248, 113, 113, .25)}.ngx-textbox{position:relative;font-family:inherit}.ngx-textbox-label{display:inline-flex;align-items:center;font-size:12px;font-weight:600;color:var(--ngx-input-label);margin-bottom:6px;transition:all .2s cubic-bezier(.4,0,.2,1)}.focused .ngx-textbox-label{color:var(--ngx-input-label-active);transform:translate(2px)}.ngx-textbox-wrap{position:relative;display:flex;align-items:center;border:1px solid var(--ngx-input-border);border-radius:var(--ngx-input-radius, 8px);background:var(--ngx-input-bg);transition:all .2s cubic-bezier(.4,0,.2,1);box-shadow:0 1px 2px #0000000d}.focused .ngx-textbox-wrap{border-color:var(--ngx-input-focus-border);box-shadow:var(--ngx-input-focus-shadow),0 1px 2px #0000000d}.ngx-textbox-wrap.status-success{border-color:var(--ngx-input-success-border)}.focused .ngx-textbox-wrap.status-success{box-shadow:var(--ngx-input-success-shadow),0 1px 2px #0000000d}.ngx-textbox-wrap.status-warning{border-color:var(--ngx-input-warning-border)}.focused .ngx-textbox-wrap.status-warning{box-shadow:var(--ngx-input-warning-shadow),0 1px 2px #0000000d}.ngx-textbox-wrap.status-error{border-color:var(--ngx-input-error-border)}.focused .ngx-textbox-wrap.status-error{box-shadow:var(--ngx-input-error-shadow),0 1px 2px #0000000d}.disabled .ngx-textbox-wrap{background:var(--ngx-input-disabled-bg);cursor:not-allowed;opacity:.7;box-shadow:none}.ngx-textbox-input{flex:1;min-width:0;padding:10px 14px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text);font-family:inherit}.ngx-textbox-input::placeholder{color:var(--ngx-input-placeholder);opacity:.8}.ngx-textbox-input:disabled{cursor:not-allowed}.status-icon{display:inline-flex;align-items:center;justify-content:center;padding:0 8px;flex-shrink:0;animation:icon-scale-in .2s cubic-bezier(.175,.885,.32,1.275) forwards}.status-icon-success{color:var(--ngx-input-success-border)}.status-icon-warning{color:var(--ngx-input-warning-border)}.status-icon-error{color:var(--ngx-input-error-border)}@keyframes icon-scale-in{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}.ngx-textbox-footer{display:flex;justify-content:space-between;align-items:flex-start;margin-top:5px;font-size:12px}.ngx-textbox-error{color:var(--ngx-input-error-border);font-weight:550;animation:slide-down .2s ease-out}.ngx-textbox-hint{color:var(--ngx-input-label)}.ngx-textbox-charcount{color:var(--ngx-input-label);font-size:11px;margin-left:auto}@keyframes slide-down{0%{transform:translateY(-4px);opacity:0}to{transform:translateY(0);opacity:1}}.ngx-textbox-affix{display:flex;align-items:center;padding:0 10px;color:var(--ngx-input-label);font-size:14px;flex-shrink:0}.ngx-textbox-clear{background:none;border:none;cursor:pointer;color:var(--ngx-input-placeholder);font-size:12px;padding:0 8px;line-height:1;display:flex;align-items:center;flex-shrink:0;transition:color .15s}.ngx-textbox-clear:hover{color:var(--ngx-input-text)}.ngx-textbox-password-toggle{background:none;border:none;cursor:pointer;color:var(--ngx-input-placeholder);font-size:14px;padding:0 8px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:color .15s}.ngx-textbox-password-toggle:hover{color:var(--ngx-input-text)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
133
163
|
}
|
|
134
164
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TextBoxComponent, decorators: [{
|
|
135
165
|
type: Component,
|
|
@@ -140,11 +170,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
140
170
|
multi: true,
|
|
141
171
|
},
|
|
142
172
|
], template: `
|
|
143
|
-
<div class="ngx-textbox" [class.focused]="isFocused()" [class.has-error]="
|
|
173
|
+
<div class="ngx-textbox" [class.focused]="isFocused()" [class.has-error]="_resolvedStatus() === 'error'" [class.disabled]="disabled()">
|
|
144
174
|
@if (label()) {
|
|
145
|
-
<label class="ngx-textbox-label"
|
|
175
|
+
<label class="ngx-textbox-label">{{ label() }}</label>
|
|
146
176
|
}
|
|
147
|
-
<div class="ngx-textbox-wrap">
|
|
177
|
+
<div class="ngx-textbox-wrap" [class]="'status-' + _resolvedStatus()">
|
|
178
|
+
<ng-content select="[prefix]" />
|
|
148
179
|
@if (prefixIcon()) {
|
|
149
180
|
<span class="ngx-textbox-affix ngx-textbox-prefix" aria-hidden="true">{{ prefixIcon() }}</span>
|
|
150
181
|
}
|
|
@@ -156,11 +187,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
156
187
|
[disabled]="disabled()"
|
|
157
188
|
[readOnly]="readonly()"
|
|
158
189
|
[attr.maxlength]="maxlength() > 0 ? maxlength() : null"
|
|
159
|
-
[attr.aria-invalid]="
|
|
190
|
+
[attr.aria-invalid]="_resolvedStatus() === 'error' ? 'true' : null"
|
|
160
191
|
(input)="onInput($event)"
|
|
161
192
|
(focus)="onFocus()"
|
|
162
193
|
(blur)="onBlur()"
|
|
163
194
|
/>
|
|
195
|
+
|
|
196
|
+
<!-- Status Indicator Icons -->
|
|
197
|
+
@if (_resolvedStatus() === 'success') {
|
|
198
|
+
<span class="status-icon status-icon-success" aria-hidden="true">
|
|
199
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>
|
|
200
|
+
</span>
|
|
201
|
+
} @else if (_resolvedStatus() === 'warning') {
|
|
202
|
+
<span class="status-icon status-icon-warning" aria-hidden="true">
|
|
203
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>
|
|
204
|
+
</span>
|
|
205
|
+
} @else if (_resolvedStatus() === 'error') {
|
|
206
|
+
<span class="status-icon status-icon-error" aria-hidden="true">
|
|
207
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
|
208
|
+
</span>
|
|
209
|
+
}
|
|
210
|
+
|
|
164
211
|
@if (type() === 'password' && passwordToggle() && !disabled()) {
|
|
165
212
|
<button class="ngx-textbox-password-toggle" type="button" (click)="togglePasswordVisibility()" [attr.aria-label]="showPassword() ? 'Hide password' : 'Show password'">
|
|
166
213
|
@if (showPassword()) {
|
|
@@ -176,17 +223,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
176
223
|
@if (suffixIcon()) {
|
|
177
224
|
<span class="ngx-textbox-affix ngx-textbox-suffix" aria-hidden="true">{{ suffixIcon() }}</span>
|
|
178
225
|
}
|
|
226
|
+
<ng-content select="[suffix]" />
|
|
227
|
+
</div>
|
|
228
|
+
<div class="ngx-textbox-footer">
|
|
229
|
+
@if (error()) {
|
|
230
|
+
<div class="ngx-textbox-error" [attr.id]="'err-' + _id">{{ error() }}</div>
|
|
231
|
+
} @else if (hint()) {
|
|
232
|
+
<div class="ngx-textbox-hint">{{ hint() }}</div>
|
|
233
|
+
} @else {
|
|
234
|
+
<div></div>
|
|
235
|
+
}
|
|
236
|
+
@if (maxlength() > 0 && showCharCount()) {
|
|
237
|
+
<div class="ngx-textbox-charcount">{{ _displayValue().length }} / {{ maxlength() }}</div>
|
|
238
|
+
}
|
|
179
239
|
</div>
|
|
180
|
-
@if (maxlength() > 0 && showCharCount()) {
|
|
181
|
-
<div class="ngx-textbox-charcount">{{ _displayValue().length }} / {{ maxlength() }}</div>
|
|
182
|
-
}
|
|
183
|
-
@if (error()) {
|
|
184
|
-
<div class="ngx-textbox-error">{{ error() }}</div>
|
|
185
|
-
} @else if (hint()) {
|
|
186
|
-
<div class="ngx-textbox-hint">{{ hint() }}</div>
|
|
187
|
-
}
|
|
188
240
|
</div>
|
|
189
|
-
`, styles: [":host{display:block}.ngx-textbox{position:relative;font-family:inherit}.ngx-textbox-label{display:
|
|
241
|
+
`, styles: [":host{display:block;--ngx-input-bg: #ffffff;--ngx-input-text: #0f172a;--ngx-input-border: #cbd5e1;--ngx-input-focus-border: #4f46e5;--ngx-input-focus-shadow: 0 0 0 3px rgba(79, 70, 229, .15);--ngx-input-disabled-bg: #f1f5f9;--ngx-input-label: #475569;--ngx-input-label-active: #4f46e5;--ngx-input-placeholder: #94a3b8;--ngx-input-success-border: #10b981;--ngx-input-success-shadow: 0 0 0 3px rgba(16, 185, 129, .15);--ngx-input-warning-border: #f59e0b;--ngx-input-warning-shadow: 0 0 0 3px rgba(245, 158, 11, .15);--ngx-input-error-border: #ef4444;--ngx-input-error-shadow: 0 0 0 3px rgba(239, 68, 68, .15)}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-input-bg: #0f172a;--ngx-input-text: #f8fafc;--ngx-input-border: #334155;--ngx-input-focus-border: #818cf8;--ngx-input-focus-shadow: 0 0 0 3px rgba(129, 140, 248, .25);--ngx-input-disabled-bg: #1e293b;--ngx-input-label: #94a3b8;--ngx-input-label-active: #818cf8;--ngx-input-placeholder: #475569;--ngx-input-success-border: #34d399;--ngx-input-success-shadow: 0 0 0 3px rgba(52, 211, 153, .25);--ngx-input-warning-border: #fbbf24;--ngx-input-warning-shadow: 0 0 0 3px rgba(251, 191, 36, .25);--ngx-input-error-border: #f87171;--ngx-input-error-shadow: 0 0 0 3px rgba(248, 113, 113, .25)}.ngx-textbox{position:relative;font-family:inherit}.ngx-textbox-label{display:inline-flex;align-items:center;font-size:12px;font-weight:600;color:var(--ngx-input-label);margin-bottom:6px;transition:all .2s cubic-bezier(.4,0,.2,1)}.focused .ngx-textbox-label{color:var(--ngx-input-label-active);transform:translate(2px)}.ngx-textbox-wrap{position:relative;display:flex;align-items:center;border:1px solid var(--ngx-input-border);border-radius:var(--ngx-input-radius, 8px);background:var(--ngx-input-bg);transition:all .2s cubic-bezier(.4,0,.2,1);box-shadow:0 1px 2px #0000000d}.focused .ngx-textbox-wrap{border-color:var(--ngx-input-focus-border);box-shadow:var(--ngx-input-focus-shadow),0 1px 2px #0000000d}.ngx-textbox-wrap.status-success{border-color:var(--ngx-input-success-border)}.focused .ngx-textbox-wrap.status-success{box-shadow:var(--ngx-input-success-shadow),0 1px 2px #0000000d}.ngx-textbox-wrap.status-warning{border-color:var(--ngx-input-warning-border)}.focused .ngx-textbox-wrap.status-warning{box-shadow:var(--ngx-input-warning-shadow),0 1px 2px #0000000d}.ngx-textbox-wrap.status-error{border-color:var(--ngx-input-error-border)}.focused .ngx-textbox-wrap.status-error{box-shadow:var(--ngx-input-error-shadow),0 1px 2px #0000000d}.disabled .ngx-textbox-wrap{background:var(--ngx-input-disabled-bg);cursor:not-allowed;opacity:.7;box-shadow:none}.ngx-textbox-input{flex:1;min-width:0;padding:10px 14px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text);font-family:inherit}.ngx-textbox-input::placeholder{color:var(--ngx-input-placeholder);opacity:.8}.ngx-textbox-input:disabled{cursor:not-allowed}.status-icon{display:inline-flex;align-items:center;justify-content:center;padding:0 8px;flex-shrink:0;animation:icon-scale-in .2s cubic-bezier(.175,.885,.32,1.275) forwards}.status-icon-success{color:var(--ngx-input-success-border)}.status-icon-warning{color:var(--ngx-input-warning-border)}.status-icon-error{color:var(--ngx-input-error-border)}@keyframes icon-scale-in{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}.ngx-textbox-footer{display:flex;justify-content:space-between;align-items:flex-start;margin-top:5px;font-size:12px}.ngx-textbox-error{color:var(--ngx-input-error-border);font-weight:550;animation:slide-down .2s ease-out}.ngx-textbox-hint{color:var(--ngx-input-label)}.ngx-textbox-charcount{color:var(--ngx-input-label);font-size:11px;margin-left:auto}@keyframes slide-down{0%{transform:translateY(-4px);opacity:0}to{transform:translateY(0);opacity:1}}.ngx-textbox-affix{display:flex;align-items:center;padding:0 10px;color:var(--ngx-input-label);font-size:14px;flex-shrink:0}.ngx-textbox-clear{background:none;border:none;cursor:pointer;color:var(--ngx-input-placeholder);font-size:12px;padding:0 8px;line-height:1;display:flex;align-items:center;flex-shrink:0;transition:color .15s}.ngx-textbox-clear:hover{color:var(--ngx-input-text)}.ngx-textbox-password-toggle{background:none;border:none;cursor:pointer;color:var(--ngx-input-placeholder);font-size:14px;padding:0 8px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:color .15s}.ngx-textbox-password-toggle:hover{color:var(--ngx-input-text)}\n"] }]
|
|
190
242
|
}] });
|
|
191
243
|
|
|
192
244
|
class CheckboxComponent {
|
|
@@ -194,12 +246,21 @@ class CheckboxComponent {
|
|
|
194
246
|
checked = input(false);
|
|
195
247
|
disabled = input(false);
|
|
196
248
|
indeterminate = input(false);
|
|
249
|
+
// Enterprise validation signals
|
|
250
|
+
status = input('default');
|
|
251
|
+
error = input('');
|
|
252
|
+
hint = input('');
|
|
197
253
|
checkedChange = output();
|
|
198
254
|
_checked = signal(false);
|
|
199
255
|
_cvaActive = false;
|
|
200
256
|
_onChange = () => { };
|
|
201
257
|
_onTouched = () => { };
|
|
202
258
|
_displayChecked = computed(() => this._cvaActive ? this._checked() : this.checked());
|
|
259
|
+
_resolvedStatus = computed(() => {
|
|
260
|
+
if (this.error())
|
|
261
|
+
return 'error';
|
|
262
|
+
return this.status();
|
|
263
|
+
});
|
|
203
264
|
toggle() {
|
|
204
265
|
if (this.disabled())
|
|
205
266
|
return;
|
|
@@ -220,32 +281,51 @@ class CheckboxComponent {
|
|
|
220
281
|
registerOnTouched(fn) {
|
|
221
282
|
this._onTouched = fn;
|
|
222
283
|
}
|
|
223
|
-
setDisabledState(
|
|
224
|
-
//
|
|
284
|
+
setDisabledState(isDisabled) {
|
|
285
|
+
// Handled at form control template level
|
|
225
286
|
}
|
|
226
287
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
227
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: CheckboxComponent, isStandalone: true, selector: "ngx-checkbox", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, providers: [
|
|
288
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: CheckboxComponent, isStandalone: true, selector: "ngx-checkbox", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", 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 } }, outputs: { checkedChange: "checkedChange" }, providers: [
|
|
228
289
|
{
|
|
229
290
|
provide: NG_VALUE_ACCESSOR,
|
|
230
291
|
useExisting: forwardRef(() => CheckboxComponent),
|
|
231
292
|
multi: true,
|
|
232
293
|
},
|
|
233
294
|
], ngImport: i0, template: `
|
|
234
|
-
<
|
|
235
|
-
<
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
295
|
+
<div class="ngx-checkbox-container" [class.has-error]="_resolvedStatus() === 'error'" [class.disabled]="disabled()" [class.status-success]="_resolvedStatus() === 'success'" [class.status-warning]="_resolvedStatus() === 'warning'">
|
|
296
|
+
<div class="ngx-checkbox-row">
|
|
297
|
+
<span
|
|
298
|
+
class="ngx-checkbox-box"
|
|
299
|
+
[class.checked]="_displayChecked()"
|
|
300
|
+
[class.indeterminate]="indeterminate()"
|
|
301
|
+
(click)="toggle()"
|
|
302
|
+
(keydown.space)="$event.preventDefault(); toggle()"
|
|
303
|
+
(keydown.enter)="$event.preventDefault(); toggle()"
|
|
304
|
+
role="checkbox"
|
|
305
|
+
[attr.aria-checked]="indeterminate() ? 'mixed' : _displayChecked()"
|
|
306
|
+
[attr.aria-disabled]="disabled()"
|
|
307
|
+
[attr.tabindex]="disabled() ? null : '0'"
|
|
308
|
+
>
|
|
309
|
+
@if (_displayChecked() && !indeterminate()) {
|
|
310
|
+
<svg class="ngx-checkbox-icon" viewBox="0 0 12 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
311
|
+
<path d="M1 5L4.5 8.5L11 1" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
312
|
+
</svg>
|
|
313
|
+
} @else if (indeterminate()) {
|
|
314
|
+
<span class="ngx-checkbox-dash"></span>
|
|
315
|
+
}
|
|
316
|
+
</span>
|
|
317
|
+
@if (label()) {
|
|
318
|
+
<span class="ngx-checkbox-label" (click)="toggle()">{{ label() }}</span>
|
|
242
319
|
}
|
|
243
|
-
</
|
|
244
|
-
|
|
245
|
-
|
|
320
|
+
</div>
|
|
321
|
+
|
|
322
|
+
@if (error()) {
|
|
323
|
+
<div class="ngx-checkbox-error">{{ error() }}</div>
|
|
324
|
+
} @else if (hint()) {
|
|
325
|
+
<div class="ngx-checkbox-hint">{{ hint() }}</div>
|
|
246
326
|
}
|
|
247
|
-
</
|
|
248
|
-
`, isInline: true, styles: [":host{display:inline-block}.ngx-checkbox
|
|
327
|
+
</div>
|
|
328
|
+
`, isInline: true, styles: [":host{display:inline-block;--ngx-input-success-border: #10b981;--ngx-input-success-shadow: 0 0 0 3px rgba(16, 185, 129, .2);--ngx-input-warning-border: #f59e0b;--ngx-input-warning-shadow: 0 0 0 3px rgba(245, 158, 11, .2);--ngx-input-error-border: #ef4444;--ngx-input-error-shadow: 0 0 0 3px rgba(239, 68, 68, .2);--ngx-checkbox-border: #cbd5e1;--ngx-checkbox-bg: #ffffff;--ngx-checkbox-active: #4f46e5;--ngx-checkbox-radius: 6px;--ngx-checkbox-text: #0f172a}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-checkbox-border: #475569;--ngx-checkbox-bg: #0f172a;--ngx-checkbox-active: #818cf8;--ngx-checkbox-text: #f8fafc;--ngx-input-success-border: #34d399;--ngx-input-success-shadow: 0 0 0 3px rgba(52, 211, 153, .3);--ngx-input-warning-border: #fbbf24;--ngx-input-warning-shadow: 0 0 0 3px rgba(251, 191, 36, .3);--ngx-input-error-border: #f87171;--ngx-input-error-shadow: 0 0 0 3px rgba(248, 113, 113, .3)}.ngx-checkbox-container{display:flex;flex-direction:column;gap:4px;font-family:inherit}.ngx-checkbox-row{display:inline-flex;align-items:center;gap:10px}.ngx-checkbox-box{width:20px;height:20px;flex-shrink:0;border:2px solid var(--ngx-checkbox-border);border-radius:var(--ngx-checkbox-radius);background:var(--ngx-checkbox-bg);display:flex;align-items:center;justify-content:center;transition:all .2s cubic-bezier(.4,0,.2,1);cursor:pointer;outline:none}.disabled .ngx-checkbox-box{cursor:not-allowed;opacity:.55;background:#f1f5f9;border-color:#cbd5e1}:host-context(.dark) .disabled .ngx-checkbox-box,:host-context(.dark-theme) .disabled .ngx-checkbox-box{background:#1e293b;border-color:#334155}.ngx-checkbox-box.checked,.ngx-checkbox-box.indeterminate{background:var(--ngx-checkbox-active);border-color:var(--ngx-checkbox-active);color:#fff}.ngx-checkbox-box:hover:not(.disabled){border-color:var(--ngx-checkbox-active);transform:scale(1.05)}.ngx-checkbox-box:focus-visible{border-color:var(--ngx-checkbox-active);box-shadow:0 0 0 3px #4f46e540}.status-success .ngx-checkbox-box{border-color:var(--ngx-input-success-border)}.status-success .ngx-checkbox-box.checked{background:var(--ngx-input-success-border)}.status-success .ngx-checkbox-box:focus-visible{box-shadow:var(--ngx-input-success-shadow)}.status-warning .ngx-checkbox-box{border-color:var(--ngx-input-warning-border)}.status-warning .ngx-checkbox-box.checked{background:var(--ngx-input-warning-border)}.status-warning .ngx-checkbox-box:focus-visible{box-shadow:var(--ngx-input-warning-shadow)}.has-error .ngx-checkbox-box{border-color:var(--ngx-input-error-border)}.has-error .ngx-checkbox-box.checked{background:var(--ngx-input-error-border)}.has-error .ngx-checkbox-box:focus-visible{box-shadow:var(--ngx-input-error-shadow)}.ngx-checkbox-icon{width:12px;height:10px;animation:checkmark-draw .18s cubic-bezier(.12,.4,.29,1.46) forwards}.ngx-checkbox-dash{width:10px;height:2px;background:#fff;border-radius:1px;animation:dash-draw .15s ease-out forwards}.ngx-checkbox-label{font-size:14px;color:var(--ngx-checkbox-text);cursor:pointer;-webkit-user-select:none;user-select:none;transition:color .15s ease}.disabled .ngx-checkbox-label{cursor:not-allowed;opacity:.55}.ngx-checkbox-error{color:var(--ngx-input-error-border);font-size:12px;font-weight:550;margin-left:30px;animation:slide-down .2s ease-out}.ngx-checkbox-hint{color:#64748b;font-size:12px;margin-left:30px}@keyframes checkmark-draw{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@keyframes dash-draw{0%{transform:scaleX(.5);opacity:0}to{transform:scaleX(1);opacity:1}}@keyframes slide-down{0%{transform:translateY(-4px);opacity:0}to{transform:translateY(0);opacity:1}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
249
329
|
}
|
|
250
330
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
251
331
|
type: Component,
|
|
@@ -256,35 +336,67 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
256
336
|
multi: true,
|
|
257
337
|
},
|
|
258
338
|
], template: `
|
|
259
|
-
<
|
|
260
|
-
<
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
339
|
+
<div class="ngx-checkbox-container" [class.has-error]="_resolvedStatus() === 'error'" [class.disabled]="disabled()" [class.status-success]="_resolvedStatus() === 'success'" [class.status-warning]="_resolvedStatus() === 'warning'">
|
|
340
|
+
<div class="ngx-checkbox-row">
|
|
341
|
+
<span
|
|
342
|
+
class="ngx-checkbox-box"
|
|
343
|
+
[class.checked]="_displayChecked()"
|
|
344
|
+
[class.indeterminate]="indeterminate()"
|
|
345
|
+
(click)="toggle()"
|
|
346
|
+
(keydown.space)="$event.preventDefault(); toggle()"
|
|
347
|
+
(keydown.enter)="$event.preventDefault(); toggle()"
|
|
348
|
+
role="checkbox"
|
|
349
|
+
[attr.aria-checked]="indeterminate() ? 'mixed' : _displayChecked()"
|
|
350
|
+
[attr.aria-disabled]="disabled()"
|
|
351
|
+
[attr.tabindex]="disabled() ? null : '0'"
|
|
352
|
+
>
|
|
353
|
+
@if (_displayChecked() && !indeterminate()) {
|
|
354
|
+
<svg class="ngx-checkbox-icon" viewBox="0 0 12 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
355
|
+
<path d="M1 5L4.5 8.5L11 1" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
356
|
+
</svg>
|
|
357
|
+
} @else if (indeterminate()) {
|
|
358
|
+
<span class="ngx-checkbox-dash"></span>
|
|
359
|
+
}
|
|
360
|
+
</span>
|
|
361
|
+
@if (label()) {
|
|
362
|
+
<span class="ngx-checkbox-label" (click)="toggle()">{{ label() }}</span>
|
|
267
363
|
}
|
|
268
|
-
</
|
|
269
|
-
|
|
270
|
-
|
|
364
|
+
</div>
|
|
365
|
+
|
|
366
|
+
@if (error()) {
|
|
367
|
+
<div class="ngx-checkbox-error">{{ error() }}</div>
|
|
368
|
+
} @else if (hint()) {
|
|
369
|
+
<div class="ngx-checkbox-hint">{{ hint() }}</div>
|
|
271
370
|
}
|
|
272
|
-
</
|
|
273
|
-
`, styles: [":host{display:inline-block}.ngx-checkbox
|
|
371
|
+
</div>
|
|
372
|
+
`, styles: [":host{display:inline-block;--ngx-input-success-border: #10b981;--ngx-input-success-shadow: 0 0 0 3px rgba(16, 185, 129, .2);--ngx-input-warning-border: #f59e0b;--ngx-input-warning-shadow: 0 0 0 3px rgba(245, 158, 11, .2);--ngx-input-error-border: #ef4444;--ngx-input-error-shadow: 0 0 0 3px rgba(239, 68, 68, .2);--ngx-checkbox-border: #cbd5e1;--ngx-checkbox-bg: #ffffff;--ngx-checkbox-active: #4f46e5;--ngx-checkbox-radius: 6px;--ngx-checkbox-text: #0f172a}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-checkbox-border: #475569;--ngx-checkbox-bg: #0f172a;--ngx-checkbox-active: #818cf8;--ngx-checkbox-text: #f8fafc;--ngx-input-success-border: #34d399;--ngx-input-success-shadow: 0 0 0 3px rgba(52, 211, 153, .3);--ngx-input-warning-border: #fbbf24;--ngx-input-warning-shadow: 0 0 0 3px rgba(251, 191, 36, .3);--ngx-input-error-border: #f87171;--ngx-input-error-shadow: 0 0 0 3px rgba(248, 113, 113, .3)}.ngx-checkbox-container{display:flex;flex-direction:column;gap:4px;font-family:inherit}.ngx-checkbox-row{display:inline-flex;align-items:center;gap:10px}.ngx-checkbox-box{width:20px;height:20px;flex-shrink:0;border:2px solid var(--ngx-checkbox-border);border-radius:var(--ngx-checkbox-radius);background:var(--ngx-checkbox-bg);display:flex;align-items:center;justify-content:center;transition:all .2s cubic-bezier(.4,0,.2,1);cursor:pointer;outline:none}.disabled .ngx-checkbox-box{cursor:not-allowed;opacity:.55;background:#f1f5f9;border-color:#cbd5e1}:host-context(.dark) .disabled .ngx-checkbox-box,:host-context(.dark-theme) .disabled .ngx-checkbox-box{background:#1e293b;border-color:#334155}.ngx-checkbox-box.checked,.ngx-checkbox-box.indeterminate{background:var(--ngx-checkbox-active);border-color:var(--ngx-checkbox-active);color:#fff}.ngx-checkbox-box:hover:not(.disabled){border-color:var(--ngx-checkbox-active);transform:scale(1.05)}.ngx-checkbox-box:focus-visible{border-color:var(--ngx-checkbox-active);box-shadow:0 0 0 3px #4f46e540}.status-success .ngx-checkbox-box{border-color:var(--ngx-input-success-border)}.status-success .ngx-checkbox-box.checked{background:var(--ngx-input-success-border)}.status-success .ngx-checkbox-box:focus-visible{box-shadow:var(--ngx-input-success-shadow)}.status-warning .ngx-checkbox-box{border-color:var(--ngx-input-warning-border)}.status-warning .ngx-checkbox-box.checked{background:var(--ngx-input-warning-border)}.status-warning .ngx-checkbox-box:focus-visible{box-shadow:var(--ngx-input-warning-shadow)}.has-error .ngx-checkbox-box{border-color:var(--ngx-input-error-border)}.has-error .ngx-checkbox-box.checked{background:var(--ngx-input-error-border)}.has-error .ngx-checkbox-box:focus-visible{box-shadow:var(--ngx-input-error-shadow)}.ngx-checkbox-icon{width:12px;height:10px;animation:checkmark-draw .18s cubic-bezier(.12,.4,.29,1.46) forwards}.ngx-checkbox-dash{width:10px;height:2px;background:#fff;border-radius:1px;animation:dash-draw .15s ease-out forwards}.ngx-checkbox-label{font-size:14px;color:var(--ngx-checkbox-text);cursor:pointer;-webkit-user-select:none;user-select:none;transition:color .15s ease}.disabled .ngx-checkbox-label{cursor:not-allowed;opacity:.55}.ngx-checkbox-error{color:var(--ngx-input-error-border);font-size:12px;font-weight:550;margin-left:30px;animation:slide-down .2s ease-out}.ngx-checkbox-hint{color:#64748b;font-size:12px;margin-left:30px}@keyframes checkmark-draw{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@keyframes dash-draw{0%{transform:scaleX(.5);opacity:0}to{transform:scaleX(1);opacity:1}}@keyframes slide-down{0%{transform:translateY(-4px);opacity:0}to{transform:translateY(0);opacity:1}}\n"] }]
|
|
274
373
|
}] });
|
|
275
374
|
|
|
276
375
|
class RadioGroupComponent {
|
|
376
|
+
el;
|
|
277
377
|
options = input([]);
|
|
278
378
|
label = input('');
|
|
279
379
|
value = input(null);
|
|
280
380
|
disabled = input(false);
|
|
281
381
|
inline = input(false);
|
|
382
|
+
// Enterprise validation signals
|
|
383
|
+
status = input('default');
|
|
384
|
+
error = input('');
|
|
385
|
+
hint = input('');
|
|
282
386
|
valueChange = output();
|
|
283
387
|
_value = signal(null);
|
|
284
388
|
_cvaActive = false;
|
|
285
389
|
_onChange = () => { };
|
|
286
390
|
_onTouched = () => { };
|
|
287
391
|
_activeValue = computed(() => this._cvaActive ? this._value() : this.value());
|
|
392
|
+
_resolvedStatus = computed(() => {
|
|
393
|
+
if (this.error())
|
|
394
|
+
return 'error';
|
|
395
|
+
return this.status();
|
|
396
|
+
});
|
|
397
|
+
constructor(el) {
|
|
398
|
+
this.el = el;
|
|
399
|
+
}
|
|
288
400
|
isChecked(val) {
|
|
289
401
|
return this._activeValue() === val;
|
|
290
402
|
}
|
|
@@ -296,6 +408,47 @@ class RadioGroupComponent {
|
|
|
296
408
|
this._onTouched();
|
|
297
409
|
this.valueChange.emit(opt.value);
|
|
298
410
|
}
|
|
411
|
+
getTabindex(opt, idx) {
|
|
412
|
+
if (this.disabled() || opt.disabled)
|
|
413
|
+
return '-1';
|
|
414
|
+
const activeVal = this._activeValue();
|
|
415
|
+
const opts = this.options();
|
|
416
|
+
if (activeVal !== null && activeVal !== undefined) {
|
|
417
|
+
return this.isChecked(opt.value) ? '0' : '-1';
|
|
418
|
+
}
|
|
419
|
+
const firstEnabledIdx = opts.findIndex(o => !o.disabled);
|
|
420
|
+
return idx === firstEnabledIdx ? '0' : '-1';
|
|
421
|
+
}
|
|
422
|
+
onOptionKeyDown(event, opt, idx) {
|
|
423
|
+
if (this.disabled())
|
|
424
|
+
return;
|
|
425
|
+
let nextIdx = idx;
|
|
426
|
+
const opts = this.options();
|
|
427
|
+
if (event.key === 'ArrowRight' || event.key === 'ArrowDown') {
|
|
428
|
+
event.preventDefault();
|
|
429
|
+
do {
|
|
430
|
+
nextIdx = (nextIdx + 1) % opts.length;
|
|
431
|
+
} while (opts[nextIdx].disabled && nextIdx !== idx);
|
|
432
|
+
this.select(opts[nextIdx]);
|
|
433
|
+
this.focusOption(nextIdx);
|
|
434
|
+
}
|
|
435
|
+
else if (event.key === 'ArrowLeft' || event.key === 'ArrowUp') {
|
|
436
|
+
event.preventDefault();
|
|
437
|
+
do {
|
|
438
|
+
nextIdx = (nextIdx - 1 + opts.length) % opts.length;
|
|
439
|
+
} while (opts[nextIdx].disabled && nextIdx !== idx);
|
|
440
|
+
this.select(opts[nextIdx]);
|
|
441
|
+
this.focusOption(nextIdx);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
focusOption(idx) {
|
|
445
|
+
setTimeout(() => {
|
|
446
|
+
const radioBtns = this.el.nativeElement.querySelectorAll('.ngx-radio-btn');
|
|
447
|
+
if (radioBtns[idx]) {
|
|
448
|
+
radioBtns[idx].focus();
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
}
|
|
299
452
|
// ControlValueAccessor
|
|
300
453
|
writeValue(val) {
|
|
301
454
|
this._cvaActive = true;
|
|
@@ -307,11 +460,11 @@ class RadioGroupComponent {
|
|
|
307
460
|
registerOnTouched(fn) {
|
|
308
461
|
this._onTouched = fn;
|
|
309
462
|
}
|
|
310
|
-
setDisabledState(
|
|
311
|
-
//
|
|
463
|
+
setDisabledState(isDisabled) {
|
|
464
|
+
// Handled at form control template level
|
|
312
465
|
}
|
|
313
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: RadioGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
314
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: RadioGroupComponent, isStandalone: true, selector: "ngx-radio-group", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, providers: [
|
|
466
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: RadioGroupComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
467
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: RadioGroupComponent, isStandalone: true, selector: "ngx-radio-group", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", 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 } }, outputs: { valueChange: "valueChange" }, providers: [
|
|
315
468
|
{
|
|
316
469
|
provide: NG_VALUE_ACCESSOR,
|
|
317
470
|
useExisting: forwardRef(() => RadioGroupComponent),
|
|
@@ -319,37 +472,51 @@ class RadioGroupComponent {
|
|
|
319
472
|
},
|
|
320
473
|
], ngImport: i0, template: `
|
|
321
474
|
<div
|
|
322
|
-
class="ngx-radio-group"
|
|
323
|
-
[class.
|
|
324
|
-
|
|
325
|
-
[
|
|
475
|
+
class="ngx-radio-group-container"
|
|
476
|
+
[class.has-error]="_resolvedStatus() === 'error'"
|
|
477
|
+
[class.disabled]="disabled()"
|
|
478
|
+
[class.status-success]="_resolvedStatus() === 'success'"
|
|
479
|
+
[class.status-warning]="_resolvedStatus() === 'warning'"
|
|
326
480
|
>
|
|
327
481
|
@if (label()) {
|
|
328
482
|
<span class="ngx-radio-group-label">{{ label() }}</span>
|
|
329
483
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
484
|
+
<div
|
|
485
|
+
class="ngx-radio-group-options"
|
|
486
|
+
[class.inline]="inline()"
|
|
487
|
+
role="radiogroup"
|
|
488
|
+
[attr.aria-label]="label()"
|
|
489
|
+
>
|
|
490
|
+
@for (opt of options(); track opt.value; let idx = $index) {
|
|
491
|
+
<label
|
|
492
|
+
class="ngx-radio"
|
|
493
|
+
[class.disabled]="disabled() || !!opt.disabled"
|
|
338
494
|
[class.checked]="isChecked(opt.value)"
|
|
339
|
-
(click)="select(opt)"
|
|
340
|
-
role="radio"
|
|
341
|
-
[attr.aria-checked]="isChecked(opt.value)"
|
|
342
|
-
tabindex="0"
|
|
343
|
-
(keydown.enter)="select(opt)"
|
|
344
|
-
(keydown.space)="select(opt)"
|
|
345
495
|
>
|
|
346
|
-
<span
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
496
|
+
<span
|
|
497
|
+
class="ngx-radio-btn"
|
|
498
|
+
[class.checked]="isChecked(opt.value)"
|
|
499
|
+
(click)="select(opt)"
|
|
500
|
+
role="radio"
|
|
501
|
+
[attr.aria-checked]="isChecked(opt.value)"
|
|
502
|
+
[attr.aria-disabled]="disabled() || opt.disabled"
|
|
503
|
+
[attr.tabindex]="getTabindex(opt, idx)"
|
|
504
|
+
(keydown)="onOptionKeyDown($event, opt, idx)"
|
|
505
|
+
>
|
|
506
|
+
<span class="ngx-radio-dot" [class.visible]="isChecked(opt.value)"></span>
|
|
507
|
+
</span>
|
|
508
|
+
<span class="ngx-radio-label" (click)="select(opt)">{{ opt.label }}</span>
|
|
509
|
+
</label>
|
|
510
|
+
}
|
|
511
|
+
</div>
|
|
512
|
+
|
|
513
|
+
@if (error()) {
|
|
514
|
+
<div class="ngx-radio-error">{{ error() }}</div>
|
|
515
|
+
} @else if (hint()) {
|
|
516
|
+
<div class="ngx-radio-hint">{{ hint() }}</div>
|
|
350
517
|
}
|
|
351
518
|
</div>
|
|
352
|
-
`, isInline: true, styles: [":host{display:block}.ngx-radio-
|
|
519
|
+
`, isInline: true, styles: [":host{display:block;--ngx-input-success-border: #10b981;--ngx-input-success-shadow: 0 0 0 3px rgba(16, 185, 129, .2);--ngx-input-warning-border: #f59e0b;--ngx-input-warning-shadow: 0 0 0 3px rgba(245, 158, 11, .2);--ngx-input-error-border: #ef4444;--ngx-input-error-shadow: 0 0 0 3px rgba(239, 68, 68, .2);--ngx-radio-border: #cbd5e1;--ngx-radio-bg: #ffffff;--ngx-radio-active: #4f46e5;--ngx-radio-text: #0f172a}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-radio-border: #475569;--ngx-radio-bg: #0f172a;--ngx-radio-active: #818cf8;--ngx-radio-text: #f8fafc;--ngx-input-success-border: #34d399;--ngx-input-success-shadow: 0 0 0 3px rgba(52, 211, 153, .3);--ngx-input-warning-border: #fbbf24;--ngx-input-warning-shadow: 0 0 0 3px rgba(251, 191, 36, .3);--ngx-input-error-border: #f87171;--ngx-input-error-shadow: 0 0 0 3px rgba(248, 113, 113, .3)}.ngx-radio-group-container{display:flex;flex-direction:column;gap:6px;font-family:inherit}.ngx-radio-group-label{display:block;font-size:13px;color:var(--ngx-radio-border);font-weight:600;margin-bottom:4px}.ngx-radio-group-options{display:flex;flex-direction:column;gap:10px}.ngx-radio-group-options.inline{flex-direction:row;flex-wrap:wrap;gap:20px}.ngx-radio{display:inline-flex;align-items:center;gap:10px;cursor:pointer;-webkit-user-select:none;user-select:none}.ngx-radio.disabled{cursor:not-allowed;opacity:.55}.ngx-radio-btn{width:20px;height:20px;flex-shrink:0;border:2px solid var(--ngx-radio-border);border-radius:50%;background:var(--ngx-radio-bg);display:flex;align-items:center;justify-content:center;transition:all .2s cubic-bezier(.4,0,.2,1);outline:none}.ngx-radio-btn.checked{border-color:var(--ngx-radio-active)}.ngx-radio-btn:hover:not(.disabled){border-color:var(--ngx-radio-active);transform:scale(1.05)}.ngx-radio-btn:focus-visible{border-color:var(--ngx-radio-active);box-shadow:0 0 0 3px #4f46e540}.status-success .ngx-radio-btn,.status-success .ngx-radio-btn.checked{border-color:var(--ngx-input-success-border)}.status-success .ngx-radio-dot{background:var(--ngx-input-success-border)}.status-success .ngx-radio-btn:focus-visible{box-shadow:var(--ngx-input-success-shadow)}.status-warning .ngx-radio-btn,.status-warning .ngx-radio-btn.checked{border-color:var(--ngx-input-warning-border)}.status-warning .ngx-radio-dot{background:var(--ngx-input-warning-border)}.status-warning .ngx-radio-btn:focus-visible{box-shadow:var(--ngx-input-warning-shadow)}.has-error .ngx-radio-btn,.has-error .ngx-radio-btn.checked{border-color:var(--ngx-input-error-border)}.has-error .ngx-radio-dot{background:var(--ngx-input-error-border)}.has-error .ngx-radio-btn:focus-visible{box-shadow:var(--ngx-input-error-shadow)}.ngx-radio-dot{width:10px;height:10px;border-radius:50%;background:var(--ngx-radio-active);opacity:0;transform:scale(.4);transition:opacity .2s cubic-bezier(.175,.885,.32,1.275),transform .2s cubic-bezier(.175,.885,.32,1.275)}.ngx-radio-dot.visible{opacity:1;transform:scale(1)}.ngx-radio-label{font-size:14px;color:var(--ngx-radio-text);transition:color .15s ease}.disabled .ngx-radio-label{cursor:not-allowed;opacity:.55}.ngx-radio-error{color:var(--ngx-input-error-border);font-size:12px;font-weight:550;animation:slide-down .2s ease-out}.ngx-radio-hint{color:#64748b;font-size:12px}@keyframes slide-down{0%{transform:translateY(-4px);opacity:0}to{transform:translateY(0);opacity:1}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
353
520
|
}
|
|
354
521
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: RadioGroupComponent, decorators: [{
|
|
355
522
|
type: Component,
|
|
@@ -361,38 +528,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
361
528
|
},
|
|
362
529
|
], template: `
|
|
363
530
|
<div
|
|
364
|
-
class="ngx-radio-group"
|
|
365
|
-
[class.
|
|
366
|
-
|
|
367
|
-
[
|
|
531
|
+
class="ngx-radio-group-container"
|
|
532
|
+
[class.has-error]="_resolvedStatus() === 'error'"
|
|
533
|
+
[class.disabled]="disabled()"
|
|
534
|
+
[class.status-success]="_resolvedStatus() === 'success'"
|
|
535
|
+
[class.status-warning]="_resolvedStatus() === 'warning'"
|
|
368
536
|
>
|
|
369
537
|
@if (label()) {
|
|
370
538
|
<span class="ngx-radio-group-label">{{ label() }}</span>
|
|
371
539
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
540
|
+
<div
|
|
541
|
+
class="ngx-radio-group-options"
|
|
542
|
+
[class.inline]="inline()"
|
|
543
|
+
role="radiogroup"
|
|
544
|
+
[attr.aria-label]="label()"
|
|
545
|
+
>
|
|
546
|
+
@for (opt of options(); track opt.value; let idx = $index) {
|
|
547
|
+
<label
|
|
548
|
+
class="ngx-radio"
|
|
549
|
+
[class.disabled]="disabled() || !!opt.disabled"
|
|
380
550
|
[class.checked]="isChecked(opt.value)"
|
|
381
|
-
(click)="select(opt)"
|
|
382
|
-
role="radio"
|
|
383
|
-
[attr.aria-checked]="isChecked(opt.value)"
|
|
384
|
-
tabindex="0"
|
|
385
|
-
(keydown.enter)="select(opt)"
|
|
386
|
-
(keydown.space)="select(opt)"
|
|
387
551
|
>
|
|
388
|
-
<span
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
552
|
+
<span
|
|
553
|
+
class="ngx-radio-btn"
|
|
554
|
+
[class.checked]="isChecked(opt.value)"
|
|
555
|
+
(click)="select(opt)"
|
|
556
|
+
role="radio"
|
|
557
|
+
[attr.aria-checked]="isChecked(opt.value)"
|
|
558
|
+
[attr.aria-disabled]="disabled() || opt.disabled"
|
|
559
|
+
[attr.tabindex]="getTabindex(opt, idx)"
|
|
560
|
+
(keydown)="onOptionKeyDown($event, opt, idx)"
|
|
561
|
+
>
|
|
562
|
+
<span class="ngx-radio-dot" [class.visible]="isChecked(opt.value)"></span>
|
|
563
|
+
</span>
|
|
564
|
+
<span class="ngx-radio-label" (click)="select(opt)">{{ opt.label }}</span>
|
|
565
|
+
</label>
|
|
566
|
+
}
|
|
567
|
+
</div>
|
|
568
|
+
|
|
569
|
+
@if (error()) {
|
|
570
|
+
<div class="ngx-radio-error">{{ error() }}</div>
|
|
571
|
+
} @else if (hint()) {
|
|
572
|
+
<div class="ngx-radio-hint">{{ hint() }}</div>
|
|
392
573
|
}
|
|
393
574
|
</div>
|
|
394
|
-
`, styles: [":host{display:block}.ngx-radio-
|
|
395
|
-
}] });
|
|
575
|
+
`, styles: [":host{display:block;--ngx-input-success-border: #10b981;--ngx-input-success-shadow: 0 0 0 3px rgba(16, 185, 129, .2);--ngx-input-warning-border: #f59e0b;--ngx-input-warning-shadow: 0 0 0 3px rgba(245, 158, 11, .2);--ngx-input-error-border: #ef4444;--ngx-input-error-shadow: 0 0 0 3px rgba(239, 68, 68, .2);--ngx-radio-border: #cbd5e1;--ngx-radio-bg: #ffffff;--ngx-radio-active: #4f46e5;--ngx-radio-text: #0f172a}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-radio-border: #475569;--ngx-radio-bg: #0f172a;--ngx-radio-active: #818cf8;--ngx-radio-text: #f8fafc;--ngx-input-success-border: #34d399;--ngx-input-success-shadow: 0 0 0 3px rgba(52, 211, 153, .3);--ngx-input-warning-border: #fbbf24;--ngx-input-warning-shadow: 0 0 0 3px rgba(251, 191, 36, .3);--ngx-input-error-border: #f87171;--ngx-input-error-shadow: 0 0 0 3px rgba(248, 113, 113, .3)}.ngx-radio-group-container{display:flex;flex-direction:column;gap:6px;font-family:inherit}.ngx-radio-group-label{display:block;font-size:13px;color:var(--ngx-radio-border);font-weight:600;margin-bottom:4px}.ngx-radio-group-options{display:flex;flex-direction:column;gap:10px}.ngx-radio-group-options.inline{flex-direction:row;flex-wrap:wrap;gap:20px}.ngx-radio{display:inline-flex;align-items:center;gap:10px;cursor:pointer;-webkit-user-select:none;user-select:none}.ngx-radio.disabled{cursor:not-allowed;opacity:.55}.ngx-radio-btn{width:20px;height:20px;flex-shrink:0;border:2px solid var(--ngx-radio-border);border-radius:50%;background:var(--ngx-radio-bg);display:flex;align-items:center;justify-content:center;transition:all .2s cubic-bezier(.4,0,.2,1);outline:none}.ngx-radio-btn.checked{border-color:var(--ngx-radio-active)}.ngx-radio-btn:hover:not(.disabled){border-color:var(--ngx-radio-active);transform:scale(1.05)}.ngx-radio-btn:focus-visible{border-color:var(--ngx-radio-active);box-shadow:0 0 0 3px #4f46e540}.status-success .ngx-radio-btn,.status-success .ngx-radio-btn.checked{border-color:var(--ngx-input-success-border)}.status-success .ngx-radio-dot{background:var(--ngx-input-success-border)}.status-success .ngx-radio-btn:focus-visible{box-shadow:var(--ngx-input-success-shadow)}.status-warning .ngx-radio-btn,.status-warning .ngx-radio-btn.checked{border-color:var(--ngx-input-warning-border)}.status-warning .ngx-radio-dot{background:var(--ngx-input-warning-border)}.status-warning .ngx-radio-btn:focus-visible{box-shadow:var(--ngx-input-warning-shadow)}.has-error .ngx-radio-btn,.has-error .ngx-radio-btn.checked{border-color:var(--ngx-input-error-border)}.has-error .ngx-radio-dot{background:var(--ngx-input-error-border)}.has-error .ngx-radio-btn:focus-visible{box-shadow:var(--ngx-input-error-shadow)}.ngx-radio-dot{width:10px;height:10px;border-radius:50%;background:var(--ngx-radio-active);opacity:0;transform:scale(.4);transition:opacity .2s cubic-bezier(.175,.885,.32,1.275),transform .2s cubic-bezier(.175,.885,.32,1.275)}.ngx-radio-dot.visible{opacity:1;transform:scale(1)}.ngx-radio-label{font-size:14px;color:var(--ngx-radio-text);transition:color .15s ease}.disabled .ngx-radio-label{cursor:not-allowed;opacity:.55}.ngx-radio-error{color:var(--ngx-input-error-border);font-size:12px;font-weight:550;animation:slide-down .2s ease-out}.ngx-radio-hint{color:#64748b;font-size:12px}@keyframes slide-down{0%{transform:translateY(-4px);opacity:0}to{transform:translateY(0);opacity:1}}\n"] }]
|
|
576
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
|
396
577
|
|
|
397
578
|
class DropdownComponent {
|
|
398
579
|
options = input([]);
|
|
@@ -1634,35 +1815,134 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1634
1815
|
}] });
|
|
1635
1816
|
|
|
1636
1817
|
class SwitchComponent {
|
|
1637
|
-
checked =
|
|
1818
|
+
checked = model(false);
|
|
1638
1819
|
onLabel = input('On');
|
|
1639
1820
|
offLabel = input('Off');
|
|
1640
1821
|
size = input('md');
|
|
1641
1822
|
disabled = input(false);
|
|
1642
|
-
|
|
1643
|
-
|
|
1823
|
+
// Enterprise validation signals
|
|
1824
|
+
status = input('default');
|
|
1825
|
+
error = input('');
|
|
1826
|
+
hint = input('');
|
|
1827
|
+
_onChange = () => { };
|
|
1828
|
+
_onTouched = () => { };
|
|
1829
|
+
_resolvedStatus = computed(() => {
|
|
1830
|
+
if (this.error())
|
|
1831
|
+
return 'error';
|
|
1832
|
+
return this.status();
|
|
1833
|
+
});
|
|
1834
|
+
toggle() {
|
|
1835
|
+
if (this.disabled())
|
|
1836
|
+
return;
|
|
1837
|
+
this.checked.update(v => !v);
|
|
1838
|
+
this._onChange(this.checked());
|
|
1839
|
+
this._onTouched();
|
|
1840
|
+
}
|
|
1841
|
+
// ControlValueAccessor
|
|
1842
|
+
writeValue(val) {
|
|
1843
|
+
this.checked.set(!!val);
|
|
1844
|
+
}
|
|
1845
|
+
registerOnChange(fn) {
|
|
1846
|
+
this._onChange = fn;
|
|
1847
|
+
}
|
|
1848
|
+
registerOnTouched(fn) {
|
|
1849
|
+
this._onTouched = fn;
|
|
1850
|
+
}
|
|
1851
|
+
setDisabledState(isDisabled) {
|
|
1852
|
+
// Handled via disabled input
|
|
1853
|
+
}
|
|
1644
1854
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1645
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1855
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: SwitchComponent, isStandalone: true, selector: "ngx-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, onLabel: { classPropertyName: "onLabel", publicName: "onLabel", isSignal: true, isRequired: false, transformFunction: null }, offLabel: { classPropertyName: "offLabel", publicName: "offLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", 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 } }, outputs: { checked: "checkedChange" }, providers: [
|
|
1856
|
+
{
|
|
1857
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1858
|
+
useExisting: forwardRef(() => SwitchComponent),
|
|
1859
|
+
multi: true
|
|
1860
|
+
}
|
|
1861
|
+
], ngImport: i0, template: `
|
|
1862
|
+
<div
|
|
1863
|
+
class="ngx-switch-container"
|
|
1864
|
+
[class.has-error]="_resolvedStatus() === 'error'"
|
|
1865
|
+
[class.disabled]="disabled()"
|
|
1866
|
+
[class.status-success]="_resolvedStatus() === 'success'"
|
|
1867
|
+
[class.status-warning]="_resolvedStatus() === 'warning'"
|
|
1868
|
+
>
|
|
1869
|
+
<div class="ngx-switch-row">
|
|
1870
|
+
@if (offLabel()) {
|
|
1871
|
+
<span class="switch-off-label" [class.active]="!checked()" (click)="disabled() ? null : (!checked() ? null : toggle())">{{ offLabel() }}</span>
|
|
1872
|
+
}
|
|
1873
|
+
<span
|
|
1874
|
+
class="switch-track"
|
|
1875
|
+
[class.checked]="checked()"
|
|
1876
|
+
[class]="'size-' + size()"
|
|
1877
|
+
(click)="toggle()"
|
|
1878
|
+
(keydown.space)="$event.preventDefault(); toggle()"
|
|
1879
|
+
(keydown.enter)="$event.preventDefault(); toggle()"
|
|
1880
|
+
role="switch"
|
|
1881
|
+
[attr.aria-checked]="checked()"
|
|
1882
|
+
[attr.aria-disabled]="disabled()"
|
|
1883
|
+
[attr.tabindex]="disabled() ? null : '0'"
|
|
1884
|
+
>
|
|
1885
|
+
<span class="switch-thumb"></span>
|
|
1886
|
+
</span>
|
|
1887
|
+
@if (onLabel()) {
|
|
1888
|
+
<span class="switch-on-label" [class.active]="checked()" (click)="disabled() ? null : (checked() ? null : toggle())">{{ onLabel() }}</span>
|
|
1889
|
+
}
|
|
1890
|
+
</div>
|
|
1891
|
+
|
|
1892
|
+
@if (error()) {
|
|
1893
|
+
<div class="ngx-switch-error">{{ error() }}</div>
|
|
1894
|
+
} @else if (hint()) {
|
|
1895
|
+
<div class="ngx-switch-hint">{{ hint() }}</div>
|
|
1896
|
+
}
|
|
1897
|
+
</div>
|
|
1898
|
+
`, isInline: true, styles: [":host{display:inline-block;--ngx-input-success-border: #10b981;--ngx-input-success-shadow: 0 0 0 3px rgba(16, 185, 129, .2);--ngx-input-warning-border: #f59e0b;--ngx-input-warning-shadow: 0 0 0 3px rgba(245, 158, 11, .2);--ngx-input-error-border: #ef4444;--ngx-input-error-shadow: 0 0 0 3px rgba(239, 68, 68, .2);--ngx-switch-off-bg: #cbd5e1;--ngx-switch-on-bg: #4f46e5;--ngx-switch-thumb-bg: #ffffff;--ngx-switch-text: #475569;--ngx-switch-text-active: #0f172a}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-switch-off-bg: #475569;--ngx-switch-on-bg: #818cf8;--ngx-switch-text: #94a3b8;--ngx-switch-text-active: #f8fafc;--ngx-input-success-border: #34d399;--ngx-input-success-shadow: 0 0 0 3px rgba(52, 211, 153, .3);--ngx-input-warning-border: #fbbf24;--ngx-input-warning-shadow: 0 0 0 3px rgba(251, 191, 36, .3);--ngx-input-error-border: #f87171;--ngx-input-error-shadow: 0 0 0 3px rgba(248, 113, 113, .3)}.ngx-switch-container{display:flex;flex-direction:column;gap:4px;font-family:inherit}.ngx-switch-row{display:inline-flex;align-items:center;gap:10px}.switch-track{position:relative;border-radius:999px;background:var(--ngx-switch-off-bg);transition:all .25s cubic-bezier(.4,0,.2,1);flex-shrink:0;cursor:pointer;outline:none;box-shadow:inset 0 1px 3px #0000001a}.switch-track.size-sm{width:34px;height:20px}.switch-track.size-md{width:44px;height:24px}.switch-track.size-lg{width:56px;height:30px}.switch-track.checked{background:var(--ngx-switch-on-bg)}.switch-thumb{position:absolute;top:2px;left:2px;border-radius:50%;background:var(--ngx-switch-thumb-bg);box-shadow:0 2px 5px #00000026,0 1px 1px #0000001a;transition:transform .25s cubic-bezier(.34,1.56,.64,1);pointer-events:none}.size-sm .switch-thumb{width:16px;height:16px}.size-md .switch-thumb{width:20px;height:20px}.size-lg .switch-thumb{width:26px;height:26px}.size-sm.checked .switch-thumb{transform:translate(14px)}.size-md.checked .switch-thumb{transform:translate(20px)}.size-lg.checked .switch-thumb{transform:translate(26px)}.switch-track:focus-visible{box-shadow:0 0 0 3px #4f46e540,inset 0 1px 3px #0000001a}.switch-track:hover:not(.disabled) .switch-thumb{transform:scale(1.05) translate(0)}.size-sm.checked:hover:not(.disabled) .switch-thumb{transform:scale(1.05) translate(14px)}.size-md.checked:hover:not(.disabled) .switch-thumb{transform:scale(1.05) translate(20px)}.size-lg.checked:hover:not(.disabled) .switch-thumb{transform:scale(1.05) translate(26px)}.disabled{opacity:.55;cursor:not-allowed}.disabled .switch-track{cursor:not-allowed;pointer-events:none}.switch-off-label,.switch-on-label{font-size:13px;color:var(--ngx-switch-text);cursor:pointer;-webkit-user-select:none;user-select:none;transition:color .15s ease}.switch-off-label.active,.switch-on-label.active{color:var(--ngx-switch-text-active);font-weight:600}.status-success .switch-track.checked{background:var(--ngx-input-success-border)}.status-success .switch-track:focus-visible{box-shadow:var(--ngx-input-success-shadow),inset 0 1px 3px #0000001a}.status-warning .switch-track.checked{background:var(--ngx-input-warning-border)}.status-warning .switch-track:focus-visible{box-shadow:var(--ngx-input-warning-shadow),inset 0 1px 3px #0000001a}.has-error .switch-track.checked{background:var(--ngx-input-error-border)}.has-error .switch-track:focus-visible{box-shadow:var(--ngx-input-error-shadow),inset 0 1px 3px #0000001a}.ngx-switch-error{color:var(--ngx-input-error-border);font-size:12px;font-weight:550;animation:slide-down .2s ease-out}.ngx-switch-hint{color:#64748b;font-size:12px}@keyframes slide-down{0%{transform:translateY(-4px);opacity:0}to{transform:translateY(0);opacity:1}}\n"] });
|
|
1654
1899
|
}
|
|
1655
1900
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
1656
1901
|
type: Component,
|
|
1657
|
-
args: [{ selector: 'ngx-switch', standalone: true,
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1902
|
+
args: [{ selector: 'ngx-switch', standalone: true, providers: [
|
|
1903
|
+
{
|
|
1904
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1905
|
+
useExisting: forwardRef(() => SwitchComponent),
|
|
1906
|
+
multi: true
|
|
1907
|
+
}
|
|
1908
|
+
], template: `
|
|
1909
|
+
<div
|
|
1910
|
+
class="ngx-switch-container"
|
|
1911
|
+
[class.has-error]="_resolvedStatus() === 'error'"
|
|
1912
|
+
[class.disabled]="disabled()"
|
|
1913
|
+
[class.status-success]="_resolvedStatus() === 'success'"
|
|
1914
|
+
[class.status-warning]="_resolvedStatus() === 'warning'"
|
|
1915
|
+
>
|
|
1916
|
+
<div class="ngx-switch-row">
|
|
1917
|
+
@if (offLabel()) {
|
|
1918
|
+
<span class="switch-off-label" [class.active]="!checked()" (click)="disabled() ? null : (!checked() ? null : toggle())">{{ offLabel() }}</span>
|
|
1919
|
+
}
|
|
1920
|
+
<span
|
|
1921
|
+
class="switch-track"
|
|
1922
|
+
[class.checked]="checked()"
|
|
1923
|
+
[class]="'size-' + size()"
|
|
1924
|
+
(click)="toggle()"
|
|
1925
|
+
(keydown.space)="$event.preventDefault(); toggle()"
|
|
1926
|
+
(keydown.enter)="$event.preventDefault(); toggle()"
|
|
1927
|
+
role="switch"
|
|
1928
|
+
[attr.aria-checked]="checked()"
|
|
1929
|
+
[attr.aria-disabled]="disabled()"
|
|
1930
|
+
[attr.tabindex]="disabled() ? null : '0'"
|
|
1931
|
+
>
|
|
1932
|
+
<span class="switch-thumb"></span>
|
|
1933
|
+
</span>
|
|
1934
|
+
@if (onLabel()) {
|
|
1935
|
+
<span class="switch-on-label" [class.active]="checked()" (click)="disabled() ? null : (checked() ? null : toggle())">{{ onLabel() }}</span>
|
|
1936
|
+
}
|
|
1937
|
+
</div>
|
|
1938
|
+
|
|
1939
|
+
@if (error()) {
|
|
1940
|
+
<div class="ngx-switch-error">{{ error() }}</div>
|
|
1941
|
+
} @else if (hint()) {
|
|
1942
|
+
<div class="ngx-switch-hint">{{ hint() }}</div>
|
|
1943
|
+
}
|
|
1944
|
+
</div>
|
|
1945
|
+
`, styles: [":host{display:inline-block;--ngx-input-success-border: #10b981;--ngx-input-success-shadow: 0 0 0 3px rgba(16, 185, 129, .2);--ngx-input-warning-border: #f59e0b;--ngx-input-warning-shadow: 0 0 0 3px rgba(245, 158, 11, .2);--ngx-input-error-border: #ef4444;--ngx-input-error-shadow: 0 0 0 3px rgba(239, 68, 68, .2);--ngx-switch-off-bg: #cbd5e1;--ngx-switch-on-bg: #4f46e5;--ngx-switch-thumb-bg: #ffffff;--ngx-switch-text: #475569;--ngx-switch-text-active: #0f172a}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-switch-off-bg: #475569;--ngx-switch-on-bg: #818cf8;--ngx-switch-text: #94a3b8;--ngx-switch-text-active: #f8fafc;--ngx-input-success-border: #34d399;--ngx-input-success-shadow: 0 0 0 3px rgba(52, 211, 153, .3);--ngx-input-warning-border: #fbbf24;--ngx-input-warning-shadow: 0 0 0 3px rgba(251, 191, 36, .3);--ngx-input-error-border: #f87171;--ngx-input-error-shadow: 0 0 0 3px rgba(248, 113, 113, .3)}.ngx-switch-container{display:flex;flex-direction:column;gap:4px;font-family:inherit}.ngx-switch-row{display:inline-flex;align-items:center;gap:10px}.switch-track{position:relative;border-radius:999px;background:var(--ngx-switch-off-bg);transition:all .25s cubic-bezier(.4,0,.2,1);flex-shrink:0;cursor:pointer;outline:none;box-shadow:inset 0 1px 3px #0000001a}.switch-track.size-sm{width:34px;height:20px}.switch-track.size-md{width:44px;height:24px}.switch-track.size-lg{width:56px;height:30px}.switch-track.checked{background:var(--ngx-switch-on-bg)}.switch-thumb{position:absolute;top:2px;left:2px;border-radius:50%;background:var(--ngx-switch-thumb-bg);box-shadow:0 2px 5px #00000026,0 1px 1px #0000001a;transition:transform .25s cubic-bezier(.34,1.56,.64,1);pointer-events:none}.size-sm .switch-thumb{width:16px;height:16px}.size-md .switch-thumb{width:20px;height:20px}.size-lg .switch-thumb{width:26px;height:26px}.size-sm.checked .switch-thumb{transform:translate(14px)}.size-md.checked .switch-thumb{transform:translate(20px)}.size-lg.checked .switch-thumb{transform:translate(26px)}.switch-track:focus-visible{box-shadow:0 0 0 3px #4f46e540,inset 0 1px 3px #0000001a}.switch-track:hover:not(.disabled) .switch-thumb{transform:scale(1.05) translate(0)}.size-sm.checked:hover:not(.disabled) .switch-thumb{transform:scale(1.05) translate(14px)}.size-md.checked:hover:not(.disabled) .switch-thumb{transform:scale(1.05) translate(20px)}.size-lg.checked:hover:not(.disabled) .switch-thumb{transform:scale(1.05) translate(26px)}.disabled{opacity:.55;cursor:not-allowed}.disabled .switch-track{cursor:not-allowed;pointer-events:none}.switch-off-label,.switch-on-label{font-size:13px;color:var(--ngx-switch-text);cursor:pointer;-webkit-user-select:none;user-select:none;transition:color .15s ease}.switch-off-label.active,.switch-on-label.active{color:var(--ngx-switch-text-active);font-weight:600}.status-success .switch-track.checked{background:var(--ngx-input-success-border)}.status-success .switch-track:focus-visible{box-shadow:var(--ngx-input-success-shadow),inset 0 1px 3px #0000001a}.status-warning .switch-track.checked{background:var(--ngx-input-warning-border)}.status-warning .switch-track:focus-visible{box-shadow:var(--ngx-input-warning-shadow),inset 0 1px 3px #0000001a}.has-error .switch-track.checked{background:var(--ngx-input-error-border)}.has-error .switch-track:focus-visible{box-shadow:var(--ngx-input-error-shadow),inset 0 1px 3px #0000001a}.ngx-switch-error{color:var(--ngx-input-error-border);font-size:12px;font-weight:550;animation:slide-down .2s ease-out}.ngx-switch-hint{color:#64748b;font-size:12px}@keyframes slide-down{0%{transform:translateY(-4px);opacity:0}to{transform:translateY(0);opacity:1}}\n"] }]
|
|
1666
1946
|
}] });
|
|
1667
1947
|
|
|
1668
1948
|
class RatingComponent {
|
|
@@ -1670,60 +1950,185 @@ class RatingComponent {
|
|
|
1670
1950
|
label = input('');
|
|
1671
1951
|
readonly = input(false);
|
|
1672
1952
|
showValue = input(false);
|
|
1673
|
-
|
|
1953
|
+
// Enterprise validation signals
|
|
1954
|
+
status = input('default');
|
|
1955
|
+
error = input('');
|
|
1956
|
+
hint = input('');
|
|
1957
|
+
value = model(0);
|
|
1958
|
+
current = computed(() => this.value());
|
|
1674
1959
|
hovered = signal(0);
|
|
1675
1960
|
ratingChange = output();
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1961
|
+
_onChange = () => { };
|
|
1962
|
+
_onTouched = () => { };
|
|
1963
|
+
stars = computed(() => Array.from({ length: this.max() }, (_, i) => i + 1));
|
|
1964
|
+
_resolvedStatus = computed(() => {
|
|
1965
|
+
if (this.error())
|
|
1966
|
+
return 'error';
|
|
1967
|
+
return this.status();
|
|
1968
|
+
});
|
|
1969
|
+
setRating(star) {
|
|
1970
|
+
if (this.readonly())
|
|
1971
|
+
return;
|
|
1972
|
+
this.value.set(star);
|
|
1973
|
+
this._onChange(star);
|
|
1974
|
+
this._onTouched();
|
|
1679
1975
|
this.ratingChange.emit(star);
|
|
1680
|
-
}
|
|
1976
|
+
}
|
|
1977
|
+
onKeyDown(event) {
|
|
1978
|
+
if (this.readonly())
|
|
1979
|
+
return;
|
|
1980
|
+
const maxVal = this.max();
|
|
1981
|
+
const curr = this.value();
|
|
1982
|
+
if (event.key === 'ArrowRight' || event.key === 'ArrowUp') {
|
|
1983
|
+
event.preventDefault();
|
|
1984
|
+
this.setRating(Math.min(maxVal, curr + 1));
|
|
1985
|
+
}
|
|
1986
|
+
else if (event.key === 'ArrowLeft' || event.key === 'ArrowDown') {
|
|
1987
|
+
event.preventDefault();
|
|
1988
|
+
this.setRating(Math.max(0, curr - 1));
|
|
1989
|
+
}
|
|
1990
|
+
else if (event.key === 'Home') {
|
|
1991
|
+
event.preventDefault();
|
|
1992
|
+
this.setRating(0);
|
|
1993
|
+
}
|
|
1994
|
+
else if (event.key === 'End') {
|
|
1995
|
+
event.preventDefault();
|
|
1996
|
+
this.setRating(maxVal);
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
// ControlValueAccessor
|
|
2000
|
+
writeValue(val) {
|
|
2001
|
+
this.value.set(val ?? 0);
|
|
2002
|
+
}
|
|
2003
|
+
registerOnChange(fn) {
|
|
2004
|
+
this._onChange = fn;
|
|
2005
|
+
}
|
|
2006
|
+
registerOnTouched(fn) {
|
|
2007
|
+
this._onTouched = fn;
|
|
2008
|
+
}
|
|
2009
|
+
setDisabledState(isDisabled) {
|
|
2010
|
+
// Handled via readonly or template-level disabled
|
|
2011
|
+
}
|
|
1681
2012
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: RatingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1682
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: RatingComponent, isStandalone: true, selector: "ngx-rating", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null } },
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
2013
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: RatingComponent, isStandalone: true, selector: "ngx-rating", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", 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 }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", ratingChange: "ratingChange" }, providers: [
|
|
2014
|
+
{
|
|
2015
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2016
|
+
useExisting: forwardRef(() => RatingComponent),
|
|
2017
|
+
multi: true
|
|
2018
|
+
}
|
|
2019
|
+
], ngImport: i0, template: `
|
|
2020
|
+
<div
|
|
2021
|
+
class="ngx-rating-container"
|
|
2022
|
+
[class.has-error]="_resolvedStatus() === 'error'"
|
|
2023
|
+
[class.disabled]="readonly()"
|
|
2024
|
+
[class.status-success]="_resolvedStatus() === 'success'"
|
|
2025
|
+
[class.status-warning]="_resolvedStatus() === 'warning'"
|
|
2026
|
+
>
|
|
2027
|
+
@if (label()) {
|
|
2028
|
+
<span class="rating-label">{{ label() }}</span>
|
|
2029
|
+
}
|
|
2030
|
+
<div class="ngx-rating-row">
|
|
2031
|
+
<div
|
|
2032
|
+
class="rating-stars"
|
|
2033
|
+
[attr.tabindex]="readonly() ? null : '0'"
|
|
2034
|
+
role="slider"
|
|
2035
|
+
[attr.aria-valuenow]="current()"
|
|
2036
|
+
[attr.aria-valuemin]="0"
|
|
2037
|
+
[attr.aria-valuemax]="max()"
|
|
2038
|
+
[attr.aria-label]="label() || 'Rating'"
|
|
2039
|
+
[attr.aria-disabled]="readonly()"
|
|
2040
|
+
(keydown)="onKeyDown($event)"
|
|
2041
|
+
>
|
|
2042
|
+
@for (star of stars(); track star) {
|
|
2043
|
+
<span
|
|
2044
|
+
class="rating-star"
|
|
2045
|
+
[class.filled]="(hovered() || current()) >= star"
|
|
2046
|
+
[class.hovered]="hovered() >= star"
|
|
2047
|
+
(mouseenter)="readonly() ? null : hovered.set(star)"
|
|
2048
|
+
(mouseleave)="readonly() ? null : hovered.set(0)"
|
|
2049
|
+
(click)="readonly() ? null : setRating(star)"
|
|
2050
|
+
>
|
|
2051
|
+
@if ((hovered() || current()) >= star) {
|
|
2052
|
+
★
|
|
2053
|
+
} @else {
|
|
2054
|
+
☆
|
|
2055
|
+
}
|
|
2056
|
+
</span>
|
|
2057
|
+
}
|
|
2058
|
+
</div>
|
|
2059
|
+
@if (showValue()) {
|
|
2060
|
+
<span class="rating-value">{{ current() }}/{{ max() }}</span>
|
|
1698
2061
|
}
|
|
1699
2062
|
</div>
|
|
1700
|
-
|
|
2063
|
+
|
|
2064
|
+
@if (error()) {
|
|
2065
|
+
<div class="ngx-rating-error">{{ error() }}</div>
|
|
2066
|
+
} @else if (hint()) {
|
|
2067
|
+
<div class="ngx-rating-hint">{{ hint() }}</div>
|
|
2068
|
+
}
|
|
1701
2069
|
</div>
|
|
1702
|
-
`, isInline: true, styles: [":host{display:inline-block}.ngx-rating{display:
|
|
2070
|
+
`, isInline: true, styles: [":host{display:inline-block;--ngx-input-success-border: #10b981;--ngx-input-success-shadow: 0 0 0 3px rgba(16, 185, 129, .2);--ngx-input-warning-border: #f59e0b;--ngx-input-warning-shadow: 0 0 0 3px rgba(245, 158, 11, .2);--ngx-input-error-border: #ef4444;--ngx-input-error-shadow: 0 0 0 3px rgba(239, 68, 68, .2);--ngx-rating-empty: #cbd5e1;--ngx-rating-filled: #f59e0b;--ngx-rating-hover: #d97706;--ngx-rating-text: #64748b}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-rating-empty: #475569;--ngx-rating-filled: #fbbf24;--ngx-rating-hover: #f59e0b;--ngx-rating-text: #94a3b8;--ngx-input-success-border: #34d399;--ngx-input-success-shadow: 0 0 0 3px rgba(52, 211, 153, .3);--ngx-input-warning-border: #fbbf24;--ngx-input-warning-shadow: 0 0 0 3px rgba(251, 191, 36, .3);--ngx-input-error-border: #f87171;--ngx-input-error-shadow: 0 0 0 3px rgba(248, 113, 113, .3)}.ngx-rating-container{display:flex;flex-direction:column;gap:4px;font-family:inherit}.rating-label{font-size:13px;font-weight:600;color:var(--ngx-rating-text);margin-bottom:2px}.ngx-rating-row{display:flex;align-items:center;gap:10px}.rating-stars{display:flex;gap:4px;padding:4px 8px;border-radius:8px;border:1px solid transparent;outline:none;transition:all .2s cubic-bezier(.4,0,.2,1)}.rating-stars:focus-visible{border-color:#cbd5e1;box-shadow:0 0 0 3px #4f46e526;background:#4f46e508}:host-context(.dark) .rating-stars:focus-visible,:host-context(.dark-theme) .rating-stars:focus-visible{border-color:#475569;background:#818cf80d}.rating-star{font-size:24px;line-height:1;color:var(--ngx-rating-empty);cursor:pointer;-webkit-user-select:none;user-select:none;transition:color .15s ease,transform .15s cubic-bezier(.34,1.56,.64,1)}.disabled .rating-star{cursor:not-allowed;opacity:.75}.rating-star.filled{color:var(--ngx-rating-filled)}.rating-star.hovered{color:var(--ngx-rating-hover);transform:scale(1.25) rotate(5deg)}.rating-value{font-size:13px;font-weight:600;color:var(--ngx-rating-text);min-width:32px}.status-success .rating-stars:focus-visible{box-shadow:var(--ngx-input-success-shadow);border-color:var(--ngx-input-success-border)}.status-warning .rating-stars:focus-visible{box-shadow:var(--ngx-input-warning-shadow);border-color:var(--ngx-input-warning-border)}.has-error .rating-stars:focus-visible{box-shadow:var(--ngx-input-error-shadow);border-color:var(--ngx-input-error-border)}.ngx-rating-error{color:var(--ngx-input-error-border);font-size:12px;font-weight:550;margin-left:10px;animation:slide-down .2s ease-out}.ngx-rating-hint{color:#64748b;font-size:12px;margin-left:10px}@keyframes slide-down{0%{transform:translateY(-4px);opacity:0}to{transform:translateY(0);opacity:1}}\n"] });
|
|
1703
2071
|
}
|
|
1704
2072
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: RatingComponent, decorators: [{
|
|
1705
2073
|
type: Component,
|
|
1706
|
-
args: [{ selector: 'ngx-rating', standalone: true,
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
2074
|
+
args: [{ selector: 'ngx-rating', standalone: true, providers: [
|
|
2075
|
+
{
|
|
2076
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2077
|
+
useExisting: forwardRef(() => RatingComponent),
|
|
2078
|
+
multi: true
|
|
2079
|
+
}
|
|
2080
|
+
], template: `
|
|
2081
|
+
<div
|
|
2082
|
+
class="ngx-rating-container"
|
|
2083
|
+
[class.has-error]="_resolvedStatus() === 'error'"
|
|
2084
|
+
[class.disabled]="readonly()"
|
|
2085
|
+
[class.status-success]="_resolvedStatus() === 'success'"
|
|
2086
|
+
[class.status-warning]="_resolvedStatus() === 'warning'"
|
|
2087
|
+
>
|
|
2088
|
+
@if (label()) {
|
|
2089
|
+
<span class="rating-label">{{ label() }}</span>
|
|
2090
|
+
}
|
|
2091
|
+
<div class="ngx-rating-row">
|
|
2092
|
+
<div
|
|
2093
|
+
class="rating-stars"
|
|
2094
|
+
[attr.tabindex]="readonly() ? null : '0'"
|
|
2095
|
+
role="slider"
|
|
2096
|
+
[attr.aria-valuenow]="current()"
|
|
2097
|
+
[attr.aria-valuemin]="0"
|
|
2098
|
+
[attr.aria-valuemax]="max()"
|
|
2099
|
+
[attr.aria-label]="label() || 'Rating'"
|
|
2100
|
+
[attr.aria-disabled]="readonly()"
|
|
2101
|
+
(keydown)="onKeyDown($event)"
|
|
2102
|
+
>
|
|
2103
|
+
@for (star of stars(); track star) {
|
|
2104
|
+
<span
|
|
2105
|
+
class="rating-star"
|
|
2106
|
+
[class.filled]="(hovered() || current()) >= star"
|
|
2107
|
+
[class.hovered]="hovered() >= star"
|
|
2108
|
+
(mouseenter)="readonly() ? null : hovered.set(star)"
|
|
2109
|
+
(mouseleave)="readonly() ? null : hovered.set(0)"
|
|
2110
|
+
(click)="readonly() ? null : setRating(star)"
|
|
2111
|
+
>
|
|
2112
|
+
@if ((hovered() || current()) >= star) {
|
|
2113
|
+
★
|
|
2114
|
+
} @else {
|
|
2115
|
+
☆
|
|
2116
|
+
}
|
|
2117
|
+
</span>
|
|
2118
|
+
}
|
|
2119
|
+
</div>
|
|
2120
|
+
@if (showValue()) {
|
|
2121
|
+
<span class="rating-value">{{ current() }}/{{ max() }}</span>
|
|
1722
2122
|
}
|
|
1723
2123
|
</div>
|
|
1724
|
-
|
|
2124
|
+
|
|
2125
|
+
@if (error()) {
|
|
2126
|
+
<div class="ngx-rating-error">{{ error() }}</div>
|
|
2127
|
+
} @else if (hint()) {
|
|
2128
|
+
<div class="ngx-rating-hint">{{ hint() }}</div>
|
|
2129
|
+
}
|
|
1725
2130
|
</div>
|
|
1726
|
-
`, styles: [":host{display:inline-block}.ngx-rating{display:
|
|
2131
|
+
`, styles: [":host{display:inline-block;--ngx-input-success-border: #10b981;--ngx-input-success-shadow: 0 0 0 3px rgba(16, 185, 129, .2);--ngx-input-warning-border: #f59e0b;--ngx-input-warning-shadow: 0 0 0 3px rgba(245, 158, 11, .2);--ngx-input-error-border: #ef4444;--ngx-input-error-shadow: 0 0 0 3px rgba(239, 68, 68, .2);--ngx-rating-empty: #cbd5e1;--ngx-rating-filled: #f59e0b;--ngx-rating-hover: #d97706;--ngx-rating-text: #64748b}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-rating-empty: #475569;--ngx-rating-filled: #fbbf24;--ngx-rating-hover: #f59e0b;--ngx-rating-text: #94a3b8;--ngx-input-success-border: #34d399;--ngx-input-success-shadow: 0 0 0 3px rgba(52, 211, 153, .3);--ngx-input-warning-border: #fbbf24;--ngx-input-warning-shadow: 0 0 0 3px rgba(251, 191, 36, .3);--ngx-input-error-border: #f87171;--ngx-input-error-shadow: 0 0 0 3px rgba(248, 113, 113, .3)}.ngx-rating-container{display:flex;flex-direction:column;gap:4px;font-family:inherit}.rating-label{font-size:13px;font-weight:600;color:var(--ngx-rating-text);margin-bottom:2px}.ngx-rating-row{display:flex;align-items:center;gap:10px}.rating-stars{display:flex;gap:4px;padding:4px 8px;border-radius:8px;border:1px solid transparent;outline:none;transition:all .2s cubic-bezier(.4,0,.2,1)}.rating-stars:focus-visible{border-color:#cbd5e1;box-shadow:0 0 0 3px #4f46e526;background:#4f46e508}:host-context(.dark) .rating-stars:focus-visible,:host-context(.dark-theme) .rating-stars:focus-visible{border-color:#475569;background:#818cf80d}.rating-star{font-size:24px;line-height:1;color:var(--ngx-rating-empty);cursor:pointer;-webkit-user-select:none;user-select:none;transition:color .15s ease,transform .15s cubic-bezier(.34,1.56,.64,1)}.disabled .rating-star{cursor:not-allowed;opacity:.75}.rating-star.filled{color:var(--ngx-rating-filled)}.rating-star.hovered{color:var(--ngx-rating-hover);transform:scale(1.25) rotate(5deg)}.rating-value{font-size:13px;font-weight:600;color:var(--ngx-rating-text);min-width:32px}.status-success .rating-stars:focus-visible{box-shadow:var(--ngx-input-success-shadow);border-color:var(--ngx-input-success-border)}.status-warning .rating-stars:focus-visible{box-shadow:var(--ngx-input-warning-shadow);border-color:var(--ngx-input-warning-border)}.has-error .rating-stars:focus-visible{box-shadow:var(--ngx-input-error-shadow);border-color:var(--ngx-input-error-border)}.ngx-rating-error{color:var(--ngx-input-error-border);font-size:12px;font-weight:550;margin-left:10px;animation:slide-down .2s ease-out}.ngx-rating-hint{color:#64748b;font-size:12px;margin-left:10px}@keyframes slide-down{0%{transform:translateY(-4px);opacity:0}to{transform:translateY(0);opacity:1}}\n"] }]
|
|
1727
2132
|
}] });
|
|
1728
2133
|
|
|
1729
2134
|
class NumericTextBoxComponent {
|
|
@@ -1738,7 +2143,16 @@ class NumericTextBoxComponent {
|
|
|
1738
2143
|
prefix = input('');
|
|
1739
2144
|
suffix = input('');
|
|
1740
2145
|
focused = signal(false);
|
|
2146
|
+
// Enterprise validation inputs
|
|
2147
|
+
status = input('default');
|
|
2148
|
+
error = input('');
|
|
2149
|
+
hint = input('');
|
|
1741
2150
|
valueChange = output();
|
|
2151
|
+
_resolvedStatus = computed(() => {
|
|
2152
|
+
if (this.error())
|
|
2153
|
+
return 'error';
|
|
2154
|
+
return this.status();
|
|
2155
|
+
});
|
|
1742
2156
|
onChangeFn = () => { };
|
|
1743
2157
|
onTouchedFn = () => { };
|
|
1744
2158
|
constructor() {
|
|
@@ -1798,33 +2212,64 @@ class NumericTextBoxComponent {
|
|
|
1798
2212
|
// Handled at form control template level
|
|
1799
2213
|
}
|
|
1800
2214
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: NumericTextBoxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1801
|
-
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: [
|
|
2215
|
+
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 }, status: { classPropertyName: "status", publicName: "status", 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 } }, outputs: { valueChange: "valueChange" }, providers: [
|
|
1802
2216
|
{
|
|
1803
2217
|
provide: NG_VALUE_ACCESSOR,
|
|
1804
2218
|
useExisting: forwardRef(() => NumericTextBoxComponent),
|
|
1805
2219
|
multi: true
|
|
1806
2220
|
}
|
|
1807
2221
|
], ngImport: i0, template: `
|
|
1808
|
-
<div class="ngx-numeric" [class.disabled]="disabled()">
|
|
2222
|
+
<div class="ngx-numeric" [class.disabled]="disabled()" [class.focused]="focused()" [class.has-error]="_resolvedStatus() === 'error'">
|
|
1809
2223
|
@if (label()) { <label class="numeric-label">{{ label() }}</label> }
|
|
1810
|
-
<div class="numeric-input-wrap" [class
|
|
2224
|
+
<div class="numeric-input-wrap" [class]="'status-' + _resolvedStatus()">
|
|
2225
|
+
<ng-content select="[prefix]" />
|
|
1811
2226
|
@if (prefix()) { <span class="numeric-prefix">{{ prefix() }}</span> }
|
|
1812
2227
|
<input
|
|
1813
2228
|
type="number" class="numeric-input"
|
|
1814
2229
|
[min]="min()" [max]="max()" [step]="step()"
|
|
1815
2230
|
[value]="currentValue()" [disabled]="disabled()" [placeholder]="placeholder()"
|
|
2231
|
+
[attr.aria-invalid]="_resolvedStatus() === 'error' ? 'true' : null"
|
|
1816
2232
|
(focus)="focused.set(true)" (blur)="onBlur()"
|
|
1817
2233
|
(keydown)="onKeyDown($event)"
|
|
1818
2234
|
(change)="onChange($event)"
|
|
1819
2235
|
/>
|
|
2236
|
+
|
|
2237
|
+
<!-- Status Indicator Icons -->
|
|
2238
|
+
@if (_resolvedStatus() === 'success') {
|
|
2239
|
+
<span class="status-icon status-icon-success" aria-hidden="true">
|
|
2240
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>
|
|
2241
|
+
</span>
|
|
2242
|
+
} @else if (_resolvedStatus() === 'warning') {
|
|
2243
|
+
<span class="status-icon status-icon-warning" aria-hidden="true">
|
|
2244
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>
|
|
2245
|
+
</span>
|
|
2246
|
+
} @else if (_resolvedStatus() === 'error') {
|
|
2247
|
+
<span class="status-icon status-icon-error" aria-hidden="true">
|
|
2248
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
|
2249
|
+
</span>
|
|
2250
|
+
}
|
|
2251
|
+
|
|
1820
2252
|
@if (suffix()) { <span class="numeric-suffix">{{ suffix() }}</span> }
|
|
2253
|
+
<ng-content select="[suffix]" />
|
|
1821
2254
|
<div class="numeric-spin">
|
|
1822
|
-
<button class="spin-btn" type="button" [disabled]="disabled() || currentValue() >= max()" (click)="spin(1)"
|
|
1823
|
-
|
|
2255
|
+
<button class="spin-btn spin-up" type="button" [disabled]="disabled() || currentValue() >= max()" (click)="spin(1)" aria-label="Increase value">
|
|
2256
|
+
<svg viewBox="0 0 24 24" width="8" height="8" fill="currentColor"><path d="M12 8l-6 6h12z"/></svg>
|
|
2257
|
+
</button>
|
|
2258
|
+
<button class="spin-btn spin-down" type="button" [disabled]="disabled() || currentValue() <= min()" (click)="spin(-1)" aria-label="Decrease value">
|
|
2259
|
+
<svg viewBox="0 0 24 24" width="8" height="8" fill="currentColor"><path d="M12 16l6-6H6z"/></svg>
|
|
2260
|
+
</button>
|
|
1824
2261
|
</div>
|
|
1825
2262
|
</div>
|
|
2263
|
+
|
|
2264
|
+
<div class="numeric-footer">
|
|
2265
|
+
@if (error()) {
|
|
2266
|
+
<div class="numeric-error">{{ error() }}</div>
|
|
2267
|
+
} @else if (hint()) {
|
|
2268
|
+
<div class="numeric-hint">{{ hint() }}</div>
|
|
2269
|
+
}
|
|
2270
|
+
</div>
|
|
1826
2271
|
</div>
|
|
1827
|
-
`, isInline: true, styles: [":host{display:block}.ngx-numeric{width:100
|
|
2272
|
+
`, isInline: true, styles: [":host{display:block;--ngx-input-bg: #ffffff;--ngx-input-text: #0f172a;--ngx-input-border: #cbd5e1;--ngx-input-focus-border: #4f46e5;--ngx-input-focus-shadow: 0 0 0 3px rgba(79, 70, 229, .15);--ngx-input-disabled-bg: #f1f5f9;--ngx-input-label: #475569;--ngx-input-label-active: #4f46e5;--ngx-input-placeholder: #94a3b8;--ngx-input-success-border: #10b981;--ngx-input-success-shadow: 0 0 0 3px rgba(16, 185, 129, .15);--ngx-input-warning-border: #f59e0b;--ngx-input-warning-shadow: 0 0 0 3px rgba(245, 158, 11, .15);--ngx-input-error-border: #ef4444;--ngx-input-error-shadow: 0 0 0 3px rgba(239, 68, 68, .15)}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-input-bg: #0f172a;--ngx-input-text: #f8fafc;--ngx-input-border: #334155;--ngx-input-focus-border: #818cf8;--ngx-input-focus-shadow: 0 0 0 3px rgba(129, 140, 248, .25);--ngx-input-disabled-bg: #1e293b;--ngx-input-label: #94a3b8;--ngx-input-label-active: #818cf8;--ngx-input-placeholder: #475569;--ngx-input-success-border: #34d399;--ngx-input-success-shadow: 0 0 0 3px rgba(52, 211, 153, .25);--ngx-input-warning-border: #fbbf24;--ngx-input-warning-shadow: 0 0 0 3px rgba(251, 191, 36, .25);--ngx-input-error-border: #f87171;--ngx-input-error-shadow: 0 0 0 3px rgba(248, 113, 113, .25)}.ngx-numeric{width:100%;font-family:inherit}.numeric-label{display:inline-flex;align-items:center;font-size:12px;font-weight:600;color:var(--ngx-input-label);margin-bottom:6px;transition:all .2s cubic-bezier(.4,0,.2,1)}.focused .numeric-label{color:var(--ngx-input-label-active);transform:translate(2px)}.numeric-input-wrap{display:flex;align-items:center;border:1px solid var(--ngx-input-border);border-radius:var(--ngx-input-radius, 8px);background:var(--ngx-input-bg);overflow:hidden;transition:all .2s cubic-bezier(.4,0,.2,1);box-shadow:0 1px 2px #0000000d}.focused .numeric-input-wrap{border-color:var(--ngx-input-focus-border);box-shadow:var(--ngx-input-focus-shadow),0 1px 2px #0000000d}.numeric-input-wrap.status-success{border-color:var(--ngx-input-success-border)}.focused .numeric-input-wrap.status-success{box-shadow:var(--ngx-input-success-shadow),0 1px 2px #0000000d}.numeric-input-wrap.status-warning{border-color:var(--ngx-input-warning-border)}.focused .numeric-input-wrap.status-warning{box-shadow:var(--ngx-input-warning-shadow),0 1px 2px #0000000d}.numeric-input-wrap.status-error{border-color:var(--ngx-input-error-border)}.focused .numeric-input-wrap.status-error{box-shadow:var(--ngx-input-error-shadow),0 1px 2px #0000000d}.disabled .numeric-input-wrap{background:var(--ngx-input-disabled-bg);cursor:not-allowed;opacity:.7;box-shadow:none}.numeric-input{flex:1;padding:10px 14px;border:none;background:transparent;font-size:14px;color:var(--ngx-input-text);outline:none;min-width:0;-moz-appearance:textfield}.numeric-input::placeholder{color:var(--ngx-input-placeholder);opacity:.8}.numeric-input::-webkit-outer-spin-button,.numeric-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.numeric-input:disabled{cursor:not-allowed}.status-icon{display:inline-flex;align-items:center;justify-content:center;padding:0 8px;flex-shrink:0;animation:icon-scale-in .2s cubic-bezier(.175,.885,.32,1.275) forwards}.status-icon-success{color:var(--ngx-input-success-border)}.status-icon-warning{color:var(--ngx-input-warning-border)}.status-icon-error{color:var(--ngx-input-error-border)}@keyframes icon-scale-in{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}.numeric-prefix,.numeric-suffix{padding:0 10px;color:var(--ngx-input-label);font-size:14px;flex-shrink:0}.numeric-spin{display:flex;flex-direction:column;border-left:1px solid var(--ngx-input-border);align-self:stretch}.spin-btn{border:none;background:transparent;cursor:pointer;padding:0 10px;color:var(--ngx-input-label);flex:1;display:inline-flex;align-items:center;justify-content:center;transition:all .15s}.spin-btn:hover:not(:disabled){background:#4f46e514;color:var(--ngx-input-label-active)}.spin-btn:active:not(:disabled){background:#4f46e526}.spin-btn:disabled{opacity:.4;cursor:not-allowed}.spin-up{border-bottom:.5px solid var(--ngx-input-border)}.numeric-footer{margin-top:5px;font-size:12px}.numeric-error{color:var(--ngx-input-error-border);font-weight:550;animation:slide-down .2s ease-out}.numeric-hint{color:var(--ngx-input-label)}@keyframes slide-down{0%{transform:translateY(-4px);opacity:0}to{transform:translateY(0);opacity:1}}\n"] });
|
|
1828
2273
|
}
|
|
1829
2274
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: NumericTextBoxComponent, decorators: [{
|
|
1830
2275
|
type: Component,
|
|
@@ -1835,26 +2280,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1835
2280
|
multi: true
|
|
1836
2281
|
}
|
|
1837
2282
|
], template: `
|
|
1838
|
-
<div class="ngx-numeric" [class.disabled]="disabled()">
|
|
2283
|
+
<div class="ngx-numeric" [class.disabled]="disabled()" [class.focused]="focused()" [class.has-error]="_resolvedStatus() === 'error'">
|
|
1839
2284
|
@if (label()) { <label class="numeric-label">{{ label() }}</label> }
|
|
1840
|
-
<div class="numeric-input-wrap" [class
|
|
2285
|
+
<div class="numeric-input-wrap" [class]="'status-' + _resolvedStatus()">
|
|
2286
|
+
<ng-content select="[prefix]" />
|
|
1841
2287
|
@if (prefix()) { <span class="numeric-prefix">{{ prefix() }}</span> }
|
|
1842
2288
|
<input
|
|
1843
2289
|
type="number" class="numeric-input"
|
|
1844
2290
|
[min]="min()" [max]="max()" [step]="step()"
|
|
1845
2291
|
[value]="currentValue()" [disabled]="disabled()" [placeholder]="placeholder()"
|
|
2292
|
+
[attr.aria-invalid]="_resolvedStatus() === 'error' ? 'true' : null"
|
|
1846
2293
|
(focus)="focused.set(true)" (blur)="onBlur()"
|
|
1847
2294
|
(keydown)="onKeyDown($event)"
|
|
1848
2295
|
(change)="onChange($event)"
|
|
1849
2296
|
/>
|
|
2297
|
+
|
|
2298
|
+
<!-- Status Indicator Icons -->
|
|
2299
|
+
@if (_resolvedStatus() === 'success') {
|
|
2300
|
+
<span class="status-icon status-icon-success" aria-hidden="true">
|
|
2301
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>
|
|
2302
|
+
</span>
|
|
2303
|
+
} @else if (_resolvedStatus() === 'warning') {
|
|
2304
|
+
<span class="status-icon status-icon-warning" aria-hidden="true">
|
|
2305
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>
|
|
2306
|
+
</span>
|
|
2307
|
+
} @else if (_resolvedStatus() === 'error') {
|
|
2308
|
+
<span class="status-icon status-icon-error" aria-hidden="true">
|
|
2309
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
|
2310
|
+
</span>
|
|
2311
|
+
}
|
|
2312
|
+
|
|
1850
2313
|
@if (suffix()) { <span class="numeric-suffix">{{ suffix() }}</span> }
|
|
2314
|
+
<ng-content select="[suffix]" />
|
|
1851
2315
|
<div class="numeric-spin">
|
|
1852
|
-
<button class="spin-btn" type="button" [disabled]="disabled() || currentValue() >= max()" (click)="spin(1)"
|
|
1853
|
-
|
|
2316
|
+
<button class="spin-btn spin-up" type="button" [disabled]="disabled() || currentValue() >= max()" (click)="spin(1)" aria-label="Increase value">
|
|
2317
|
+
<svg viewBox="0 0 24 24" width="8" height="8" fill="currentColor"><path d="M12 8l-6 6h12z"/></svg>
|
|
2318
|
+
</button>
|
|
2319
|
+
<button class="spin-btn spin-down" type="button" [disabled]="disabled() || currentValue() <= min()" (click)="spin(-1)" aria-label="Decrease value">
|
|
2320
|
+
<svg viewBox="0 0 24 24" width="8" height="8" fill="currentColor"><path d="M12 16l6-6H6z"/></svg>
|
|
2321
|
+
</button>
|
|
1854
2322
|
</div>
|
|
1855
2323
|
</div>
|
|
2324
|
+
|
|
2325
|
+
<div class="numeric-footer">
|
|
2326
|
+
@if (error()) {
|
|
2327
|
+
<div class="numeric-error">{{ error() }}</div>
|
|
2328
|
+
} @else if (hint()) {
|
|
2329
|
+
<div class="numeric-hint">{{ hint() }}</div>
|
|
2330
|
+
}
|
|
2331
|
+
</div>
|
|
1856
2332
|
</div>
|
|
1857
|
-
`, styles: [":host{display:block}.ngx-numeric{width:100
|
|
2333
|
+
`, styles: [":host{display:block;--ngx-input-bg: #ffffff;--ngx-input-text: #0f172a;--ngx-input-border: #cbd5e1;--ngx-input-focus-border: #4f46e5;--ngx-input-focus-shadow: 0 0 0 3px rgba(79, 70, 229, .15);--ngx-input-disabled-bg: #f1f5f9;--ngx-input-label: #475569;--ngx-input-label-active: #4f46e5;--ngx-input-placeholder: #94a3b8;--ngx-input-success-border: #10b981;--ngx-input-success-shadow: 0 0 0 3px rgba(16, 185, 129, .15);--ngx-input-warning-border: #f59e0b;--ngx-input-warning-shadow: 0 0 0 3px rgba(245, 158, 11, .15);--ngx-input-error-border: #ef4444;--ngx-input-error-shadow: 0 0 0 3px rgba(239, 68, 68, .15)}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-input-bg: #0f172a;--ngx-input-text: #f8fafc;--ngx-input-border: #334155;--ngx-input-focus-border: #818cf8;--ngx-input-focus-shadow: 0 0 0 3px rgba(129, 140, 248, .25);--ngx-input-disabled-bg: #1e293b;--ngx-input-label: #94a3b8;--ngx-input-label-active: #818cf8;--ngx-input-placeholder: #475569;--ngx-input-success-border: #34d399;--ngx-input-success-shadow: 0 0 0 3px rgba(52, 211, 153, .25);--ngx-input-warning-border: #fbbf24;--ngx-input-warning-shadow: 0 0 0 3px rgba(251, 191, 36, .25);--ngx-input-error-border: #f87171;--ngx-input-error-shadow: 0 0 0 3px rgba(248, 113, 113, .25)}.ngx-numeric{width:100%;font-family:inherit}.numeric-label{display:inline-flex;align-items:center;font-size:12px;font-weight:600;color:var(--ngx-input-label);margin-bottom:6px;transition:all .2s cubic-bezier(.4,0,.2,1)}.focused .numeric-label{color:var(--ngx-input-label-active);transform:translate(2px)}.numeric-input-wrap{display:flex;align-items:center;border:1px solid var(--ngx-input-border);border-radius:var(--ngx-input-radius, 8px);background:var(--ngx-input-bg);overflow:hidden;transition:all .2s cubic-bezier(.4,0,.2,1);box-shadow:0 1px 2px #0000000d}.focused .numeric-input-wrap{border-color:var(--ngx-input-focus-border);box-shadow:var(--ngx-input-focus-shadow),0 1px 2px #0000000d}.numeric-input-wrap.status-success{border-color:var(--ngx-input-success-border)}.focused .numeric-input-wrap.status-success{box-shadow:var(--ngx-input-success-shadow),0 1px 2px #0000000d}.numeric-input-wrap.status-warning{border-color:var(--ngx-input-warning-border)}.focused .numeric-input-wrap.status-warning{box-shadow:var(--ngx-input-warning-shadow),0 1px 2px #0000000d}.numeric-input-wrap.status-error{border-color:var(--ngx-input-error-border)}.focused .numeric-input-wrap.status-error{box-shadow:var(--ngx-input-error-shadow),0 1px 2px #0000000d}.disabled .numeric-input-wrap{background:var(--ngx-input-disabled-bg);cursor:not-allowed;opacity:.7;box-shadow:none}.numeric-input{flex:1;padding:10px 14px;border:none;background:transparent;font-size:14px;color:var(--ngx-input-text);outline:none;min-width:0;-moz-appearance:textfield}.numeric-input::placeholder{color:var(--ngx-input-placeholder);opacity:.8}.numeric-input::-webkit-outer-spin-button,.numeric-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.numeric-input:disabled{cursor:not-allowed}.status-icon{display:inline-flex;align-items:center;justify-content:center;padding:0 8px;flex-shrink:0;animation:icon-scale-in .2s cubic-bezier(.175,.885,.32,1.275) forwards}.status-icon-success{color:var(--ngx-input-success-border)}.status-icon-warning{color:var(--ngx-input-warning-border)}.status-icon-error{color:var(--ngx-input-error-border)}@keyframes icon-scale-in{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}.numeric-prefix,.numeric-suffix{padding:0 10px;color:var(--ngx-input-label);font-size:14px;flex-shrink:0}.numeric-spin{display:flex;flex-direction:column;border-left:1px solid var(--ngx-input-border);align-self:stretch}.spin-btn{border:none;background:transparent;cursor:pointer;padding:0 10px;color:var(--ngx-input-label);flex:1;display:inline-flex;align-items:center;justify-content:center;transition:all .15s}.spin-btn:hover:not(:disabled){background:#4f46e514;color:var(--ngx-input-label-active)}.spin-btn:active:not(:disabled){background:#4f46e526}.spin-btn:disabled{opacity:.4;cursor:not-allowed}.spin-up{border-bottom:.5px solid var(--ngx-input-border)}.numeric-footer{margin-top:5px;font-size:12px}.numeric-error{color:var(--ngx-input-error-border);font-weight:550;animation:slide-down .2s ease-out}.numeric-hint{color:var(--ngx-input-label)}@keyframes slide-down{0%{transform:translateY(-4px);opacity:0}to{transform:translateY(0);opacity:1}}\n"] }]
|
|
1858
2334
|
}], ctorParameters: () => [] });
|
|
1859
2335
|
|
|
1860
2336
|
class TextareaComponent {
|
|
@@ -1868,25 +2344,59 @@ class TextareaComponent {
|
|
|
1868
2344
|
error = input('');
|
|
1869
2345
|
value = signal('');
|
|
1870
2346
|
focused = signal(false);
|
|
2347
|
+
// Enterprise status state
|
|
2348
|
+
status = input('default');
|
|
1871
2349
|
charCount = computed(() => this.value().length);
|
|
1872
2350
|
valueChange = output();
|
|
1873
|
-
|
|
2351
|
+
_resolvedStatus = computed(() => {
|
|
2352
|
+
if (this.error())
|
|
2353
|
+
return 'error';
|
|
2354
|
+
return this.status();
|
|
2355
|
+
});
|
|
2356
|
+
onInput(e) {
|
|
2357
|
+
const v = e.target.value;
|
|
2358
|
+
this.value.set(v);
|
|
2359
|
+
this.valueChange.emit(v);
|
|
2360
|
+
}
|
|
1874
2361
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1875
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: TextareaComponent, isStandalone: true, selector: "ngx-textarea", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", 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 }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, autoResize: { classPropertyName: "autoResize", publicName: "autoResize", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
1876
|
-
<div class="ngx-textarea-
|
|
1877
|
-
@if (label()) {
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
[
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
2362
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: TextareaComponent, isStandalone: true, selector: "ngx-textarea", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", 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 }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, autoResize: { classPropertyName: "autoResize", publicName: "autoResize", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
2363
|
+
<div class="ngx-textarea-container" [class.focused]="focused()" [class.has-error]="_resolvedStatus() === 'error'" [class.disabled]="disabled()">
|
|
2364
|
+
@if (label()) {
|
|
2365
|
+
<label class="textarea-label">{{ label() }}</label>
|
|
2366
|
+
}
|
|
2367
|
+
<div class="ngx-textarea-wrap" [class]="'status-' + _resolvedStatus()">
|
|
2368
|
+
<ng-content select="[prefix]" />
|
|
2369
|
+
<textarea
|
|
2370
|
+
class="ngx-textarea"
|
|
2371
|
+
[rows]="rows()"
|
|
2372
|
+
[placeholder]="placeholder()"
|
|
2373
|
+
[disabled]="disabled()"
|
|
2374
|
+
[attr.maxlength]="maxlength() > 0 ? maxlength() : null"
|
|
2375
|
+
[value]="value()"
|
|
2376
|
+
[class.auto-resize]="autoResize()"
|
|
2377
|
+
[attr.aria-invalid]="_resolvedStatus() === 'error' ? 'true' : null"
|
|
2378
|
+
(input)="onInput($event)"
|
|
2379
|
+
(focus)="focused.set(true)"
|
|
2380
|
+
(blur)="focused.set(false)"
|
|
2381
|
+
></textarea>
|
|
2382
|
+
|
|
2383
|
+
<!-- Status Indicator Icons -->
|
|
2384
|
+
@if (_resolvedStatus() === 'success') {
|
|
2385
|
+
<span class="status-icon status-icon-success" aria-hidden="true">
|
|
2386
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>
|
|
2387
|
+
</span>
|
|
2388
|
+
} @else if (_resolvedStatus() === 'warning') {
|
|
2389
|
+
<span class="status-icon status-icon-warning" aria-hidden="true">
|
|
2390
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>
|
|
2391
|
+
</span>
|
|
2392
|
+
} @else if (_resolvedStatus() === 'error') {
|
|
2393
|
+
<span class="status-icon status-icon-error" aria-hidden="true">
|
|
2394
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
|
2395
|
+
</span>
|
|
2396
|
+
}
|
|
2397
|
+
<ng-content select="[suffix]" />
|
|
2398
|
+
</div>
|
|
2399
|
+
|
|
1890
2400
|
<div class="textarea-footer">
|
|
1891
2401
|
@if (error()) { <span class="textarea-error">{{ error() }}</span> }
|
|
1892
2402
|
@else if (hint()) { <span class="textarea-hint">{{ hint() }}</span> }
|
|
@@ -1894,25 +2404,48 @@ class TextareaComponent {
|
|
|
1894
2404
|
@if (maxlength() > 0) { <span class="textarea-counter" [class.near-limit]="charCount() > maxlength() * 0.8">{{ charCount() }}/{{ maxlength() }}</span> }
|
|
1895
2405
|
</div>
|
|
1896
2406
|
</div>
|
|
1897
|
-
`, isInline: true, styles: [":host{display:block}.ngx-textarea-
|
|
2407
|
+
`, isInline: true, styles: [":host{display:block;--ngx-input-bg: #ffffff;--ngx-input-text: #0f172a;--ngx-input-border: #cbd5e1;--ngx-input-focus-border: #4f46e5;--ngx-input-focus-shadow: 0 0 0 3px rgba(79, 70, 229, .15);--ngx-input-disabled-bg: #f1f5f9;--ngx-input-label: #475569;--ngx-input-label-active: #4f46e5;--ngx-input-placeholder: #94a3b8;--ngx-input-success-border: #10b981;--ngx-input-success-shadow: 0 0 0 3px rgba(16, 185, 129, .15);--ngx-input-warning-border: #f59e0b;--ngx-input-warning-shadow: 0 0 0 3px rgba(245, 158, 11, .15);--ngx-input-error-border: #ef4444;--ngx-input-error-shadow: 0 0 0 3px rgba(239, 68, 68, .15)}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-input-bg: #0f172a;--ngx-input-text: #f8fafc;--ngx-input-border: #334155;--ngx-input-focus-border: #818cf8;--ngx-input-focus-shadow: 0 0 0 3px rgba(129, 140, 248, .25);--ngx-input-disabled-bg: #1e293b;--ngx-input-label: #94a3b8;--ngx-input-label-active: #818cf8;--ngx-input-placeholder: #475569;--ngx-input-success-border: #34d399;--ngx-input-success-shadow: 0 0 0 3px rgba(52, 211, 153, .25);--ngx-input-warning-border: #fbbf24;--ngx-input-warning-shadow: 0 0 0 3px rgba(251, 191, 36, .25);--ngx-input-error-border: #f87171;--ngx-input-error-shadow: 0 0 0 3px rgba(248, 113, 113, .25)}.ngx-textarea-container{position:relative;font-family:inherit}.textarea-label{display:inline-flex;align-items:center;font-size:12px;font-weight:600;color:var(--ngx-input-label);margin-bottom:6px;transition:all .2s cubic-bezier(.4,0,.2,1)}.focused .textarea-label{color:var(--ngx-input-label-active);transform:translate(2px)}.ngx-textarea-wrap{position:relative;display:flex;align-items:flex-start;border:1px solid var(--ngx-input-border);border-radius:var(--ngx-input-radius, 8px);background:var(--ngx-input-bg);transition:all .2s cubic-bezier(.4,0,.2,1);box-shadow:0 1px 2px #0000000d}.focused .ngx-textarea-wrap{border-color:var(--ngx-input-focus-border);box-shadow:var(--ngx-input-focus-shadow),0 1px 2px #0000000d}.ngx-textarea-wrap.status-success{border-color:var(--ngx-input-success-border)}.focused .ngx-textarea-wrap.status-success{box-shadow:var(--ngx-input-success-shadow),0 1px 2px #0000000d}.ngx-textarea-wrap.status-warning{border-color:var(--ngx-input-warning-border)}.focused .ngx-textarea-wrap.status-warning{box-shadow:var(--ngx-input-warning-shadow),0 1px 2px #0000000d}.ngx-textarea-wrap.status-error{border-color:var(--ngx-input-error-border)}.focused .ngx-textarea-wrap.status-error{box-shadow:var(--ngx-input-error-shadow),0 1px 2px #0000000d}.disabled .ngx-textarea-wrap{background:var(--ngx-input-disabled-bg);cursor:not-allowed;opacity:.7;box-shadow:none}.ngx-textarea{flex:1;min-width:0;padding:10px 14px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text);font-family:inherit;resize:vertical;box-sizing:border-box}.ngx-textarea::placeholder{color:var(--ngx-input-placeholder);opacity:.8}.ngx-textarea:disabled{cursor:not-allowed}.status-icon{display:inline-flex;align-items:center;justify-content:center;padding:10px 12px 0 0;flex-shrink:0;animation:icon-scale-in .2s cubic-bezier(.175,.885,.32,1.275) forwards}.status-icon-success{color:var(--ngx-input-success-border)}.status-icon-warning{color:var(--ngx-input-warning-border)}.status-icon-error{color:var(--ngx-input-error-border)}@keyframes icon-scale-in{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}.textarea-footer{display:flex;justify-content:space-between;align-items:flex-start;margin-top:5px;font-size:12px}.textarea-error{color:var(--ngx-input-error-border);font-weight:550;animation:slide-down .2s ease-out}.textarea-hint{color:var(--ngx-input-label)}.textarea-counter{color:var(--ngx-input-label);font-size:11px;margin-left:auto}.textarea-counter.near-limit{color:var(--ngx-input-error-border);font-weight:600}@keyframes slide-down{0%{transform:translateY(-4px);opacity:0}to{transform:translateY(0);opacity:1}}\n"] });
|
|
1898
2408
|
}
|
|
1899
2409
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
1900
2410
|
type: Component,
|
|
1901
2411
|
args: [{ selector: 'ngx-textarea', standalone: true, template: `
|
|
1902
|
-
<div class="ngx-textarea-
|
|
1903
|
-
@if (label()) {
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
[
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
2412
|
+
<div class="ngx-textarea-container" [class.focused]="focused()" [class.has-error]="_resolvedStatus() === 'error'" [class.disabled]="disabled()">
|
|
2413
|
+
@if (label()) {
|
|
2414
|
+
<label class="textarea-label">{{ label() }}</label>
|
|
2415
|
+
}
|
|
2416
|
+
<div class="ngx-textarea-wrap" [class]="'status-' + _resolvedStatus()">
|
|
2417
|
+
<ng-content select="[prefix]" />
|
|
2418
|
+
<textarea
|
|
2419
|
+
class="ngx-textarea"
|
|
2420
|
+
[rows]="rows()"
|
|
2421
|
+
[placeholder]="placeholder()"
|
|
2422
|
+
[disabled]="disabled()"
|
|
2423
|
+
[attr.maxlength]="maxlength() > 0 ? maxlength() : null"
|
|
2424
|
+
[value]="value()"
|
|
2425
|
+
[class.auto-resize]="autoResize()"
|
|
2426
|
+
[attr.aria-invalid]="_resolvedStatus() === 'error' ? 'true' : null"
|
|
2427
|
+
(input)="onInput($event)"
|
|
2428
|
+
(focus)="focused.set(true)"
|
|
2429
|
+
(blur)="focused.set(false)"
|
|
2430
|
+
></textarea>
|
|
2431
|
+
|
|
2432
|
+
<!-- Status Indicator Icons -->
|
|
2433
|
+
@if (_resolvedStatus() === 'success') {
|
|
2434
|
+
<span class="status-icon status-icon-success" aria-hidden="true">
|
|
2435
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>
|
|
2436
|
+
</span>
|
|
2437
|
+
} @else if (_resolvedStatus() === 'warning') {
|
|
2438
|
+
<span class="status-icon status-icon-warning" aria-hidden="true">
|
|
2439
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg>
|
|
2440
|
+
</span>
|
|
2441
|
+
} @else if (_resolvedStatus() === 'error') {
|
|
2442
|
+
<span class="status-icon status-icon-error" aria-hidden="true">
|
|
2443
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
|
2444
|
+
</span>
|
|
2445
|
+
}
|
|
2446
|
+
<ng-content select="[suffix]" />
|
|
2447
|
+
</div>
|
|
2448
|
+
|
|
1916
2449
|
<div class="textarea-footer">
|
|
1917
2450
|
@if (error()) { <span class="textarea-error">{{ error() }}</span> }
|
|
1918
2451
|
@else if (hint()) { <span class="textarea-hint">{{ hint() }}</span> }
|
|
@@ -1920,7 +2453,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1920
2453
|
@if (maxlength() > 0) { <span class="textarea-counter" [class.near-limit]="charCount() > maxlength() * 0.8">{{ charCount() }}/{{ maxlength() }}</span> }
|
|
1921
2454
|
</div>
|
|
1922
2455
|
</div>
|
|
1923
|
-
`, styles: [":host{display:block}.ngx-textarea-
|
|
2456
|
+
`, styles: [":host{display:block;--ngx-input-bg: #ffffff;--ngx-input-text: #0f172a;--ngx-input-border: #cbd5e1;--ngx-input-focus-border: #4f46e5;--ngx-input-focus-shadow: 0 0 0 3px rgba(79, 70, 229, .15);--ngx-input-disabled-bg: #f1f5f9;--ngx-input-label: #475569;--ngx-input-label-active: #4f46e5;--ngx-input-placeholder: #94a3b8;--ngx-input-success-border: #10b981;--ngx-input-success-shadow: 0 0 0 3px rgba(16, 185, 129, .15);--ngx-input-warning-border: #f59e0b;--ngx-input-warning-shadow: 0 0 0 3px rgba(245, 158, 11, .15);--ngx-input-error-border: #ef4444;--ngx-input-error-shadow: 0 0 0 3px rgba(239, 68, 68, .15)}:host-context(body.dark),:host-context(.dark),:host-context(.dark-theme){--ngx-input-bg: #0f172a;--ngx-input-text: #f8fafc;--ngx-input-border: #334155;--ngx-input-focus-border: #818cf8;--ngx-input-focus-shadow: 0 0 0 3px rgba(129, 140, 248, .25);--ngx-input-disabled-bg: #1e293b;--ngx-input-label: #94a3b8;--ngx-input-label-active: #818cf8;--ngx-input-placeholder: #475569;--ngx-input-success-border: #34d399;--ngx-input-success-shadow: 0 0 0 3px rgba(52, 211, 153, .25);--ngx-input-warning-border: #fbbf24;--ngx-input-warning-shadow: 0 0 0 3px rgba(251, 191, 36, .25);--ngx-input-error-border: #f87171;--ngx-input-error-shadow: 0 0 0 3px rgba(248, 113, 113, .25)}.ngx-textarea-container{position:relative;font-family:inherit}.textarea-label{display:inline-flex;align-items:center;font-size:12px;font-weight:600;color:var(--ngx-input-label);margin-bottom:6px;transition:all .2s cubic-bezier(.4,0,.2,1)}.focused .textarea-label{color:var(--ngx-input-label-active);transform:translate(2px)}.ngx-textarea-wrap{position:relative;display:flex;align-items:flex-start;border:1px solid var(--ngx-input-border);border-radius:var(--ngx-input-radius, 8px);background:var(--ngx-input-bg);transition:all .2s cubic-bezier(.4,0,.2,1);box-shadow:0 1px 2px #0000000d}.focused .ngx-textarea-wrap{border-color:var(--ngx-input-focus-border);box-shadow:var(--ngx-input-focus-shadow),0 1px 2px #0000000d}.ngx-textarea-wrap.status-success{border-color:var(--ngx-input-success-border)}.focused .ngx-textarea-wrap.status-success{box-shadow:var(--ngx-input-success-shadow),0 1px 2px #0000000d}.ngx-textarea-wrap.status-warning{border-color:var(--ngx-input-warning-border)}.focused .ngx-textarea-wrap.status-warning{box-shadow:var(--ngx-input-warning-shadow),0 1px 2px #0000000d}.ngx-textarea-wrap.status-error{border-color:var(--ngx-input-error-border)}.focused .ngx-textarea-wrap.status-error{box-shadow:var(--ngx-input-error-shadow),0 1px 2px #0000000d}.disabled .ngx-textarea-wrap{background:var(--ngx-input-disabled-bg);cursor:not-allowed;opacity:.7;box-shadow:none}.ngx-textarea{flex:1;min-width:0;padding:10px 14px;border:none;outline:none;background:transparent;font-size:14px;color:var(--ngx-input-text);font-family:inherit;resize:vertical;box-sizing:border-box}.ngx-textarea::placeholder{color:var(--ngx-input-placeholder);opacity:.8}.ngx-textarea:disabled{cursor:not-allowed}.status-icon{display:inline-flex;align-items:center;justify-content:center;padding:10px 12px 0 0;flex-shrink:0;animation:icon-scale-in .2s cubic-bezier(.175,.885,.32,1.275) forwards}.status-icon-success{color:var(--ngx-input-success-border)}.status-icon-warning{color:var(--ngx-input-warning-border)}.status-icon-error{color:var(--ngx-input-error-border)}@keyframes icon-scale-in{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}.textarea-footer{display:flex;justify-content:space-between;align-items:flex-start;margin-top:5px;font-size:12px}.textarea-error{color:var(--ngx-input-error-border);font-weight:550;animation:slide-down .2s ease-out}.textarea-hint{color:var(--ngx-input-label)}.textarea-counter{color:var(--ngx-input-label);font-size:11px;margin-left:auto}.textarea-counter.near-limit{color:var(--ngx-input-error-border);font-weight:600}@keyframes slide-down{0%{transform:translateY(-4px);opacity:0}to{transform:translateY(0);opacity:1}}\n"] }]
|
|
1924
2457
|
}] });
|
|
1925
2458
|
|
|
1926
2459
|
const COLORS = [
|