@jdpo2008/ngx-ds 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/fesm2022/jdpo2008-ngx-ds.mjs +1079 -112
- package/fesm2022/jdpo2008-ngx-ds.mjs.map +1 -1
- package/package.json +1 -1
- package/types/jdpo2008-ngx-ds.d.ts +361 -12
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, Injectable, InjectionToken, inject, provideAppInitializer, makeEnvironmentProviders, DOCUMENT, DestroyRef, ElementRef, Directive, input, ChangeDetectionStrategy, Component, computed, output, ViewEncapsulation, ApplicationRef, EnvironmentInjector, createComponent, model, forwardRef, Renderer2, viewChild, Injector, afterNextRender, effect, untracked, viewChildren, contentChildren, afterRenderEffect, TemplateRef, contentChild
|
|
3
|
-
import { DOCUMENT as DOCUMENT$1,
|
|
2
|
+
import { signal, Injectable, InjectionToken, inject, provideAppInitializer, makeEnvironmentProviders, DOCUMENT, DestroyRef, ElementRef, Directive, input, ChangeDetectionStrategy, Component, computed, output, ViewEncapsulation, ApplicationRef, EnvironmentInjector, createComponent, model, forwardRef, Renderer2, viewChild, Injector, afterNextRender, effect, untracked, viewChildren, contentChildren, afterRenderEffect, linkedSignal, TemplateRef, contentChild } from '@angular/core';
|
|
3
|
+
import { DOCUMENT as DOCUMENT$1, NgTemplateOutlet, CommonModule } from '@angular/common';
|
|
4
4
|
import * as i1 from 'lucide-angular';
|
|
5
|
-
import { LucideAngularModule, X, EyeOff, Eye, ChevronDown, ChevronUp, Check, Search, Calendar, ChevronLeft, ChevronRight, AlertCircle, AlertTriangle, CheckCircle2, Info, Upload, FileImage, FileVideo, FileText, File, Plus, Minus, Star, Columns3, MoreVertical, ArrowUpDown, ArrowDown, ArrowUp, Inbox, CheckCircle, Bell, BellOff, PanelLeftOpen, PanelLeftClose } from 'lucide-angular';
|
|
5
|
+
import { LucideAngularModule, X, EyeOff, Eye, ChevronDown, ChevronUp, Check, Search, Calendar, ChevronLeft, ChevronRight, AlertCircle, AlertTriangle, CheckCircle2, Info, Upload, FileImage, FileVideo, FileText, File, Plus, Minus, Star, Clock, Columns3, MoreVertical, ArrowUpDown, ArrowDown, ArrowUp, Inbox, CheckCircle, Bell, BellOff, PanelLeftOpen, PanelLeftClose, Play, Pause } from 'lucide-angular';
|
|
6
6
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
7
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
8
8
|
|
|
@@ -113,6 +113,12 @@ const NGX_DS_LABELS_ES = {
|
|
|
113
113
|
prevMonth: 'Mes anterior',
|
|
114
114
|
nextMonth: 'Mes siguiente',
|
|
115
115
|
selectDateRange: 'Seleccionar rango de fechas',
|
|
116
|
+
timePlaceholder: 'HH:MM',
|
|
117
|
+
selectTime: 'Seleccionar hora',
|
|
118
|
+
clearTime: 'Limpiar hora',
|
|
119
|
+
hours: 'Horas',
|
|
120
|
+
minutes: 'Minutos',
|
|
121
|
+
timePeriod: 'AM/PM',
|
|
116
122
|
pagination: 'Paginación',
|
|
117
123
|
prevPage: 'Página anterior',
|
|
118
124
|
nextPage: 'Página siguiente',
|
|
@@ -154,6 +160,16 @@ const NGX_DS_LABELS_ES = {
|
|
|
154
160
|
daysAgo: (n) => `Hace ${n} d`,
|
|
155
161
|
confirm: 'Confirmar',
|
|
156
162
|
cancel: 'Cancelar',
|
|
163
|
+
carousel: 'Carrusel',
|
|
164
|
+
slide: 'Diapositiva',
|
|
165
|
+
prevSlide: 'Diapositiva anterior',
|
|
166
|
+
nextSlide: 'Diapositiva siguiente',
|
|
167
|
+
goToSlide: (n) => `Ir a la diapositiva ${n}`,
|
|
168
|
+
slideOf: (n, total) => `${n} de ${total}`,
|
|
169
|
+
pauseAutoplay: 'Pausar la reproducción automática',
|
|
170
|
+
playAutoplay: 'Reanudar la reproducción automática',
|
|
171
|
+
lightbox: 'Visor de imágenes',
|
|
172
|
+
resizePanels: 'Redimensionar paneles',
|
|
157
173
|
};
|
|
158
174
|
const NGX_DS_LABELS_EN = {
|
|
159
175
|
close: 'Close',
|
|
@@ -209,6 +225,12 @@ const NGX_DS_LABELS_EN = {
|
|
|
209
225
|
prevMonth: 'Previous month',
|
|
210
226
|
nextMonth: 'Next month',
|
|
211
227
|
selectDateRange: 'Select date range',
|
|
228
|
+
timePlaceholder: 'HH:MM',
|
|
229
|
+
selectTime: 'Select time',
|
|
230
|
+
clearTime: 'Clear time',
|
|
231
|
+
hours: 'Hours',
|
|
232
|
+
minutes: 'Minutes',
|
|
233
|
+
timePeriod: 'AM/PM',
|
|
212
234
|
pagination: 'Pagination',
|
|
213
235
|
prevPage: 'Previous page',
|
|
214
236
|
nextPage: 'Next page',
|
|
@@ -250,6 +272,16 @@ const NGX_DS_LABELS_EN = {
|
|
|
250
272
|
daysAgo: (n) => `${n} d ago`,
|
|
251
273
|
confirm: 'Confirm',
|
|
252
274
|
cancel: 'Cancel',
|
|
275
|
+
carousel: 'Carousel',
|
|
276
|
+
slide: 'Slide',
|
|
277
|
+
prevSlide: 'Previous slide',
|
|
278
|
+
nextSlide: 'Next slide',
|
|
279
|
+
goToSlide: (n) => `Go to slide ${n}`,
|
|
280
|
+
slideOf: (n, total) => `${n} of ${total}`,
|
|
281
|
+
pauseAutoplay: 'Pause autoplay',
|
|
282
|
+
playAutoplay: 'Resume autoplay',
|
|
283
|
+
lightbox: 'Image viewer',
|
|
284
|
+
resizePanels: 'Resize panels',
|
|
253
285
|
};
|
|
254
286
|
const NGX_DS_LABELS = new InjectionToken('NGX_DS_LABELS', {
|
|
255
287
|
providedIn: 'root',
|
|
@@ -497,7 +529,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
497
529
|
args: [{ selector: 'ngx-ds-spinner', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<span [class]=\"hostClasses()\" role=\"status\" [attr.aria-label]=\"i18n.loading\"></span>\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;line-height:0}.spinner{display:inline-block;border-radius:50%;border-style:solid;border-top-color:transparent!important;animation:ngx-spin .8s linear infinite}.spinner--xs{width:.875rem;height:.875rem;border-width:1.5px}.spinner--sm{width:1rem;height:1rem;border-width:2px}.spinner--md{width:1.25rem;height:1.25rem;border-width:2px}.spinner--lg{width:1.75rem;height:1.75rem;border-width:2.5px}.spinner--current{border-color:currentColor}.spinner--primary{border-color:var(--primary-500, #6366f1)}.spinner--secondary{border-color:var(--gray-500, #6b7280)}.spinner--danger{border-color:var(--danger-500, #ef4444)}.spinner--success{border-color:var(--success-500, #10b981)}.spinner--warning{border-color:var(--warning-500, #f59e0b)}@keyframes ngx-spin{to{transform:rotate(360deg)}}\n"] }]
|
|
498
530
|
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }] } });
|
|
499
531
|
|
|
500
|
-
const ICON_SIZE$
|
|
532
|
+
const ICON_SIZE$e = { sm: 14, md: 16, lg: 20 };
|
|
501
533
|
const SPINNER_SIZE = { sm: 'xs', md: 'sm', lg: 'md' };
|
|
502
534
|
class ButtonComponent {
|
|
503
535
|
variant = input('solid', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
@@ -522,7 +554,7 @@ class ButtonComponent {
|
|
|
522
554
|
classes.push('btn--loading');
|
|
523
555
|
return classes.join(' ');
|
|
524
556
|
}, ...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
525
|
-
iconSize = computed(() => ICON_SIZE$
|
|
557
|
+
iconSize = computed(() => ICON_SIZE$e[this.size()], ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
526
558
|
spinnerSize = computed(() => SPINNER_SIZE[this.size()], ...(ngDevMode ? [{ debugName: "spinnerSize" }] : /* istanbul ignore next */ []));
|
|
527
559
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
528
560
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: ButtonComponent, isStandalone: true, selector: "ngx-ds-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, iconLeft: { classPropertyName: "iconLeft", publicName: "iconLeft", isSignal: true, isRequired: false, transformFunction: null }, iconRight: { classPropertyName: "iconRight", publicName: "iconRight", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<button [type]=\"type()\" [class]=\"hostClasses()\" [disabled]=\"disabled() || loading() || null\">\n @if (loading()) {\n <ngx-ds-spinner class=\"btn__icon\" [size]=\"spinnerSize()\" color=\"current\" />\n } @else if (iconLeft()) {\n <ngx-ds-icon class=\"btn__icon\" [icon]=\"iconLeft()!\" [size]=\"iconSize()\" aria-hidden=\"true\" />\n }\n <ng-content />\n @if (!loading() && iconRight()) {\n <ngx-ds-icon class=\"btn__icon\" [icon]=\"iconRight()!\" [size]=\"iconSize()\" aria-hidden=\"true\" />\n }\n</button>\n", styles: [".btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif);font-weight:500;border-radius:.375rem;border:1.5px solid transparent;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease,filter .15s ease;white-space:nowrap;line-height:1;text-decoration:none;-webkit-user-select:none;user-select:none}.btn:focus-visible{outline:2px solid currentColor;outline-offset:2px}.btn:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.btn--sm{padding:.375rem .75rem;font-size:.75rem}.btn--md{padding:.5rem 1rem;font-size:.875rem}.btn--lg{padding:.75rem 1.5rem;font-size:1rem}.btn--rounded{border-radius:9999px}.btn__icon{flex-shrink:0}.btn--loading{cursor:wait;pointer-events:none;opacity:.85}.btn--primary.btn--solid{background-color:var(--primary-500, #6366f1);border-color:var(--primary-500, #6366f1);color:var(--text-on-color, #fff)}.btn--primary.btn--solid:hover:not(:disabled){filter:brightness(.88)}.btn--primary.btn--solid:active:not(:disabled){filter:brightness(.78)}.btn--primary.btn--outline{background-color:transparent;border-color:var(--primary-500, #6366f1);color:var(--primary-500, #6366f1)}.btn--primary.btn--outline:hover:not(:disabled){background-color:var(--primary-500, #6366f1);color:var(--text-on-color, #fff)}.btn--primary.btn--outline:active:not(:disabled){background-color:var(--primary-500, #6366f1);filter:brightness(.88);color:var(--text-on-color, #fff)}.btn--secondary.btn--solid{background-color:var(--fill-neutral, #6b7280);border-color:var(--fill-neutral, #6b7280);color:var(--text-on-color, #fff)}.btn--secondary.btn--solid:hover:not(:disabled){filter:brightness(.88)}.btn--secondary.btn--solid:active:not(:disabled){filter:brightness(.78)}.btn--secondary.btn--outline{background-color:transparent;border-color:var(--fill-neutral, #6b7280);color:var(--fill-neutral, #6b7280)}.btn--secondary.btn--outline:hover:not(:disabled){background-color:var(--fill-neutral, #6b7280);color:var(--text-on-color, #fff)}.btn--secondary.btn--outline:active:not(:disabled){background-color:var(--fill-neutral, #6b7280);filter:brightness(.88);color:var(--text-on-color, #fff)}.btn--danger.btn--solid{background-color:var(--danger-500, #ef4444);border-color:var(--danger-500, #ef4444);color:var(--text-on-color, #fff)}.btn--danger.btn--solid:hover:not(:disabled){filter:brightness(.88)}.btn--danger.btn--solid:active:not(:disabled){filter:brightness(.78)}.btn--danger.btn--outline{background-color:transparent;border-color:var(--danger-500, #ef4444);color:var(--danger-500, #ef4444)}.btn--danger.btn--outline:hover:not(:disabled){background-color:var(--danger-500, #ef4444);color:var(--text-on-color, #fff)}.btn--danger.btn--outline:active:not(:disabled){background-color:var(--danger-500, #ef4444);filter:brightness(.88);color:var(--text-on-color, #fff)}.btn--success.btn--solid{background-color:var(--success-500, #10b981);border-color:var(--success-500, #10b981);color:var(--text-on-color, #fff)}.btn--success.btn--solid:hover:not(:disabled){filter:brightness(.88)}.btn--success.btn--solid:active:not(:disabled){filter:brightness(.78)}.btn--success.btn--outline{background-color:transparent;border-color:var(--success-500, #10b981);color:var(--success-500, #10b981)}.btn--success.btn--outline:hover:not(:disabled){background-color:var(--success-500, #10b981);color:var(--text-on-color, #fff)}.btn--success.btn--outline:active:not(:disabled){background-color:var(--success-500, #10b981);filter:brightness(.88);color:var(--text-on-color, #fff)}.btn--warning.btn--solid{background-color:var(--warning-500, #f59e0b);border-color:var(--warning-500, #f59e0b);color:var(--text-on-color, #fff)}.btn--warning.btn--solid:hover:not(:disabled){filter:brightness(.88)}.btn--warning.btn--solid:active:not(:disabled){filter:brightness(.78)}.btn--warning.btn--outline{background-color:transparent;border-color:var(--warning-500, #f59e0b);color:var(--warning-500, #f59e0b)}.btn--warning.btn--outline:hover:not(:disabled){background-color:var(--warning-500, #f59e0b);color:var(--text-on-color, #fff)}.btn--warning.btn--outline:active:not(:disabled){background-color:var(--warning-500, #f59e0b);filter:brightness(.88);color:var(--text-on-color, #fff)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }, { kind: "component", type: SpinnerComponent, selector: "ngx-ds-spinner", inputs: ["size", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -532,7 +564,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
532
564
|
args: [{ selector: 'ngx-ds-button', standalone: true, imports: [IconComponent, SpinnerComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button [type]=\"type()\" [class]=\"hostClasses()\" [disabled]=\"disabled() || loading() || null\">\n @if (loading()) {\n <ngx-ds-spinner class=\"btn__icon\" [size]=\"spinnerSize()\" color=\"current\" />\n } @else if (iconLeft()) {\n <ngx-ds-icon class=\"btn__icon\" [icon]=\"iconLeft()!\" [size]=\"iconSize()\" aria-hidden=\"true\" />\n }\n <ng-content />\n @if (!loading() && iconRight()) {\n <ngx-ds-icon class=\"btn__icon\" [icon]=\"iconRight()!\" [size]=\"iconSize()\" aria-hidden=\"true\" />\n }\n</button>\n", styles: [".btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif);font-weight:500;border-radius:.375rem;border:1.5px solid transparent;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease,filter .15s ease;white-space:nowrap;line-height:1;text-decoration:none;-webkit-user-select:none;user-select:none}.btn:focus-visible{outline:2px solid currentColor;outline-offset:2px}.btn:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.btn--sm{padding:.375rem .75rem;font-size:.75rem}.btn--md{padding:.5rem 1rem;font-size:.875rem}.btn--lg{padding:.75rem 1.5rem;font-size:1rem}.btn--rounded{border-radius:9999px}.btn__icon{flex-shrink:0}.btn--loading{cursor:wait;pointer-events:none;opacity:.85}.btn--primary.btn--solid{background-color:var(--primary-500, #6366f1);border-color:var(--primary-500, #6366f1);color:var(--text-on-color, #fff)}.btn--primary.btn--solid:hover:not(:disabled){filter:brightness(.88)}.btn--primary.btn--solid:active:not(:disabled){filter:brightness(.78)}.btn--primary.btn--outline{background-color:transparent;border-color:var(--primary-500, #6366f1);color:var(--primary-500, #6366f1)}.btn--primary.btn--outline:hover:not(:disabled){background-color:var(--primary-500, #6366f1);color:var(--text-on-color, #fff)}.btn--primary.btn--outline:active:not(:disabled){background-color:var(--primary-500, #6366f1);filter:brightness(.88);color:var(--text-on-color, #fff)}.btn--secondary.btn--solid{background-color:var(--fill-neutral, #6b7280);border-color:var(--fill-neutral, #6b7280);color:var(--text-on-color, #fff)}.btn--secondary.btn--solid:hover:not(:disabled){filter:brightness(.88)}.btn--secondary.btn--solid:active:not(:disabled){filter:brightness(.78)}.btn--secondary.btn--outline{background-color:transparent;border-color:var(--fill-neutral, #6b7280);color:var(--fill-neutral, #6b7280)}.btn--secondary.btn--outline:hover:not(:disabled){background-color:var(--fill-neutral, #6b7280);color:var(--text-on-color, #fff)}.btn--secondary.btn--outline:active:not(:disabled){background-color:var(--fill-neutral, #6b7280);filter:brightness(.88);color:var(--text-on-color, #fff)}.btn--danger.btn--solid{background-color:var(--danger-500, #ef4444);border-color:var(--danger-500, #ef4444);color:var(--text-on-color, #fff)}.btn--danger.btn--solid:hover:not(:disabled){filter:brightness(.88)}.btn--danger.btn--solid:active:not(:disabled){filter:brightness(.78)}.btn--danger.btn--outline{background-color:transparent;border-color:var(--danger-500, #ef4444);color:var(--danger-500, #ef4444)}.btn--danger.btn--outline:hover:not(:disabled){background-color:var(--danger-500, #ef4444);color:var(--text-on-color, #fff)}.btn--danger.btn--outline:active:not(:disabled){background-color:var(--danger-500, #ef4444);filter:brightness(.88);color:var(--text-on-color, #fff)}.btn--success.btn--solid{background-color:var(--success-500, #10b981);border-color:var(--success-500, #10b981);color:var(--text-on-color, #fff)}.btn--success.btn--solid:hover:not(:disabled){filter:brightness(.88)}.btn--success.btn--solid:active:not(:disabled){filter:brightness(.78)}.btn--success.btn--outline{background-color:transparent;border-color:var(--success-500, #10b981);color:var(--success-500, #10b981)}.btn--success.btn--outline:hover:not(:disabled){background-color:var(--success-500, #10b981);color:var(--text-on-color, #fff)}.btn--success.btn--outline:active:not(:disabled){background-color:var(--success-500, #10b981);filter:brightness(.88);color:var(--text-on-color, #fff)}.btn--warning.btn--solid{background-color:var(--warning-500, #f59e0b);border-color:var(--warning-500, #f59e0b);color:var(--text-on-color, #fff)}.btn--warning.btn--solid:hover:not(:disabled){filter:brightness(.88)}.btn--warning.btn--solid:active:not(:disabled){filter:brightness(.78)}.btn--warning.btn--outline{background-color:transparent;border-color:var(--warning-500, #f59e0b);color:var(--warning-500, #f59e0b)}.btn--warning.btn--outline:hover:not(:disabled){background-color:var(--warning-500, #f59e0b);color:var(--text-on-color, #fff)}.btn--warning.btn--outline:active:not(:disabled){background-color:var(--warning-500, #f59e0b);filter:brightness(.88);color:var(--text-on-color, #fff)}\n"] }]
|
|
533
565
|
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], iconLeft: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconLeft", required: false }] }], iconRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconRight", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
|
|
534
566
|
|
|
535
|
-
const ICON_SIZE$
|
|
567
|
+
const ICON_SIZE$d = { sm: 14, md: 18, lg: 22 };
|
|
536
568
|
class IconButtonComponent {
|
|
537
569
|
icon = input.required(...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
538
570
|
ariaLabel = input.required(...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
@@ -556,7 +588,7 @@ class IconButtonComponent {
|
|
|
556
588
|
classes.push('icon-btn--borderless');
|
|
557
589
|
return classes.join(' ');
|
|
558
590
|
}, ...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
559
|
-
iconSize = computed(() => ICON_SIZE$
|
|
591
|
+
iconSize = computed(() => ICON_SIZE$d[this.size()], ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
560
592
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: IconButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
561
593
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: IconButtonComponent, isStandalone: true, selector: "ngx-ds-icon-button", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: true, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, rounded: { classPropertyName: "rounded", publicName: "rounded", isSignal: true, isRequired: false, transformFunction: null }, bordered: { classPropertyName: "bordered", publicName: "bordered", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<button\n [type]=\"type()\"\n [class]=\"hostClasses()\"\n [disabled]=\"disabled() || null\"\n [attr.aria-label]=\"ariaLabel()\"\n>\n <ngx-ds-icon [icon]=\"icon()\" [size]=\"iconSize()\" aria-hidden=\"true\" />\n</button>\n", styles: [".icon-btn{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:.375rem;border:1.5px solid transparent;cursor:pointer;transition:background-color .15s ease,border-color .15s ease,color .15s ease,filter .15s ease;-webkit-user-select:none;user-select:none}.icon-btn:focus-visible{outline:2px solid currentColor;outline-offset:2px}.icon-btn:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.icon-btn--sm{width:1.75rem;height:1.75rem}.icon-btn--md{width:2.25rem;height:2.25rem}.icon-btn--lg{width:2.75rem;height:2.75rem}.icon-btn--rounded{border-radius:9999px}.icon-btn--primary.icon-btn--solid{background-color:var(--primary-500, #6366f1);border-color:var(--primary-500, #6366f1);color:var(--text-on-color, #fff)}.icon-btn--primary.icon-btn--solid:hover:not(:disabled){filter:brightness(.88)}.icon-btn--primary.icon-btn--solid:active:not(:disabled){filter:brightness(.78)}.icon-btn--primary.icon-btn--outline{background-color:transparent;border-color:var(--primary-500, #6366f1);color:var(--primary-500, #6366f1)}.icon-btn--primary.icon-btn--outline:hover:not(:disabled){background-color:var(--primary-500, #6366f1);color:var(--text-on-color, #fff)}.icon-btn--primary.icon-btn--outline:active:not(:disabled){background-color:var(--primary-500, #6366f1);filter:brightness(.88);color:var(--text-on-color, #fff)}.icon-btn--secondary.icon-btn--solid{background-color:var(--fill-neutral, #6b7280);border-color:var(--fill-neutral, #6b7280);color:var(--text-on-color, #fff)}.icon-btn--secondary.icon-btn--solid:hover:not(:disabled){filter:brightness(.88)}.icon-btn--secondary.icon-btn--solid:active:not(:disabled){filter:brightness(.78)}.icon-btn--secondary.icon-btn--outline{background-color:transparent;border-color:var(--fill-neutral, #6b7280);color:var(--fill-neutral, #6b7280)}.icon-btn--secondary.icon-btn--outline:hover:not(:disabled){background-color:var(--fill-neutral, #6b7280);color:var(--text-on-color, #fff)}.icon-btn--secondary.icon-btn--outline:active:not(:disabled){background-color:var(--fill-neutral, #6b7280);filter:brightness(.88);color:var(--text-on-color, #fff)}.icon-btn--danger.icon-btn--solid{background-color:var(--danger-500, #ef4444);border-color:var(--danger-500, #ef4444);color:var(--text-on-color, #fff)}.icon-btn--danger.icon-btn--solid:hover:not(:disabled){filter:brightness(.88)}.icon-btn--danger.icon-btn--solid:active:not(:disabled){filter:brightness(.78)}.icon-btn--danger.icon-btn--outline{background-color:transparent;border-color:var(--danger-500, #ef4444);color:var(--danger-500, #ef4444)}.icon-btn--danger.icon-btn--outline:hover:not(:disabled){background-color:var(--danger-500, #ef4444);color:var(--text-on-color, #fff)}.icon-btn--danger.icon-btn--outline:active:not(:disabled){background-color:var(--danger-500, #ef4444);filter:brightness(.88);color:var(--text-on-color, #fff)}.icon-btn--success.icon-btn--solid{background-color:var(--success-500, #10b981);border-color:var(--success-500, #10b981);color:var(--text-on-color, #fff)}.icon-btn--success.icon-btn--solid:hover:not(:disabled){filter:brightness(.88)}.icon-btn--success.icon-btn--solid:active:not(:disabled){filter:brightness(.78)}.icon-btn--success.icon-btn--outline{background-color:transparent;border-color:var(--success-500, #10b981);color:var(--success-500, #10b981)}.icon-btn--success.icon-btn--outline:hover:not(:disabled){background-color:var(--success-500, #10b981);color:var(--text-on-color, #fff)}.icon-btn--success.icon-btn--outline:active:not(:disabled){background-color:var(--success-500, #10b981);filter:brightness(.88);color:var(--text-on-color, #fff)}.icon-btn--warning.icon-btn--solid{background-color:var(--warning-500, #f59e0b);border-color:var(--warning-500, #f59e0b);color:var(--text-on-color, #fff)}.icon-btn--warning.icon-btn--solid:hover:not(:disabled){filter:brightness(.88)}.icon-btn--warning.icon-btn--solid:active:not(:disabled){filter:brightness(.78)}.icon-btn--warning.icon-btn--outline{background-color:transparent;border-color:var(--warning-500, #f59e0b);color:var(--warning-500, #f59e0b)}.icon-btn--warning.icon-btn--outline:hover:not(:disabled){background-color:var(--warning-500, #f59e0b);color:var(--text-on-color, #fff)}.icon-btn--warning.icon-btn--outline:active:not(:disabled){background-color:var(--warning-500, #f59e0b);filter:brightness(.88);color:var(--text-on-color, #fff)}.icon-btn--borderless{border-color:transparent!important}.icon-btn--borderless:hover:not(:disabled),.icon-btn--borderless:active:not(:disabled){border-color:transparent!important}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
562
594
|
}
|
|
@@ -630,7 +662,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
630
662
|
args: [{ selector: 'ngx-ds-badge', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<span [class]=\"hostClasses()\">{{ displayText() }}</span>\n", styles: [".badge{display:inline-flex;align-items:center;justify-content:center;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif);font-weight:500;white-space:nowrap;line-height:1;border:1.5px solid transparent}.badge--rounded{border-radius:9999px}.badge:not(.badge--rounded){border-radius:.25rem}.badge--dot{padding:0;border-radius:9999px}.badge--dot.badge--sm{width:.5rem;height:.5rem}.badge--dot.badge--md{width:.625rem;height:.625rem}.badge--dot.badge--lg{width:.75rem;height:.75rem}.badge--sm:not(.badge--dot){font-size:.65rem;padding:.25rem .45rem}.badge--md:not(.badge--dot){font-size:.75rem;padding:.3rem .6rem}.badge--lg:not(.badge--dot){font-size:.875rem;padding:.4rem .75rem}.badge--primary.badge--solid{background-color:var(--primary-500, #6366f1);color:var(--text-on-color, #fff);border-color:var(--primary-500, #6366f1)}.badge--primary.badge--soft{background-color:var(--info-50, #eff6ff);color:var(--info-700, #1d4ed8);border-color:transparent}.badge--primary.badge--outline{background-color:transparent;color:var(--primary-500, #6366f1);border-color:var(--primary-500, #6366f1)}.badge--primary.badge--dot{background-color:var(--primary-500, #6366f1);border-color:var(--primary-500, #6366f1)}.badge--secondary.badge--solid{background-color:var(--fill-neutral, #6b7280);color:var(--text-on-color, #fff);border-color:var(--fill-neutral, #6b7280)}.badge--secondary.badge--soft{background-color:var(--surface-muted, #f3f4f6);color:var(--text-secondary, #374151);border-color:transparent}.badge--secondary.badge--outline{background-color:transparent;color:var(--fill-neutral, #6b7280);border-color:var(--fill-neutral, #6b7280)}.badge--secondary.badge--dot{background-color:var(--fill-neutral, #6b7280);border-color:var(--fill-neutral, #6b7280)}.badge--danger.badge--solid{background-color:var(--danger-500, #ef4444);color:var(--text-on-color, #fff);border-color:var(--danger-500, #ef4444)}.badge--danger.badge--soft{background-color:var(--danger-50, #fef2f2);color:var(--danger-700, #b91c1c);border-color:transparent}.badge--danger.badge--outline{background-color:transparent;color:var(--danger-500, #ef4444);border-color:var(--danger-500, #ef4444)}.badge--danger.badge--dot{background-color:var(--danger-500, #ef4444);border-color:var(--danger-500, #ef4444)}.badge--success.badge--solid{background-color:var(--success-500, #10b981);color:var(--text-on-color, #fff);border-color:var(--success-500, #10b981)}.badge--success.badge--soft{background-color:var(--success-50, #ecfdf5);color:var(--success-700, #047857);border-color:transparent}.badge--success.badge--outline{background-color:transparent;color:var(--success-500, #10b981);border-color:var(--success-500, #10b981)}.badge--success.badge--dot{background-color:var(--success-500, #10b981);border-color:var(--success-500, #10b981)}.badge--warning.badge--solid{background-color:var(--warning-500, #f59e0b);color:var(--text-on-color, #fff);border-color:var(--warning-500, #f59e0b)}.badge--warning.badge--soft{background-color:var(--warning-50, #fffbeb);color:var(--warning-700, #b45309);border-color:transparent}.badge--warning.badge--outline{background-color:transparent;color:var(--warning-500, #f59e0b);border-color:var(--warning-500, #f59e0b)}.badge--warning.badge--dot{background-color:var(--warning-500, #f59e0b);border-color:var(--warning-500, #f59e0b)}\n"] }]
|
|
631
663
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], dot: [{ type: i0.Input, args: [{ isSignal: true, alias: "dot", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }] } });
|
|
632
664
|
|
|
633
|
-
const ICON_SIZE$
|
|
665
|
+
const ICON_SIZE$c = { sm: 12, md: 14, lg: 16 };
|
|
634
666
|
class TagComponent {
|
|
635
667
|
i18n = inject(NGX_DS_LABELS);
|
|
636
668
|
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
@@ -654,7 +686,7 @@ class TagComponent {
|
|
|
654
686
|
classes.push('tag--rounded');
|
|
655
687
|
return classes.join(' ');
|
|
656
688
|
}, ...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
657
|
-
iconSize = computed(() => ICON_SIZE$
|
|
689
|
+
iconSize = computed(() => ICON_SIZE$c[this.size()], ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
658
690
|
onDismiss() {
|
|
659
691
|
this.dismissed.emit();
|
|
660
692
|
}
|
|
@@ -712,7 +744,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
712
744
|
args: [{ selector: 'ngx-ds-progress-bar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (label() || (showValue() && !indeterminate())) {\n <div class=\"progress__header\">\n @if (label()) {\n <span class=\"progress__label\">{{ label() }}</span>\n }\n @if (showValue() && !indeterminate()) {\n <span class=\"progress__value\">{{ displayValue() }}</span>\n }\n </div>\n}\n\n<div\n [class]=\"trackClasses()\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"indeterminate() ? null : value()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-label]=\"label() || i18n.progress\"\n>\n <div [class]=\"barClasses()\" [style.width.%]=\"indeterminate() ? null : percentage()\"></div>\n</div>\n", styles: ["@keyframes progress-stripes{0%{background-position:1.5rem 0}to{background-position:0 0}}@keyframes progress-indeterminate{0%{margin-left:-40%}to{margin-left:100%}}.progress{width:100%;background-color:var(--surface-active, #e5e7eb);overflow:hidden;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.progress__header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.375rem}.progress__label{font-size:.8125rem;font-weight:500;color:var(--text-secondary, #374151)}.progress__value{font-size:.8125rem;font-weight:600;color:var(--text-muted, #6b7280)}.progress--rounded{border-radius:9999px}.progress--sm{height:.25rem}.progress--md{height:.5rem}.progress--lg{height:.875rem}.progress__bar{height:100%;transition:width .4s ease}.progress__bar--rounded{border-radius:9999px}.progress__bar--striped{background-image:repeating-linear-gradient(45deg,transparent,transparent .625rem,rgba(255,255,255,.2) .625rem,rgba(255,255,255,.2) 1.25rem);background-size:1.5rem 1.5rem}.progress__bar--animated{animation:progress-stripes .8s linear infinite}.progress__bar--indeterminate{width:40%!important;animation:progress-indeterminate 1.2s ease-in-out infinite}.progress--primary .progress__bar{background-color:var(--primary-500, #6366f1)}.progress--secondary .progress__bar{background-color:var(--fill-neutral, #6b7280)}.progress--danger .progress__bar{background-color:var(--danger-500, #ef4444)}.progress--success .progress__bar{background-color:var(--success-500, #10b981)}.progress--warning .progress__bar{background-color:var(--warning-500, #f59e0b)}\n"] }]
|
|
713
745
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], striped: [{ type: i0.Input, args: [{ isSignal: true, alias: "striped", required: false }] }], animated: [{ type: i0.Input, args: [{ isSignal: true, alias: "animated", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }] } });
|
|
714
746
|
|
|
715
|
-
const ICON_SIZE$
|
|
747
|
+
const ICON_SIZE$b = { sm: 14, md: 16, lg: 18 };
|
|
716
748
|
class MenuButtonComponent {
|
|
717
749
|
iconLeft = input(undefined, ...(ngDevMode ? [{ debugName: "iconLeft" }] : /* istanbul ignore next */ []));
|
|
718
750
|
iconRight = input(undefined, ...(ngDevMode ? [{ debugName: "iconRight" }] : /* istanbul ignore next */ []));
|
|
@@ -727,7 +759,7 @@ class MenuButtonComponent {
|
|
|
727
759
|
classes.push('menu-btn--full');
|
|
728
760
|
return classes.join(' ');
|
|
729
761
|
}, ...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
730
|
-
iconSize = computed(() => ICON_SIZE$
|
|
762
|
+
iconSize = computed(() => ICON_SIZE$b[this.size()], ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
731
763
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MenuButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
732
764
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MenuButtonComponent, isStandalone: true, selector: "ngx-ds-menu-button", inputs: { iconLeft: { classPropertyName: "iconLeft", publicName: "iconLeft", isSignal: true, isRequired: false, transformFunction: null }, iconRight: { classPropertyName: "iconRight", publicName: "iconRight", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", 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 }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<button [type]=\"type()\" [class]=\"hostClasses()\" [disabled]=\"disabled() || null\">\n @if (iconLeft()) {\n <ngx-ds-icon\n class=\"menu-btn__icon\"\n [icon]=\"iconLeft()!\"\n [size]=\"iconSize()\"\n aria-hidden=\"true\"\n />\n }\n <ng-content />\n @if (iconRight()) {\n <ngx-ds-icon\n class=\"menu-btn__icon\"\n [icon]=\"iconRight()!\"\n [size]=\"iconSize()\"\n aria-hidden=\"true\"\n />\n }\n</button>\n", styles: [".menu-btn{display:inline-flex;align-items:center;gap:.5rem;border:none;background:transparent;cursor:pointer;border-radius:.375rem;white-space:nowrap;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif);font-weight:400;line-height:1;-webkit-user-select:none;user-select:none;transition:background .12s ease,color .12s ease}.menu-btn:focus-visible{outline:2px solid currentColor;outline-offset:2px}.menu-btn:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.menu-btn--sm{padding:.375rem .625rem;font-size:.8125rem}.menu-btn--md{padding:.5rem .75rem;font-size:.875rem}.menu-btn--lg{padding:.625rem 1rem;font-size:1rem}.menu-btn--full{width:100%;justify-content:flex-start}.menu-btn--default{color:var(--text-base, #111827)}.menu-btn--default:hover:not(:disabled){background:var(--surface-hover, #f3f4f6)}.menu-btn--primary{color:var(--primary-500, #6366f1)}.menu-btn--primary:hover:not(:disabled){background:var(--primary-50, #eef2ff)}.menu-btn--danger{color:var(--danger-500, #ef4444)}.menu-btn--danger:hover:not(:disabled){background:var(--danger-50, #fef2f2)}.menu-btn--success{color:var(--success-500, #10b981)}.menu-btn--success:hover:not(:disabled){background:var(--success-50, #ecfdf5)}.menu-btn--warning{color:var(--warning-500, #f59e0b)}.menu-btn--warning:hover:not(:disabled){background:var(--warning-50, #fffbeb)}.menu-btn__icon{flex-shrink:0}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
733
765
|
}
|
|
@@ -910,7 +942,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
910
942
|
args: [{ selector: 'ngx-ds-kbd', standalone: true, imports: [], template: `<kbd [class]="hostClasses()"><ng-content /></kbd>`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.kbd{display:inline-flex;align-items:center;justify-content:center;font-family:ui-monospace,SFMono-Regular,Cascadia Code,Consolas,monospace;font-weight:500;background:var(--surface-muted, #f3f4f6);border:1px solid var(--border-input, #d1d5db);border-bottom-width:2px;border-radius:.3rem;color:var(--text-secondary, #374151);line-height:1;white-space:nowrap;box-shadow:inset 0 -1px 0 var(--border-input, #d1d5db)}.kbd--sm{font-size:.7rem;padding:.125rem .35rem}.kbd--md{font-size:.8125rem;padding:.2rem .5rem}.kbd--lg{font-size:.9375rem;padding:.25rem .625rem}\n"] }]
|
|
911
943
|
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
912
944
|
|
|
913
|
-
let nextId$
|
|
945
|
+
let nextId$j = 0;
|
|
914
946
|
class CheckboxComponent {
|
|
915
947
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
916
948
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
@@ -918,7 +950,7 @@ class CheckboxComponent {
|
|
|
918
950
|
indeterminate = input(false, ...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
|
|
919
951
|
labelPosition = input('right', ...(ngDevMode ? [{ debugName: "labelPosition" }] : /* istanbul ignore next */ []));
|
|
920
952
|
checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
921
|
-
id = `ngx-checkbox-${nextId$
|
|
953
|
+
id = `ngx-checkbox-${nextId$j++}`;
|
|
922
954
|
#disabled = signal(false, ...(ngDevMode ? [{ debugName: "#disabled" }] : /* istanbul ignore next */ []));
|
|
923
955
|
isDisabled = this.#disabled.asReadonly();
|
|
924
956
|
onChange = () => { };
|
|
@@ -971,7 +1003,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
971
1003
|
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<label [for]=\"id\" [class]=\"hostClasses()\">\n <input\n type=\"checkbox\"\n [id]=\"id\"\n class=\"checkbox__input\"\n [checked]=\"checked()\"\n [indeterminate]=\"indeterminate() && !checked()\"\n [disabled]=\"isDisabled()\"\n (change)=\"onNativeChange($event)\"\n />\n\n @if (labelPosition() === 'left' && label()) {\n <span class=\"checkbox__label\">{{ label() }}</span>\n }\n\n <span class=\"checkbox__box\" aria-hidden=\"true\"></span>\n\n @if (labelPosition() === 'right' && label()) {\n <span class=\"checkbox__label\">{{ label() }}</span>\n }\n</label>\n", styles: [".checkbox{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.checkbox--disabled{cursor:not-allowed;opacity:.5}.checkbox__input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.checkbox__input:focus-visible~.checkbox__box{outline:2px solid var(--ngx-checkbox-color);outline-offset:2px}.checkbox__box{position:relative;flex-shrink:0;border:2px solid var(--border-input, #d1d5db);border-radius:.25rem;background:var(--surface-base, #fff);transition:background-color .15s ease,border-color .15s ease}.checkbox__box:after{content:\"\";position:absolute;display:none;left:50%;top:46%;width:35%;height:58%;border:2px solid var(--text-on-color, #fff);border-top:none;border-left:none;transform:translate(-50%,-50%) rotate(45deg)}.checkbox:hover:not(.checkbox--disabled):not(.checkbox--checked):not(.checkbox--indeterminate) .checkbox__box{border-color:var(--ngx-checkbox-color)}.checkbox--checked .checkbox__box{background-color:var(--ngx-checkbox-color);border-color:var(--ngx-checkbox-color)}.checkbox--checked .checkbox__box:after{display:block}.checkbox--indeterminate .checkbox__box{background-color:var(--ngx-checkbox-color);border-color:var(--ngx-checkbox-color)}.checkbox--indeterminate .checkbox__box:after{display:block;width:55%;height:2px;border:none;background:var(--text-on-color, #fff);top:50%;transform:translate(-50%,-50%)}.checkbox__label{font-size:.875rem;color:var(--text-secondary, #374151);line-height:1.25}.checkbox--sm .checkbox__box{width:.875rem;height:.875rem}.checkbox--md .checkbox__box{width:1.125rem;height:1.125rem}.checkbox--lg .checkbox__box{width:1.375rem;height:1.375rem}.checkbox--primary{--ngx-checkbox-color: var(--primary-500, #6366f1)}.checkbox--secondary{--ngx-checkbox-color: var(--fill-neutral, #6b7280)}.checkbox--danger{--ngx-checkbox-color: var(--danger-500, #ef4444)}.checkbox--success{--ngx-checkbox-color: var(--success-500, #10b981)}.checkbox--warning{--ngx-checkbox-color: var(--warning-500, #f59e0b)}\n"] }]
|
|
972
1004
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }] } });
|
|
973
1005
|
|
|
974
|
-
let nextId$
|
|
1006
|
+
let nextId$i = 0;
|
|
975
1007
|
class RadioComponent {
|
|
976
1008
|
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
977
1009
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
@@ -987,7 +1019,7 @@ class RadioComponent {
|
|
|
987
1019
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
988
1020
|
/** Emits this radio's `value` when the user selects it. */
|
|
989
1021
|
valueSelect = output();
|
|
990
|
-
id = `ngx-radio-${nextId$
|
|
1022
|
+
id = `ngx-radio-${nextId$i++}`;
|
|
991
1023
|
#modelValue = signal(null, ...(ngDevMode ? [{ debugName: "#modelValue" }] : /* istanbul ignore next */ []));
|
|
992
1024
|
#formDisabled = signal(false, ...(ngDevMode ? [{ debugName: "#formDisabled" }] : /* istanbul ignore next */ []));
|
|
993
1025
|
isDisabled = computed(() => this.disabled() || this.#formDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
@@ -1043,7 +1075,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
1043
1075
|
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<label [for]=\"id\" [class]=\"hostClasses()\">\n <input\n type=\"radio\"\n [id]=\"id\"\n [name]=\"name()\"\n [value]=\"value()\"\n class=\"radio__input\"\n [checked]=\"isChecked()\"\n [disabled]=\"isDisabled()\"\n (change)=\"onSelect()\"\n />\n\n @if (labelPosition() === 'left' && label()) {\n <span class=\"radio__label\">{{ label() }}</span>\n }\n\n <span class=\"radio__circle\" aria-hidden=\"true\">\n <span class=\"radio__dot\"></span>\n </span>\n\n @if (labelPosition() === 'right' && label()) {\n <span class=\"radio__label\">{{ label() }}</span>\n }\n</label>\n", styles: [".radio{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.radio--disabled{cursor:not-allowed;opacity:.5}.radio__input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.radio__input:focus-visible~.radio__circle{outline:2px solid var(--ngx-radio-color);outline-offset:2px}.radio__circle{display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:9999px;border:2px solid var(--border-input, #d1d5db);background:var(--surface-base, #fff);transition:border-color .15s ease,background-color .15s ease}.radio:hover:not(.radio--disabled):not(.radio--checked) .radio__circle{border-color:var(--ngx-radio-color)}.radio--checked .radio__circle{border-color:var(--ngx-radio-color);background-color:var(--ngx-radio-color)}.radio__dot{border-radius:9999px;background:var(--text-on-color, #fff);width:40%;height:40%;transform:scale(0);transition:transform .15s ease}.radio--checked .radio__dot{transform:scale(1)}.radio__label{font-size:.875rem;color:var(--text-secondary, #374151);line-height:1.25}.radio--sm .radio__circle{width:.875rem;height:.875rem}.radio--md .radio__circle{width:1.125rem;height:1.125rem}.radio--lg .radio__circle{width:1.375rem;height:1.375rem}.radio--primary{--ngx-radio-color: var(--primary-500, #6366f1)}.radio--secondary{--ngx-radio-color: var(--fill-neutral, #6b7280)}.radio--danger{--ngx-radio-color: var(--danger-500, #ef4444)}.radio--success{--ngx-radio-color: var(--success-500, #10b981)}.radio--warning{--ngx-radio-color: var(--warning-500, #f59e0b)}\n"] }]
|
|
1044
1076
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], valueSelect: [{ type: i0.Output, args: ["valueSelect"] }] } });
|
|
1045
1077
|
|
|
1046
|
-
let nextId$
|
|
1078
|
+
let nextId$h = 0;
|
|
1047
1079
|
class SwitchComponent {
|
|
1048
1080
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1049
1081
|
labelPosition = input('right', ...(ngDevMode ? [{ debugName: "labelPosition" }] : /* istanbul ignore next */ []));
|
|
@@ -1052,7 +1084,7 @@ class SwitchComponent {
|
|
|
1052
1084
|
labelOn = input('', ...(ngDevMode ? [{ debugName: "labelOn" }] : /* istanbul ignore next */ []));
|
|
1053
1085
|
labelOff = input('', ...(ngDevMode ? [{ debugName: "labelOff" }] : /* istanbul ignore next */ []));
|
|
1054
1086
|
checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
1055
|
-
id = `ngx-switch-${nextId$
|
|
1087
|
+
id = `ngx-switch-${nextId$h++}`;
|
|
1056
1088
|
#disabled = signal(false, ...(ngDevMode ? [{ debugName: "#disabled" }] : /* istanbul ignore next */ []));
|
|
1057
1089
|
isDisabled = this.#disabled.asReadonly();
|
|
1058
1090
|
onChange = () => { };
|
|
@@ -1104,8 +1136,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
1104
1136
|
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<label [for]=\"id\" [class]=\"hostClasses()\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n [id]=\"id\"\n class=\"switch__input\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-checked]=\"checked()\"\n [attr.aria-label]=\"label() || null\"\n (change)=\"onNativeChange($event)\"\n />\n\n @if (labelPosition() === 'left' && label()) {\n <span class=\"switch__label\">{{ label() }}</span>\n }\n\n <span class=\"switch__track\" aria-hidden=\"true\">\n <span class=\"switch__thumb\"></span>\n </span>\n\n @if (labelPosition() === 'right' && label()) {\n <span class=\"switch__label\">{{ label() }}</span>\n }\n\n @if (activeLabel()) {\n <span class=\"switch__state-label\">{{ activeLabel() }}</span>\n }\n</label>\n", styles: [".switch{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.switch--disabled{cursor:not-allowed;opacity:.5}.switch__input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.switch__input:focus-visible~.switch__track{outline:2px solid var(--ngx-switch-color);outline-offset:2px}.switch__track{position:relative;flex-shrink:0;border-radius:9999px;background-color:var(--border-input, #d1d5db);transition:background-color .2s ease}.switch--checked .switch__track{background-color:var(--ngx-switch-color)}.switch:hover:not(.switch--disabled) .switch__track{filter:brightness(.95)}.switch__thumb{position:absolute;top:50%;background:var(--surface-thumb, #fff);border-radius:9999px;box-shadow:0 1px 3px #0003;transition:transform .2s ease;transform:translateY(-50%) translate(var(--ngx-switch-thumb-start))}.switch--checked .switch__thumb{transform:translateY(-50%) translate(var(--ngx-switch-thumb-end))}.switch__label{font-size:.875rem;color:var(--text-secondary, #374151);line-height:1.25}.switch__state-label{font-size:.75rem;color:var(--text-muted, #6b7280);min-width:2rem}.switch--sm .switch__track{width:2rem;height:1.125rem}.switch--sm .switch__thumb{width:.75rem;height:.75rem;--ngx-switch-thumb-start: .1875rem;--ngx-switch-thumb-end: .875rem}.switch--md .switch__track{width:2.75rem;height:1.5rem}.switch--md .switch__thumb{width:1rem;height:1rem;--ngx-switch-thumb-start: .25rem;--ngx-switch-thumb-end: 1.25rem}.switch--lg .switch__track{width:3.5rem;height:1.875rem}.switch--lg .switch__thumb{width:1.25rem;height:1.25rem;--ngx-switch-thumb-start: .3125rem;--ngx-switch-thumb-end: 1.625rem}.switch--primary{--ngx-switch-color: var(--primary-500, #6366f1)}.switch--secondary{--ngx-switch-color: var(--fill-neutral, #6b7280)}.switch--danger{--ngx-switch-color: var(--danger-500, #ef4444)}.switch--success{--ngx-switch-color: var(--success-500, #10b981)}.switch--warning{--ngx-switch-color: var(--warning-500, #f59e0b)}\n"] }]
|
|
1105
1137
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], labelOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelOn", required: false }] }], labelOff: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelOff", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }] } });
|
|
1106
1138
|
|
|
1107
|
-
|
|
1108
|
-
|
|
1139
|
+
/**
|
|
1140
|
+
* Whether a control shows its error state: always with an explicit `errorMessage`,
|
|
1141
|
+
* and for Signal Forms errors only once the field is touched.
|
|
1142
|
+
*/
|
|
1143
|
+
function fieldHasError(explicit, errors, touched) {
|
|
1144
|
+
return explicit.length > 0 || (touched && errors.length > 0);
|
|
1145
|
+
}
|
|
1146
|
+
/**
|
|
1147
|
+
* The message to show under a control: the explicit `errorMessage` wins; otherwise the
|
|
1148
|
+
* first Signal Forms error that has a `message`, once the field is touched.
|
|
1149
|
+
*/
|
|
1150
|
+
function fieldErrorText(explicit, errors, touched) {
|
|
1151
|
+
if (explicit)
|
|
1152
|
+
return explicit;
|
|
1153
|
+
if (!touched)
|
|
1154
|
+
return '';
|
|
1155
|
+
return errors.find((e) => e.message)?.message ?? '';
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
const ICON_SIZE$a = { sm: 14, md: 16, lg: 18 };
|
|
1159
|
+
let nextId$g = 0;
|
|
1109
1160
|
class InputComponent {
|
|
1110
1161
|
i18n = inject(NGX_DS_LABELS);
|
|
1111
1162
|
// ── Configuration ────────────────────────────────────────────
|
|
@@ -1116,12 +1167,16 @@ class InputComponent {
|
|
|
1116
1167
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1117
1168
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
1118
1169
|
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
1170
|
+
/** Set by Signal Forms `[formField]`. Its errors show once the field is touched. */
|
|
1171
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
1172
|
+
touched = input(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
1119
1173
|
iconLeft = input(undefined, ...(ngDevMode ? [{ debugName: "iconLeft" }] : /* istanbul ignore next */ []));
|
|
1120
1174
|
iconRight = input(undefined, ...(ngDevMode ? [{ debugName: "iconRight" }] : /* istanbul ignore next */ []));
|
|
1121
1175
|
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
1122
1176
|
// ── Value — two-way bindable (signal forms) ──────────────────
|
|
1123
1177
|
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1124
|
-
id = `ngx-input-${nextId$
|
|
1178
|
+
id = `ngx-input-${nextId$g++}`;
|
|
1179
|
+
messageId = `${this.id}-message`;
|
|
1125
1180
|
// ── Internal state ───────────────────────────────────────────
|
|
1126
1181
|
#disabled = signal(false, ...(ngDevMode ? [{ debugName: "#disabled" }] : /* istanbul ignore next */ []));
|
|
1127
1182
|
#focused = signal(false, ...(ngDevMode ? [{ debugName: "#focused" }] : /* istanbul ignore next */ []));
|
|
@@ -1132,8 +1187,9 @@ class InputComponent {
|
|
|
1132
1187
|
effectiveType = computed(() => this.type() === 'password' && this.#showPassword() ? 'text' : this.type(), ...(ngDevMode ? [{ debugName: "effectiveType" }] : /* istanbul ignore next */ []));
|
|
1133
1188
|
// ── Derived ──────────────────────────────────────────────────
|
|
1134
1189
|
isFloating = computed(() => this.#focused() || this.value().length > 0, ...(ngDevMode ? [{ debugName: "isFloating" }] : /* istanbul ignore next */ []));
|
|
1135
|
-
hasError = computed(() => this.errorMessage().
|
|
1136
|
-
|
|
1190
|
+
hasError = computed(() => fieldHasError(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
1191
|
+
errorText = computed(() => fieldErrorText(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
1192
|
+
iconSize = computed(() => ICON_SIZE$a[this.size()], ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
1137
1193
|
// In floating mode the placeholder only appears once the label has floated up
|
|
1138
1194
|
effectivePlaceholder = computed(() => this.floatingLabel() && this.label() && !this.isFloating() ? '' : this.placeholder(), ...(ngDevMode ? [{ debugName: "effectivePlaceholder" }] : /* istanbul ignore next */ []));
|
|
1139
1195
|
fieldClasses = computed(() => {
|
|
@@ -1193,13 +1249,13 @@ class InputComponent {
|
|
|
1193
1249
|
this.#disabled.set(disabled);
|
|
1194
1250
|
}
|
|
1195
1251
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1196
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: InputComponent, isStandalone: true, selector: "ngx-ds-input", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, floatingLabel: { classPropertyName: "floatingLabel", publicName: "floatingLabel", 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 }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, iconLeft: { classPropertyName: "iconLeft", publicName: "iconLeft", isSignal: true, isRequired: false, transformFunction: null }, iconRight: { classPropertyName: "iconRight", publicName: "iconRight", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
1252
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: InputComponent, isStandalone: true, selector: "ngx-ds-input", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, floatingLabel: { classPropertyName: "floatingLabel", publicName: "floatingLabel", 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 }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, iconLeft: { classPropertyName: "iconLeft", publicName: "iconLeft", isSignal: true, isRequired: false, transformFunction: null }, iconRight: { classPropertyName: "iconRight", publicName: "iconRight", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
1197
1253
|
{
|
|
1198
1254
|
provide: NG_VALUE_ACCESSOR,
|
|
1199
1255
|
useExisting: forwardRef(() => InputComponent),
|
|
1200
1256
|
multi: true,
|
|
1201
1257
|
},
|
|
1202
|
-
], ngImport: i0, template: "<!-- Static label (non-floating) -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-input__label\">{{ label() }}</label>\n}\n\n<!-- Field container -->\n<div [class]=\"fieldClasses()\">\n <!-- Floating label (lives inside the bordered field) -->\n @if (floatingLabel() && label()) {\n <label [for]=\"id\" [class]=\"floatLabelClasses()\">{{ label() }}</label>\n }\n\n <!-- Left icon -->\n @if (iconLeft()) {\n <span class=\"ngx-input__icon ngx-input__icon--left\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"iconLeft()!\" [size]=\"iconSize()\" />\n </span>\n }\n\n <!-- Native input -->\n <input\n class=\"ngx-input__native\"\n [id]=\"id\"\n [type]=\"effectiveType()\"\n [value]=\"value()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled() || null\"\n [attr.readonly]=\"readonly() || null\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n\n <!-- Password toggle -->\n @if (type() === 'password') {\n <button\n type=\"button\"\n class=\"ngx-input__password-toggle\"\n [attr.aria-label]=\"effectiveType() === 'text' ? i18n.hidePassword : i18n.showPassword\"\n (click)=\"togglePassword()\"\n tabindex=\"-1\"\n >\n <ngx-ds-icon [icon]=\"eyeIcon()\" [size]=\"iconSize()\" />\n </button>\n }\n\n <!-- Right icon (non-password) -->\n @if (iconRight() && type() !== 'password') {\n <span class=\"ngx-input__icon ngx-input__icon--right\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"iconRight()!\" [size]=\"iconSize()\" />\n </span>\n }\n</div>\n\n<!-- Error / Hint -->\n@if (
|
|
1258
|
+
], ngImport: i0, template: "<!-- Static label (non-floating) -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-input__label\">{{ label() }}</label>\n}\n\n<!-- Field container -->\n<div [class]=\"fieldClasses()\">\n <!-- Floating label (lives inside the bordered field) -->\n @if (floatingLabel() && label()) {\n <label [for]=\"id\" [class]=\"floatLabelClasses()\">{{ label() }}</label>\n }\n\n <!-- Left icon -->\n @if (iconLeft()) {\n <span class=\"ngx-input__icon ngx-input__icon--left\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"iconLeft()!\" [size]=\"iconSize()\" />\n </span>\n }\n\n <!-- Native input -->\n <input\n class=\"ngx-input__native\"\n [id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n [type]=\"effectiveType()\"\n [value]=\"value()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled() || null\"\n [attr.readonly]=\"readonly() || null\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n\n <!-- Password toggle -->\n @if (type() === 'password') {\n <button\n type=\"button\"\n class=\"ngx-input__password-toggle\"\n [attr.aria-label]=\"effectiveType() === 'text' ? i18n.hidePassword : i18n.showPassword\"\n (click)=\"togglePassword()\"\n tabindex=\"-1\"\n >\n <ngx-ds-icon [icon]=\"eyeIcon()\" [size]=\"iconSize()\" />\n </button>\n }\n\n <!-- Right icon (non-password) -->\n @if (iconRight() && type() !== 'password') {\n <span class=\"ngx-input__icon ngx-input__icon--right\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"iconRight()!\" [size]=\"iconSize()\" />\n </span>\n }\n</div>\n\n<!-- Error / Hint -->\n@if (errorText()) {\n <p [id]=\"messageId\" class=\"ngx-input__message ngx-input__message--error\" role=\"alert\">\n {{ errorText() }}\n </p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-input__message ngx-input__message--hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-input__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-input__field{position:relative;display:flex;align-items:center;gap:.5rem;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;transition:border-color .15s ease,box-shadow .15s ease}.ngx-input__field--focused{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-input__field--error{border-color:var(--danger-500, #ef4444)}.ngx-input__field--error.ngx-input__field--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-input__field--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed}.ngx-input__field--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-input__field--md{padding:.5rem .75rem;font-size:.875rem}.ngx-input__field--lg{padding:.625rem 1rem;font-size:1rem}.ngx-input__native{flex:1;min-width:0;padding:0;background:transparent;border:none;outline:none;color:var(--text-base, #111827);font-family:inherit;font-size:inherit;line-height:1.5}.ngx-input__native::placeholder{color:var(--text-placeholder, #9ca3af)}.ngx-input__native:disabled{cursor:not-allowed;color:var(--text-muted, #6b7280)}.ngx-input__native[readonly]{cursor:default}.ngx-input__float-label{position:absolute;left:.75rem;top:50%;transform:translateY(-50%);font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-input__float-label--offset{left:2.25rem}.ngx-input__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1)}.ngx-input__float-label--focused:not(.ngx-input__float-label--error){color:var(--primary-500, #6366f1)}.ngx-input__float-label--error{color:var(--danger-500, #ef4444)}.ngx-input__icon{display:inline-flex;align-items:center;flex-shrink:0;color:var(--text-placeholder, #9ca3af)}.ngx-input__password-toggle{display:inline-flex;align-items:center;flex-shrink:0;padding:0;background:transparent;border:none;cursor:pointer;color:var(--text-placeholder, #9ca3af);transition:color .15s ease}.ngx-input__password-toggle:hover{color:var(--text-muted, #6b7280)}.ngx-input__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-input__message--hint{color:var(--text-muted, #6b7280)}.ngx-input__message--error{color:var(--danger-500, #ef4444)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1203
1259
|
}
|
|
1204
1260
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: InputComponent, decorators: [{
|
|
1205
1261
|
type: Component,
|
|
@@ -1209,10 +1265,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
1209
1265
|
useExisting: forwardRef(() => InputComponent),
|
|
1210
1266
|
multi: true,
|
|
1211
1267
|
},
|
|
1212
|
-
], template: "<!-- Static label (non-floating) -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-input__label\">{{ label() }}</label>\n}\n\n<!-- Field container -->\n<div [class]=\"fieldClasses()\">\n <!-- Floating label (lives inside the bordered field) -->\n @if (floatingLabel() && label()) {\n <label [for]=\"id\" [class]=\"floatLabelClasses()\">{{ label() }}</label>\n }\n\n <!-- Left icon -->\n @if (iconLeft()) {\n <span class=\"ngx-input__icon ngx-input__icon--left\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"iconLeft()!\" [size]=\"iconSize()\" />\n </span>\n }\n\n <!-- Native input -->\n <input\n class=\"ngx-input__native\"\n [id]=\"id\"\n [type]=\"effectiveType()\"\n [value]=\"value()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled() || null\"\n [attr.readonly]=\"readonly() || null\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n\n <!-- Password toggle -->\n @if (type() === 'password') {\n <button\n type=\"button\"\n class=\"ngx-input__password-toggle\"\n [attr.aria-label]=\"effectiveType() === 'text' ? i18n.hidePassword : i18n.showPassword\"\n (click)=\"togglePassword()\"\n tabindex=\"-1\"\n >\n <ngx-ds-icon [icon]=\"eyeIcon()\" [size]=\"iconSize()\" />\n </button>\n }\n\n <!-- Right icon (non-password) -->\n @if (iconRight() && type() !== 'password') {\n <span class=\"ngx-input__icon ngx-input__icon--right\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"iconRight()!\" [size]=\"iconSize()\" />\n </span>\n }\n</div>\n\n<!-- Error / Hint -->\n@if (
|
|
1213
|
-
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], floatingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatingLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], iconLeft: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconLeft", required: false }] }], iconRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconRight", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
1268
|
+
], template: "<!-- Static label (non-floating) -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-input__label\">{{ label() }}</label>\n}\n\n<!-- Field container -->\n<div [class]=\"fieldClasses()\">\n <!-- Floating label (lives inside the bordered field) -->\n @if (floatingLabel() && label()) {\n <label [for]=\"id\" [class]=\"floatLabelClasses()\">{{ label() }}</label>\n }\n\n <!-- Left icon -->\n @if (iconLeft()) {\n <span class=\"ngx-input__icon ngx-input__icon--left\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"iconLeft()!\" [size]=\"iconSize()\" />\n </span>\n }\n\n <!-- Native input -->\n <input\n class=\"ngx-input__native\"\n [id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n [type]=\"effectiveType()\"\n [value]=\"value()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled() || null\"\n [attr.readonly]=\"readonly() || null\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n\n <!-- Password toggle -->\n @if (type() === 'password') {\n <button\n type=\"button\"\n class=\"ngx-input__password-toggle\"\n [attr.aria-label]=\"effectiveType() === 'text' ? i18n.hidePassword : i18n.showPassword\"\n (click)=\"togglePassword()\"\n tabindex=\"-1\"\n >\n <ngx-ds-icon [icon]=\"eyeIcon()\" [size]=\"iconSize()\" />\n </button>\n }\n\n <!-- Right icon (non-password) -->\n @if (iconRight() && type() !== 'password') {\n <span class=\"ngx-input__icon ngx-input__icon--right\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"iconRight()!\" [size]=\"iconSize()\" />\n </span>\n }\n</div>\n\n<!-- Error / Hint -->\n@if (errorText()) {\n <p [id]=\"messageId\" class=\"ngx-input__message ngx-input__message--error\" role=\"alert\">\n {{ errorText() }}\n </p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-input__message ngx-input__message--hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-input__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-input__field{position:relative;display:flex;align-items:center;gap:.5rem;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;transition:border-color .15s ease,box-shadow .15s ease}.ngx-input__field--focused{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-input__field--error{border-color:var(--danger-500, #ef4444)}.ngx-input__field--error.ngx-input__field--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-input__field--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed}.ngx-input__field--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-input__field--md{padding:.5rem .75rem;font-size:.875rem}.ngx-input__field--lg{padding:.625rem 1rem;font-size:1rem}.ngx-input__native{flex:1;min-width:0;padding:0;background:transparent;border:none;outline:none;color:var(--text-base, #111827);font-family:inherit;font-size:inherit;line-height:1.5}.ngx-input__native::placeholder{color:var(--text-placeholder, #9ca3af)}.ngx-input__native:disabled{cursor:not-allowed;color:var(--text-muted, #6b7280)}.ngx-input__native[readonly]{cursor:default}.ngx-input__float-label{position:absolute;left:.75rem;top:50%;transform:translateY(-50%);font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-input__float-label--offset{left:2.25rem}.ngx-input__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1)}.ngx-input__float-label--focused:not(.ngx-input__float-label--error){color:var(--primary-500, #6366f1)}.ngx-input__float-label--error{color:var(--danger-500, #ef4444)}.ngx-input__icon{display:inline-flex;align-items:center;flex-shrink:0;color:var(--text-placeholder, #9ca3af)}.ngx-input__password-toggle{display:inline-flex;align-items:center;flex-shrink:0;padding:0;background:transparent;border:none;cursor:pointer;color:var(--text-placeholder, #9ca3af);transition:color .15s ease}.ngx-input__password-toggle:hover{color:var(--text-muted, #6b7280)}.ngx-input__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-input__message--hint{color:var(--text-muted, #6b7280)}.ngx-input__message--error{color:var(--danger-500, #ef4444)}\n"] }]
|
|
1269
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], floatingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatingLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], iconLeft: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconLeft", required: false }] }], iconRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconRight", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
1214
1270
|
|
|
1215
|
-
let nextId$
|
|
1271
|
+
let nextId$f = 0;
|
|
1216
1272
|
class TextareaComponent {
|
|
1217
1273
|
// ── Configuration ────────────────────────────────────────────
|
|
1218
1274
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
@@ -1223,19 +1279,24 @@ class TextareaComponent {
|
|
|
1223
1279
|
rows = input(3, ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
1224
1280
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
1225
1281
|
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
1282
|
+
/** Set by Signal Forms `[formField]`. Its errors show once the field is touched. */
|
|
1283
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
1284
|
+
touched = input(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
1226
1285
|
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
1227
1286
|
maxLength = input(undefined, ...(ngDevMode ? [{ debugName: "maxLength" }] : /* istanbul ignore next */ []));
|
|
1228
1287
|
showCount = input(false, ...(ngDevMode ? [{ debugName: "showCount" }] : /* istanbul ignore next */ []));
|
|
1229
1288
|
// ── Value ─────────────────────────────────────────────────────
|
|
1230
1289
|
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1231
|
-
id = `ngx-textarea-${nextId$
|
|
1290
|
+
id = `ngx-textarea-${nextId$f++}`;
|
|
1291
|
+
messageId = `${this.id}-message`;
|
|
1232
1292
|
// ── Internal state ────────────────────────────────────────────
|
|
1233
1293
|
#disabled = signal(false, ...(ngDevMode ? [{ debugName: "#disabled" }] : /* istanbul ignore next */ []));
|
|
1234
1294
|
#focused = signal(false, ...(ngDevMode ? [{ debugName: "#focused" }] : /* istanbul ignore next */ []));
|
|
1235
1295
|
isDisabled = this.#disabled.asReadonly();
|
|
1236
1296
|
isFocused = this.#focused.asReadonly();
|
|
1237
1297
|
// ── Derived ───────────────────────────────────────────────────
|
|
1238
|
-
hasError = computed(() => this.errorMessage().
|
|
1298
|
+
hasError = computed(() => fieldHasError(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
1299
|
+
errorText = computed(() => fieldErrorText(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
1239
1300
|
isFloating = computed(() => this.#focused() || this.value().length > 0, ...(ngDevMode ? [{ debugName: "isFloating" }] : /* istanbul ignore next */ []));
|
|
1240
1301
|
charCount = computed(() => this.value().length, ...(ngDevMode ? [{ debugName: "charCount" }] : /* istanbul ignore next */ []));
|
|
1241
1302
|
effectivePlaceholder = computed(() => this.floatingLabel() && this.label() && !this.isFloating() ? '' : this.placeholder(), ...(ngDevMode ? [{ debugName: "effectivePlaceholder" }] : /* istanbul ignore next */ []));
|
|
@@ -1292,13 +1353,13 @@ class TextareaComponent {
|
|
|
1292
1353
|
this.#disabled.set(disabled);
|
|
1293
1354
|
}
|
|
1294
1355
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1295
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: TextareaComponent, isStandalone: true, selector: "ngx-ds-textarea", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, floatingLabel: { classPropertyName: "floatingLabel", publicName: "floatingLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, resize: { classPropertyName: "resize", publicName: "resize", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, showCount: { classPropertyName: "showCount", publicName: "showCount", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
1356
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: TextareaComponent, isStandalone: true, selector: "ngx-ds-textarea", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, floatingLabel: { classPropertyName: "floatingLabel", publicName: "floatingLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, resize: { classPropertyName: "resize", publicName: "resize", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, showCount: { classPropertyName: "showCount", publicName: "showCount", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
1296
1357
|
{
|
|
1297
1358
|
provide: NG_VALUE_ACCESSOR,
|
|
1298
1359
|
useExisting: forwardRef(() => TextareaComponent),
|
|
1299
1360
|
multi: true,
|
|
1300
1361
|
},
|
|
1301
|
-
], ngImport: i0, template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-textarea__label\">{{ label() }}</label>\n}\n\n<!-- Field container -->\n<div [class]=\"fieldClasses()\">\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <label [for]=\"id\" [class]=\"floatLabelClasses()\">{{ label() }}</label>\n }\n\n <!-- Native textarea -->\n <textarea\n class=\"ngx-textarea__native\"\n [id]=\"id\"\n [rows]=\"rows()\"\n [value]=\"value()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled() || null\"\n [attr.readonly]=\"readonly() || null\"\n [attr.maxlength]=\"maxLength() ?? null\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n ></textarea>\n</div>\n\n<!-- Footer: error/hint + char count -->\n<div class=\"ngx-textarea__footer\">\n @if (
|
|
1362
|
+
], ngImport: i0, template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-textarea__label\">{{ label() }}</label>\n}\n\n<!-- Field container -->\n<div [class]=\"fieldClasses()\">\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <label [for]=\"id\" [class]=\"floatLabelClasses()\">{{ label() }}</label>\n }\n\n <!-- Native textarea -->\n <textarea\n class=\"ngx-textarea__native\"\n [id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n [rows]=\"rows()\"\n [value]=\"value()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled() || null\"\n [attr.readonly]=\"readonly() || null\"\n [attr.maxlength]=\"maxLength() ?? null\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n ></textarea>\n</div>\n\n<!-- Footer: error/hint + char count -->\n<div class=\"ngx-textarea__footer\">\n @if (errorText()) {\n <p [id]=\"messageId\" class=\"ngx-textarea__message ngx-textarea__message--error\" role=\"alert\">\n {{ errorText() }}\n </p>\n } @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-textarea__message ngx-textarea__message--hint\">{{ hint() }}</p>\n } @else {\n <span></span>\n }\n\n @if (showCount() && maxLength()) {\n <span\n class=\"ngx-textarea__count\"\n [class.ngx-textarea__count--limit]=\"charCount() >= maxLength()!\"\n >\n {{ charCount() }}/{{ maxLength() }}\n </span>\n }\n</div>\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-textarea__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-textarea__field{position:relative;display:flex;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;transition:border-color .15s ease,box-shadow .15s ease}.ngx-textarea__field--focused{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-textarea__field--error{border-color:var(--danger-500, #ef4444)}.ngx-textarea__field--error.ngx-textarea__field--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-textarea__field--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed}.ngx-textarea__field--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-textarea__field--md{padding:.5rem .75rem;font-size:.875rem}.ngx-textarea__field--lg{padding:.625rem 1rem;font-size:1rem}.ngx-textarea__field--floating{padding-top:1.25rem}.ngx-textarea__field--resize-none .ngx-textarea__native{resize:none}.ngx-textarea__field--resize-vertical .ngx-textarea__native{resize:vertical}.ngx-textarea__field--resize-horizontal .ngx-textarea__native{resize:horizontal}.ngx-textarea__field--resize-both .ngx-textarea__native{resize:both}.ngx-textarea__native{flex:1;min-width:0;padding:0;background:transparent;border:none;outline:none;color:var(--text-base, #111827);font-family:inherit;font-size:inherit;line-height:1.6;resize:vertical}.ngx-textarea__native::placeholder{color:var(--text-placeholder, #9ca3af)}.ngx-textarea__native:disabled{cursor:not-allowed;color:var(--text-muted, #6b7280)}.ngx-textarea__native[readonly]{cursor:default}.ngx-textarea__float-label{position:absolute;left:.75rem;top:.625rem;transform:none;font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-textarea__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1);transform:translateY(-50%)}.ngx-textarea__float-label--focused:not(.ngx-textarea__float-label--error){color:var(--primary-500, #6366f1)}.ngx-textarea__float-label--error{color:var(--danger-500, #ef4444)}.ngx-textarea__footer{display:flex;justify-content:space-between;align-items:flex-start;gap:.5rem;min-height:1.25rem}.ngx-textarea__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-textarea__message--hint{color:var(--text-muted, #6b7280)}.ngx-textarea__message--error{color:var(--danger-500, #ef4444)}.ngx-textarea__count{flex-shrink:0;margin-top:.375rem;font-size:.75rem;color:var(--text-placeholder, #9ca3af)}.ngx-textarea__count--limit{color:var(--danger-500, #ef4444)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1302
1363
|
}
|
|
1303
1364
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
1304
1365
|
type: Component,
|
|
@@ -1308,8 +1369,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
1308
1369
|
useExisting: forwardRef(() => TextareaComponent),
|
|
1309
1370
|
multi: true,
|
|
1310
1371
|
},
|
|
1311
|
-
], template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-textarea__label\">{{ label() }}</label>\n}\n\n<!-- Field container -->\n<div [class]=\"fieldClasses()\">\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <label [for]=\"id\" [class]=\"floatLabelClasses()\">{{ label() }}</label>\n }\n\n <!-- Native textarea -->\n <textarea\n class=\"ngx-textarea__native\"\n [id]=\"id\"\n [rows]=\"rows()\"\n [value]=\"value()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled() || null\"\n [attr.readonly]=\"readonly() || null\"\n [attr.maxlength]=\"maxLength() ?? null\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n ></textarea>\n</div>\n\n<!-- Footer: error/hint + char count -->\n<div class=\"ngx-textarea__footer\">\n @if (
|
|
1312
|
-
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], floatingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatingLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], resize: [{ type: i0.Input, args: [{ isSignal: true, alias: "resize", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], showCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCount", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
1372
|
+
], template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-textarea__label\">{{ label() }}</label>\n}\n\n<!-- Field container -->\n<div [class]=\"fieldClasses()\">\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <label [for]=\"id\" [class]=\"floatLabelClasses()\">{{ label() }}</label>\n }\n\n <!-- Native textarea -->\n <textarea\n class=\"ngx-textarea__native\"\n [id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n [rows]=\"rows()\"\n [value]=\"value()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled() || null\"\n [attr.readonly]=\"readonly() || null\"\n [attr.maxlength]=\"maxLength() ?? null\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n ></textarea>\n</div>\n\n<!-- Footer: error/hint + char count -->\n<div class=\"ngx-textarea__footer\">\n @if (errorText()) {\n <p [id]=\"messageId\" class=\"ngx-textarea__message ngx-textarea__message--error\" role=\"alert\">\n {{ errorText() }}\n </p>\n } @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-textarea__message ngx-textarea__message--hint\">{{ hint() }}</p>\n } @else {\n <span></span>\n }\n\n @if (showCount() && maxLength()) {\n <span\n class=\"ngx-textarea__count\"\n [class.ngx-textarea__count--limit]=\"charCount() >= maxLength()!\"\n >\n {{ charCount() }}/{{ maxLength() }}\n </span>\n }\n</div>\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-textarea__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-textarea__field{position:relative;display:flex;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;transition:border-color .15s ease,box-shadow .15s ease}.ngx-textarea__field--focused{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-textarea__field--error{border-color:var(--danger-500, #ef4444)}.ngx-textarea__field--error.ngx-textarea__field--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-textarea__field--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed}.ngx-textarea__field--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-textarea__field--md{padding:.5rem .75rem;font-size:.875rem}.ngx-textarea__field--lg{padding:.625rem 1rem;font-size:1rem}.ngx-textarea__field--floating{padding-top:1.25rem}.ngx-textarea__field--resize-none .ngx-textarea__native{resize:none}.ngx-textarea__field--resize-vertical .ngx-textarea__native{resize:vertical}.ngx-textarea__field--resize-horizontal .ngx-textarea__native{resize:horizontal}.ngx-textarea__field--resize-both .ngx-textarea__native{resize:both}.ngx-textarea__native{flex:1;min-width:0;padding:0;background:transparent;border:none;outline:none;color:var(--text-base, #111827);font-family:inherit;font-size:inherit;line-height:1.6;resize:vertical}.ngx-textarea__native::placeholder{color:var(--text-placeholder, #9ca3af)}.ngx-textarea__native:disabled{cursor:not-allowed;color:var(--text-muted, #6b7280)}.ngx-textarea__native[readonly]{cursor:default}.ngx-textarea__float-label{position:absolute;left:.75rem;top:.625rem;transform:none;font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-textarea__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1);transform:translateY(-50%)}.ngx-textarea__float-label--focused:not(.ngx-textarea__float-label--error){color:var(--primary-500, #6366f1)}.ngx-textarea__float-label--error{color:var(--danger-500, #ef4444)}.ngx-textarea__footer{display:flex;justify-content:space-between;align-items:flex-start;gap:.5rem;min-height:1.25rem}.ngx-textarea__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-textarea__message--hint{color:var(--text-muted, #6b7280)}.ngx-textarea__message--error{color:var(--danger-500, #ef4444)}.ngx-textarea__count{flex-shrink:0;margin-top:.375rem;font-size:.75rem;color:var(--text-placeholder, #9ca3af)}.ngx-textarea__count--limit{color:var(--danger-500, #ef4444)}\n"] }]
|
|
1373
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], floatingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatingLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], resize: [{ type: i0.Input, args: [{ isSignal: true, alias: "resize", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], showCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCount", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
1313
1374
|
|
|
1314
1375
|
/**
|
|
1315
1376
|
* Escucha clicks en `document` e invoca el callback cuando el click ocurre
|
|
@@ -1384,8 +1445,8 @@ function moveOptionFocus(event) {
|
|
|
1384
1445
|
return true;
|
|
1385
1446
|
}
|
|
1386
1447
|
|
|
1387
|
-
const ICON_SIZE$
|
|
1388
|
-
let nextId$
|
|
1448
|
+
const ICON_SIZE$9 = { sm: 14, md: 16, lg: 18 };
|
|
1449
|
+
let nextId$e = 0;
|
|
1389
1450
|
class SelectComponent {
|
|
1390
1451
|
i18n = inject(NGX_DS_LABELS);
|
|
1391
1452
|
// ── Configuration ──────────────────────────────────────────
|
|
@@ -1398,9 +1459,13 @@ class SelectComponent {
|
|
|
1398
1459
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1399
1460
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
1400
1461
|
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
1462
|
+
/** Set by Signal Forms `[formField]`. Its errors show once the field is touched. */
|
|
1463
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
1464
|
+
touched = input(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
1401
1465
|
// ── Value ─────────────────────────────────────────────────
|
|
1402
1466
|
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1403
|
-
id = `ngx-select-${nextId$
|
|
1467
|
+
id = `ngx-select-${nextId$e++}`;
|
|
1468
|
+
messageId = `${this.id}-message`;
|
|
1404
1469
|
// ── Icons ──────────────────────────────────────────────────
|
|
1405
1470
|
ChevronDown = ChevronDown;
|
|
1406
1471
|
ChevronUp = ChevronUp;
|
|
@@ -1415,8 +1480,9 @@ class SelectComponent {
|
|
|
1415
1480
|
isOpen = this.#open.asReadonly();
|
|
1416
1481
|
isDisabled = this.#disabled.asReadonly();
|
|
1417
1482
|
searchText = this.#search.asReadonly();
|
|
1418
|
-
iconSize = computed(() => ICON_SIZE$
|
|
1419
|
-
hasError = computed(() => this.errorMessage().
|
|
1483
|
+
iconSize = computed(() => ICON_SIZE$9[this.size()], ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
1484
|
+
hasError = computed(() => fieldHasError(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
1485
|
+
errorText = computed(() => fieldErrorText(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
1420
1486
|
// ── Derived ────────────────────────────────────────────────
|
|
1421
1487
|
selectedValues = computed(() => {
|
|
1422
1488
|
const v = this.value();
|
|
@@ -1600,13 +1666,13 @@ class SelectComponent {
|
|
|
1600
1666
|
this.#disabled.set(disabled);
|
|
1601
1667
|
}
|
|
1602
1668
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1603
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: SelectComponent, isStandalone: true, selector: "ngx-ds-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, floatingLabel: { classPropertyName: "floatingLabel", publicName: "floatingLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
1669
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: SelectComponent, isStandalone: true, selector: "ngx-ds-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, floatingLabel: { classPropertyName: "floatingLabel", publicName: "floatingLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
1604
1670
|
{
|
|
1605
1671
|
provide: NG_VALUE_ACCESSOR,
|
|
1606
1672
|
useExisting: forwardRef(() => SelectComponent),
|
|
1607
1673
|
multi: true,
|
|
1608
1674
|
},
|
|
1609
|
-
], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-select__label\">{{ label() }}</label>\n}\n\n<!-- Trigger -->\n<div\n #trigger\n [class]=\"triggerClasses()\"\n (click)=\"togglePanel()\"\n (keydown)=\"onTriggerKeydown($event)\"\n [attr.id]=\"id\"\n role=\"combobox\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled()\"\n>\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <span [class]=\"floatLabelClasses()\">{{ label() }}</span>\n }\n\n <!-- Display area -->\n <span class=\"ngx-select__display\">\n @if (multiple() && selectedValues().length) {\n <!-- Chips (\u22642) or count badge (>2) -->\n @if (selectedValues().length <= 2) {\n @for (val of selectedValues(); track val) {\n <span class=\"ngx-select__tag\">\n {{ tagLabel(val) }}\n @if (!isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-select__tag-remove\"\n [attr.aria-label]=\"i18n.removeChip(tagLabel(val))\"\n (click)=\"removeTag(val, $event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"10\" />\n </button>\n }\n </span>\n }\n } @else {\n <span class=\"ngx-select__tag\"\n >{{ selectedValues().length }} seleccionados\n @if (!isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-select__tag-remove\"\n [attr.aria-label]=\"i18n.clearSelection\"\n (click)=\"clearAll($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"10\" />\n </button>\n }\n </span>\n }\n } @else if (!multiple() && displayText()) {\n <span class=\"ngx-select__value\">{{ displayText() }}</span>\n } @else {\n <span class=\"ngx-select__placeholder\">{{ placeholder() ?? i18n.selectPlaceholder }}</span>\n }\n </span>\n\n <!-- Clear button (single mode) -->\n @if (!multiple() && displayText() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-select__clear\"\n [attr.aria-label]=\"i18n.clearSelection\"\n (click)=\"clearAll($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n\n <!-- Chevron -->\n <span class=\"ngx-select__chevron\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"isOpen() ? ChevronUp : ChevronDown\" [size]=\"iconSize()\" />\n </span>\n</div>\n\n<!-- Dropdown panel -->\n@if (isOpen()) {\n <div\n class=\"ngx-select__panel\"\n [id]=\"id + '-panel'\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple()\"\n >\n <!-- Search -->\n @if (searchable()) {\n <div class=\"ngx-select__search\">\n <ngx-ds-icon [icon]=\"SearchIcon\" [size]=\"14\" class=\"ngx-select__search-icon\" />\n <input\n class=\"ngx-select__search-input\"\n type=\"text\"\n [placeholder]=\"i18n.searchPlaceholder\"\n [value]=\"searchText()\"\n (input)=\"onSearchChange($any($event.target).value)\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onSearchKeydown($event)\"\n autocomplete=\"off\"\n />\n </div>\n }\n\n <!-- Select all (multiple only) -->\n @if (multiple() && !searchText()) {\n <button\n type=\"button\"\n class=\"ngx-select__select-all\"\n (click)=\"selectAll(); $event.stopPropagation()\"\n >\n {{ i18n.selectAll }}\n </button>\n }\n\n <!-- Options -->\n <ul class=\"ngx-select__options\" role=\"presentation\">\n @for (option of filteredOptions(); track option.value) {\n <li\n class=\"ngx-select__option\"\n [class.ngx-select__option--selected]=\"isSelected(option.value)\"\n [class.ngx-select__option--disabled]=\"option.disabled\"\n role=\"option\"\n tabindex=\"-1\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [attr.aria-disabled]=\"option.disabled || null\"\n (click)=\"selectOption(option); $event.stopPropagation()\"\n (keydown)=\"onOptionKeydown($event, option)\"\n >\n @if (multiple()) {\n <span\n class=\"ngx-select__checkbox\"\n [class.ngx-select__checkbox--checked]=\"isSelected(option.value)\"\n aria-hidden=\"true\"\n ></span>\n } @else {\n <span class=\"ngx-select__check\">\n @if (isSelected(option.value)) {\n <ngx-ds-icon [icon]=\"CheckIcon\" [size]=\"14\" />\n }\n </span>\n }\n <span class=\"ngx-select__option-label\">{{ option.label }}</span>\n </li>\n } @empty {\n <li class=\"ngx-select__empty\">{{ i18n.noResults }}</li>\n }\n </ul>\n </div>\n}\n\n<!-- Hint / Error -->\n@if (hasError()) {\n <p class=\"ngx-select__message ngx-select__message--error\" role=\"alert\">{{ errorMessage() }}</p>\n} @else if (hint()) {\n <p class=\"ngx-select__message ngx-select__message--hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;position:relative;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-select__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-select__trigger{position:relative;display:flex;align-items:center;gap:.375rem;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color .15s ease,box-shadow .15s ease;min-height:2.375rem}.ngx-select__trigger--focused,.ngx-select__trigger--open{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-select__trigger--error{border-color:var(--danger-500, #ef4444)}.ngx-select__trigger--error.ngx-select__trigger--open,.ngx-select__trigger--error.ngx-select__trigger--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-select__trigger--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed;color:var(--text-placeholder, #9ca3af)}.ngx-select__trigger--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-select__trigger--md{padding:.5rem .75rem;font-size:.875rem}.ngx-select__trigger--lg{padding:.625rem 1rem;font-size:1rem}.ngx-select__display{flex:1;min-width:0;display:flex;flex-wrap:wrap;gap:.25rem;align-items:center}.ngx-select__value{color:var(--text-base, #111827);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ngx-select__placeholder{color:var(--text-placeholder, #9ca3af);white-space:nowrap}.ngx-select__tag{display:inline-flex;align-items:center;gap:.25rem;padding:.125rem .375rem;background:var(--primary-100, #e0e7ff);color:var(--primary-700, #4338ca);border-radius:.25rem;font-size:.75rem;font-weight:500;white-space:nowrap}.ngx-select__tag-remove{display:inline-flex;align-items:center;padding:0;background:transparent;border:none;cursor:pointer;color:inherit;opacity:.7}.ngx-select__tag-remove:hover{opacity:1}.ngx-select__clear{display:inline-flex;align-items:center;padding:0;background:transparent;border:none;cursor:pointer;color:var(--text-placeholder, #9ca3af);flex-shrink:0}.ngx-select__clear:hover{color:var(--text-muted, #6b7280)}.ngx-select__chevron{display:inline-flex;align-items:center;flex-shrink:0;color:var(--text-placeholder, #9ca3af)}.ngx-select__float-label{position:absolute;left:.75rem;top:50%;transform:translateY(-50%);font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-select__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1)}.ngx-select__float-label--focused:not(.ngx-select__float-label--error){color:var(--primary-500, #6366f1)}.ngx-select__float-label--error{color:var(--danger-500, #ef4444)}.ngx-select__panel{position:absolute;top:calc(100% + .25rem);left:0;right:0;z-index:100;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;box-shadow:0 4px 16px #0000001a;overflow:hidden}.ngx-select__search{display:flex;align-items:center;gap:.375rem;padding:.375rem .75rem;border-bottom:1px solid var(--border-subtle, #f3f4f6)}.ngx-select__search-icon{color:var(--text-placeholder, #9ca3af);flex-shrink:0}.ngx-select__search-input{flex:1;border:none;outline:none;font-size:.8125rem;color:var(--text-base, #111827);background:transparent;font-family:inherit}.ngx-select__search-input::placeholder{color:var(--text-placeholder, #9ca3af)}.ngx-select__select-all{display:block;width:100%;padding:.375rem .75rem;text-align:left;background:transparent;border:none;border-bottom:1px solid var(--border-subtle, #f3f4f6);font-size:.8125rem;color:var(--primary-500, #6366f1);font-weight:500;cursor:pointer;font-family:inherit}.ngx-select__select-all:hover{background:var(--primary-50, #eef2ff)}.ngx-select__options{list-style:none;margin:0;padding:.25rem 0;max-height:14rem;overflow-y:auto}.ngx-select__option{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;font-size:.875rem;color:var(--text-secondary, #374151);cursor:pointer;transition:background .1s ease}.ngx-select__option:hover:not(.ngx-select__option--disabled){background:var(--surface-subtle, #f9fafb)}.ngx-select__option--selected:not(.ngx-select__option--disabled){color:var(--primary-700, #4338ca);background:var(--primary-50, #eef2ff)}.ngx-select__option--disabled{color:var(--text-placeholder, #9ca3af);cursor:not-allowed}.ngx-select__option-label{flex:1}.ngx-select__checkbox{flex-shrink:0;width:1rem;height:1rem;border:1.5px solid var(--border-input, #d1d5db);border-radius:.2rem;background:var(--surface-base, #fff);position:relative;transition:border-color .1s,background .1s}.ngx-select__checkbox--checked{border-color:var(--primary-500, #6366f1);background:var(--primary-500, #6366f1)}.ngx-select__checkbox--checked:after{content:\"\";position:absolute;left:.2rem;top:.05rem;width:.35rem;height:.55rem;border:2px solid var(--text-on-color, #fff);border-top:none;border-left:none;transform:rotate(45deg)}.ngx-select__check{flex-shrink:0;width:1rem;height:1rem;display:flex;align-items:center;justify-content:center;color:var(--primary-500, #6366f1)}.ngx-select__empty{padding:.75rem;text-align:center;font-size:.875rem;color:var(--text-placeholder, #9ca3af)}.ngx-select__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-select__message--hint{color:var(--text-muted, #6b7280)}.ngx-select__message--error{color:var(--danger-500, #ef4444)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1675
|
+
], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-select__label\">{{ label() }}</label>\n}\n\n<!-- Trigger -->\n<div\n #trigger\n [class]=\"triggerClasses()\"\n (click)=\"togglePanel()\"\n (keydown)=\"onTriggerKeydown($event)\"\n [attr.id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n role=\"combobox\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled()\"\n>\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <span [class]=\"floatLabelClasses()\">{{ label() }}</span>\n }\n\n <!-- Display area -->\n <span class=\"ngx-select__display\">\n @if (multiple() && selectedValues().length) {\n <!-- Chips (\u22642) or count badge (>2) -->\n @if (selectedValues().length <= 2) {\n @for (val of selectedValues(); track val) {\n <span class=\"ngx-select__tag\">\n {{ tagLabel(val) }}\n @if (!isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-select__tag-remove\"\n [attr.aria-label]=\"i18n.removeChip(tagLabel(val))\"\n (click)=\"removeTag(val, $event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"10\" />\n </button>\n }\n </span>\n }\n } @else {\n <span class=\"ngx-select__tag\"\n >{{ selectedValues().length }} seleccionados\n @if (!isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-select__tag-remove\"\n [attr.aria-label]=\"i18n.clearSelection\"\n (click)=\"clearAll($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"10\" />\n </button>\n }\n </span>\n }\n } @else if (!multiple() && displayText()) {\n <span class=\"ngx-select__value\">{{ displayText() }}</span>\n } @else {\n <span class=\"ngx-select__placeholder\">{{ placeholder() ?? i18n.selectPlaceholder }}</span>\n }\n </span>\n\n <!-- Clear button (single mode) -->\n @if (!multiple() && displayText() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-select__clear\"\n [attr.aria-label]=\"i18n.clearSelection\"\n (click)=\"clearAll($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n\n <!-- Chevron -->\n <span class=\"ngx-select__chevron\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"isOpen() ? ChevronUp : ChevronDown\" [size]=\"iconSize()\" />\n </span>\n</div>\n\n<!-- Dropdown panel -->\n@if (isOpen()) {\n <div\n class=\"ngx-select__panel\"\n [id]=\"id + '-panel'\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple()\"\n >\n <!-- Search -->\n @if (searchable()) {\n <div class=\"ngx-select__search\">\n <ngx-ds-icon [icon]=\"SearchIcon\" [size]=\"14\" class=\"ngx-select__search-icon\" />\n <input\n class=\"ngx-select__search-input\"\n type=\"text\"\n [placeholder]=\"i18n.searchPlaceholder\"\n [value]=\"searchText()\"\n (input)=\"onSearchChange($any($event.target).value)\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onSearchKeydown($event)\"\n autocomplete=\"off\"\n />\n </div>\n }\n\n <!-- Select all (multiple only) -->\n @if (multiple() && !searchText()) {\n <button\n type=\"button\"\n class=\"ngx-select__select-all\"\n (click)=\"selectAll(); $event.stopPropagation()\"\n >\n {{ i18n.selectAll }}\n </button>\n }\n\n <!-- Options -->\n <ul class=\"ngx-select__options\" role=\"presentation\">\n @for (option of filteredOptions(); track option.value) {\n <li\n class=\"ngx-select__option\"\n [class.ngx-select__option--selected]=\"isSelected(option.value)\"\n [class.ngx-select__option--disabled]=\"option.disabled\"\n role=\"option\"\n tabindex=\"-1\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [attr.aria-disabled]=\"option.disabled || null\"\n (click)=\"selectOption(option); $event.stopPropagation()\"\n (keydown)=\"onOptionKeydown($event, option)\"\n >\n @if (multiple()) {\n <span\n class=\"ngx-select__checkbox\"\n [class.ngx-select__checkbox--checked]=\"isSelected(option.value)\"\n aria-hidden=\"true\"\n ></span>\n } @else {\n <span class=\"ngx-select__check\">\n @if (isSelected(option.value)) {\n <ngx-ds-icon [icon]=\"CheckIcon\" [size]=\"14\" />\n }\n </span>\n }\n <span class=\"ngx-select__option-label\">{{ option.label }}</span>\n </li>\n } @empty {\n <li class=\"ngx-select__empty\">{{ i18n.noResults }}</li>\n }\n </ul>\n </div>\n}\n\n<!-- Hint / Error -->\n@if (errorText()) {\n <p [id]=\"messageId\" class=\"ngx-select__message ngx-select__message--error\" role=\"alert\">\n {{ errorText() }}\n </p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-select__message ngx-select__message--hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;position:relative;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-select__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-select__trigger{position:relative;display:flex;align-items:center;gap:.375rem;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color .15s ease,box-shadow .15s ease;min-height:2.375rem}.ngx-select__trigger--focused,.ngx-select__trigger--open{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-select__trigger--error{border-color:var(--danger-500, #ef4444)}.ngx-select__trigger--error.ngx-select__trigger--open,.ngx-select__trigger--error.ngx-select__trigger--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-select__trigger--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed;color:var(--text-placeholder, #9ca3af)}.ngx-select__trigger--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-select__trigger--md{padding:.5rem .75rem;font-size:.875rem}.ngx-select__trigger--lg{padding:.625rem 1rem;font-size:1rem}.ngx-select__display{flex:1;min-width:0;display:flex;flex-wrap:wrap;gap:.25rem;align-items:center}.ngx-select__value{color:var(--text-base, #111827);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ngx-select__placeholder{color:var(--text-placeholder, #9ca3af);white-space:nowrap}.ngx-select__tag{display:inline-flex;align-items:center;gap:.25rem;padding:.125rem .375rem;background:var(--primary-100, #e0e7ff);color:var(--primary-700, #4338ca);border-radius:.25rem;font-size:.75rem;font-weight:500;white-space:nowrap}.ngx-select__tag-remove{display:inline-flex;align-items:center;padding:0;background:transparent;border:none;cursor:pointer;color:inherit;opacity:.7}.ngx-select__tag-remove:hover{opacity:1}.ngx-select__clear{display:inline-flex;align-items:center;padding:0;background:transparent;border:none;cursor:pointer;color:var(--text-placeholder, #9ca3af);flex-shrink:0}.ngx-select__clear:hover{color:var(--text-muted, #6b7280)}.ngx-select__chevron{display:inline-flex;align-items:center;flex-shrink:0;color:var(--text-placeholder, #9ca3af)}.ngx-select__float-label{position:absolute;left:.75rem;top:50%;transform:translateY(-50%);font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-select__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1)}.ngx-select__float-label--focused:not(.ngx-select__float-label--error){color:var(--primary-500, #6366f1)}.ngx-select__float-label--error{color:var(--danger-500, #ef4444)}.ngx-select__panel{position:absolute;top:calc(100% + .25rem);left:0;right:0;z-index:100;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;box-shadow:0 4px 16px #0000001a;overflow:hidden}.ngx-select__search{display:flex;align-items:center;gap:.375rem;padding:.375rem .75rem;border-bottom:1px solid var(--border-subtle, #f3f4f6)}.ngx-select__search-icon{color:var(--text-placeholder, #9ca3af);flex-shrink:0}.ngx-select__search-input{flex:1;border:none;outline:none;font-size:.8125rem;color:var(--text-base, #111827);background:transparent;font-family:inherit}.ngx-select__search-input::placeholder{color:var(--text-placeholder, #9ca3af)}.ngx-select__select-all{display:block;width:100%;padding:.375rem .75rem;text-align:left;background:transparent;border:none;border-bottom:1px solid var(--border-subtle, #f3f4f6);font-size:.8125rem;color:var(--primary-500, #6366f1);font-weight:500;cursor:pointer;font-family:inherit}.ngx-select__select-all:hover{background:var(--primary-50, #eef2ff)}.ngx-select__options{list-style:none;margin:0;padding:.25rem 0;max-height:14rem;overflow-y:auto}.ngx-select__option{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;font-size:.875rem;color:var(--text-secondary, #374151);cursor:pointer;transition:background .1s ease}.ngx-select__option:hover:not(.ngx-select__option--disabled){background:var(--surface-subtle, #f9fafb)}.ngx-select__option--selected:not(.ngx-select__option--disabled){color:var(--primary-700, #4338ca);background:var(--primary-50, #eef2ff)}.ngx-select__option--disabled{color:var(--text-placeholder, #9ca3af);cursor:not-allowed}.ngx-select__option-label{flex:1}.ngx-select__checkbox{flex-shrink:0;width:1rem;height:1rem;border:1.5px solid var(--border-input, #d1d5db);border-radius:.2rem;background:var(--surface-base, #fff);position:relative;transition:border-color .1s,background .1s}.ngx-select__checkbox--checked{border-color:var(--primary-500, #6366f1);background:var(--primary-500, #6366f1)}.ngx-select__checkbox--checked:after{content:\"\";position:absolute;left:.2rem;top:.05rem;width:.35rem;height:.55rem;border:2px solid var(--text-on-color, #fff);border-top:none;border-left:none;transform:rotate(45deg)}.ngx-select__check{flex-shrink:0;width:1rem;height:1rem;display:flex;align-items:center;justify-content:center;color:var(--primary-500, #6366f1)}.ngx-select__empty{padding:.75rem;text-align:center;font-size:.875rem;color:var(--text-placeholder, #9ca3af)}.ngx-select__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-select__message--hint{color:var(--text-muted, #6b7280)}.ngx-select__message--error{color:var(--danger-500, #ef4444)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1610
1676
|
}
|
|
1611
1677
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: SelectComponent, decorators: [{
|
|
1612
1678
|
type: Component,
|
|
@@ -1616,11 +1682,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
1616
1682
|
useExisting: forwardRef(() => SelectComponent),
|
|
1617
1683
|
multi: true,
|
|
1618
1684
|
},
|
|
1619
|
-
], template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-select__label\">{{ label() }}</label>\n}\n\n<!-- Trigger -->\n<div\n #trigger\n [class]=\"triggerClasses()\"\n (click)=\"togglePanel()\"\n (keydown)=\"onTriggerKeydown($event)\"\n [attr.id]=\"id\"\n role=\"combobox\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled()\"\n>\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <span [class]=\"floatLabelClasses()\">{{ label() }}</span>\n }\n\n <!-- Display area -->\n <span class=\"ngx-select__display\">\n @if (multiple() && selectedValues().length) {\n <!-- Chips (\u22642) or count badge (>2) -->\n @if (selectedValues().length <= 2) {\n @for (val of selectedValues(); track val) {\n <span class=\"ngx-select__tag\">\n {{ tagLabel(val) }}\n @if (!isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-select__tag-remove\"\n [attr.aria-label]=\"i18n.removeChip(tagLabel(val))\"\n (click)=\"removeTag(val, $event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"10\" />\n </button>\n }\n </span>\n }\n } @else {\n <span class=\"ngx-select__tag\"\n >{{ selectedValues().length }} seleccionados\n @if (!isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-select__tag-remove\"\n [attr.aria-label]=\"i18n.clearSelection\"\n (click)=\"clearAll($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"10\" />\n </button>\n }\n </span>\n }\n } @else if (!multiple() && displayText()) {\n <span class=\"ngx-select__value\">{{ displayText() }}</span>\n } @else {\n <span class=\"ngx-select__placeholder\">{{ placeholder() ?? i18n.selectPlaceholder }}</span>\n }\n </span>\n\n <!-- Clear button (single mode) -->\n @if (!multiple() && displayText() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-select__clear\"\n [attr.aria-label]=\"i18n.clearSelection\"\n (click)=\"clearAll($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n\n <!-- Chevron -->\n <span class=\"ngx-select__chevron\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"isOpen() ? ChevronUp : ChevronDown\" [size]=\"iconSize()\" />\n </span>\n</div>\n\n<!-- Dropdown panel -->\n@if (isOpen()) {\n <div\n class=\"ngx-select__panel\"\n [id]=\"id + '-panel'\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple()\"\n >\n <!-- Search -->\n @if (searchable()) {\n <div class=\"ngx-select__search\">\n <ngx-ds-icon [icon]=\"SearchIcon\" [size]=\"14\" class=\"ngx-select__search-icon\" />\n <input\n class=\"ngx-select__search-input\"\n type=\"text\"\n [placeholder]=\"i18n.searchPlaceholder\"\n [value]=\"searchText()\"\n (input)=\"onSearchChange($any($event.target).value)\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onSearchKeydown($event)\"\n autocomplete=\"off\"\n />\n </div>\n }\n\n <!-- Select all (multiple only) -->\n @if (multiple() && !searchText()) {\n <button\n type=\"button\"\n class=\"ngx-select__select-all\"\n (click)=\"selectAll(); $event.stopPropagation()\"\n >\n {{ i18n.selectAll }}\n </button>\n }\n\n <!-- Options -->\n <ul class=\"ngx-select__options\" role=\"presentation\">\n @for (option of filteredOptions(); track option.value) {\n <li\n class=\"ngx-select__option\"\n [class.ngx-select__option--selected]=\"isSelected(option.value)\"\n [class.ngx-select__option--disabled]=\"option.disabled\"\n role=\"option\"\n tabindex=\"-1\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [attr.aria-disabled]=\"option.disabled || null\"\n (click)=\"selectOption(option); $event.stopPropagation()\"\n (keydown)=\"onOptionKeydown($event, option)\"\n >\n @if (multiple()) {\n <span\n class=\"ngx-select__checkbox\"\n [class.ngx-select__checkbox--checked]=\"isSelected(option.value)\"\n aria-hidden=\"true\"\n ></span>\n } @else {\n <span class=\"ngx-select__check\">\n @if (isSelected(option.value)) {\n <ngx-ds-icon [icon]=\"CheckIcon\" [size]=\"14\" />\n }\n </span>\n }\n <span class=\"ngx-select__option-label\">{{ option.label }}</span>\n </li>\n } @empty {\n <li class=\"ngx-select__empty\">{{ i18n.noResults }}</li>\n }\n </ul>\n </div>\n}\n\n<!-- Hint / Error -->\n@if (hasError()) {\n <p class=\"ngx-select__message ngx-select__message--error\" role=\"alert\">{{ errorMessage() }}</p>\n} @else if (hint()) {\n <p class=\"ngx-select__message ngx-select__message--hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;position:relative;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-select__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-select__trigger{position:relative;display:flex;align-items:center;gap:.375rem;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color .15s ease,box-shadow .15s ease;min-height:2.375rem}.ngx-select__trigger--focused,.ngx-select__trigger--open{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-select__trigger--error{border-color:var(--danger-500, #ef4444)}.ngx-select__trigger--error.ngx-select__trigger--open,.ngx-select__trigger--error.ngx-select__trigger--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-select__trigger--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed;color:var(--text-placeholder, #9ca3af)}.ngx-select__trigger--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-select__trigger--md{padding:.5rem .75rem;font-size:.875rem}.ngx-select__trigger--lg{padding:.625rem 1rem;font-size:1rem}.ngx-select__display{flex:1;min-width:0;display:flex;flex-wrap:wrap;gap:.25rem;align-items:center}.ngx-select__value{color:var(--text-base, #111827);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ngx-select__placeholder{color:var(--text-placeholder, #9ca3af);white-space:nowrap}.ngx-select__tag{display:inline-flex;align-items:center;gap:.25rem;padding:.125rem .375rem;background:var(--primary-100, #e0e7ff);color:var(--primary-700, #4338ca);border-radius:.25rem;font-size:.75rem;font-weight:500;white-space:nowrap}.ngx-select__tag-remove{display:inline-flex;align-items:center;padding:0;background:transparent;border:none;cursor:pointer;color:inherit;opacity:.7}.ngx-select__tag-remove:hover{opacity:1}.ngx-select__clear{display:inline-flex;align-items:center;padding:0;background:transparent;border:none;cursor:pointer;color:var(--text-placeholder, #9ca3af);flex-shrink:0}.ngx-select__clear:hover{color:var(--text-muted, #6b7280)}.ngx-select__chevron{display:inline-flex;align-items:center;flex-shrink:0;color:var(--text-placeholder, #9ca3af)}.ngx-select__float-label{position:absolute;left:.75rem;top:50%;transform:translateY(-50%);font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-select__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1)}.ngx-select__float-label--focused:not(.ngx-select__float-label--error){color:var(--primary-500, #6366f1)}.ngx-select__float-label--error{color:var(--danger-500, #ef4444)}.ngx-select__panel{position:absolute;top:calc(100% + .25rem);left:0;right:0;z-index:100;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;box-shadow:0 4px 16px #0000001a;overflow:hidden}.ngx-select__search{display:flex;align-items:center;gap:.375rem;padding:.375rem .75rem;border-bottom:1px solid var(--border-subtle, #f3f4f6)}.ngx-select__search-icon{color:var(--text-placeholder, #9ca3af);flex-shrink:0}.ngx-select__search-input{flex:1;border:none;outline:none;font-size:.8125rem;color:var(--text-base, #111827);background:transparent;font-family:inherit}.ngx-select__search-input::placeholder{color:var(--text-placeholder, #9ca3af)}.ngx-select__select-all{display:block;width:100%;padding:.375rem .75rem;text-align:left;background:transparent;border:none;border-bottom:1px solid var(--border-subtle, #f3f4f6);font-size:.8125rem;color:var(--primary-500, #6366f1);font-weight:500;cursor:pointer;font-family:inherit}.ngx-select__select-all:hover{background:var(--primary-50, #eef2ff)}.ngx-select__options{list-style:none;margin:0;padding:.25rem 0;max-height:14rem;overflow-y:auto}.ngx-select__option{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;font-size:.875rem;color:var(--text-secondary, #374151);cursor:pointer;transition:background .1s ease}.ngx-select__option:hover:not(.ngx-select__option--disabled){background:var(--surface-subtle, #f9fafb)}.ngx-select__option--selected:not(.ngx-select__option--disabled){color:var(--primary-700, #4338ca);background:var(--primary-50, #eef2ff)}.ngx-select__option--disabled{color:var(--text-placeholder, #9ca3af);cursor:not-allowed}.ngx-select__option-label{flex:1}.ngx-select__checkbox{flex-shrink:0;width:1rem;height:1rem;border:1.5px solid var(--border-input, #d1d5db);border-radius:.2rem;background:var(--surface-base, #fff);position:relative;transition:border-color .1s,background .1s}.ngx-select__checkbox--checked{border-color:var(--primary-500, #6366f1);background:var(--primary-500, #6366f1)}.ngx-select__checkbox--checked:after{content:\"\";position:absolute;left:.2rem;top:.05rem;width:.35rem;height:.55rem;border:2px solid var(--text-on-color, #fff);border-top:none;border-left:none;transform:rotate(45deg)}.ngx-select__check{flex-shrink:0;width:1rem;height:1rem;display:flex;align-items:center;justify-content:center;color:var(--primary-500, #6366f1)}.ngx-select__empty{padding:.75rem;text-align:center;font-size:.875rem;color:var(--text-placeholder, #9ca3af)}.ngx-select__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-select__message--hint{color:var(--text-muted, #6b7280)}.ngx-select__message--error{color:var(--danger-500, #ef4444)}\n"] }]
|
|
1620
|
-
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], floatingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatingLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], triggerRef: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }] } });
|
|
1685
|
+
], template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-select__label\">{{ label() }}</label>\n}\n\n<!-- Trigger -->\n<div\n #trigger\n [class]=\"triggerClasses()\"\n (click)=\"togglePanel()\"\n (keydown)=\"onTriggerKeydown($event)\"\n [attr.id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n role=\"combobox\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled()\"\n>\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <span [class]=\"floatLabelClasses()\">{{ label() }}</span>\n }\n\n <!-- Display area -->\n <span class=\"ngx-select__display\">\n @if (multiple() && selectedValues().length) {\n <!-- Chips (\u22642) or count badge (>2) -->\n @if (selectedValues().length <= 2) {\n @for (val of selectedValues(); track val) {\n <span class=\"ngx-select__tag\">\n {{ tagLabel(val) }}\n @if (!isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-select__tag-remove\"\n [attr.aria-label]=\"i18n.removeChip(tagLabel(val))\"\n (click)=\"removeTag(val, $event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"10\" />\n </button>\n }\n </span>\n }\n } @else {\n <span class=\"ngx-select__tag\"\n >{{ selectedValues().length }} seleccionados\n @if (!isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-select__tag-remove\"\n [attr.aria-label]=\"i18n.clearSelection\"\n (click)=\"clearAll($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"10\" />\n </button>\n }\n </span>\n }\n } @else if (!multiple() && displayText()) {\n <span class=\"ngx-select__value\">{{ displayText() }}</span>\n } @else {\n <span class=\"ngx-select__placeholder\">{{ placeholder() ?? i18n.selectPlaceholder }}</span>\n }\n </span>\n\n <!-- Clear button (single mode) -->\n @if (!multiple() && displayText() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-select__clear\"\n [attr.aria-label]=\"i18n.clearSelection\"\n (click)=\"clearAll($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n\n <!-- Chevron -->\n <span class=\"ngx-select__chevron\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"isOpen() ? ChevronUp : ChevronDown\" [size]=\"iconSize()\" />\n </span>\n</div>\n\n<!-- Dropdown panel -->\n@if (isOpen()) {\n <div\n class=\"ngx-select__panel\"\n [id]=\"id + '-panel'\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"multiple()\"\n >\n <!-- Search -->\n @if (searchable()) {\n <div class=\"ngx-select__search\">\n <ngx-ds-icon [icon]=\"SearchIcon\" [size]=\"14\" class=\"ngx-select__search-icon\" />\n <input\n class=\"ngx-select__search-input\"\n type=\"text\"\n [placeholder]=\"i18n.searchPlaceholder\"\n [value]=\"searchText()\"\n (input)=\"onSearchChange($any($event.target).value)\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onSearchKeydown($event)\"\n autocomplete=\"off\"\n />\n </div>\n }\n\n <!-- Select all (multiple only) -->\n @if (multiple() && !searchText()) {\n <button\n type=\"button\"\n class=\"ngx-select__select-all\"\n (click)=\"selectAll(); $event.stopPropagation()\"\n >\n {{ i18n.selectAll }}\n </button>\n }\n\n <!-- Options -->\n <ul class=\"ngx-select__options\" role=\"presentation\">\n @for (option of filteredOptions(); track option.value) {\n <li\n class=\"ngx-select__option\"\n [class.ngx-select__option--selected]=\"isSelected(option.value)\"\n [class.ngx-select__option--disabled]=\"option.disabled\"\n role=\"option\"\n tabindex=\"-1\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [attr.aria-disabled]=\"option.disabled || null\"\n (click)=\"selectOption(option); $event.stopPropagation()\"\n (keydown)=\"onOptionKeydown($event, option)\"\n >\n @if (multiple()) {\n <span\n class=\"ngx-select__checkbox\"\n [class.ngx-select__checkbox--checked]=\"isSelected(option.value)\"\n aria-hidden=\"true\"\n ></span>\n } @else {\n <span class=\"ngx-select__check\">\n @if (isSelected(option.value)) {\n <ngx-ds-icon [icon]=\"CheckIcon\" [size]=\"14\" />\n }\n </span>\n }\n <span class=\"ngx-select__option-label\">{{ option.label }}</span>\n </li>\n } @empty {\n <li class=\"ngx-select__empty\">{{ i18n.noResults }}</li>\n }\n </ul>\n </div>\n}\n\n<!-- Hint / Error -->\n@if (errorText()) {\n <p [id]=\"messageId\" class=\"ngx-select__message ngx-select__message--error\" role=\"alert\">\n {{ errorText() }}\n </p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-select__message ngx-select__message--hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;position:relative;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-select__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-select__trigger{position:relative;display:flex;align-items:center;gap:.375rem;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color .15s ease,box-shadow .15s ease;min-height:2.375rem}.ngx-select__trigger--focused,.ngx-select__trigger--open{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-select__trigger--error{border-color:var(--danger-500, #ef4444)}.ngx-select__trigger--error.ngx-select__trigger--open,.ngx-select__trigger--error.ngx-select__trigger--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-select__trigger--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed;color:var(--text-placeholder, #9ca3af)}.ngx-select__trigger--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-select__trigger--md{padding:.5rem .75rem;font-size:.875rem}.ngx-select__trigger--lg{padding:.625rem 1rem;font-size:1rem}.ngx-select__display{flex:1;min-width:0;display:flex;flex-wrap:wrap;gap:.25rem;align-items:center}.ngx-select__value{color:var(--text-base, #111827);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ngx-select__placeholder{color:var(--text-placeholder, #9ca3af);white-space:nowrap}.ngx-select__tag{display:inline-flex;align-items:center;gap:.25rem;padding:.125rem .375rem;background:var(--primary-100, #e0e7ff);color:var(--primary-700, #4338ca);border-radius:.25rem;font-size:.75rem;font-weight:500;white-space:nowrap}.ngx-select__tag-remove{display:inline-flex;align-items:center;padding:0;background:transparent;border:none;cursor:pointer;color:inherit;opacity:.7}.ngx-select__tag-remove:hover{opacity:1}.ngx-select__clear{display:inline-flex;align-items:center;padding:0;background:transparent;border:none;cursor:pointer;color:var(--text-placeholder, #9ca3af);flex-shrink:0}.ngx-select__clear:hover{color:var(--text-muted, #6b7280)}.ngx-select__chevron{display:inline-flex;align-items:center;flex-shrink:0;color:var(--text-placeholder, #9ca3af)}.ngx-select__float-label{position:absolute;left:.75rem;top:50%;transform:translateY(-50%);font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-select__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1)}.ngx-select__float-label--focused:not(.ngx-select__float-label--error){color:var(--primary-500, #6366f1)}.ngx-select__float-label--error{color:var(--danger-500, #ef4444)}.ngx-select__panel{position:absolute;top:calc(100% + .25rem);left:0;right:0;z-index:100;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;box-shadow:0 4px 16px #0000001a;overflow:hidden}.ngx-select__search{display:flex;align-items:center;gap:.375rem;padding:.375rem .75rem;border-bottom:1px solid var(--border-subtle, #f3f4f6)}.ngx-select__search-icon{color:var(--text-placeholder, #9ca3af);flex-shrink:0}.ngx-select__search-input{flex:1;border:none;outline:none;font-size:.8125rem;color:var(--text-base, #111827);background:transparent;font-family:inherit}.ngx-select__search-input::placeholder{color:var(--text-placeholder, #9ca3af)}.ngx-select__select-all{display:block;width:100%;padding:.375rem .75rem;text-align:left;background:transparent;border:none;border-bottom:1px solid var(--border-subtle, #f3f4f6);font-size:.8125rem;color:var(--primary-500, #6366f1);font-weight:500;cursor:pointer;font-family:inherit}.ngx-select__select-all:hover{background:var(--primary-50, #eef2ff)}.ngx-select__options{list-style:none;margin:0;padding:.25rem 0;max-height:14rem;overflow-y:auto}.ngx-select__option{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;font-size:.875rem;color:var(--text-secondary, #374151);cursor:pointer;transition:background .1s ease}.ngx-select__option:hover:not(.ngx-select__option--disabled){background:var(--surface-subtle, #f9fafb)}.ngx-select__option--selected:not(.ngx-select__option--disabled){color:var(--primary-700, #4338ca);background:var(--primary-50, #eef2ff)}.ngx-select__option--disabled{color:var(--text-placeholder, #9ca3af);cursor:not-allowed}.ngx-select__option-label{flex:1}.ngx-select__checkbox{flex-shrink:0;width:1rem;height:1rem;border:1.5px solid var(--border-input, #d1d5db);border-radius:.2rem;background:var(--surface-base, #fff);position:relative;transition:border-color .1s,background .1s}.ngx-select__checkbox--checked{border-color:var(--primary-500, #6366f1);background:var(--primary-500, #6366f1)}.ngx-select__checkbox--checked:after{content:\"\";position:absolute;left:.2rem;top:.05rem;width:.35rem;height:.55rem;border:2px solid var(--text-on-color, #fff);border-top:none;border-left:none;transform:rotate(45deg)}.ngx-select__check{flex-shrink:0;width:1rem;height:1rem;display:flex;align-items:center;justify-content:center;color:var(--primary-500, #6366f1)}.ngx-select__empty{padding:.75rem;text-align:center;font-size:.875rem;color:var(--text-placeholder, #9ca3af)}.ngx-select__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-select__message--hint{color:var(--text-muted, #6b7280)}.ngx-select__message--error{color:var(--danger-500, #ef4444)}\n"] }]
|
|
1686
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], floatingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatingLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], triggerRef: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }] } });
|
|
1621
1687
|
|
|
1622
|
-
const ICON_SIZE$
|
|
1623
|
-
let nextId$
|
|
1688
|
+
const ICON_SIZE$8 = { sm: 14, md: 16, lg: 18 };
|
|
1689
|
+
let nextId$d = 0;
|
|
1624
1690
|
class DropdownComponent {
|
|
1625
1691
|
i18n = inject(NGX_DS_LABELS);
|
|
1626
1692
|
// ── Configuration ──────────────────────────────────────────
|
|
@@ -1631,9 +1697,13 @@ class DropdownComponent {
|
|
|
1631
1697
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1632
1698
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
1633
1699
|
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
1700
|
+
/** Set by Signal Forms `[formField]`. Its errors show once the field is touched. */
|
|
1701
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
1702
|
+
touched = input(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
1634
1703
|
// ── Value ─────────────────────────────────────────────────
|
|
1635
1704
|
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1636
|
-
id = `ngx-dropdown-${nextId$
|
|
1705
|
+
id = `ngx-dropdown-${nextId$d++}`;
|
|
1706
|
+
messageId = `${this.id}-message`;
|
|
1637
1707
|
// ── Icons ──────────────────────────────────────────────────
|
|
1638
1708
|
ChevronDown = ChevronDown;
|
|
1639
1709
|
ChevronUp = ChevronUp;
|
|
@@ -1645,8 +1715,9 @@ class DropdownComponent {
|
|
|
1645
1715
|
#focused = signal(false, ...(ngDevMode ? [{ debugName: "#focused" }] : /* istanbul ignore next */ []));
|
|
1646
1716
|
isOpen = this.#open.asReadonly();
|
|
1647
1717
|
isDisabled = this.#disabled.asReadonly();
|
|
1648
|
-
iconSize = computed(() => ICON_SIZE$
|
|
1649
|
-
hasError = computed(() => this.errorMessage().
|
|
1718
|
+
iconSize = computed(() => ICON_SIZE$8[this.size()], ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
1719
|
+
hasError = computed(() => fieldHasError(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
1720
|
+
errorText = computed(() => fieldErrorText(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
1650
1721
|
hasValue = computed(() => this.value() !== null && this.value() !== undefined, ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
1651
1722
|
isFloating = computed(() => this.#focused() || this.hasValue(), ...(ngDevMode ? [{ debugName: "isFloating" }] : /* istanbul ignore next */ []));
|
|
1652
1723
|
displayText = computed(() => {
|
|
@@ -1767,13 +1838,13 @@ class DropdownComponent {
|
|
|
1767
1838
|
this.#disabled.set(disabled);
|
|
1768
1839
|
}
|
|
1769
1840
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1770
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: DropdownComponent, isStandalone: true, selector: "ngx-ds-dropdown", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, floatingLabel: { classPropertyName: "floatingLabel", publicName: "floatingLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
1841
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: DropdownComponent, isStandalone: true, selector: "ngx-ds-dropdown", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, floatingLabel: { classPropertyName: "floatingLabel", publicName: "floatingLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
1771
1842
|
{
|
|
1772
1843
|
provide: NG_VALUE_ACCESSOR,
|
|
1773
1844
|
useExisting: forwardRef(() => DropdownComponent),
|
|
1774
1845
|
multi: true,
|
|
1775
1846
|
},
|
|
1776
|
-
], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-dropdown__label\">{{ label() }}</label>\n}\n\n<!-- Trigger -->\n<div\n #trigger\n [class]=\"triggerClasses()\"\n (click)=\"togglePanel()\"\n (keydown)=\"onTriggerKeydown($event)\"\n [attr.id]=\"id\"\n role=\"combobox\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled()\"\n>\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <span [class]=\"floatLabelClasses()\">{{ label() }}</span>\n }\n\n <!-- Display area -->\n <span class=\"ngx-dropdown__display\">\n @if (displayText()) {\n <span class=\"ngx-dropdown__value\">{{ displayText() }}</span>\n } @else {\n <span class=\"ngx-dropdown__placeholder\">{{ placeholder() ?? i18n.selectPlaceholder }}</span>\n }\n </span>\n\n <!-- Clear button -->\n @if (hasValue() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-dropdown__clear\"\n [attr.aria-label]=\"i18n.clearSelection\"\n (click)=\"clearValue($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n\n <!-- Chevron -->\n <span class=\"ngx-dropdown__chevron\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"isOpen() ? ChevronUp : ChevronDown\" [size]=\"iconSize()\" />\n </span>\n</div>\n\n<!-- Dropdown panel -->\n@if (isOpen()) {\n <div class=\"ngx-dropdown__panel\" [id]=\"id + '-panel'\" role=\"listbox\">\n <ul class=\"ngx-dropdown__options\" role=\"presentation\">\n @for (option of options(); track option.value) {\n <li\n class=\"ngx-dropdown__option\"\n [class.ngx-dropdown__option--selected]=\"isSelected(option.value)\"\n [class.ngx-dropdown__option--disabled]=\"option.disabled\"\n role=\"option\"\n tabindex=\"-1\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [attr.aria-disabled]=\"option.disabled || null\"\n (click)=\"selectOption(option); $event.stopPropagation()\"\n (keydown)=\"onOptionKeydown($event, option)\"\n >\n <span class=\"ngx-dropdown__check\">\n @if (isSelected(option.value)) {\n <ngx-ds-icon [icon]=\"CheckIcon\" [size]=\"14\" />\n }\n </span>\n <span class=\"ngx-dropdown__option-label\">{{ option.label }}</span>\n </li>\n } @empty {\n <li class=\"ngx-dropdown__empty\">{{ i18n.noOptions }}</li>\n }\n </ul>\n </div>\n}\n\n<!-- Hint / Error -->\n@if (
|
|
1847
|
+
], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-dropdown__label\">{{ label() }}</label>\n}\n\n<!-- Trigger -->\n<div\n #trigger\n [class]=\"triggerClasses()\"\n (click)=\"togglePanel()\"\n (keydown)=\"onTriggerKeydown($event)\"\n [attr.id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n role=\"combobox\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled()\"\n>\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <span [class]=\"floatLabelClasses()\">{{ label() }}</span>\n }\n\n <!-- Display area -->\n <span class=\"ngx-dropdown__display\">\n @if (displayText()) {\n <span class=\"ngx-dropdown__value\">{{ displayText() }}</span>\n } @else {\n <span class=\"ngx-dropdown__placeholder\">{{ placeholder() ?? i18n.selectPlaceholder }}</span>\n }\n </span>\n\n <!-- Clear button -->\n @if (hasValue() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-dropdown__clear\"\n [attr.aria-label]=\"i18n.clearSelection\"\n (click)=\"clearValue($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n\n <!-- Chevron -->\n <span class=\"ngx-dropdown__chevron\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"isOpen() ? ChevronUp : ChevronDown\" [size]=\"iconSize()\" />\n </span>\n</div>\n\n<!-- Dropdown panel -->\n@if (isOpen()) {\n <div class=\"ngx-dropdown__panel\" [id]=\"id + '-panel'\" role=\"listbox\">\n <ul class=\"ngx-dropdown__options\" role=\"presentation\">\n @for (option of options(); track option.value) {\n <li\n class=\"ngx-dropdown__option\"\n [class.ngx-dropdown__option--selected]=\"isSelected(option.value)\"\n [class.ngx-dropdown__option--disabled]=\"option.disabled\"\n role=\"option\"\n tabindex=\"-1\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [attr.aria-disabled]=\"option.disabled || null\"\n (click)=\"selectOption(option); $event.stopPropagation()\"\n (keydown)=\"onOptionKeydown($event, option)\"\n >\n <span class=\"ngx-dropdown__check\">\n @if (isSelected(option.value)) {\n <ngx-ds-icon [icon]=\"CheckIcon\" [size]=\"14\" />\n }\n </span>\n <span class=\"ngx-dropdown__option-label\">{{ option.label }}</span>\n </li>\n } @empty {\n <li class=\"ngx-dropdown__empty\">{{ i18n.noOptions }}</li>\n }\n </ul>\n </div>\n}\n\n<!-- Hint / Error -->\n@if (errorText()) {\n <p [id]=\"messageId\" class=\"ngx-dropdown__message ngx-dropdown__message--error\" role=\"alert\">\n {{ errorText() }}\n </p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-dropdown__message ngx-dropdown__message--hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;position:relative;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-dropdown__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-dropdown__trigger{position:relative;display:flex;align-items:center;gap:.5rem;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color .15s ease,box-shadow .15s ease;min-height:2.375rem}.ngx-dropdown__trigger--focused,.ngx-dropdown__trigger--open{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-dropdown__trigger--error{border-color:var(--danger-500, #ef4444)}.ngx-dropdown__trigger--error.ngx-dropdown__trigger--open,.ngx-dropdown__trigger--error.ngx-dropdown__trigger--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-dropdown__trigger--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed;color:var(--text-placeholder, #9ca3af)}.ngx-dropdown__trigger--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-dropdown__trigger--md{padding:.5rem .75rem;font-size:.875rem}.ngx-dropdown__trigger--lg{padding:.625rem 1rem;font-size:1rem}.ngx-dropdown__display{flex:1;min-width:0;overflow:hidden}.ngx-dropdown__value{display:block;color:var(--text-base, #111827);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ngx-dropdown__placeholder{display:block;color:var(--text-placeholder, #9ca3af);white-space:nowrap}.ngx-dropdown__clear{display:inline-flex;align-items:center;padding:0;background:transparent;border:none;cursor:pointer;color:var(--text-placeholder, #9ca3af);flex-shrink:0}.ngx-dropdown__clear:hover{color:var(--text-muted, #6b7280)}.ngx-dropdown__chevron{display:inline-flex;align-items:center;flex-shrink:0;color:var(--text-placeholder, #9ca3af)}.ngx-dropdown__float-label{position:absolute;left:.75rem;top:50%;transform:translateY(-50%);font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-dropdown__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1)}.ngx-dropdown__float-label--focused:not(.ngx-dropdown__float-label--error){color:var(--primary-500, #6366f1)}.ngx-dropdown__float-label--error{color:var(--danger-500, #ef4444)}.ngx-dropdown__panel{position:absolute;top:calc(100% + .25rem);left:0;right:0;z-index:100;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;box-shadow:0 4px 16px #0000001a;overflow:hidden}.ngx-dropdown__options{list-style:none;margin:0;padding:.25rem 0;max-height:14rem;overflow-y:auto}.ngx-dropdown__option{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;font-size:.875rem;color:var(--text-secondary, #374151);cursor:pointer;transition:background .1s ease}.ngx-dropdown__option:hover:not(.ngx-dropdown__option--disabled){background:var(--surface-subtle, #f9fafb)}.ngx-dropdown__option--selected:not(.ngx-dropdown__option--disabled){color:var(--primary-700, #4338ca);background:var(--primary-50, #eef2ff)}.ngx-dropdown__option--disabled{color:var(--text-placeholder, #9ca3af);cursor:not-allowed}.ngx-dropdown__option-label{flex:1}.ngx-dropdown__check{flex-shrink:0;width:1rem;height:1rem;display:flex;align-items:center;justify-content:center;color:var(--primary-500, #6366f1)}.ngx-dropdown__empty{padding:.75rem;text-align:center;font-size:.875rem;color:var(--text-placeholder, #9ca3af)}.ngx-dropdown__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-dropdown__message--hint{color:var(--text-muted, #6b7280)}.ngx-dropdown__message--error{color:var(--danger-500, #ef4444)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1777
1848
|
}
|
|
1778
1849
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DropdownComponent, decorators: [{
|
|
1779
1850
|
type: Component,
|
|
@@ -1783,11 +1854,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
1783
1854
|
useExisting: forwardRef(() => DropdownComponent),
|
|
1784
1855
|
multi: true,
|
|
1785
1856
|
},
|
|
1786
|
-
], template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-dropdown__label\">{{ label() }}</label>\n}\n\n<!-- Trigger -->\n<div\n #trigger\n [class]=\"triggerClasses()\"\n (click)=\"togglePanel()\"\n (keydown)=\"onTriggerKeydown($event)\"\n [attr.id]=\"id\"\n role=\"combobox\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled()\"\n>\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <span [class]=\"floatLabelClasses()\">{{ label() }}</span>\n }\n\n <!-- Display area -->\n <span class=\"ngx-dropdown__display\">\n @if (displayText()) {\n <span class=\"ngx-dropdown__value\">{{ displayText() }}</span>\n } @else {\n <span class=\"ngx-dropdown__placeholder\">{{ placeholder() ?? i18n.selectPlaceholder }}</span>\n }\n </span>\n\n <!-- Clear button -->\n @if (hasValue() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-dropdown__clear\"\n [attr.aria-label]=\"i18n.clearSelection\"\n (click)=\"clearValue($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n\n <!-- Chevron -->\n <span class=\"ngx-dropdown__chevron\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"isOpen() ? ChevronUp : ChevronDown\" [size]=\"iconSize()\" />\n </span>\n</div>\n\n<!-- Dropdown panel -->\n@if (isOpen()) {\n <div class=\"ngx-dropdown__panel\" [id]=\"id + '-panel'\" role=\"listbox\">\n <ul class=\"ngx-dropdown__options\" role=\"presentation\">\n @for (option of options(); track option.value) {\n <li\n class=\"ngx-dropdown__option\"\n [class.ngx-dropdown__option--selected]=\"isSelected(option.value)\"\n [class.ngx-dropdown__option--disabled]=\"option.disabled\"\n role=\"option\"\n tabindex=\"-1\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [attr.aria-disabled]=\"option.disabled || null\"\n (click)=\"selectOption(option); $event.stopPropagation()\"\n (keydown)=\"onOptionKeydown($event, option)\"\n >\n <span class=\"ngx-dropdown__check\">\n @if (isSelected(option.value)) {\n <ngx-ds-icon [icon]=\"CheckIcon\" [size]=\"14\" />\n }\n </span>\n <span class=\"ngx-dropdown__option-label\">{{ option.label }}</span>\n </li>\n } @empty {\n <li class=\"ngx-dropdown__empty\">{{ i18n.noOptions }}</li>\n }\n </ul>\n </div>\n}\n\n<!-- Hint / Error -->\n@if (
|
|
1787
|
-
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], floatingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatingLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], triggerRef: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }] } });
|
|
1857
|
+
], template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-dropdown__label\">{{ label() }}</label>\n}\n\n<!-- Trigger -->\n<div\n #trigger\n [class]=\"triggerClasses()\"\n (click)=\"togglePanel()\"\n (keydown)=\"onTriggerKeydown($event)\"\n [attr.id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n role=\"combobox\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled()\"\n>\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <span [class]=\"floatLabelClasses()\">{{ label() }}</span>\n }\n\n <!-- Display area -->\n <span class=\"ngx-dropdown__display\">\n @if (displayText()) {\n <span class=\"ngx-dropdown__value\">{{ displayText() }}</span>\n } @else {\n <span class=\"ngx-dropdown__placeholder\">{{ placeholder() ?? i18n.selectPlaceholder }}</span>\n }\n </span>\n\n <!-- Clear button -->\n @if (hasValue() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-dropdown__clear\"\n [attr.aria-label]=\"i18n.clearSelection\"\n (click)=\"clearValue($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n\n <!-- Chevron -->\n <span class=\"ngx-dropdown__chevron\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"isOpen() ? ChevronUp : ChevronDown\" [size]=\"iconSize()\" />\n </span>\n</div>\n\n<!-- Dropdown panel -->\n@if (isOpen()) {\n <div class=\"ngx-dropdown__panel\" [id]=\"id + '-panel'\" role=\"listbox\">\n <ul class=\"ngx-dropdown__options\" role=\"presentation\">\n @for (option of options(); track option.value) {\n <li\n class=\"ngx-dropdown__option\"\n [class.ngx-dropdown__option--selected]=\"isSelected(option.value)\"\n [class.ngx-dropdown__option--disabled]=\"option.disabled\"\n role=\"option\"\n tabindex=\"-1\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n [attr.aria-disabled]=\"option.disabled || null\"\n (click)=\"selectOption(option); $event.stopPropagation()\"\n (keydown)=\"onOptionKeydown($event, option)\"\n >\n <span class=\"ngx-dropdown__check\">\n @if (isSelected(option.value)) {\n <ngx-ds-icon [icon]=\"CheckIcon\" [size]=\"14\" />\n }\n </span>\n <span class=\"ngx-dropdown__option-label\">{{ option.label }}</span>\n </li>\n } @empty {\n <li class=\"ngx-dropdown__empty\">{{ i18n.noOptions }}</li>\n }\n </ul>\n </div>\n}\n\n<!-- Hint / Error -->\n@if (errorText()) {\n <p [id]=\"messageId\" class=\"ngx-dropdown__message ngx-dropdown__message--error\" role=\"alert\">\n {{ errorText() }}\n </p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-dropdown__message ngx-dropdown__message--hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;position:relative;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-dropdown__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-dropdown__trigger{position:relative;display:flex;align-items:center;gap:.5rem;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color .15s ease,box-shadow .15s ease;min-height:2.375rem}.ngx-dropdown__trigger--focused,.ngx-dropdown__trigger--open{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-dropdown__trigger--error{border-color:var(--danger-500, #ef4444)}.ngx-dropdown__trigger--error.ngx-dropdown__trigger--open,.ngx-dropdown__trigger--error.ngx-dropdown__trigger--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-dropdown__trigger--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed;color:var(--text-placeholder, #9ca3af)}.ngx-dropdown__trigger--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-dropdown__trigger--md{padding:.5rem .75rem;font-size:.875rem}.ngx-dropdown__trigger--lg{padding:.625rem 1rem;font-size:1rem}.ngx-dropdown__display{flex:1;min-width:0;overflow:hidden}.ngx-dropdown__value{display:block;color:var(--text-base, #111827);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ngx-dropdown__placeholder{display:block;color:var(--text-placeholder, #9ca3af);white-space:nowrap}.ngx-dropdown__clear{display:inline-flex;align-items:center;padding:0;background:transparent;border:none;cursor:pointer;color:var(--text-placeholder, #9ca3af);flex-shrink:0}.ngx-dropdown__clear:hover{color:var(--text-muted, #6b7280)}.ngx-dropdown__chevron{display:inline-flex;align-items:center;flex-shrink:0;color:var(--text-placeholder, #9ca3af)}.ngx-dropdown__float-label{position:absolute;left:.75rem;top:50%;transform:translateY(-50%);font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-dropdown__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1)}.ngx-dropdown__float-label--focused:not(.ngx-dropdown__float-label--error){color:var(--primary-500, #6366f1)}.ngx-dropdown__float-label--error{color:var(--danger-500, #ef4444)}.ngx-dropdown__panel{position:absolute;top:calc(100% + .25rem);left:0;right:0;z-index:100;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;box-shadow:0 4px 16px #0000001a;overflow:hidden}.ngx-dropdown__options{list-style:none;margin:0;padding:.25rem 0;max-height:14rem;overflow-y:auto}.ngx-dropdown__option{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;font-size:.875rem;color:var(--text-secondary, #374151);cursor:pointer;transition:background .1s ease}.ngx-dropdown__option:hover:not(.ngx-dropdown__option--disabled){background:var(--surface-subtle, #f9fafb)}.ngx-dropdown__option--selected:not(.ngx-dropdown__option--disabled){color:var(--primary-700, #4338ca);background:var(--primary-50, #eef2ff)}.ngx-dropdown__option--disabled{color:var(--text-placeholder, #9ca3af);cursor:not-allowed}.ngx-dropdown__option-label{flex:1}.ngx-dropdown__check{flex-shrink:0;width:1rem;height:1rem;display:flex;align-items:center;justify-content:center;color:var(--primary-500, #6366f1)}.ngx-dropdown__empty{padding:.75rem;text-align:center;font-size:.875rem;color:var(--text-placeholder, #9ca3af)}.ngx-dropdown__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-dropdown__message--hint{color:var(--text-muted, #6b7280)}.ngx-dropdown__message--error{color:var(--danger-500, #ef4444)}\n"] }]
|
|
1858
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], floatingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatingLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], triggerRef: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }] } });
|
|
1788
1859
|
|
|
1789
|
-
const ICON_SIZE$
|
|
1790
|
-
let nextId$
|
|
1860
|
+
const ICON_SIZE$7 = { sm: 14, md: 16, lg: 18 };
|
|
1861
|
+
let nextId$c = 0;
|
|
1791
1862
|
class AutocompleteComponent {
|
|
1792
1863
|
i18n = inject(NGX_DS_LABELS);
|
|
1793
1864
|
sanitizer = inject(DomSanitizer);
|
|
@@ -1799,6 +1870,9 @@ class AutocompleteComponent {
|
|
|
1799
1870
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1800
1871
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
1801
1872
|
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
1873
|
+
/** Set by Signal Forms `[formField]`. Its errors show once the field is touched. */
|
|
1874
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
1875
|
+
touched = input(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
1802
1876
|
iconLeft = input(undefined, ...(ngDevMode ? [{ debugName: "iconLeft" }] : /* istanbul ignore next */ []));
|
|
1803
1877
|
/** Show loading spinner — set true while fetching async results */
|
|
1804
1878
|
loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
@@ -1816,7 +1890,8 @@ class AutocompleteComponent {
|
|
|
1816
1890
|
// ── Outputs ──────────────────────────────────────────────
|
|
1817
1891
|
/** Emits the current search string (debounced) — use for async data loading */
|
|
1818
1892
|
searchChange = output();
|
|
1819
|
-
id = `ngx-autocomplete-${nextId$
|
|
1893
|
+
id = `ngx-autocomplete-${nextId$c++}`;
|
|
1894
|
+
messageId = `${this.id}-message`;
|
|
1820
1895
|
// ── Icons ────────────────────────────────────────────────
|
|
1821
1896
|
SearchIcon = Search;
|
|
1822
1897
|
XIcon = X;
|
|
@@ -1832,8 +1907,9 @@ class AutocompleteComponent {
|
|
|
1832
1907
|
searchTimer = null;
|
|
1833
1908
|
inputEl = null;
|
|
1834
1909
|
// ── Derived ──────────────────────────────────────────────
|
|
1835
|
-
iconSize = computed(() => ICON_SIZE$
|
|
1836
|
-
hasError = computed(() => this.errorMessage().
|
|
1910
|
+
iconSize = computed(() => ICON_SIZE$7[this.size()], ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
1911
|
+
hasError = computed(() => fieldHasError(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
1912
|
+
errorText = computed(() => fieldErrorText(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
1837
1913
|
hasValue = computed(() => this.value() !== null && this.value() !== undefined, ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
1838
1914
|
selectedOption = computed(() => {
|
|
1839
1915
|
const v = this.value();
|
|
@@ -2007,13 +2083,13 @@ class AutocompleteComponent {
|
|
|
2007
2083
|
this.#disabled.set(disabled);
|
|
2008
2084
|
}
|
|
2009
2085
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: AutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2010
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: AutocompleteComponent, isStandalone: true, selector: "ngx-ds-autocomplete", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, floatingLabel: { classPropertyName: "floatingLabel", publicName: "floatingLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, iconLeft: { classPropertyName: "iconLeft", publicName: "iconLeft", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, minChars: { classPropertyName: "minChars", publicName: "minChars", isSignal: true, isRequired: false, transformFunction: null }, debounceMs: { classPropertyName: "debounceMs", publicName: "debounceMs", isSignal: true, isRequired: false, transformFunction: null }, allowCustom: { classPropertyName: "allowCustom", publicName: "allowCustom", isSignal: true, isRequired: false, transformFunction: null }, showAllOnFocus: { classPropertyName: "showAllOnFocus", publicName: "showAllOnFocus", isSignal: true, isRequired: false, transformFunction: null }, noResultsText: { classPropertyName: "noResultsText", publicName: "noResultsText", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", searchChange: "searchChange" }, providers: [
|
|
2086
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: AutocompleteComponent, isStandalone: true, selector: "ngx-ds-autocomplete", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, floatingLabel: { classPropertyName: "floatingLabel", publicName: "floatingLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, iconLeft: { classPropertyName: "iconLeft", publicName: "iconLeft", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, minChars: { classPropertyName: "minChars", publicName: "minChars", isSignal: true, isRequired: false, transformFunction: null }, debounceMs: { classPropertyName: "debounceMs", publicName: "debounceMs", isSignal: true, isRequired: false, transformFunction: null }, allowCustom: { classPropertyName: "allowCustom", publicName: "allowCustom", isSignal: true, isRequired: false, transformFunction: null }, showAllOnFocus: { classPropertyName: "showAllOnFocus", publicName: "showAllOnFocus", isSignal: true, isRequired: false, transformFunction: null }, noResultsText: { classPropertyName: "noResultsText", publicName: "noResultsText", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", searchChange: "searchChange" }, providers: [
|
|
2011
2087
|
{
|
|
2012
2088
|
provide: NG_VALUE_ACCESSOR,
|
|
2013
2089
|
useExisting: forwardRef(() => AutocompleteComponent),
|
|
2014
2090
|
multi: true,
|
|
2015
2091
|
},
|
|
2016
|
-
], ngImport: i0, template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-autocomplete__label\">{{ label() }}</label>\n}\n\n<!-- Field container -->\n<div [class]=\"fieldClasses()\">\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <label [for]=\"id\" [class]=\"floatLabelClasses()\">{{ label() }}</label>\n }\n\n <!-- Left icon -->\n @if (iconLeft()) {\n <span class=\"ngx-autocomplete__icon ngx-autocomplete__icon--left\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"iconLeft()!\" [size]=\"iconSize()\" />\n </span>\n }\n\n <!-- Text input -->\n <input\n #nativeInput\n class=\"ngx-autocomplete__native\"\n [id]=\"id\"\n type=\"text\"\n [value]=\"inputText()\"\n [placeholder]=\"\n floatingLabel() && label() && !isFloating() ? '' : (placeholder() ?? i18n.searchPlaceholder)\n \"\n [disabled]=\"isDisabled() || null\"\n autocomplete=\"off\"\n role=\"combobox\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"showPanel()\"\n [attr.aria-autocomplete]=\"'list'\"\n (input)=\"onInputChange($any($event.target).value)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n\n <!-- Loading spinner -->\n @if (loading()) {\n <span class=\"ngx-autocomplete__spinner\" aria-hidden=\"true\">\n <span class=\"ngx-autocomplete__spinner-ring\"></span>\n </span>\n }\n\n <!-- Clear button -->\n @if (hasValue() && !isDisabled() && !loading()) {\n <button\n type=\"button\"\n class=\"ngx-autocomplete__clear\"\n [attr.aria-label]=\"i18n.clear\"\n (mousedown)=\"onClear($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n</div>\n\n<!-- Dropdown panel -->\n@if (showPanel()) {\n <div class=\"ngx-autocomplete__panel\" role=\"listbox\" [id]=\"id + '-panel'\">\n <ul class=\"ngx-autocomplete__options\" role=\"presentation\">\n @for (option of filteredOptions(); track option.value) {\n <li\n class=\"ngx-autocomplete__option\"\n [class.ngx-autocomplete__option--selected]=\"isSelected(option.value)\"\n [class.ngx-autocomplete__option--disabled]=\"option.disabled\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n (mousedown)=\"onOptionSelect(option)\"\n >\n <span [innerHTML]=\"getHighlightedLabel(option.label)\"></span>\n @if (isSelected(option.value)) {\n <span class=\"ngx-autocomplete__check\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"SearchIcon\" [size]=\"12\" />\n </span>\n }\n </li>\n } @empty {\n @if (!loading()) {\n <li class=\"ngx-autocomplete__empty\">{{ noResultsText() ?? i18n.noResults }}</li>\n }\n }\n </ul>\n @if (loading() && filteredOptions().length === 0) {\n <p class=\"ngx-autocomplete__loading-text\">{{ i18n.searching }}</p>\n }\n </div>\n}\n\n<!-- Error / Hint -->\n@if (
|
|
2092
|
+
], ngImport: i0, template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-autocomplete__label\">{{ label() }}</label>\n}\n\n<!-- Field container -->\n<div [class]=\"fieldClasses()\">\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <label [for]=\"id\" [class]=\"floatLabelClasses()\">{{ label() }}</label>\n }\n\n <!-- Left icon -->\n @if (iconLeft()) {\n <span class=\"ngx-autocomplete__icon ngx-autocomplete__icon--left\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"iconLeft()!\" [size]=\"iconSize()\" />\n </span>\n }\n\n <!-- Text input -->\n <input\n #nativeInput\n class=\"ngx-autocomplete__native\"\n [id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n type=\"text\"\n [value]=\"inputText()\"\n [placeholder]=\"\n floatingLabel() && label() && !isFloating() ? '' : (placeholder() ?? i18n.searchPlaceholder)\n \"\n [disabled]=\"isDisabled() || null\"\n autocomplete=\"off\"\n role=\"combobox\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"showPanel()\"\n [attr.aria-autocomplete]=\"'list'\"\n (input)=\"onInputChange($any($event.target).value)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n\n <!-- Loading spinner -->\n @if (loading()) {\n <span class=\"ngx-autocomplete__spinner\" aria-hidden=\"true\">\n <span class=\"ngx-autocomplete__spinner-ring\"></span>\n </span>\n }\n\n <!-- Clear button -->\n @if (hasValue() && !isDisabled() && !loading()) {\n <button\n type=\"button\"\n class=\"ngx-autocomplete__clear\"\n [attr.aria-label]=\"i18n.clear\"\n (mousedown)=\"onClear($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n</div>\n\n<!-- Dropdown panel -->\n@if (showPanel()) {\n <div class=\"ngx-autocomplete__panel\" role=\"listbox\" [id]=\"id + '-panel'\">\n <ul class=\"ngx-autocomplete__options\" role=\"presentation\">\n @for (option of filteredOptions(); track option.value) {\n <li\n class=\"ngx-autocomplete__option\"\n [class.ngx-autocomplete__option--selected]=\"isSelected(option.value)\"\n [class.ngx-autocomplete__option--disabled]=\"option.disabled\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n (mousedown)=\"onOptionSelect(option)\"\n >\n <span [innerHTML]=\"getHighlightedLabel(option.label)\"></span>\n @if (isSelected(option.value)) {\n <span class=\"ngx-autocomplete__check\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"SearchIcon\" [size]=\"12\" />\n </span>\n }\n </li>\n } @empty {\n @if (!loading()) {\n <li class=\"ngx-autocomplete__empty\">{{ noResultsText() ?? i18n.noResults }}</li>\n }\n }\n </ul>\n @if (loading() && filteredOptions().length === 0) {\n <p class=\"ngx-autocomplete__loading-text\">{{ i18n.searching }}</p>\n }\n </div>\n}\n\n<!-- Error / Hint -->\n@if (errorText()) {\n <p\n [id]=\"messageId\"\n class=\"ngx-autocomplete__message ngx-autocomplete__message--error\"\n role=\"alert\"\n >\n {{ errorText() }}\n </p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-autocomplete__message ngx-autocomplete__message--hint\">\n {{ hint() }}\n </p>\n}\n", styles: [":host{display:block;position:relative;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-autocomplete__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-autocomplete__field{position:relative;display:flex;align-items:center;gap:.5rem;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;transition:border-color .15s ease,box-shadow .15s ease}.ngx-autocomplete__field--focused{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-autocomplete__field--error{border-color:var(--danger-500, #ef4444)}.ngx-autocomplete__field--error.ngx-autocomplete__field--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-autocomplete__field--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed}.ngx-autocomplete__field--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-autocomplete__field--md{padding:.5rem .75rem;font-size:.875rem}.ngx-autocomplete__field--lg{padding:.625rem 1rem;font-size:1rem}.ngx-autocomplete__native{flex:1;min-width:0;padding:0;background:transparent;border:none;outline:none;color:var(--text-base, #111827);font-family:inherit;font-size:inherit;line-height:1.5}.ngx-autocomplete__native::placeholder{color:var(--text-placeholder, #9ca3af)}.ngx-autocomplete__native:disabled{cursor:not-allowed;color:var(--text-muted, #6b7280)}.ngx-autocomplete__icon{display:inline-flex;align-items:center;flex-shrink:0;color:var(--text-placeholder, #9ca3af)}.ngx-autocomplete__clear{display:inline-flex;align-items:center;flex-shrink:0;padding:0;background:transparent;border:none;cursor:pointer;color:var(--text-placeholder, #9ca3af);transition:color .15s ease}.ngx-autocomplete__clear:hover{color:var(--text-muted, #6b7280)}.ngx-autocomplete__float-label{position:absolute;left:.75rem;top:50%;transform:translateY(-50%);font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-autocomplete__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1)}.ngx-autocomplete__float-label--offset{left:2.25rem}.ngx-autocomplete__float-label--focused:not(.ngx-autocomplete__float-label--error){color:var(--primary-500, #6366f1)}.ngx-autocomplete__float-label--error{color:var(--danger-500, #ef4444)}.ngx-autocomplete__spinner{display:inline-flex;align-items:center;flex-shrink:0}.ngx-autocomplete__spinner-ring{display:block;width:1rem;height:1rem;border:2px solid var(--surface-active, #e5e7eb);border-top-color:var(--primary-500, #6366f1);border-radius:50%;animation:ngx-spin .7s linear infinite}@keyframes ngx-spin{to{transform:rotate(360deg)}}.ngx-autocomplete__panel{position:absolute;top:calc(100% + .25rem);left:0;right:0;z-index:100;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;box-shadow:0 4px 16px #0000001a;overflow:hidden}.ngx-autocomplete__options{list-style:none;margin:0;padding:.25rem 0;max-height:14rem;overflow-y:auto}.ngx-autocomplete__option{display:flex;align-items:center;justify-content:space-between;padding:.5rem .75rem;font-size:.875rem;color:var(--text-secondary, #374151);cursor:pointer;transition:background .1s ease}.ngx-autocomplete__option:hover:not(.ngx-autocomplete__option--disabled){background:var(--surface-subtle, #f9fafb)}.ngx-autocomplete__option--selected:not(.ngx-autocomplete__option--disabled){color:var(--primary-700, #4338ca);background:var(--primary-50, #eef2ff)}.ngx-autocomplete__option--disabled{color:var(--text-placeholder, #9ca3af);cursor:not-allowed}.ngx-autocomplete__highlight{background:var(--warning-200, #fde68a);color:var(--warning-800, #92400e);border-radius:.125rem;font-style:normal;font-weight:600;padding:0 .1rem}.ngx-autocomplete__check{flex-shrink:0;color:var(--primary-500, #6366f1);display:inline-flex;align-items:center}.ngx-autocomplete__empty,.ngx-autocomplete__loading-text{padding:.75rem;text-align:center;font-size:.875rem;color:var(--text-placeholder, #9ca3af)}.ngx-autocomplete__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-autocomplete__message--hint{color:var(--text-muted, #6b7280)}.ngx-autocomplete__message--error{color:var(--danger-500, #ef4444)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2017
2093
|
}
|
|
2018
2094
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: AutocompleteComponent, decorators: [{
|
|
2019
2095
|
type: Component,
|
|
@@ -2023,8 +2099,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
2023
2099
|
useExisting: forwardRef(() => AutocompleteComponent),
|
|
2024
2100
|
multi: true,
|
|
2025
2101
|
},
|
|
2026
|
-
], template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-autocomplete__label\">{{ label() }}</label>\n}\n\n<!-- Field container -->\n<div [class]=\"fieldClasses()\">\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <label [for]=\"id\" [class]=\"floatLabelClasses()\">{{ label() }}</label>\n }\n\n <!-- Left icon -->\n @if (iconLeft()) {\n <span class=\"ngx-autocomplete__icon ngx-autocomplete__icon--left\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"iconLeft()!\" [size]=\"iconSize()\" />\n </span>\n }\n\n <!-- Text input -->\n <input\n #nativeInput\n class=\"ngx-autocomplete__native\"\n [id]=\"id\"\n type=\"text\"\n [value]=\"inputText()\"\n [placeholder]=\"\n floatingLabel() && label() && !isFloating() ? '' : (placeholder() ?? i18n.searchPlaceholder)\n \"\n [disabled]=\"isDisabled() || null\"\n autocomplete=\"off\"\n role=\"combobox\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"showPanel()\"\n [attr.aria-autocomplete]=\"'list'\"\n (input)=\"onInputChange($any($event.target).value)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n\n <!-- Loading spinner -->\n @if (loading()) {\n <span class=\"ngx-autocomplete__spinner\" aria-hidden=\"true\">\n <span class=\"ngx-autocomplete__spinner-ring\"></span>\n </span>\n }\n\n <!-- Clear button -->\n @if (hasValue() && !isDisabled() && !loading()) {\n <button\n type=\"button\"\n class=\"ngx-autocomplete__clear\"\n [attr.aria-label]=\"i18n.clear\"\n (mousedown)=\"onClear($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n</div>\n\n<!-- Dropdown panel -->\n@if (showPanel()) {\n <div class=\"ngx-autocomplete__panel\" role=\"listbox\" [id]=\"id + '-panel'\">\n <ul class=\"ngx-autocomplete__options\" role=\"presentation\">\n @for (option of filteredOptions(); track option.value) {\n <li\n class=\"ngx-autocomplete__option\"\n [class.ngx-autocomplete__option--selected]=\"isSelected(option.value)\"\n [class.ngx-autocomplete__option--disabled]=\"option.disabled\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n (mousedown)=\"onOptionSelect(option)\"\n >\n <span [innerHTML]=\"getHighlightedLabel(option.label)\"></span>\n @if (isSelected(option.value)) {\n <span class=\"ngx-autocomplete__check\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"SearchIcon\" [size]=\"12\" />\n </span>\n }\n </li>\n } @empty {\n @if (!loading()) {\n <li class=\"ngx-autocomplete__empty\">{{ noResultsText() ?? i18n.noResults }}</li>\n }\n }\n </ul>\n @if (loading() && filteredOptions().length === 0) {\n <p class=\"ngx-autocomplete__loading-text\">{{ i18n.searching }}</p>\n }\n </div>\n}\n\n<!-- Error / Hint -->\n@if (
|
|
2027
|
-
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], floatingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatingLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], iconLeft: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconLeft", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], minChars: [{ type: i0.Input, args: [{ isSignal: true, alias: "minChars", required: false }] }], debounceMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceMs", required: false }] }], allowCustom: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowCustom", required: false }] }], showAllOnFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAllOnFocus", required: false }] }], noResultsText: [{ type: i0.Input, args: [{ isSignal: true, alias: "noResultsText", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], searchChange: [{ type: i0.Output, args: ["searchChange"] }] } });
|
|
2102
|
+
], template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-autocomplete__label\">{{ label() }}</label>\n}\n\n<!-- Field container -->\n<div [class]=\"fieldClasses()\">\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <label [for]=\"id\" [class]=\"floatLabelClasses()\">{{ label() }}</label>\n }\n\n <!-- Left icon -->\n @if (iconLeft()) {\n <span class=\"ngx-autocomplete__icon ngx-autocomplete__icon--left\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"iconLeft()!\" [size]=\"iconSize()\" />\n </span>\n }\n\n <!-- Text input -->\n <input\n #nativeInput\n class=\"ngx-autocomplete__native\"\n [id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n type=\"text\"\n [value]=\"inputText()\"\n [placeholder]=\"\n floatingLabel() && label() && !isFloating() ? '' : (placeholder() ?? i18n.searchPlaceholder)\n \"\n [disabled]=\"isDisabled() || null\"\n autocomplete=\"off\"\n role=\"combobox\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"showPanel()\"\n [attr.aria-autocomplete]=\"'list'\"\n (input)=\"onInputChange($any($event.target).value)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n\n <!-- Loading spinner -->\n @if (loading()) {\n <span class=\"ngx-autocomplete__spinner\" aria-hidden=\"true\">\n <span class=\"ngx-autocomplete__spinner-ring\"></span>\n </span>\n }\n\n <!-- Clear button -->\n @if (hasValue() && !isDisabled() && !loading()) {\n <button\n type=\"button\"\n class=\"ngx-autocomplete__clear\"\n [attr.aria-label]=\"i18n.clear\"\n (mousedown)=\"onClear($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n</div>\n\n<!-- Dropdown panel -->\n@if (showPanel()) {\n <div class=\"ngx-autocomplete__panel\" role=\"listbox\" [id]=\"id + '-panel'\">\n <ul class=\"ngx-autocomplete__options\" role=\"presentation\">\n @for (option of filteredOptions(); track option.value) {\n <li\n class=\"ngx-autocomplete__option\"\n [class.ngx-autocomplete__option--selected]=\"isSelected(option.value)\"\n [class.ngx-autocomplete__option--disabled]=\"option.disabled\"\n role=\"option\"\n [attr.aria-selected]=\"isSelected(option.value)\"\n (mousedown)=\"onOptionSelect(option)\"\n >\n <span [innerHTML]=\"getHighlightedLabel(option.label)\"></span>\n @if (isSelected(option.value)) {\n <span class=\"ngx-autocomplete__check\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"SearchIcon\" [size]=\"12\" />\n </span>\n }\n </li>\n } @empty {\n @if (!loading()) {\n <li class=\"ngx-autocomplete__empty\">{{ noResultsText() ?? i18n.noResults }}</li>\n }\n }\n </ul>\n @if (loading() && filteredOptions().length === 0) {\n <p class=\"ngx-autocomplete__loading-text\">{{ i18n.searching }}</p>\n }\n </div>\n}\n\n<!-- Error / Hint -->\n@if (errorText()) {\n <p\n [id]=\"messageId\"\n class=\"ngx-autocomplete__message ngx-autocomplete__message--error\"\n role=\"alert\"\n >\n {{ errorText() }}\n </p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-autocomplete__message ngx-autocomplete__message--hint\">\n {{ hint() }}\n </p>\n}\n", styles: [":host{display:block;position:relative;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-autocomplete__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-autocomplete__field{position:relative;display:flex;align-items:center;gap:.5rem;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;transition:border-color .15s ease,box-shadow .15s ease}.ngx-autocomplete__field--focused{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-autocomplete__field--error{border-color:var(--danger-500, #ef4444)}.ngx-autocomplete__field--error.ngx-autocomplete__field--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-autocomplete__field--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed}.ngx-autocomplete__field--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-autocomplete__field--md{padding:.5rem .75rem;font-size:.875rem}.ngx-autocomplete__field--lg{padding:.625rem 1rem;font-size:1rem}.ngx-autocomplete__native{flex:1;min-width:0;padding:0;background:transparent;border:none;outline:none;color:var(--text-base, #111827);font-family:inherit;font-size:inherit;line-height:1.5}.ngx-autocomplete__native::placeholder{color:var(--text-placeholder, #9ca3af)}.ngx-autocomplete__native:disabled{cursor:not-allowed;color:var(--text-muted, #6b7280)}.ngx-autocomplete__icon{display:inline-flex;align-items:center;flex-shrink:0;color:var(--text-placeholder, #9ca3af)}.ngx-autocomplete__clear{display:inline-flex;align-items:center;flex-shrink:0;padding:0;background:transparent;border:none;cursor:pointer;color:var(--text-placeholder, #9ca3af);transition:color .15s ease}.ngx-autocomplete__clear:hover{color:var(--text-muted, #6b7280)}.ngx-autocomplete__float-label{position:absolute;left:.75rem;top:50%;transform:translateY(-50%);font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-autocomplete__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1)}.ngx-autocomplete__float-label--offset{left:2.25rem}.ngx-autocomplete__float-label--focused:not(.ngx-autocomplete__float-label--error){color:var(--primary-500, #6366f1)}.ngx-autocomplete__float-label--error{color:var(--danger-500, #ef4444)}.ngx-autocomplete__spinner{display:inline-flex;align-items:center;flex-shrink:0}.ngx-autocomplete__spinner-ring{display:block;width:1rem;height:1rem;border:2px solid var(--surface-active, #e5e7eb);border-top-color:var(--primary-500, #6366f1);border-radius:50%;animation:ngx-spin .7s linear infinite}@keyframes ngx-spin{to{transform:rotate(360deg)}}.ngx-autocomplete__panel{position:absolute;top:calc(100% + .25rem);left:0;right:0;z-index:100;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;box-shadow:0 4px 16px #0000001a;overflow:hidden}.ngx-autocomplete__options{list-style:none;margin:0;padding:.25rem 0;max-height:14rem;overflow-y:auto}.ngx-autocomplete__option{display:flex;align-items:center;justify-content:space-between;padding:.5rem .75rem;font-size:.875rem;color:var(--text-secondary, #374151);cursor:pointer;transition:background .1s ease}.ngx-autocomplete__option:hover:not(.ngx-autocomplete__option--disabled){background:var(--surface-subtle, #f9fafb)}.ngx-autocomplete__option--selected:not(.ngx-autocomplete__option--disabled){color:var(--primary-700, #4338ca);background:var(--primary-50, #eef2ff)}.ngx-autocomplete__option--disabled{color:var(--text-placeholder, #9ca3af);cursor:not-allowed}.ngx-autocomplete__highlight{background:var(--warning-200, #fde68a);color:var(--warning-800, #92400e);border-radius:.125rem;font-style:normal;font-weight:600;padding:0 .1rem}.ngx-autocomplete__check{flex-shrink:0;color:var(--primary-500, #6366f1);display:inline-flex;align-items:center}.ngx-autocomplete__empty,.ngx-autocomplete__loading-text{padding:.75rem;text-align:center;font-size:.875rem;color:var(--text-placeholder, #9ca3af)}.ngx-autocomplete__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-autocomplete__message--hint{color:var(--text-muted, #6b7280)}.ngx-autocomplete__message--error{color:var(--danger-500, #ef4444)}\n"] }]
|
|
2103
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], floatingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatingLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], iconLeft: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconLeft", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], minChars: [{ type: i0.Input, args: [{ isSignal: true, alias: "minChars", required: false }] }], debounceMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceMs", required: false }] }], allowCustom: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowCustom", required: false }] }], showAllOnFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAllOnFocus", required: false }] }], noResultsText: [{ type: i0.Input, args: [{ isSignal: true, alias: "noResultsText", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], searchChange: [{ type: i0.Output, args: ["searchChange"] }] } });
|
|
2028
2104
|
|
|
2029
2105
|
/** True when both dates fall on the same calendar day. */
|
|
2030
2106
|
function isSameDay(a, b) {
|
|
@@ -2085,8 +2161,8 @@ function moveFocusDate(date, event, firstDayOfWeek = 1) {
|
|
|
2085
2161
|
}
|
|
2086
2162
|
}
|
|
2087
2163
|
|
|
2088
|
-
const ICON_SIZE$
|
|
2089
|
-
let nextId$
|
|
2164
|
+
const ICON_SIZE$6 = { sm: 14, md: 16, lg: 18 };
|
|
2165
|
+
let nextId$b = 0;
|
|
2090
2166
|
class DatepickerComponent {
|
|
2091
2167
|
i18n = inject(NGX_DS_LABELS);
|
|
2092
2168
|
// ── Configuration ─────────────────────────────────────────
|
|
@@ -2096,6 +2172,9 @@ class DatepickerComponent {
|
|
|
2096
2172
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2097
2173
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
2098
2174
|
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
2175
|
+
/** Set by Signal Forms `[formField]`. Its errors show once the field is touched. */
|
|
2176
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
2177
|
+
touched = input(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
2099
2178
|
minDate = input(null, ...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
|
|
2100
2179
|
maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
2101
2180
|
disabledDates = input([], ...(ngDevMode ? [{ debugName: "disabledDates" }] : /* istanbul ignore next */ []));
|
|
@@ -2104,7 +2183,8 @@ class DatepickerComponent {
|
|
|
2104
2183
|
showToday = input(true, ...(ngDevMode ? [{ debugName: "showToday" }] : /* istanbul ignore next */ []));
|
|
2105
2184
|
// ── Value ────────────────────────────────────────────────
|
|
2106
2185
|
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2107
|
-
id = `ngx-datepicker-${nextId$
|
|
2186
|
+
id = `ngx-datepicker-${nextId$b++}`;
|
|
2187
|
+
messageId = `${this.id}-message`;
|
|
2108
2188
|
// ── Icons ────────────────────────────────────────────────
|
|
2109
2189
|
CalendarIcon = Calendar;
|
|
2110
2190
|
XIcon = X;
|
|
@@ -2126,8 +2206,9 @@ class DatepickerComponent {
|
|
|
2126
2206
|
isDisabled = this.#disabled.asReadonly();
|
|
2127
2207
|
isFocused = this.#focused.asReadonly();
|
|
2128
2208
|
// ── Derived ───────────────────────────────────────────────
|
|
2129
|
-
iconSize = computed(() => ICON_SIZE$
|
|
2130
|
-
hasError = computed(() => this.errorMessage().
|
|
2209
|
+
iconSize = computed(() => ICON_SIZE$6[this.size()], ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
2210
|
+
hasError = computed(() => fieldHasError(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
2211
|
+
errorText = computed(() => fieldErrorText(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
2131
2212
|
hasValue = computed(() => this.value() !== null, ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
2132
2213
|
isFloating = computed(() => this.#focused() || this.hasValue(), ...(ngDevMode ? [{ debugName: "isFloating" }] : /* istanbul ignore next */ []));
|
|
2133
2214
|
displayValue = computed(() => {
|
|
@@ -2342,13 +2423,13 @@ class DatepickerComponent {
|
|
|
2342
2423
|
this.#disabled.set(disabled);
|
|
2343
2424
|
}
|
|
2344
2425
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DatepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2345
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: DatepickerComponent, isStandalone: true, selector: "ngx-ds-datepicker", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, floatingLabel: { classPropertyName: "floatingLabel", publicName: "floatingLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: false, transformFunction: null }, disabledDaysOfWeek: { classPropertyName: "disabledDaysOfWeek", publicName: "disabledDaysOfWeek", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, showToday: { classPropertyName: "showToday", publicName: "showToday", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
2426
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: DatepickerComponent, isStandalone: true, selector: "ngx-ds-datepicker", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, floatingLabel: { classPropertyName: "floatingLabel", publicName: "floatingLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, disabledDates: { classPropertyName: "disabledDates", publicName: "disabledDates", isSignal: true, isRequired: false, transformFunction: null }, disabledDaysOfWeek: { classPropertyName: "disabledDaysOfWeek", publicName: "disabledDaysOfWeek", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, showToday: { classPropertyName: "showToday", publicName: "showToday", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
2346
2427
|
{
|
|
2347
2428
|
provide: NG_VALUE_ACCESSOR,
|
|
2348
2429
|
useExisting: forwardRef(() => DatepickerComponent),
|
|
2349
2430
|
multi: true,
|
|
2350
2431
|
},
|
|
2351
|
-
], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "gridRef", first: true, predicate: ["grid"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-datepicker__label\">{{ label() }}</label>\n}\n\n<!-- Field trigger -->\n<div\n #trigger\n [class]=\"fieldClasses()\"\n (click)=\"togglePanel()\"\n (keydown)=\"onTriggerKeydown($event)\"\n [attr.id]=\"id\"\n role=\"button\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled()\"\n>\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <span [class]=\"floatLabelClasses()\">{{ label() }}</span>\n }\n\n <!-- Calendar icon -->\n <span class=\"ngx-datepicker__icon\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"CalendarIcon\" [size]=\"iconSize()\" />\n </span>\n\n <!-- Display value -->\n <span class=\"ngx-datepicker__display\">\n @if (displayValue()) {\n <span class=\"ngx-datepicker__value\">{{ displayValue() }}</span>\n } @else {\n <span class=\"ngx-datepicker__placeholder\">{{ placeholder() ?? i18n.datePlaceholder }}</span>\n }\n </span>\n\n <!-- Clear button -->\n @if (hasValue() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-datepicker__clear\"\n [attr.aria-label]=\"i18n.clearDate\"\n (click)=\"clearValue($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n</div>\n\n<!-- Calendar panel -->\n@if (isOpen()) {\n <div class=\"ngx-datepicker__panel\" role=\"dialog\" [attr.aria-label]=\"i18n.calendar\">\n <!-- Month navigation -->\n <div class=\"ngx-datepicker__header\">\n <button\n type=\"button\"\n class=\"ngx-datepicker__nav\"\n [attr.aria-label]=\"i18n.prevMonth\"\n (click)=\"prevMonth(); $event.stopPropagation()\"\n >\n <ngx-ds-icon [icon]=\"ChevronLeft\" [size]=\"16\" />\n </button>\n <span class=\"ngx-datepicker__header-text\">{{ headerText() }}</span>\n <button\n type=\"button\"\n class=\"ngx-datepicker__nav\"\n [attr.aria-label]=\"i18n.nextMonth\"\n (click)=\"nextMonth(); $event.stopPropagation()\"\n >\n <ngx-ds-icon [icon]=\"ChevronRight\" [size]=\"16\" />\n </button>\n </div>\n\n <!-- Weekday labels -->\n <div class=\"ngx-datepicker__weekdays\" aria-hidden=\"true\">\n @for (day of weekdayLabels(); track day) {\n <span class=\"ngx-datepicker__weekday\">{{ day }}</span>\n }\n </div>\n\n <!-- Day grid -->\n <div #grid class=\"ngx-datepicker__days\" role=\"grid\" [attr.aria-label]=\"headerText()\">\n @for (week of calendarWeeks(); track $index) {\n <div class=\"ngx-datepicker__week\" role=\"row\">\n @for (cell of week; track trackByTime($index, cell)) {\n <button\n type=\"button\"\n class=\"ngx-datepicker__day\"\n [class.ngx-datepicker__day--other-month]=\"!cell.inMonth\"\n [class.ngx-datepicker__day--today]=\"cell.isToday\"\n [class.ngx-datepicker__day--selected]=\"cell.isSelected\"\n [class.ngx-datepicker__day--disabled]=\"cell.isDisabled\"\n [attr.aria-disabled]=\"cell.isDisabled || null\"\n [attr.aria-label]=\"dayLabel(cell.date)\"\n [attr.aria-selected]=\"cell.isSelected\"\n [attr.aria-current]=\"cell.isToday ? 'date' : null\"\n [attr.tabindex]=\"isFocusTarget(cell) ? 0 : -1\"\n role=\"gridcell\"\n (click)=\"selectDate(cell); $event.stopPropagation()\"\n (keydown)=\"onDayKeydown($event, cell)\"\n >\n {{ cell.date.getDate() }}\n </button>\n }\n </div>\n }\n </div>\n\n <!-- Footer -->\n @if (showToday()) {\n <div class=\"ngx-datepicker__footer\">\n <button\n type=\"button\"\n class=\"ngx-datepicker__today-btn\"\n (click)=\"selectToday(); $event.stopPropagation()\"\n >\n Hoy\n </button>\n </div>\n }\n </div>\n}\n\n<!-- Error / Hint -->\n@if (hasError()) {\n <p class=\"ngx-datepicker__message ngx-datepicker__message--error\" role=\"alert\">\n {{ errorMessage() }}\n </p>\n} @else if (hint()) {\n <p class=\"ngx-datepicker__message ngx-datepicker__message--hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;position:relative;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-datepicker__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-datepicker__field{position:relative;display:flex;align-items:center;gap:.5rem;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color .15s ease,box-shadow .15s ease;min-height:2.375rem}.ngx-datepicker__field--focused{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-datepicker__field--error{border-color:var(--danger-500, #ef4444)}.ngx-datepicker__field--error.ngx-datepicker__field--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-datepicker__field--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed;color:var(--text-placeholder, #9ca3af)}.ngx-datepicker__field--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-datepicker__field--md{padding:.5rem .75rem;font-size:.875rem}.ngx-datepicker__field--lg{padding:.625rem 1rem;font-size:1rem}.ngx-datepicker__float-label{position:absolute;left:2.25rem;top:50%;transform:translateY(-50%);font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-datepicker__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1)}.ngx-datepicker__float-label--focused:not(.ngx-datepicker__float-label--error){color:var(--primary-500, #6366f1)}.ngx-datepicker__float-label--error{color:var(--danger-500, #ef4444)}.ngx-datepicker__icon{display:inline-flex;align-items:center;flex-shrink:0;color:var(--text-placeholder, #9ca3af)}.ngx-datepicker__display{flex:1;min-width:0}.ngx-datepicker__value{display:block;color:var(--text-base, #111827);font-variant-numeric:tabular-nums}.ngx-datepicker__placeholder{display:block;color:var(--text-placeholder, #9ca3af)}.ngx-datepicker__clear{display:inline-flex;align-items:center;flex-shrink:0;padding:0;background:transparent;border:none;cursor:pointer;color:var(--text-placeholder, #9ca3af);transition:color .15s ease}.ngx-datepicker__clear:hover{color:var(--text-muted, #6b7280)}.ngx-datepicker__panel{position:absolute;top:calc(100% + .25rem);left:0;z-index:100;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.5rem;box-shadow:0 8px 24px #0000001f;width:17.5rem;overflow:hidden}.ngx-datepicker__header{display:flex;align-items:center;justify-content:space-between;padding:.75rem .625rem .5rem;border-bottom:1px solid var(--border-subtle, #f3f4f6)}.ngx-datepicker__header-text{font-size:.875rem;font-weight:600;color:var(--text-base, #111827);text-transform:capitalize}.ngx-datepicker__nav{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;padding:0;background:transparent;border:none;border-radius:.375rem;cursor:pointer;color:var(--text-muted, #6b7280);transition:background .1s ease,color .1s ease}.ngx-datepicker__nav:hover{background:var(--surface-muted, #f3f4f6);color:var(--text-base, #111827)}.ngx-datepicker__weekdays{display:grid;grid-template-columns:repeat(7,1fr);padding:.375rem .5rem .25rem}.ngx-datepicker__weekday{display:flex;align-items:center;justify-content:center;font-size:.7rem;font-weight:600;color:var(--text-placeholder, #9ca3af);text-transform:uppercase;letter-spacing:.03em}.ngx-datepicker__days{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;padding:0 .5rem .5rem}.ngx-datepicker__week{display:contents}.ngx-datepicker__day{display:flex;align-items:center;justify-content:center;height:2.25rem;padding:0;background:transparent;border:none;border-radius:.375rem;font-size:.8125rem;font-family:inherit;color:var(--text-secondary, #374151);cursor:pointer;transition:background .1s ease,color .1s ease;font-variant-numeric:tabular-nums}.ngx-datepicker__day:focus-visible{outline:2px solid var(--primary-300, #a5b4fc);outline-offset:1px}.ngx-datepicker__day:hover:not(.ngx-datepicker__day--disabled):not(.ngx-datepicker__day--selected){background:var(--surface-muted, #f3f4f6);color:var(--text-base, #111827)}.ngx-datepicker__day--other-month{color:var(--text-disabled, #d1d5db)}.ngx-datepicker__day--today:not(.ngx-datepicker__day--selected){color:var(--primary-500, #6366f1);font-weight:700;background:var(--primary-50, #eef2ff)}.ngx-datepicker__day--selected{background:var(--primary-500, #6366f1);color:var(--text-on-color, #fff);font-weight:600}.ngx-datepicker__day--selected:hover{background:var(--primary-600, #4f46e5)}.ngx-datepicker__day--disabled{color:var(--text-disabled, #d1d5db);cursor:not-allowed;pointer-events:none}.ngx-datepicker__footer{display:flex;justify-content:center;padding:.5rem;border-top:1px solid var(--border-subtle, #f3f4f6)}.ngx-datepicker__today-btn{padding:.25rem .875rem;background:transparent;border:1.5px solid var(--border-base, #e5e7eb);border-radius:.375rem;font-size:.8125rem;font-family:inherit;font-weight:500;color:var(--primary-500, #6366f1);cursor:pointer;transition:background .1s ease,border-color .1s ease}.ngx-datepicker__today-btn:hover{background:var(--primary-50, #eef2ff);border-color:var(--primary-200, #c7d2fe)}.ngx-datepicker__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-datepicker__message--hint{color:var(--text-muted, #6b7280)}.ngx-datepicker__message--error{color:var(--danger-500, #ef4444)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2432
|
+
], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "gridRef", first: true, predicate: ["grid"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-datepicker__label\">{{ label() }}</label>\n}\n\n<!-- Field trigger -->\n<div\n #trigger\n [class]=\"fieldClasses()\"\n (click)=\"togglePanel()\"\n (keydown)=\"onTriggerKeydown($event)\"\n [attr.id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n role=\"button\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled()\"\n>\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <span [class]=\"floatLabelClasses()\">{{ label() }}</span>\n }\n\n <!-- Calendar icon -->\n <span class=\"ngx-datepicker__icon\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"CalendarIcon\" [size]=\"iconSize()\" />\n </span>\n\n <!-- Display value -->\n <span class=\"ngx-datepicker__display\">\n @if (displayValue()) {\n <span class=\"ngx-datepicker__value\">{{ displayValue() }}</span>\n } @else {\n <span class=\"ngx-datepicker__placeholder\">{{ placeholder() ?? i18n.datePlaceholder }}</span>\n }\n </span>\n\n <!-- Clear button -->\n @if (hasValue() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-datepicker__clear\"\n [attr.aria-label]=\"i18n.clearDate\"\n (click)=\"clearValue($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n</div>\n\n<!-- Calendar panel -->\n@if (isOpen()) {\n <div class=\"ngx-datepicker__panel\" role=\"dialog\" [attr.aria-label]=\"i18n.calendar\">\n <!-- Month navigation -->\n <div class=\"ngx-datepicker__header\">\n <button\n type=\"button\"\n class=\"ngx-datepicker__nav\"\n [attr.aria-label]=\"i18n.prevMonth\"\n (click)=\"prevMonth(); $event.stopPropagation()\"\n >\n <ngx-ds-icon [icon]=\"ChevronLeft\" [size]=\"16\" />\n </button>\n <span class=\"ngx-datepicker__header-text\">{{ headerText() }}</span>\n <button\n type=\"button\"\n class=\"ngx-datepicker__nav\"\n [attr.aria-label]=\"i18n.nextMonth\"\n (click)=\"nextMonth(); $event.stopPropagation()\"\n >\n <ngx-ds-icon [icon]=\"ChevronRight\" [size]=\"16\" />\n </button>\n </div>\n\n <!-- Weekday labels -->\n <div class=\"ngx-datepicker__weekdays\" aria-hidden=\"true\">\n @for (day of weekdayLabels(); track day) {\n <span class=\"ngx-datepicker__weekday\">{{ day }}</span>\n }\n </div>\n\n <!-- Day grid -->\n <div #grid class=\"ngx-datepicker__days\" role=\"grid\" [attr.aria-label]=\"headerText()\">\n @for (week of calendarWeeks(); track $index) {\n <div class=\"ngx-datepicker__week\" role=\"row\">\n @for (cell of week; track trackByTime($index, cell)) {\n <button\n type=\"button\"\n class=\"ngx-datepicker__day\"\n [class.ngx-datepicker__day--other-month]=\"!cell.inMonth\"\n [class.ngx-datepicker__day--today]=\"cell.isToday\"\n [class.ngx-datepicker__day--selected]=\"cell.isSelected\"\n [class.ngx-datepicker__day--disabled]=\"cell.isDisabled\"\n [attr.aria-disabled]=\"cell.isDisabled || null\"\n [attr.aria-label]=\"dayLabel(cell.date)\"\n [attr.aria-selected]=\"cell.isSelected\"\n [attr.aria-current]=\"cell.isToday ? 'date' : null\"\n [attr.tabindex]=\"isFocusTarget(cell) ? 0 : -1\"\n role=\"gridcell\"\n (click)=\"selectDate(cell); $event.stopPropagation()\"\n (keydown)=\"onDayKeydown($event, cell)\"\n >\n {{ cell.date.getDate() }}\n </button>\n }\n </div>\n }\n </div>\n\n <!-- Footer -->\n @if (showToday()) {\n <div class=\"ngx-datepicker__footer\">\n <button\n type=\"button\"\n class=\"ngx-datepicker__today-btn\"\n (click)=\"selectToday(); $event.stopPropagation()\"\n >\n Hoy\n </button>\n </div>\n }\n </div>\n}\n\n<!-- Error / Hint -->\n@if (errorText()) {\n <p [id]=\"messageId\" class=\"ngx-datepicker__message ngx-datepicker__message--error\" role=\"alert\">\n {{ errorText() }}\n </p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-datepicker__message ngx-datepicker__message--hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;position:relative;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-datepicker__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-datepicker__field{position:relative;display:flex;align-items:center;gap:.5rem;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color .15s ease,box-shadow .15s ease;min-height:2.375rem}.ngx-datepicker__field--focused{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-datepicker__field--error{border-color:var(--danger-500, #ef4444)}.ngx-datepicker__field--error.ngx-datepicker__field--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-datepicker__field--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed;color:var(--text-placeholder, #9ca3af)}.ngx-datepicker__field--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-datepicker__field--md{padding:.5rem .75rem;font-size:.875rem}.ngx-datepicker__field--lg{padding:.625rem 1rem;font-size:1rem}.ngx-datepicker__float-label{position:absolute;left:2.25rem;top:50%;transform:translateY(-50%);font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-datepicker__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1)}.ngx-datepicker__float-label--focused:not(.ngx-datepicker__float-label--error){color:var(--primary-500, #6366f1)}.ngx-datepicker__float-label--error{color:var(--danger-500, #ef4444)}.ngx-datepicker__icon{display:inline-flex;align-items:center;flex-shrink:0;color:var(--text-placeholder, #9ca3af)}.ngx-datepicker__display{flex:1;min-width:0}.ngx-datepicker__value{display:block;color:var(--text-base, #111827);font-variant-numeric:tabular-nums}.ngx-datepicker__placeholder{display:block;color:var(--text-placeholder, #9ca3af)}.ngx-datepicker__clear{display:inline-flex;align-items:center;flex-shrink:0;padding:0;background:transparent;border:none;cursor:pointer;color:var(--text-placeholder, #9ca3af);transition:color .15s ease}.ngx-datepicker__clear:hover{color:var(--text-muted, #6b7280)}.ngx-datepicker__panel{position:absolute;top:calc(100% + .25rem);left:0;z-index:100;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.5rem;box-shadow:0 8px 24px #0000001f;width:17.5rem;overflow:hidden}.ngx-datepicker__header{display:flex;align-items:center;justify-content:space-between;padding:.75rem .625rem .5rem;border-bottom:1px solid var(--border-subtle, #f3f4f6)}.ngx-datepicker__header-text{font-size:.875rem;font-weight:600;color:var(--text-base, #111827);text-transform:capitalize}.ngx-datepicker__nav{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;padding:0;background:transparent;border:none;border-radius:.375rem;cursor:pointer;color:var(--text-muted, #6b7280);transition:background .1s ease,color .1s ease}.ngx-datepicker__nav:hover{background:var(--surface-muted, #f3f4f6);color:var(--text-base, #111827)}.ngx-datepicker__weekdays{display:grid;grid-template-columns:repeat(7,1fr);padding:.375rem .5rem .25rem}.ngx-datepicker__weekday{display:flex;align-items:center;justify-content:center;font-size:.7rem;font-weight:600;color:var(--text-placeholder, #9ca3af);text-transform:uppercase;letter-spacing:.03em}.ngx-datepicker__days{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;padding:0 .5rem .5rem}.ngx-datepicker__week{display:contents}.ngx-datepicker__day{display:flex;align-items:center;justify-content:center;height:2.25rem;padding:0;background:transparent;border:none;border-radius:.375rem;font-size:.8125rem;font-family:inherit;color:var(--text-secondary, #374151);cursor:pointer;transition:background .1s ease,color .1s ease;font-variant-numeric:tabular-nums}.ngx-datepicker__day:focus-visible{outline:2px solid var(--primary-300, #a5b4fc);outline-offset:1px}.ngx-datepicker__day:hover:not(.ngx-datepicker__day--disabled):not(.ngx-datepicker__day--selected){background:var(--surface-muted, #f3f4f6);color:var(--text-base, #111827)}.ngx-datepicker__day--other-month{color:var(--text-disabled, #d1d5db)}.ngx-datepicker__day--today:not(.ngx-datepicker__day--selected){color:var(--primary-500, #6366f1);font-weight:700;background:var(--primary-50, #eef2ff)}.ngx-datepicker__day--selected{background:var(--primary-500, #6366f1);color:var(--text-on-color, #fff);font-weight:600}.ngx-datepicker__day--selected:hover{background:var(--primary-600, #4f46e5)}.ngx-datepicker__day--disabled{color:var(--text-disabled, #d1d5db);cursor:not-allowed;pointer-events:none}.ngx-datepicker__footer{display:flex;justify-content:center;padding:.5rem;border-top:1px solid var(--border-subtle, #f3f4f6)}.ngx-datepicker__today-btn{padding:.25rem .875rem;background:transparent;border:1.5px solid var(--border-base, #e5e7eb);border-radius:.375rem;font-size:.8125rem;font-family:inherit;font-weight:500;color:var(--primary-500, #6366f1);cursor:pointer;transition:background .1s ease,border-color .1s ease}.ngx-datepicker__today-btn:hover{background:var(--primary-50, #eef2ff);border-color:var(--primary-200, #c7d2fe)}.ngx-datepicker__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-datepicker__message--hint{color:var(--text-muted, #6b7280)}.ngx-datepicker__message--error{color:var(--danger-500, #ef4444)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2352
2433
|
}
|
|
2353
2434
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DatepickerComponent, decorators: [{
|
|
2354
2435
|
type: Component,
|
|
@@ -2358,8 +2439,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
2358
2439
|
useExisting: forwardRef(() => DatepickerComponent),
|
|
2359
2440
|
multi: true,
|
|
2360
2441
|
},
|
|
2361
|
-
], template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-datepicker__label\">{{ label() }}</label>\n}\n\n<!-- Field trigger -->\n<div\n #trigger\n [class]=\"fieldClasses()\"\n (click)=\"togglePanel()\"\n (keydown)=\"onTriggerKeydown($event)\"\n [attr.id]=\"id\"\n role=\"button\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled()\"\n>\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <span [class]=\"floatLabelClasses()\">{{ label() }}</span>\n }\n\n <!-- Calendar icon -->\n <span class=\"ngx-datepicker__icon\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"CalendarIcon\" [size]=\"iconSize()\" />\n </span>\n\n <!-- Display value -->\n <span class=\"ngx-datepicker__display\">\n @if (displayValue()) {\n <span class=\"ngx-datepicker__value\">{{ displayValue() }}</span>\n } @else {\n <span class=\"ngx-datepicker__placeholder\">{{ placeholder() ?? i18n.datePlaceholder }}</span>\n }\n </span>\n\n <!-- Clear button -->\n @if (hasValue() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-datepicker__clear\"\n [attr.aria-label]=\"i18n.clearDate\"\n (click)=\"clearValue($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n</div>\n\n<!-- Calendar panel -->\n@if (isOpen()) {\n <div class=\"ngx-datepicker__panel\" role=\"dialog\" [attr.aria-label]=\"i18n.calendar\">\n <!-- Month navigation -->\n <div class=\"ngx-datepicker__header\">\n <button\n type=\"button\"\n class=\"ngx-datepicker__nav\"\n [attr.aria-label]=\"i18n.prevMonth\"\n (click)=\"prevMonth(); $event.stopPropagation()\"\n >\n <ngx-ds-icon [icon]=\"ChevronLeft\" [size]=\"16\" />\n </button>\n <span class=\"ngx-datepicker__header-text\">{{ headerText() }}</span>\n <button\n type=\"button\"\n class=\"ngx-datepicker__nav\"\n [attr.aria-label]=\"i18n.nextMonth\"\n (click)=\"nextMonth(); $event.stopPropagation()\"\n >\n <ngx-ds-icon [icon]=\"ChevronRight\" [size]=\"16\" />\n </button>\n </div>\n\n <!-- Weekday labels -->\n <div class=\"ngx-datepicker__weekdays\" aria-hidden=\"true\">\n @for (day of weekdayLabels(); track day) {\n <span class=\"ngx-datepicker__weekday\">{{ day }}</span>\n }\n </div>\n\n <!-- Day grid -->\n <div #grid class=\"ngx-datepicker__days\" role=\"grid\" [attr.aria-label]=\"headerText()\">\n @for (week of calendarWeeks(); track $index) {\n <div class=\"ngx-datepicker__week\" role=\"row\">\n @for (cell of week; track trackByTime($index, cell)) {\n <button\n type=\"button\"\n class=\"ngx-datepicker__day\"\n [class.ngx-datepicker__day--other-month]=\"!cell.inMonth\"\n [class.ngx-datepicker__day--today]=\"cell.isToday\"\n [class.ngx-datepicker__day--selected]=\"cell.isSelected\"\n [class.ngx-datepicker__day--disabled]=\"cell.isDisabled\"\n [attr.aria-disabled]=\"cell.isDisabled || null\"\n [attr.aria-label]=\"dayLabel(cell.date)\"\n [attr.aria-selected]=\"cell.isSelected\"\n [attr.aria-current]=\"cell.isToday ? 'date' : null\"\n [attr.tabindex]=\"isFocusTarget(cell) ? 0 : -1\"\n role=\"gridcell\"\n (click)=\"selectDate(cell); $event.stopPropagation()\"\n (keydown)=\"onDayKeydown($event, cell)\"\n >\n {{ cell.date.getDate() }}\n </button>\n }\n </div>\n }\n </div>\n\n <!-- Footer -->\n @if (showToday()) {\n <div class=\"ngx-datepicker__footer\">\n <button\n type=\"button\"\n class=\"ngx-datepicker__today-btn\"\n (click)=\"selectToday(); $event.stopPropagation()\"\n >\n Hoy\n </button>\n </div>\n }\n </div>\n}\n\n<!-- Error / Hint -->\n@if (hasError()) {\n <p class=\"ngx-datepicker__message ngx-datepicker__message--error\" role=\"alert\">\n {{ errorMessage() }}\n </p>\n} @else if (hint()) {\n <p class=\"ngx-datepicker__message ngx-datepicker__message--hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;position:relative;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-datepicker__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-datepicker__field{position:relative;display:flex;align-items:center;gap:.5rem;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color .15s ease,box-shadow .15s ease;min-height:2.375rem}.ngx-datepicker__field--focused{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-datepicker__field--error{border-color:var(--danger-500, #ef4444)}.ngx-datepicker__field--error.ngx-datepicker__field--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-datepicker__field--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed;color:var(--text-placeholder, #9ca3af)}.ngx-datepicker__field--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-datepicker__field--md{padding:.5rem .75rem;font-size:.875rem}.ngx-datepicker__field--lg{padding:.625rem 1rem;font-size:1rem}.ngx-datepicker__float-label{position:absolute;left:2.25rem;top:50%;transform:translateY(-50%);font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-datepicker__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1)}.ngx-datepicker__float-label--focused:not(.ngx-datepicker__float-label--error){color:var(--primary-500, #6366f1)}.ngx-datepicker__float-label--error{color:var(--danger-500, #ef4444)}.ngx-datepicker__icon{display:inline-flex;align-items:center;flex-shrink:0;color:var(--text-placeholder, #9ca3af)}.ngx-datepicker__display{flex:1;min-width:0}.ngx-datepicker__value{display:block;color:var(--text-base, #111827);font-variant-numeric:tabular-nums}.ngx-datepicker__placeholder{display:block;color:var(--text-placeholder, #9ca3af)}.ngx-datepicker__clear{display:inline-flex;align-items:center;flex-shrink:0;padding:0;background:transparent;border:none;cursor:pointer;color:var(--text-placeholder, #9ca3af);transition:color .15s ease}.ngx-datepicker__clear:hover{color:var(--text-muted, #6b7280)}.ngx-datepicker__panel{position:absolute;top:calc(100% + .25rem);left:0;z-index:100;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.5rem;box-shadow:0 8px 24px #0000001f;width:17.5rem;overflow:hidden}.ngx-datepicker__header{display:flex;align-items:center;justify-content:space-between;padding:.75rem .625rem .5rem;border-bottom:1px solid var(--border-subtle, #f3f4f6)}.ngx-datepicker__header-text{font-size:.875rem;font-weight:600;color:var(--text-base, #111827);text-transform:capitalize}.ngx-datepicker__nav{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;padding:0;background:transparent;border:none;border-radius:.375rem;cursor:pointer;color:var(--text-muted, #6b7280);transition:background .1s ease,color .1s ease}.ngx-datepicker__nav:hover{background:var(--surface-muted, #f3f4f6);color:var(--text-base, #111827)}.ngx-datepicker__weekdays{display:grid;grid-template-columns:repeat(7,1fr);padding:.375rem .5rem .25rem}.ngx-datepicker__weekday{display:flex;align-items:center;justify-content:center;font-size:.7rem;font-weight:600;color:var(--text-placeholder, #9ca3af);text-transform:uppercase;letter-spacing:.03em}.ngx-datepicker__days{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;padding:0 .5rem .5rem}.ngx-datepicker__week{display:contents}.ngx-datepicker__day{display:flex;align-items:center;justify-content:center;height:2.25rem;padding:0;background:transparent;border:none;border-radius:.375rem;font-size:.8125rem;font-family:inherit;color:var(--text-secondary, #374151);cursor:pointer;transition:background .1s ease,color .1s ease;font-variant-numeric:tabular-nums}.ngx-datepicker__day:focus-visible{outline:2px solid var(--primary-300, #a5b4fc);outline-offset:1px}.ngx-datepicker__day:hover:not(.ngx-datepicker__day--disabled):not(.ngx-datepicker__day--selected){background:var(--surface-muted, #f3f4f6);color:var(--text-base, #111827)}.ngx-datepicker__day--other-month{color:var(--text-disabled, #d1d5db)}.ngx-datepicker__day--today:not(.ngx-datepicker__day--selected){color:var(--primary-500, #6366f1);font-weight:700;background:var(--primary-50, #eef2ff)}.ngx-datepicker__day--selected{background:var(--primary-500, #6366f1);color:var(--text-on-color, #fff);font-weight:600}.ngx-datepicker__day--selected:hover{background:var(--primary-600, #4f46e5)}.ngx-datepicker__day--disabled{color:var(--text-disabled, #d1d5db);cursor:not-allowed;pointer-events:none}.ngx-datepicker__footer{display:flex;justify-content:center;padding:.5rem;border-top:1px solid var(--border-subtle, #f3f4f6)}.ngx-datepicker__today-btn{padding:.25rem .875rem;background:transparent;border:1.5px solid var(--border-base, #e5e7eb);border-radius:.375rem;font-size:.8125rem;font-family:inherit;font-weight:500;color:var(--primary-500, #6366f1);cursor:pointer;transition:background .1s ease,border-color .1s ease}.ngx-datepicker__today-btn:hover{background:var(--primary-50, #eef2ff);border-color:var(--primary-200, #c7d2fe)}.ngx-datepicker__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-datepicker__message--hint{color:var(--text-muted, #6b7280)}.ngx-datepicker__message--error{color:var(--danger-500, #ef4444)}\n"] }]
|
|
2362
|
-
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], floatingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatingLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], disabledDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDates", required: false }] }], disabledDaysOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDaysOfWeek", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], showToday: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToday", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], triggerRef: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], gridRef: [{ type: i0.ViewChild, args: ['grid', { isSignal: true }] }] } });
|
|
2442
|
+
], template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-datepicker__label\">{{ label() }}</label>\n}\n\n<!-- Field trigger -->\n<div\n #trigger\n [class]=\"fieldClasses()\"\n (click)=\"togglePanel()\"\n (keydown)=\"onTriggerKeydown($event)\"\n [attr.id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n role=\"button\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled()\"\n>\n <!-- Floating label -->\n @if (floatingLabel() && label()) {\n <span [class]=\"floatLabelClasses()\">{{ label() }}</span>\n }\n\n <!-- Calendar icon -->\n <span class=\"ngx-datepicker__icon\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"CalendarIcon\" [size]=\"iconSize()\" />\n </span>\n\n <!-- Display value -->\n <span class=\"ngx-datepicker__display\">\n @if (displayValue()) {\n <span class=\"ngx-datepicker__value\">{{ displayValue() }}</span>\n } @else {\n <span class=\"ngx-datepicker__placeholder\">{{ placeholder() ?? i18n.datePlaceholder }}</span>\n }\n </span>\n\n <!-- Clear button -->\n @if (hasValue() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-datepicker__clear\"\n [attr.aria-label]=\"i18n.clearDate\"\n (click)=\"clearValue($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n</div>\n\n<!-- Calendar panel -->\n@if (isOpen()) {\n <div class=\"ngx-datepicker__panel\" role=\"dialog\" [attr.aria-label]=\"i18n.calendar\">\n <!-- Month navigation -->\n <div class=\"ngx-datepicker__header\">\n <button\n type=\"button\"\n class=\"ngx-datepicker__nav\"\n [attr.aria-label]=\"i18n.prevMonth\"\n (click)=\"prevMonth(); $event.stopPropagation()\"\n >\n <ngx-ds-icon [icon]=\"ChevronLeft\" [size]=\"16\" />\n </button>\n <span class=\"ngx-datepicker__header-text\">{{ headerText() }}</span>\n <button\n type=\"button\"\n class=\"ngx-datepicker__nav\"\n [attr.aria-label]=\"i18n.nextMonth\"\n (click)=\"nextMonth(); $event.stopPropagation()\"\n >\n <ngx-ds-icon [icon]=\"ChevronRight\" [size]=\"16\" />\n </button>\n </div>\n\n <!-- Weekday labels -->\n <div class=\"ngx-datepicker__weekdays\" aria-hidden=\"true\">\n @for (day of weekdayLabels(); track day) {\n <span class=\"ngx-datepicker__weekday\">{{ day }}</span>\n }\n </div>\n\n <!-- Day grid -->\n <div #grid class=\"ngx-datepicker__days\" role=\"grid\" [attr.aria-label]=\"headerText()\">\n @for (week of calendarWeeks(); track $index) {\n <div class=\"ngx-datepicker__week\" role=\"row\">\n @for (cell of week; track trackByTime($index, cell)) {\n <button\n type=\"button\"\n class=\"ngx-datepicker__day\"\n [class.ngx-datepicker__day--other-month]=\"!cell.inMonth\"\n [class.ngx-datepicker__day--today]=\"cell.isToday\"\n [class.ngx-datepicker__day--selected]=\"cell.isSelected\"\n [class.ngx-datepicker__day--disabled]=\"cell.isDisabled\"\n [attr.aria-disabled]=\"cell.isDisabled || null\"\n [attr.aria-label]=\"dayLabel(cell.date)\"\n [attr.aria-selected]=\"cell.isSelected\"\n [attr.aria-current]=\"cell.isToday ? 'date' : null\"\n [attr.tabindex]=\"isFocusTarget(cell) ? 0 : -1\"\n role=\"gridcell\"\n (click)=\"selectDate(cell); $event.stopPropagation()\"\n (keydown)=\"onDayKeydown($event, cell)\"\n >\n {{ cell.date.getDate() }}\n </button>\n }\n </div>\n }\n </div>\n\n <!-- Footer -->\n @if (showToday()) {\n <div class=\"ngx-datepicker__footer\">\n <button\n type=\"button\"\n class=\"ngx-datepicker__today-btn\"\n (click)=\"selectToday(); $event.stopPropagation()\"\n >\n Hoy\n </button>\n </div>\n }\n </div>\n}\n\n<!-- Error / Hint -->\n@if (errorText()) {\n <p [id]=\"messageId\" class=\"ngx-datepicker__message ngx-datepicker__message--error\" role=\"alert\">\n {{ errorText() }}\n </p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-datepicker__message ngx-datepicker__message--hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;position:relative;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-datepicker__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-datepicker__field{position:relative;display:flex;align-items:center;gap:.5rem;width:100%;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color .15s ease,box-shadow .15s ease;min-height:2.375rem}.ngx-datepicker__field--focused{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-datepicker__field--error{border-color:var(--danger-500, #ef4444)}.ngx-datepicker__field--error.ngx-datepicker__field--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-datepicker__field--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed;color:var(--text-placeholder, #9ca3af)}.ngx-datepicker__field--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-datepicker__field--md{padding:.5rem .75rem;font-size:.875rem}.ngx-datepicker__field--lg{padding:.625rem 1rem;font-size:1rem}.ngx-datepicker__float-label{position:absolute;left:2.25rem;top:50%;transform:translateY(-50%);font-size:inherit;color:var(--text-placeholder, #9ca3af);pointer-events:none;white-space:nowrap;line-height:1;padding:0;background:transparent;transition:top .15s ease,font-size .15s ease,color .15s ease,background-color .15s ease,padding .15s ease}.ngx-datepicker__float-label--active{top:0;font-size:.7rem;background:var(--surface-base, #fff);padding:0 .25rem;color:var(--primary-500, #6366f1)}.ngx-datepicker__float-label--focused:not(.ngx-datepicker__float-label--error){color:var(--primary-500, #6366f1)}.ngx-datepicker__float-label--error{color:var(--danger-500, #ef4444)}.ngx-datepicker__icon{display:inline-flex;align-items:center;flex-shrink:0;color:var(--text-placeholder, #9ca3af)}.ngx-datepicker__display{flex:1;min-width:0}.ngx-datepicker__value{display:block;color:var(--text-base, #111827);font-variant-numeric:tabular-nums}.ngx-datepicker__placeholder{display:block;color:var(--text-placeholder, #9ca3af)}.ngx-datepicker__clear{display:inline-flex;align-items:center;flex-shrink:0;padding:0;background:transparent;border:none;cursor:pointer;color:var(--text-placeholder, #9ca3af);transition:color .15s ease}.ngx-datepicker__clear:hover{color:var(--text-muted, #6b7280)}.ngx-datepicker__panel{position:absolute;top:calc(100% + .25rem);left:0;z-index:100;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.5rem;box-shadow:0 8px 24px #0000001f;width:17.5rem;overflow:hidden}.ngx-datepicker__header{display:flex;align-items:center;justify-content:space-between;padding:.75rem .625rem .5rem;border-bottom:1px solid var(--border-subtle, #f3f4f6)}.ngx-datepicker__header-text{font-size:.875rem;font-weight:600;color:var(--text-base, #111827);text-transform:capitalize}.ngx-datepicker__nav{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;padding:0;background:transparent;border:none;border-radius:.375rem;cursor:pointer;color:var(--text-muted, #6b7280);transition:background .1s ease,color .1s ease}.ngx-datepicker__nav:hover{background:var(--surface-muted, #f3f4f6);color:var(--text-base, #111827)}.ngx-datepicker__weekdays{display:grid;grid-template-columns:repeat(7,1fr);padding:.375rem .5rem .25rem}.ngx-datepicker__weekday{display:flex;align-items:center;justify-content:center;font-size:.7rem;font-weight:600;color:var(--text-placeholder, #9ca3af);text-transform:uppercase;letter-spacing:.03em}.ngx-datepicker__days{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;padding:0 .5rem .5rem}.ngx-datepicker__week{display:contents}.ngx-datepicker__day{display:flex;align-items:center;justify-content:center;height:2.25rem;padding:0;background:transparent;border:none;border-radius:.375rem;font-size:.8125rem;font-family:inherit;color:var(--text-secondary, #374151);cursor:pointer;transition:background .1s ease,color .1s ease;font-variant-numeric:tabular-nums}.ngx-datepicker__day:focus-visible{outline:2px solid var(--primary-300, #a5b4fc);outline-offset:1px}.ngx-datepicker__day:hover:not(.ngx-datepicker__day--disabled):not(.ngx-datepicker__day--selected){background:var(--surface-muted, #f3f4f6);color:var(--text-base, #111827)}.ngx-datepicker__day--other-month{color:var(--text-disabled, #d1d5db)}.ngx-datepicker__day--today:not(.ngx-datepicker__day--selected){color:var(--primary-500, #6366f1);font-weight:700;background:var(--primary-50, #eef2ff)}.ngx-datepicker__day--selected{background:var(--primary-500, #6366f1);color:var(--text-on-color, #fff);font-weight:600}.ngx-datepicker__day--selected:hover{background:var(--primary-600, #4f46e5)}.ngx-datepicker__day--disabled{color:var(--text-disabled, #d1d5db);cursor:not-allowed;pointer-events:none}.ngx-datepicker__footer{display:flex;justify-content:center;padding:.5rem;border-top:1px solid var(--border-subtle, #f3f4f6)}.ngx-datepicker__today-btn{padding:.25rem .875rem;background:transparent;border:1.5px solid var(--border-base, #e5e7eb);border-radius:.375rem;font-size:.8125rem;font-family:inherit;font-weight:500;color:var(--primary-500, #6366f1);cursor:pointer;transition:background .1s ease,border-color .1s ease}.ngx-datepicker__today-btn:hover{background:var(--primary-50, #eef2ff);border-color:var(--primary-200, #c7d2fe)}.ngx-datepicker__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-datepicker__message--hint{color:var(--text-muted, #6b7280)}.ngx-datepicker__message--error{color:var(--danger-500, #ef4444)}\n"] }]
|
|
2443
|
+
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], floatingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatingLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], disabledDates: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDates", required: false }] }], disabledDaysOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDaysOfWeek", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], showToday: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToday", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], triggerRef: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], gridRef: [{ type: i0.ViewChild, args: ['grid', { isSignal: true }] }] } });
|
|
2363
2444
|
|
|
2364
2445
|
class PasswordStrengthComponent {
|
|
2365
2446
|
i18n = inject(NGX_DS_LABELS);
|
|
@@ -2603,7 +2684,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
2603
2684
|
args: [{ selector: 'ngx-ds-file-upload', standalone: true, imports: [IconComponent, IconButtonComponent, ProgressBarComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'file-upload-host' }, template: "<label\n [class]=\"zoneClasses()\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\"\n>\n <input\n type=\"file\"\n class=\"upload-input\"\n [accept]=\"accept() || null\"\n [multiple]=\"multiple() || null\"\n [disabled]=\"disabled() || null\"\n (change)=\"onFileSelected($event)\"\n />\n\n <ngx-ds-icon class=\"upload-icon\" [icon]=\"icons.Upload\" [size]=\"32\" />\n <span class=\"upload-label\">{{ label() ?? i18n.fileUploadPrompt }}</span>\n @if (hint()) {\n <span class=\"upload-hint\">{{ hint() }}</span>\n }\n</label>\n\n@if (files().length > 0) {\n <ul class=\"upload-list\" role=\"list\">\n @for (file of files(); track file.id) {\n <li\n class=\"upload-file\"\n [class.upload-file--invalid]=\"file.status === 'invalid'\"\n [class.upload-file--error]=\"stateFor(file)?.status === 'error'\"\n >\n <ngx-ds-icon class=\"upload-file__icon\" [icon]=\"fileIcon(file)\" [size]=\"20\" />\n <div class=\"upload-file__info\">\n <span class=\"upload-file__name\">{{ file.name }}</span>\n <span class=\"upload-file__meta\">\n {{ formatSize(file.size) }}\n @if (file.error) {\n \u00B7 {{ file.error }}\n }\n @if (stateFor(file)?.status === 'error' && stateFor(file)?.error) {\n \u00B7 {{ stateFor(file)?.error }}\n }\n </span>\n\n @if (stateFor(file); as state) {\n @if (state.status === 'uploading') {\n <ngx-ds-progress-bar\n class=\"upload-file__progress\"\n size=\"sm\"\n color=\"primary\"\n [value]=\"state.progress ?? 0\"\n [indeterminate]=\"state.progress == null\"\n />\n }\n }\n </div>\n\n @if (stateFor(file); as state) {\n @if (state.status === 'done') {\n <ngx-ds-icon\n class=\"upload-file__status upload-file__status--done\"\n [icon]=\"icons.CheckCircle2\"\n [size]=\"18\"\n />\n } @else if (state.status === 'error') {\n <ngx-ds-icon\n class=\"upload-file__status upload-file__status--error\"\n [icon]=\"icons.AlertCircle\"\n [size]=\"18\"\n />\n }\n }\n\n <ngx-ds-icon-button\n [icon]=\"icons.X\"\n [ariaLabel]=\"i18n.removeFile\"\n variant=\"outline\"\n color=\"secondary\"\n size=\"sm\"\n [bordered]=\"false\"\n (click)=\"removeFile(file.id)\"\n />\n </li>\n }\n </ul>\n}\n", styles: [":host{display:block}.upload-zone{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.375rem;padding:2rem 1.5rem;min-height:9rem;border:2px dashed var(--border-input, #d1d5db);border-radius:.75rem;cursor:pointer;text-align:center;transition:border-color .15s ease,background .15s ease;background:var(--surface-subtle, #f9fafb)}.upload-zone:hover:not(.upload-zone--disabled),.upload-zone--dragging{border-color:var(--primary-500, #6366f1);background:#3b82f60a}.upload-zone:hover:not(.upload-zone--disabled) .upload-icon,.upload-zone--dragging .upload-icon{color:var(--primary-500, #6366f1)}.upload-zone--disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.upload-input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.upload-icon{color:var(--text-placeholder, #9ca3af);transition:color .15s ease;margin-bottom:.25rem}.upload-label{font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.upload-hint{font-size:.75rem;color:var(--text-muted, #6b7280)}.upload-list{list-style:none;margin:.75rem 0 0;padding:0;display:flex;flex-direction:column;gap:.5rem}.upload-file{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;padding:.625rem .875rem;border:1px solid var(--border-base, #e5e7eb);border-radius:.5rem;background:var(--surface-base, #fff)}.upload-file--invalid,.upload-file--error{border-color:#ef444480;background:#ef44440a}.upload-file--invalid .upload-file__meta,.upload-file--error .upload-file__meta{color:var(--danger-500, #ef4444)}.upload-file__progress{flex-basis:100%}.upload-file__status{flex-shrink:0}.upload-file__status--done{color:var(--success-500, #10b981)}.upload-file__status--error{color:var(--danger-500, #ef4444)}.upload-file__icon{color:var(--text-muted, #6b7280);flex-shrink:0}.upload-file__info{flex:1;min-width:0}.upload-file__name{display:block;font-size:.875rem;font-weight:500;color:var(--text-base, #111827);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.upload-file__meta{display:block;font-size:.75rem;color:var(--text-muted, #6b7280);margin-top:.0625rem}\n"] }]
|
|
2604
2685
|
}], propDecorators: { multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], maxSizeMb: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSizeMb", required: false }] }], maxFiles: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFiles", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], uploadState: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadState", required: false }] }], filesChange: [{ type: i0.Output, args: ["filesChange"] }] } });
|
|
2605
2686
|
|
|
2606
|
-
const ICON_SIZE$
|
|
2687
|
+
const ICON_SIZE$5 = { sm: 14, md: 16, lg: 18 };
|
|
2607
2688
|
class SearchInputComponent {
|
|
2608
2689
|
i18n = inject(NGX_DS_LABELS);
|
|
2609
2690
|
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
@@ -2619,7 +2700,7 @@ class SearchInputComponent {
|
|
|
2619
2700
|
focused = signal(false, ...(ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []));
|
|
2620
2701
|
searchIcon = Search;
|
|
2621
2702
|
clearIcon = X;
|
|
2622
|
-
iconSize = computed(() => ICON_SIZE$
|
|
2703
|
+
iconSize = computed(() => ICON_SIZE$5[this.size()], ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
2623
2704
|
showClear = computed(() => this.clearable() && this.value().length > 0 && !this.disabled() && !this.loading(), ...(ngDevMode ? [{ debugName: "showClear" }] : /* istanbul ignore next */ []));
|
|
2624
2705
|
wrapperClasses = computed(() => {
|
|
2625
2706
|
const b = 'search-input';
|
|
@@ -2662,6 +2743,10 @@ class OtpInputComponent {
|
|
|
2662
2743
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
2663
2744
|
masked = input(false, ...(ngDevMode ? [{ debugName: "masked" }] : /* istanbul ignore next */ []));
|
|
2664
2745
|
error = input(false, ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
2746
|
+
/** Set by Signal Forms `[formField]`. Its errors show once the field is touched. */
|
|
2747
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
2748
|
+
touched = input(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
2749
|
+
hasError = computed(() => this.error() || fieldHasError('', this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
2665
2750
|
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2666
2751
|
complete = output();
|
|
2667
2752
|
#formDisabled = signal(false, ...(ngDevMode ? [{ debugName: "#formDisabled" }] : /* istanbul ignore next */ []));
|
|
@@ -2682,7 +2767,7 @@ class OtpInputComponent {
|
|
|
2682
2767
|
return [
|
|
2683
2768
|
b,
|
|
2684
2769
|
`${b}--${this.size()}`,
|
|
2685
|
-
this.
|
|
2770
|
+
this.hasError() ? `${b}--error` : '',
|
|
2686
2771
|
this.isDisabled() ? `${b}--disabled` : '',
|
|
2687
2772
|
]
|
|
2688
2773
|
.filter(Boolean)
|
|
@@ -2778,13 +2863,13 @@ class OtpInputComponent {
|
|
|
2778
2863
|
this.#formDisabled.set(disabled);
|
|
2779
2864
|
}
|
|
2780
2865
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: OtpInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2781
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: OtpInputComponent, isStandalone: true, selector: "ngx-ds-otp-input", inputs: { length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", 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 }, masked: { classPropertyName: "masked", publicName: "masked", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", complete: "complete" }, providers: [
|
|
2866
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: OtpInputComponent, isStandalone: true, selector: "ngx-ds-otp-input", inputs: { length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", 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 }, masked: { classPropertyName: "masked", publicName: "masked", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", complete: "complete" }, providers: [
|
|
2782
2867
|
{
|
|
2783
2868
|
provide: NG_VALUE_ACCESSOR,
|
|
2784
2869
|
useExisting: forwardRef(() => OtpInputComponent),
|
|
2785
2870
|
multi: true,
|
|
2786
2871
|
},
|
|
2787
|
-
], viewQueries: [{ propertyName: "boxes", predicate: ["otpBox"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"wrapperClasses()\" role=\"group\" [attr.aria-label]=\"i18n.otpGroup\">\n @for (i of indices(); track i) {\n <input\n #otpBox\n [class]=\"boxClasses()\"\n [type]=\"inputType()\"\n [inputMode]=\"inputMode()\"\n maxlength=\"1\"\n [value]=\"digits()[i] || ''\"\n [attr.autocomplete]=\"i === 0 ? 'one-time-code' : 'off'\"\n [disabled]=\"isDisabled() || null\"\n [style.width]=\"boxDim()\"\n [style.height]=\"boxDim()\"\n [style.fontSize]=\"boxFs()\"\n (input)=\"onInput($event, i)\"\n (keydown)=\"onKeydown($event, i)\"\n (paste)=\"onPaste($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur()\"\n />\n }\n</div>\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.otp{display:flex;align-items:center;gap:.5rem}.otp--disabled{opacity:.55;pointer-events:none}.otp__box{display:flex;align-items:center;justify-content:center;padding:0;text-align:center;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.5rem;color:var(--text-base, #111827);font-family:inherit;font-weight:600;caret-color:var(--primary-500, #6366f1);transition:border-color .15s ease,box-shadow .15s ease;outline:none}.otp__box:focus{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.otp__box--error{border-color:var(--danger-500, #ef4444);background:#ef44440a}.otp__box--error:focus{box-shadow:0 0 0 3px #ef44441f}.otp__box--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed}.otp__box::-webkit-outer-spin-button,.otp__box::-webkit-inner-spin-button{-webkit-appearance:none}.otp__box{-moz-appearance:textfield}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2872
|
+
], viewQueries: [{ propertyName: "boxes", predicate: ["otpBox"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"wrapperClasses()\" role=\"group\" [attr.aria-label]=\"i18n.otpGroup\">\n @for (i of indices(); track i) {\n <input\n #otpBox\n [class]=\"boxClasses()\"\n [type]=\"inputType()\"\n [inputMode]=\"inputMode()\"\n maxlength=\"1\"\n [value]=\"digits()[i] || ''\"\n [attr.autocomplete]=\"i === 0 ? 'one-time-code' : 'off'\"\n [disabled]=\"isDisabled() || null\"\n [attr.aria-invalid]=\"hasError() || null\"\n [style.width]=\"boxDim()\"\n [style.height]=\"boxDim()\"\n [style.fontSize]=\"boxFs()\"\n (input)=\"onInput($event, i)\"\n (keydown)=\"onKeydown($event, i)\"\n (paste)=\"onPaste($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur()\"\n />\n }\n</div>\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.otp{display:flex;align-items:center;gap:.5rem}.otp--disabled{opacity:.55;pointer-events:none}.otp__box{display:flex;align-items:center;justify-content:center;padding:0;text-align:center;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.5rem;color:var(--text-base, #111827);font-family:inherit;font-weight:600;caret-color:var(--primary-500, #6366f1);transition:border-color .15s ease,box-shadow .15s ease;outline:none}.otp__box:focus{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.otp__box--error{border-color:var(--danger-500, #ef4444);background:#ef44440a}.otp__box--error:focus{box-shadow:0 0 0 3px #ef44441f}.otp__box--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed}.otp__box::-webkit-outer-spin-button,.otp__box::-webkit-inner-spin-button{-webkit-appearance:none}.otp__box{-moz-appearance:textfield}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2788
2873
|
}
|
|
2789
2874
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: OtpInputComponent, decorators: [{
|
|
2790
2875
|
type: Component,
|
|
@@ -2794,8 +2879,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
2794
2879
|
useExisting: forwardRef(() => OtpInputComponent),
|
|
2795
2880
|
multi: true,
|
|
2796
2881
|
},
|
|
2797
|
-
], template: "<div [class]=\"wrapperClasses()\" role=\"group\" [attr.aria-label]=\"i18n.otpGroup\">\n @for (i of indices(); track i) {\n <input\n #otpBox\n [class]=\"boxClasses()\"\n [type]=\"inputType()\"\n [inputMode]=\"inputMode()\"\n maxlength=\"1\"\n [value]=\"digits()[i] || ''\"\n [attr.autocomplete]=\"i === 0 ? 'one-time-code' : 'off'\"\n [disabled]=\"isDisabled() || null\"\n [style.width]=\"boxDim()\"\n [style.height]=\"boxDim()\"\n [style.fontSize]=\"boxFs()\"\n (input)=\"onInput($event, i)\"\n (keydown)=\"onKeydown($event, i)\"\n (paste)=\"onPaste($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur()\"\n />\n }\n</div>\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.otp{display:flex;align-items:center;gap:.5rem}.otp--disabled{opacity:.55;pointer-events:none}.otp__box{display:flex;align-items:center;justify-content:center;padding:0;text-align:center;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.5rem;color:var(--text-base, #111827);font-family:inherit;font-weight:600;caret-color:var(--primary-500, #6366f1);transition:border-color .15s ease,box-shadow .15s ease;outline:none}.otp__box:focus{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.otp__box--error{border-color:var(--danger-500, #ef4444);background:#ef44440a}.otp__box--error:focus{box-shadow:0 0 0 3px #ef44441f}.otp__box--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed}.otp__box::-webkit-outer-spin-button,.otp__box::-webkit-inner-spin-button{-webkit-appearance:none}.otp__box{-moz-appearance:textfield}\n"] }]
|
|
2798
|
-
}], ctorParameters: () => [], propDecorators: { length: [{ type: i0.Input, args: [{ isSignal: true, alias: "length", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], masked: [{ type: i0.Input, args: [{ isSignal: true, alias: "masked", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], complete: [{ type: i0.Output, args: ["complete"] }], boxes: [{ type: i0.ViewChildren, args: ['otpBox', { isSignal: true }] }] } });
|
|
2882
|
+
], template: "<div [class]=\"wrapperClasses()\" role=\"group\" [attr.aria-label]=\"i18n.otpGroup\">\n @for (i of indices(); track i) {\n <input\n #otpBox\n [class]=\"boxClasses()\"\n [type]=\"inputType()\"\n [inputMode]=\"inputMode()\"\n maxlength=\"1\"\n [value]=\"digits()[i] || ''\"\n [attr.autocomplete]=\"i === 0 ? 'one-time-code' : 'off'\"\n [disabled]=\"isDisabled() || null\"\n [attr.aria-invalid]=\"hasError() || null\"\n [style.width]=\"boxDim()\"\n [style.height]=\"boxDim()\"\n [style.fontSize]=\"boxFs()\"\n (input)=\"onInput($event, i)\"\n (keydown)=\"onKeydown($event, i)\"\n (paste)=\"onPaste($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur()\"\n />\n }\n</div>\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.otp{display:flex;align-items:center;gap:.5rem}.otp--disabled{opacity:.55;pointer-events:none}.otp__box{display:flex;align-items:center;justify-content:center;padding:0;text-align:center;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.5rem;color:var(--text-base, #111827);font-family:inherit;font-weight:600;caret-color:var(--primary-500, #6366f1);transition:border-color .15s ease,box-shadow .15s ease;outline:none}.otp__box:focus{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.otp__box--error{border-color:var(--danger-500, #ef4444);background:#ef44440a}.otp__box--error:focus{box-shadow:0 0 0 3px #ef44441f}.otp__box--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed}.otp__box::-webkit-outer-spin-button,.otp__box::-webkit-inner-spin-button{-webkit-appearance:none}.otp__box{-moz-appearance:textfield}\n"] }]
|
|
2883
|
+
}], ctorParameters: () => [], propDecorators: { length: [{ type: i0.Input, args: [{ isSignal: true, alias: "length", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], masked: [{ type: i0.Input, args: [{ isSignal: true, alias: "masked", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], complete: [{ type: i0.Output, args: ["complete"] }], boxes: [{ type: i0.ViewChildren, args: ['otpBox', { isSignal: true }] }] } });
|
|
2799
2884
|
|
|
2800
2885
|
// Theme tokens (with fallbacks) so consumers can restyle the slider via CSS.
|
|
2801
2886
|
const TRACK_COLORS = {
|
|
@@ -2805,9 +2890,9 @@ const TRACK_COLORS = {
|
|
|
2805
2890
|
warning: 'var(--warning-500, #f59e0b)',
|
|
2806
2891
|
danger: 'var(--danger-500, #ef4444)',
|
|
2807
2892
|
};
|
|
2808
|
-
let nextId$
|
|
2893
|
+
let nextId$a = 0;
|
|
2809
2894
|
class RangeSliderComponent {
|
|
2810
|
-
id = `ngx-range-slider-${nextId$
|
|
2895
|
+
id = `ngx-range-slider-${nextId$a++}`;
|
|
2811
2896
|
value = model(0, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2812
2897
|
// `undefined` is accepted so Signal Forms can bind the field's min/max.
|
|
2813
2898
|
min = input(0, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}), transform: (v) => v ?? 0 });
|
|
@@ -2953,7 +3038,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
2953
3038
|
args: [{ selector: 'ngx-ds-card', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"hostClasses()\">\n <!-- Header \u2014 hidden when empty -->\n <div class=\"card__header\">\n <ng-content select=\"[card-header]\" />\n </div>\n\n <!-- Body -->\n <div class=\"card__body\">\n <ng-content />\n </div>\n\n <!-- Footer \u2014 hidden when empty -->\n <div class=\"card__footer\">\n <ng-content select=\"[card-footer]\" />\n </div>\n</div>\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.card{background:var(--surface-base, #fff);border-radius:.75rem;overflow:hidden}.card--bordered{border:1.5px solid var(--border-base, #e5e7eb)}.card--shadow-none{box-shadow:none}.card--shadow-sm{box-shadow:0 1px 3px #00000014,0 1px 2px #0000000d}.card--shadow-md{box-shadow:0 4px 6px #00000012,0 2px 4px #0000000d}.card--shadow-lg{box-shadow:0 10px 15px #00000014,0 4px 6px #0000000d}.card--hoverable{transition:box-shadow .2s ease,transform .2s ease;cursor:pointer}.card--hoverable:hover{box-shadow:0 8px 20px #0000001a,0 4px 8px #0000000f;transform:translateY(-2px)}.card__header{padding:0;border-bottom:1.5px solid var(--border-base, #e5e7eb)}.card__header:not(:has(*)){display:none}.card__body{color:var(--text-secondary, #374151);font-size:.875rem;line-height:1.6}.card__footer{border-top:1.5px solid var(--border-base, #e5e7eb)}.card__footer:not(:has(*)){display:none}.card--pad-none .card__header,.card--pad-none .card__body,.card--pad-none .card__footer{padding:0}.card--pad-sm .card__header,.card--pad-sm .card__footer{padding:.625rem .875rem}.card--pad-sm .card__body{padding:.875rem}.card--pad-md .card__header,.card--pad-md .card__footer{padding:.875rem 1.25rem}.card--pad-md .card__body{padding:1.25rem}.card--pad-lg .card__header,.card--pad-lg .card__footer{padding:1.25rem 1.5rem}.card--pad-lg .card__body{padding:1.5rem}\n"] }]
|
|
2954
3039
|
}], propDecorators: { shadow: [{ type: i0.Input, args: [{ isSignal: true, alias: "shadow", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], bordered: [{ type: i0.Input, args: [{ isSignal: true, alias: "bordered", required: false }] }], hoverable: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoverable", required: false }] }] } });
|
|
2955
3040
|
|
|
2956
|
-
const ICON_SIZE$
|
|
3041
|
+
const ICON_SIZE$4 = { sm: 12, md: 14, lg: 16 };
|
|
2957
3042
|
class BreadcrumbComponent {
|
|
2958
3043
|
i18n = inject(NGX_DS_LABELS);
|
|
2959
3044
|
items = input([], ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
@@ -2964,7 +3049,7 @@ class BreadcrumbComponent {
|
|
|
2964
3049
|
separatorIsIcon = computed(() => typeof this.separator() !== 'string', ...(ngDevMode ? [{ debugName: "separatorIsIcon" }] : /* istanbul ignore next */ []));
|
|
2965
3050
|
separatorIcon = computed(() => typeof this.separator() === 'string' ? null : this.separator(), ...(ngDevMode ? [{ debugName: "separatorIcon" }] : /* istanbul ignore next */ []));
|
|
2966
3051
|
separatorChar = computed(() => typeof this.separator() === 'string' ? this.separator() : '', ...(ngDevMode ? [{ debugName: "separatorChar" }] : /* istanbul ignore next */ []));
|
|
2967
|
-
iconSize = computed(() => ICON_SIZE$
|
|
3052
|
+
iconSize = computed(() => ICON_SIZE$4[this.size()], ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
2968
3053
|
visibleItems = computed(() => {
|
|
2969
3054
|
const all = this.items();
|
|
2970
3055
|
const max = this.maxItems();
|
|
@@ -3067,7 +3152,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
3067
3152
|
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
3068
3153
|
|
|
3069
3154
|
const ICON_SIZES = { sm: 14, md: 16, lg: 18 };
|
|
3070
|
-
let nextId$
|
|
3155
|
+
let nextId$9 = 0;
|
|
3071
3156
|
class NumberInputComponent {
|
|
3072
3157
|
i18n = inject(NGX_DS_LABELS);
|
|
3073
3158
|
value = model(0, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
@@ -3079,10 +3164,16 @@ class NumberInputComponent {
|
|
|
3079
3164
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
3080
3165
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
3081
3166
|
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
3167
|
+
/** Set by Signal Forms `[formField]`. Its errors show once the field is touched. */
|
|
3168
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
3169
|
+
touched = input(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
3170
|
+
hasError = computed(() => fieldHasError(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
3171
|
+
errorText = computed(() => fieldErrorText(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
3082
3172
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
3083
3173
|
#formDisabled = signal(false, ...(ngDevMode ? [{ debugName: "#formDisabled" }] : /* istanbul ignore next */ []));
|
|
3084
3174
|
isDisabled = computed(() => this.disabled() || this.#formDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
3085
|
-
id = `ngx-number-${nextId$
|
|
3175
|
+
id = `ngx-number-${nextId$9++}`;
|
|
3176
|
+
messageId = `${this.id}-message`;
|
|
3086
3177
|
PlusIcon = Plus;
|
|
3087
3178
|
MinusIcon = Minus;
|
|
3088
3179
|
iconSize = computed(() => ICON_SIZES[this.size()], ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
@@ -3094,7 +3185,7 @@ class NumberInputComponent {
|
|
|
3094
3185
|
const max = this.max();
|
|
3095
3186
|
return !this.isDisabled() && (max === null || this.value() < max);
|
|
3096
3187
|
}, ...(ngDevMode ? [{ debugName: "canIncrement" }] : /* istanbul ignore next */ []));
|
|
3097
|
-
hostClasses = computed(() => `number-input number-input--${this.size()}
|
|
3188
|
+
hostClasses = computed(() => `number-input number-input--${this.size()}` + (this.hasError() ? ' number-input--error' : ''), ...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
3098
3189
|
decrement() {
|
|
3099
3190
|
if (!this.canDecrement())
|
|
3100
3191
|
return;
|
|
@@ -3142,13 +3233,13 @@ class NumberInputComponent {
|
|
|
3142
3233
|
this.#formDisabled.set(isDisabled);
|
|
3143
3234
|
}
|
|
3144
3235
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: NumberInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3145
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: NumberInputComponent, isStandalone: true, selector: "ngx-ds-number-input", inputs: { 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 }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
3236
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: NumberInputComponent, isStandalone: true, selector: "ngx-ds-number-input", inputs: { 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 }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
3146
3237
|
{
|
|
3147
3238
|
provide: NG_VALUE_ACCESSOR,
|
|
3148
3239
|
useExisting: forwardRef(() => NumberInputComponent),
|
|
3149
3240
|
multi: true,
|
|
3150
3241
|
},
|
|
3151
|
-
], ngImport: i0, template: "@if (label()) {\n <label class=\"number-input__label\" [for]=\"id\">{{ label() }}</label>\n}\n\n<div [class]=\"hostClasses()\">\n <button\n type=\"button\"\n class=\"number-input__btn\"\n [disabled]=\"!canDecrement() || null\"\n (click)=\"decrement()\"\n [attr.aria-label]=\"i18n.decrement\"\n >\n <ngx-ds-icon [icon]=\"MinusIcon\" [size]=\"iconSize()\" />\n </button>\n\n <input\n class=\"number-input__field\"\n type=\"number\"\n [id]=\"id\"\n [value]=\"value()\"\n [min]=\"min() ?? null\"\n [max]=\"max() ?? null\"\n [step]=\"step()\"\n [disabled]=\"isDisabled() || null\"\n (change)=\"onInputChange($event)\"\n />\n\n <button\n type=\"button\"\n class=\"number-input__btn\"\n [disabled]=\"!canIncrement() || null\"\n (click)=\"increment()\"\n [attr.aria-label]=\"i18n.increment\"\n >\n <ngx-ds-icon [icon]=\"PlusIcon\" [size]=\"iconSize()\" />\n </button>\n</div>\n\n@if (
|
|
3242
|
+
], ngImport: i0, template: "@if (label()) {\n <label class=\"number-input__label\" [for]=\"id\">{{ label() }}</label>\n}\n\n<div [class]=\"hostClasses()\">\n <button\n type=\"button\"\n class=\"number-input__btn\"\n [disabled]=\"!canDecrement() || null\"\n (click)=\"decrement()\"\n [attr.aria-label]=\"i18n.decrement\"\n >\n <ngx-ds-icon [icon]=\"MinusIcon\" [size]=\"iconSize()\" />\n </button>\n\n <input\n class=\"number-input__field\"\n type=\"number\"\n [id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n [value]=\"value()\"\n [min]=\"min() ?? null\"\n [max]=\"max() ?? null\"\n [step]=\"step()\"\n [disabled]=\"isDisabled() || null\"\n (change)=\"onInputChange($event)\"\n />\n\n <button\n type=\"button\"\n class=\"number-input__btn\"\n [disabled]=\"!canIncrement() || null\"\n (click)=\"increment()\"\n [attr.aria-label]=\"i18n.increment\"\n >\n <ngx-ds-icon [icon]=\"PlusIcon\" [size]=\"iconSize()\" />\n </button>\n</div>\n\n@if (errorText()) {\n <p [id]=\"messageId\" role=\"alert\" class=\"number-input__error\">{{ errorText() }}</p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"number-input__hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.number-input__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-base, #111827)}.number-input{display:inline-flex;align-items:center;border:1px solid var(--border-input, #d1d5db);border-radius:.5rem;background:var(--surface-base, #ffffff);overflow:hidden;transition:border-color .15s ease,box-shadow .15s ease}.number-input:focus-within{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px var(--primary-100, #e0e7ff)}.number-input--error,.number-input--error:focus-within{border-color:var(--danger-500, #ef4444)}.number-input--error:focus-within{box-shadow:0 0 0 3px #ef44441f}.number-input__btn{display:inline-flex;align-items:center;justify-content:center;background:var(--surface-subtle, #f9fafb);border:none;cursor:pointer;color:var(--text-muted, #6b7280);flex-shrink:0;transition:background .15s ease,color .15s ease}.number-input__btn:hover:not(:disabled){background:var(--surface-hover, #f3f4f6);color:var(--text-base, #111827)}.number-input__btn:disabled{opacity:.4;cursor:not-allowed}.number-input__field{flex:1;min-width:0;border:none;background:transparent;font-family:inherit;font-weight:500;text-align:center;color:var(--text-base, #111827);outline:none;-moz-appearance:textfield}.number-input__field::-webkit-inner-spin-button,.number-input__field::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.number-input__field:disabled{opacity:.5;cursor:not-allowed}.number-input--sm .number-input__btn{width:2rem;height:2rem}.number-input--sm .number-input__field{font-size:.8125rem;height:2rem;width:3.5rem}.number-input--md .number-input__btn{width:2.5rem;height:2.5rem}.number-input--md .number-input__field{font-size:.9375rem;height:2.5rem;width:4rem}.number-input--lg .number-input__btn{width:3rem;height:3rem}.number-input--lg .number-input__field{font-size:1.0625rem;height:3rem;width:5rem}.number-input__hint{margin:.375rem 0 0;font-size:.8125rem;color:var(--text-muted, #6b7280)}.number-input__error{margin:.375rem 0 0;font-size:.8125rem;color:var(--danger-600, #dc2626)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3152
3243
|
}
|
|
3153
3244
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: NumberInputComponent, decorators: [{
|
|
3154
3245
|
type: Component,
|
|
@@ -3158,10 +3249,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
3158
3249
|
useExisting: forwardRef(() => NumberInputComponent),
|
|
3159
3250
|
multi: true,
|
|
3160
3251
|
},
|
|
3161
|
-
], template: "@if (label()) {\n <label class=\"number-input__label\" [for]=\"id\">{{ label() }}</label>\n}\n\n<div [class]=\"hostClasses()\">\n <button\n type=\"button\"\n class=\"number-input__btn\"\n [disabled]=\"!canDecrement() || null\"\n (click)=\"decrement()\"\n [attr.aria-label]=\"i18n.decrement\"\n >\n <ngx-ds-icon [icon]=\"MinusIcon\" [size]=\"iconSize()\" />\n </button>\n\n <input\n class=\"number-input__field\"\n type=\"number\"\n [id]=\"id\"\n [value]=\"value()\"\n [min]=\"min() ?? null\"\n [max]=\"max() ?? null\"\n [step]=\"step()\"\n [disabled]=\"isDisabled() || null\"\n (change)=\"onInputChange($event)\"\n />\n\n <button\n type=\"button\"\n class=\"number-input__btn\"\n [disabled]=\"!canIncrement() || null\"\n (click)=\"increment()\"\n [attr.aria-label]=\"i18n.increment\"\n >\n <ngx-ds-icon [icon]=\"PlusIcon\" [size]=\"iconSize()\" />\n </button>\n</div>\n\n@if (
|
|
3162
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
3252
|
+
], template: "@if (label()) {\n <label class=\"number-input__label\" [for]=\"id\">{{ label() }}</label>\n}\n\n<div [class]=\"hostClasses()\">\n <button\n type=\"button\"\n class=\"number-input__btn\"\n [disabled]=\"!canDecrement() || null\"\n (click)=\"decrement()\"\n [attr.aria-label]=\"i18n.decrement\"\n >\n <ngx-ds-icon [icon]=\"MinusIcon\" [size]=\"iconSize()\" />\n </button>\n\n <input\n class=\"number-input__field\"\n type=\"number\"\n [id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n [value]=\"value()\"\n [min]=\"min() ?? null\"\n [max]=\"max() ?? null\"\n [step]=\"step()\"\n [disabled]=\"isDisabled() || null\"\n (change)=\"onInputChange($event)\"\n />\n\n <button\n type=\"button\"\n class=\"number-input__btn\"\n [disabled]=\"!canIncrement() || null\"\n (click)=\"increment()\"\n [attr.aria-label]=\"i18n.increment\"\n >\n <ngx-ds-icon [icon]=\"PlusIcon\" [size]=\"iconSize()\" />\n </button>\n</div>\n\n@if (errorText()) {\n <p [id]=\"messageId\" role=\"alert\" class=\"number-input__error\">{{ errorText() }}</p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"number-input__hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.number-input__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-base, #111827)}.number-input{display:inline-flex;align-items:center;border:1px solid var(--border-input, #d1d5db);border-radius:.5rem;background:var(--surface-base, #ffffff);overflow:hidden;transition:border-color .15s ease,box-shadow .15s ease}.number-input:focus-within{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px var(--primary-100, #e0e7ff)}.number-input--error,.number-input--error:focus-within{border-color:var(--danger-500, #ef4444)}.number-input--error:focus-within{box-shadow:0 0 0 3px #ef44441f}.number-input__btn{display:inline-flex;align-items:center;justify-content:center;background:var(--surface-subtle, #f9fafb);border:none;cursor:pointer;color:var(--text-muted, #6b7280);flex-shrink:0;transition:background .15s ease,color .15s ease}.number-input__btn:hover:not(:disabled){background:var(--surface-hover, #f3f4f6);color:var(--text-base, #111827)}.number-input__btn:disabled{opacity:.4;cursor:not-allowed}.number-input__field{flex:1;min-width:0;border:none;background:transparent;font-family:inherit;font-weight:500;text-align:center;color:var(--text-base, #111827);outline:none;-moz-appearance:textfield}.number-input__field::-webkit-inner-spin-button,.number-input__field::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.number-input__field:disabled{opacity:.5;cursor:not-allowed}.number-input--sm .number-input__btn{width:2rem;height:2rem}.number-input--sm .number-input__field{font-size:.8125rem;height:2rem;width:3.5rem}.number-input--md .number-input__btn{width:2.5rem;height:2.5rem}.number-input--md .number-input__field{font-size:.9375rem;height:2.5rem;width:4rem}.number-input--lg .number-input__btn{width:3rem;height:3rem}.number-input--lg .number-input__field{font-size:1.0625rem;height:3rem;width:5rem}.number-input__hint{margin:.375rem 0 0;font-size:.8125rem;color:var(--text-muted, #6b7280)}.number-input__error{margin:.375rem 0 0;font-size:.8125rem;color:var(--danger-600, #dc2626)}\n"] }]
|
|
3253
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
3163
3254
|
|
|
3164
|
-
let nextId$
|
|
3255
|
+
let nextId$8 = 0;
|
|
3165
3256
|
class MultiSelectComponent {
|
|
3166
3257
|
i18n = inject(NGX_DS_LABELS);
|
|
3167
3258
|
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
@@ -3170,11 +3261,15 @@ class MultiSelectComponent {
|
|
|
3170
3261
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
3171
3262
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
3172
3263
|
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
3264
|
+
/** Set by Signal Forms `[formField]`. Its errors show once the field is touched. */
|
|
3265
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
3266
|
+
touched = input(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
3173
3267
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
3174
3268
|
searchable = input(true, ...(ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []));
|
|
3175
3269
|
maxSelected = input(null, ...(ngDevMode ? [{ debugName: "maxSelected" }] : /* istanbul ignore next */ []));
|
|
3176
3270
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
3177
|
-
id = `ngx-multi-${nextId$
|
|
3271
|
+
id = `ngx-multi-${nextId$8++}`;
|
|
3272
|
+
messageId = `${this.id}-message`;
|
|
3178
3273
|
ChevronDownIcon = ChevronDown;
|
|
3179
3274
|
XIcon = X;
|
|
3180
3275
|
CheckIcon = Check;
|
|
@@ -3196,11 +3291,13 @@ class MultiSelectComponent {
|
|
|
3196
3291
|
const max = this.maxSelected();
|
|
3197
3292
|
return max === null || this.value().length < max;
|
|
3198
3293
|
}, ...(ngDevMode ? [{ debugName: "canSelectMore" }] : /* istanbul ignore next */ []));
|
|
3294
|
+
hasError = computed(() => fieldHasError(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
3295
|
+
errorText = computed(() => fieldErrorText(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
3199
3296
|
triggerClasses = computed(() => {
|
|
3200
3297
|
const base = `ms__trigger ms__trigger--${this.size()}`;
|
|
3201
3298
|
if (this.#open())
|
|
3202
3299
|
return base + ' ms__trigger--open';
|
|
3203
|
-
if (this.
|
|
3300
|
+
if (this.hasError())
|
|
3204
3301
|
return base + ' ms__trigger--error';
|
|
3205
3302
|
return base;
|
|
3206
3303
|
}, ...(ngDevMode ? [{ debugName: "triggerClasses" }] : /* istanbul ignore next */ []));
|
|
@@ -3314,13 +3411,13 @@ class MultiSelectComponent {
|
|
|
3314
3411
|
this.#disabledInt.set(d);
|
|
3315
3412
|
}
|
|
3316
3413
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3317
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MultiSelectComponent, isStandalone: true, selector: "ngx-ds-multi-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, maxSelected: { classPropertyName: "maxSelected", publicName: "maxSelected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
3414
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: MultiSelectComponent, isStandalone: true, selector: "ngx-ds-multi-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, maxSelected: { classPropertyName: "maxSelected", publicName: "maxSelected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
3318
3415
|
{
|
|
3319
3416
|
provide: NG_VALUE_ACCESSOR,
|
|
3320
3417
|
useExisting: forwardRef(() => MultiSelectComponent),
|
|
3321
3418
|
multi: true,
|
|
3322
3419
|
},
|
|
3323
|
-
], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (label()) {\n <label class=\"ms__label\" [for]=\"id\">{{ label() }}</label>\n}\n\n<div class=\"ms\">\n <!-- Trigger -->\n <div\n #trigger\n [class]=\"triggerClasses()\"\n [id]=\"id\"\n role=\"combobox\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggleOpen()\"\n (keydown)=\"onTriggerKeydown($event)\"\n >\n <div class=\"ms__chips\">\n @if (value().length === 0) {\n <span class=\"ms__placeholder\">{{ placeholder() ?? i18n.selectPlaceholder }}</span>\n }\n @for (val of value(); track val) {\n @let label = selectedLabels()[$index];\n <span class=\"ms__chip\">\n {{ label }}\n <button\n type=\"button\"\n class=\"ms__chip-remove\"\n (click)=\"removeChip(val, $event)\"\n [attr.aria-label]=\"i18n.removeChip(label)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"12\" />\n </button>\n </span>\n }\n </div>\n <ngx-ds-icon\n [icon]=\"ChevronDownIcon\"\n [size]=\"16\"\n class=\"ms__arrow\"\n [class.ms__arrow--open]=\"isOpen()\"\n />\n </div>\n\n <!-- Dropdown -->\n @if (isOpen()) {\n <div\n class=\"ms__dropdown\"\n [id]=\"id + '-panel'\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"true\"\n >\n @if (searchable()) {\n <div class=\"ms__search-wrap\">\n <input\n class=\"ms__search\"\n type=\"text\"\n [placeholder]=\"i18n.searchPlaceholder\"\n [value]=\"search()\"\n (input)=\"onSearch($event)\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onSearchKeydown($event)\"\n />\n </div>\n }\n\n <ul class=\"ms__list\">\n @for (option of filteredOptions(); track option.value) {\n <li\n class=\"ms__option\"\n [class.ms__option--selected]=\"isSelected(option)\"\n [class.ms__option--disabled]=\"\n option.disabled || (!canSelectMore() && !isSelected(option))\n \"\n role=\"option\"\n tabindex=\"-1\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled || null\"\n (click)=\"toggleOption(option)\"\n (keydown)=\"onOptionKeydown($event, option)\"\n >\n <span class=\"ms__option-check\">\n @if (isSelected(option)) {\n <ngx-ds-icon [icon]=\"CheckIcon\" [size]=\"14\" />\n }\n </span>\n {{ option.label }}\n </li>\n }\n\n @if (filteredOptions().length === 0) {\n <li class=\"ms__empty\">{{ i18n.noResults }}</li>\n }\n </ul>\n </div>\n }\n</div>\n\n@if (
|
|
3420
|
+
], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (label()) {\n <label class=\"ms__label\" [for]=\"id\">{{ label() }}</label>\n}\n\n<div class=\"ms\">\n <!-- Trigger -->\n <div\n #trigger\n [class]=\"triggerClasses()\"\n [id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n role=\"combobox\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggleOpen()\"\n (keydown)=\"onTriggerKeydown($event)\"\n >\n <div class=\"ms__chips\">\n @if (value().length === 0) {\n <span class=\"ms__placeholder\">{{ placeholder() ?? i18n.selectPlaceholder }}</span>\n }\n @for (val of value(); track val) {\n @let label = selectedLabels()[$index];\n <span class=\"ms__chip\">\n {{ label }}\n <button\n type=\"button\"\n class=\"ms__chip-remove\"\n (click)=\"removeChip(val, $event)\"\n [attr.aria-label]=\"i18n.removeChip(label)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"12\" />\n </button>\n </span>\n }\n </div>\n <ngx-ds-icon\n [icon]=\"ChevronDownIcon\"\n [size]=\"16\"\n class=\"ms__arrow\"\n [class.ms__arrow--open]=\"isOpen()\"\n />\n </div>\n\n <!-- Dropdown -->\n @if (isOpen()) {\n <div\n class=\"ms__dropdown\"\n [id]=\"id + '-panel'\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"true\"\n >\n @if (searchable()) {\n <div class=\"ms__search-wrap\">\n <input\n class=\"ms__search\"\n type=\"text\"\n [placeholder]=\"i18n.searchPlaceholder\"\n [value]=\"search()\"\n (input)=\"onSearch($event)\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onSearchKeydown($event)\"\n />\n </div>\n }\n\n <ul class=\"ms__list\">\n @for (option of filteredOptions(); track option.value) {\n <li\n class=\"ms__option\"\n [class.ms__option--selected]=\"isSelected(option)\"\n [class.ms__option--disabled]=\"\n option.disabled || (!canSelectMore() && !isSelected(option))\n \"\n role=\"option\"\n tabindex=\"-1\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled || null\"\n (click)=\"toggleOption(option)\"\n (keydown)=\"onOptionKeydown($event, option)\"\n >\n <span class=\"ms__option-check\">\n @if (isSelected(option)) {\n <ngx-ds-icon [icon]=\"CheckIcon\" [size]=\"14\" />\n }\n </span>\n {{ option.label }}\n </li>\n }\n\n @if (filteredOptions().length === 0) {\n <li class=\"ms__empty\">{{ i18n.noResults }}</li>\n }\n </ul>\n </div>\n }\n</div>\n\n@if (errorText()) {\n <p [id]=\"messageId\" role=\"alert\" class=\"ms__error\">{{ errorText() }}</p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ms__hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ms__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-base, #111827)}.ms{position:relative}.ms__trigger{display:flex;align-items:center;gap:.5rem;border:1px solid var(--border-input, #d1d5db);border-radius:.5rem;background:var(--surface-base, #ffffff);cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease;min-height:2.5rem}.ms__trigger--sm{padding:.25rem .625rem;font-size:.8125rem;min-height:2rem}.ms__trigger--md{padding:.375rem .75rem;font-size:.875rem;min-height:2.5rem}.ms__trigger--lg{padding:.5rem 1rem;font-size:1rem;min-height:3rem}.ms__trigger--open,.ms__trigger:focus{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px var(--primary-100, #e0e7ff);outline:none}.ms__trigger--error{border-color:var(--danger-600, #dc2626)}.ms__chips{flex:1;display:flex;flex-wrap:wrap;gap:.25rem;min-width:0}.ms__placeholder{color:var(--text-placeholder, #9ca3af);font-size:inherit}.ms__chip{display:inline-flex;align-items:center;gap:.25rem;background:var(--primary-100, #e0e7ff);color:var(--primary-700, #4338ca);border-radius:.25rem;font-size:.75rem;font-weight:500;padding:.125rem .375rem}.ms__chip-remove{display:inline-flex;align-items:center;justify-content:center;background:none;border:none;padding:0;cursor:pointer;color:inherit;opacity:.7;line-height:1}.ms__chip-remove:hover{opacity:1}.ms__arrow{flex-shrink:0;color:var(--text-placeholder, #9ca3af);transition:transform .2s ease}.ms__arrow--open{transform:rotate(180deg)}.ms__dropdown{position:absolute;top:calc(100% + .25rem);left:0;right:0;background:var(--surface-base, #ffffff);border:1px solid var(--border-base, #e5e7eb);border-radius:.5rem;box-shadow:0 4px 16px #0000001a;z-index:1000;overflow:hidden}.ms__search-wrap{padding:.5rem;border-bottom:1px solid var(--border-base, #e5e7eb)}.ms__search{width:100%;border:1px solid var(--border-input, #d1d5db);border-radius:.375rem;padding:.375rem .5rem;font-family:inherit;font-size:.8125rem;outline:none;background:var(--surface-subtle, #f9fafb);color:var(--text-base, #111827);box-sizing:border-box}.ms__search:focus{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 2px var(--primary-100, #e0e7ff)}.ms__list{list-style:none;margin:0;padding:.25rem;max-height:14rem;overflow-y:auto}.ms__option{display:flex;align-items:center;gap:.5rem;padding:.5rem .625rem;border-radius:.375rem;cursor:pointer;font-size:.875rem;color:var(--text-base, #111827);transition:background .1s ease}.ms__option:hover:not(.ms__option--disabled){background:var(--surface-hover, #f3f4f6)}.ms__option--selected{background:var(--primary-50, #eef2ff);color:var(--primary-700, #4338ca)}.ms__option--disabled{opacity:.45;cursor:not-allowed}.ms__option-check{display:inline-flex;align-items:center;justify-content:center;width:1rem;height:1rem;flex-shrink:0}.ms__empty{padding:.75rem;text-align:center;font-size:.8125rem;color:var(--text-placeholder, #9ca3af)}.ms__hint{margin:.375rem 0 0;font-size:.8125rem;color:var(--text-muted, #6b7280)}.ms__error{margin:.375rem 0 0;font-size:.8125rem;color:var(--danger-600, #dc2626)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3324
3421
|
}
|
|
3325
3422
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: MultiSelectComponent, decorators: [{
|
|
3326
3423
|
type: Component,
|
|
@@ -3330,8 +3427,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
3330
3427
|
useExisting: forwardRef(() => MultiSelectComponent),
|
|
3331
3428
|
multi: true,
|
|
3332
3429
|
},
|
|
3333
|
-
], template: "@if (label()) {\n <label class=\"ms__label\" [for]=\"id\">{{ label() }}</label>\n}\n\n<div class=\"ms\">\n <!-- Trigger -->\n <div\n #trigger\n [class]=\"triggerClasses()\"\n [id]=\"id\"\n role=\"combobox\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggleOpen()\"\n (keydown)=\"onTriggerKeydown($event)\"\n >\n <div class=\"ms__chips\">\n @if (value().length === 0) {\n <span class=\"ms__placeholder\">{{ placeholder() ?? i18n.selectPlaceholder }}</span>\n }\n @for (val of value(); track val) {\n @let label = selectedLabels()[$index];\n <span class=\"ms__chip\">\n {{ label }}\n <button\n type=\"button\"\n class=\"ms__chip-remove\"\n (click)=\"removeChip(val, $event)\"\n [attr.aria-label]=\"i18n.removeChip(label)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"12\" />\n </button>\n </span>\n }\n </div>\n <ngx-ds-icon\n [icon]=\"ChevronDownIcon\"\n [size]=\"16\"\n class=\"ms__arrow\"\n [class.ms__arrow--open]=\"isOpen()\"\n />\n </div>\n\n <!-- Dropdown -->\n @if (isOpen()) {\n <div\n class=\"ms__dropdown\"\n [id]=\"id + '-panel'\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"true\"\n >\n @if (searchable()) {\n <div class=\"ms__search-wrap\">\n <input\n class=\"ms__search\"\n type=\"text\"\n [placeholder]=\"i18n.searchPlaceholder\"\n [value]=\"search()\"\n (input)=\"onSearch($event)\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onSearchKeydown($event)\"\n />\n </div>\n }\n\n <ul class=\"ms__list\">\n @for (option of filteredOptions(); track option.value) {\n <li\n class=\"ms__option\"\n [class.ms__option--selected]=\"isSelected(option)\"\n [class.ms__option--disabled]=\"\n option.disabled || (!canSelectMore() && !isSelected(option))\n \"\n role=\"option\"\n tabindex=\"-1\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled || null\"\n (click)=\"toggleOption(option)\"\n (keydown)=\"onOptionKeydown($event, option)\"\n >\n <span class=\"ms__option-check\">\n @if (isSelected(option)) {\n <ngx-ds-icon [icon]=\"CheckIcon\" [size]=\"14\" />\n }\n </span>\n {{ option.label }}\n </li>\n }\n\n @if (filteredOptions().length === 0) {\n <li class=\"ms__empty\">{{ i18n.noResults }}</li>\n }\n </ul>\n </div>\n }\n</div>\n\n@if (
|
|
3334
|
-
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], maxSelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSelected", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], triggerRef: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }] } });
|
|
3430
|
+
], template: "@if (label()) {\n <label class=\"ms__label\" [for]=\"id\">{{ label() }}</label>\n}\n\n<div class=\"ms\">\n <!-- Trigger -->\n <div\n #trigger\n [class]=\"triggerClasses()\"\n [id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n role=\"combobox\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n [attr.aria-controls]=\"id + '-panel'\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggleOpen()\"\n (keydown)=\"onTriggerKeydown($event)\"\n >\n <div class=\"ms__chips\">\n @if (value().length === 0) {\n <span class=\"ms__placeholder\">{{ placeholder() ?? i18n.selectPlaceholder }}</span>\n }\n @for (val of value(); track val) {\n @let label = selectedLabels()[$index];\n <span class=\"ms__chip\">\n {{ label }}\n <button\n type=\"button\"\n class=\"ms__chip-remove\"\n (click)=\"removeChip(val, $event)\"\n [attr.aria-label]=\"i18n.removeChip(label)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"12\" />\n </button>\n </span>\n }\n </div>\n <ngx-ds-icon\n [icon]=\"ChevronDownIcon\"\n [size]=\"16\"\n class=\"ms__arrow\"\n [class.ms__arrow--open]=\"isOpen()\"\n />\n </div>\n\n <!-- Dropdown -->\n @if (isOpen()) {\n <div\n class=\"ms__dropdown\"\n [id]=\"id + '-panel'\"\n role=\"listbox\"\n [attr.aria-multiselectable]=\"true\"\n >\n @if (searchable()) {\n <div class=\"ms__search-wrap\">\n <input\n class=\"ms__search\"\n type=\"text\"\n [placeholder]=\"i18n.searchPlaceholder\"\n [value]=\"search()\"\n (input)=\"onSearch($event)\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onSearchKeydown($event)\"\n />\n </div>\n }\n\n <ul class=\"ms__list\">\n @for (option of filteredOptions(); track option.value) {\n <li\n class=\"ms__option\"\n [class.ms__option--selected]=\"isSelected(option)\"\n [class.ms__option--disabled]=\"\n option.disabled || (!canSelectMore() && !isSelected(option))\n \"\n role=\"option\"\n tabindex=\"-1\"\n [attr.aria-selected]=\"isSelected(option)\"\n [attr.aria-disabled]=\"option.disabled || null\"\n (click)=\"toggleOption(option)\"\n (keydown)=\"onOptionKeydown($event, option)\"\n >\n <span class=\"ms__option-check\">\n @if (isSelected(option)) {\n <ngx-ds-icon [icon]=\"CheckIcon\" [size]=\"14\" />\n }\n </span>\n {{ option.label }}\n </li>\n }\n\n @if (filteredOptions().length === 0) {\n <li class=\"ms__empty\">{{ i18n.noResults }}</li>\n }\n </ul>\n </div>\n }\n</div>\n\n@if (errorText()) {\n <p [id]=\"messageId\" role=\"alert\" class=\"ms__error\">{{ errorText() }}</p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ms__hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ms__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-base, #111827)}.ms{position:relative}.ms__trigger{display:flex;align-items:center;gap:.5rem;border:1px solid var(--border-input, #d1d5db);border-radius:.5rem;background:var(--surface-base, #ffffff);cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease;min-height:2.5rem}.ms__trigger--sm{padding:.25rem .625rem;font-size:.8125rem;min-height:2rem}.ms__trigger--md{padding:.375rem .75rem;font-size:.875rem;min-height:2.5rem}.ms__trigger--lg{padding:.5rem 1rem;font-size:1rem;min-height:3rem}.ms__trigger--open,.ms__trigger:focus{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px var(--primary-100, #e0e7ff);outline:none}.ms__trigger--error{border-color:var(--danger-600, #dc2626)}.ms__chips{flex:1;display:flex;flex-wrap:wrap;gap:.25rem;min-width:0}.ms__placeholder{color:var(--text-placeholder, #9ca3af);font-size:inherit}.ms__chip{display:inline-flex;align-items:center;gap:.25rem;background:var(--primary-100, #e0e7ff);color:var(--primary-700, #4338ca);border-radius:.25rem;font-size:.75rem;font-weight:500;padding:.125rem .375rem}.ms__chip-remove{display:inline-flex;align-items:center;justify-content:center;background:none;border:none;padding:0;cursor:pointer;color:inherit;opacity:.7;line-height:1}.ms__chip-remove:hover{opacity:1}.ms__arrow{flex-shrink:0;color:var(--text-placeholder, #9ca3af);transition:transform .2s ease}.ms__arrow--open{transform:rotate(180deg)}.ms__dropdown{position:absolute;top:calc(100% + .25rem);left:0;right:0;background:var(--surface-base, #ffffff);border:1px solid var(--border-base, #e5e7eb);border-radius:.5rem;box-shadow:0 4px 16px #0000001a;z-index:1000;overflow:hidden}.ms__search-wrap{padding:.5rem;border-bottom:1px solid var(--border-base, #e5e7eb)}.ms__search{width:100%;border:1px solid var(--border-input, #d1d5db);border-radius:.375rem;padding:.375rem .5rem;font-family:inherit;font-size:.8125rem;outline:none;background:var(--surface-subtle, #f9fafb);color:var(--text-base, #111827);box-sizing:border-box}.ms__search:focus{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 2px var(--primary-100, #e0e7ff)}.ms__list{list-style:none;margin:0;padding:.25rem;max-height:14rem;overflow-y:auto}.ms__option{display:flex;align-items:center;gap:.5rem;padding:.5rem .625rem;border-radius:.375rem;cursor:pointer;font-size:.875rem;color:var(--text-base, #111827);transition:background .1s ease}.ms__option:hover:not(.ms__option--disabled){background:var(--surface-hover, #f3f4f6)}.ms__option--selected{background:var(--primary-50, #eef2ff);color:var(--primary-700, #4338ca)}.ms__option--disabled{opacity:.45;cursor:not-allowed}.ms__option-check{display:inline-flex;align-items:center;justify-content:center;width:1rem;height:1rem;flex-shrink:0}.ms__empty{padding:.75rem;text-align:center;font-size:.8125rem;color:var(--text-placeholder, #9ca3af)}.ms__hint{margin:.375rem 0 0;font-size:.8125rem;color:var(--text-muted, #6b7280)}.ms__error{margin:.375rem 0 0;font-size:.8125rem;color:var(--danger-600, #dc2626)}\n"] }]
|
|
3431
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], maxSelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSelected", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], triggerRef: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }] } });
|
|
3335
3432
|
|
|
3336
3433
|
const SIZES = { sm: 16, md: 22, lg: 28 };
|
|
3337
3434
|
class RatingComponent {
|
|
@@ -3478,7 +3575,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
3478
3575
|
], template: "<div [class]=\"hostClasses()\" role=\"group\">\n @for (chip of chips(); track chip.value) {\n <span\n class=\"chip\"\n [class.chip--selected]=\"isSelected(chip)\"\n [class.chip--disabled]=\"chip.disabled || isDisabled()\"\n >\n <button\n type=\"button\"\n class=\"chip__label\"\n [disabled]=\"chip.disabled || isDisabled() || null\"\n [attr.aria-pressed]=\"selectable() ? isSelected(chip) : null\"\n (click)=\"toggle(chip)\"\n >\n {{ chip.label }}\n </button>\n\n @if (removable()) {\n <button\n type=\"button\"\n class=\"chip__remove\"\n [disabled]=\"chip.disabled || isDisabled() || null\"\n [attr.aria-label]=\"i18n.removeChip(chip.label)\"\n (click)=\"remove(chip, $event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"12\" />\n </button>\n }\n </span>\n }\n</div>\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.chip-group{display:flex;flex-wrap:wrap;gap:.5rem}.chip{display:inline-flex;align-items:center;gap:.375rem;border-radius:999px;cursor:pointer;font-family:inherit;font-weight:500;transition:background .15s ease,color .15s ease,border-color .15s ease,box-shadow .15s ease;white-space:nowrap;position:relative}.chip:has(.chip__label:focus-visible){box-shadow:0 0 0 2px var(--primary-300, #a5b4fc)}.chip--disabled{opacity:.45;cursor:not-allowed}.chip__label,.chip__remove{appearance:none;background:none;border:0;padding:0;margin:0;color:inherit;font:inherit;cursor:inherit}.chip__label:disabled,.chip__remove:disabled{cursor:not-allowed}.chip__label{outline:none}.chip__label:after{content:\"\";position:absolute;inset:0;border-radius:inherit}.chip__remove{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;width:1rem;height:1rem;line-height:0;opacity:.6}.chip__remove:hover:not(:disabled){opacity:1}.chip__remove:focus-visible{opacity:1;outline:2px solid var(--primary-300, #a5b4fc);outline-offset:1px}.chip-group--sm .chip{font-size:.75rem;padding:.2rem .625rem}.chip-group--md .chip{font-size:.8125rem;padding:.3rem .875rem}.chip-group--lg .chip{font-size:.9375rem;padding:.4rem 1.125rem}.chip-group--soft .chip{background:var(--surface-muted, #f3f4f6);color:var(--text-secondary, #374151);border:1px solid transparent}.chip-group--soft .chip:hover:not(.chip--disabled){background:var(--surface-active, #e5e7eb);color:var(--text-base, #111827)}.chip-group--soft .chip--selected{background:var(--primary-100, #e0e7ff);color:var(--primary-700, #4338ca);border-color:var(--primary-200, #c7d2fe)}.chip-group--filled .chip{background:var(--surface-active, #e5e7eb);color:var(--text-secondary, #374151);border:1px solid transparent}.chip-group--filled .chip:hover:not(.chip--disabled){background:var(--border-input, #d1d5db)}.chip-group--filled .chip--selected{background:var(--primary-500, #6366f1);color:var(--text-on-color, #fff);border-color:var(--primary-600, #4f46e5)}.chip-group--outline .chip{background:transparent;color:var(--text-muted, #6b7280);border:1px solid var(--border-input, #d1d5db)}.chip-group--outline .chip:hover:not(.chip--disabled){border-color:var(--text-placeholder, #9ca3af);color:var(--text-base, #111827)}.chip-group--outline .chip--selected{border-color:var(--primary-500, #6366f1);color:var(--primary-700, #4338ca);background:var(--primary-50, #eef2ff)}\n"] }]
|
|
3479
3576
|
}], propDecorators: { chips: [{ type: i0.Input, args: [{ isSignal: true, alias: "chips", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }, { type: i0.Output, args: ["selectedChange"] }], selectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectable", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], multiSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiSelect", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], removed: [{ type: i0.Output, args: ["removed"] }] } });
|
|
3480
3577
|
|
|
3481
|
-
let nextId$
|
|
3578
|
+
let nextId$7 = 0;
|
|
3482
3579
|
class DateRangePickerComponent {
|
|
3483
3580
|
i18n = inject(NGX_DS_LABELS);
|
|
3484
3581
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
@@ -3486,6 +3583,9 @@ class DateRangePickerComponent {
|
|
|
3486
3583
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
3487
3584
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
3488
3585
|
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
3586
|
+
/** Set by Signal Forms `[formField]`. Its errors show once the field is touched. */
|
|
3587
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
3588
|
+
touched = input(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
3489
3589
|
minDate = input(null, ...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
|
|
3490
3590
|
maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
3491
3591
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
@@ -3493,7 +3593,8 @@ class DateRangePickerComponent {
|
|
|
3493
3593
|
isDisabled = computed(() => this.disabled() || this.#formDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
3494
3594
|
start = model(null, ...(ngDevMode ? [{ debugName: "start" }] : /* istanbul ignore next */ []));
|
|
3495
3595
|
end = model(null, ...(ngDevMode ? [{ debugName: "end" }] : /* istanbul ignore next */ []));
|
|
3496
|
-
id = `ngx-drp-${nextId$
|
|
3596
|
+
id = `ngx-drp-${nextId$7++}`;
|
|
3597
|
+
messageId = `${this.id}-message`;
|
|
3497
3598
|
CalendarIcon = Calendar;
|
|
3498
3599
|
ChevronLeft = ChevronLeft;
|
|
3499
3600
|
ChevronRight = ChevronRight;
|
|
@@ -3523,13 +3624,15 @@ class DateRangePickerComponent {
|
|
|
3523
3624
|
return `${fmt(s)} – ...`;
|
|
3524
3625
|
return '';
|
|
3525
3626
|
}, ...(ngDevMode ? [{ debugName: "triggerLabel" }] : /* istanbul ignore next */ []));
|
|
3627
|
+
hasError = computed(() => fieldHasError(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
3628
|
+
errorText = computed(() => fieldErrorText(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
3526
3629
|
triggerClasses = computed(() => {
|
|
3527
3630
|
const base = `drp__trigger drp__trigger--${this.size()}`;
|
|
3528
3631
|
if (this.isDisabled())
|
|
3529
3632
|
return base + ' drp__trigger--disabled';
|
|
3530
3633
|
if (this.#open())
|
|
3531
3634
|
return base + ' drp__trigger--open';
|
|
3532
|
-
if (this.
|
|
3635
|
+
if (this.hasError())
|
|
3533
3636
|
return base + ' drp__trigger--error';
|
|
3534
3637
|
return base;
|
|
3535
3638
|
}, ...(ngDevMode ? [{ debugName: "triggerClasses" }] : /* istanbul ignore next */ []));
|
|
@@ -3743,13 +3846,13 @@ class DateRangePickerComponent {
|
|
|
3743
3846
|
this.#formDisabled.set(isDisabled);
|
|
3744
3847
|
}
|
|
3745
3848
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DateRangePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3746
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: DateRangePickerComponent, isStandalone: true, selector: "ngx-ds-date-range-picker", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, start: { classPropertyName: "start", publicName: "start", isSignal: true, isRequired: false, transformFunction: null }, end: { classPropertyName: "end", publicName: "end", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { start: "startChange", end: "endChange" }, providers: [
|
|
3849
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: DateRangePickerComponent, isStandalone: true, selector: "ngx-ds-date-range-picker", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, start: { classPropertyName: "start", publicName: "start", isSignal: true, isRequired: false, transformFunction: null }, end: { classPropertyName: "end", publicName: "end", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { start: "startChange", end: "endChange" }, providers: [
|
|
3747
3850
|
{
|
|
3748
3851
|
provide: NG_VALUE_ACCESSOR,
|
|
3749
3852
|
useExisting: forwardRef(() => DateRangePickerComponent),
|
|
3750
3853
|
multi: true,
|
|
3751
3854
|
},
|
|
3752
|
-
], viewQueries: [{ propertyName: "panelRef", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (label()) {\n <label class=\"drp__label\" [for]=\"id\">{{ label() }}</label>\n}\n\n<div class=\"drp\">\n <!-- Trigger -->\n <div\n #trigger\n [class]=\"triggerClasses()\"\n [id]=\"id\"\n role=\"button\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n (click)=\"openCalendar()\"\n (keydown)=\"onTriggerKeydown($event)\"\n >\n <ngx-ds-icon [icon]=\"CalendarIcon\" [size]=\"16\" class=\"drp__icon\" />\n <span class=\"drp__text\" [class.drp__text--placeholder]=\"!triggerLabel()\">\n {{ triggerLabel() || placeholderText() + ' \u2013 ' + placeholderText() }}\n </span>\n @if ((start() || end()) && !isDisabled()) {\n <button\n type=\"button\"\n class=\"drp__clear\"\n (click)=\"clear($event)\"\n [attr.aria-label]=\"i18n.clear\"\n >\n \u00D7\n </button>\n }\n </div>\n\n <!-- Calendars panel -->\n @if (isOpen()) {\n <div\n #panel\n class=\"drp__panel\"\n role=\"dialog\"\n [attr.aria-label]=\"i18n.selectDateRange\"\n (mouseleave)=\"onLeave()\"\n >\n <!-- Left calendar -->\n <div class=\"drp__calendar\">\n <div class=\"drp__cal-header\">\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n [attr.aria-label]=\"i18n.prevMonth\"\n (click)=\"prevMonth()\"\n >\n <ngx-ds-icon [icon]=\"ChevronLeft\" [size]=\"16\" />\n </button>\n <span class=\"drp__month-title\">{{ leftTitle() }}</span>\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n style=\"visibility: hidden\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n >\n <ngx-ds-icon [icon]=\"ChevronRight\" [size]=\"16\" />\n </button>\n </div>\n <div class=\"drp__weekdays\" aria-hidden=\"true\">\n @for (d of weekdays; track d) {\n <span class=\"drp__weekday\">{{ d }}</span>\n }\n </div>\n <div class=\"drp__grid\" role=\"grid\" [attr.aria-label]=\"leftTitle()\">\n @for (week of leftWeeks(); track $index) {\n <div class=\"drp__week\" role=\"row\">\n @for (cell of week; track cell.date.getTime()) {\n <button\n type=\"button\"\n class=\"drp__day\"\n role=\"gridcell\"\n [class.drp__day--other]=\"!cell.inMonth\"\n [class.drp__day--today]=\"cell.isToday\"\n [class.drp__day--start]=\"isStart(cell.date)\"\n [class.drp__day--end]=\"isEnd(cell.date)\"\n [class.drp__day--in-range]=\"inRange(cell.date)\"\n [class.drp__day--disabled]=\"cell.isDisabled\"\n [attr.aria-disabled]=\"cell.isDisabled || null\"\n [attr.aria-label]=\"dayLabel(cell.date)\"\n [attr.aria-selected]=\"isSelected(cell.date)\"\n [attr.aria-current]=\"cell.isToday ? 'date' : null\"\n [attr.tabindex]=\"isFocusTarget(cell) ? 0 : -1\"\n (click)=\"selectDay(cell)\"\n (mouseenter)=\"onHover(cell)\"\n (keydown)=\"onDayKeydown($event, cell)\"\n >\n {{ cell.date.getDate() }}\n </button>\n }\n </div>\n }\n </div>\n </div>\n\n <div class=\"drp__divider\"></div>\n\n <!-- Right calendar -->\n <div class=\"drp__calendar\">\n <div class=\"drp__cal-header\">\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n style=\"visibility: hidden\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n >\n <ngx-ds-icon [icon]=\"ChevronLeft\" [size]=\"16\" />\n </button>\n <span class=\"drp__month-title\">{{ rightTitle() }}</span>\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n [attr.aria-label]=\"i18n.nextMonth\"\n (click)=\"nextMonth()\"\n >\n <ngx-ds-icon [icon]=\"ChevronRight\" [size]=\"16\" />\n </button>\n </div>\n <div class=\"drp__weekdays\" aria-hidden=\"true\">\n @for (d of weekdays; track d) {\n <span class=\"drp__weekday\">{{ d }}</span>\n }\n </div>\n <div class=\"drp__grid\" role=\"grid\" [attr.aria-label]=\"rightTitle()\">\n @for (week of rightWeeks(); track $index) {\n <div class=\"drp__week\" role=\"row\">\n @for (cell of week; track cell.date.getTime()) {\n <button\n type=\"button\"\n class=\"drp__day\"\n role=\"gridcell\"\n [class.drp__day--other]=\"!cell.inMonth\"\n [class.drp__day--today]=\"cell.isToday\"\n [class.drp__day--start]=\"isStart(cell.date)\"\n [class.drp__day--end]=\"isEnd(cell.date)\"\n [class.drp__day--in-range]=\"inRange(cell.date)\"\n [class.drp__day--disabled]=\"cell.isDisabled\"\n [attr.aria-disabled]=\"cell.isDisabled || null\"\n [attr.aria-label]=\"dayLabel(cell.date)\"\n [attr.aria-selected]=\"isSelected(cell.date)\"\n [attr.aria-current]=\"cell.isToday ? 'date' : null\"\n [attr.tabindex]=\"isFocusTarget(cell) ? 0 : -1\"\n (click)=\"selectDay(cell)\"\n (mouseenter)=\"onHover(cell)\"\n (keydown)=\"onDayKeydown($event, cell)\"\n >\n {{ cell.date.getDate() }}\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n</div>\n\n@if (errorMessage()) {\n <p class=\"drp__error\">{{ errorMessage() }}</p>\n} @else if (hint()) {\n <p class=\"drp__hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.drp__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-base, #111827)}.drp{position:relative;display:inline-block}.drp__trigger{display:inline-flex;align-items:center;gap:.5rem;border:1px solid var(--border-input, #d1d5db);border-radius:.5rem;background:var(--surface-base, #ffffff);cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}.drp__trigger--sm{padding:.375rem .75rem;font-size:.8125rem}.drp__trigger--md{padding:.5rem .875rem;font-size:.875rem}.drp__trigger--lg{padding:.625rem 1rem;font-size:1rem}.drp__trigger--open{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px var(--primary-100, #e0e7ff)}.drp__trigger--error{border-color:var(--danger-600, #dc2626)}.drp__trigger--disabled{background:var(--surface-subtle, #f9fafb);color:var(--text-disabled, #9ca3af);cursor:not-allowed}.drp__icon{color:var(--text-placeholder, #9ca3af);flex-shrink:0}.drp__text{flex:1;min-width:0;white-space:nowrap;color:var(--text-base, #111827)}.drp__text--placeholder{color:var(--text-placeholder, #9ca3af)}.drp__clear{background:none;border:none;padding:0;cursor:pointer;font-size:1.125rem;line-height:1;color:var(--text-placeholder, #9ca3af);display:flex;align-items:center}.drp__clear:hover{color:var(--text-base, #111827)}.drp__panel{position:absolute;top:calc(100% + .5rem);left:0;display:flex;gap:0;background:var(--surface-base, #ffffff);border:1px solid var(--border-base, #e5e7eb);border-radius:.75rem;box-shadow:0 8px 24px #0000001f;z-index:1000;overflow:hidden}.drp__divider{width:1px;background:var(--border-base, #e5e7eb);margin:1rem 0}.drp__calendar{padding:1rem;width:17rem}.drp__cal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:.75rem}.drp__month-title{font-size:.9375rem;font-weight:600;color:var(--text-base, #111827)}.drp__nav-btn{background:none;border:none;cursor:pointer;padding:.25rem;border-radius:.375rem;display:flex;align-items:center;color:var(--text-muted, #6b7280);transition:background .1s ease}.drp__nav-btn:hover{background:var(--surface-hover, #f3f4f6);color:var(--text-base, #111827)}.drp__weekdays{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:.25rem}.drp__weekday{text-align:center;font-size:.75rem;font-weight:600;color:var(--text-placeholder, #9ca3af);padding:.25rem 0}.drp__grid{display:grid;grid-template-columns:repeat(7,1fr);gap:.125rem}.drp__day{display:flex;align-items:center;justify-content:center;aspect-ratio:1;border:none;background:transparent;border-radius:.375rem;font-size:.8125rem;font-family:inherit;cursor:pointer;color:var(--text-base, #111827);transition:background .1s ease,color .1s ease}.drp__day:focus-visible{outline:2px solid var(--primary-300, #a5b4fc);outline-offset:1px}.drp__day:hover:not(.drp__day--disabled):not(.drp__day--in-range):not(.drp__day--start):not(.drp__day--end){background:var(--surface-hover, #f3f4f6)}.drp__day--other{color:var(--text-disabled, #d1d5db)}.drp__day--today{font-weight:700;color:var(--primary-600, #4f46e5)}.drp__day--in-range{background:var(--primary-50, #eef2ff);border-radius:0;color:var(--primary-700, #4338ca)}.drp__day--start,.drp__day--end{background:var(--primary-500, #6366f1);color:var(--text-on-color, #fff);font-weight:600;border-radius:.375rem}.drp__day--start.drp__day--in-range{border-radius:.375rem 0 0 .375rem}.drp__day--end.drp__day--in-range{border-radius:0 .375rem .375rem 0}.drp__day--disabled{opacity:.35;cursor:not-allowed}.drp__week{display:contents}.drp__hint{margin:.375rem 0 0;font-size:.8125rem;color:var(--text-muted, #6b7280)}.drp__error{margin:.375rem 0 0;font-size:.8125rem;color:var(--danger-600, #dc2626)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3855
|
+
], viewQueries: [{ propertyName: "panelRef", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (label()) {\n <label class=\"drp__label\" [for]=\"id\">{{ label() }}</label>\n}\n\n<div class=\"drp\">\n <!-- Trigger -->\n <div\n #trigger\n [class]=\"triggerClasses()\"\n [id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n role=\"button\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n (click)=\"openCalendar()\"\n (keydown)=\"onTriggerKeydown($event)\"\n >\n <ngx-ds-icon [icon]=\"CalendarIcon\" [size]=\"16\" class=\"drp__icon\" />\n <span class=\"drp__text\" [class.drp__text--placeholder]=\"!triggerLabel()\">\n {{ triggerLabel() || placeholderText() + ' \u2013 ' + placeholderText() }}\n </span>\n @if ((start() || end()) && !isDisabled()) {\n <button\n type=\"button\"\n class=\"drp__clear\"\n (click)=\"clear($event)\"\n [attr.aria-label]=\"i18n.clear\"\n >\n \u00D7\n </button>\n }\n </div>\n\n <!-- Calendars panel -->\n @if (isOpen()) {\n <div\n #panel\n class=\"drp__panel\"\n role=\"dialog\"\n [attr.aria-label]=\"i18n.selectDateRange\"\n (mouseleave)=\"onLeave()\"\n >\n <!-- Left calendar -->\n <div class=\"drp__calendar\">\n <div class=\"drp__cal-header\">\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n [attr.aria-label]=\"i18n.prevMonth\"\n (click)=\"prevMonth()\"\n >\n <ngx-ds-icon [icon]=\"ChevronLeft\" [size]=\"16\" />\n </button>\n <span class=\"drp__month-title\">{{ leftTitle() }}</span>\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n style=\"visibility: hidden\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n >\n <ngx-ds-icon [icon]=\"ChevronRight\" [size]=\"16\" />\n </button>\n </div>\n <div class=\"drp__weekdays\" aria-hidden=\"true\">\n @for (d of weekdays; track d) {\n <span class=\"drp__weekday\">{{ d }}</span>\n }\n </div>\n <div class=\"drp__grid\" role=\"grid\" [attr.aria-label]=\"leftTitle()\">\n @for (week of leftWeeks(); track $index) {\n <div class=\"drp__week\" role=\"row\">\n @for (cell of week; track cell.date.getTime()) {\n <button\n type=\"button\"\n class=\"drp__day\"\n role=\"gridcell\"\n [class.drp__day--other]=\"!cell.inMonth\"\n [class.drp__day--today]=\"cell.isToday\"\n [class.drp__day--start]=\"isStart(cell.date)\"\n [class.drp__day--end]=\"isEnd(cell.date)\"\n [class.drp__day--in-range]=\"inRange(cell.date)\"\n [class.drp__day--disabled]=\"cell.isDisabled\"\n [attr.aria-disabled]=\"cell.isDisabled || null\"\n [attr.aria-label]=\"dayLabel(cell.date)\"\n [attr.aria-selected]=\"isSelected(cell.date)\"\n [attr.aria-current]=\"cell.isToday ? 'date' : null\"\n [attr.tabindex]=\"isFocusTarget(cell) ? 0 : -1\"\n (click)=\"selectDay(cell)\"\n (mouseenter)=\"onHover(cell)\"\n (keydown)=\"onDayKeydown($event, cell)\"\n >\n {{ cell.date.getDate() }}\n </button>\n }\n </div>\n }\n </div>\n </div>\n\n <div class=\"drp__divider\"></div>\n\n <!-- Right calendar -->\n <div class=\"drp__calendar\">\n <div class=\"drp__cal-header\">\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n style=\"visibility: hidden\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n >\n <ngx-ds-icon [icon]=\"ChevronLeft\" [size]=\"16\" />\n </button>\n <span class=\"drp__month-title\">{{ rightTitle() }}</span>\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n [attr.aria-label]=\"i18n.nextMonth\"\n (click)=\"nextMonth()\"\n >\n <ngx-ds-icon [icon]=\"ChevronRight\" [size]=\"16\" />\n </button>\n </div>\n <div class=\"drp__weekdays\" aria-hidden=\"true\">\n @for (d of weekdays; track d) {\n <span class=\"drp__weekday\">{{ d }}</span>\n }\n </div>\n <div class=\"drp__grid\" role=\"grid\" [attr.aria-label]=\"rightTitle()\">\n @for (week of rightWeeks(); track $index) {\n <div class=\"drp__week\" role=\"row\">\n @for (cell of week; track cell.date.getTime()) {\n <button\n type=\"button\"\n class=\"drp__day\"\n role=\"gridcell\"\n [class.drp__day--other]=\"!cell.inMonth\"\n [class.drp__day--today]=\"cell.isToday\"\n [class.drp__day--start]=\"isStart(cell.date)\"\n [class.drp__day--end]=\"isEnd(cell.date)\"\n [class.drp__day--in-range]=\"inRange(cell.date)\"\n [class.drp__day--disabled]=\"cell.isDisabled\"\n [attr.aria-disabled]=\"cell.isDisabled || null\"\n [attr.aria-label]=\"dayLabel(cell.date)\"\n [attr.aria-selected]=\"isSelected(cell.date)\"\n [attr.aria-current]=\"cell.isToday ? 'date' : null\"\n [attr.tabindex]=\"isFocusTarget(cell) ? 0 : -1\"\n (click)=\"selectDay(cell)\"\n (mouseenter)=\"onHover(cell)\"\n (keydown)=\"onDayKeydown($event, cell)\"\n >\n {{ cell.date.getDate() }}\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n</div>\n\n@if (errorText()) {\n <p [id]=\"messageId\" role=\"alert\" class=\"drp__error\">{{ errorText() }}</p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"drp__hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.drp__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-base, #111827)}.drp{position:relative;display:inline-block}.drp__trigger{display:inline-flex;align-items:center;gap:.5rem;border:1px solid var(--border-input, #d1d5db);border-radius:.5rem;background:var(--surface-base, #ffffff);cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}.drp__trigger--sm{padding:.375rem .75rem;font-size:.8125rem}.drp__trigger--md{padding:.5rem .875rem;font-size:.875rem}.drp__trigger--lg{padding:.625rem 1rem;font-size:1rem}.drp__trigger--open{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px var(--primary-100, #e0e7ff)}.drp__trigger--error{border-color:var(--danger-600, #dc2626)}.drp__trigger--disabled{background:var(--surface-subtle, #f9fafb);color:var(--text-disabled, #9ca3af);cursor:not-allowed}.drp__icon{color:var(--text-placeholder, #9ca3af);flex-shrink:0}.drp__text{flex:1;min-width:0;white-space:nowrap;color:var(--text-base, #111827)}.drp__text--placeholder{color:var(--text-placeholder, #9ca3af)}.drp__clear{background:none;border:none;padding:0;cursor:pointer;font-size:1.125rem;line-height:1;color:var(--text-placeholder, #9ca3af);display:flex;align-items:center}.drp__clear:hover{color:var(--text-base, #111827)}.drp__panel{position:absolute;top:calc(100% + .5rem);left:0;display:flex;gap:0;background:var(--surface-base, #ffffff);border:1px solid var(--border-base, #e5e7eb);border-radius:.75rem;box-shadow:0 8px 24px #0000001f;z-index:1000;overflow:hidden}.drp__divider{width:1px;background:var(--border-base, #e5e7eb);margin:1rem 0}.drp__calendar{padding:1rem;width:17rem}.drp__cal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:.75rem}.drp__month-title{font-size:.9375rem;font-weight:600;color:var(--text-base, #111827)}.drp__nav-btn{background:none;border:none;cursor:pointer;padding:.25rem;border-radius:.375rem;display:flex;align-items:center;color:var(--text-muted, #6b7280);transition:background .1s ease}.drp__nav-btn:hover{background:var(--surface-hover, #f3f4f6);color:var(--text-base, #111827)}.drp__weekdays{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:.25rem}.drp__weekday{text-align:center;font-size:.75rem;font-weight:600;color:var(--text-placeholder, #9ca3af);padding:.25rem 0}.drp__grid{display:grid;grid-template-columns:repeat(7,1fr);gap:.125rem}.drp__day{display:flex;align-items:center;justify-content:center;aspect-ratio:1;border:none;background:transparent;border-radius:.375rem;font-size:.8125rem;font-family:inherit;cursor:pointer;color:var(--text-base, #111827);transition:background .1s ease,color .1s ease}.drp__day:focus-visible{outline:2px solid var(--primary-300, #a5b4fc);outline-offset:1px}.drp__day:hover:not(.drp__day--disabled):not(.drp__day--in-range):not(.drp__day--start):not(.drp__day--end){background:var(--surface-hover, #f3f4f6)}.drp__day--other{color:var(--text-disabled, #d1d5db)}.drp__day--today{font-weight:700;color:var(--primary-600, #4f46e5)}.drp__day--in-range{background:var(--primary-50, #eef2ff);border-radius:0;color:var(--primary-700, #4338ca)}.drp__day--start,.drp__day--end{background:var(--primary-500, #6366f1);color:var(--text-on-color, #fff);font-weight:600;border-radius:.375rem}.drp__day--start.drp__day--in-range{border-radius:.375rem 0 0 .375rem}.drp__day--end.drp__day--in-range{border-radius:0 .375rem .375rem 0}.drp__day--disabled{opacity:.35;cursor:not-allowed}.drp__week{display:contents}.drp__hint{margin:.375rem 0 0;font-size:.8125rem;color:var(--text-muted, #6b7280)}.drp__error{margin:.375rem 0 0;font-size:.8125rem;color:var(--danger-600, #dc2626)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3753
3856
|
}
|
|
3754
3857
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: DateRangePickerComponent, decorators: [{
|
|
3755
3858
|
type: Component,
|
|
@@ -3759,8 +3862,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
3759
3862
|
useExisting: forwardRef(() => DateRangePickerComponent),
|
|
3760
3863
|
multi: true,
|
|
3761
3864
|
},
|
|
3762
|
-
], template: "@if (label()) {\n <label class=\"drp__label\" [for]=\"id\">{{ label() }}</label>\n}\n\n<div class=\"drp\">\n <!-- Trigger -->\n <div\n #trigger\n [class]=\"triggerClasses()\"\n [id]=\"id\"\n role=\"button\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n (click)=\"openCalendar()\"\n (keydown)=\"onTriggerKeydown($event)\"\n >\n <ngx-ds-icon [icon]=\"CalendarIcon\" [size]=\"16\" class=\"drp__icon\" />\n <span class=\"drp__text\" [class.drp__text--placeholder]=\"!triggerLabel()\">\n {{ triggerLabel() || placeholderText() + ' \u2013 ' + placeholderText() }}\n </span>\n @if ((start() || end()) && !isDisabled()) {\n <button\n type=\"button\"\n class=\"drp__clear\"\n (click)=\"clear($event)\"\n [attr.aria-label]=\"i18n.clear\"\n >\n \u00D7\n </button>\n }\n </div>\n\n <!-- Calendars panel -->\n @if (isOpen()) {\n <div\n #panel\n class=\"drp__panel\"\n role=\"dialog\"\n [attr.aria-label]=\"i18n.selectDateRange\"\n (mouseleave)=\"onLeave()\"\n >\n <!-- Left calendar -->\n <div class=\"drp__calendar\">\n <div class=\"drp__cal-header\">\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n [attr.aria-label]=\"i18n.prevMonth\"\n (click)=\"prevMonth()\"\n >\n <ngx-ds-icon [icon]=\"ChevronLeft\" [size]=\"16\" />\n </button>\n <span class=\"drp__month-title\">{{ leftTitle() }}</span>\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n style=\"visibility: hidden\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n >\n <ngx-ds-icon [icon]=\"ChevronRight\" [size]=\"16\" />\n </button>\n </div>\n <div class=\"drp__weekdays\" aria-hidden=\"true\">\n @for (d of weekdays; track d) {\n <span class=\"drp__weekday\">{{ d }}</span>\n }\n </div>\n <div class=\"drp__grid\" role=\"grid\" [attr.aria-label]=\"leftTitle()\">\n @for (week of leftWeeks(); track $index) {\n <div class=\"drp__week\" role=\"row\">\n @for (cell of week; track cell.date.getTime()) {\n <button\n type=\"button\"\n class=\"drp__day\"\n role=\"gridcell\"\n [class.drp__day--other]=\"!cell.inMonth\"\n [class.drp__day--today]=\"cell.isToday\"\n [class.drp__day--start]=\"isStart(cell.date)\"\n [class.drp__day--end]=\"isEnd(cell.date)\"\n [class.drp__day--in-range]=\"inRange(cell.date)\"\n [class.drp__day--disabled]=\"cell.isDisabled\"\n [attr.aria-disabled]=\"cell.isDisabled || null\"\n [attr.aria-label]=\"dayLabel(cell.date)\"\n [attr.aria-selected]=\"isSelected(cell.date)\"\n [attr.aria-current]=\"cell.isToday ? 'date' : null\"\n [attr.tabindex]=\"isFocusTarget(cell) ? 0 : -1\"\n (click)=\"selectDay(cell)\"\n (mouseenter)=\"onHover(cell)\"\n (keydown)=\"onDayKeydown($event, cell)\"\n >\n {{ cell.date.getDate() }}\n </button>\n }\n </div>\n }\n </div>\n </div>\n\n <div class=\"drp__divider\"></div>\n\n <!-- Right calendar -->\n <div class=\"drp__calendar\">\n <div class=\"drp__cal-header\">\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n style=\"visibility: hidden\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n >\n <ngx-ds-icon [icon]=\"ChevronLeft\" [size]=\"16\" />\n </button>\n <span class=\"drp__month-title\">{{ rightTitle() }}</span>\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n [attr.aria-label]=\"i18n.nextMonth\"\n (click)=\"nextMonth()\"\n >\n <ngx-ds-icon [icon]=\"ChevronRight\" [size]=\"16\" />\n </button>\n </div>\n <div class=\"drp__weekdays\" aria-hidden=\"true\">\n @for (d of weekdays; track d) {\n <span class=\"drp__weekday\">{{ d }}</span>\n }\n </div>\n <div class=\"drp__grid\" role=\"grid\" [attr.aria-label]=\"rightTitle()\">\n @for (week of rightWeeks(); track $index) {\n <div class=\"drp__week\" role=\"row\">\n @for (cell of week; track cell.date.getTime()) {\n <button\n type=\"button\"\n class=\"drp__day\"\n role=\"gridcell\"\n [class.drp__day--other]=\"!cell.inMonth\"\n [class.drp__day--today]=\"cell.isToday\"\n [class.drp__day--start]=\"isStart(cell.date)\"\n [class.drp__day--end]=\"isEnd(cell.date)\"\n [class.drp__day--in-range]=\"inRange(cell.date)\"\n [class.drp__day--disabled]=\"cell.isDisabled\"\n [attr.aria-disabled]=\"cell.isDisabled || null\"\n [attr.aria-label]=\"dayLabel(cell.date)\"\n [attr.aria-selected]=\"isSelected(cell.date)\"\n [attr.aria-current]=\"cell.isToday ? 'date' : null\"\n [attr.tabindex]=\"isFocusTarget(cell) ? 0 : -1\"\n (click)=\"selectDay(cell)\"\n (mouseenter)=\"onHover(cell)\"\n (keydown)=\"onDayKeydown($event, cell)\"\n >\n {{ cell.date.getDate() }}\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n</div>\n\n@if (errorMessage()) {\n <p class=\"drp__error\">{{ errorMessage() }}</p>\n} @else if (hint()) {\n <p class=\"drp__hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.drp__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-base, #111827)}.drp{position:relative;display:inline-block}.drp__trigger{display:inline-flex;align-items:center;gap:.5rem;border:1px solid var(--border-input, #d1d5db);border-radius:.5rem;background:var(--surface-base, #ffffff);cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}.drp__trigger--sm{padding:.375rem .75rem;font-size:.8125rem}.drp__trigger--md{padding:.5rem .875rem;font-size:.875rem}.drp__trigger--lg{padding:.625rem 1rem;font-size:1rem}.drp__trigger--open{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px var(--primary-100, #e0e7ff)}.drp__trigger--error{border-color:var(--danger-600, #dc2626)}.drp__trigger--disabled{background:var(--surface-subtle, #f9fafb);color:var(--text-disabled, #9ca3af);cursor:not-allowed}.drp__icon{color:var(--text-placeholder, #9ca3af);flex-shrink:0}.drp__text{flex:1;min-width:0;white-space:nowrap;color:var(--text-base, #111827)}.drp__text--placeholder{color:var(--text-placeholder, #9ca3af)}.drp__clear{background:none;border:none;padding:0;cursor:pointer;font-size:1.125rem;line-height:1;color:var(--text-placeholder, #9ca3af);display:flex;align-items:center}.drp__clear:hover{color:var(--text-base, #111827)}.drp__panel{position:absolute;top:calc(100% + .5rem);left:0;display:flex;gap:0;background:var(--surface-base, #ffffff);border:1px solid var(--border-base, #e5e7eb);border-radius:.75rem;box-shadow:0 8px 24px #0000001f;z-index:1000;overflow:hidden}.drp__divider{width:1px;background:var(--border-base, #e5e7eb);margin:1rem 0}.drp__calendar{padding:1rem;width:17rem}.drp__cal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:.75rem}.drp__month-title{font-size:.9375rem;font-weight:600;color:var(--text-base, #111827)}.drp__nav-btn{background:none;border:none;cursor:pointer;padding:.25rem;border-radius:.375rem;display:flex;align-items:center;color:var(--text-muted, #6b7280);transition:background .1s ease}.drp__nav-btn:hover{background:var(--surface-hover, #f3f4f6);color:var(--text-base, #111827)}.drp__weekdays{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:.25rem}.drp__weekday{text-align:center;font-size:.75rem;font-weight:600;color:var(--text-placeholder, #9ca3af);padding:.25rem 0}.drp__grid{display:grid;grid-template-columns:repeat(7,1fr);gap:.125rem}.drp__day{display:flex;align-items:center;justify-content:center;aspect-ratio:1;border:none;background:transparent;border-radius:.375rem;font-size:.8125rem;font-family:inherit;cursor:pointer;color:var(--text-base, #111827);transition:background .1s ease,color .1s ease}.drp__day:focus-visible{outline:2px solid var(--primary-300, #a5b4fc);outline-offset:1px}.drp__day:hover:not(.drp__day--disabled):not(.drp__day--in-range):not(.drp__day--start):not(.drp__day--end){background:var(--surface-hover, #f3f4f6)}.drp__day--other{color:var(--text-disabled, #d1d5db)}.drp__day--today{font-weight:700;color:var(--primary-600, #4f46e5)}.drp__day--in-range{background:var(--primary-50, #eef2ff);border-radius:0;color:var(--primary-700, #4338ca)}.drp__day--start,.drp__day--end{background:var(--primary-500, #6366f1);color:var(--text-on-color, #fff);font-weight:600;border-radius:.375rem}.drp__day--start.drp__day--in-range{border-radius:.375rem 0 0 .375rem}.drp__day--end.drp__day--in-range{border-radius:0 .375rem .375rem 0}.drp__day--disabled{opacity:.35;cursor:not-allowed}.drp__week{display:contents}.drp__hint{margin:.375rem 0 0;font-size:.8125rem;color:var(--text-muted, #6b7280)}.drp__error{margin:.375rem 0 0;font-size:.8125rem;color:var(--danger-600, #dc2626)}\n"] }]
|
|
3763
|
-
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], start: [{ type: i0.Input, args: [{ isSignal: true, alias: "start", required: false }] }, { type: i0.Output, args: ["startChange"] }], end: [{ type: i0.Input, args: [{ isSignal: true, alias: "end", required: false }] }, { type: i0.Output, args: ["endChange"] }], panelRef: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], triggerRef: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }] } });
|
|
3865
|
+
], template: "@if (label()) {\n <label class=\"drp__label\" [for]=\"id\">{{ label() }}</label>\n}\n\n<div class=\"drp\">\n <!-- Trigger -->\n <div\n #trigger\n [class]=\"triggerClasses()\"\n [id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n role=\"button\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n (click)=\"openCalendar()\"\n (keydown)=\"onTriggerKeydown($event)\"\n >\n <ngx-ds-icon [icon]=\"CalendarIcon\" [size]=\"16\" class=\"drp__icon\" />\n <span class=\"drp__text\" [class.drp__text--placeholder]=\"!triggerLabel()\">\n {{ triggerLabel() || placeholderText() + ' \u2013 ' + placeholderText() }}\n </span>\n @if ((start() || end()) && !isDisabled()) {\n <button\n type=\"button\"\n class=\"drp__clear\"\n (click)=\"clear($event)\"\n [attr.aria-label]=\"i18n.clear\"\n >\n \u00D7\n </button>\n }\n </div>\n\n <!-- Calendars panel -->\n @if (isOpen()) {\n <div\n #panel\n class=\"drp__panel\"\n role=\"dialog\"\n [attr.aria-label]=\"i18n.selectDateRange\"\n (mouseleave)=\"onLeave()\"\n >\n <!-- Left calendar -->\n <div class=\"drp__calendar\">\n <div class=\"drp__cal-header\">\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n [attr.aria-label]=\"i18n.prevMonth\"\n (click)=\"prevMonth()\"\n >\n <ngx-ds-icon [icon]=\"ChevronLeft\" [size]=\"16\" />\n </button>\n <span class=\"drp__month-title\">{{ leftTitle() }}</span>\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n style=\"visibility: hidden\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n >\n <ngx-ds-icon [icon]=\"ChevronRight\" [size]=\"16\" />\n </button>\n </div>\n <div class=\"drp__weekdays\" aria-hidden=\"true\">\n @for (d of weekdays; track d) {\n <span class=\"drp__weekday\">{{ d }}</span>\n }\n </div>\n <div class=\"drp__grid\" role=\"grid\" [attr.aria-label]=\"leftTitle()\">\n @for (week of leftWeeks(); track $index) {\n <div class=\"drp__week\" role=\"row\">\n @for (cell of week; track cell.date.getTime()) {\n <button\n type=\"button\"\n class=\"drp__day\"\n role=\"gridcell\"\n [class.drp__day--other]=\"!cell.inMonth\"\n [class.drp__day--today]=\"cell.isToday\"\n [class.drp__day--start]=\"isStart(cell.date)\"\n [class.drp__day--end]=\"isEnd(cell.date)\"\n [class.drp__day--in-range]=\"inRange(cell.date)\"\n [class.drp__day--disabled]=\"cell.isDisabled\"\n [attr.aria-disabled]=\"cell.isDisabled || null\"\n [attr.aria-label]=\"dayLabel(cell.date)\"\n [attr.aria-selected]=\"isSelected(cell.date)\"\n [attr.aria-current]=\"cell.isToday ? 'date' : null\"\n [attr.tabindex]=\"isFocusTarget(cell) ? 0 : -1\"\n (click)=\"selectDay(cell)\"\n (mouseenter)=\"onHover(cell)\"\n (keydown)=\"onDayKeydown($event, cell)\"\n >\n {{ cell.date.getDate() }}\n </button>\n }\n </div>\n }\n </div>\n </div>\n\n <div class=\"drp__divider\"></div>\n\n <!-- Right calendar -->\n <div class=\"drp__calendar\">\n <div class=\"drp__cal-header\">\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n style=\"visibility: hidden\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n >\n <ngx-ds-icon [icon]=\"ChevronLeft\" [size]=\"16\" />\n </button>\n <span class=\"drp__month-title\">{{ rightTitle() }}</span>\n <button\n type=\"button\"\n class=\"drp__nav-btn\"\n [attr.aria-label]=\"i18n.nextMonth\"\n (click)=\"nextMonth()\"\n >\n <ngx-ds-icon [icon]=\"ChevronRight\" [size]=\"16\" />\n </button>\n </div>\n <div class=\"drp__weekdays\" aria-hidden=\"true\">\n @for (d of weekdays; track d) {\n <span class=\"drp__weekday\">{{ d }}</span>\n }\n </div>\n <div class=\"drp__grid\" role=\"grid\" [attr.aria-label]=\"rightTitle()\">\n @for (week of rightWeeks(); track $index) {\n <div class=\"drp__week\" role=\"row\">\n @for (cell of week; track cell.date.getTime()) {\n <button\n type=\"button\"\n class=\"drp__day\"\n role=\"gridcell\"\n [class.drp__day--other]=\"!cell.inMonth\"\n [class.drp__day--today]=\"cell.isToday\"\n [class.drp__day--start]=\"isStart(cell.date)\"\n [class.drp__day--end]=\"isEnd(cell.date)\"\n [class.drp__day--in-range]=\"inRange(cell.date)\"\n [class.drp__day--disabled]=\"cell.isDisabled\"\n [attr.aria-disabled]=\"cell.isDisabled || null\"\n [attr.aria-label]=\"dayLabel(cell.date)\"\n [attr.aria-selected]=\"isSelected(cell.date)\"\n [attr.aria-current]=\"cell.isToday ? 'date' : null\"\n [attr.tabindex]=\"isFocusTarget(cell) ? 0 : -1\"\n (click)=\"selectDay(cell)\"\n (mouseenter)=\"onHover(cell)\"\n (keydown)=\"onDayKeydown($event, cell)\"\n >\n {{ cell.date.getDate() }}\n </button>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n</div>\n\n@if (errorText()) {\n <p [id]=\"messageId\" role=\"alert\" class=\"drp__error\">{{ errorText() }}</p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"drp__hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.drp__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-base, #111827)}.drp{position:relative;display:inline-block}.drp__trigger{display:inline-flex;align-items:center;gap:.5rem;border:1px solid var(--border-input, #d1d5db);border-radius:.5rem;background:var(--surface-base, #ffffff);cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}.drp__trigger--sm{padding:.375rem .75rem;font-size:.8125rem}.drp__trigger--md{padding:.5rem .875rem;font-size:.875rem}.drp__trigger--lg{padding:.625rem 1rem;font-size:1rem}.drp__trigger--open{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px var(--primary-100, #e0e7ff)}.drp__trigger--error{border-color:var(--danger-600, #dc2626)}.drp__trigger--disabled{background:var(--surface-subtle, #f9fafb);color:var(--text-disabled, #9ca3af);cursor:not-allowed}.drp__icon{color:var(--text-placeholder, #9ca3af);flex-shrink:0}.drp__text{flex:1;min-width:0;white-space:nowrap;color:var(--text-base, #111827)}.drp__text--placeholder{color:var(--text-placeholder, #9ca3af)}.drp__clear{background:none;border:none;padding:0;cursor:pointer;font-size:1.125rem;line-height:1;color:var(--text-placeholder, #9ca3af);display:flex;align-items:center}.drp__clear:hover{color:var(--text-base, #111827)}.drp__panel{position:absolute;top:calc(100% + .5rem);left:0;display:flex;gap:0;background:var(--surface-base, #ffffff);border:1px solid var(--border-base, #e5e7eb);border-radius:.75rem;box-shadow:0 8px 24px #0000001f;z-index:1000;overflow:hidden}.drp__divider{width:1px;background:var(--border-base, #e5e7eb);margin:1rem 0}.drp__calendar{padding:1rem;width:17rem}.drp__cal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:.75rem}.drp__month-title{font-size:.9375rem;font-weight:600;color:var(--text-base, #111827)}.drp__nav-btn{background:none;border:none;cursor:pointer;padding:.25rem;border-radius:.375rem;display:flex;align-items:center;color:var(--text-muted, #6b7280);transition:background .1s ease}.drp__nav-btn:hover{background:var(--surface-hover, #f3f4f6);color:var(--text-base, #111827)}.drp__weekdays{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:.25rem}.drp__weekday{text-align:center;font-size:.75rem;font-weight:600;color:var(--text-placeholder, #9ca3af);padding:.25rem 0}.drp__grid{display:grid;grid-template-columns:repeat(7,1fr);gap:.125rem}.drp__day{display:flex;align-items:center;justify-content:center;aspect-ratio:1;border:none;background:transparent;border-radius:.375rem;font-size:.8125rem;font-family:inherit;cursor:pointer;color:var(--text-base, #111827);transition:background .1s ease,color .1s ease}.drp__day:focus-visible{outline:2px solid var(--primary-300, #a5b4fc);outline-offset:1px}.drp__day:hover:not(.drp__day--disabled):not(.drp__day--in-range):not(.drp__day--start):not(.drp__day--end){background:var(--surface-hover, #f3f4f6)}.drp__day--other{color:var(--text-disabled, #d1d5db)}.drp__day--today{font-weight:700;color:var(--primary-600, #4f46e5)}.drp__day--in-range{background:var(--primary-50, #eef2ff);border-radius:0;color:var(--primary-700, #4338ca)}.drp__day--start,.drp__day--end{background:var(--primary-500, #6366f1);color:var(--text-on-color, #fff);font-weight:600;border-radius:.375rem}.drp__day--start.drp__day--in-range{border-radius:.375rem 0 0 .375rem}.drp__day--end.drp__day--in-range{border-radius:0 .375rem .375rem 0}.drp__day--disabled{opacity:.35;cursor:not-allowed}.drp__week{display:contents}.drp__hint{margin:.375rem 0 0;font-size:.8125rem;color:var(--text-muted, #6b7280)}.drp__error{margin:.375rem 0 0;font-size:.8125rem;color:var(--danger-600, #dc2626)}\n"] }]
|
|
3866
|
+
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], start: [{ type: i0.Input, args: [{ isSignal: true, alias: "start", required: false }] }, { type: i0.Output, args: ["startChange"] }], end: [{ type: i0.Input, args: [{ isSignal: true, alias: "end", required: false }] }, { type: i0.Output, args: ["endChange"] }], panelRef: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], triggerRef: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }] } });
|
|
3764
3867
|
|
|
3765
3868
|
function hexToHsl(hex) {
|
|
3766
3869
|
let r = 0, g = 0, b = 0;
|
|
@@ -3810,10 +3913,10 @@ function hslToHex(h, s, l) {
|
|
|
3810
3913
|
};
|
|
3811
3914
|
return `#${f(0)}${f(8)}${f(4)}`;
|
|
3812
3915
|
}
|
|
3813
|
-
let nextId$
|
|
3916
|
+
let nextId$6 = 0;
|
|
3814
3917
|
class ColorPickerComponent {
|
|
3815
3918
|
i18n = inject(NGX_DS_LABELS);
|
|
3816
|
-
id = `ngx-color-picker-${nextId$
|
|
3919
|
+
id = `ngx-color-picker-${nextId$6++}`;
|
|
3817
3920
|
value = model('#6366f1', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
3818
3921
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
3819
3922
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
@@ -3955,7 +4058,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
3955
4058
|
args: [{ selector: 'ngx-ds-avatar-group', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"avatar-group\" [style]=\"hostStyle()\">\n <ng-content />\n @if (hiddenCount() > 0) {\n <span class=\"avatar-group__count\" [class]=\"'avatar-group__count--' + size()\"\n >+{{ hiddenCount() }}</span\n >\n }\n</div>\n", styles: [":host{display:inline-flex;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.avatar-group{--ag-overlap: -.5rem;display:inline-flex;align-items:center}.avatar-group ::ng-deep ngx-ds-avatar{display:inline-flex;margin-left:var(--ag-overlap);outline:2px solid var(--surface-base, #fff);border-radius:9999px}.avatar-group ::ng-deep ngx-ds-avatar:first-child{margin-left:0}.avatar-group__count{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;margin-left:var(--ag-overlap);border-radius:9999px;outline:2px solid var(--surface-base, #fff);background:var(--surface-muted, #f3f4f6);color:var(--text-secondary, #4b5563);font-weight:600;-webkit-user-select:none;user-select:none}.avatar-group__count--xs{width:1.5rem;height:1.5rem;font-size:.625rem}.avatar-group__count--sm{width:2rem;height:2rem;font-size:.75rem}.avatar-group__count--md{width:2.5rem;height:2.5rem;font-size:.875rem}.avatar-group__count--lg{width:3rem;height:3rem;font-size:1rem}.avatar-group__count--xl{width:4rem;height:4rem;font-size:1.25rem}\n"] }]
|
|
3956
4059
|
}], ctorParameters: () => [], propDecorators: { max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], spacing: [{ type: i0.Input, args: [{ isSignal: true, alias: "spacing", required: false }] }], avatarRefs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => AvatarComponent), { ...{ read: ElementRef }, isSignal: true }] }] } });
|
|
3957
4060
|
|
|
3958
|
-
const ICON_SIZE$
|
|
4061
|
+
const ICON_SIZE$3 = { sm: 14, md: 16, lg: 18 };
|
|
3959
4062
|
class MenuComponent {
|
|
3960
4063
|
items = input.required(...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
3961
4064
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
@@ -3967,7 +4070,7 @@ class MenuComponent {
|
|
|
3967
4070
|
activeIndex = signal(0, ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
3968
4071
|
openSubmenu = signal(null, ...(ngDevMode ? [{ debugName: "openSubmenu" }] : /* istanbul ignore next */ []));
|
|
3969
4072
|
chevronRight = ChevronRight;
|
|
3970
|
-
iconSize = computed(() => ICON_SIZE$
|
|
4073
|
+
iconSize = computed(() => ICON_SIZE$3[this.size()], ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
3971
4074
|
constructor() {
|
|
3972
4075
|
afterNextRender(() => {
|
|
3973
4076
|
if (this.autofocus()) {
|
|
@@ -4061,7 +4164,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
4061
4164
|
}, template: "@for (item of items(); track item.id; let i = $index) {\n @if (item.separator) {\n <ngx-ds-divider />\n }\n <div class=\"menu__item-wrapper\">\n <button\n #itemBtn\n type=\"button\"\n role=\"menuitem\"\n class=\"menu__item\"\n [class.menu__item--danger]=\"item.danger\"\n [class.menu__item--active]=\"activeIndex() === i\"\n [disabled]=\"item.disabled\"\n [attr.aria-haspopup]=\"item.children?.length ? 'menu' : null\"\n [attr.aria-expanded]=\"item.children?.length ? openSubmenu() === item.id : null\"\n [attr.tabindex]=\"activeIndex() === i ? 0 : -1\"\n (click)=\"onItemClick(item, i)\"\n >\n @if (item.icon) {\n <ngx-ds-icon [icon]=\"item.icon\" [size]=\"iconSize()\" class=\"menu__item-icon\" />\n }\n <span class=\"menu__item-label\">{{ item.label }}</span>\n @if (item.kbd) {\n <ngx-ds-kbd size=\"sm\" class=\"menu__item-kbd\">{{ item.kbd }}</ngx-ds-kbd>\n }\n @if (item.children?.length) {\n <ngx-ds-icon [icon]=\"chevronRight\" [size]=\"14\" class=\"menu__item-chevron\" />\n }\n </button>\n\n @if (item.children?.length && openSubmenu() === item.id) {\n <div class=\"menu__submenu\">\n <ngx-ds-menu\n [items]=\"item.children!\"\n [size]=\"size()\"\n [autofocus]=\"true\"\n (itemClick)=\"onSubmenuItemClick($event)\"\n (closed)=\"onSubmenuClosed(i)\"\n />\n </div>\n }\n </div>\n}\n", styles: [":host{display:inline-flex;flex-direction:column;min-width:12rem;padding:.375rem;background:var(--surface-base, #fff);border:1px solid var(--border-base, #e5e7eb);border-radius:.5rem;box-shadow:0 4px 12px #00000014;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif);outline:none}.menu__item-wrapper{position:relative}.menu__item{display:flex;align-items:center;gap:.5rem;width:100%;border:none;background:transparent;cursor:pointer;border-radius:.375rem;padding:.5rem .625rem;font-size:.875rem;color:var(--text-base, #111827);text-align:left;white-space:nowrap;transition:background .12s ease,color .12s ease}.menu__item:hover:not(:disabled),.menu__item--active{background:var(--surface-hover, #f3f4f6)}.menu__item:focus-visible{outline:2px solid var(--primary-600, #4f46e5);outline-offset:-2px}.menu__item:disabled{opacity:.5;cursor:not-allowed}.menu__item--danger{color:var(--danger-600, #dc2626)}.menu__item--danger:hover:not(:disabled){background:#ef444414}.menu__item-icon{flex-shrink:0}.menu__item-label{flex:1;overflow:hidden;text-overflow:ellipsis}.menu__item-kbd,.menu__item-chevron{flex-shrink:0}.menu__submenu{position:absolute;top:0;left:100%;z-index:10;padding-left:.25rem}\n"] }]
|
|
4062
4165
|
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], closed: [{ type: i0.Output, args: ["closed"] }], itemBtns: [{ type: i0.ViewChildren, args: ['itemBtn', { isSignal: true }] }] } });
|
|
4063
4166
|
|
|
4064
|
-
let nextId$
|
|
4167
|
+
let nextId$5 = 0;
|
|
4065
4168
|
class FormFieldComponent {
|
|
4066
4169
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
4067
4170
|
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
@@ -4069,7 +4172,7 @@ class FormFieldComponent {
|
|
|
4069
4172
|
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
4070
4173
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
4071
4174
|
for = input(null, ...(ngDevMode ? [{ debugName: "for" }] : /* istanbul ignore next */ []));
|
|
4072
|
-
generatedId = `ngx-ff-${nextId$
|
|
4175
|
+
generatedId = `ngx-ff-${nextId$5++}`;
|
|
4073
4176
|
fieldId = computed(() => this.for() ?? this.generatedId, ...(ngDevMode ? [{ debugName: "fieldId" }] : /* istanbul ignore next */ []));
|
|
4074
4177
|
hintId = computed(() => `${this.fieldId()}-hint`, ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
4075
4178
|
errorId = computed(() => `${this.fieldId()}-error`, ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
@@ -4107,6 +4210,533 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
4107
4210
|
args: [{ selector: 'ngx-ds-form-field', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (label()) {\n <label [for]=\"fieldId()\" class=\"ngx-ff__label\">\n {{ label() }}\n @if (required()) {\n <span class=\"ngx-ff__required\" aria-hidden=\"true\">*</span>\n }\n </label>\n}\n\n<div class=\"ngx-ff__control\" [class.ngx-ff__control--disabled]=\"disabled()\">\n <ng-content />\n</div>\n\n@if (error()) {\n <p [id]=\"errorId()\" class=\"ngx-ff__message ngx-ff__message--error\" role=\"alert\">{{ error() }}</p>\n} @else if (hint()) {\n <p [id]=\"hintId()\" class=\"ngx-ff__message ngx-ff__message--hint\">{{ hint() }}</p>\n}\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-ff__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-ff__required{margin-left:.125rem;color:var(--danger-500, #ef4444)}.ngx-ff__control--disabled{opacity:.6;pointer-events:none}.ngx-ff__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-ff__message--hint{color:var(--text-muted, #6b7280)}.ngx-ff__message--error{color:var(--danger-500, #ef4444)}\n"] }]
|
|
4108
4211
|
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], for: [{ type: i0.Input, args: [{ isSignal: true, alias: "for", required: false }] }] } });
|
|
4109
4212
|
|
|
4213
|
+
const ICON_SIZE$2 = { sm: 14, md: 16, lg: 18 };
|
|
4214
|
+
const LAST_MINUTE = 23 * 60 + 59;
|
|
4215
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
4216
|
+
/** Parses `HH:mm` into minutes since midnight, or `null` when it is not a valid time. */
|
|
4217
|
+
function parseTime(value) {
|
|
4218
|
+
const match = /^(\d{1,2}):(\d{2})$/.exec(value?.trim() ?? '');
|
|
4219
|
+
if (!match)
|
|
4220
|
+
return null;
|
|
4221
|
+
const h = Number(match[1]);
|
|
4222
|
+
const m = Number(match[2]);
|
|
4223
|
+
return h > 23 || m > 59 ? null : h * 60 + m;
|
|
4224
|
+
}
|
|
4225
|
+
function formatTime(total) {
|
|
4226
|
+
return `${pad(Math.floor(total / 60))}:${pad(total % 60)}`;
|
|
4227
|
+
}
|
|
4228
|
+
let nextId$4 = 0;
|
|
4229
|
+
/**
|
|
4230
|
+
* Time field with an hour / minute (and AM/PM) panel.
|
|
4231
|
+
* The value is a 24-hour `HH:mm` string, like a native `<input type="time">`.
|
|
4232
|
+
*/
|
|
4233
|
+
class TimePickerComponent {
|
|
4234
|
+
i18n = inject(NGX_DS_LABELS);
|
|
4235
|
+
// ── Configuration ─────────────────────────────────────────
|
|
4236
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
4237
|
+
floatingLabel = input(false, ...(ngDevMode ? [{ debugName: "floatingLabel" }] : /* istanbul ignore next */ []));
|
|
4238
|
+
placeholder = input(undefined, ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
4239
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
4240
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
4241
|
+
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
4242
|
+
/** Set by Signal Forms `[formField]`. Its errors show once the field is touched. */
|
|
4243
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
4244
|
+
touched = input(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
4245
|
+
/** `'24'` shows 00–23; `'12'` shows 1–12 plus an AM/PM column. The value is always 24-hour. */
|
|
4246
|
+
hourFormat = input('24', ...(ngDevMode ? [{ debugName: "hourFormat" }] : /* istanbul ignore next */ []));
|
|
4247
|
+
/** Gap between the minutes offered in the panel. */
|
|
4248
|
+
minuteStep = input(5, ...(ngDevMode ? [{ debugName: "minuteStep" }] : /* istanbul ignore next */ []));
|
|
4249
|
+
/** Earliest selectable time, as `HH:mm`. */
|
|
4250
|
+
minTime = input(null, ...(ngDevMode ? [{ debugName: "minTime" }] : /* istanbul ignore next */ []));
|
|
4251
|
+
/** Latest selectable time, as `HH:mm`. */
|
|
4252
|
+
maxTime = input(null, ...(ngDevMode ? [{ debugName: "maxTime" }] : /* istanbul ignore next */ []));
|
|
4253
|
+
// ── Value ────────────────────────────────────────────────
|
|
4254
|
+
/** Selected time as `HH:mm` (24-hour), or `null`. */
|
|
4255
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
4256
|
+
id = `ngx-time-picker-${nextId$4++}`;
|
|
4257
|
+
messageId = `${this.id}-message`;
|
|
4258
|
+
ClockIcon = Clock;
|
|
4259
|
+
XIcon = X;
|
|
4260
|
+
// ── Internal state ────────────────────────────────────────
|
|
4261
|
+
#open = signal(false, ...(ngDevMode ? [{ debugName: "#open" }] : /* istanbul ignore next */ []));
|
|
4262
|
+
#focused = signal(false, ...(ngDevMode ? [{ debugName: "#focused" }] : /* istanbul ignore next */ []));
|
|
4263
|
+
#disabled = signal(false, ...(ngDevMode ? [{ debugName: "#disabled" }] : /* istanbul ignore next */ []));
|
|
4264
|
+
#injector = inject(Injector);
|
|
4265
|
+
isOpen = this.#open.asReadonly();
|
|
4266
|
+
isDisabled = this.#disabled.asReadonly();
|
|
4267
|
+
isFocused = this.#focused.asReadonly();
|
|
4268
|
+
#total = computed(() => parseTime(this.value()), ...(ngDevMode ? [{ debugName: "#total" }] : /* istanbul ignore next */ []));
|
|
4269
|
+
#hour = computed(() => {
|
|
4270
|
+
const t = this.#total();
|
|
4271
|
+
return t === null ? null : Math.floor(t / 60);
|
|
4272
|
+
}, ...(ngDevMode ? [{ debugName: "#hour" }] : /* istanbul ignore next */ []));
|
|
4273
|
+
#minute = computed(() => {
|
|
4274
|
+
const t = this.#total();
|
|
4275
|
+
return t === null ? null : t % 60;
|
|
4276
|
+
}, ...(ngDevMode ? [{ debugName: "#minute" }] : /* istanbul ignore next */ []));
|
|
4277
|
+
/** AM/PM shown in 12-hour mode; follows the value but can be picked before an hour. */
|
|
4278
|
+
#pm = linkedSignal(() => (this.#hour() ?? 0) >= 12, ...(ngDevMode ? [{ debugName: "#pm" }] : /* istanbul ignore next */ []));
|
|
4279
|
+
#min = computed(() => parseTime(this.minTime()) ?? 0, ...(ngDevMode ? [{ debugName: "#min" }] : /* istanbul ignore next */ []));
|
|
4280
|
+
#max = computed(() => parseTime(this.maxTime()) ?? LAST_MINUTE, ...(ngDevMode ? [{ debugName: "#max" }] : /* istanbul ignore next */ []));
|
|
4281
|
+
#minuteValues = computed(() => {
|
|
4282
|
+
const step = Math.min(Math.max(Math.floor(this.minuteStep()) || 1, 1), 60);
|
|
4283
|
+
const values = [];
|
|
4284
|
+
for (let m = 0; m < 60; m += step)
|
|
4285
|
+
values.push(m);
|
|
4286
|
+
return values;
|
|
4287
|
+
}, ...(ngDevMode ? [{ debugName: "#minuteValues" }] : /* istanbul ignore next */ []));
|
|
4288
|
+
// ── Derived ───────────────────────────────────────────────
|
|
4289
|
+
iconSize = computed(() => ICON_SIZE$2[this.size()], ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
4290
|
+
is12h = computed(() => this.hourFormat() === '12', ...(ngDevMode ? [{ debugName: "is12h" }] : /* istanbul ignore next */ []));
|
|
4291
|
+
hasError = computed(() => fieldHasError(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
4292
|
+
errorText = computed(() => fieldErrorText(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
4293
|
+
hasValue = computed(() => this.#total() !== null, ...(ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []));
|
|
4294
|
+
isFloating = computed(() => this.#focused() || this.hasValue(), ...(ngDevMode ? [{ debugName: "isFloating" }] : /* istanbul ignore next */ []));
|
|
4295
|
+
displayValue = computed(() => {
|
|
4296
|
+
const t = this.#total();
|
|
4297
|
+
if (t === null)
|
|
4298
|
+
return '';
|
|
4299
|
+
if (!this.is12h())
|
|
4300
|
+
return formatTime(t);
|
|
4301
|
+
const h = Math.floor(t / 60);
|
|
4302
|
+
return `${h % 12 || 12}:${pad(t % 60)} ${h >= 12 ? 'PM' : 'AM'}`;
|
|
4303
|
+
}, ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
|
|
4304
|
+
hourOptions = computed(() => {
|
|
4305
|
+
const selected = this.#hour();
|
|
4306
|
+
const hours = this.is12h()
|
|
4307
|
+
? [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map((h12) => ({
|
|
4308
|
+
value: (h12 % 12) + (this.#pm() ? 12 : 0),
|
|
4309
|
+
label: String(h12),
|
|
4310
|
+
}))
|
|
4311
|
+
: Array.from({ length: 24 }, (_, h) => ({ value: h, label: pad(h) }));
|
|
4312
|
+
return hours.map((o) => ({
|
|
4313
|
+
...o,
|
|
4314
|
+
disabled: !this.#hourEnabled(o.value),
|
|
4315
|
+
selected: o.value === selected,
|
|
4316
|
+
}));
|
|
4317
|
+
}, ...(ngDevMode ? [{ debugName: "hourOptions" }] : /* istanbul ignore next */ []));
|
|
4318
|
+
minuteOptions = computed(() => {
|
|
4319
|
+
const hour = this.#hour();
|
|
4320
|
+
const selected = this.#minute();
|
|
4321
|
+
return this.#minuteValues().map((m) => ({
|
|
4322
|
+
value: m,
|
|
4323
|
+
label: pad(m),
|
|
4324
|
+
disabled: hour !== null && !this.#allowed(hour * 60 + m),
|
|
4325
|
+
selected: m === selected,
|
|
4326
|
+
}));
|
|
4327
|
+
}, ...(ngDevMode ? [{ debugName: "minuteOptions" }] : /* istanbul ignore next */ []));
|
|
4328
|
+
periodOptions = computed(() => {
|
|
4329
|
+
const pm = this.#pm();
|
|
4330
|
+
const anyEnabled = (from) => Array.from({ length: 12 }, (_, i) => from + i).some((h) => this.#hourEnabled(h));
|
|
4331
|
+
return [
|
|
4332
|
+
{ value: 0, label: 'AM', disabled: !anyEnabled(0), selected: !pm },
|
|
4333
|
+
{ value: 12, label: 'PM', disabled: !anyEnabled(12), selected: pm },
|
|
4334
|
+
];
|
|
4335
|
+
}, ...(ngDevMode ? [{ debugName: "periodOptions" }] : /* istanbul ignore next */ []));
|
|
4336
|
+
fieldClasses = computed(() => {
|
|
4337
|
+
const base = 'ngx-time-picker__field';
|
|
4338
|
+
return [
|
|
4339
|
+
base,
|
|
4340
|
+
`${base}--${this.size()}`,
|
|
4341
|
+
this.isFocused() ? `${base}--focused` : '',
|
|
4342
|
+
this.hasError() ? `${base}--error` : '',
|
|
4343
|
+
this.isDisabled() ? `${base}--disabled` : '',
|
|
4344
|
+
this.floatingLabel() ? `${base}--floating` : '',
|
|
4345
|
+
]
|
|
4346
|
+
.filter(Boolean)
|
|
4347
|
+
.join(' ');
|
|
4348
|
+
}, ...(ngDevMode ? [{ debugName: "fieldClasses" }] : /* istanbul ignore next */ []));
|
|
4349
|
+
floatLabelClasses = computed(() => {
|
|
4350
|
+
const base = 'ngx-time-picker__float-label';
|
|
4351
|
+
return [
|
|
4352
|
+
base,
|
|
4353
|
+
this.isFloating() ? `${base}--active` : '',
|
|
4354
|
+
this.isFocused() ? `${base}--focused` : '',
|
|
4355
|
+
this.hasError() ? `${base}--error` : '',
|
|
4356
|
+
]
|
|
4357
|
+
.filter(Boolean)
|
|
4358
|
+
.join(' ');
|
|
4359
|
+
}, ...(ngDevMode ? [{ debugName: "floatLabelClasses" }] : /* istanbul ignore next */ []));
|
|
4360
|
+
triggerRef = viewChild('trigger', ...(ngDevMode ? [{ debugName: "triggerRef" }] : /* istanbul ignore next */ []));
|
|
4361
|
+
panelRef = viewChild('panel', ...(ngDevMode ? [{ debugName: "panelRef" }] : /* istanbul ignore next */ []));
|
|
4362
|
+
constructor() {
|
|
4363
|
+
setupEscapeClose(() => this.#closeOnEscape());
|
|
4364
|
+
setupClickOutside(() => {
|
|
4365
|
+
if (!this.#open() && !this.#focused())
|
|
4366
|
+
return;
|
|
4367
|
+
this.#open.set(false);
|
|
4368
|
+
this.#focused.set(false);
|
|
4369
|
+
this.onTouched();
|
|
4370
|
+
});
|
|
4371
|
+
}
|
|
4372
|
+
/** The option of a column that Tab lands on: the selected one, else the first enabled one. */
|
|
4373
|
+
isFocusTarget(options, option) {
|
|
4374
|
+
const target = options.find((o) => o.selected && !o.disabled) ?? options.find((o) => !o.disabled);
|
|
4375
|
+
return option === target;
|
|
4376
|
+
}
|
|
4377
|
+
// ── Interactions ──────────────────────────────────────────
|
|
4378
|
+
togglePanel() {
|
|
4379
|
+
if (this.isDisabled())
|
|
4380
|
+
return;
|
|
4381
|
+
const opening = !this.#open();
|
|
4382
|
+
this.#open.set(opening);
|
|
4383
|
+
this.#focused.set(opening);
|
|
4384
|
+
if (opening) {
|
|
4385
|
+
afterNextRender(() => {
|
|
4386
|
+
const panel = this.panelRef()?.nativeElement;
|
|
4387
|
+
if (!panel)
|
|
4388
|
+
return;
|
|
4389
|
+
// Center the selected option of each column, then focus the first column.
|
|
4390
|
+
panel.querySelectorAll('[role="listbox"]').forEach((list) => {
|
|
4391
|
+
const selected = list.querySelector('[aria-selected="true"]');
|
|
4392
|
+
if (selected) {
|
|
4393
|
+
list.scrollTop = selected.offsetTop - (list.clientHeight - selected.offsetHeight) / 2;
|
|
4394
|
+
}
|
|
4395
|
+
});
|
|
4396
|
+
panel
|
|
4397
|
+
.querySelector('[role="option"][tabindex="0"]')
|
|
4398
|
+
?.focus({ preventScroll: true });
|
|
4399
|
+
}, { injector: this.#injector });
|
|
4400
|
+
}
|
|
4401
|
+
}
|
|
4402
|
+
onTriggerKeydown(event) {
|
|
4403
|
+
// Ignore keys coming from the clear button.
|
|
4404
|
+
if (event.target !== event.currentTarget)
|
|
4405
|
+
return;
|
|
4406
|
+
if (isActivationKey(event) || (event.key === 'ArrowDown' && !this.isOpen())) {
|
|
4407
|
+
event.preventDefault();
|
|
4408
|
+
this.togglePanel();
|
|
4409
|
+
}
|
|
4410
|
+
}
|
|
4411
|
+
/** Arrow / Home / End move focus inside a column, skipping disabled options. */
|
|
4412
|
+
onOptionKeydown(event) {
|
|
4413
|
+
if (!['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key))
|
|
4414
|
+
return;
|
|
4415
|
+
event.preventDefault();
|
|
4416
|
+
const current = event.currentTarget;
|
|
4417
|
+
const list = current.closest('[role="listbox"]');
|
|
4418
|
+
if (!list)
|
|
4419
|
+
return;
|
|
4420
|
+
const options = Array.from(list.querySelectorAll('[role="option"]:not([aria-disabled="true"])'));
|
|
4421
|
+
const i = options.indexOf(current);
|
|
4422
|
+
const last = options.length - 1;
|
|
4423
|
+
const next = event.key === 'Home'
|
|
4424
|
+
? 0
|
|
4425
|
+
: event.key === 'End'
|
|
4426
|
+
? last
|
|
4427
|
+
: event.key === 'ArrowDown'
|
|
4428
|
+
? Math.min(i + 1, last)
|
|
4429
|
+
: Math.max(i - 1, 0);
|
|
4430
|
+
options[next]?.focus();
|
|
4431
|
+
}
|
|
4432
|
+
select(kind, option) {
|
|
4433
|
+
if (kind === 'hour')
|
|
4434
|
+
this.selectHour(option);
|
|
4435
|
+
else if (kind === 'minute')
|
|
4436
|
+
this.selectMinute(option);
|
|
4437
|
+
else
|
|
4438
|
+
this.selectPeriod(option);
|
|
4439
|
+
}
|
|
4440
|
+
selectHour(option) {
|
|
4441
|
+
if (option.disabled || this.isDisabled())
|
|
4442
|
+
return;
|
|
4443
|
+
const h = option.value;
|
|
4444
|
+
const current = this.#minute();
|
|
4445
|
+
const m = current !== null && this.#allowed(h * 60 + current)
|
|
4446
|
+
? current
|
|
4447
|
+
: this.#minuteValues().find((v) => this.#allowed(h * 60 + v));
|
|
4448
|
+
if (m !== undefined)
|
|
4449
|
+
this.#commit(h * 60 + m);
|
|
4450
|
+
}
|
|
4451
|
+
selectMinute(option) {
|
|
4452
|
+
if (option.disabled || this.isDisabled())
|
|
4453
|
+
return;
|
|
4454
|
+
const h = this.#hour() ??
|
|
4455
|
+
this.hourOptions().find((o) => !o.disabled && this.#allowed(o.value * 60 + option.value))
|
|
4456
|
+
?.value;
|
|
4457
|
+
if (h === undefined || !this.#allowed(h * 60 + option.value))
|
|
4458
|
+
return;
|
|
4459
|
+
this.#commit(h * 60 + option.value);
|
|
4460
|
+
this.#open.set(false);
|
|
4461
|
+
this.#focused.set(false);
|
|
4462
|
+
this.triggerRef()?.nativeElement.focus();
|
|
4463
|
+
}
|
|
4464
|
+
selectPeriod(option) {
|
|
4465
|
+
if (option.disabled || this.isDisabled())
|
|
4466
|
+
return;
|
|
4467
|
+
const pm = option.value === 12;
|
|
4468
|
+
this.#pm.set(pm);
|
|
4469
|
+
const h = this.#hour();
|
|
4470
|
+
if (h === null || h >= 12 === pm)
|
|
4471
|
+
return;
|
|
4472
|
+
const target = this.hourOptions().find((o) => o.value === (h % 12) + (pm ? 12 : 0));
|
|
4473
|
+
if (target)
|
|
4474
|
+
this.selectHour(target);
|
|
4475
|
+
}
|
|
4476
|
+
clearValue(event) {
|
|
4477
|
+
event.stopPropagation();
|
|
4478
|
+
if (this.isDisabled())
|
|
4479
|
+
return;
|
|
4480
|
+
this.value.set(null);
|
|
4481
|
+
this.onChange(null);
|
|
4482
|
+
}
|
|
4483
|
+
// ── Helpers ───────────────────────────────────────────────
|
|
4484
|
+
#allowed(total) {
|
|
4485
|
+
return total >= this.#min() && total <= this.#max();
|
|
4486
|
+
}
|
|
4487
|
+
#hourEnabled(h) {
|
|
4488
|
+
return this.#minuteValues().some((m) => this.#allowed(h * 60 + m));
|
|
4489
|
+
}
|
|
4490
|
+
#commit(total) {
|
|
4491
|
+
const v = formatTime(total);
|
|
4492
|
+
this.value.set(v);
|
|
4493
|
+
this.onChange(v);
|
|
4494
|
+
}
|
|
4495
|
+
#closeOnEscape() {
|
|
4496
|
+
if (!this.isOpen())
|
|
4497
|
+
return;
|
|
4498
|
+
this.#open.set(false);
|
|
4499
|
+
this.#focused.set(false);
|
|
4500
|
+
this.triggerRef()?.nativeElement.focus();
|
|
4501
|
+
}
|
|
4502
|
+
// ── CVA ───────────────────────────────────────────────────
|
|
4503
|
+
onChange = () => { };
|
|
4504
|
+
onTouched = () => { };
|
|
4505
|
+
writeValue(v) {
|
|
4506
|
+
this.value.set(v ?? null);
|
|
4507
|
+
}
|
|
4508
|
+
registerOnChange(fn) {
|
|
4509
|
+
this.onChange = fn;
|
|
4510
|
+
}
|
|
4511
|
+
registerOnTouched(fn) {
|
|
4512
|
+
this.onTouched = fn;
|
|
4513
|
+
}
|
|
4514
|
+
setDisabledState(disabled) {
|
|
4515
|
+
this.#disabled.set(disabled);
|
|
4516
|
+
}
|
|
4517
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TimePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4518
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: TimePickerComponent, isStandalone: true, selector: "ngx-ds-time-picker", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, floatingLabel: { classPropertyName: "floatingLabel", publicName: "floatingLabel", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, hourFormat: { classPropertyName: "hourFormat", publicName: "hourFormat", isSignal: true, isRequired: false, transformFunction: null }, minuteStep: { classPropertyName: "minuteStep", publicName: "minuteStep", isSignal: true, isRequired: false, transformFunction: null }, minTime: { classPropertyName: "minTime", publicName: "minTime", isSignal: true, isRequired: false, transformFunction: null }, maxTime: { classPropertyName: "maxTime", publicName: "maxTime", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, providers: [
|
|
4519
|
+
{
|
|
4520
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4521
|
+
useExisting: forwardRef(() => TimePickerComponent),
|
|
4522
|
+
multi: true,
|
|
4523
|
+
},
|
|
4524
|
+
], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "panelRef", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-time-picker__label\">{{ label() }}</label>\n}\n\n<!-- Field trigger -->\n<div\n #trigger\n [class]=\"fieldClasses()\"\n (click)=\"togglePanel()\"\n (keydown)=\"onTriggerKeydown($event)\"\n [attr.id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n role=\"button\"\n aria-haspopup=\"dialog\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled()\"\n>\n @if (floatingLabel() && label()) {\n <span [class]=\"floatLabelClasses()\">{{ label() }}</span>\n }\n\n <span class=\"ngx-time-picker__icon\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"ClockIcon\" [size]=\"iconSize()\" />\n </span>\n\n <span class=\"ngx-time-picker__display\">\n @if (displayValue()) {\n <span class=\"ngx-time-picker__value\">{{ displayValue() }}</span>\n } @else {\n <span class=\"ngx-time-picker__placeholder\">{{ placeholder() ?? i18n.timePlaceholder }}</span>\n }\n </span>\n\n @if (hasValue() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-time-picker__clear\"\n [attr.aria-label]=\"i18n.clearTime\"\n (click)=\"clearValue($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n</div>\n\n<!-- Panel -->\n@if (isOpen()) {\n <div #panel class=\"ngx-time-picker__panel\" role=\"dialog\" [attr.aria-label]=\"i18n.selectTime\">\n <ng-container\n *ngTemplateOutlet=\"\n column;\n context: { options: hourOptions(), label: i18n.hours, kind: 'hour' }\n \"\n />\n <ng-container\n *ngTemplateOutlet=\"\n column;\n context: { options: minuteOptions(), label: i18n.minutes, kind: 'minute' }\n \"\n />\n @if (is12h()) {\n <ng-container\n *ngTemplateOutlet=\"\n column;\n context: { options: periodOptions(), label: i18n.timePeriod, kind: 'period' }\n \"\n />\n }\n </div>\n}\n\n<ng-template #column let-options=\"options\" let-label=\"label\" let-kind=\"kind\">\n <div class=\"ngx-time-picker__column\" role=\"listbox\" [attr.aria-label]=\"label\">\n @for (option of options; track option.value) {\n <button\n type=\"button\"\n role=\"option\"\n class=\"ngx-time-picker__option\"\n [class.ngx-time-picker__option--selected]=\"option.selected\"\n [class.ngx-time-picker__option--disabled]=\"option.disabled\"\n [attr.aria-selected]=\"option.selected\"\n [attr.aria-disabled]=\"option.disabled || null\"\n [attr.tabindex]=\"isFocusTarget(options, option) ? 0 : -1\"\n (click)=\"select(kind, option); $event.stopPropagation()\"\n (keydown)=\"onOptionKeydown($event)\"\n >\n {{ option.label }}\n </button>\n }\n </div>\n</ng-template>\n\n<!-- Error / Hint -->\n@if (errorText()) {\n <p [id]=\"messageId\" class=\"ngx-time-picker__message ngx-time-picker__message--error\" role=\"alert\">\n {{ errorText() }}\n </p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-time-picker__message ngx-time-picker__message--hint\">\n {{ hint() }}\n </p>\n}\n", styles: [":host{display:block;position:relative;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-time-picker__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-time-picker__field{position:relative;display:flex;align-items:center;gap:.5rem;width:100%;min-height:2.375rem;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color .15s ease,box-shadow .15s ease}.ngx-time-picker__field:focus-visible{outline:none;border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-time-picker__field--focused{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-time-picker__field--error{border-color:var(--danger-500, #ef4444)}.ngx-time-picker__field--error.ngx-time-picker__field--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-time-picker__field--disabled{background:var(--surface-subtle, #f9fafb);color:var(--text-placeholder, #9ca3af);cursor:not-allowed}.ngx-time-picker__field--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-time-picker__field--md{padding:.5rem .75rem;font-size:.875rem}.ngx-time-picker__field--lg{padding:.625rem 1rem;font-size:1rem}.ngx-time-picker__float-label{position:absolute;left:2.25rem;top:50%;transform:translateY(-50%);padding:0;font-size:inherit;line-height:1;white-space:nowrap;color:var(--text-placeholder, #9ca3af);background:transparent;pointer-events:none;transition:top .15s ease,font-size .15s ease,color .15s ease,padding .15s ease}.ngx-time-picker__float-label--active{top:0;padding:0 .25rem;font-size:.7rem;color:var(--primary-500, #6366f1);background:var(--surface-base, #fff)}.ngx-time-picker__float-label--focused:not(.ngx-time-picker__float-label--error){color:var(--primary-500, #6366f1)}.ngx-time-picker__float-label--error{color:var(--danger-500, #ef4444)}.ngx-time-picker__icon{display:inline-flex;flex-shrink:0;align-items:center;color:var(--text-placeholder, #9ca3af)}.ngx-time-picker__display{flex:1;min-width:0}.ngx-time-picker__value{display:block;color:var(--text-base, #111827);font-variant-numeric:tabular-nums}.ngx-time-picker__placeholder{display:block;color:var(--text-placeholder, #9ca3af)}.ngx-time-picker__clear{display:inline-flex;flex-shrink:0;align-items:center;padding:0;color:var(--text-placeholder, #9ca3af);background:transparent;border:none;cursor:pointer;transition:color .15s ease}.ngx-time-picker__clear:hover{color:var(--text-muted, #6b7280)}.ngx-time-picker__panel{position:absolute;top:calc(100% + .25rem);left:0;z-index:100;display:flex;padding:.375rem;gap:.25rem;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.5rem;box-shadow:0 8px 24px #0000001f}.ngx-time-picker__column{position:relative;display:flex;flex-direction:column;gap:2px;width:3.25rem;max-height:13.5rem;overflow-y:auto;scrollbar-width:none}.ngx-time-picker__column::-webkit-scrollbar{display:none}.ngx-time-picker__column+.ngx-time-picker__column{padding-left:.25rem;border-left:1px solid var(--border-subtle, #f3f4f6)}.ngx-time-picker__option{flex-shrink:0;height:2rem;padding:0;font-family:inherit;font-size:.8125rem;font-variant-numeric:tabular-nums;color:var(--text-secondary, #374151);background:transparent;border:none;border-radius:.375rem;cursor:pointer;transition:background .1s ease,color .1s ease}.ngx-time-picker__option:focus-visible{outline:2px solid var(--primary-300, #a5b4fc);outline-offset:-2px}.ngx-time-picker__option:hover:not(.ngx-time-picker__option--disabled):not(.ngx-time-picker__option--selected){color:var(--text-base, #111827);background:var(--surface-muted, #f3f4f6)}.ngx-time-picker__option--selected{font-weight:600;color:var(--text-on-color, #fff);background:var(--primary-500, #6366f1)}.ngx-time-picker__option--selected:hover{background:var(--primary-600, #4f46e5)}.ngx-time-picker__option--disabled{color:var(--text-disabled, #d1d5db);cursor:not-allowed}.ngx-time-picker__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-time-picker__message--hint{color:var(--text-muted, #6b7280)}.ngx-time-picker__message--error{color:var(--danger-500, #ef4444)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4525
|
+
}
|
|
4526
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TimePickerComponent, decorators: [{
|
|
4527
|
+
type: Component,
|
|
4528
|
+
args: [{ selector: 'ngx-ds-time-picker', standalone: true, imports: [IconComponent, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
4529
|
+
{
|
|
4530
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4531
|
+
useExisting: forwardRef(() => TimePickerComponent),
|
|
4532
|
+
multi: true,
|
|
4533
|
+
},
|
|
4534
|
+
], template: "<!-- Static label -->\n@if (!floatingLabel() && label()) {\n <label [for]=\"id\" class=\"ngx-time-picker__label\">{{ label() }}</label>\n}\n\n<!-- Field trigger -->\n<div\n #trigger\n [class]=\"fieldClasses()\"\n (click)=\"togglePanel()\"\n (keydown)=\"onTriggerKeydown($event)\"\n [attr.id]=\"id\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n role=\"button\"\n aria-haspopup=\"dialog\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-disabled]=\"isDisabled()\"\n>\n @if (floatingLabel() && label()) {\n <span [class]=\"floatLabelClasses()\">{{ label() }}</span>\n }\n\n <span class=\"ngx-time-picker__icon\" aria-hidden=\"true\">\n <ngx-ds-icon [icon]=\"ClockIcon\" [size]=\"iconSize()\" />\n </span>\n\n <span class=\"ngx-time-picker__display\">\n @if (displayValue()) {\n <span class=\"ngx-time-picker__value\">{{ displayValue() }}</span>\n } @else {\n <span class=\"ngx-time-picker__placeholder\">{{ placeholder() ?? i18n.timePlaceholder }}</span>\n }\n </span>\n\n @if (hasValue() && !isDisabled()) {\n <button\n type=\"button\"\n class=\"ngx-time-picker__clear\"\n [attr.aria-label]=\"i18n.clearTime\"\n (click)=\"clearValue($event)\"\n >\n <ngx-ds-icon [icon]=\"XIcon\" [size]=\"iconSize()\" />\n </button>\n }\n</div>\n\n<!-- Panel -->\n@if (isOpen()) {\n <div #panel class=\"ngx-time-picker__panel\" role=\"dialog\" [attr.aria-label]=\"i18n.selectTime\">\n <ng-container\n *ngTemplateOutlet=\"\n column;\n context: { options: hourOptions(), label: i18n.hours, kind: 'hour' }\n \"\n />\n <ng-container\n *ngTemplateOutlet=\"\n column;\n context: { options: minuteOptions(), label: i18n.minutes, kind: 'minute' }\n \"\n />\n @if (is12h()) {\n <ng-container\n *ngTemplateOutlet=\"\n column;\n context: { options: periodOptions(), label: i18n.timePeriod, kind: 'period' }\n \"\n />\n }\n </div>\n}\n\n<ng-template #column let-options=\"options\" let-label=\"label\" let-kind=\"kind\">\n <div class=\"ngx-time-picker__column\" role=\"listbox\" [attr.aria-label]=\"label\">\n @for (option of options; track option.value) {\n <button\n type=\"button\"\n role=\"option\"\n class=\"ngx-time-picker__option\"\n [class.ngx-time-picker__option--selected]=\"option.selected\"\n [class.ngx-time-picker__option--disabled]=\"option.disabled\"\n [attr.aria-selected]=\"option.selected\"\n [attr.aria-disabled]=\"option.disabled || null\"\n [attr.tabindex]=\"isFocusTarget(options, option) ? 0 : -1\"\n (click)=\"select(kind, option); $event.stopPropagation()\"\n (keydown)=\"onOptionKeydown($event)\"\n >\n {{ option.label }}\n </button>\n }\n </div>\n</ng-template>\n\n<!-- Error / Hint -->\n@if (errorText()) {\n <p [id]=\"messageId\" class=\"ngx-time-picker__message ngx-time-picker__message--error\" role=\"alert\">\n {{ errorText() }}\n </p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-time-picker__message ngx-time-picker__message--hint\">\n {{ hint() }}\n </p>\n}\n", styles: [":host{display:block;position:relative;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-time-picker__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-time-picker__field{position:relative;display:flex;align-items:center;gap:.5rem;width:100%;min-height:2.375rem;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color .15s ease,box-shadow .15s ease}.ngx-time-picker__field:focus-visible{outline:none;border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-time-picker__field--focused{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-time-picker__field--error{border-color:var(--danger-500, #ef4444)}.ngx-time-picker__field--error.ngx-time-picker__field--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-time-picker__field--disabled{background:var(--surface-subtle, #f9fafb);color:var(--text-placeholder, #9ca3af);cursor:not-allowed}.ngx-time-picker__field--sm{padding:.375rem .625rem;font-size:.8125rem}.ngx-time-picker__field--md{padding:.5rem .75rem;font-size:.875rem}.ngx-time-picker__field--lg{padding:.625rem 1rem;font-size:1rem}.ngx-time-picker__float-label{position:absolute;left:2.25rem;top:50%;transform:translateY(-50%);padding:0;font-size:inherit;line-height:1;white-space:nowrap;color:var(--text-placeholder, #9ca3af);background:transparent;pointer-events:none;transition:top .15s ease,font-size .15s ease,color .15s ease,padding .15s ease}.ngx-time-picker__float-label--active{top:0;padding:0 .25rem;font-size:.7rem;color:var(--primary-500, #6366f1);background:var(--surface-base, #fff)}.ngx-time-picker__float-label--focused:not(.ngx-time-picker__float-label--error){color:var(--primary-500, #6366f1)}.ngx-time-picker__float-label--error{color:var(--danger-500, #ef4444)}.ngx-time-picker__icon{display:inline-flex;flex-shrink:0;align-items:center;color:var(--text-placeholder, #9ca3af)}.ngx-time-picker__display{flex:1;min-width:0}.ngx-time-picker__value{display:block;color:var(--text-base, #111827);font-variant-numeric:tabular-nums}.ngx-time-picker__placeholder{display:block;color:var(--text-placeholder, #9ca3af)}.ngx-time-picker__clear{display:inline-flex;flex-shrink:0;align-items:center;padding:0;color:var(--text-placeholder, #9ca3af);background:transparent;border:none;cursor:pointer;transition:color .15s ease}.ngx-time-picker__clear:hover{color:var(--text-muted, #6b7280)}.ngx-time-picker__panel{position:absolute;top:calc(100% + .25rem);left:0;z-index:100;display:flex;padding:.375rem;gap:.25rem;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.5rem;box-shadow:0 8px 24px #0000001f}.ngx-time-picker__column{position:relative;display:flex;flex-direction:column;gap:2px;width:3.25rem;max-height:13.5rem;overflow-y:auto;scrollbar-width:none}.ngx-time-picker__column::-webkit-scrollbar{display:none}.ngx-time-picker__column+.ngx-time-picker__column{padding-left:.25rem;border-left:1px solid var(--border-subtle, #f3f4f6)}.ngx-time-picker__option{flex-shrink:0;height:2rem;padding:0;font-family:inherit;font-size:.8125rem;font-variant-numeric:tabular-nums;color:var(--text-secondary, #374151);background:transparent;border:none;border-radius:.375rem;cursor:pointer;transition:background .1s ease,color .1s ease}.ngx-time-picker__option:focus-visible{outline:2px solid var(--primary-300, #a5b4fc);outline-offset:-2px}.ngx-time-picker__option:hover:not(.ngx-time-picker__option--disabled):not(.ngx-time-picker__option--selected){color:var(--text-base, #111827);background:var(--surface-muted, #f3f4f6)}.ngx-time-picker__option--selected{font-weight:600;color:var(--text-on-color, #fff);background:var(--primary-500, #6366f1)}.ngx-time-picker__option--selected:hover{background:var(--primary-600, #4f46e5)}.ngx-time-picker__option--disabled{color:var(--text-disabled, #d1d5db);cursor:not-allowed}.ngx-time-picker__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-time-picker__message--hint{color:var(--text-muted, #6b7280)}.ngx-time-picker__message--error{color:var(--danger-500, #ef4444)}\n"] }]
|
|
4535
|
+
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], floatingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "floatingLabel", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], hourFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "hourFormat", required: false }] }], minuteStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "minuteStep", required: false }] }], minTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "minTime", required: false }] }], maxTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxTime", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], triggerRef: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], panelRef: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }] } });
|
|
4536
|
+
|
|
4537
|
+
let nextId$3 = 0;
|
|
4538
|
+
function escapeRegExp(text) {
|
|
4539
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
4540
|
+
}
|
|
4541
|
+
class TagInputComponent {
|
|
4542
|
+
// ── Configuration ────────────────────────────────────────────
|
|
4543
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
4544
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
4545
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
4546
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
4547
|
+
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
4548
|
+
/** Set by Signal Forms `[formField]`. Its errors show once the field is touched. */
|
|
4549
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
4550
|
+
touched = input(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
4551
|
+
/**
|
|
4552
|
+
* Keys that turn the typed text into a tag. `Enter` is a key name; any other
|
|
4553
|
+
* entry is a character, which also splits pasted text.
|
|
4554
|
+
*/
|
|
4555
|
+
separators = input(['Enter', ','], ...(ngDevMode ? [{ debugName: "separators" }] : /* istanbul ignore next */ []));
|
|
4556
|
+
/** Maximum number of tags. `null` means no limit. */
|
|
4557
|
+
maxTags = input(null, ...(ngDevMode ? [{ debugName: "maxTags" }] : /* istanbul ignore next */ []));
|
|
4558
|
+
allowDuplicates = input(false, ...(ngDevMode ? [{ debugName: "allowDuplicates" }] : /* istanbul ignore next */ []));
|
|
4559
|
+
/** Adds the pending text as a tag when the field loses focus. */
|
|
4560
|
+
addOnBlur = input(true, ...(ngDevMode ? [{ debugName: "addOnBlur" }] : /* istanbul ignore next */ []));
|
|
4561
|
+
// ── Value — two-way bindable ─────────────────────────────────
|
|
4562
|
+
value = model([], ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
4563
|
+
added = output();
|
|
4564
|
+
removed = output();
|
|
4565
|
+
id = `ngx-tag-input-${nextId$3++}`;
|
|
4566
|
+
messageId = `${this.id}-message`;
|
|
4567
|
+
native = viewChild.required('native');
|
|
4568
|
+
// ── Internal state ───────────────────────────────────────────
|
|
4569
|
+
#disabled = signal(false, ...(ngDevMode ? [{ debugName: "#disabled" }] : /* istanbul ignore next */ []));
|
|
4570
|
+
#focused = signal(false, ...(ngDevMode ? [{ debugName: "#focused" }] : /* istanbul ignore next */ []));
|
|
4571
|
+
text = signal('', ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
4572
|
+
isDisabled = this.#disabled.asReadonly();
|
|
4573
|
+
isFocused = this.#focused.asReadonly();
|
|
4574
|
+
// ── Derived ──────────────────────────────────────────────────
|
|
4575
|
+
isFull = computed(() => {
|
|
4576
|
+
const max = this.maxTags();
|
|
4577
|
+
return max !== null && this.value().length >= max;
|
|
4578
|
+
}, ...(ngDevMode ? [{ debugName: "isFull" }] : /* istanbul ignore next */ []));
|
|
4579
|
+
hasError = computed(() => fieldHasError(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
4580
|
+
errorText = computed(() => fieldErrorText(this.errorMessage(), this.errors(), this.touched()), ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
4581
|
+
/** The placeholder only shows while there are no tags. */
|
|
4582
|
+
effectivePlaceholder = computed(() => (this.value().length ? '' : this.placeholder()), ...(ngDevMode ? [{ debugName: "effectivePlaceholder" }] : /* istanbul ignore next */ []));
|
|
4583
|
+
fieldClasses = computed(() => {
|
|
4584
|
+
const base = 'ngx-tag-input__field';
|
|
4585
|
+
return [
|
|
4586
|
+
base,
|
|
4587
|
+
`${base}--${this.size()}`,
|
|
4588
|
+
this.isFocused() ? `${base}--focused` : '',
|
|
4589
|
+
this.hasError() ? `${base}--error` : '',
|
|
4590
|
+
this.isDisabled() ? `${base}--disabled` : '',
|
|
4591
|
+
]
|
|
4592
|
+
.filter(Boolean)
|
|
4593
|
+
.join(' ');
|
|
4594
|
+
}, ...(ngDevMode ? [{ debugName: "fieldClasses" }] : /* istanbul ignore next */ []));
|
|
4595
|
+
#charSeparators = computed(() => this.separators().filter((s) => s.length === 1), ...(ngDevMode ? [{ debugName: "#charSeparators" }] : /* istanbul ignore next */ []));
|
|
4596
|
+
// ── CVA ──────────────────────────────────────────────────────
|
|
4597
|
+
onChange = () => { };
|
|
4598
|
+
onTouched = () => { };
|
|
4599
|
+
writeValue(value) {
|
|
4600
|
+
this.value.set(Array.isArray(value) ? [...value] : []);
|
|
4601
|
+
}
|
|
4602
|
+
registerOnChange(fn) {
|
|
4603
|
+
this.onChange = fn;
|
|
4604
|
+
}
|
|
4605
|
+
registerOnTouched(fn) {
|
|
4606
|
+
this.onTouched = fn;
|
|
4607
|
+
}
|
|
4608
|
+
setDisabledState(disabled) {
|
|
4609
|
+
this.#disabled.set(disabled);
|
|
4610
|
+
}
|
|
4611
|
+
// ── Actions ──────────────────────────────────────────────────
|
|
4612
|
+
/** Adds the given labels, skipping blanks, duplicates and anything past `maxTags`. */
|
|
4613
|
+
addTags(labels) {
|
|
4614
|
+
const next = [...this.value()];
|
|
4615
|
+
const max = this.maxTags();
|
|
4616
|
+
const accepted = [];
|
|
4617
|
+
for (const raw of labels) {
|
|
4618
|
+
const tag = raw.trim();
|
|
4619
|
+
if (!tag)
|
|
4620
|
+
continue;
|
|
4621
|
+
if (max !== null && next.length >= max)
|
|
4622
|
+
break;
|
|
4623
|
+
if (!this.allowDuplicates() && next.some((t) => t.toLowerCase() === tag.toLowerCase())) {
|
|
4624
|
+
continue;
|
|
4625
|
+
}
|
|
4626
|
+
next.push(tag);
|
|
4627
|
+
accepted.push(tag);
|
|
4628
|
+
}
|
|
4629
|
+
if (!accepted.length)
|
|
4630
|
+
return;
|
|
4631
|
+
this.#commit(next);
|
|
4632
|
+
accepted.forEach((tag) => this.added.emit(tag));
|
|
4633
|
+
}
|
|
4634
|
+
remove(index) {
|
|
4635
|
+
if (this.isDisabled())
|
|
4636
|
+
return;
|
|
4637
|
+
const tag = this.value()[index];
|
|
4638
|
+
if (tag === undefined)
|
|
4639
|
+
return;
|
|
4640
|
+
this.#commit(this.value().filter((_, i) => i !== index));
|
|
4641
|
+
this.removed.emit(tag);
|
|
4642
|
+
}
|
|
4643
|
+
focusInput() {
|
|
4644
|
+
if (!this.isDisabled())
|
|
4645
|
+
this.native().nativeElement.focus();
|
|
4646
|
+
}
|
|
4647
|
+
// ── Event handlers ───────────────────────────────────────────
|
|
4648
|
+
onInput(event) {
|
|
4649
|
+
const raw = event.target.value;
|
|
4650
|
+
const chars = this.#charSeparators();
|
|
4651
|
+
// A separator can arrive without a keydown (mobile keyboards, autocomplete).
|
|
4652
|
+
if (chars.some((c) => raw.includes(c))) {
|
|
4653
|
+
const parts = this.#split(raw);
|
|
4654
|
+
const rest = parts.pop() ?? '';
|
|
4655
|
+
this.addTags(parts);
|
|
4656
|
+
this.#setText(rest);
|
|
4657
|
+
}
|
|
4658
|
+
else {
|
|
4659
|
+
this.text.set(raw);
|
|
4660
|
+
}
|
|
4661
|
+
}
|
|
4662
|
+
onKeydown(event) {
|
|
4663
|
+
if (event.isComposing)
|
|
4664
|
+
return;
|
|
4665
|
+
if (this.separators().includes(event.key)) {
|
|
4666
|
+
if (event.key === 'Enter' && !this.text().trim())
|
|
4667
|
+
return;
|
|
4668
|
+
event.preventDefault();
|
|
4669
|
+
this.#addPending();
|
|
4670
|
+
return;
|
|
4671
|
+
}
|
|
4672
|
+
if (event.key === 'Backspace' && this.text() === '' && this.value().length) {
|
|
4673
|
+
event.preventDefault();
|
|
4674
|
+
this.remove(this.value().length - 1);
|
|
4675
|
+
}
|
|
4676
|
+
}
|
|
4677
|
+
onPaste(event) {
|
|
4678
|
+
const pasted = event.clipboardData?.getData('text') ?? '';
|
|
4679
|
+
const parts = this.#split(pasted);
|
|
4680
|
+
if (parts.length < 2)
|
|
4681
|
+
return;
|
|
4682
|
+
event.preventDefault();
|
|
4683
|
+
const input = event.target;
|
|
4684
|
+
const before = input.value.slice(0, input.selectionStart ?? input.value.length);
|
|
4685
|
+
const after = input.value.slice(input.selectionEnd ?? input.value.length);
|
|
4686
|
+
parts[0] = before + parts[0];
|
|
4687
|
+
const rest = parts.pop() + after;
|
|
4688
|
+
this.addTags(parts);
|
|
4689
|
+
this.#setText(rest);
|
|
4690
|
+
}
|
|
4691
|
+
onFocus() {
|
|
4692
|
+
this.#focused.set(true);
|
|
4693
|
+
}
|
|
4694
|
+
onBlur() {
|
|
4695
|
+
this.#focused.set(false);
|
|
4696
|
+
if (this.addOnBlur())
|
|
4697
|
+
this.#addPending();
|
|
4698
|
+
this.onTouched();
|
|
4699
|
+
}
|
|
4700
|
+
// ── Helpers ──────────────────────────────────────────────────
|
|
4701
|
+
#addPending() {
|
|
4702
|
+
if (!this.text().trim())
|
|
4703
|
+
return;
|
|
4704
|
+
if (!this.isFull())
|
|
4705
|
+
this.addTags([this.text()]);
|
|
4706
|
+
this.#setText('');
|
|
4707
|
+
}
|
|
4708
|
+
#split(text) {
|
|
4709
|
+
const chars = [...this.#charSeparators(), '\n'];
|
|
4710
|
+
return text.split(new RegExp(`[${chars.map(escapeRegExp).join('')}]`));
|
|
4711
|
+
}
|
|
4712
|
+
#setText(text) {
|
|
4713
|
+
this.text.set(text);
|
|
4714
|
+
this.native().nativeElement.value = text;
|
|
4715
|
+
}
|
|
4716
|
+
#commit(next) {
|
|
4717
|
+
this.value.set(next);
|
|
4718
|
+
this.onChange(next);
|
|
4719
|
+
}
|
|
4720
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TagInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4721
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: TagInputComponent, isStandalone: true, selector: "ngx-ds-tag-input", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, separators: { classPropertyName: "separators", publicName: "separators", isSignal: true, isRequired: false, transformFunction: null }, maxTags: { classPropertyName: "maxTags", publicName: "maxTags", isSignal: true, isRequired: false, transformFunction: null }, allowDuplicates: { classPropertyName: "allowDuplicates", publicName: "allowDuplicates", isSignal: true, isRequired: false, transformFunction: null }, addOnBlur: { classPropertyName: "addOnBlur", publicName: "addOnBlur", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", added: "added", removed: "removed" }, providers: [
|
|
4722
|
+
{
|
|
4723
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4724
|
+
useExisting: forwardRef(() => TagInputComponent),
|
|
4725
|
+
multi: true,
|
|
4726
|
+
},
|
|
4727
|
+
], viewQueries: [{ propertyName: "native", first: true, predicate: ["native"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (label()) {\n <label class=\"ngx-tag-input__label\" [for]=\"id\">{{ label() }}</label>\n}\n\n<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n<div [class]=\"fieldClasses()\" (click)=\"focusInput()\">\n @if (value().length) {\n <ul class=\"ngx-tag-input__tags\" [attr.aria-label]=\"label() || null\">\n @for (tag of value(); track $index; let i = $index) {\n <li class=\"ngx-tag-input__tag\">\n <ngx-ds-tag\n [label]=\"tag\"\n size=\"sm\"\n color=\"primary\"\n [dismissible]=\"!isDisabled()\"\n (dismissed)=\"remove(i)\"\n />\n </li>\n }\n </ul>\n }\n\n <input\n #native\n class=\"ngx-tag-input__native\"\n type=\"text\"\n autocomplete=\"off\"\n [id]=\"id\"\n [value]=\"text()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"isFull()\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (paste)=\"onPaste($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n</div>\n\n@if (errorText()) {\n <p [id]=\"messageId\" class=\"ngx-tag-input__message ngx-tag-input__message--error\" role=\"alert\">\n {{ errorText() }}\n </p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-tag-input__message ngx-tag-input__message--hint\">\n {{ hint() }}\n </p>\n}\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-tag-input__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-tag-input__field{display:flex;flex-wrap:wrap;align-items:center;gap:.375rem;width:100%;min-height:2.375rem;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;cursor:text;transition:border-color .15s ease,box-shadow .15s ease}.ngx-tag-input__field--focused{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-tag-input__field--error{border-color:var(--danger-500, #ef4444)}.ngx-tag-input__field--error.ngx-tag-input__field--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-tag-input__field--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed}.ngx-tag-input__field--sm{padding:.25rem .5rem;font-size:.8125rem}.ngx-tag-input__field--md{padding:.3125rem .625rem;font-size:.875rem}.ngx-tag-input__field--lg{padding:.4375rem .875rem;font-size:1rem}.ngx-tag-input__tags{display:contents;margin:0;padding:0;list-style:none}.ngx-tag-input__tag{display:inline-flex}.ngx-tag-input__native{flex:1 1 6rem;min-width:6rem;padding:.125rem 0;font:inherit;color:var(--text-base, #111827);background:transparent;border:none;outline:none}.ngx-tag-input__native::placeholder{color:var(--text-placeholder, #9ca3af)}.ngx-tag-input__native:disabled{color:var(--text-placeholder, #9ca3af);cursor:not-allowed}.ngx-tag-input__native:read-only{caret-color:transparent}.ngx-tag-input__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-tag-input__message--hint{color:var(--text-muted, #6b7280)}.ngx-tag-input__message--error{color:var(--danger-500, #ef4444)}\n"], dependencies: [{ kind: "component", type: TagComponent, selector: "ngx-ds-tag", inputs: ["label", "size", "color", "variant", "iconLeft", "iconRight", "rounded", "dismissible"], outputs: ["dismissed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4728
|
+
}
|
|
4729
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: TagInputComponent, decorators: [{
|
|
4730
|
+
type: Component,
|
|
4731
|
+
args: [{ selector: 'ngx-ds-tag-input', standalone: true, imports: [TagComponent], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
4732
|
+
{
|
|
4733
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4734
|
+
useExisting: forwardRef(() => TagInputComponent),
|
|
4735
|
+
multi: true,
|
|
4736
|
+
},
|
|
4737
|
+
], template: "@if (label()) {\n <label class=\"ngx-tag-input__label\" [for]=\"id\">{{ label() }}</label>\n}\n\n<!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n<div [class]=\"fieldClasses()\" (click)=\"focusInput()\">\n @if (value().length) {\n <ul class=\"ngx-tag-input__tags\" [attr.aria-label]=\"label() || null\">\n @for (tag of value(); track $index; let i = $index) {\n <li class=\"ngx-tag-input__tag\">\n <ngx-ds-tag\n [label]=\"tag\"\n size=\"sm\"\n color=\"primary\"\n [dismissible]=\"!isDisabled()\"\n (dismissed)=\"remove(i)\"\n />\n </li>\n }\n </ul>\n }\n\n <input\n #native\n class=\"ngx-tag-input__native\"\n type=\"text\"\n autocomplete=\"off\"\n [id]=\"id\"\n [value]=\"text()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"isFull()\"\n [attr.aria-invalid]=\"hasError() || null\"\n [attr.aria-describedby]=\"errorText() || hint() ? messageId : null\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (paste)=\"onPaste($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n />\n</div>\n\n@if (errorText()) {\n <p [id]=\"messageId\" class=\"ngx-tag-input__message ngx-tag-input__message--error\" role=\"alert\">\n {{ errorText() }}\n </p>\n} @else if (hint()) {\n <p [id]=\"messageId\" class=\"ngx-tag-input__message ngx-tag-input__message--hint\">\n {{ hint() }}\n </p>\n}\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.ngx-tag-input__label{display:block;margin-bottom:.375rem;font-size:.875rem;font-weight:500;color:var(--text-secondary, #374151)}.ngx-tag-input__field{display:flex;flex-wrap:wrap;align-items:center;gap:.375rem;width:100%;min-height:2.375rem;background:var(--surface-base, #fff);border:1.5px solid var(--border-input, #d1d5db);border-radius:.375rem;cursor:text;transition:border-color .15s ease,box-shadow .15s ease}.ngx-tag-input__field--focused{border-color:var(--primary-500, #6366f1);box-shadow:0 0 0 3px #3b82f61f}.ngx-tag-input__field--error{border-color:var(--danger-500, #ef4444)}.ngx-tag-input__field--error.ngx-tag-input__field--focused{box-shadow:0 0 0 3px #ef44441f}.ngx-tag-input__field--disabled{background:var(--surface-subtle, #f9fafb);cursor:not-allowed}.ngx-tag-input__field--sm{padding:.25rem .5rem;font-size:.8125rem}.ngx-tag-input__field--md{padding:.3125rem .625rem;font-size:.875rem}.ngx-tag-input__field--lg{padding:.4375rem .875rem;font-size:1rem}.ngx-tag-input__tags{display:contents;margin:0;padding:0;list-style:none}.ngx-tag-input__tag{display:inline-flex}.ngx-tag-input__native{flex:1 1 6rem;min-width:6rem;padding:.125rem 0;font:inherit;color:var(--text-base, #111827);background:transparent;border:none;outline:none}.ngx-tag-input__native::placeholder{color:var(--text-placeholder, #9ca3af)}.ngx-tag-input__native:disabled{color:var(--text-placeholder, #9ca3af);cursor:not-allowed}.ngx-tag-input__native:read-only{caret-color:transparent}.ngx-tag-input__message{margin-top:.375rem;font-size:.75rem;line-height:1.4}.ngx-tag-input__message--hint{color:var(--text-muted, #6b7280)}.ngx-tag-input__message--error{color:var(--danger-500, #ef4444)}\n"] }]
|
|
4738
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }], separators: [{ type: i0.Input, args: [{ isSignal: true, alias: "separators", required: false }] }], maxTags: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxTags", required: false }] }], allowDuplicates: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowDuplicates", required: false }] }], addOnBlur: [{ type: i0.Input, args: [{ isSignal: true, alias: "addOnBlur", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], added: [{ type: i0.Output, args: ["added"] }], removed: [{ type: i0.Output, args: ["removed"] }], native: [{ type: i0.ViewChild, args: ['native', { isSignal: true }] }] } });
|
|
4739
|
+
|
|
4110
4740
|
class PaginationComponent {
|
|
4111
4741
|
i18n = inject(NGX_DS_LABELS);
|
|
4112
4742
|
totalPages = input.required(...(ngDevMode ? [{ debugName: "totalPages" }] : /* istanbul ignore next */ []));
|
|
@@ -4739,7 +5369,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
4739
5369
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], lazy: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazy", required: false }] }], contentTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TabContentDirective), { isSignal: true }] }] } });
|
|
4740
5370
|
|
|
4741
5371
|
const ICON_SIZE$1 = { sm: 14, md: 16, lg: 18 };
|
|
4742
|
-
let nextId$
|
|
5372
|
+
let nextId$2 = 0;
|
|
4743
5373
|
class TabsComponent {
|
|
4744
5374
|
tabButtons = viewChildren('tabBtn', ...(ngDevMode ? [{ debugName: "tabButtons" }] : /* istanbul ignore next */ []));
|
|
4745
5375
|
tabs = contentChildren(TabComponent, ...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
|
|
@@ -4747,7 +5377,7 @@ class TabsComponent {
|
|
|
4747
5377
|
variant = input('line', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
4748
5378
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
4749
5379
|
fullWidth = input(false, ...(ngDevMode ? [{ debugName: "fullWidth" }] : /* istanbul ignore next */ []));
|
|
4750
|
-
id = `ngx-tabs-${nextId$
|
|
5380
|
+
id = `ngx-tabs-${nextId$2++}`;
|
|
4751
5381
|
tabId(index) {
|
|
4752
5382
|
return `${this.id}-tab-${index}`;
|
|
4753
5383
|
}
|
|
@@ -5270,7 +5900,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
5270
5900
|
args: [{ selector: 'ngx-ds-calendar', standalone: true, imports: [IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"calendar\" [class.calendar--disabled]=\"disabled()\">\n <!-- Header -->\n <div class=\"calendar__header\">\n <button\n type=\"button\"\n class=\"calendar__nav-btn\"\n (click)=\"prevMonth()\"\n [attr.aria-label]=\"i18n.prevMonth\"\n >\n <ngx-ds-icon [icon]=\"ChevronLeft\" [size]=\"18\" />\n </button>\n <span class=\"calendar__title\">{{ title() }}</span>\n <button\n type=\"button\"\n class=\"calendar__nav-btn\"\n (click)=\"nextMonth()\"\n [attr.aria-label]=\"i18n.nextMonth\"\n >\n <ngx-ds-icon [icon]=\"ChevronRight\" [size]=\"18\" />\n </button>\n </div>\n\n <!-- Weekday headers -->\n <div class=\"calendar__weekdays\" aria-hidden=\"true\">\n @for (d of weekdays; track d) {\n <span class=\"calendar__weekday\">{{ d }}</span>\n }\n </div>\n\n <!-- Day grid (WAI-ARIA grid with roving tabindex) -->\n <div #grid class=\"calendar__grid\" role=\"grid\" [attr.aria-label]=\"title()\">\n @for (week of weeks(); track $index) {\n <div class=\"calendar__week\" role=\"row\">\n @for (cell of week; track cell.date.getTime()) {\n <button\n type=\"button\"\n class=\"calendar__day\"\n role=\"gridcell\"\n [class.calendar__day--other]=\"!cell.inMonth\"\n [class.calendar__day--today]=\"cell.isToday\"\n [class.calendar__day--selected]=\"cell.isSelected\"\n [class.calendar__day--disabled]=\"cell.isDisabled\"\n [disabled]=\"disabled() || null\"\n [attr.aria-disabled]=\"cell.isDisabled || null\"\n [attr.aria-label]=\"dayLabel(cell.date)\"\n [attr.aria-selected]=\"cell.isSelected\"\n [attr.aria-current]=\"cell.isToday ? 'date' : null\"\n [attr.tabindex]=\"isFocusTarget(cell) ? 0 : -1\"\n (click)=\"selectDay(cell)\"\n (keydown)=\"onDayKeydown($event, cell)\"\n >\n {{ cell.date.getDate() }}\n </button>\n }\n </div>\n }\n </div>\n</div>\n", styles: [":host{display:inline-block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.calendar{width:20rem;padding:1rem;background:var(--surface-base, #ffffff);border:1px solid var(--border-base, #e5e7eb);border-radius:.75rem;box-shadow:0 2px 8px #0000000f}.calendar--disabled{opacity:.5;pointer-events:none}.calendar__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:.75rem}.calendar__title{font-size:1rem;font-weight:600;color:var(--text-base, #111827)}.calendar__nav-btn{background:none;border:none;cursor:pointer;padding:.375rem;border-radius:.375rem;display:flex;align-items:center;color:var(--text-muted, #6b7280);transition:background .1s ease}.calendar__nav-btn:hover{background:var(--surface-hover, #f3f4f6);color:var(--text-base, #111827)}.calendar__weekdays{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:.25rem}.calendar__weekday{text-align:center;font-size:.75rem;font-weight:600;color:var(--text-placeholder, #9ca3af);padding:.25rem 0}.calendar__grid{display:grid;grid-template-columns:repeat(7,1fr);gap:.125rem}.calendar__day{display:flex;align-items:center;justify-content:center;aspect-ratio:1;border:none;background:transparent;border-radius:.5rem;font-size:.875rem;font-family:inherit;cursor:pointer;color:var(--text-base, #111827);transition:background .1s ease,color .1s ease}.calendar__day:focus-visible{outline:2px solid var(--primary-300, #a5b4fc);outline-offset:1px}.calendar__day:hover:not(:disabled):not(.calendar__day--disabled):not(.calendar__day--selected){background:var(--surface-hover, #f3f4f6)}.calendar__day--other{color:var(--text-disabled, #d1d5db)}.calendar__day--today{color:var(--primary-600, #4f46e5);font-weight:700}.calendar__day--selected{background:var(--primary-500, #6366f1);color:var(--text-on-color, #fff);font-weight:600}.calendar__day--disabled{opacity:.35;cursor:not-allowed}.calendar__week{display:contents}\n"] }]
|
|
5271
5901
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }, { type: i0.Output, args: ["minDateChange"] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }, { type: i0.Output, args: ["maxDateChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], dateSelect: [{ type: i0.Output, args: ["dateSelect"] }], gridRef: [{ type: i0.ViewChild, args: ['grid', { isSignal: true }] }] } });
|
|
5272
5902
|
|
|
5273
|
-
let nextId = 0;
|
|
5903
|
+
let nextId$1 = 0;
|
|
5274
5904
|
class CommandPaletteComponent {
|
|
5275
5905
|
i18n = inject(NGX_DS_LABELS);
|
|
5276
5906
|
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
@@ -5301,7 +5931,7 @@ class CommandPaletteComponent {
|
|
|
5301
5931
|
return Array.from(cats.entries()).map(([cat, items]) => ({ cat, items }));
|
|
5302
5932
|
}, ...(ngDevMode ? [{ debugName: "categories" }] : /* istanbul ignore next */ []));
|
|
5303
5933
|
flatItems = computed(() => this.filteredItems(), ...(ngDevMode ? [{ debugName: "flatItems" }] : /* istanbul ignore next */ []));
|
|
5304
|
-
listboxId = `ngx-cp-listbox-${nextId++}`;
|
|
5934
|
+
listboxId = `ngx-cp-listbox-${nextId$1++}`;
|
|
5305
5935
|
optionId(item) {
|
|
5306
5936
|
return `${this.listboxId}-option-${item.id}`;
|
|
5307
5937
|
}
|
|
@@ -5623,6 +6253,343 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
5623
6253
|
args: [{ selector: 'ngx-ds-sidebar', standalone: true, imports: [IconComponent, IconButtonComponent, BadgeComponent, TooltipDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nav\n class=\"sidebar\"\n [class.sidebar--collapsed]=\"collapsed()\"\n [attr.aria-label]=\"ariaLabel() ?? i18n.mainNavigation\"\n>\n <div class=\"sidebar__header\">\n <ng-content select=\"[sidebar-header]\" />\n </div>\n\n <div class=\"sidebar__body\">\n @for (section of sections(); track section.id ?? $index) {\n <div class=\"sidebar__section\">\n @if (section.title) {\n <span class=\"sidebar__section-title\">{{ section.title }}</span>\n }\n @for (item of section.items; track item.id) {\n <button\n type=\"button\"\n class=\"sidebar__item\"\n [class.sidebar__item--active]=\"activeId() === item.id\"\n [disabled]=\"item.disabled\"\n [attr.aria-current]=\"activeId() === item.id ? 'page' : null\"\n [ngxTooltip]=\"collapsed() ? item.label : ''\"\n tooltipPlacement=\"right\"\n (click)=\"onItemClick(item)\"\n >\n @if (item.icon) {\n <ngx-ds-icon [icon]=\"item.icon\" [size]=\"18\" class=\"sidebar__item-icon\" />\n }\n <span class=\"sidebar__item-label\">{{ item.label }}</span>\n @if (item.badge !== undefined) {\n <ngx-ds-badge\n class=\"sidebar__item-badge\"\n size=\"sm\"\n [count]=\"badgeCount(item)\"\n [label]=\"badgeLabel(item)\"\n />\n }\n </button>\n }\n </div>\n }\n </div>\n\n <div class=\"sidebar__footer\">\n <ng-content select=\"[sidebar-footer]\" />\n </div>\n\n @if (collapsible()) {\n <ngx-ds-icon-button\n class=\"sidebar__toggle\"\n [icon]=\"toggleIcon()\"\n [ariaLabel]=\"collapsed() ? i18n.expandMenu : i18n.collapseMenu\"\n variant=\"outline\"\n size=\"sm\"\n (click)=\"toggleCollapsed()\"\n />\n }\n</nav>\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.sidebar{display:flex;flex-direction:column;width:240px;height:100%;background:var(--surface-base, #ffffff);border-right:1px solid var(--border-base, #e5e7eb);transition:width .2s ease;overflow:hidden}.sidebar--collapsed{width:64px}.sidebar--collapsed .sidebar__section-title,.sidebar--collapsed .sidebar__item-label,.sidebar--collapsed .sidebar__item-badge{display:none}.sidebar--collapsed .sidebar__item{justify-content:center}.sidebar__header:not(:has(*)),.sidebar__footer:not(:has(*)){display:none}.sidebar__body{flex:1;overflow-y:auto;padding:.5rem}.sidebar__section{display:flex;flex-direction:column;margin-bottom:.75rem}.sidebar__section-title{padding:.375rem .75rem;font-size:.6875rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted, #6b7280);white-space:nowrap}.sidebar__item{display:flex;align-items:center;gap:.625rem;width:100%;padding:.5rem .75rem;border:none;border-radius:.375rem;background:transparent;color:var(--text-base, #111827);font-size:.875rem;text-align:left;cursor:pointer;white-space:nowrap}.sidebar__item:hover:not(:disabled){background:var(--surface-hover, #f3f4f6)}.sidebar__item:focus-visible{outline:2px solid var(--primary-600, #4f46e5);outline-offset:-2px}.sidebar__item:disabled{color:var(--text-disabled, #d1d5db);cursor:not-allowed}.sidebar__item--active{background:var(--primary-50, #eef2ff);color:var(--primary-700, #4338ca)}.sidebar__item-icon{flex-shrink:0}.sidebar__item-label{flex:1;overflow:hidden;text-overflow:ellipsis}.sidebar__toggle{align-self:flex-end;margin:.5rem}\n"] }]
|
|
5624
6254
|
}], propDecorators: { sections: [{ type: i0.Input, args: [{ isSignal: true, alias: "sections", required: true }] }], activeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeId", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }, { type: i0.Output, args: ["collapsedChange"] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }] } });
|
|
5625
6255
|
|
|
6256
|
+
/**
|
|
6257
|
+
* Moves `index` by `delta` inside a list of `count` items. With `loop` it wraps
|
|
6258
|
+
* around; without it, it stops at the first and last item.
|
|
6259
|
+
*/
|
|
6260
|
+
function stepIndex(index, delta, count, loop) {
|
|
6261
|
+
if (count <= 0)
|
|
6262
|
+
return 0;
|
|
6263
|
+
const next = index + delta;
|
|
6264
|
+
if (loop)
|
|
6265
|
+
return ((next % count) + count) % count;
|
|
6266
|
+
return Math.min(Math.max(next, 0), count - 1);
|
|
6267
|
+
}
|
|
6268
|
+
|
|
6269
|
+
/** Minimum horizontal drag, in px, that counts as a swipe. */
|
|
6270
|
+
const SWIPE_THRESHOLD$1 = 40;
|
|
6271
|
+
class CarouselComponent {
|
|
6272
|
+
i18n = inject(NGX_DS_LABELS);
|
|
6273
|
+
icons = { ChevronLeft, ChevronRight, Pause, Play };
|
|
6274
|
+
// ── Inputs ───────────────────────────────────────────────────
|
|
6275
|
+
items = input.required(...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
6276
|
+
/** Index of the visible slide. Two-way bindable. */
|
|
6277
|
+
index = model(0, ...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
6278
|
+
/** After the last slide comes the first one again. */
|
|
6279
|
+
loop = input(true, ...(ngDevMode ? [{ debugName: "loop" }] : /* istanbul ignore next */ []));
|
|
6280
|
+
/** Milliseconds between slides. `0` turns autoplay off. */
|
|
6281
|
+
autoplay = input(0, ...(ngDevMode ? [{ debugName: "autoplay" }] : /* istanbul ignore next */ []));
|
|
6282
|
+
showArrows = input(true, ...(ngDevMode ? [{ debugName: "showArrows" }] : /* istanbul ignore next */ []));
|
|
6283
|
+
showIndicators = input(true, ...(ngDevMode ? [{ debugName: "showIndicators" }] : /* istanbul ignore next */ []));
|
|
6284
|
+
/** CSS `aspect-ratio` of the viewport. */
|
|
6285
|
+
aspectRatio = input('16 / 9', ...(ngDevMode ? [{ debugName: "aspectRatio" }] : /* istanbul ignore next */ []));
|
|
6286
|
+
fit = input('cover', ...(ngDevMode ? [{ debugName: "fit" }] : /* istanbul ignore next */ []));
|
|
6287
|
+
/** Accessible name of the carousel region. */
|
|
6288
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
6289
|
+
/** Emitted when a slide image is clicked, e.g. to open a Lightbox. */
|
|
6290
|
+
itemClick = output();
|
|
6291
|
+
// ── State ────────────────────────────────────────────────────
|
|
6292
|
+
/** Autoplay paused with the pause button. */
|
|
6293
|
+
#userPaused = signal(false, ...(ngDevMode ? [{ debugName: "#userPaused" }] : /* istanbul ignore next */ []));
|
|
6294
|
+
#hovered = signal(false, ...(ngDevMode ? [{ debugName: "#hovered" }] : /* istanbul ignore next */ []));
|
|
6295
|
+
#focused = signal(false, ...(ngDevMode ? [{ debugName: "#focused" }] : /* istanbul ignore next */ []));
|
|
6296
|
+
#pointerStart = null;
|
|
6297
|
+
// ── Derived ──────────────────────────────────────────────────
|
|
6298
|
+
count = computed(() => this.items().length, ...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
|
|
6299
|
+
current = computed(() => Math.min(Math.max(this.index(), 0), this.count() - 1), ...(ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []));
|
|
6300
|
+
hasAutoplay = computed(() => this.autoplay() > 0 && this.count() > 1, ...(ngDevMode ? [{ debugName: "hasAutoplay" }] : /* istanbul ignore next */ []));
|
|
6301
|
+
isPlaying = computed(() => this.hasAutoplay() && !this.#userPaused() && !this.#hovered() && !this.#focused(), ...(ngDevMode ? [{ debugName: "isPlaying" }] : /* istanbul ignore next */ []));
|
|
6302
|
+
isUserPaused = this.#userPaused.asReadonly();
|
|
6303
|
+
canPrev = computed(() => this.loop() || this.current() > 0, ...(ngDevMode ? [{ debugName: "canPrev" }] : /* istanbul ignore next */ []));
|
|
6304
|
+
canNext = computed(() => this.loop() || this.current() < this.count() - 1, ...(ngDevMode ? [{ debugName: "canNext" }] : /* istanbul ignore next */ []));
|
|
6305
|
+
trackTransform = computed(() => `translateX(-${this.current() * 100}%)`, ...(ngDevMode ? [{ debugName: "trackTransform" }] : /* istanbul ignore next */ []));
|
|
6306
|
+
constructor() {
|
|
6307
|
+
// The interval restarts whenever the slide changes, so a manual move gets a full period.
|
|
6308
|
+
effect((onCleanup) => {
|
|
6309
|
+
if (!this.isPlaying())
|
|
6310
|
+
return;
|
|
6311
|
+
this.current();
|
|
6312
|
+
const id = setInterval(() => this.next(), this.autoplay());
|
|
6313
|
+
onCleanup(() => clearInterval(id));
|
|
6314
|
+
});
|
|
6315
|
+
}
|
|
6316
|
+
// ── Navigation ───────────────────────────────────────────────
|
|
6317
|
+
goTo(index) {
|
|
6318
|
+
if (index >= 0 && index < this.count())
|
|
6319
|
+
this.index.set(index);
|
|
6320
|
+
}
|
|
6321
|
+
prev() {
|
|
6322
|
+
this.index.set(stepIndex(this.current(), -1, this.count(), this.loop()));
|
|
6323
|
+
}
|
|
6324
|
+
next() {
|
|
6325
|
+
this.index.set(stepIndex(this.current(), 1, this.count(), this.loop()));
|
|
6326
|
+
}
|
|
6327
|
+
toggleAutoplay() {
|
|
6328
|
+
this.#userPaused.update((p) => !p);
|
|
6329
|
+
}
|
|
6330
|
+
// ── Events ───────────────────────────────────────────────────
|
|
6331
|
+
onKeydown(event) {
|
|
6332
|
+
switch (event.key) {
|
|
6333
|
+
case 'ArrowLeft':
|
|
6334
|
+
this.prev();
|
|
6335
|
+
break;
|
|
6336
|
+
case 'ArrowRight':
|
|
6337
|
+
this.next();
|
|
6338
|
+
break;
|
|
6339
|
+
case 'Home':
|
|
6340
|
+
this.goTo(0);
|
|
6341
|
+
break;
|
|
6342
|
+
case 'End':
|
|
6343
|
+
this.goTo(this.count() - 1);
|
|
6344
|
+
break;
|
|
6345
|
+
default:
|
|
6346
|
+
return;
|
|
6347
|
+
}
|
|
6348
|
+
event.preventDefault();
|
|
6349
|
+
}
|
|
6350
|
+
onMouseEnter() {
|
|
6351
|
+
this.#hovered.set(true);
|
|
6352
|
+
}
|
|
6353
|
+
onMouseLeave() {
|
|
6354
|
+
this.#hovered.set(false);
|
|
6355
|
+
}
|
|
6356
|
+
onFocusIn() {
|
|
6357
|
+
this.#focused.set(true);
|
|
6358
|
+
}
|
|
6359
|
+
onFocusOut(event) {
|
|
6360
|
+
const host = event.currentTarget;
|
|
6361
|
+
if (!host.contains(event.relatedTarget))
|
|
6362
|
+
this.#focused.set(false);
|
|
6363
|
+
}
|
|
6364
|
+
onPointerDown(event) {
|
|
6365
|
+
if (event.pointerType === 'mouse' && event.button !== 0)
|
|
6366
|
+
return;
|
|
6367
|
+
this.#pointerStart = event.clientX;
|
|
6368
|
+
}
|
|
6369
|
+
onPointerUp(event) {
|
|
6370
|
+
if (this.#pointerStart === null)
|
|
6371
|
+
return;
|
|
6372
|
+
const delta = event.clientX - this.#pointerStart;
|
|
6373
|
+
this.#pointerStart = null;
|
|
6374
|
+
if (Math.abs(delta) < SWIPE_THRESHOLD$1)
|
|
6375
|
+
return;
|
|
6376
|
+
if (delta < 0)
|
|
6377
|
+
this.next();
|
|
6378
|
+
else
|
|
6379
|
+
this.prev();
|
|
6380
|
+
}
|
|
6381
|
+
onPointerCancel() {
|
|
6382
|
+
this.#pointerStart = null;
|
|
6383
|
+
}
|
|
6384
|
+
onItemClick(item, index) {
|
|
6385
|
+
this.itemClick.emit({ item, index });
|
|
6386
|
+
}
|
|
6387
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: CarouselComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6388
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: CarouselComponent, isStandalone: true, selector: "ngx-ds-carousel", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, autoplay: { classPropertyName: "autoplay", publicName: "autoplay", isSignal: true, isRequired: false, transformFunction: null }, showArrows: { classPropertyName: "showArrows", publicName: "showArrows", isSignal: true, isRequired: false, transformFunction: null }, showIndicators: { classPropertyName: "showIndicators", publicName: "showIndicators", isSignal: true, isRequired: false, transformFunction: null }, aspectRatio: { classPropertyName: "aspectRatio", publicName: "aspectRatio", isSignal: true, isRequired: false, transformFunction: null }, fit: { classPropertyName: "fit", publicName: "fit", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { index: "indexChange", itemClick: "itemClick" }, ngImport: i0, template: "<section\n class=\"carousel\"\n role=\"region\"\n [attr.aria-roledescription]=\"i18n.carousel\"\n [attr.aria-label]=\"ariaLabel() || i18n.carousel\"\n (keydown)=\"onKeydown($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n>\n <div\n class=\"carousel__viewport\"\n [style.aspect-ratio]=\"aspectRatio()\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerCancel()\"\n >\n <div\n class=\"carousel__track\"\n [style.transform]=\"trackTransform()\"\n [attr.aria-live]=\"isPlaying() ? 'off' : 'polite'\"\n >\n @for (item of items(); track $index; let i = $index) {\n <div\n class=\"carousel__slide\"\n role=\"group\"\n [attr.aria-roledescription]=\"i18n.slide\"\n [attr.aria-label]=\"i18n.slideOf(i + 1, count())\"\n [attr.aria-hidden]=\"i !== current() || null\"\n [attr.inert]=\"i !== current() ? '' : null\"\n >\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- optional mouse shortcut; itemClick is a convenience output -->\n <img\n class=\"carousel__image\"\n [class.carousel__image--contain]=\"fit() === 'contain'\"\n [src]=\"item.src\"\n [alt]=\"item.alt\"\n [attr.loading]=\"i === 0 ? null : 'lazy'\"\n draggable=\"false\"\n (click)=\"onItemClick(item, i)\"\n />\n @if (item.caption) {\n <p class=\"carousel__caption\">{{ item.caption }}</p>\n }\n </div>\n }\n </div>\n\n @if (showArrows() && count() > 1) {\n <button\n type=\"button\"\n class=\"carousel__arrow carousel__arrow--prev\"\n [disabled]=\"!canPrev()\"\n [attr.aria-label]=\"i18n.prevSlide\"\n (click)=\"prev()\"\n >\n <ngx-ds-icon [icon]=\"icons.ChevronLeft\" [size]=\"20\" />\n </button>\n <button\n type=\"button\"\n class=\"carousel__arrow carousel__arrow--next\"\n [disabled]=\"!canNext()\"\n [attr.aria-label]=\"i18n.nextSlide\"\n (click)=\"next()\"\n >\n <ngx-ds-icon [icon]=\"icons.ChevronRight\" [size]=\"20\" />\n </button>\n }\n </div>\n\n @if ((showIndicators() && count() > 1) || hasAutoplay()) {\n <div class=\"carousel__controls\">\n @if (hasAutoplay()) {\n <button\n type=\"button\"\n class=\"carousel__play\"\n [attr.aria-label]=\"isUserPaused() ? i18n.playAutoplay : i18n.pauseAutoplay\"\n (click)=\"toggleAutoplay()\"\n >\n <ngx-ds-icon [icon]=\"isUserPaused() ? icons.Play : icons.Pause\" [size]=\"14\" />\n </button>\n }\n @if (showIndicators() && count() > 1) {\n <div class=\"carousel__dots\">\n @for (item of items(); track $index; let i = $index) {\n <button\n type=\"button\"\n class=\"carousel__dot\"\n [class.carousel__dot--active]=\"i === current()\"\n [attr.aria-label]=\"i18n.goToSlide(i + 1)\"\n [attr.aria-current]=\"i === current() || null\"\n (click)=\"goTo(i)\"\n ></button>\n }\n </div>\n }\n </div>\n }\n</section>\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.carousel{position:relative}.carousel__viewport{position:relative;overflow:hidden;background:var(--surface-muted, #f3f4f6);border-radius:.75rem;touch-action:pan-y}.carousel__track{display:flex;height:100%;transition:transform .4s ease}@media(prefers-reduced-motion:reduce){.carousel__track{transition:none}}.carousel__slide{position:relative;flex:0 0 100%;height:100%}.carousel__image{display:block;width:100%;height:100%;object-fit:cover;-webkit-user-select:none;user-select:none}.carousel__image--contain{object-fit:contain}.carousel__caption{position:absolute;inset:auto 0 0;margin:0;padding:2rem 1rem .875rem;font-size:.875rem;color:#fff;background:linear-gradient(to top,rgba(0,0,0,.6),transparent)}.carousel__arrow{position:absolute;top:50%;display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;color:var(--text-base, #111827);background:#ffffffd9;border:none;border-radius:9999px;box-shadow:0 2px 8px #00000026;cursor:pointer;transform:translateY(-50%);transition:background .15s ease,opacity .15s ease}.carousel__arrow:hover:not(:disabled){background:#fff}.carousel__arrow:focus-visible{outline:2px solid var(--primary-500, #6366f1);outline-offset:2px}.carousel__arrow:disabled{opacity:.4;cursor:not-allowed}.carousel__arrow--prev{left:.75rem}.carousel__arrow--next{right:.75rem}.carousel__controls{display:flex;align-items:center;justify-content:center;gap:.75rem;margin-top:.75rem}.carousel__dots{display:flex;align-items:center;gap:.25rem}.carousel__dot{position:relative;width:1.5rem;height:1.5rem;padding:0;background:transparent;border:none;cursor:pointer}.carousel__dot:before{content:\"\";position:absolute;top:50%;left:50%;width:.5rem;height:.5rem;background:var(--border-strong, #d1d5db);border-radius:9999px;transform:translate(-50%,-50%);transition:width .2s ease,background .2s ease}.carousel__dot:hover:before{background:var(--text-placeholder, #9ca3af)}.carousel__dot--active:before,.carousel__dot--active:hover:before{width:1.25rem;background:var(--primary-500, #6366f1)}.carousel__dot:focus-visible{outline:2px solid var(--primary-500, #6366f1);outline-offset:-2px;border-radius:9999px}.carousel__play{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;padding:0;color:var(--text-secondary, #374151);background:var(--surface-muted, #f3f4f6);border:none;border-radius:9999px;cursor:pointer}.carousel__play:hover{background:var(--surface-hover, #e5e7eb)}.carousel__play:focus-visible{outline:2px solid var(--primary-500, #6366f1);outline-offset:2px}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6389
|
+
}
|
|
6390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: CarouselComponent, decorators: [{
|
|
6391
|
+
type: Component,
|
|
6392
|
+
args: [{ selector: 'ngx-ds-carousel', standalone: true, imports: [IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<section\n class=\"carousel\"\n role=\"region\"\n [attr.aria-roledescription]=\"i18n.carousel\"\n [attr.aria-label]=\"ariaLabel() || i18n.carousel\"\n (keydown)=\"onKeydown($event)\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n (focusin)=\"onFocusIn()\"\n (focusout)=\"onFocusOut($event)\"\n>\n <div\n class=\"carousel__viewport\"\n [style.aspect-ratio]=\"aspectRatio()\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerCancel()\"\n >\n <div\n class=\"carousel__track\"\n [style.transform]=\"trackTransform()\"\n [attr.aria-live]=\"isPlaying() ? 'off' : 'polite'\"\n >\n @for (item of items(); track $index; let i = $index) {\n <div\n class=\"carousel__slide\"\n role=\"group\"\n [attr.aria-roledescription]=\"i18n.slide\"\n [attr.aria-label]=\"i18n.slideOf(i + 1, count())\"\n [attr.aria-hidden]=\"i !== current() || null\"\n [attr.inert]=\"i !== current() ? '' : null\"\n >\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- optional mouse shortcut; itemClick is a convenience output -->\n <img\n class=\"carousel__image\"\n [class.carousel__image--contain]=\"fit() === 'contain'\"\n [src]=\"item.src\"\n [alt]=\"item.alt\"\n [attr.loading]=\"i === 0 ? null : 'lazy'\"\n draggable=\"false\"\n (click)=\"onItemClick(item, i)\"\n />\n @if (item.caption) {\n <p class=\"carousel__caption\">{{ item.caption }}</p>\n }\n </div>\n }\n </div>\n\n @if (showArrows() && count() > 1) {\n <button\n type=\"button\"\n class=\"carousel__arrow carousel__arrow--prev\"\n [disabled]=\"!canPrev()\"\n [attr.aria-label]=\"i18n.prevSlide\"\n (click)=\"prev()\"\n >\n <ngx-ds-icon [icon]=\"icons.ChevronLeft\" [size]=\"20\" />\n </button>\n <button\n type=\"button\"\n class=\"carousel__arrow carousel__arrow--next\"\n [disabled]=\"!canNext()\"\n [attr.aria-label]=\"i18n.nextSlide\"\n (click)=\"next()\"\n >\n <ngx-ds-icon [icon]=\"icons.ChevronRight\" [size]=\"20\" />\n </button>\n }\n </div>\n\n @if ((showIndicators() && count() > 1) || hasAutoplay()) {\n <div class=\"carousel__controls\">\n @if (hasAutoplay()) {\n <button\n type=\"button\"\n class=\"carousel__play\"\n [attr.aria-label]=\"isUserPaused() ? i18n.playAutoplay : i18n.pauseAutoplay\"\n (click)=\"toggleAutoplay()\"\n >\n <ngx-ds-icon [icon]=\"isUserPaused() ? icons.Play : icons.Pause\" [size]=\"14\" />\n </button>\n }\n @if (showIndicators() && count() > 1) {\n <div class=\"carousel__dots\">\n @for (item of items(); track $index; let i = $index) {\n <button\n type=\"button\"\n class=\"carousel__dot\"\n [class.carousel__dot--active]=\"i === current()\"\n [attr.aria-label]=\"i18n.goToSlide(i + 1)\"\n [attr.aria-current]=\"i === current() || null\"\n (click)=\"goTo(i)\"\n ></button>\n }\n </div>\n }\n </div>\n }\n</section>\n", styles: [":host{display:block;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.carousel{position:relative}.carousel__viewport{position:relative;overflow:hidden;background:var(--surface-muted, #f3f4f6);border-radius:.75rem;touch-action:pan-y}.carousel__track{display:flex;height:100%;transition:transform .4s ease}@media(prefers-reduced-motion:reduce){.carousel__track{transition:none}}.carousel__slide{position:relative;flex:0 0 100%;height:100%}.carousel__image{display:block;width:100%;height:100%;object-fit:cover;-webkit-user-select:none;user-select:none}.carousel__image--contain{object-fit:contain}.carousel__caption{position:absolute;inset:auto 0 0;margin:0;padding:2rem 1rem .875rem;font-size:.875rem;color:#fff;background:linear-gradient(to top,rgba(0,0,0,.6),transparent)}.carousel__arrow{position:absolute;top:50%;display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;color:var(--text-base, #111827);background:#ffffffd9;border:none;border-radius:9999px;box-shadow:0 2px 8px #00000026;cursor:pointer;transform:translateY(-50%);transition:background .15s ease,opacity .15s ease}.carousel__arrow:hover:not(:disabled){background:#fff}.carousel__arrow:focus-visible{outline:2px solid var(--primary-500, #6366f1);outline-offset:2px}.carousel__arrow:disabled{opacity:.4;cursor:not-allowed}.carousel__arrow--prev{left:.75rem}.carousel__arrow--next{right:.75rem}.carousel__controls{display:flex;align-items:center;justify-content:center;gap:.75rem;margin-top:.75rem}.carousel__dots{display:flex;align-items:center;gap:.25rem}.carousel__dot{position:relative;width:1.5rem;height:1.5rem;padding:0;background:transparent;border:none;cursor:pointer}.carousel__dot:before{content:\"\";position:absolute;top:50%;left:50%;width:.5rem;height:.5rem;background:var(--border-strong, #d1d5db);border-radius:9999px;transform:translate(-50%,-50%);transition:width .2s ease,background .2s ease}.carousel__dot:hover:before{background:var(--text-placeholder, #9ca3af)}.carousel__dot--active:before,.carousel__dot--active:hover:before{width:1.25rem;background:var(--primary-500, #6366f1)}.carousel__dot:focus-visible{outline:2px solid var(--primary-500, #6366f1);outline-offset:-2px;border-radius:9999px}.carousel__play{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;padding:0;color:var(--text-secondary, #374151);background:var(--surface-muted, #f3f4f6);border:none;border-radius:9999px;cursor:pointer}.carousel__play:hover{background:var(--surface-hover, #e5e7eb)}.carousel__play:focus-visible{outline:2px solid var(--primary-500, #6366f1);outline-offset:2px}\n"] }]
|
|
6393
|
+
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: false }] }, { type: i0.Output, args: ["indexChange"] }], loop: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], autoplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoplay", required: false }] }], showArrows: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArrows", required: false }] }], showIndicators: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIndicators", required: false }] }], aspectRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "aspectRatio", required: false }] }], fit: [{ type: i0.Input, args: [{ isSignal: true, alias: "fit", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }] } });
|
|
6394
|
+
|
|
6395
|
+
/** Minimum horizontal drag, in px, that counts as a swipe. */
|
|
6396
|
+
const SWIPE_THRESHOLD = 40;
|
|
6397
|
+
class LightboxComponent {
|
|
6398
|
+
i18n = inject(NGX_DS_LABELS);
|
|
6399
|
+
doc = inject(DOCUMENT$1);
|
|
6400
|
+
icons = { ChevronLeft, ChevronRight, X };
|
|
6401
|
+
// ── Inputs ───────────────────────────────────────────────────
|
|
6402
|
+
items = input.required(...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
6403
|
+
open = model(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
6404
|
+
/** Index of the visible image. Two-way bindable. */
|
|
6405
|
+
index = model(0, ...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
|
|
6406
|
+
loop = input(true, ...(ngDevMode ? [{ debugName: "loop" }] : /* istanbul ignore next */ []));
|
|
6407
|
+
closed = output();
|
|
6408
|
+
#pointerStart = null;
|
|
6409
|
+
// ── Derived ──────────────────────────────────────────────────
|
|
6410
|
+
count = computed(() => this.items().length, ...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
|
|
6411
|
+
current = computed(() => Math.min(Math.max(this.index(), 0), this.count() - 1), ...(ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []));
|
|
6412
|
+
item = computed(() => this.items()[this.current()], ...(ngDevMode ? [{ debugName: "item" }] : /* istanbul ignore next */ []));
|
|
6413
|
+
canPrev = computed(() => this.count() > 1 && (this.loop() || this.current() > 0), ...(ngDevMode ? [{ debugName: "canPrev" }] : /* istanbul ignore next */ []));
|
|
6414
|
+
canNext = computed(() => this.count() > 1 && (this.loop() || this.current() < this.count() - 1), ...(ngDevMode ? [{ debugName: "canNext" }] : /* istanbul ignore next */ []));
|
|
6415
|
+
constructor() {
|
|
6416
|
+
effect(() => {
|
|
6417
|
+
this.doc.body.style.overflow = this.open() ? 'hidden' : '';
|
|
6418
|
+
});
|
|
6419
|
+
setupEscapeClose(() => {
|
|
6420
|
+
if (this.open())
|
|
6421
|
+
this.close();
|
|
6422
|
+
});
|
|
6423
|
+
}
|
|
6424
|
+
ngOnDestroy() {
|
|
6425
|
+
this.doc.body.style.overflow = '';
|
|
6426
|
+
}
|
|
6427
|
+
close() {
|
|
6428
|
+
this.open.set(false);
|
|
6429
|
+
this.closed.emit();
|
|
6430
|
+
}
|
|
6431
|
+
prev() {
|
|
6432
|
+
if (this.canPrev())
|
|
6433
|
+
this.index.set(stepIndex(this.current(), -1, this.count(), this.loop()));
|
|
6434
|
+
}
|
|
6435
|
+
next() {
|
|
6436
|
+
if (this.canNext())
|
|
6437
|
+
this.index.set(stepIndex(this.current(), 1, this.count(), this.loop()));
|
|
6438
|
+
}
|
|
6439
|
+
onKeydown(event) {
|
|
6440
|
+
if (event.key === 'ArrowLeft')
|
|
6441
|
+
this.prev();
|
|
6442
|
+
else if (event.key === 'ArrowRight')
|
|
6443
|
+
this.next();
|
|
6444
|
+
else
|
|
6445
|
+
return;
|
|
6446
|
+
event.preventDefault();
|
|
6447
|
+
}
|
|
6448
|
+
onPointerDown(event) {
|
|
6449
|
+
if (event.pointerType === 'mouse' && event.button !== 0)
|
|
6450
|
+
return;
|
|
6451
|
+
this.#pointerStart = event.clientX;
|
|
6452
|
+
}
|
|
6453
|
+
onPointerUp(event) {
|
|
6454
|
+
if (this.#pointerStart === null)
|
|
6455
|
+
return;
|
|
6456
|
+
const delta = event.clientX - this.#pointerStart;
|
|
6457
|
+
this.#pointerStart = null;
|
|
6458
|
+
if (Math.abs(delta) < SWIPE_THRESHOLD)
|
|
6459
|
+
return;
|
|
6460
|
+
if (delta < 0)
|
|
6461
|
+
this.next();
|
|
6462
|
+
else
|
|
6463
|
+
this.prev();
|
|
6464
|
+
}
|
|
6465
|
+
onPointerCancel() {
|
|
6466
|
+
this.#pointerStart = null;
|
|
6467
|
+
}
|
|
6468
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: LightboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6469
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: LightboxComponent, isStandalone: true, selector: "ngx-ds-lightbox", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", index: "indexChange", closed: "closed" }, ngImport: i0, template: "@if (open() && item(); as img) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- backdrop click is a mouse shortcut; keyboard users close with Escape -->\n <div\n class=\"lightbox\"\n (click)=\"$event.target === $event.currentTarget && close()\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerCancel()\"\n >\n <div\n class=\"lightbox__dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"i18n.lightbox\"\n ngxFocusTrap\n tabindex=\"-1\"\n (keydown)=\"onKeydown($event)\"\n >\n <div class=\"lightbox__toolbar\">\n @if (count() > 1) {\n <span class=\"lightbox__counter\" aria-live=\"polite\">\n {{ i18n.slideOf(current() + 1, count()) }}\n </span>\n }\n <button\n type=\"button\"\n class=\"lightbox__btn lightbox__close\"\n [attr.aria-label]=\"i18n.close\"\n (click)=\"close()\"\n >\n <ngx-ds-icon [icon]=\"icons.X\" [size]=\"20\" />\n </button>\n </div>\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- clicks around the image close it, like the backdrop -->\n <figure class=\"lightbox__figure\" (click)=\"$event.target === $event.currentTarget && close()\">\n <img class=\"lightbox__image\" [src]=\"img.src\" [alt]=\"img.alt\" draggable=\"false\" />\n @if (img.caption) {\n <figcaption class=\"lightbox__caption\">{{ img.caption }}</figcaption>\n }\n </figure>\n\n @if (count() > 1) {\n <button\n type=\"button\"\n class=\"lightbox__btn lightbox__nav lightbox__nav--prev\"\n [disabled]=\"!canPrev()\"\n [attr.aria-label]=\"i18n.prevSlide\"\n (click)=\"prev()\"\n >\n <ngx-ds-icon [icon]=\"icons.ChevronLeft\" [size]=\"24\" />\n </button>\n <button\n type=\"button\"\n class=\"lightbox__btn lightbox__nav lightbox__nav--next\"\n [disabled]=\"!canNext()\"\n [attr.aria-label]=\"i18n.nextSlide\"\n (click)=\"next()\"\n >\n <ngx-ds-icon [icon]=\"icons.ChevronRight\" [size]=\"24\" />\n </button>\n }\n </div>\n </div>\n}\n", styles: [":host{display:contents;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.lightbox{position:fixed;inset:0;z-index:1100;background:#000000e6;touch-action:pan-y;animation:lightbox-in .18s ease}@media(prefers-reduced-motion:reduce){.lightbox{animation:none}}.lightbox__dialog{position:relative;width:100%;height:100%;outline:none}.lightbox__toolbar{position:absolute;inset:0 0 auto;z-index:1;display:flex;align-items:center;justify-content:flex-end;gap:1rem;padding:.75rem 1rem}.lightbox__counter{font-size:.875rem;color:#ffffffd9}.lightbox__figure{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;width:100%;height:100%;margin:0;padding:4rem 4.5rem 2rem;box-sizing:border-box}@media(max-width:640px){.lightbox__figure{padding:4rem .5rem 1.5rem}}.lightbox__image{display:block;max-width:100%;max-height:100%;min-height:0;flex:0 1 auto;object-fit:contain;border-radius:.25rem;-webkit-user-select:none;user-select:none}.lightbox__caption{max-width:48rem;font-size:.875rem;text-align:center;color:#ffffffe6}.lightbox__btn{display:inline-flex;align-items:center;justify-content:center;padding:0;color:#fff;background:#ffffff1f;border:none;border-radius:9999px;cursor:pointer;transition:background .15s ease,opacity .15s ease}.lightbox__btn:hover:not(:disabled){background:#ffffff3d}.lightbox__btn:focus-visible{outline:2px solid #fff;outline-offset:2px}.lightbox__btn:disabled{opacity:.3;cursor:not-allowed}.lightbox__close{width:2.5rem;height:2.5rem}.lightbox__nav{position:absolute;top:50%;width:3rem;height:3rem;transform:translateY(-50%)}.lightbox__nav--prev{left:1rem}.lightbox__nav--next{right:1rem}@media(max-width:640px){.lightbox__nav{top:auto;bottom:1rem;transform:none}}@keyframes lightbox-in{0%{opacity:0}}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ngx-ds-icon", inputs: ["icon", "size", "color", "strokeWidth", "absoluteStrokeWidth"] }, { kind: "directive", type: FocusTrapDirective, selector: "[ngxFocusTrap]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6470
|
+
}
|
|
6471
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: LightboxComponent, decorators: [{
|
|
6472
|
+
type: Component,
|
|
6473
|
+
args: [{ selector: 'ngx-ds-lightbox', standalone: true, imports: [IconComponent, FocusTrapDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (open() && item(); as img) {\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- backdrop click is a mouse shortcut; keyboard users close with Escape -->\n <div\n class=\"lightbox\"\n (click)=\"$event.target === $event.currentTarget && close()\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerCancel()\"\n >\n <div\n class=\"lightbox__dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"i18n.lightbox\"\n ngxFocusTrap\n tabindex=\"-1\"\n (keydown)=\"onKeydown($event)\"\n >\n <div class=\"lightbox__toolbar\">\n @if (count() > 1) {\n <span class=\"lightbox__counter\" aria-live=\"polite\">\n {{ i18n.slideOf(current() + 1, count()) }}\n </span>\n }\n <button\n type=\"button\"\n class=\"lightbox__btn lightbox__close\"\n [attr.aria-label]=\"i18n.close\"\n (click)=\"close()\"\n >\n <ngx-ds-icon [icon]=\"icons.X\" [size]=\"20\" />\n </button>\n </div>\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- clicks around the image close it, like the backdrop -->\n <figure class=\"lightbox__figure\" (click)=\"$event.target === $event.currentTarget && close()\">\n <img class=\"lightbox__image\" [src]=\"img.src\" [alt]=\"img.alt\" draggable=\"false\" />\n @if (img.caption) {\n <figcaption class=\"lightbox__caption\">{{ img.caption }}</figcaption>\n }\n </figure>\n\n @if (count() > 1) {\n <button\n type=\"button\"\n class=\"lightbox__btn lightbox__nav lightbox__nav--prev\"\n [disabled]=\"!canPrev()\"\n [attr.aria-label]=\"i18n.prevSlide\"\n (click)=\"prev()\"\n >\n <ngx-ds-icon [icon]=\"icons.ChevronLeft\" [size]=\"24\" />\n </button>\n <button\n type=\"button\"\n class=\"lightbox__btn lightbox__nav lightbox__nav--next\"\n [disabled]=\"!canNext()\"\n [attr.aria-label]=\"i18n.nextSlide\"\n (click)=\"next()\"\n >\n <ngx-ds-icon [icon]=\"icons.ChevronRight\" [size]=\"24\" />\n </button>\n }\n </div>\n </div>\n}\n", styles: [":host{display:contents;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.lightbox{position:fixed;inset:0;z-index:1100;background:#000000e6;touch-action:pan-y;animation:lightbox-in .18s ease}@media(prefers-reduced-motion:reduce){.lightbox{animation:none}}.lightbox__dialog{position:relative;width:100%;height:100%;outline:none}.lightbox__toolbar{position:absolute;inset:0 0 auto;z-index:1;display:flex;align-items:center;justify-content:flex-end;gap:1rem;padding:.75rem 1rem}.lightbox__counter{font-size:.875rem;color:#ffffffd9}.lightbox__figure{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;width:100%;height:100%;margin:0;padding:4rem 4.5rem 2rem;box-sizing:border-box}@media(max-width:640px){.lightbox__figure{padding:4rem .5rem 1.5rem}}.lightbox__image{display:block;max-width:100%;max-height:100%;min-height:0;flex:0 1 auto;object-fit:contain;border-radius:.25rem;-webkit-user-select:none;user-select:none}.lightbox__caption{max-width:48rem;font-size:.875rem;text-align:center;color:#ffffffe6}.lightbox__btn{display:inline-flex;align-items:center;justify-content:center;padding:0;color:#fff;background:#ffffff1f;border:none;border-radius:9999px;cursor:pointer;transition:background .15s ease,opacity .15s ease}.lightbox__btn:hover:not(:disabled){background:#ffffff3d}.lightbox__btn:focus-visible{outline:2px solid #fff;outline-offset:2px}.lightbox__btn:disabled{opacity:.3;cursor:not-allowed}.lightbox__close{width:2.5rem;height:2.5rem}.lightbox__nav{position:absolute;top:50%;width:3rem;height:3rem;transform:translateY(-50%)}.lightbox__nav--prev{left:1rem}.lightbox__nav--next{right:1rem}@media(max-width:640px){.lightbox__nav{top:auto;bottom:1rem;transform:none}}@keyframes lightbox-in{0%{opacity:0}}\n"] }]
|
|
6474
|
+
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: false }] }, { type: i0.Output, args: ["indexChange"] }], loop: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
6475
|
+
|
|
6476
|
+
let nextId = 0;
|
|
6477
|
+
/**
|
|
6478
|
+
* Two resizable panes with a draggable divider. Project the panes with the
|
|
6479
|
+
* `splitter-start` and `splitter-end` attributes.
|
|
6480
|
+
*/
|
|
6481
|
+
class SplitterComponent {
|
|
6482
|
+
i18n = inject(NGX_DS_LABELS);
|
|
6483
|
+
host = inject(ElementRef);
|
|
6484
|
+
// ── Inputs ───────────────────────────────────────────────────
|
|
6485
|
+
/** `horizontal` puts the panes side by side; `vertical` stacks them. */
|
|
6486
|
+
orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
6487
|
+
/** Size of the first pane, in % of the available space. Two-way bindable. */
|
|
6488
|
+
size = model(50, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
6489
|
+
min = input(10, ...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
6490
|
+
max = input(90, ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
6491
|
+
/** Percentage moved by each arrow key press. */
|
|
6492
|
+
step = input(5, ...(ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []));
|
|
6493
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
6494
|
+
/** Accessible name of the divider. */
|
|
6495
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
6496
|
+
/** Emitted with the final size after a drag or a keyboard change. */
|
|
6497
|
+
resizeEnd = output();
|
|
6498
|
+
// ── State ────────────────────────────────────────────────────
|
|
6499
|
+
paneId = `ngx-ds-splitter-${nextId++}`;
|
|
6500
|
+
#dragging = signal(false, ...(ngDevMode ? [{ debugName: "#dragging" }] : /* istanbul ignore next */ []));
|
|
6501
|
+
isDragging = this.#dragging.asReadonly();
|
|
6502
|
+
/** Size before Enter collapsed the first pane. */
|
|
6503
|
+
#restoreSize = null;
|
|
6504
|
+
// ── Derived ──────────────────────────────────────────────────
|
|
6505
|
+
isHorizontal = computed(() => this.orientation() === 'horizontal', ...(ngDevMode ? [{ debugName: "isHorizontal" }] : /* istanbul ignore next */ []));
|
|
6506
|
+
current = computed(() => this.clamp(this.size()), ...(ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []));
|
|
6507
|
+
template = computed(() => `minmax(0, ${this.current()}fr) auto minmax(0, ${100 - this.current()}fr)`, ...(ngDevMode ? [{ debugName: "template" }] : /* istanbul ignore next */ []));
|
|
6508
|
+
/** A splitter that puts panes side by side has a vertical divider. */
|
|
6509
|
+
separatorOrientation = computed(() => (this.isHorizontal() ? 'vertical' : 'horizontal'), ...(ngDevMode ? [{ debugName: "separatorOrientation" }] : /* istanbul ignore next */ []));
|
|
6510
|
+
// ── Keyboard ─────────────────────────────────────────────────
|
|
6511
|
+
onKeydown(event) {
|
|
6512
|
+
if (this.disabled())
|
|
6513
|
+
return;
|
|
6514
|
+
const [less, more] = this.isHorizontal()
|
|
6515
|
+
? ['ArrowLeft', 'ArrowRight']
|
|
6516
|
+
: ['ArrowUp', 'ArrowDown'];
|
|
6517
|
+
switch (event.key) {
|
|
6518
|
+
case less:
|
|
6519
|
+
this.setSize(this.current() - this.step());
|
|
6520
|
+
break;
|
|
6521
|
+
case more:
|
|
6522
|
+
this.setSize(this.current() + this.step());
|
|
6523
|
+
break;
|
|
6524
|
+
case 'Home':
|
|
6525
|
+
this.setSize(this.min());
|
|
6526
|
+
break;
|
|
6527
|
+
case 'End':
|
|
6528
|
+
this.setSize(this.max());
|
|
6529
|
+
break;
|
|
6530
|
+
case 'Enter':
|
|
6531
|
+
this.toggleCollapse();
|
|
6532
|
+
break;
|
|
6533
|
+
default:
|
|
6534
|
+
return;
|
|
6535
|
+
}
|
|
6536
|
+
event.preventDefault();
|
|
6537
|
+
this.resizeEnd.emit(this.current());
|
|
6538
|
+
}
|
|
6539
|
+
/** Collapses the first pane to `min`, or restores the size it had before. */
|
|
6540
|
+
toggleCollapse() {
|
|
6541
|
+
if (this.current() > this.min()) {
|
|
6542
|
+
this.#restoreSize = this.current();
|
|
6543
|
+
this.setSize(this.min());
|
|
6544
|
+
}
|
|
6545
|
+
else {
|
|
6546
|
+
this.setSize(this.#restoreSize ?? 50);
|
|
6547
|
+
this.#restoreSize = null;
|
|
6548
|
+
}
|
|
6549
|
+
}
|
|
6550
|
+
// ── Pointer ──────────────────────────────────────────────────
|
|
6551
|
+
onPointerDown(event) {
|
|
6552
|
+
if (this.disabled() || (event.pointerType === 'mouse' && event.button !== 0))
|
|
6553
|
+
return;
|
|
6554
|
+
event.preventDefault();
|
|
6555
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
6556
|
+
this.#dragging.set(true);
|
|
6557
|
+
}
|
|
6558
|
+
onPointerMove(event) {
|
|
6559
|
+
if (!this.#dragging())
|
|
6560
|
+
return;
|
|
6561
|
+
const handle = event.currentTarget;
|
|
6562
|
+
const rect = this.host.nativeElement.getBoundingClientRect();
|
|
6563
|
+
const horizontal = this.isHorizontal();
|
|
6564
|
+
const handleSize = horizontal ? handle.offsetWidth : handle.offsetHeight;
|
|
6565
|
+
const total = (horizontal ? rect.width : rect.height) - handleSize;
|
|
6566
|
+
if (total <= 0)
|
|
6567
|
+
return;
|
|
6568
|
+
const pos = (horizontal ? event.clientX - rect.left : event.clientY - rect.top) - handleSize / 2;
|
|
6569
|
+
this.setSize(Math.round((pos / total) * 1000) / 10);
|
|
6570
|
+
}
|
|
6571
|
+
onPointerUp(event) {
|
|
6572
|
+
if (!this.#dragging())
|
|
6573
|
+
return;
|
|
6574
|
+
event.currentTarget.releasePointerCapture?.(event.pointerId);
|
|
6575
|
+
this.#dragging.set(false);
|
|
6576
|
+
this.resizeEnd.emit(this.current());
|
|
6577
|
+
}
|
|
6578
|
+
// ── Helpers ──────────────────────────────────────────────────
|
|
6579
|
+
setSize(value) {
|
|
6580
|
+
this.size.set(this.clamp(value));
|
|
6581
|
+
}
|
|
6582
|
+
clamp(value) {
|
|
6583
|
+
return Math.min(Math.max(value, this.min()), this.max());
|
|
6584
|
+
}
|
|
6585
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: SplitterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6586
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.12", type: SplitterComponent, isStandalone: true, selector: "ngx-ds-splitter", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", 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 }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { size: "sizeChange", resizeEnd: "resizeEnd" }, ngImport: i0, template: "<div\n class=\"splitter\"\n [class.splitter--vertical]=\"!isHorizontal()\"\n [class.splitter--dragging]=\"isDragging()\"\n [style.grid-template-columns]=\"isHorizontal() ? template() : null\"\n [style.grid-template-rows]=\"isHorizontal() ? null : template()\"\n>\n <div class=\"splitter__pane\" [id]=\"paneId\">\n <ng-content select=\"[splitter-start]\" />\n </div>\n\n <div\n class=\"splitter__handle\"\n role=\"separator\"\n [attr.tabindex]=\"disabled() ? null : 0\"\n [attr.aria-label]=\"ariaLabel() || i18n.resizePanels\"\n [attr.aria-orientation]=\"separatorOrientation()\"\n [attr.aria-controls]=\"paneId\"\n [attr.aria-valuenow]=\"current()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-disabled]=\"disabled() || null\"\n (keydown)=\"onKeydown($event)\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n >\n <span class=\"splitter__grip\" aria-hidden=\"true\"></span>\n </div>\n\n <div class=\"splitter__pane\">\n <ng-content select=\"[splitter-end]\" />\n </div>\n</div>\n", styles: [":host{display:block;height:100%;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.splitter{display:grid;width:100%;height:100%}.splitter--dragging{cursor:col-resize;-webkit-user-select:none;user-select:none}.splitter--vertical.splitter--dragging{cursor:row-resize}.splitter__pane{min-width:0;min-height:0;overflow:auto}.splitter__handle{position:relative;display:flex;align-items:center;justify-content:center;width:.5rem;cursor:col-resize;touch-action:none}.splitter__handle:before{content:\"\";position:absolute;inset:0 calc(50% - .5px);background:var(--border-base, #e5e7eb);transition:background .15s ease}.splitter__handle:hover:before,.splitter--dragging>.splitter__handle:before{inset:0 calc(50% - 1px);background:var(--primary-500, #6366f1)}.splitter__handle:focus-visible{outline:2px solid var(--primary-500, #6366f1);outline-offset:-2px;border-radius:.25rem}.splitter__handle[aria-disabled=true]{cursor:default}.splitter__handle[aria-disabled=true]:before{background:var(--border-base, #e5e7eb)}.splitter__handle[aria-disabled=true] .splitter__grip{display:none}.splitter__grip{position:relative;width:.25rem;height:1.5rem;background:var(--surface-base, #ffffff);border:1px solid var(--border-strong, #d1d5db);border-radius:9999px}.splitter--vertical .splitter__handle{width:auto;height:.5rem;cursor:row-resize}.splitter--vertical .splitter__handle:before{inset:calc(50% - .5px) 0}.splitter--vertical .splitter__handle:hover:before{inset:calc(50% - 1px) 0}.splitter--vertical.splitter--dragging>.splitter__handle:before{inset:calc(50% - 1px) 0}.splitter--vertical .splitter__grip{width:1.5rem;height:.25rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6587
|
+
}
|
|
6588
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: SplitterComponent, decorators: [{
|
|
6589
|
+
type: Component,
|
|
6590
|
+
args: [{ selector: 'ngx-ds-splitter', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"splitter\"\n [class.splitter--vertical]=\"!isHorizontal()\"\n [class.splitter--dragging]=\"isDragging()\"\n [style.grid-template-columns]=\"isHorizontal() ? template() : null\"\n [style.grid-template-rows]=\"isHorizontal() ? null : template()\"\n>\n <div class=\"splitter__pane\" [id]=\"paneId\">\n <ng-content select=\"[splitter-start]\" />\n </div>\n\n <div\n class=\"splitter__handle\"\n role=\"separator\"\n [attr.tabindex]=\"disabled() ? null : 0\"\n [attr.aria-label]=\"ariaLabel() || i18n.resizePanels\"\n [attr.aria-orientation]=\"separatorOrientation()\"\n [attr.aria-controls]=\"paneId\"\n [attr.aria-valuenow]=\"current()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-disabled]=\"disabled() || null\"\n (keydown)=\"onKeydown($event)\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n >\n <span class=\"splitter__grip\" aria-hidden=\"true\"></span>\n </div>\n\n <div class=\"splitter__pane\">\n <ng-content select=\"[splitter-end]\" />\n </div>\n</div>\n", styles: [":host{display:block;height:100%;font-family:var(--ngx-primary-font-family, \"Poppins\", sans-serif)}.splitter{display:grid;width:100%;height:100%}.splitter--dragging{cursor:col-resize;-webkit-user-select:none;user-select:none}.splitter--vertical.splitter--dragging{cursor:row-resize}.splitter__pane{min-width:0;min-height:0;overflow:auto}.splitter__handle{position:relative;display:flex;align-items:center;justify-content:center;width:.5rem;cursor:col-resize;touch-action:none}.splitter__handle:before{content:\"\";position:absolute;inset:0 calc(50% - .5px);background:var(--border-base, #e5e7eb);transition:background .15s ease}.splitter__handle:hover:before,.splitter--dragging>.splitter__handle:before{inset:0 calc(50% - 1px);background:var(--primary-500, #6366f1)}.splitter__handle:focus-visible{outline:2px solid var(--primary-500, #6366f1);outline-offset:-2px;border-radius:.25rem}.splitter__handle[aria-disabled=true]{cursor:default}.splitter__handle[aria-disabled=true]:before{background:var(--border-base, #e5e7eb)}.splitter__handle[aria-disabled=true] .splitter__grip{display:none}.splitter__grip{position:relative;width:.25rem;height:1.5rem;background:var(--surface-base, #ffffff);border:1px solid var(--border-strong, #d1d5db);border-radius:9999px}.splitter--vertical .splitter__handle{width:auto;height:.5rem;cursor:row-resize}.splitter--vertical .splitter__handle:before{inset:calc(50% - .5px) 0}.splitter--vertical .splitter__handle:hover:before{inset:calc(50% - 1px) 0}.splitter--vertical.splitter--dragging>.splitter__handle:before{inset:calc(50% - 1px) 0}.splitter--vertical .splitter__grip{width:1.5rem;height:.25rem}\n"] }]
|
|
6591
|
+
}], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }, { type: i0.Output, args: ["sizeChange"] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], resizeEnd: [{ type: i0.Output, args: ["resizeEnd"] }] } });
|
|
6592
|
+
|
|
5626
6593
|
// Public API Surface of ngx-ds
|
|
5627
6594
|
// ── Services ────────────────────────────────────────────────
|
|
5628
6595
|
|
|
@@ -5630,5 +6597,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
5630
6597
|
* Generated bundle index. Do not edit.
|
|
5631
6598
|
*/
|
|
5632
6599
|
|
|
5633
|
-
export { ACCORDION_CONTROLLER, AccordionComponent, AccordionItemComponent, AlertComponent, AutocompleteComponent, AvatarComponent, AvatarGroupComponent, BadgeComponent, BreadcrumbComponent, ButtonComponent, ButtonGroupComponent, CalendarComponent, CardComponent, CheckboxComponent, ChipGroupComponent, ColorPickerComponent, CommandPaletteComponent, ConfirmationComponent, ConfirmationService, ContextMenuComponent, DateRangePickerComponent, DatepickerComponent, DividerComponent, DrawerComponent, DropdownComponent, EmptyStateComponent, FileUploadComponent, FocusTrapDirective, FormFieldComponent, IconButtonComponent, IconComponent, InputComponent, KbdComponent, MenuButtonComponent, MenuComponent, ModalComponent, MultiSelectComponent, NGX_DS_LABELS, NGX_DS_LABELS_EN, NGX_DS_LABELS_ES, NGX_DS_LOCALE, NotificationCenterComponent, NotificationItemComponent, NumberInputComponent, OtpInputComponent, PaginationComponent, PasswordStrengthComponent, PopoverComponent, ProgressBarComponent, RadioComponent, RangeSliderComponent, RatingComponent, SearchInputComponent, SegmentedControlComponent, SelectComponent, SidebarComponent, SkeletonComponent, SpinnerComponent, StepComponent, StepperComponent, SwitchComponent, TabComponent, TabContentDirective, TableComponent, TabsComponent, TagComponent, TextareaComponent, TimelineComponent, TimelineItemComponent, ToastComponent, ToastrService, TooltipDirective, TreeNodeComponent, TreeViewComponent, UserMenuComponent, formatDayLabel, monthNames, provideNgxDs, provideNgxDsLabels, provideNgxDsLocale, weekdayNames };
|
|
6600
|
+
export { ACCORDION_CONTROLLER, AccordionComponent, AccordionItemComponent, AlertComponent, AutocompleteComponent, AvatarComponent, AvatarGroupComponent, BadgeComponent, BreadcrumbComponent, ButtonComponent, ButtonGroupComponent, CalendarComponent, CardComponent, CarouselComponent, CheckboxComponent, ChipGroupComponent, ColorPickerComponent, CommandPaletteComponent, ConfirmationComponent, ConfirmationService, ContextMenuComponent, DateRangePickerComponent, DatepickerComponent, DividerComponent, DrawerComponent, DropdownComponent, EmptyStateComponent, FileUploadComponent, FocusTrapDirective, FormFieldComponent, IconButtonComponent, IconComponent, InputComponent, KbdComponent, LightboxComponent, MenuButtonComponent, MenuComponent, ModalComponent, MultiSelectComponent, NGX_DS_LABELS, NGX_DS_LABELS_EN, NGX_DS_LABELS_ES, NGX_DS_LOCALE, NotificationCenterComponent, NotificationItemComponent, NumberInputComponent, OtpInputComponent, PaginationComponent, PasswordStrengthComponent, PopoverComponent, ProgressBarComponent, RadioComponent, RangeSliderComponent, RatingComponent, SearchInputComponent, SegmentedControlComponent, SelectComponent, SidebarComponent, SkeletonComponent, SpinnerComponent, SplitterComponent, StepComponent, StepperComponent, SwitchComponent, TabComponent, TabContentDirective, TableComponent, TabsComponent, TagComponent, TagInputComponent, TextareaComponent, TimePickerComponent, TimelineComponent, TimelineItemComponent, ToastComponent, ToastrService, TooltipDirective, TreeNodeComponent, TreeViewComponent, UserMenuComponent, formatDayLabel, monthNames, parseTime, provideNgxDs, provideNgxDsLabels, provideNgxDsLocale, stepIndex, weekdayNames };
|
|
5634
6601
|
//# sourceMappingURL=jdpo2008-ngx-ds.mjs.map
|