@telcomdev/ui 0.0.5 → 0.0.7
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 +57 -0
- package/fesm2022/telcomdev-ui.mjs +1353 -141
- package/fesm2022/telcomdev-ui.mjs.map +1 -1
- package/package.json +5 -1
- package/types/telcomdev-ui.d.ts +370 -54
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Injectable, inject, HostBinding, Input, ChangeDetectionStrategy, EventEmitter, Output, ViewChild, InjectionToken, HostListener, Directive,
|
|
2
|
+
import { Component, Injectable, inject, HostBinding, Input, ChangeDetectionStrategy, EventEmitter, Output, ViewChild, ChangeDetectorRef, input, output, model, signal, computed, forwardRef, InjectionToken, HostListener, Directive, DestroyRef, TemplateRef, ViewChildren, ContentChildren } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/cdk/scrolling';
|
|
4
4
|
import { ScrollingModule, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
|
+
import { ScrollStrategyOptions, CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
|
|
7
8
|
import { DIALOG_DATA, Dialog } from '@angular/cdk/dialog';
|
|
8
9
|
import { NgComponentOutlet, DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
9
|
-
import { ScrollStrategyOptions, CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
|
|
10
10
|
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
11
11
|
|
|
12
12
|
class TelcomdevUi {
|
|
@@ -468,7 +468,138 @@ const TD_ICONOS = {
|
|
|
468
468
|
path: 'M4 3h16l3 11v7H1v-7L4 3Zm1.5 2L3 14h5l1 2h6l1-2h5l-2.5-9h-13Z',
|
|
469
469
|
},
|
|
470
470
|
pdf: {
|
|
471
|
-
path: 'M6
|
|
471
|
+
path: 'M6.5 2.75h8l4.75 4.75v13.75H6.5a1.75 1.75 0 0 1-1.75-1.75v-15A1.75 1.75 0 0 1 6.5 2.75Zm8 0V7.5h4.75M7.1 20v-6.5m0 1.1c.45-.75 1.25-1.15 2.05-1.05 1.25.15 1.85 1.25 1.7 2.65-.15 1.35-.9 2.2-2.05 2.15-.75-.05-1.35-.4-1.7-.95m7.85-5.9V18.4m0-3.8c-.45-.75-1.25-1.15-2.05-1.05-1.25.15-1.85 1.25-1.7 2.65.15 1.35.9 2.2 2.05 2.15.75-.05 1.35-.4 1.7-.95m2.15 1v-5.65c0-1.15.55-1.75 1.65-1.75.35 0 .65.05.9.15m-2.5 3.05h2.1',
|
|
472
|
+
estilo: 'linea',
|
|
473
|
+
grosor: 1.65,
|
|
474
|
+
},
|
|
475
|
+
save: {
|
|
476
|
+
path: 'M5 3h12l4 4v14H3V5a2 2 0 0 1 2-2Zm1 2a1 1 0 0 0-1 1v13h14V8h-4V5H6Zm2 0v5h7V5H8Zm1 8h6a2 2 0 0 1 2 2v4H7v-4a2 2 0 0 1 2-2Z',
|
|
477
|
+
},
|
|
478
|
+
copy: {
|
|
479
|
+
path: 'M8 3h11a2 2 0 0 1 2 2v11h-2V5H8V3ZM5 7h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2Zm0 2v10h10V9H5Z',
|
|
480
|
+
},
|
|
481
|
+
download: {
|
|
482
|
+
path: 'M11 3h2v10.17l3.59-3.58L18 11l-6 6-6-6 1.41-1.41L11 13.17V3ZM4 19h16v2H4v-2Z',
|
|
483
|
+
},
|
|
484
|
+
upload: {
|
|
485
|
+
path: 'm12 3 6 6-1.41 1.41L13 6.83V17h-2V6.83l-3.59 3.58L6 9l6-6ZM4 19h16v2H4v-2Z',
|
|
486
|
+
},
|
|
487
|
+
print: {
|
|
488
|
+
path: 'M7 3h10v4H7V3Zm10 12v6H7v-6h10Zm2-7a3 3 0 0 1 3 3v6h-3v-4H5v4H2v-6a3 3 0 0 1 3-3h14Zm-4 9H9v2h6v-2Zm4-7a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z',
|
|
489
|
+
},
|
|
490
|
+
excel: {
|
|
491
|
+
path: 'M6.5 2.75h8l4.75 4.75v13.75H6.5a1.75 1.75 0 0 1-1.75-1.75v-15A1.75 1.75 0 0 1 6.5 2.75Zm8 0V7.5h4.75M8 11h8v7.5H8V11Zm0 3.75h8M11.9 11v7.5',
|
|
492
|
+
estilo: 'linea',
|
|
493
|
+
grosor: 1.65,
|
|
494
|
+
},
|
|
495
|
+
xml: {
|
|
496
|
+
path: 'M6.5 2.75h8l4.75 4.75v13.75H6.5a1.75 1.75 0 0 1-1.75-1.75v-15A1.75 1.75 0 0 1 6.5 2.75Zm8 0V7.5h4.75M9.25 12l-2.5 3 2.5 3m5.5-6 2.5 3-2.5 3m-1.5-7-2.5 8',
|
|
497
|
+
estilo: 'linea',
|
|
498
|
+
grosor: 1.65,
|
|
499
|
+
},
|
|
500
|
+
zip: {
|
|
501
|
+
path: 'M6.5 2.75h8l4.75 4.75v13.75H6.5a1.75 1.75 0 0 1-1.75-1.75v-15A1.75 1.75 0 0 1 6.5 2.75Zm8 0V7.5h4.75M10.25 2.75h3.5m-3.5 2.25h3.5m-3.5 2.25h3.5m-3.5 2.25h3.5m-3.5 2.25h3.5M12 11.75v3m-1.75 0h3.5v3.5h-3.5v-3.5Z',
|
|
502
|
+
estilo: 'linea',
|
|
503
|
+
grosor: 1.65,
|
|
504
|
+
},
|
|
505
|
+
file: {
|
|
506
|
+
path: 'M6 2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Zm8 2H6v16h12V8h-4V4Zm2 2 2 2h-2V6Z',
|
|
507
|
+
},
|
|
508
|
+
image: {
|
|
509
|
+
path: 'M4 3h16a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm0 2v14h16V5H4Zm3.5 2A2.5 2.5 0 1 1 5 9.5 2.5 2.5 0 0 1 7.5 7Zm12 10-4.5-5-3.2 3.5-2.3-2.5L4.5 18h15v-1Z',
|
|
510
|
+
},
|
|
511
|
+
calendar: {
|
|
512
|
+
path: 'M7 2h2v2h6V2h2v2h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2V2ZM5 9v11h14V9H5Zm0-3v1h14V6H5Z',
|
|
513
|
+
},
|
|
514
|
+
clock: {
|
|
515
|
+
path: 'M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-1 3h2v4.59l3.2 3.2-1.41 1.42L11 12.41V7Z',
|
|
516
|
+
},
|
|
517
|
+
history: {
|
|
518
|
+
path: 'M12 4a8 8 0 1 1-7.45 5H2l3.5-4L9 9H6.67A6 6 0 1 0 12 6V4Zm-1 3h2v4.59l3.2 3.2-1.41 1.42L11 12.41V7Z',
|
|
519
|
+
},
|
|
520
|
+
filter: {
|
|
521
|
+
path: 'M3 4h18l-7 8v6l-4 2v-8L3 4Zm4.41 2L12 11.25 16.59 6H7.41Z',
|
|
522
|
+
},
|
|
523
|
+
refresh: {
|
|
524
|
+
path: 'M17.65 6.35A7.95 7.95 0 0 0 12 4a8 8 0 1 0 7.75 10h-2.08A6 6 0 1 1 16.2 7.8L13 11h8V3l-3.35 3.35Z',
|
|
525
|
+
},
|
|
526
|
+
sort: {
|
|
527
|
+
path: 'M7 3 3 7h3v11H3l4 4 4-4H8V7h3L7 3Zm10 0-4 4h3v11h-3l4 4 4-4h-3V7h3l-4-4Z',
|
|
528
|
+
},
|
|
529
|
+
more_vertical: {
|
|
530
|
+
path: 'M12 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 6a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 6a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z',
|
|
531
|
+
},
|
|
532
|
+
more_horizontal: {
|
|
533
|
+
path: 'M8 12a2 2 0 1 0-4 0 2 2 0 0 0 4 0Zm6 0a2 2 0 1 0-4 0 2 2 0 0 0 4 0Zm6 0a2 2 0 1 0-4 0 2 2 0 0 0 4 0Z',
|
|
534
|
+
},
|
|
535
|
+
arrow_back: {
|
|
536
|
+
path: 'm11 5-7 7 7 7 1.41-1.41L7.83 13H21v-2H7.83l4.58-4.59L11 5Z',
|
|
537
|
+
},
|
|
538
|
+
arrow_forward: {
|
|
539
|
+
path: 'm13 5-1.41 1.41L16.17 11H3v2h13.17l-4.58 4.59L13 19l7-7-7-7Z',
|
|
540
|
+
},
|
|
541
|
+
login: {
|
|
542
|
+
path: 'M4 3h9a2 2 0 0 1 2 2v4h-2V5H4v14h9v-4h2v4a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm13 5 4 4-4 4v-3H8v-2h9V8Z',
|
|
543
|
+
},
|
|
544
|
+
logout: {
|
|
545
|
+
path: 'M4 3h9a2 2 0 0 1 2 2v4h-2V5H4v14h9v-4h2v4a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm13 5 4 4-4 4v-3H8v-2h9V8Z',
|
|
546
|
+
},
|
|
547
|
+
lock: {
|
|
548
|
+
path: 'M7 10V7a5 5 0 0 1 10 0v3h1a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h1Zm2 0h6V7a3 3 0 0 0-6 0v3Zm3 4a2 2 0 0 0-1 3.73V19h2v-1.27A2 2 0 0 0 12 14Z',
|
|
549
|
+
},
|
|
550
|
+
lock_open: {
|
|
551
|
+
path: 'M7 10V7a5 5 0 0 1 9.9-1H14.8A3 3 0 0 0 9 7v3h9a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h1Zm5 4a2 2 0 0 0-1 3.73V19h2v-1.27A2 2 0 0 0 12 14Z',
|
|
552
|
+
},
|
|
553
|
+
mail: {
|
|
554
|
+
path: 'M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm0 3.24V18h16V7.24l-8 5-8-5ZM18.53 6H5.47L12 10.08 18.53 6Z',
|
|
555
|
+
},
|
|
556
|
+
phone: {
|
|
557
|
+
path: 'M6.62 2.5 10 6.2 7.9 8.3a15.5 15.5 0 0 0 7.8 7.8l2.1-2.1 3.7 3.38V20a2 2 0 0 1-2 2C9.84 22 2 14.16 2 4.5a2 2 0 0 1 2-2h2.62Z',
|
|
558
|
+
},
|
|
559
|
+
send: {
|
|
560
|
+
path: 'm3 3 19 9-19 9 2-7 10-2-10-2-2-7Zm3.62 5.55.57 2L12 12l-4.81 1.45-.57 2L17.53 12 6.62 8.55Z',
|
|
561
|
+
},
|
|
562
|
+
location: {
|
|
563
|
+
path: 'M12 2a8 8 0 0 1 8 8c0 5.5-8 12-8 12S4 15.5 4 10a8 8 0 0 1 8-8Zm0 2a6 6 0 0 0-6 6c0 3.55 3.92 7.68 6 9.65 2.08-1.97 6-6.1 6-9.65a6 6 0 0 0-6-6Zm0 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6Z',
|
|
564
|
+
},
|
|
565
|
+
language: {
|
|
566
|
+
path: 'M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm6.92 6h-3.08a15.7 15.7 0 0 0-1.38-3.18A8.05 8.05 0 0 1 18.92 8ZM12 4c-.83 1.2-1.5 2.53-1.84 4h3.68A13.7 13.7 0 0 0 12 4ZM9.54 4.82A15.7 15.7 0 0 0 8.16 8H5.08a8.05 8.05 0 0 1 4.46-3.18ZM4.26 10A8.3 8.3 0 0 0 4 12c0 .69.09 1.36.26 2h3.55a17 17 0 0 1 0-4H4.26Zm5.57 0a14.6 14.6 0 0 0 0 4h4.34a14.6 14.6 0 0 0 0-4H9.83Zm6.36 0a17 17 0 0 1 0 4h3.55A8.3 8.3 0 0 0 20 12c0-.69-.09-1.36-.26-2h-3.55ZM5.08 16h3.08c.3 1.14.77 2.2 1.38 3.18A8.05 8.05 0 0 1 5.08 16Zm5.08 0c.34 1.47 1.01 2.8 1.84 4 .83-1.2 1.5-2.53 1.84-4h-3.68Zm4.3 3.18A15.7 15.7 0 0 0 15.84 16h3.08a8.05 8.05 0 0 1-4.46 3.18Z',
|
|
567
|
+
},
|
|
568
|
+
info: {
|
|
569
|
+
path: 'M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-1 6h2v7h-2v-7Zm0-3h2v2h-2V7Z',
|
|
570
|
+
},
|
|
571
|
+
warning: {
|
|
572
|
+
path: 'M12 2 1 21h22L12 2Zm0 4.03L19.53 19H4.47L12 6.03ZM11 10v5h2v-5h-2Zm0 6v2h2v-2h-2Z',
|
|
573
|
+
},
|
|
574
|
+
error: {
|
|
575
|
+
path: 'M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-1 3h2v7h-2V7Zm0 9h2v2h-2v-2Z',
|
|
576
|
+
},
|
|
577
|
+
check_circle: {
|
|
578
|
+
path: 'M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-1.5 11.5-3-3 1.41-1.41 1.59 1.58 4.59-4.58 1.41 1.41-6 6Z',
|
|
579
|
+
},
|
|
580
|
+
cancel: {
|
|
581
|
+
path: 'M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-3.3 3.3L12 10.59l3.3-3.3 1.4 1.42-3.29 3.29 3.3 3.3-1.42 1.4L12 13.41l-3.3 3.3-1.4-1.42 3.29-3.29-3.3-3.3L8.7 7.3Z',
|
|
582
|
+
},
|
|
583
|
+
star: {
|
|
584
|
+
path: 'm12 2.5 2.94 5.96 6.58.96-4.76 4.64 1.12 6.56L12 17.53l-5.88 3.09 1.12-6.56-4.76-4.64 6.58-.96L12 2.5Z',
|
|
585
|
+
},
|
|
586
|
+
favorite: {
|
|
587
|
+
path: 'M12 21s-9-5.4-9-12a5 5 0 0 1 9-3 5 5 0 0 1 9 3c0 6.6-9 12-9 12Z',
|
|
588
|
+
},
|
|
589
|
+
database: {
|
|
590
|
+
path: 'M12 2C6.48 2 2 3.79 2 6v12c0 2.21 4.48 4 10 4s10-1.79 10-4V6c0-2.21-4.48-4-10-4Zm0 2c4.42 0 8 1.12 8 2s-3.58 2-8 2-8-1.12-8-2 3.58-2 8-2ZM4 9.2c1.83.82 4.69 1.3 8 1.3s6.17-.48 8-1.3V12c0 .88-3.58 2-8 2s-8-1.12-8-2V9.2Zm0 6c1.83.82 4.69 1.3 8 1.3s6.17-.48 8-1.3V18c0 .88-3.58 2-8 2s-8-1.12-8-2v-2.8Z',
|
|
591
|
+
},
|
|
592
|
+
cloud: {
|
|
593
|
+
path: 'M7.5 20A5.5 5.5 0 0 1 6.3 9.13 7 7 0 0 1 19 11.5h.5a4.25 4.25 0 0 1 0 8.5h-12Zm0-2h12a2.25 2.25 0 0 0 0-4.5h-2.4l-.05-1.2A5 5 0 0 0 7.9 10.1l-.42 1.05-1.12.17A3.5 3.5 0 0 0 7.5 18Z',
|
|
594
|
+
},
|
|
595
|
+
camera: {
|
|
596
|
+
path: 'M8 4h8l1.5 2H21a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3.5L8 4Zm4 4a5 5 0 1 0 0 10 5 5 0 0 0 0-10Zm0 2a3 3 0 1 1 0 6 3 3 0 0 1 0-6Z',
|
|
597
|
+
},
|
|
598
|
+
link: {
|
|
599
|
+
path: 'M10.59 13.41a2 2 0 0 0 2.82 0l3-3a2 2 0 0 0-2.82-2.82l-1.3 1.29-1.41-1.41 1.3-1.3a4 4 0 1 1 5.65 5.66l-3 3a4 4 0 0 1-5.66 0l-.7-.71 1.41-1.41.71.7Zm2.82-2.82a2 2 0 0 0-2.82 0l-3 3a2 2 0 0 0 2.82 2.82l1.3-1.29 1.41 1.41-1.3 1.3a4 4 0 1 1-5.65-5.66l3-3a4 4 0 0 1 5.66 0l.7.71-1.41 1.41-.71-.7Z',
|
|
600
|
+
},
|
|
601
|
+
external_link: {
|
|
602
|
+
path: 'M14 3h7v7h-2V6.41l-8.29 8.3-1.42-1.42L17.59 5H14V3ZM5 5h6v2H5v12h12v-6h2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Z',
|
|
472
603
|
},
|
|
473
604
|
};
|
|
474
605
|
const TD_ICONOS_NOMBRES = Object.freeze(Object.keys(TD_ICONOS));
|
|
@@ -526,9 +657,16 @@ class TdIcon {
|
|
|
526
657
|
[attr.role]="titulo ? 'img' : null"
|
|
527
658
|
focusable="false"
|
|
528
659
|
>
|
|
529
|
-
<path
|
|
660
|
+
<path
|
|
661
|
+
[attr.d]="definicion().path"
|
|
662
|
+
[attr.fill]="definicion().estilo === 'linea' ? 'none' : 'currentColor'"
|
|
663
|
+
[attr.stroke]="definicion().estilo === 'linea' ? 'currentColor' : 'none'"
|
|
664
|
+
[attr.stroke-width]="definicion().grosor || null"
|
|
665
|
+
[attr.stroke-linecap]="definicion().estilo === 'linea' ? 'round' : null"
|
|
666
|
+
[attr.stroke-linejoin]="definicion().estilo === 'linea' ? 'round' : null"
|
|
667
|
+
/>
|
|
530
668
|
</svg>
|
|
531
|
-
`, isInline: true, styles: [":host{display:inline-flex;width:var(--td-icon-size, 1.25rem);height:var(--td-icon-size, 1.25rem);flex:0 0 auto;color:inherit;line-height:0;vertical-align:middle}svg{width:100%;height:100
|
|
669
|
+
`, isInline: true, styles: [":host{display:inline-flex;width:var(--td-icon-size, 1.25rem);height:var(--td-icon-size, 1.25rem);flex:0 0 auto;color:inherit;line-height:0;vertical-align:middle}svg{width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
532
670
|
}
|
|
533
671
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdIcon, decorators: [{
|
|
534
672
|
type: Component,
|
|
@@ -540,9 +678,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
540
678
|
[attr.role]="titulo ? 'img' : null"
|
|
541
679
|
focusable="false"
|
|
542
680
|
>
|
|
543
|
-
<path
|
|
681
|
+
<path
|
|
682
|
+
[attr.d]="definicion().path"
|
|
683
|
+
[attr.fill]="definicion().estilo === 'linea' ? 'none' : 'currentColor'"
|
|
684
|
+
[attr.stroke]="definicion().estilo === 'linea' ? 'currentColor' : 'none'"
|
|
685
|
+
[attr.stroke-width]="definicion().grosor || null"
|
|
686
|
+
[attr.stroke-linecap]="definicion().estilo === 'linea' ? 'round' : null"
|
|
687
|
+
[attr.stroke-linejoin]="definicion().estilo === 'linea' ? 'round' : null"
|
|
688
|
+
/>
|
|
544
689
|
</svg>
|
|
545
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;width:var(--td-icon-size, 1.25rem);height:var(--td-icon-size, 1.25rem);flex:0 0 auto;color:inherit;line-height:0;vertical-align:middle}svg{width:100%;height:100
|
|
690
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline-flex;width:var(--td-icon-size, 1.25rem);height:var(--td-icon-size, 1.25rem);flex:0 0 auto;color:inherit;line-height:0;vertical-align:middle}svg{width:100%;height:100%}\n"] }]
|
|
546
691
|
}], propDecorators: { nombre: [{
|
|
547
692
|
type: Input
|
|
548
693
|
}], titulo: [{
|
|
@@ -718,6 +863,742 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
718
863
|
type: Output
|
|
719
864
|
}] } });
|
|
720
865
|
|
|
866
|
+
let datePickerSequence = 0;
|
|
867
|
+
class TdDatePicker {
|
|
868
|
+
cdr = inject(ChangeDetectorRef);
|
|
869
|
+
scrollStrategies = inject(ScrollStrategyOptions);
|
|
870
|
+
generatedId = `td-date-picker-${++datePickerSequence}`;
|
|
871
|
+
formatter = new Intl.DateTimeFormat('es-PE', {
|
|
872
|
+
day: '2-digit',
|
|
873
|
+
month: 'short',
|
|
874
|
+
year: 'numeric',
|
|
875
|
+
});
|
|
876
|
+
monthFormatter = new Intl.DateTimeFormat('es-PE', {
|
|
877
|
+
month: 'long',
|
|
878
|
+
year: 'numeric',
|
|
879
|
+
});
|
|
880
|
+
longFormatter = new Intl.DateTimeFormat('es-PE', {
|
|
881
|
+
weekday: 'long',
|
|
882
|
+
day: 'numeric',
|
|
883
|
+
month: 'long',
|
|
884
|
+
year: 'numeric',
|
|
885
|
+
});
|
|
886
|
+
label = 'Fecha';
|
|
887
|
+
placeholder = 'Selecciona una fecha';
|
|
888
|
+
mode = 'fecha';
|
|
889
|
+
hint = '';
|
|
890
|
+
error = '';
|
|
891
|
+
minDate = null;
|
|
892
|
+
maxDate = null;
|
|
893
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
894
|
+
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
895
|
+
invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
896
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
897
|
+
touch = output();
|
|
898
|
+
clearable = true;
|
|
899
|
+
dark = false;
|
|
900
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
901
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
902
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
903
|
+
displayError = computed(() => this.error || this.errors()[0]?.message || '', ...(ngDevMode ? [{ debugName: "displayError" }] : /* istanbul ignore next */ []));
|
|
904
|
+
hasError = computed(() => this.invalid() || !!this.displayError(), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
905
|
+
selectionChange = new EventEmitter();
|
|
906
|
+
openedChange = new EventEmitter();
|
|
907
|
+
open = false;
|
|
908
|
+
hoveredDate = null;
|
|
909
|
+
viewDate = this.startOfMonth(new Date());
|
|
910
|
+
calendarView = 'dias';
|
|
911
|
+
currentYear = new Date().getFullYear();
|
|
912
|
+
scrollStrategy = this.scrollStrategies.reposition();
|
|
913
|
+
get labelId() {
|
|
914
|
+
return `${this.generatedId}-label`;
|
|
915
|
+
}
|
|
916
|
+
get calendarId() {
|
|
917
|
+
return `${this.generatedId}-calendar`;
|
|
918
|
+
}
|
|
919
|
+
get weekdays() {
|
|
920
|
+
return ['L', 'M', 'X', 'J', 'V', 'S', 'D'];
|
|
921
|
+
}
|
|
922
|
+
get monthLabel() {
|
|
923
|
+
const label = this.monthFormatter.format(this.viewDate);
|
|
924
|
+
return label.charAt(0).toUpperCase() + label.slice(1);
|
|
925
|
+
}
|
|
926
|
+
get periodLabel() {
|
|
927
|
+
if (this.calendarView === 'dias')
|
|
928
|
+
return this.monthLabel;
|
|
929
|
+
if (this.calendarView === 'meses')
|
|
930
|
+
return String(this.viewDate.getFullYear());
|
|
931
|
+
return `${this.yearPageStart} – ${this.yearPageStart + 11}`;
|
|
932
|
+
}
|
|
933
|
+
get periodButtonLabel() {
|
|
934
|
+
if (this.calendarView === 'dias')
|
|
935
|
+
return 'Elegir mes y año';
|
|
936
|
+
if (this.calendarView === 'meses')
|
|
937
|
+
return 'Elegir año';
|
|
938
|
+
return 'Periodo de años';
|
|
939
|
+
}
|
|
940
|
+
get previousLabel() {
|
|
941
|
+
return this.calendarView === 'dias'
|
|
942
|
+
? 'Mes anterior'
|
|
943
|
+
: this.calendarView === 'meses'
|
|
944
|
+
? 'Año anterior'
|
|
945
|
+
: 'Años anteriores';
|
|
946
|
+
}
|
|
947
|
+
get nextLabel() {
|
|
948
|
+
return this.calendarView === 'dias'
|
|
949
|
+
? 'Mes siguiente'
|
|
950
|
+
: this.calendarView === 'meses'
|
|
951
|
+
? 'Año siguiente'
|
|
952
|
+
: 'Años siguientes';
|
|
953
|
+
}
|
|
954
|
+
get months() {
|
|
955
|
+
const formatter = new Intl.DateTimeFormat('es-PE', { month: 'short' });
|
|
956
|
+
const year = this.viewDate.getFullYear();
|
|
957
|
+
return Array.from({ length: 12 }, (_, index) => {
|
|
958
|
+
const label = formatter.format(new Date(year, index, 1)).replace('.', '');
|
|
959
|
+
return {
|
|
960
|
+
index,
|
|
961
|
+
label: label.charAt(0).toUpperCase() + label.slice(1),
|
|
962
|
+
disabled: !this.monthIntersectsLimits(year, index),
|
|
963
|
+
};
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
get years() {
|
|
967
|
+
return Array.from({ length: 12 }, (_, index) => {
|
|
968
|
+
const value = this.yearPageStart + index;
|
|
969
|
+
return { value, disabled: !this.yearIntersectsLimits(value) };
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
get yearPageStart() {
|
|
973
|
+
return Math.floor(this.viewDate.getFullYear() / 12) * 12;
|
|
974
|
+
}
|
|
975
|
+
get days() {
|
|
976
|
+
const first = this.startOfMonth(this.viewDate);
|
|
977
|
+
const mondayOffset = (first.getDay() + 6) % 7;
|
|
978
|
+
const start = new Date(first.getFullYear(), first.getMonth(), 1 - mondayOffset);
|
|
979
|
+
return Array.from({ length: 42 }, (_, index) => {
|
|
980
|
+
const date = new Date(start.getFullYear(), start.getMonth(), start.getDate() + index);
|
|
981
|
+
const iso = this.toIso(date);
|
|
982
|
+
return {
|
|
983
|
+
iso,
|
|
984
|
+
day: date.getDate(),
|
|
985
|
+
currentMonth: date.getMonth() === this.viewDate.getMonth(),
|
|
986
|
+
today: iso === this.toIso(new Date()),
|
|
987
|
+
disabled: (typeof this.minDate === 'string' && iso < this.minDate) ||
|
|
988
|
+
(typeof this.maxDate === 'string' && iso > this.maxDate),
|
|
989
|
+
};
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
get displayValue() {
|
|
993
|
+
const current = this.value();
|
|
994
|
+
if (typeof current === 'string')
|
|
995
|
+
return this.format(current);
|
|
996
|
+
if (current && typeof current === 'object') {
|
|
997
|
+
return current.fin
|
|
998
|
+
? `${this.format(current.inicio)} — ${this.format(current.fin)}`
|
|
999
|
+
: this.format(current.inicio);
|
|
1000
|
+
}
|
|
1001
|
+
return '';
|
|
1002
|
+
}
|
|
1003
|
+
get rangeStartLabel() {
|
|
1004
|
+
return this.currentRange()?.inicio ? this.format(this.currentRange().inicio) : 'Sin elegir';
|
|
1005
|
+
}
|
|
1006
|
+
get rangeEndLabel() {
|
|
1007
|
+
return this.currentRange()?.fin ? this.format(this.currentRange().fin) : 'Sin elegir';
|
|
1008
|
+
}
|
|
1009
|
+
changed = () => undefined;
|
|
1010
|
+
onCvaTouched = () => undefined;
|
|
1011
|
+
writeValue(value) {
|
|
1012
|
+
this.value.set(this.normalizeValue(value));
|
|
1013
|
+
this.syncViewToValue();
|
|
1014
|
+
this.cdr.markForCheck();
|
|
1015
|
+
}
|
|
1016
|
+
registerOnChange(fn) {
|
|
1017
|
+
this.changed = fn;
|
|
1018
|
+
}
|
|
1019
|
+
registerOnTouched(fn) {
|
|
1020
|
+
this.onCvaTouched = fn;
|
|
1021
|
+
}
|
|
1022
|
+
setDisabledState(disabled) {
|
|
1023
|
+
this.cvaDisabled.set(disabled);
|
|
1024
|
+
this.cdr.markForCheck();
|
|
1025
|
+
}
|
|
1026
|
+
focus() {
|
|
1027
|
+
document.getElementById(this.labelId)?.parentElement?.querySelector('button')?.focus();
|
|
1028
|
+
}
|
|
1029
|
+
toggle() {
|
|
1030
|
+
if (this.isDisabled() || this.readonly())
|
|
1031
|
+
return;
|
|
1032
|
+
this.open ? this.close() : this.openPanel();
|
|
1033
|
+
}
|
|
1034
|
+
openPanel() {
|
|
1035
|
+
if (this.isDisabled() || this.readonly())
|
|
1036
|
+
return;
|
|
1037
|
+
this.syncViewToValue();
|
|
1038
|
+
this.calendarView = 'dias';
|
|
1039
|
+
this.open = true;
|
|
1040
|
+
this.openedChange.emit(true);
|
|
1041
|
+
}
|
|
1042
|
+
close() {
|
|
1043
|
+
if (!this.open)
|
|
1044
|
+
return;
|
|
1045
|
+
this.open = false;
|
|
1046
|
+
this.hoveredDate = null;
|
|
1047
|
+
this.onCvaTouched();
|
|
1048
|
+
this.touch.emit();
|
|
1049
|
+
this.openedChange.emit(false);
|
|
1050
|
+
}
|
|
1051
|
+
previousPage() {
|
|
1052
|
+
if (this.calendarView === 'dias') {
|
|
1053
|
+
this.viewDate = new Date(this.viewDate.getFullYear(), this.viewDate.getMonth() - 1, 1);
|
|
1054
|
+
}
|
|
1055
|
+
else if (this.calendarView === 'meses') {
|
|
1056
|
+
this.viewDate = new Date(this.viewDate.getFullYear() - 1, this.viewDate.getMonth(), 1);
|
|
1057
|
+
}
|
|
1058
|
+
else {
|
|
1059
|
+
this.viewDate = new Date(this.viewDate.getFullYear() - 12, this.viewDate.getMonth(), 1);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
nextPage() {
|
|
1063
|
+
if (this.calendarView === 'dias') {
|
|
1064
|
+
this.viewDate = new Date(this.viewDate.getFullYear(), this.viewDate.getMonth() + 1, 1);
|
|
1065
|
+
}
|
|
1066
|
+
else if (this.calendarView === 'meses') {
|
|
1067
|
+
this.viewDate = new Date(this.viewDate.getFullYear() + 1, this.viewDate.getMonth(), 1);
|
|
1068
|
+
}
|
|
1069
|
+
else {
|
|
1070
|
+
this.viewDate = new Date(this.viewDate.getFullYear() + 12, this.viewDate.getMonth(), 1);
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
changeCalendarView() {
|
|
1074
|
+
if (this.calendarView === 'dias') {
|
|
1075
|
+
this.calendarView = 'meses';
|
|
1076
|
+
}
|
|
1077
|
+
else if (this.calendarView === 'meses') {
|
|
1078
|
+
this.calendarView = 'anios';
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
selectMonth(month) {
|
|
1082
|
+
this.viewDate = new Date(this.viewDate.getFullYear(), month, 1);
|
|
1083
|
+
this.calendarView = 'dias';
|
|
1084
|
+
}
|
|
1085
|
+
selectYear(year) {
|
|
1086
|
+
this.viewDate = new Date(year, this.viewDate.getMonth(), 1);
|
|
1087
|
+
this.calendarView = 'meses';
|
|
1088
|
+
}
|
|
1089
|
+
goToday() {
|
|
1090
|
+
const today = this.toIso(new Date());
|
|
1091
|
+
if ((typeof this.minDate === 'string' && today < this.minDate) ||
|
|
1092
|
+
(typeof this.maxDate === 'string' && today > this.maxDate))
|
|
1093
|
+
return;
|
|
1094
|
+
this.viewDate = this.startOfMonth(new Date());
|
|
1095
|
+
this.calendarView = 'dias';
|
|
1096
|
+
this.selectDate(this.days.find((day) => day.iso === today) ?? {
|
|
1097
|
+
iso: today,
|
|
1098
|
+
day: new Date().getDate(),
|
|
1099
|
+
currentMonth: true,
|
|
1100
|
+
today: true,
|
|
1101
|
+
disabled: false,
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1104
|
+
selectDate(date) {
|
|
1105
|
+
if (date.disabled)
|
|
1106
|
+
return;
|
|
1107
|
+
if (!date.currentMonth) {
|
|
1108
|
+
const parsed = this.fromIso(date.iso);
|
|
1109
|
+
this.viewDate = this.startOfMonth(parsed);
|
|
1110
|
+
}
|
|
1111
|
+
if (this.mode === 'fecha') {
|
|
1112
|
+
this.setValue(date.iso);
|
|
1113
|
+
this.close();
|
|
1114
|
+
return;
|
|
1115
|
+
}
|
|
1116
|
+
const range = this.currentRange();
|
|
1117
|
+
if (!range || range.fin) {
|
|
1118
|
+
this.setValue({ inicio: date.iso, fin: null });
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
this.setValue(date.iso < range.inicio
|
|
1122
|
+
? { inicio: date.iso, fin: range.inicio }
|
|
1123
|
+
: { inicio: range.inicio, fin: date.iso });
|
|
1124
|
+
this.close();
|
|
1125
|
+
}
|
|
1126
|
+
clear(event) {
|
|
1127
|
+
event.stopPropagation();
|
|
1128
|
+
this.setValue(null);
|
|
1129
|
+
}
|
|
1130
|
+
isSelected(iso) {
|
|
1131
|
+
const current = this.value();
|
|
1132
|
+
if (typeof current === 'string')
|
|
1133
|
+
return current === iso;
|
|
1134
|
+
return !!current && (current.inicio === iso || current.fin === iso);
|
|
1135
|
+
}
|
|
1136
|
+
isRangeStart(iso) {
|
|
1137
|
+
return this.currentRange()?.inicio === iso;
|
|
1138
|
+
}
|
|
1139
|
+
isRangeEnd(iso) {
|
|
1140
|
+
return this.currentRange()?.fin === iso;
|
|
1141
|
+
}
|
|
1142
|
+
isInRange(iso) {
|
|
1143
|
+
const range = this.currentRange();
|
|
1144
|
+
if (!range)
|
|
1145
|
+
return false;
|
|
1146
|
+
const end = range.fin ?? this.hoveredDate;
|
|
1147
|
+
if (!end)
|
|
1148
|
+
return false;
|
|
1149
|
+
const start = end < range.inicio ? end : range.inicio;
|
|
1150
|
+
const finish = end < range.inicio ? range.inicio : end;
|
|
1151
|
+
return iso > start && iso < finish;
|
|
1152
|
+
}
|
|
1153
|
+
formatLong(iso) {
|
|
1154
|
+
return this.longFormatter.format(this.fromIso(iso));
|
|
1155
|
+
}
|
|
1156
|
+
handleTriggerKeydown(event) {
|
|
1157
|
+
if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') {
|
|
1158
|
+
event.preventDefault();
|
|
1159
|
+
this.openPanel();
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
handleOverlayKeydown(event) {
|
|
1163
|
+
if (event.key === 'Escape') {
|
|
1164
|
+
event.preventDefault();
|
|
1165
|
+
this.close();
|
|
1166
|
+
}
|
|
1167
|
+
else if (event.key === 'PageUp') {
|
|
1168
|
+
event.preventDefault();
|
|
1169
|
+
this.previousPage();
|
|
1170
|
+
}
|
|
1171
|
+
else if (event.key === 'PageDown') {
|
|
1172
|
+
event.preventDefault();
|
|
1173
|
+
this.nextPage();
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
currentRange() {
|
|
1177
|
+
const current = this.value();
|
|
1178
|
+
return current && typeof current === 'object' ? current : null;
|
|
1179
|
+
}
|
|
1180
|
+
setValue(value) {
|
|
1181
|
+
this.value.set(value);
|
|
1182
|
+
this.changed(value);
|
|
1183
|
+
this.selectionChange.emit(value);
|
|
1184
|
+
}
|
|
1185
|
+
syncViewToValue() {
|
|
1186
|
+
const current = this.value();
|
|
1187
|
+
const iso = typeof current === 'string' ? current : current?.inicio;
|
|
1188
|
+
if (iso)
|
|
1189
|
+
this.viewDate = this.startOfMonth(this.fromIso(iso));
|
|
1190
|
+
}
|
|
1191
|
+
normalizeValue(value) {
|
|
1192
|
+
if (!value)
|
|
1193
|
+
return null;
|
|
1194
|
+
if (typeof value === 'string')
|
|
1195
|
+
return value;
|
|
1196
|
+
return { inicio: value.inicio, fin: value.fin ?? null };
|
|
1197
|
+
}
|
|
1198
|
+
format(iso) {
|
|
1199
|
+
return this.formatter.format(this.fromIso(iso)).replace('.', '');
|
|
1200
|
+
}
|
|
1201
|
+
fromIso(iso) {
|
|
1202
|
+
const [year, month, day] = iso.split('-').map(Number);
|
|
1203
|
+
return new Date(year, month - 1, day);
|
|
1204
|
+
}
|
|
1205
|
+
toIso(date) {
|
|
1206
|
+
const year = date.getFullYear();
|
|
1207
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
1208
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
1209
|
+
return `${year}-${month}-${day}`;
|
|
1210
|
+
}
|
|
1211
|
+
startOfMonth(date) {
|
|
1212
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
1213
|
+
}
|
|
1214
|
+
monthIntersectsLimits(year, month) {
|
|
1215
|
+
const first = this.toIso(new Date(year, month, 1));
|
|
1216
|
+
const last = this.toIso(new Date(year, month + 1, 0));
|
|
1217
|
+
return !((typeof this.minDate === 'string' && last < this.minDate) ||
|
|
1218
|
+
(typeof this.maxDate === 'string' && first > this.maxDate));
|
|
1219
|
+
}
|
|
1220
|
+
yearIntersectsLimits(year) {
|
|
1221
|
+
const first = `${year}-01-01`;
|
|
1222
|
+
const last = `${year}-12-31`;
|
|
1223
|
+
return !((typeof this.minDate === 'string' && last < this.minDate) ||
|
|
1224
|
+
(typeof this.maxDate === 'string' && first > this.maxDate));
|
|
1225
|
+
}
|
|
1226
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdDatePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1227
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdDatePicker, isStandalone: true, selector: "td-date-picker", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: false, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: false, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: false, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "min", isSignal: false, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "max", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, dark: { classPropertyName: "dark", publicName: "dark", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch", value: "valueChange", selectionChange: "selectionChange", openedChange: "openedChange" }, providers: [
|
|
1228
|
+
{
|
|
1229
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1230
|
+
useExisting: forwardRef(() => TdDatePicker),
|
|
1231
|
+
multi: true,
|
|
1232
|
+
},
|
|
1233
|
+
], ngImport: i0, template: `
|
|
1234
|
+
<div
|
|
1235
|
+
cdkOverlayOrigin
|
|
1236
|
+
#origin="cdkOverlayOrigin"
|
|
1237
|
+
class="td-date-picker"
|
|
1238
|
+
[class.td-date-picker--open]="open"
|
|
1239
|
+
[class.td-date-picker--error]="hasError()"
|
|
1240
|
+
[class.td-date-picker--disabled]="isDisabled()"
|
|
1241
|
+
[class.td-date-picker--dark]="dark"
|
|
1242
|
+
>
|
|
1243
|
+
<label [id]="labelId">{{ label }}</label>
|
|
1244
|
+
<button
|
|
1245
|
+
type="button"
|
|
1246
|
+
class="td-date-picker__trigger"
|
|
1247
|
+
[disabled]="isDisabled()"
|
|
1248
|
+
[attr.aria-labelledby]="labelId"
|
|
1249
|
+
[attr.aria-expanded]="open"
|
|
1250
|
+
[attr.aria-controls]="calendarId"
|
|
1251
|
+
(click)="toggle()"
|
|
1252
|
+
(keydown)="handleTriggerKeydown($event)"
|
|
1253
|
+
>
|
|
1254
|
+
<td-icon nombre="calendar" />
|
|
1255
|
+
<span [class.td-date-picker__placeholder]="!displayValue">
|
|
1256
|
+
{{ displayValue || placeholder }}
|
|
1257
|
+
</span>
|
|
1258
|
+
@if (clearable && value() && !isDisabled() && !readonly()) {
|
|
1259
|
+
<span
|
|
1260
|
+
class="td-date-picker__clear"
|
|
1261
|
+
role="button"
|
|
1262
|
+
tabindex="-1"
|
|
1263
|
+
aria-label="Limpiar fecha"
|
|
1264
|
+
(click)="clear($event)"
|
|
1265
|
+
>
|
|
1266
|
+
<td-icon nombre="close" tamano=".92rem" />
|
|
1267
|
+
</span>
|
|
1268
|
+
}
|
|
1269
|
+
<td-icon
|
|
1270
|
+
class="td-date-picker__chevron"
|
|
1271
|
+
[class.td-date-picker__chevron--open]="open"
|
|
1272
|
+
nombre="chevron_down"
|
|
1273
|
+
/>
|
|
1274
|
+
</button>
|
|
1275
|
+
</div>
|
|
1276
|
+
|
|
1277
|
+
@if (displayError() || hint) {
|
|
1278
|
+
<p class="td-date-picker__message" [class.td-date-picker__message--error]="hasError()">
|
|
1279
|
+
{{ displayError() || hint }}
|
|
1280
|
+
</p>
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
<ng-template
|
|
1284
|
+
cdkConnectedOverlay
|
|
1285
|
+
[cdkConnectedOverlayOrigin]="origin"
|
|
1286
|
+
[cdkConnectedOverlayOpen]="open"
|
|
1287
|
+
[cdkConnectedOverlayScrollStrategy]="scrollStrategy"
|
|
1288
|
+
[cdkConnectedOverlayMatchWidth]="false"
|
|
1289
|
+
[cdkConnectedOverlayViewportMargin]="8"
|
|
1290
|
+
[cdkConnectedOverlayPush]="true"
|
|
1291
|
+
(overlayOutsideClick)="close()"
|
|
1292
|
+
(overlayKeydown)="handleOverlayKeydown($event)"
|
|
1293
|
+
(detach)="close()"
|
|
1294
|
+
>
|
|
1295
|
+
<section
|
|
1296
|
+
class="td-calendar"
|
|
1297
|
+
[class.td-calendar--dark]="dark"
|
|
1298
|
+
[id]="calendarId"
|
|
1299
|
+
role="dialog"
|
|
1300
|
+
aria-modal="true"
|
|
1301
|
+
[attr.aria-label]="mode === 'rango' ? 'Seleccionar rango de fechas' : 'Seleccionar fecha'"
|
|
1302
|
+
>
|
|
1303
|
+
<header class="td-calendar__header">
|
|
1304
|
+
<button type="button" [attr.aria-label]="previousLabel" (click)="previousPage()">
|
|
1305
|
+
<td-icon nombre="chevron_left" />
|
|
1306
|
+
</button>
|
|
1307
|
+
<button
|
|
1308
|
+
type="button"
|
|
1309
|
+
class="td-calendar__period"
|
|
1310
|
+
[attr.aria-label]="periodButtonLabel"
|
|
1311
|
+
(click)="changeCalendarView()"
|
|
1312
|
+
>
|
|
1313
|
+
{{ periodLabel }}
|
|
1314
|
+
@if (calendarView !== 'anios') {
|
|
1315
|
+
<td-icon nombre="chevron_down" tamano=".85rem" />
|
|
1316
|
+
}
|
|
1317
|
+
</button>
|
|
1318
|
+
<button type="button" [attr.aria-label]="nextLabel" (click)="nextPage()">
|
|
1319
|
+
<td-icon nombre="chevron_right" />
|
|
1320
|
+
</button>
|
|
1321
|
+
</header>
|
|
1322
|
+
|
|
1323
|
+
@if (mode === 'rango') {
|
|
1324
|
+
<div class="td-calendar__range-summary">
|
|
1325
|
+
<span><small>Desde</small><strong>{{ rangeStartLabel }}</strong></span>
|
|
1326
|
+
<td-icon nombre="arrow_forward" />
|
|
1327
|
+
<span><small>Hasta</small><strong>{{ rangeEndLabel }}</strong></span>
|
|
1328
|
+
</div>
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
@if (calendarView === 'dias') {
|
|
1332
|
+
<div class="td-calendar__weekdays" aria-hidden="true">
|
|
1333
|
+
@for (weekday of weekdays; track weekday) {
|
|
1334
|
+
<span>{{ weekday }}</span>
|
|
1335
|
+
}
|
|
1336
|
+
</div>
|
|
1337
|
+
|
|
1338
|
+
<div class="td-calendar__grid">
|
|
1339
|
+
@for (date of days; track date.iso) {
|
|
1340
|
+
<button
|
|
1341
|
+
type="button"
|
|
1342
|
+
class="td-calendar__day"
|
|
1343
|
+
[class.td-calendar__day--outside]="!date.currentMonth"
|
|
1344
|
+
[class.td-calendar__day--today]="date.today"
|
|
1345
|
+
[class.td-calendar__day--selected]="isSelected(date.iso)"
|
|
1346
|
+
[class.td-calendar__day--range]="isInRange(date.iso)"
|
|
1347
|
+
[class.td-calendar__day--range-start]="isRangeStart(date.iso)"
|
|
1348
|
+
[class.td-calendar__day--range-end]="isRangeEnd(date.iso)"
|
|
1349
|
+
[disabled]="date.disabled"
|
|
1350
|
+
[attr.aria-label]="formatLong(date.iso)"
|
|
1351
|
+
[attr.aria-pressed]="isSelected(date.iso)"
|
|
1352
|
+
(mouseenter)="hoveredDate = date.iso"
|
|
1353
|
+
(mouseleave)="hoveredDate = null"
|
|
1354
|
+
(click)="selectDate(date)"
|
|
1355
|
+
>
|
|
1356
|
+
{{ date.day }}
|
|
1357
|
+
</button>
|
|
1358
|
+
}
|
|
1359
|
+
</div>
|
|
1360
|
+
} @else if (calendarView === 'meses') {
|
|
1361
|
+
<div class="td-calendar__selector-grid td-calendar__selector-grid--months">
|
|
1362
|
+
@for (month of months; track month.index) {
|
|
1363
|
+
<button
|
|
1364
|
+
type="button"
|
|
1365
|
+
[class.td-calendar__selector--active]="month.index === viewDate.getMonth()"
|
|
1366
|
+
[disabled]="month.disabled"
|
|
1367
|
+
(click)="selectMonth(month.index)"
|
|
1368
|
+
>
|
|
1369
|
+
{{ month.label }}
|
|
1370
|
+
</button>
|
|
1371
|
+
}
|
|
1372
|
+
</div>
|
|
1373
|
+
} @else {
|
|
1374
|
+
<div class="td-calendar__selector-grid td-calendar__selector-grid--years">
|
|
1375
|
+
@for (year of years; track year.value) {
|
|
1376
|
+
<button
|
|
1377
|
+
type="button"
|
|
1378
|
+
[class.td-calendar__selector--active]="year.value === viewDate.getFullYear()"
|
|
1379
|
+
[class.td-calendar__selector--today]="year.value === currentYear"
|
|
1380
|
+
[disabled]="year.disabled"
|
|
1381
|
+
(click)="selectYear(year.value)"
|
|
1382
|
+
>
|
|
1383
|
+
{{ year.value }}
|
|
1384
|
+
</button>
|
|
1385
|
+
}
|
|
1386
|
+
</div>
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
<footer class="td-calendar__footer">
|
|
1390
|
+
<button type="button" class="td-calendar__text-action" (click)="goToday()">
|
|
1391
|
+
Hoy
|
|
1392
|
+
</button>
|
|
1393
|
+
<button type="button" class="td-calendar__text-action" (click)="close()">
|
|
1394
|
+
Cerrar
|
|
1395
|
+
</button>
|
|
1396
|
+
</footer>
|
|
1397
|
+
</section>
|
|
1398
|
+
</ng-template>
|
|
1399
|
+
`, isInline: true, styles: [":host{display:block;min-width:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}.td-date-picker{--td-date-bg: #fff;--td-date-border: #dfe3eb;--td-date-text: #263147;--td-date-muted: #748096;position:relative;min-height:3.15rem;border:1px solid var(--td-date-border);border-radius:.78rem;background:var(--td-date-bg);transition:border-color .14s ease,box-shadow .14s ease}.td-date-picker--dark{--td-date-bg: #19191f;--td-date-border: #34343e;--td-date-text: #ededf0;--td-date-muted: #a1a1aa}.td-date-picker:hover:not(.td-date-picker--disabled){border-color:#8d80e8}.td-date-picker--open{border-color:#5746d8;box-shadow:0 0 0 3px #5746d821}.td-date-picker--error{border-color:#d33f3f;box-shadow:0 0 0 3px #d33f3f1a}.td-date-picker--disabled{opacity:.58;background:#f5f6f8}.td-date-picker>label{position:absolute;z-index:1;top:-.48rem;left:.72rem;padding:0 .35rem;color:var(--td-date-muted);background:var(--td-date-bg);font-size:.65rem;font-weight:750;line-height:1}.td-date-picker--open>label{color:#5746d8}.td-date-picker--error>label{color:#d33f3f}.td-date-picker__trigger{display:flex;width:100%;min-height:3.05rem;align-items:center;gap:.55rem;border:0;border-radius:inherit;padding:.3rem .7rem;color:var(--td-date-text);background:transparent;font:550 .78rem/1.25 system-ui,sans-serif;text-align:left;cursor:pointer}.td-date-picker__trigger>span:not(.td-date-picker__clear){min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.td-date-picker__placeholder{color:color-mix(in srgb,var(--td-date-muted) 72%,transparent)}.td-date-picker__trigger>td-icon{color:var(--td-date-muted)}.td-date-picker__chevron{transition:transform .14s ease}.td-date-picker__chevron--open{transform:rotate(180deg)}.td-date-picker__clear{display:grid;width:1.8rem;height:1.8rem;flex:0 0 auto;place-items:center;border-radius:.45rem;color:var(--td-date-muted)}.td-date-picker__clear:hover{color:#5746d8;background:#f2f0ff}.td-date-picker__message{margin:.38rem .75rem 0;color:#748096;font-size:.66rem}.td-date-picker__message--error{color:#c43636}.td-calendar{width:min(21rem,100vw - 1rem);overflow:hidden;border:1px solid #e1e5ee;border-radius:1rem;padding:.8rem;color:#263147;background:#fff;box-shadow:0 22px 55px #0f172a33;font-family:Inter,ui-sans-serif,system-ui,sans-serif;animation:td-calendar-in .14s ease-out}.td-calendar--dark{border-color:#34343e;color:#ededf0;background:#202028}.td-calendar__header{display:grid;grid-template-columns:2.35rem 1fr 2.35rem;align-items:center;gap:.35rem}.td-calendar__header button,.td-calendar__footer button{border:0;color:inherit;background:transparent;cursor:pointer}.td-calendar__header button{display:grid;width:2.35rem;height:2.35rem;place-items:center;border-radius:.65rem}.td-calendar__header .td-calendar__period{display:inline-flex;width:auto;min-width:0;height:2.35rem;align-items:center;justify-content:center;gap:.35rem;padding:0 .65rem;font-size:.82rem;font-weight:800}.td-calendar__header button:hover{color:#5746d8;background:#f2f0ff}.td-calendar--dark .td-calendar__header button:hover{background:#2b293d}.td-calendar__range-summary{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:.55rem;margin:.65rem 0 .35rem;border-radius:.72rem;padding:.55rem .65rem;background:#f7f7fb}.td-calendar--dark .td-calendar__range-summary{background:#292931}.td-calendar__range-summary span{min-width:0}.td-calendar__range-summary span:last-child{text-align:right}.td-calendar__range-summary small,.td-calendar__range-summary strong{display:block}.td-calendar__range-summary small{color:#748096;font-size:.58rem}.td-calendar__range-summary strong{overflow:hidden;margin-top:.12rem;font-size:.67rem;text-overflow:ellipsis;white-space:nowrap}.td-calendar__weekdays,.td-calendar__grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.td-calendar__weekdays{margin-top:.55rem}.td-calendar__weekdays span{padding:.35rem 0;color:#8791a4;font-size:.59rem;font-weight:800;text-align:center}.td-calendar__day{position:relative;display:grid;min-width:0;aspect-ratio:1;place-items:center;border:0;border-radius:.6rem;color:inherit;background:transparent;font:650 .7rem/1 system-ui,sans-serif;cursor:pointer}.td-calendar__day:hover:not(:disabled){color:#5746d8;background:#f0eeff}.td-calendar__day--outside{color:#b4bac6}.td-calendar__day--today{box-shadow:inset 0 0 0 1px #8d80e8}.td-calendar__day--range{border-radius:0;color:#5746d8;background:#efedff}.td-calendar__day--selected,.td-calendar__day--range-start,.td-calendar__day--range-end{border-radius:.6rem;color:#fff;background:#5746d8;box-shadow:0 5px 12px #5746d83d}.td-calendar__day:disabled{opacity:.3;cursor:not-allowed}.td-calendar__selector-grid{display:grid;min-height:15.75rem;align-content:center;gap:.45rem;padding:.75rem .15rem}.td-calendar__selector-grid--months,.td-calendar__selector-grid--years{grid-template-columns:repeat(3,minmax(0,1fr))}.td-calendar__selector-grid button{min-height:3.15rem;border:0;border-radius:.7rem;color:inherit;background:transparent;font:700 .72rem/1 system-ui,sans-serif;cursor:pointer}.td-calendar__selector-grid button:hover:not(:disabled){color:#5746d8;background:#f0eeff}.td-calendar--dark .td-calendar__selector-grid button:hover:not(:disabled){color:#b9b0fa;background:#2b293d}.td-calendar__selector-grid button:disabled{opacity:.28;cursor:not-allowed}.td-calendar__selector--active{color:#fff!important;background:#5746d8!important;box-shadow:0 5px 12px #5746d838}.td-calendar__selector--today:not(.td-calendar__selector--active){box-shadow:inset 0 0 0 1px #8d80e8}.td-calendar__footer{display:flex;justify-content:space-between;margin-top:.55rem;border-top:1px solid #e6e9f0;padding-top:.55rem}.td-calendar--dark .td-calendar__footer{border-color:#34343e}.td-calendar__text-action{border-radius:.5rem!important;padding:.45rem .6rem;color:#5746d8!important;font-size:.68rem;font-weight:750}.td-calendar__text-action:hover{background:#f2f0ff!important}@keyframes td-calendar-in{0%{opacity:0;transform:translateY(-.25rem) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@media(max-width:600px){.td-calendar{width:calc(100vw - 1rem);border-radius:.9rem}}@media(prefers-reduced-motion:reduce){.td-calendar{animation:none}}\n"], dependencies: [{ kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "component", type: TdIcon, selector: "td-icon", inputs: ["nombre", "titulo", "tamano"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1400
|
+
}
|
|
1401
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdDatePicker, decorators: [{
|
|
1402
|
+
type: Component,
|
|
1403
|
+
args: [{ selector: 'td-date-picker', imports: [CdkConnectedOverlay, CdkOverlayOrigin, TdIcon], template: `
|
|
1404
|
+
<div
|
|
1405
|
+
cdkOverlayOrigin
|
|
1406
|
+
#origin="cdkOverlayOrigin"
|
|
1407
|
+
class="td-date-picker"
|
|
1408
|
+
[class.td-date-picker--open]="open"
|
|
1409
|
+
[class.td-date-picker--error]="hasError()"
|
|
1410
|
+
[class.td-date-picker--disabled]="isDisabled()"
|
|
1411
|
+
[class.td-date-picker--dark]="dark"
|
|
1412
|
+
>
|
|
1413
|
+
<label [id]="labelId">{{ label }}</label>
|
|
1414
|
+
<button
|
|
1415
|
+
type="button"
|
|
1416
|
+
class="td-date-picker__trigger"
|
|
1417
|
+
[disabled]="isDisabled()"
|
|
1418
|
+
[attr.aria-labelledby]="labelId"
|
|
1419
|
+
[attr.aria-expanded]="open"
|
|
1420
|
+
[attr.aria-controls]="calendarId"
|
|
1421
|
+
(click)="toggle()"
|
|
1422
|
+
(keydown)="handleTriggerKeydown($event)"
|
|
1423
|
+
>
|
|
1424
|
+
<td-icon nombre="calendar" />
|
|
1425
|
+
<span [class.td-date-picker__placeholder]="!displayValue">
|
|
1426
|
+
{{ displayValue || placeholder }}
|
|
1427
|
+
</span>
|
|
1428
|
+
@if (clearable && value() && !isDisabled() && !readonly()) {
|
|
1429
|
+
<span
|
|
1430
|
+
class="td-date-picker__clear"
|
|
1431
|
+
role="button"
|
|
1432
|
+
tabindex="-1"
|
|
1433
|
+
aria-label="Limpiar fecha"
|
|
1434
|
+
(click)="clear($event)"
|
|
1435
|
+
>
|
|
1436
|
+
<td-icon nombre="close" tamano=".92rem" />
|
|
1437
|
+
</span>
|
|
1438
|
+
}
|
|
1439
|
+
<td-icon
|
|
1440
|
+
class="td-date-picker__chevron"
|
|
1441
|
+
[class.td-date-picker__chevron--open]="open"
|
|
1442
|
+
nombre="chevron_down"
|
|
1443
|
+
/>
|
|
1444
|
+
</button>
|
|
1445
|
+
</div>
|
|
1446
|
+
|
|
1447
|
+
@if (displayError() || hint) {
|
|
1448
|
+
<p class="td-date-picker__message" [class.td-date-picker__message--error]="hasError()">
|
|
1449
|
+
{{ displayError() || hint }}
|
|
1450
|
+
</p>
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
<ng-template
|
|
1454
|
+
cdkConnectedOverlay
|
|
1455
|
+
[cdkConnectedOverlayOrigin]="origin"
|
|
1456
|
+
[cdkConnectedOverlayOpen]="open"
|
|
1457
|
+
[cdkConnectedOverlayScrollStrategy]="scrollStrategy"
|
|
1458
|
+
[cdkConnectedOverlayMatchWidth]="false"
|
|
1459
|
+
[cdkConnectedOverlayViewportMargin]="8"
|
|
1460
|
+
[cdkConnectedOverlayPush]="true"
|
|
1461
|
+
(overlayOutsideClick)="close()"
|
|
1462
|
+
(overlayKeydown)="handleOverlayKeydown($event)"
|
|
1463
|
+
(detach)="close()"
|
|
1464
|
+
>
|
|
1465
|
+
<section
|
|
1466
|
+
class="td-calendar"
|
|
1467
|
+
[class.td-calendar--dark]="dark"
|
|
1468
|
+
[id]="calendarId"
|
|
1469
|
+
role="dialog"
|
|
1470
|
+
aria-modal="true"
|
|
1471
|
+
[attr.aria-label]="mode === 'rango' ? 'Seleccionar rango de fechas' : 'Seleccionar fecha'"
|
|
1472
|
+
>
|
|
1473
|
+
<header class="td-calendar__header">
|
|
1474
|
+
<button type="button" [attr.aria-label]="previousLabel" (click)="previousPage()">
|
|
1475
|
+
<td-icon nombre="chevron_left" />
|
|
1476
|
+
</button>
|
|
1477
|
+
<button
|
|
1478
|
+
type="button"
|
|
1479
|
+
class="td-calendar__period"
|
|
1480
|
+
[attr.aria-label]="periodButtonLabel"
|
|
1481
|
+
(click)="changeCalendarView()"
|
|
1482
|
+
>
|
|
1483
|
+
{{ periodLabel }}
|
|
1484
|
+
@if (calendarView !== 'anios') {
|
|
1485
|
+
<td-icon nombre="chevron_down" tamano=".85rem" />
|
|
1486
|
+
}
|
|
1487
|
+
</button>
|
|
1488
|
+
<button type="button" [attr.aria-label]="nextLabel" (click)="nextPage()">
|
|
1489
|
+
<td-icon nombre="chevron_right" />
|
|
1490
|
+
</button>
|
|
1491
|
+
</header>
|
|
1492
|
+
|
|
1493
|
+
@if (mode === 'rango') {
|
|
1494
|
+
<div class="td-calendar__range-summary">
|
|
1495
|
+
<span><small>Desde</small><strong>{{ rangeStartLabel }}</strong></span>
|
|
1496
|
+
<td-icon nombre="arrow_forward" />
|
|
1497
|
+
<span><small>Hasta</small><strong>{{ rangeEndLabel }}</strong></span>
|
|
1498
|
+
</div>
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
@if (calendarView === 'dias') {
|
|
1502
|
+
<div class="td-calendar__weekdays" aria-hidden="true">
|
|
1503
|
+
@for (weekday of weekdays; track weekday) {
|
|
1504
|
+
<span>{{ weekday }}</span>
|
|
1505
|
+
}
|
|
1506
|
+
</div>
|
|
1507
|
+
|
|
1508
|
+
<div class="td-calendar__grid">
|
|
1509
|
+
@for (date of days; track date.iso) {
|
|
1510
|
+
<button
|
|
1511
|
+
type="button"
|
|
1512
|
+
class="td-calendar__day"
|
|
1513
|
+
[class.td-calendar__day--outside]="!date.currentMonth"
|
|
1514
|
+
[class.td-calendar__day--today]="date.today"
|
|
1515
|
+
[class.td-calendar__day--selected]="isSelected(date.iso)"
|
|
1516
|
+
[class.td-calendar__day--range]="isInRange(date.iso)"
|
|
1517
|
+
[class.td-calendar__day--range-start]="isRangeStart(date.iso)"
|
|
1518
|
+
[class.td-calendar__day--range-end]="isRangeEnd(date.iso)"
|
|
1519
|
+
[disabled]="date.disabled"
|
|
1520
|
+
[attr.aria-label]="formatLong(date.iso)"
|
|
1521
|
+
[attr.aria-pressed]="isSelected(date.iso)"
|
|
1522
|
+
(mouseenter)="hoveredDate = date.iso"
|
|
1523
|
+
(mouseleave)="hoveredDate = null"
|
|
1524
|
+
(click)="selectDate(date)"
|
|
1525
|
+
>
|
|
1526
|
+
{{ date.day }}
|
|
1527
|
+
</button>
|
|
1528
|
+
}
|
|
1529
|
+
</div>
|
|
1530
|
+
} @else if (calendarView === 'meses') {
|
|
1531
|
+
<div class="td-calendar__selector-grid td-calendar__selector-grid--months">
|
|
1532
|
+
@for (month of months; track month.index) {
|
|
1533
|
+
<button
|
|
1534
|
+
type="button"
|
|
1535
|
+
[class.td-calendar__selector--active]="month.index === viewDate.getMonth()"
|
|
1536
|
+
[disabled]="month.disabled"
|
|
1537
|
+
(click)="selectMonth(month.index)"
|
|
1538
|
+
>
|
|
1539
|
+
{{ month.label }}
|
|
1540
|
+
</button>
|
|
1541
|
+
}
|
|
1542
|
+
</div>
|
|
1543
|
+
} @else {
|
|
1544
|
+
<div class="td-calendar__selector-grid td-calendar__selector-grid--years">
|
|
1545
|
+
@for (year of years; track year.value) {
|
|
1546
|
+
<button
|
|
1547
|
+
type="button"
|
|
1548
|
+
[class.td-calendar__selector--active]="year.value === viewDate.getFullYear()"
|
|
1549
|
+
[class.td-calendar__selector--today]="year.value === currentYear"
|
|
1550
|
+
[disabled]="year.disabled"
|
|
1551
|
+
(click)="selectYear(year.value)"
|
|
1552
|
+
>
|
|
1553
|
+
{{ year.value }}
|
|
1554
|
+
</button>
|
|
1555
|
+
}
|
|
1556
|
+
</div>
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
<footer class="td-calendar__footer">
|
|
1560
|
+
<button type="button" class="td-calendar__text-action" (click)="goToday()">
|
|
1561
|
+
Hoy
|
|
1562
|
+
</button>
|
|
1563
|
+
<button type="button" class="td-calendar__text-action" (click)="close()">
|
|
1564
|
+
Cerrar
|
|
1565
|
+
</button>
|
|
1566
|
+
</footer>
|
|
1567
|
+
</section>
|
|
1568
|
+
</ng-template>
|
|
1569
|
+
`, providers: [
|
|
1570
|
+
{
|
|
1571
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1572
|
+
useExisting: forwardRef(() => TdDatePicker),
|
|
1573
|
+
multi: true,
|
|
1574
|
+
},
|
|
1575
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;min-width:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}.td-date-picker{--td-date-bg: #fff;--td-date-border: #dfe3eb;--td-date-text: #263147;--td-date-muted: #748096;position:relative;min-height:3.15rem;border:1px solid var(--td-date-border);border-radius:.78rem;background:var(--td-date-bg);transition:border-color .14s ease,box-shadow .14s ease}.td-date-picker--dark{--td-date-bg: #19191f;--td-date-border: #34343e;--td-date-text: #ededf0;--td-date-muted: #a1a1aa}.td-date-picker:hover:not(.td-date-picker--disabled){border-color:#8d80e8}.td-date-picker--open{border-color:#5746d8;box-shadow:0 0 0 3px #5746d821}.td-date-picker--error{border-color:#d33f3f;box-shadow:0 0 0 3px #d33f3f1a}.td-date-picker--disabled{opacity:.58;background:#f5f6f8}.td-date-picker>label{position:absolute;z-index:1;top:-.48rem;left:.72rem;padding:0 .35rem;color:var(--td-date-muted);background:var(--td-date-bg);font-size:.65rem;font-weight:750;line-height:1}.td-date-picker--open>label{color:#5746d8}.td-date-picker--error>label{color:#d33f3f}.td-date-picker__trigger{display:flex;width:100%;min-height:3.05rem;align-items:center;gap:.55rem;border:0;border-radius:inherit;padding:.3rem .7rem;color:var(--td-date-text);background:transparent;font:550 .78rem/1.25 system-ui,sans-serif;text-align:left;cursor:pointer}.td-date-picker__trigger>span:not(.td-date-picker__clear){min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.td-date-picker__placeholder{color:color-mix(in srgb,var(--td-date-muted) 72%,transparent)}.td-date-picker__trigger>td-icon{color:var(--td-date-muted)}.td-date-picker__chevron{transition:transform .14s ease}.td-date-picker__chevron--open{transform:rotate(180deg)}.td-date-picker__clear{display:grid;width:1.8rem;height:1.8rem;flex:0 0 auto;place-items:center;border-radius:.45rem;color:var(--td-date-muted)}.td-date-picker__clear:hover{color:#5746d8;background:#f2f0ff}.td-date-picker__message{margin:.38rem .75rem 0;color:#748096;font-size:.66rem}.td-date-picker__message--error{color:#c43636}.td-calendar{width:min(21rem,100vw - 1rem);overflow:hidden;border:1px solid #e1e5ee;border-radius:1rem;padding:.8rem;color:#263147;background:#fff;box-shadow:0 22px 55px #0f172a33;font-family:Inter,ui-sans-serif,system-ui,sans-serif;animation:td-calendar-in .14s ease-out}.td-calendar--dark{border-color:#34343e;color:#ededf0;background:#202028}.td-calendar__header{display:grid;grid-template-columns:2.35rem 1fr 2.35rem;align-items:center;gap:.35rem}.td-calendar__header button,.td-calendar__footer button{border:0;color:inherit;background:transparent;cursor:pointer}.td-calendar__header button{display:grid;width:2.35rem;height:2.35rem;place-items:center;border-radius:.65rem}.td-calendar__header .td-calendar__period{display:inline-flex;width:auto;min-width:0;height:2.35rem;align-items:center;justify-content:center;gap:.35rem;padding:0 .65rem;font-size:.82rem;font-weight:800}.td-calendar__header button:hover{color:#5746d8;background:#f2f0ff}.td-calendar--dark .td-calendar__header button:hover{background:#2b293d}.td-calendar__range-summary{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:.55rem;margin:.65rem 0 .35rem;border-radius:.72rem;padding:.55rem .65rem;background:#f7f7fb}.td-calendar--dark .td-calendar__range-summary{background:#292931}.td-calendar__range-summary span{min-width:0}.td-calendar__range-summary span:last-child{text-align:right}.td-calendar__range-summary small,.td-calendar__range-summary strong{display:block}.td-calendar__range-summary small{color:#748096;font-size:.58rem}.td-calendar__range-summary strong{overflow:hidden;margin-top:.12rem;font-size:.67rem;text-overflow:ellipsis;white-space:nowrap}.td-calendar__weekdays,.td-calendar__grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.td-calendar__weekdays{margin-top:.55rem}.td-calendar__weekdays span{padding:.35rem 0;color:#8791a4;font-size:.59rem;font-weight:800;text-align:center}.td-calendar__day{position:relative;display:grid;min-width:0;aspect-ratio:1;place-items:center;border:0;border-radius:.6rem;color:inherit;background:transparent;font:650 .7rem/1 system-ui,sans-serif;cursor:pointer}.td-calendar__day:hover:not(:disabled){color:#5746d8;background:#f0eeff}.td-calendar__day--outside{color:#b4bac6}.td-calendar__day--today{box-shadow:inset 0 0 0 1px #8d80e8}.td-calendar__day--range{border-radius:0;color:#5746d8;background:#efedff}.td-calendar__day--selected,.td-calendar__day--range-start,.td-calendar__day--range-end{border-radius:.6rem;color:#fff;background:#5746d8;box-shadow:0 5px 12px #5746d83d}.td-calendar__day:disabled{opacity:.3;cursor:not-allowed}.td-calendar__selector-grid{display:grid;min-height:15.75rem;align-content:center;gap:.45rem;padding:.75rem .15rem}.td-calendar__selector-grid--months,.td-calendar__selector-grid--years{grid-template-columns:repeat(3,minmax(0,1fr))}.td-calendar__selector-grid button{min-height:3.15rem;border:0;border-radius:.7rem;color:inherit;background:transparent;font:700 .72rem/1 system-ui,sans-serif;cursor:pointer}.td-calendar__selector-grid button:hover:not(:disabled){color:#5746d8;background:#f0eeff}.td-calendar--dark .td-calendar__selector-grid button:hover:not(:disabled){color:#b9b0fa;background:#2b293d}.td-calendar__selector-grid button:disabled{opacity:.28;cursor:not-allowed}.td-calendar__selector--active{color:#fff!important;background:#5746d8!important;box-shadow:0 5px 12px #5746d838}.td-calendar__selector--today:not(.td-calendar__selector--active){box-shadow:inset 0 0 0 1px #8d80e8}.td-calendar__footer{display:flex;justify-content:space-between;margin-top:.55rem;border-top:1px solid #e6e9f0;padding-top:.55rem}.td-calendar--dark .td-calendar__footer{border-color:#34343e}.td-calendar__text-action{border-radius:.5rem!important;padding:.45rem .6rem;color:#5746d8!important;font-size:.68rem;font-weight:750}.td-calendar__text-action:hover{background:#f2f0ff!important}@keyframes td-calendar-in{0%{opacity:0;transform:translateY(-.25rem) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@media(max-width:600px){.td-calendar{width:calc(100vw - 1rem);border-radius:.9rem}}@media(prefers-reduced-motion:reduce){.td-calendar{animation:none}}\n"] }]
|
|
1576
|
+
}], propDecorators: { label: [{
|
|
1577
|
+
type: Input
|
|
1578
|
+
}], placeholder: [{
|
|
1579
|
+
type: Input
|
|
1580
|
+
}], mode: [{
|
|
1581
|
+
type: Input
|
|
1582
|
+
}], hint: [{
|
|
1583
|
+
type: Input
|
|
1584
|
+
}], error: [{
|
|
1585
|
+
type: Input
|
|
1586
|
+
}], minDate: [{
|
|
1587
|
+
type: Input,
|
|
1588
|
+
args: [{ alias: 'min' }]
|
|
1589
|
+
}], maxDate: [{
|
|
1590
|
+
type: Input,
|
|
1591
|
+
args: [{ alias: 'max' }]
|
|
1592
|
+
}], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], clearable: [{
|
|
1593
|
+
type: Input
|
|
1594
|
+
}], dark: [{
|
|
1595
|
+
type: Input
|
|
1596
|
+
}], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], selectionChange: [{
|
|
1597
|
+
type: Output
|
|
1598
|
+
}], openedChange: [{
|
|
1599
|
+
type: Output
|
|
1600
|
+
}] } });
|
|
1601
|
+
|
|
721
1602
|
const TD_DIALOG_DATA = new InjectionToken('TD_DIALOG_DATA');
|
|
722
1603
|
const TD_DIALOG_CONFIG = new InjectionToken('TD_DIALOG_CONFIG');
|
|
723
1604
|
|
|
@@ -1067,7 +1948,7 @@ class TdInput {
|
|
|
1067
1948
|
cdr = inject(ChangeDetectorRef);
|
|
1068
1949
|
generatedId = `td-input-${++inputSequence}`;
|
|
1069
1950
|
id = '';
|
|
1070
|
-
name = '';
|
|
1951
|
+
name = input('', ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
1071
1952
|
label = 'Campo';
|
|
1072
1953
|
type = 'text';
|
|
1073
1954
|
placeholder = '';
|
|
@@ -1075,25 +1956,31 @@ class TdInput {
|
|
|
1075
1956
|
icon = '';
|
|
1076
1957
|
hint = '';
|
|
1077
1958
|
error = '';
|
|
1078
|
-
readonly = false;
|
|
1079
|
-
disabled = false;
|
|
1080
|
-
required = false;
|
|
1959
|
+
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
1960
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1961
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
1962
|
+
invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
1963
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
1964
|
+
touch = output();
|
|
1081
1965
|
clearable = false;
|
|
1082
1966
|
dark = false;
|
|
1083
|
-
|
|
1084
|
-
|
|
1967
|
+
minValue = null;
|
|
1968
|
+
maxValue = null;
|
|
1085
1969
|
step = null;
|
|
1086
1970
|
minlength = null;
|
|
1087
1971
|
maxlength = null;
|
|
1088
|
-
|
|
1089
|
-
|
|
1972
|
+
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1973
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
1974
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
1975
|
+
displayError = computed(() => this.error || this.errors()[0]?.message || '', ...(ngDevMode ? [{ debugName: "displayError" }] : /* istanbul ignore next */ []));
|
|
1976
|
+
hasError = computed(() => this.invalid() || !!this.displayError(), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
1090
1977
|
focused = false;
|
|
1091
1978
|
passwordVisible = false;
|
|
1092
1979
|
get inputId() {
|
|
1093
1980
|
return this.id || this.generatedId;
|
|
1094
1981
|
}
|
|
1095
1982
|
get descriptionId() {
|
|
1096
|
-
return this.
|
|
1983
|
+
return this.displayError() || this.hint ? `${this.inputId}-description` : null;
|
|
1097
1984
|
}
|
|
1098
1985
|
get resolvedType() {
|
|
1099
1986
|
return this.type === 'password' && this.passwordVisible ? 'text' : this.type;
|
|
@@ -1101,7 +1988,7 @@ class TdInput {
|
|
|
1101
1988
|
onChange = () => undefined;
|
|
1102
1989
|
onTouched = () => undefined;
|
|
1103
1990
|
writeValue(value) {
|
|
1104
|
-
this.value
|
|
1991
|
+
this.value.set(value === null || value === undefined ? '' : String(value));
|
|
1105
1992
|
this.cdr.markForCheck();
|
|
1106
1993
|
}
|
|
1107
1994
|
registerOnChange(fn) {
|
|
@@ -1111,7 +1998,7 @@ class TdInput {
|
|
|
1111
1998
|
this.onTouched = fn;
|
|
1112
1999
|
}
|
|
1113
2000
|
setDisabledState(disabled) {
|
|
1114
|
-
this.disabled
|
|
2001
|
+
this.cvaDisabled.set(disabled);
|
|
1115
2002
|
this.cdr.markForCheck();
|
|
1116
2003
|
}
|
|
1117
2004
|
handleInput(event) {
|
|
@@ -1120,17 +2007,17 @@ class TdInput {
|
|
|
1120
2007
|
handleBlur() {
|
|
1121
2008
|
this.focused = false;
|
|
1122
2009
|
this.onTouched();
|
|
2010
|
+
this.touch.emit();
|
|
1123
2011
|
}
|
|
1124
2012
|
clear() {
|
|
1125
2013
|
this.setValue('');
|
|
1126
2014
|
}
|
|
1127
2015
|
setValue(value) {
|
|
1128
|
-
this.value
|
|
2016
|
+
this.value.set(value);
|
|
1129
2017
|
this.onChange(value);
|
|
1130
|
-
this.valueChange.emit(value);
|
|
1131
2018
|
}
|
|
1132
2019
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1133
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdInput, isStandalone: true, selector: "td-input", inputs: { id: "id", name: "name", label: "label", type: "type", placeholder: "placeholder", autocomplete: "autocomplete", icon: "icon", hint: "hint", error: "error", readonly: "readonly", disabled: "disabled", required: "required", clearable: "clearable", dark: "dark",
|
|
2020
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdInput, isStandalone: true, selector: "td-input", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: false, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: false, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: false, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: false, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, dark: { classPropertyName: "dark", publicName: "dark", isSignal: false, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "min", isSignal: false, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "max", isSignal: false, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: false, isRequired: false, transformFunction: null }, minlength: { classPropertyName: "minlength", publicName: "minlength", isSignal: false, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch", value: "valueChange" }, providers: [
|
|
1134
2021
|
{
|
|
1135
2022
|
provide: NG_VALUE_ACCESSOR,
|
|
1136
2023
|
useExisting: forwardRef(() => TdInput),
|
|
@@ -1140,8 +2027,8 @@ class TdInput {
|
|
|
1140
2027
|
<div
|
|
1141
2028
|
class="td-input"
|
|
1142
2029
|
[class.td-input--focused]="focused"
|
|
1143
|
-
[class.td-input--error]="
|
|
1144
|
-
[class.td-input--disabled]="
|
|
2030
|
+
[class.td-input--error]="hasError()"
|
|
2031
|
+
[class.td-input--disabled]="isDisabled()"
|
|
1145
2032
|
[class.td-input--dark]="dark"
|
|
1146
2033
|
>
|
|
1147
2034
|
<label [for]="inputId">{{ label }}</label>
|
|
@@ -1153,27 +2040,27 @@ class TdInput {
|
|
|
1153
2040
|
|
|
1154
2041
|
<input
|
|
1155
2042
|
[id]="inputId"
|
|
1156
|
-
[name]="name"
|
|
2043
|
+
[name]="name()"
|
|
1157
2044
|
[type]="resolvedType"
|
|
1158
|
-
[value]="value"
|
|
2045
|
+
[value]="value()"
|
|
1159
2046
|
[placeholder]="placeholder"
|
|
1160
2047
|
[autocomplete]="autocomplete"
|
|
1161
|
-
[disabled]="
|
|
1162
|
-
[readonly]="readonly"
|
|
1163
|
-
[required]="required"
|
|
1164
|
-
[min]="
|
|
1165
|
-
[max]="
|
|
2048
|
+
[disabled]="isDisabled()"
|
|
2049
|
+
[readonly]="readonly()"
|
|
2050
|
+
[required]="required()"
|
|
2051
|
+
[min]="minValue"
|
|
2052
|
+
[max]="maxValue"
|
|
1166
2053
|
[step]="step"
|
|
1167
2054
|
[attr.minlength]="minlength"
|
|
1168
2055
|
[attr.maxlength]="maxlength"
|
|
1169
2056
|
[attr.aria-describedby]="descriptionId"
|
|
1170
|
-
[attr.aria-invalid]="
|
|
2057
|
+
[attr.aria-invalid]="hasError()"
|
|
1171
2058
|
(input)="handleInput($event)"
|
|
1172
2059
|
(focus)="focused = true"
|
|
1173
2060
|
(blur)="handleBlur()"
|
|
1174
2061
|
/>
|
|
1175
2062
|
|
|
1176
|
-
@if (clearable && value && !
|
|
2063
|
+
@if (clearable && value() && !isDisabled() && !readonly()) {
|
|
1177
2064
|
<button type="button" class="td-input__action" title="Limpiar" (click)="clear()">
|
|
1178
2065
|
<td-icon nombre="close" tamano=".95rem" />
|
|
1179
2066
|
</button>
|
|
@@ -1192,13 +2079,13 @@ class TdInput {
|
|
|
1192
2079
|
</div>
|
|
1193
2080
|
</div>
|
|
1194
2081
|
|
|
1195
|
-
@if (
|
|
2082
|
+
@if (displayError() || hint) {
|
|
1196
2083
|
<p
|
|
1197
2084
|
class="td-input__message"
|
|
1198
|
-
[class.td-input__message--error]="
|
|
2085
|
+
[class.td-input__message--error]="hasError()"
|
|
1199
2086
|
[id]="descriptionId"
|
|
1200
2087
|
>
|
|
1201
|
-
{{
|
|
2088
|
+
{{ displayError() || hint }}
|
|
1202
2089
|
</p>
|
|
1203
2090
|
}
|
|
1204
2091
|
`, isInline: true, styles: [":host{display:block;min-width:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}.td-input{--td-input-bg: #fff;--td-input-border: #dfe3eb;--td-input-text: #263147;--td-input-muted: #748096;position:relative;display:flex;min-height:3.15rem;align-items:center;border:1px solid var(--td-input-border);border-radius:.78rem;background:var(--td-input-bg);transition:border-color .14s ease,box-shadow .14s ease,background .14s ease}.td-input--dark{--td-input-bg: #19191f;--td-input-border: #34343e;--td-input-text: #ededf0;--td-input-muted: #a1a1aa;color-scheme:dark}.td-input:hover:not(.td-input--disabled){border-color:color-mix(in srgb,#5746d8 42%,var(--td-input-border))}.td-input--focused{border-color:#5746d8;box-shadow:0 0 0 3px #5746d821}.td-input--error{border-color:#d33f3f;box-shadow:0 0 0 3px #d33f3f1a}.td-input--disabled{opacity:.58;background:#f5f6f8;cursor:not-allowed}.td-input label{position:absolute;z-index:1;top:-.48rem;left:.72rem;max-width:calc(100% - 1.4rem);overflow:hidden;padding:0 .35rem;color:var(--td-input-muted);background:var(--td-input-bg);font-size:.65rem;font-weight:750;line-height:1;text-overflow:ellipsis;white-space:nowrap}.td-input--focused label{color:#5746d8}.td-input--error label{color:#d33f3f}.td-input__control{display:flex;width:100%;min-width:0;align-items:center;gap:.55rem;padding:.25rem .7rem}.td-input__icon{flex:0 0 auto;color:var(--td-input-muted)}input{width:100%;min-width:0;height:2.55rem;border:0;outline:0;color:var(--td-input-text);background:transparent;font:550 .78rem/1 system-ui,sans-serif}input::placeholder{color:color-mix(in srgb,var(--td-input-muted) 72%,transparent)}input:disabled{cursor:not-allowed}input[type=search]::-webkit-search-cancel-button{display:none}.td-input__action{display:grid;width:2rem;height:2rem;flex:0 0 auto;place-items:center;border:0;border-radius:.5rem;color:var(--td-input-muted);background:transparent;cursor:pointer}.td-input__action:hover{color:#5746d8;background:#f2f0ff}.td-input--dark .td-input__action:hover{color:#b9b0fa;background:#292931}.td-input__message{margin:.38rem .75rem 0;color:#748096;font-size:.66rem;line-height:1.4}.td-input__message--error{color:#c43636}\n"], dependencies: [{ kind: "component", type: TdIcon, selector: "td-icon", inputs: ["nombre", "titulo", "tamano"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -1209,8 +2096,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1209
2096
|
<div
|
|
1210
2097
|
class="td-input"
|
|
1211
2098
|
[class.td-input--focused]="focused"
|
|
1212
|
-
[class.td-input--error]="
|
|
1213
|
-
[class.td-input--disabled]="
|
|
2099
|
+
[class.td-input--error]="hasError()"
|
|
2100
|
+
[class.td-input--disabled]="isDisabled()"
|
|
1214
2101
|
[class.td-input--dark]="dark"
|
|
1215
2102
|
>
|
|
1216
2103
|
<label [for]="inputId">{{ label }}</label>
|
|
@@ -1222,27 +2109,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1222
2109
|
|
|
1223
2110
|
<input
|
|
1224
2111
|
[id]="inputId"
|
|
1225
|
-
[name]="name"
|
|
2112
|
+
[name]="name()"
|
|
1226
2113
|
[type]="resolvedType"
|
|
1227
|
-
[value]="value"
|
|
2114
|
+
[value]="value()"
|
|
1228
2115
|
[placeholder]="placeholder"
|
|
1229
2116
|
[autocomplete]="autocomplete"
|
|
1230
|
-
[disabled]="
|
|
1231
|
-
[readonly]="readonly"
|
|
1232
|
-
[required]="required"
|
|
1233
|
-
[min]="
|
|
1234
|
-
[max]="
|
|
2117
|
+
[disabled]="isDisabled()"
|
|
2118
|
+
[readonly]="readonly()"
|
|
2119
|
+
[required]="required()"
|
|
2120
|
+
[min]="minValue"
|
|
2121
|
+
[max]="maxValue"
|
|
1235
2122
|
[step]="step"
|
|
1236
2123
|
[attr.minlength]="minlength"
|
|
1237
2124
|
[attr.maxlength]="maxlength"
|
|
1238
2125
|
[attr.aria-describedby]="descriptionId"
|
|
1239
|
-
[attr.aria-invalid]="
|
|
2126
|
+
[attr.aria-invalid]="hasError()"
|
|
1240
2127
|
(input)="handleInput($event)"
|
|
1241
2128
|
(focus)="focused = true"
|
|
1242
2129
|
(blur)="handleBlur()"
|
|
1243
2130
|
/>
|
|
1244
2131
|
|
|
1245
|
-
@if (clearable && value && !
|
|
2132
|
+
@if (clearable && value() && !isDisabled() && !readonly()) {
|
|
1246
2133
|
<button type="button" class="td-input__action" title="Limpiar" (click)="clear()">
|
|
1247
2134
|
<td-icon nombre="close" tamano=".95rem" />
|
|
1248
2135
|
</button>
|
|
@@ -1261,13 +2148,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1261
2148
|
</div>
|
|
1262
2149
|
</div>
|
|
1263
2150
|
|
|
1264
|
-
@if (
|
|
2151
|
+
@if (displayError() || hint) {
|
|
1265
2152
|
<p
|
|
1266
2153
|
class="td-input__message"
|
|
1267
|
-
[class.td-input__message--error]="
|
|
2154
|
+
[class.td-input__message--error]="hasError()"
|
|
1268
2155
|
[id]="descriptionId"
|
|
1269
2156
|
>
|
|
1270
|
-
{{
|
|
2157
|
+
{{ displayError() || hint }}
|
|
1271
2158
|
</p>
|
|
1272
2159
|
}
|
|
1273
2160
|
`, providers: [
|
|
@@ -1279,9 +2166,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1279
2166
|
], changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;min-width:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}.td-input{--td-input-bg: #fff;--td-input-border: #dfe3eb;--td-input-text: #263147;--td-input-muted: #748096;position:relative;display:flex;min-height:3.15rem;align-items:center;border:1px solid var(--td-input-border);border-radius:.78rem;background:var(--td-input-bg);transition:border-color .14s ease,box-shadow .14s ease,background .14s ease}.td-input--dark{--td-input-bg: #19191f;--td-input-border: #34343e;--td-input-text: #ededf0;--td-input-muted: #a1a1aa;color-scheme:dark}.td-input:hover:not(.td-input--disabled){border-color:color-mix(in srgb,#5746d8 42%,var(--td-input-border))}.td-input--focused{border-color:#5746d8;box-shadow:0 0 0 3px #5746d821}.td-input--error{border-color:#d33f3f;box-shadow:0 0 0 3px #d33f3f1a}.td-input--disabled{opacity:.58;background:#f5f6f8;cursor:not-allowed}.td-input label{position:absolute;z-index:1;top:-.48rem;left:.72rem;max-width:calc(100% - 1.4rem);overflow:hidden;padding:0 .35rem;color:var(--td-input-muted);background:var(--td-input-bg);font-size:.65rem;font-weight:750;line-height:1;text-overflow:ellipsis;white-space:nowrap}.td-input--focused label{color:#5746d8}.td-input--error label{color:#d33f3f}.td-input__control{display:flex;width:100%;min-width:0;align-items:center;gap:.55rem;padding:.25rem .7rem}.td-input__icon{flex:0 0 auto;color:var(--td-input-muted)}input{width:100%;min-width:0;height:2.55rem;border:0;outline:0;color:var(--td-input-text);background:transparent;font:550 .78rem/1 system-ui,sans-serif}input::placeholder{color:color-mix(in srgb,var(--td-input-muted) 72%,transparent)}input:disabled{cursor:not-allowed}input[type=search]::-webkit-search-cancel-button{display:none}.td-input__action{display:grid;width:2rem;height:2rem;flex:0 0 auto;place-items:center;border:0;border-radius:.5rem;color:var(--td-input-muted);background:transparent;cursor:pointer}.td-input__action:hover{color:#5746d8;background:#f2f0ff}.td-input--dark .td-input__action:hover{color:#b9b0fa;background:#292931}.td-input__message{margin:.38rem .75rem 0;color:#748096;font-size:.66rem;line-height:1.4}.td-input__message--error{color:#c43636}\n"] }]
|
|
1280
2167
|
}], propDecorators: { id: [{
|
|
1281
2168
|
type: Input
|
|
1282
|
-
}], name: [{
|
|
1283
|
-
type: Input
|
|
1284
|
-
}], label: [{
|
|
2169
|
+
}], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], label: [{
|
|
1285
2170
|
type: Input
|
|
1286
2171
|
}], type: [{
|
|
1287
2172
|
type: Input
|
|
@@ -1295,31 +2180,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1295
2180
|
type: Input
|
|
1296
2181
|
}], error: [{
|
|
1297
2182
|
type: Input
|
|
1298
|
-
}], readonly: [{
|
|
1299
|
-
type: Input
|
|
1300
|
-
}], disabled: [{
|
|
1301
|
-
type: Input
|
|
1302
|
-
}], required: [{
|
|
1303
|
-
type: Input
|
|
1304
|
-
}], clearable: [{
|
|
2183
|
+
}], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], clearable: [{
|
|
1305
2184
|
type: Input
|
|
1306
2185
|
}], dark: [{
|
|
1307
2186
|
type: Input
|
|
1308
|
-
}],
|
|
1309
|
-
type: Input
|
|
1310
|
-
|
|
1311
|
-
|
|
2187
|
+
}], minValue: [{
|
|
2188
|
+
type: Input,
|
|
2189
|
+
args: [{ alias: 'min' }]
|
|
2190
|
+
}], maxValue: [{
|
|
2191
|
+
type: Input,
|
|
2192
|
+
args: [{ alias: 'max' }]
|
|
1312
2193
|
}], step: [{
|
|
1313
2194
|
type: Input
|
|
1314
2195
|
}], minlength: [{
|
|
1315
2196
|
type: Input
|
|
1316
2197
|
}], maxlength: [{
|
|
1317
2198
|
type: Input
|
|
1318
|
-
}],
|
|
1319
|
-
type: Output
|
|
1320
|
-
}], value: [{
|
|
1321
|
-
type: Input
|
|
1322
|
-
}] } });
|
|
2199
|
+
}], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
1323
2200
|
|
|
1324
2201
|
let autocompleteSequence = 0;
|
|
1325
2202
|
class TdAutocompleteSelect {
|
|
@@ -1338,14 +2215,21 @@ class TdAutocompleteSelect {
|
|
|
1338
2215
|
emptyText = 'No se encontraron resultados';
|
|
1339
2216
|
clearable = true;
|
|
1340
2217
|
dark = false;
|
|
1341
|
-
disabled = false;
|
|
2218
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
2219
|
+
invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
2220
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
2221
|
+
touch = output();
|
|
1342
2222
|
scrollBehavior = 'reposition';
|
|
1343
2223
|
minimumCharacters = 0;
|
|
1344
2224
|
filterWith = (option, search) => `${option.label} ${option.description ?? ''}`.toLocaleLowerCase().includes(search);
|
|
1345
2225
|
compareWith = (first, second) => Object.is(first, second);
|
|
1346
2226
|
selectionChange = new EventEmitter();
|
|
1347
2227
|
searchChange = new EventEmitter();
|
|
1348
|
-
value = null;
|
|
2228
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2229
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
2230
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
2231
|
+
displayError = computed(() => this.error || this.errors()[0]?.message || '', ...(ngDevMode ? [{ debugName: "displayError" }] : /* istanbul ignore next */ []));
|
|
2232
|
+
hasError = computed(() => this.invalid() || !!this.displayError(), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
1349
2233
|
search = '';
|
|
1350
2234
|
open = false;
|
|
1351
2235
|
activeIndex = -1;
|
|
@@ -1363,10 +2247,11 @@ class TdAutocompleteSelect {
|
|
|
1363
2247
|
return this.options.filter((option) => this.filterWith(option, normalized));
|
|
1364
2248
|
}
|
|
1365
2249
|
onTouched = () => {
|
|
1366
|
-
this.
|
|
2250
|
+
this.onCvaTouched();
|
|
2251
|
+
this.touch.emit();
|
|
1367
2252
|
};
|
|
1368
2253
|
changed = () => undefined;
|
|
1369
|
-
|
|
2254
|
+
onCvaTouched = () => undefined;
|
|
1370
2255
|
constructor() {
|
|
1371
2256
|
const scrollListener = (event) => {
|
|
1372
2257
|
const target = event.target;
|
|
@@ -1386,39 +2271,41 @@ class TdAutocompleteSelect {
|
|
|
1386
2271
|
this.destroyRef.onDestroy(() => this.document.removeEventListener('scroll', scrollListener, true));
|
|
1387
2272
|
}
|
|
1388
2273
|
writeValue(value) {
|
|
1389
|
-
this.value
|
|
1390
|
-
this.search =
|
|
2274
|
+
this.value.set(value ?? null);
|
|
2275
|
+
this.search =
|
|
2276
|
+
this.options.find((option) => this.compare(option.value, this.value()))?.label ?? '';
|
|
1391
2277
|
this.cdr.markForCheck();
|
|
1392
2278
|
}
|
|
1393
2279
|
registerOnChange(fn) {
|
|
1394
2280
|
this.changed = fn;
|
|
1395
2281
|
}
|
|
1396
2282
|
registerOnTouched(fn) {
|
|
1397
|
-
this.
|
|
2283
|
+
this.onCvaTouched = fn;
|
|
1398
2284
|
}
|
|
1399
2285
|
setDisabledState(disabled) {
|
|
1400
|
-
this.disabled
|
|
2286
|
+
this.cvaDisabled.set(disabled);
|
|
1401
2287
|
this.cdr.markForCheck();
|
|
1402
2288
|
}
|
|
1403
2289
|
compare(first, second) {
|
|
1404
2290
|
return this.compareWith(first, second);
|
|
1405
2291
|
}
|
|
1406
2292
|
openPanel() {
|
|
1407
|
-
if (this.
|
|
2293
|
+
if (this.isDisabled())
|
|
1408
2294
|
return;
|
|
1409
2295
|
this.open = true;
|
|
1410
2296
|
this.activeIndex = this.firstEnabledIndex();
|
|
1411
2297
|
}
|
|
1412
2298
|
close() {
|
|
1413
2299
|
this.open = false;
|
|
1414
|
-
const selected = this.options.find((option) => this.compare(option.value, this.value));
|
|
2300
|
+
const selected = this.options.find((option) => this.compare(option.value, this.value()));
|
|
1415
2301
|
if (selected)
|
|
1416
2302
|
this.search = selected.label;
|
|
1417
|
-
this.
|
|
2303
|
+
this.onCvaTouched();
|
|
2304
|
+
this.touch.emit();
|
|
1418
2305
|
}
|
|
1419
2306
|
handleInput(event) {
|
|
1420
2307
|
this.search = event.target.value;
|
|
1421
|
-
this.value
|
|
2308
|
+
this.value.set(null);
|
|
1422
2309
|
this.changed(null);
|
|
1423
2310
|
this.searchChange.emit(this.search);
|
|
1424
2311
|
this.openPanel();
|
|
@@ -1427,7 +2314,7 @@ class TdAutocompleteSelect {
|
|
|
1427
2314
|
select(option) {
|
|
1428
2315
|
if (option.disabled)
|
|
1429
2316
|
return;
|
|
1430
|
-
this.value
|
|
2317
|
+
this.value.set(option.value);
|
|
1431
2318
|
this.search = option.label;
|
|
1432
2319
|
this.changed(option.value);
|
|
1433
2320
|
this.selectionChange.emit(option.value);
|
|
@@ -1435,7 +2322,7 @@ class TdAutocompleteSelect {
|
|
|
1435
2322
|
}
|
|
1436
2323
|
clear(event) {
|
|
1437
2324
|
event.stopPropagation();
|
|
1438
|
-
this.value
|
|
2325
|
+
this.value.set(null);
|
|
1439
2326
|
this.search = '';
|
|
1440
2327
|
this.changed(null);
|
|
1441
2328
|
this.selectionChange.emit(null);
|
|
@@ -1482,7 +2369,7 @@ class TdAutocompleteSelect {
|
|
|
1482
2369
|
return this.filteredOptions.findIndex((option) => !option.disabled);
|
|
1483
2370
|
}
|
|
1484
2371
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdAutocompleteSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1485
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdAutocompleteSelect, isStandalone: true, selector: "td-autocomplete-select", inputs: { label: "label", placeholder: "placeholder", options: "options", hint: "hint", error: "error", emptyText: "emptyText", clearable: "clearable", dark: "dark", disabled: "disabled", scrollBehavior: "scrollBehavior", minimumCharacters: "minimumCharacters", filterWith: "filterWith", compareWith: "compareWith" }, outputs: { selectionChange: "selectionChange", searchChange: "searchChange" }, providers: [
|
|
2372
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdAutocompleteSelect, isStandalone: true, selector: "td-autocomplete-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: false, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: false, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, dark: { classPropertyName: "dark", publicName: "dark", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "scrollBehavior", isSignal: false, isRequired: false, transformFunction: null }, minimumCharacters: { classPropertyName: "minimumCharacters", publicName: "minimumCharacters", isSignal: false, isRequired: false, transformFunction: null }, filterWith: { classPropertyName: "filterWith", publicName: "filterWith", isSignal: false, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch", selectionChange: "selectionChange", searchChange: "searchChange", value: "valueChange" }, providers: [
|
|
1486
2373
|
{
|
|
1487
2374
|
provide: NG_VALUE_ACCESSOR,
|
|
1488
2375
|
useExisting: forwardRef(() => TdAutocompleteSelect),
|
|
@@ -1494,8 +2381,8 @@ class TdAutocompleteSelect {
|
|
|
1494
2381
|
#origin="cdkOverlayOrigin"
|
|
1495
2382
|
class="td-select td-select--autocomplete"
|
|
1496
2383
|
[class.td-select--open]="open"
|
|
1497
|
-
[class.td-select--error]="
|
|
1498
|
-
[class.td-select--disabled]="
|
|
2384
|
+
[class.td-select--error]="hasError()"
|
|
2385
|
+
[class.td-select--disabled]="isDisabled()"
|
|
1499
2386
|
[class.td-select--dark]="dark"
|
|
1500
2387
|
>
|
|
1501
2388
|
<label [for]="inputId">{{ label }}</label>
|
|
@@ -1509,7 +2396,7 @@ class TdAutocompleteSelect {
|
|
|
1509
2396
|
role="combobox"
|
|
1510
2397
|
[value]="search"
|
|
1511
2398
|
[placeholder]="placeholder"
|
|
1512
|
-
[disabled]="
|
|
2399
|
+
[disabled]="isDisabled()"
|
|
1513
2400
|
[attr.aria-expanded]="open"
|
|
1514
2401
|
[attr.aria-controls]="listId"
|
|
1515
2402
|
(focus)="openPanel()"
|
|
@@ -1517,7 +2404,7 @@ class TdAutocompleteSelect {
|
|
|
1517
2404
|
(keydown)="handleKeydown($event)"
|
|
1518
2405
|
(blur)="onTouched()"
|
|
1519
2406
|
/>
|
|
1520
|
-
@if (clearable && (value !== null || search) && !
|
|
2407
|
+
@if (clearable && (value() !== null || search) && !isDisabled()) {
|
|
1521
2408
|
<button type="button" class="td-select__clear" title="Limpiar" (click)="clear($event)">
|
|
1522
2409
|
<td-icon nombre="close" tamano=".95rem" />
|
|
1523
2410
|
</button>
|
|
@@ -1530,9 +2417,9 @@ class TdAutocompleteSelect {
|
|
|
1530
2417
|
</div>
|
|
1531
2418
|
</div>
|
|
1532
2419
|
|
|
1533
|
-
@if (
|
|
1534
|
-
<p class="td-select__message" [class.td-select__message--error]="
|
|
1535
|
-
{{
|
|
2420
|
+
@if (displayError() || hint) {
|
|
2421
|
+
<p class="td-select__message" [class.td-select__message--error]="hasError()">
|
|
2422
|
+
{{ displayError() || hint }}
|
|
1536
2423
|
</p>
|
|
1537
2424
|
}
|
|
1538
2425
|
|
|
@@ -1563,7 +2450,7 @@ class TdAutocompleteSelect {
|
|
|
1563
2450
|
type="button"
|
|
1564
2451
|
role="option"
|
|
1565
2452
|
[class.td-select-panel__option--active]="index === activeIndex"
|
|
1566
|
-
[class.td-select-panel__option--selected]="compare(option.value, value)"
|
|
2453
|
+
[class.td-select-panel__option--selected]="compare(option.value, value())"
|
|
1567
2454
|
[disabled]="option.disabled"
|
|
1568
2455
|
(mousedown)="$event.preventDefault()"
|
|
1569
2456
|
(mouseenter)="activeIndex = index"
|
|
@@ -1578,7 +2465,7 @@ class TdAutocompleteSelect {
|
|
|
1578
2465
|
<small>{{ option.description }}</small>
|
|
1579
2466
|
}
|
|
1580
2467
|
</span>
|
|
1581
|
-
@if (compare(option.value, value)) {
|
|
2468
|
+
@if (compare(option.value, value())) {
|
|
1582
2469
|
<td-icon class="td-select-panel__check" nombre="check" />
|
|
1583
2470
|
}
|
|
1584
2471
|
</button>
|
|
@@ -1595,8 +2482,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1595
2482
|
#origin="cdkOverlayOrigin"
|
|
1596
2483
|
class="td-select td-select--autocomplete"
|
|
1597
2484
|
[class.td-select--open]="open"
|
|
1598
|
-
[class.td-select--error]="
|
|
1599
|
-
[class.td-select--disabled]="
|
|
2485
|
+
[class.td-select--error]="hasError()"
|
|
2486
|
+
[class.td-select--disabled]="isDisabled()"
|
|
1600
2487
|
[class.td-select--dark]="dark"
|
|
1601
2488
|
>
|
|
1602
2489
|
<label [for]="inputId">{{ label }}</label>
|
|
@@ -1610,7 +2497,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1610
2497
|
role="combobox"
|
|
1611
2498
|
[value]="search"
|
|
1612
2499
|
[placeholder]="placeholder"
|
|
1613
|
-
[disabled]="
|
|
2500
|
+
[disabled]="isDisabled()"
|
|
1614
2501
|
[attr.aria-expanded]="open"
|
|
1615
2502
|
[attr.aria-controls]="listId"
|
|
1616
2503
|
(focus)="openPanel()"
|
|
@@ -1618,7 +2505,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1618
2505
|
(keydown)="handleKeydown($event)"
|
|
1619
2506
|
(blur)="onTouched()"
|
|
1620
2507
|
/>
|
|
1621
|
-
@if (clearable && (value !== null || search) && !
|
|
2508
|
+
@if (clearable && (value() !== null || search) && !isDisabled()) {
|
|
1622
2509
|
<button type="button" class="td-select__clear" title="Limpiar" (click)="clear($event)">
|
|
1623
2510
|
<td-icon nombre="close" tamano=".95rem" />
|
|
1624
2511
|
</button>
|
|
@@ -1631,9 +2518,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1631
2518
|
</div>
|
|
1632
2519
|
</div>
|
|
1633
2520
|
|
|
1634
|
-
@if (
|
|
1635
|
-
<p class="td-select__message" [class.td-select__message--error]="
|
|
1636
|
-
{{
|
|
2521
|
+
@if (displayError() || hint) {
|
|
2522
|
+
<p class="td-select__message" [class.td-select__message--error]="hasError()">
|
|
2523
|
+
{{ displayError() || hint }}
|
|
1637
2524
|
</p>
|
|
1638
2525
|
}
|
|
1639
2526
|
|
|
@@ -1664,7 +2551,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1664
2551
|
type="button"
|
|
1665
2552
|
role="option"
|
|
1666
2553
|
[class.td-select-panel__option--active]="index === activeIndex"
|
|
1667
|
-
[class.td-select-panel__option--selected]="compare(option.value, value)"
|
|
2554
|
+
[class.td-select-panel__option--selected]="compare(option.value, value())"
|
|
1668
2555
|
[disabled]="option.disabled"
|
|
1669
2556
|
(mousedown)="$event.preventDefault()"
|
|
1670
2557
|
(mouseenter)="activeIndex = index"
|
|
@@ -1679,7 +2566,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1679
2566
|
<small>{{ option.description }}</small>
|
|
1680
2567
|
}
|
|
1681
2568
|
</span>
|
|
1682
|
-
@if (compare(option.value, value)) {
|
|
2569
|
+
@if (compare(option.value, value())) {
|
|
1683
2570
|
<td-icon class="td-select-panel__check" nombre="check" />
|
|
1684
2571
|
}
|
|
1685
2572
|
</button>
|
|
@@ -1715,9 +2602,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1715
2602
|
type: Input
|
|
1716
2603
|
}], dark: [{
|
|
1717
2604
|
type: Input
|
|
1718
|
-
}], disabled: [{
|
|
1719
|
-
type: Input
|
|
1720
|
-
}], scrollBehavior: [{
|
|
2605
|
+
}], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], scrollBehavior: [{
|
|
1721
2606
|
type: Input
|
|
1722
2607
|
}], minimumCharacters: [{
|
|
1723
2608
|
type: Input
|
|
@@ -1729,7 +2614,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1729
2614
|
type: Output
|
|
1730
2615
|
}], searchChange: [{
|
|
1731
2616
|
type: Output
|
|
1732
|
-
}] } });
|
|
2617
|
+
}], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
1733
2618
|
|
|
1734
2619
|
let selectSequence = 0;
|
|
1735
2620
|
class TdSelect {
|
|
@@ -1747,11 +2632,18 @@ class TdSelect {
|
|
|
1747
2632
|
emptyText = 'No hay opciones disponibles';
|
|
1748
2633
|
clearable = false;
|
|
1749
2634
|
dark = false;
|
|
1750
|
-
disabled = false;
|
|
2635
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
2636
|
+
invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
2637
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
2638
|
+
touch = output();
|
|
1751
2639
|
scrollBehavior = 'reposition';
|
|
1752
2640
|
compareWith = (first, second) => Object.is(first, second);
|
|
1753
2641
|
selectionChange = new EventEmitter();
|
|
1754
|
-
value = null;
|
|
2642
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2643
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
2644
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
2645
|
+
displayError = computed(() => this.error || this.errors()[0]?.message || '', ...(ngDevMode ? [{ debugName: "displayError" }] : /* istanbul ignore next */ []));
|
|
2646
|
+
hasError = computed(() => this.invalid() || !!this.displayError(), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
1755
2647
|
open = false;
|
|
1756
2648
|
activeIndex = -1;
|
|
1757
2649
|
scrollStrategy = this.scrollStrategies.reposition();
|
|
@@ -1762,7 +2654,7 @@ class TdSelect {
|
|
|
1762
2654
|
return `${this.generatedId}-list`;
|
|
1763
2655
|
}
|
|
1764
2656
|
get selectedOption() {
|
|
1765
|
-
return this.options.find((option) => this.compare(option.value, this.value));
|
|
2657
|
+
return this.options.find((option) => this.compare(option.value, this.value()));
|
|
1766
2658
|
}
|
|
1767
2659
|
onChange = () => undefined;
|
|
1768
2660
|
onTouched = () => undefined;
|
|
@@ -1785,7 +2677,7 @@ class TdSelect {
|
|
|
1785
2677
|
this.destroyRef.onDestroy(() => this.document.removeEventListener('scroll', scrollListener, true));
|
|
1786
2678
|
}
|
|
1787
2679
|
writeValue(value) {
|
|
1788
|
-
this.value
|
|
2680
|
+
this.value.set(value ?? null);
|
|
1789
2681
|
this.cdr.markForCheck();
|
|
1790
2682
|
}
|
|
1791
2683
|
registerOnChange(fn) {
|
|
@@ -1795,14 +2687,14 @@ class TdSelect {
|
|
|
1795
2687
|
this.onTouched = fn;
|
|
1796
2688
|
}
|
|
1797
2689
|
setDisabledState(disabled) {
|
|
1798
|
-
this.disabled
|
|
2690
|
+
this.cvaDisabled.set(disabled);
|
|
1799
2691
|
this.cdr.markForCheck();
|
|
1800
2692
|
}
|
|
1801
2693
|
compare(first, second) {
|
|
1802
2694
|
return this.compareWith(first, second);
|
|
1803
2695
|
}
|
|
1804
2696
|
toggle() {
|
|
1805
|
-
if (this.
|
|
2697
|
+
if (this.isDisabled())
|
|
1806
2698
|
return;
|
|
1807
2699
|
this.open ? this.close() : this.openPanel();
|
|
1808
2700
|
}
|
|
@@ -1811,6 +2703,7 @@ class TdSelect {
|
|
|
1811
2703
|
return;
|
|
1812
2704
|
this.open = false;
|
|
1813
2705
|
this.onTouched();
|
|
2706
|
+
this.touch.emit();
|
|
1814
2707
|
}
|
|
1815
2708
|
select(option) {
|
|
1816
2709
|
if (option.disabled)
|
|
@@ -1851,7 +2744,7 @@ class TdSelect {
|
|
|
1851
2744
|
}
|
|
1852
2745
|
openPanel() {
|
|
1853
2746
|
this.open = true;
|
|
1854
|
-
const selectedIndex = this.options.findIndex((option) => this.compare(option.value, this.value));
|
|
2747
|
+
const selectedIndex = this.options.findIndex((option) => this.compare(option.value, this.value()));
|
|
1855
2748
|
this.activeIndex = selectedIndex >= 0 ? selectedIndex : this.firstEnabledIndex();
|
|
1856
2749
|
}
|
|
1857
2750
|
moveActive(direction) {
|
|
@@ -1870,12 +2763,12 @@ class TdSelect {
|
|
|
1870
2763
|
return this.options.findIndex((option) => !option.disabled);
|
|
1871
2764
|
}
|
|
1872
2765
|
setValue(value) {
|
|
1873
|
-
this.value
|
|
2766
|
+
this.value.set(value);
|
|
1874
2767
|
this.onChange(value);
|
|
1875
2768
|
this.selectionChange.emit(value);
|
|
1876
2769
|
}
|
|
1877
2770
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1878
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdSelect, isStandalone: true, selector: "td-select", inputs: { label: "label", placeholder: "placeholder", options: "options", hint: "hint", error: "error", emptyText: "emptyText", clearable: "clearable", dark: "dark", disabled: "disabled", scrollBehavior: "scrollBehavior", compareWith: "compareWith" }, outputs: { selectionChange: "selectionChange" }, providers: [
|
|
2771
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdSelect, isStandalone: true, selector: "td-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: false, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: false, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, dark: { classPropertyName: "dark", publicName: "dark", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "scrollBehavior", isSignal: false, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch", selectionChange: "selectionChange", value: "valueChange" }, providers: [
|
|
1879
2772
|
{
|
|
1880
2773
|
provide: NG_VALUE_ACCESSOR,
|
|
1881
2774
|
useExisting: forwardRef(() => TdSelect),
|
|
@@ -1887,16 +2780,16 @@ class TdSelect {
|
|
|
1887
2780
|
#origin="cdkOverlayOrigin"
|
|
1888
2781
|
class="td-select"
|
|
1889
2782
|
[class.td-select--open]="open"
|
|
1890
|
-
[class.td-select--error]="
|
|
1891
|
-
[class.td-select--disabled]="
|
|
2783
|
+
[class.td-select--error]="hasError()"
|
|
2784
|
+
[class.td-select--disabled]="isDisabled()"
|
|
1892
2785
|
[class.td-select--dark]="dark"
|
|
1893
2786
|
>
|
|
1894
2787
|
<label [id]="labelId">{{ label }}</label>
|
|
1895
2788
|
<div
|
|
1896
2789
|
class="td-select__trigger"
|
|
1897
2790
|
role="combobox"
|
|
1898
|
-
[attr.tabindex]="
|
|
1899
|
-
[attr.aria-disabled]="
|
|
2791
|
+
[attr.tabindex]="isDisabled() ? -1 : 0"
|
|
2792
|
+
[attr.aria-disabled]="isDisabled()"
|
|
1900
2793
|
[attr.aria-labelledby]="labelId"
|
|
1901
2794
|
[attr.aria-expanded]="open"
|
|
1902
2795
|
[attr.aria-controls]="listId"
|
|
@@ -1909,7 +2802,7 @@ class TdSelect {
|
|
|
1909
2802
|
<span [class.td-select__placeholder]="!selectedOption">
|
|
1910
2803
|
{{ selectedOption?.label || placeholder }}
|
|
1911
2804
|
</span>
|
|
1912
|
-
@if (clearable && selectedOption && !
|
|
2805
|
+
@if (clearable && selectedOption && !isDisabled()) {
|
|
1913
2806
|
<button
|
|
1914
2807
|
type="button"
|
|
1915
2808
|
class="td-select__clear"
|
|
@@ -1927,9 +2820,9 @@ class TdSelect {
|
|
|
1927
2820
|
</div>
|
|
1928
2821
|
</div>
|
|
1929
2822
|
|
|
1930
|
-
@if (
|
|
1931
|
-
<p class="td-select__message" [class.td-select__message--error]="
|
|
1932
|
-
{{
|
|
2823
|
+
@if (displayError() || hint) {
|
|
2824
|
+
<p class="td-select__message" [class.td-select__message--error]="hasError()">
|
|
2825
|
+
{{ displayError() || hint }}
|
|
1933
2826
|
</p>
|
|
1934
2827
|
}
|
|
1935
2828
|
|
|
@@ -1960,8 +2853,8 @@ class TdSelect {
|
|
|
1960
2853
|
type="button"
|
|
1961
2854
|
role="option"
|
|
1962
2855
|
[class.td-select-panel__option--active]="index === activeIndex"
|
|
1963
|
-
[class.td-select-panel__option--selected]="compare(option.value, value)"
|
|
1964
|
-
[attr.aria-selected]="compare(option.value, value)"
|
|
2856
|
+
[class.td-select-panel__option--selected]="compare(option.value, value())"
|
|
2857
|
+
[attr.aria-selected]="compare(option.value, value())"
|
|
1965
2858
|
[disabled]="option.disabled"
|
|
1966
2859
|
(mouseenter)="activeIndex = index"
|
|
1967
2860
|
(click)="select(option)"
|
|
@@ -1975,7 +2868,7 @@ class TdSelect {
|
|
|
1975
2868
|
<small>{{ option.description }}</small>
|
|
1976
2869
|
}
|
|
1977
2870
|
</span>
|
|
1978
|
-
@if (compare(option.value, value)) {
|
|
2871
|
+
@if (compare(option.value, value())) {
|
|
1979
2872
|
<td-icon class="td-select-panel__check" nombre="check" />
|
|
1980
2873
|
}
|
|
1981
2874
|
</button>
|
|
@@ -1992,16 +2885,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1992
2885
|
#origin="cdkOverlayOrigin"
|
|
1993
2886
|
class="td-select"
|
|
1994
2887
|
[class.td-select--open]="open"
|
|
1995
|
-
[class.td-select--error]="
|
|
1996
|
-
[class.td-select--disabled]="
|
|
2888
|
+
[class.td-select--error]="hasError()"
|
|
2889
|
+
[class.td-select--disabled]="isDisabled()"
|
|
1997
2890
|
[class.td-select--dark]="dark"
|
|
1998
2891
|
>
|
|
1999
2892
|
<label [id]="labelId">{{ label }}</label>
|
|
2000
2893
|
<div
|
|
2001
2894
|
class="td-select__trigger"
|
|
2002
2895
|
role="combobox"
|
|
2003
|
-
[attr.tabindex]="
|
|
2004
|
-
[attr.aria-disabled]="
|
|
2896
|
+
[attr.tabindex]="isDisabled() ? -1 : 0"
|
|
2897
|
+
[attr.aria-disabled]="isDisabled()"
|
|
2005
2898
|
[attr.aria-labelledby]="labelId"
|
|
2006
2899
|
[attr.aria-expanded]="open"
|
|
2007
2900
|
[attr.aria-controls]="listId"
|
|
@@ -2014,7 +2907,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2014
2907
|
<span [class.td-select__placeholder]="!selectedOption">
|
|
2015
2908
|
{{ selectedOption?.label || placeholder }}
|
|
2016
2909
|
</span>
|
|
2017
|
-
@if (clearable && selectedOption && !
|
|
2910
|
+
@if (clearable && selectedOption && !isDisabled()) {
|
|
2018
2911
|
<button
|
|
2019
2912
|
type="button"
|
|
2020
2913
|
class="td-select__clear"
|
|
@@ -2032,9 +2925,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2032
2925
|
</div>
|
|
2033
2926
|
</div>
|
|
2034
2927
|
|
|
2035
|
-
@if (
|
|
2036
|
-
<p class="td-select__message" [class.td-select__message--error]="
|
|
2037
|
-
{{
|
|
2928
|
+
@if (displayError() || hint) {
|
|
2929
|
+
<p class="td-select__message" [class.td-select__message--error]="hasError()">
|
|
2930
|
+
{{ displayError() || hint }}
|
|
2038
2931
|
</p>
|
|
2039
2932
|
}
|
|
2040
2933
|
|
|
@@ -2065,8 +2958,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2065
2958
|
type="button"
|
|
2066
2959
|
role="option"
|
|
2067
2960
|
[class.td-select-panel__option--active]="index === activeIndex"
|
|
2068
|
-
[class.td-select-panel__option--selected]="compare(option.value, value)"
|
|
2069
|
-
[attr.aria-selected]="compare(option.value, value)"
|
|
2961
|
+
[class.td-select-panel__option--selected]="compare(option.value, value())"
|
|
2962
|
+
[attr.aria-selected]="compare(option.value, value())"
|
|
2070
2963
|
[disabled]="option.disabled"
|
|
2071
2964
|
(mouseenter)="activeIndex = index"
|
|
2072
2965
|
(click)="select(option)"
|
|
@@ -2080,7 +2973,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2080
2973
|
<small>{{ option.description }}</small>
|
|
2081
2974
|
}
|
|
2082
2975
|
</span>
|
|
2083
|
-
@if (compare(option.value, value)) {
|
|
2976
|
+
@if (compare(option.value, value())) {
|
|
2084
2977
|
<td-icon class="td-select-panel__check" nombre="check" />
|
|
2085
2978
|
}
|
|
2086
2979
|
</button>
|
|
@@ -2113,15 +3006,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2113
3006
|
type: Input
|
|
2114
3007
|
}], dark: [{
|
|
2115
3008
|
type: Input
|
|
2116
|
-
}], disabled: [{
|
|
2117
|
-
type: Input
|
|
2118
|
-
}], scrollBehavior: [{
|
|
3009
|
+
}], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], scrollBehavior: [{
|
|
2119
3010
|
type: Input
|
|
2120
3011
|
}], compareWith: [{
|
|
2121
3012
|
type: Input
|
|
2122
3013
|
}], selectionChange: [{
|
|
2123
3014
|
type: Output
|
|
2124
|
-
}] } });
|
|
3015
|
+
}], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
2125
3016
|
|
|
2126
3017
|
class TdSidebar {
|
|
2127
3018
|
titulo = 'Gestión Corporativa';
|
|
@@ -2222,6 +3113,327 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2222
3113
|
type: Output
|
|
2223
3114
|
}] } });
|
|
2224
3115
|
|
|
3116
|
+
let tabSequence = 0;
|
|
3117
|
+
class TdTab {
|
|
3118
|
+
generatedId = `td-tab-${++tabSequence}`;
|
|
3119
|
+
id = '';
|
|
3120
|
+
label = 'Tab';
|
|
3121
|
+
icon = '';
|
|
3122
|
+
disabled = false;
|
|
3123
|
+
badge = null;
|
|
3124
|
+
content;
|
|
3125
|
+
get resolvedId() {
|
|
3126
|
+
return this.id || this.generatedId;
|
|
3127
|
+
}
|
|
3128
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdTab, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3129
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.17", type: TdTab, isStandalone: true, selector: "td-tab", inputs: { id: "id", label: "label", icon: "icon", disabled: "disabled", badge: "badge" }, viewQueries: [{ propertyName: "content", first: true, predicate: TemplateRef, descendants: true, static: true }], ngImport: i0, template: `
|
|
3130
|
+
<ng-template>
|
|
3131
|
+
<ng-content />
|
|
3132
|
+
</ng-template>
|
|
3133
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3134
|
+
}
|
|
3135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdTab, decorators: [{
|
|
3136
|
+
type: Component,
|
|
3137
|
+
args: [{
|
|
3138
|
+
selector: 'td-tab',
|
|
3139
|
+
template: `
|
|
3140
|
+
<ng-template>
|
|
3141
|
+
<ng-content />
|
|
3142
|
+
</ng-template>
|
|
3143
|
+
`,
|
|
3144
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3145
|
+
}]
|
|
3146
|
+
}], propDecorators: { id: [{
|
|
3147
|
+
type: Input
|
|
3148
|
+
}], label: [{
|
|
3149
|
+
type: Input
|
|
3150
|
+
}], icon: [{
|
|
3151
|
+
type: Input
|
|
3152
|
+
}], disabled: [{
|
|
3153
|
+
type: Input
|
|
3154
|
+
}], badge: [{
|
|
3155
|
+
type: Input
|
|
3156
|
+
}], content: [{
|
|
3157
|
+
type: ViewChild,
|
|
3158
|
+
args: [TemplateRef, { static: true }]
|
|
3159
|
+
}] } });
|
|
3160
|
+
|
|
3161
|
+
class TdTabs {
|
|
3162
|
+
cdr = inject(ChangeDetectorRef);
|
|
3163
|
+
tabsChange;
|
|
3164
|
+
requestedIndex = 0;
|
|
3165
|
+
tabQuery;
|
|
3166
|
+
tabList;
|
|
3167
|
+
tabButtons;
|
|
3168
|
+
set selectedIndex(value) {
|
|
3169
|
+
this.requestedIndex = Number.isFinite(value) ? Math.max(0, Math.trunc(value)) : 0;
|
|
3170
|
+
if (this.tabQuery)
|
|
3171
|
+
this.applyRequestedIndex();
|
|
3172
|
+
}
|
|
3173
|
+
get selectedIndex() {
|
|
3174
|
+
return this.activeIndex;
|
|
3175
|
+
}
|
|
3176
|
+
variant = 'linea';
|
|
3177
|
+
alignment = 'inicio';
|
|
3178
|
+
stretch = false;
|
|
3179
|
+
dark = false;
|
|
3180
|
+
ariaLabel = 'Pestañas';
|
|
3181
|
+
panelFocusable = false;
|
|
3182
|
+
selectedIndexChange = new EventEmitter();
|
|
3183
|
+
tabChange = new EventEmitter();
|
|
3184
|
+
tabs = [];
|
|
3185
|
+
activeIndex = 0;
|
|
3186
|
+
get activeTab() {
|
|
3187
|
+
return this.tabs[this.activeIndex] ?? null;
|
|
3188
|
+
}
|
|
3189
|
+
ngAfterContentInit() {
|
|
3190
|
+
this.syncTabs();
|
|
3191
|
+
this.tabsChange = this.tabQuery.changes.subscribe(() => this.syncTabs());
|
|
3192
|
+
}
|
|
3193
|
+
ngOnDestroy() {
|
|
3194
|
+
this.tabsChange?.unsubscribe();
|
|
3195
|
+
}
|
|
3196
|
+
select(index, focus = false) {
|
|
3197
|
+
const tab = this.tabs[index];
|
|
3198
|
+
if (!tab || tab.disabled || index === this.activeIndex) {
|
|
3199
|
+
if (focus && tab && !tab.disabled)
|
|
3200
|
+
this.focusButton(index);
|
|
3201
|
+
return;
|
|
3202
|
+
}
|
|
3203
|
+
this.activeIndex = index;
|
|
3204
|
+
this.requestedIndex = index;
|
|
3205
|
+
this.selectedIndexChange.emit(index);
|
|
3206
|
+
this.tabChange.emit(tab);
|
|
3207
|
+
this.cdr.markForCheck();
|
|
3208
|
+
queueMicrotask(() => {
|
|
3209
|
+
this.ensureTabVisible(index, focus ? 'auto' : 'smooth');
|
|
3210
|
+
if (focus)
|
|
3211
|
+
this.focusButton(index);
|
|
3212
|
+
});
|
|
3213
|
+
}
|
|
3214
|
+
handleKeydown(event) {
|
|
3215
|
+
const horizontalKeys = ['ArrowLeft', 'ArrowRight'];
|
|
3216
|
+
if (!horizontalKeys.includes(event.key) && !['Home', 'End'].includes(event.key))
|
|
3217
|
+
return;
|
|
3218
|
+
event.preventDefault();
|
|
3219
|
+
if (event.key === 'Home') {
|
|
3220
|
+
this.select(this.firstEnabledIndex(), true);
|
|
3221
|
+
return;
|
|
3222
|
+
}
|
|
3223
|
+
if (event.key === 'End') {
|
|
3224
|
+
this.select(this.lastEnabledIndex(), true);
|
|
3225
|
+
return;
|
|
3226
|
+
}
|
|
3227
|
+
this.select(this.nextEnabledIndex(event.key === 'ArrowRight' ? 1 : -1), true);
|
|
3228
|
+
}
|
|
3229
|
+
tabId(tab) {
|
|
3230
|
+
return `${tab.resolvedId}-trigger`;
|
|
3231
|
+
}
|
|
3232
|
+
panelId(tab) {
|
|
3233
|
+
return `${tab.resolvedId}-panel`;
|
|
3234
|
+
}
|
|
3235
|
+
syncTabs() {
|
|
3236
|
+
this.tabs = this.tabQuery.toArray();
|
|
3237
|
+
this.applyRequestedIndex();
|
|
3238
|
+
this.cdr.markForCheck();
|
|
3239
|
+
queueMicrotask(() => this.ensureTabVisible(this.activeIndex, 'auto'));
|
|
3240
|
+
}
|
|
3241
|
+
applyRequestedIndex() {
|
|
3242
|
+
if (!this.tabs.length) {
|
|
3243
|
+
this.activeIndex = 0;
|
|
3244
|
+
return;
|
|
3245
|
+
}
|
|
3246
|
+
const requested = Math.min(this.requestedIndex, this.tabs.length - 1);
|
|
3247
|
+
if (!this.tabs[requested]?.disabled) {
|
|
3248
|
+
this.activeIndex = requested;
|
|
3249
|
+
return;
|
|
3250
|
+
}
|
|
3251
|
+
const firstEnabled = this.firstEnabledIndex();
|
|
3252
|
+
this.activeIndex = firstEnabled >= 0 ? firstEnabled : 0;
|
|
3253
|
+
}
|
|
3254
|
+
nextEnabledIndex(direction) {
|
|
3255
|
+
if (!this.tabs.length)
|
|
3256
|
+
return 0;
|
|
3257
|
+
let next = this.activeIndex;
|
|
3258
|
+
for (let index = 0; index < this.tabs.length; index++) {
|
|
3259
|
+
next = (next + direction + this.tabs.length) % this.tabs.length;
|
|
3260
|
+
if (!this.tabs[next]?.disabled)
|
|
3261
|
+
return next;
|
|
3262
|
+
}
|
|
3263
|
+
return this.activeIndex;
|
|
3264
|
+
}
|
|
3265
|
+
firstEnabledIndex() {
|
|
3266
|
+
return this.tabs.findIndex((tab) => !tab.disabled);
|
|
3267
|
+
}
|
|
3268
|
+
lastEnabledIndex() {
|
|
3269
|
+
for (let index = this.tabs.length - 1; index >= 0; index--) {
|
|
3270
|
+
if (!this.tabs[index]?.disabled)
|
|
3271
|
+
return index;
|
|
3272
|
+
}
|
|
3273
|
+
return this.activeIndex;
|
|
3274
|
+
}
|
|
3275
|
+
focusButton(index) {
|
|
3276
|
+
this.tabButtons.get(index)?.nativeElement.focus();
|
|
3277
|
+
}
|
|
3278
|
+
ensureTabVisible(index, behavior) {
|
|
3279
|
+
const list = this.tabList?.nativeElement;
|
|
3280
|
+
const button = this.tabButtons?.get(index)?.nativeElement;
|
|
3281
|
+
if (!list || !button || list.scrollWidth <= list.clientWidth)
|
|
3282
|
+
return;
|
|
3283
|
+
const padding = 8;
|
|
3284
|
+
const visibleStart = list.scrollLeft + padding;
|
|
3285
|
+
const visibleEnd = list.scrollLeft + list.clientWidth - padding;
|
|
3286
|
+
const tabStart = button.offsetLeft;
|
|
3287
|
+
const tabEnd = tabStart + button.offsetWidth;
|
|
3288
|
+
if (tabStart < visibleStart) {
|
|
3289
|
+
list.scrollTo({ left: Math.max(0, tabStart - padding), behavior });
|
|
3290
|
+
}
|
|
3291
|
+
else if (tabEnd > visibleEnd) {
|
|
3292
|
+
list.scrollTo({
|
|
3293
|
+
left: tabEnd - list.clientWidth + padding,
|
|
3294
|
+
behavior,
|
|
3295
|
+
});
|
|
3296
|
+
}
|
|
3297
|
+
}
|
|
3298
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdTabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3299
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdTabs, isStandalone: true, selector: "td-tabs", inputs: { selectedIndex: "selectedIndex", variant: "variant", alignment: "alignment", stretch: "stretch", dark: "dark", ariaLabel: "ariaLabel", panelFocusable: "panelFocusable" }, outputs: { selectedIndexChange: "selectedIndexChange", tabChange: "tabChange" }, queries: [{ propertyName: "tabQuery", predicate: TdTab }], viewQueries: [{ propertyName: "tabList", first: true, predicate: ["tabList"], descendants: true }, { propertyName: "tabButtons", predicate: ["tabButton"], descendants: true }], ngImport: i0, template: `
|
|
3300
|
+
<section
|
|
3301
|
+
class="td-tabs"
|
|
3302
|
+
[class.td-tabs--dark]="dark"
|
|
3303
|
+
[class.td-tabs--stretch]="stretch"
|
|
3304
|
+
[class]="'td-tabs td-tabs--' + variant + ' td-tabs--align-' + alignment +
|
|
3305
|
+
(dark ? ' td-tabs--dark' : '') + (stretch ? ' td-tabs--stretch' : '')"
|
|
3306
|
+
>
|
|
3307
|
+
<div
|
|
3308
|
+
#tabList
|
|
3309
|
+
class="td-tabs__list"
|
|
3310
|
+
role="tablist"
|
|
3311
|
+
[attr.aria-label]="ariaLabel"
|
|
3312
|
+
(keydown)="handleKeydown($event)"
|
|
3313
|
+
>
|
|
3314
|
+
@for (tab of tabs; track tab.resolvedId; let index = $index) {
|
|
3315
|
+
<button
|
|
3316
|
+
#tabButton
|
|
3317
|
+
type="button"
|
|
3318
|
+
class="td-tabs__tab"
|
|
3319
|
+
role="tab"
|
|
3320
|
+
[id]="tabId(tab)"
|
|
3321
|
+
[class.td-tabs__tab--active]="index === activeIndex"
|
|
3322
|
+
[disabled]="tab.disabled"
|
|
3323
|
+
[attr.tabindex]="index === activeIndex ? 0 : -1"
|
|
3324
|
+
[attr.aria-selected]="index === activeIndex"
|
|
3325
|
+
[attr.aria-controls]="panelId(tab)"
|
|
3326
|
+
(click)="select(index)"
|
|
3327
|
+
>
|
|
3328
|
+
@if (tab.icon) {
|
|
3329
|
+
<td-icon [nombre]="tab.icon" />
|
|
3330
|
+
}
|
|
3331
|
+
<span>{{ tab.label }}</span>
|
|
3332
|
+
@if (tab.badge !== null) {
|
|
3333
|
+
<small>{{ tab.badge }}</small>
|
|
3334
|
+
}
|
|
3335
|
+
</button>
|
|
3336
|
+
}
|
|
3337
|
+
</div>
|
|
3338
|
+
|
|
3339
|
+
@if (activeTab; as tab) {
|
|
3340
|
+
<div
|
|
3341
|
+
class="td-tabs__panel"
|
|
3342
|
+
role="tabpanel"
|
|
3343
|
+
[id]="panelId(tab)"
|
|
3344
|
+
[attr.aria-labelledby]="tabId(tab)"
|
|
3345
|
+
[attr.tabindex]="panelFocusable ? 0 : null"
|
|
3346
|
+
>
|
|
3347
|
+
<ng-container [ngTemplateOutlet]="tab.content" />
|
|
3348
|
+
</div>
|
|
3349
|
+
}
|
|
3350
|
+
</section>
|
|
3351
|
+
`, isInline: true, styles: [":host{display:block;min-width:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}.td-tabs{--td-tabs-bg: #fff;--td-tabs-soft: #f7f8fb;--td-tabs-border: #e3e7ef;--td-tabs-text: #263147;--td-tabs-muted: #748096;--td-tabs-accent: #5746d8;min-width:0;color:var(--td-tabs-text)}.td-tabs--dark{--td-tabs-bg: #19191f;--td-tabs-soft: #202028;--td-tabs-border: #303039;--td-tabs-text: #ededf0;--td-tabs-muted: #a1a1aa;--td-tabs-accent: #b9b0fa}.td-tabs__list{display:flex;width:100%;min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-inline:contain;scroll-padding-inline:.5rem;scroll-snap-type:inline proximity;touch-action:pan-x;-webkit-overflow-scrolling:touch;scrollbar-width:none}.td-tabs__list::-webkit-scrollbar{display:none}.td-tabs--align-centro .td-tabs__list{justify-content:safe center}.td-tabs--align-fin .td-tabs__list{justify-content:safe flex-end}.td-tabs__tab{position:relative;display:inline-flex;min-height:2.85rem;flex:0 0 auto;align-items:center;justify-content:center;gap:.45rem;border:0;padding:.7rem .95rem;color:var(--td-tabs-muted);background:transparent;font:750 .72rem/1 system-ui,sans-serif;white-space:nowrap;scroll-snap-align:start;cursor:pointer;transition:color .13s ease,background .13s ease}.td-tabs--stretch .td-tabs__tab{min-width:0;flex:1 1 0}.td-tabs__tab:hover:not(:disabled){color:var(--td-tabs-accent)}.td-tabs__tab:focus-visible{outline:2px solid var(--td-tabs-accent);outline-offset:-2px}.td-tabs__tab:disabled{opacity:.42;cursor:not-allowed}.td-tabs__tab small{min-width:1.25rem;border-radius:999px;padding:.22rem .38rem;color:var(--td-tabs-muted);background:var(--td-tabs-soft);font-size:.58rem}.td-tabs--linea .td-tabs__list{border-bottom:1px solid var(--td-tabs-border)}.td-tabs--linea .td-tabs__tab:after{position:absolute;right:.65rem;bottom:-1px;left:.65rem;height:2px;border-radius:999px 999px 0 0;background:transparent;content:\"\"}.td-tabs--linea .td-tabs__tab--active{color:var(--td-tabs-accent)}.td-tabs--linea .td-tabs__tab--active:after{background:var(--td-tabs-accent)}.td-tabs--pastilla .td-tabs__list{gap:.3rem;border:1px solid var(--td-tabs-border);border-radius:.8rem;padding:.28rem;background:var(--td-tabs-soft)}.td-tabs--pastilla .td-tabs__tab{min-height:2.35rem;border-radius:.58rem}.td-tabs--pastilla .td-tabs__tab--active{color:var(--td-tabs-accent);background:var(--td-tabs-bg);box-shadow:0 3px 10px #0f172a14}.td-tabs--contenida{overflow:hidden;border:1px solid var(--td-tabs-border);border-radius:.9rem;background:var(--td-tabs-bg)}.td-tabs--contenida .td-tabs__list{border-bottom:1px solid var(--td-tabs-border);padding:0 .45rem;background:var(--td-tabs-soft)}.td-tabs--contenida .td-tabs__tab--active{color:var(--td-tabs-accent);background:var(--td-tabs-bg)}.td-tabs--contenida .td-tabs__panel{padding:1.25rem}.td-tabs__panel{min-width:0;padding-top:1.15rem;animation:td-tabs-panel-in .14s ease-out}@keyframes td-tabs-panel-in{0%{opacity:0;transform:translateY(.18rem)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.td-tabs__panel{animation:none}}@media(max-width:600px){.td-tabs__list{justify-content:flex-start!important}.td-tabs--stretch .td-tabs__tab{min-width:max-content;flex:0 0 auto}.td-tabs--contenida .td-tabs__list{padding-inline:.25rem}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TdIcon, selector: "td-icon", inputs: ["nombre", "titulo", "tamano"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3352
|
+
}
|
|
3353
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdTabs, decorators: [{
|
|
3354
|
+
type: Component,
|
|
3355
|
+
args: [{ selector: 'td-tabs', imports: [NgTemplateOutlet, TdIcon], template: `
|
|
3356
|
+
<section
|
|
3357
|
+
class="td-tabs"
|
|
3358
|
+
[class.td-tabs--dark]="dark"
|
|
3359
|
+
[class.td-tabs--stretch]="stretch"
|
|
3360
|
+
[class]="'td-tabs td-tabs--' + variant + ' td-tabs--align-' + alignment +
|
|
3361
|
+
(dark ? ' td-tabs--dark' : '') + (stretch ? ' td-tabs--stretch' : '')"
|
|
3362
|
+
>
|
|
3363
|
+
<div
|
|
3364
|
+
#tabList
|
|
3365
|
+
class="td-tabs__list"
|
|
3366
|
+
role="tablist"
|
|
3367
|
+
[attr.aria-label]="ariaLabel"
|
|
3368
|
+
(keydown)="handleKeydown($event)"
|
|
3369
|
+
>
|
|
3370
|
+
@for (tab of tabs; track tab.resolvedId; let index = $index) {
|
|
3371
|
+
<button
|
|
3372
|
+
#tabButton
|
|
3373
|
+
type="button"
|
|
3374
|
+
class="td-tabs__tab"
|
|
3375
|
+
role="tab"
|
|
3376
|
+
[id]="tabId(tab)"
|
|
3377
|
+
[class.td-tabs__tab--active]="index === activeIndex"
|
|
3378
|
+
[disabled]="tab.disabled"
|
|
3379
|
+
[attr.tabindex]="index === activeIndex ? 0 : -1"
|
|
3380
|
+
[attr.aria-selected]="index === activeIndex"
|
|
3381
|
+
[attr.aria-controls]="panelId(tab)"
|
|
3382
|
+
(click)="select(index)"
|
|
3383
|
+
>
|
|
3384
|
+
@if (tab.icon) {
|
|
3385
|
+
<td-icon [nombre]="tab.icon" />
|
|
3386
|
+
}
|
|
3387
|
+
<span>{{ tab.label }}</span>
|
|
3388
|
+
@if (tab.badge !== null) {
|
|
3389
|
+
<small>{{ tab.badge }}</small>
|
|
3390
|
+
}
|
|
3391
|
+
</button>
|
|
3392
|
+
}
|
|
3393
|
+
</div>
|
|
3394
|
+
|
|
3395
|
+
@if (activeTab; as tab) {
|
|
3396
|
+
<div
|
|
3397
|
+
class="td-tabs__panel"
|
|
3398
|
+
role="tabpanel"
|
|
3399
|
+
[id]="panelId(tab)"
|
|
3400
|
+
[attr.aria-labelledby]="tabId(tab)"
|
|
3401
|
+
[attr.tabindex]="panelFocusable ? 0 : null"
|
|
3402
|
+
>
|
|
3403
|
+
<ng-container [ngTemplateOutlet]="tab.content" />
|
|
3404
|
+
</div>
|
|
3405
|
+
}
|
|
3406
|
+
</section>
|
|
3407
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;min-width:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}.td-tabs{--td-tabs-bg: #fff;--td-tabs-soft: #f7f8fb;--td-tabs-border: #e3e7ef;--td-tabs-text: #263147;--td-tabs-muted: #748096;--td-tabs-accent: #5746d8;min-width:0;color:var(--td-tabs-text)}.td-tabs--dark{--td-tabs-bg: #19191f;--td-tabs-soft: #202028;--td-tabs-border: #303039;--td-tabs-text: #ededf0;--td-tabs-muted: #a1a1aa;--td-tabs-accent: #b9b0fa}.td-tabs__list{display:flex;width:100%;min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-inline:contain;scroll-padding-inline:.5rem;scroll-snap-type:inline proximity;touch-action:pan-x;-webkit-overflow-scrolling:touch;scrollbar-width:none}.td-tabs__list::-webkit-scrollbar{display:none}.td-tabs--align-centro .td-tabs__list{justify-content:safe center}.td-tabs--align-fin .td-tabs__list{justify-content:safe flex-end}.td-tabs__tab{position:relative;display:inline-flex;min-height:2.85rem;flex:0 0 auto;align-items:center;justify-content:center;gap:.45rem;border:0;padding:.7rem .95rem;color:var(--td-tabs-muted);background:transparent;font:750 .72rem/1 system-ui,sans-serif;white-space:nowrap;scroll-snap-align:start;cursor:pointer;transition:color .13s ease,background .13s ease}.td-tabs--stretch .td-tabs__tab{min-width:0;flex:1 1 0}.td-tabs__tab:hover:not(:disabled){color:var(--td-tabs-accent)}.td-tabs__tab:focus-visible{outline:2px solid var(--td-tabs-accent);outline-offset:-2px}.td-tabs__tab:disabled{opacity:.42;cursor:not-allowed}.td-tabs__tab small{min-width:1.25rem;border-radius:999px;padding:.22rem .38rem;color:var(--td-tabs-muted);background:var(--td-tabs-soft);font-size:.58rem}.td-tabs--linea .td-tabs__list{border-bottom:1px solid var(--td-tabs-border)}.td-tabs--linea .td-tabs__tab:after{position:absolute;right:.65rem;bottom:-1px;left:.65rem;height:2px;border-radius:999px 999px 0 0;background:transparent;content:\"\"}.td-tabs--linea .td-tabs__tab--active{color:var(--td-tabs-accent)}.td-tabs--linea .td-tabs__tab--active:after{background:var(--td-tabs-accent)}.td-tabs--pastilla .td-tabs__list{gap:.3rem;border:1px solid var(--td-tabs-border);border-radius:.8rem;padding:.28rem;background:var(--td-tabs-soft)}.td-tabs--pastilla .td-tabs__tab{min-height:2.35rem;border-radius:.58rem}.td-tabs--pastilla .td-tabs__tab--active{color:var(--td-tabs-accent);background:var(--td-tabs-bg);box-shadow:0 3px 10px #0f172a14}.td-tabs--contenida{overflow:hidden;border:1px solid var(--td-tabs-border);border-radius:.9rem;background:var(--td-tabs-bg)}.td-tabs--contenida .td-tabs__list{border-bottom:1px solid var(--td-tabs-border);padding:0 .45rem;background:var(--td-tabs-soft)}.td-tabs--contenida .td-tabs__tab--active{color:var(--td-tabs-accent);background:var(--td-tabs-bg)}.td-tabs--contenida .td-tabs__panel{padding:1.25rem}.td-tabs__panel{min-width:0;padding-top:1.15rem;animation:td-tabs-panel-in .14s ease-out}@keyframes td-tabs-panel-in{0%{opacity:0;transform:translateY(.18rem)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.td-tabs__panel{animation:none}}@media(max-width:600px){.td-tabs__list{justify-content:flex-start!important}.td-tabs--stretch .td-tabs__tab{min-width:max-content;flex:0 0 auto}.td-tabs--contenida .td-tabs__list{padding-inline:.25rem}}\n"] }]
|
|
3408
|
+
}], propDecorators: { tabQuery: [{
|
|
3409
|
+
type: ContentChildren,
|
|
3410
|
+
args: [TdTab]
|
|
3411
|
+
}], tabList: [{
|
|
3412
|
+
type: ViewChild,
|
|
3413
|
+
args: ['tabList']
|
|
3414
|
+
}], tabButtons: [{
|
|
3415
|
+
type: ViewChildren,
|
|
3416
|
+
args: ['tabButton']
|
|
3417
|
+
}], selectedIndex: [{
|
|
3418
|
+
type: Input
|
|
3419
|
+
}], variant: [{
|
|
3420
|
+
type: Input
|
|
3421
|
+
}], alignment: [{
|
|
3422
|
+
type: Input
|
|
3423
|
+
}], stretch: [{
|
|
3424
|
+
type: Input
|
|
3425
|
+
}], dark: [{
|
|
3426
|
+
type: Input
|
|
3427
|
+
}], ariaLabel: [{
|
|
3428
|
+
type: Input
|
|
3429
|
+
}], panelFocusable: [{
|
|
3430
|
+
type: Input
|
|
3431
|
+
}], selectedIndexChange: [{
|
|
3432
|
+
type: Output
|
|
3433
|
+
}], tabChange: [{
|
|
3434
|
+
type: Output
|
|
3435
|
+
}] } });
|
|
3436
|
+
|
|
2225
3437
|
/*
|
|
2226
3438
|
* Public API Surface of telcomdev-ui
|
|
2227
3439
|
*/
|
|
@@ -2230,5 +3442,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2230
3442
|
* Generated bundle index. Do not edit.
|
|
2231
3443
|
*/
|
|
2232
3444
|
|
|
2233
|
-
export { TD_DIALOG_CONFIG, TD_DIALOG_DATA, TD_ICONOS, TD_ICONOS_NOMBRES, TdAlerta, TdAutocompleteSelect, TdDataTable, TdDialog, TdDialogActions, TdDialogClose, TdDialogPrimary, TdDialogRef, TdFooter, TdHeader, TdIcon, TdIconoRegistry, TdInput, TdSelect, TdSidebar, TelcomdevUi };
|
|
3445
|
+
export { TD_DIALOG_CONFIG, TD_DIALOG_DATA, TD_ICONOS, TD_ICONOS_NOMBRES, TdAlerta, TdAutocompleteSelect, TdDataTable, TdDatePicker, TdDialog, TdDialogActions, TdDialogClose, TdDialogPrimary, TdDialogRef, TdFooter, TdHeader, TdIcon, TdIconoRegistry, TdInput, TdSelect, TdSidebar, TdTab, TdTabs, TelcomdevUi };
|
|
2234
3446
|
//# sourceMappingURL=telcomdev-ui.mjs.map
|