@ziadshalaby/ngx-zs-component 2.0.8 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ziadshalaby-ngx-zs-component.mjs +484 -168
- package/fesm2022/ziadshalaby-ngx-zs-component.mjs.map +1 -1
- package/index.d.ts +136 -21
- package/output.css +372 -72
- package/package.json +1 -1
|
@@ -379,152 +379,424 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
|
|
|
379
379
|
args: [{ selector: 'ZS-nav-item', imports: [CommonModule, RouterModule], template: "<!-- ========================= Conditional Rendering ========================= -->\n@if (item()) {\n @if (item().children?.length) {\n\n <!-- ========================= Parent Item with Dropdown ========================= -->\n <div class=\"zs:relative zs:w-full\">\n\n <!-- ========================= Main Toggle Button ========================= -->\n <button\n type=\"button\"\n (click)=\"toggle()\"\n [ngClass]=\"getItemClasses(item())\"\n class=\"zs:flex zs:w-full zs:items-center zs:gap-2 zs:rounded-md zs:px-3 zs:py-2 zs:text-left \n zs:text-sm zs:font-medium zs:md:text-base\"\n aria-haspopup=\"true\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"'submenu-' + index()\"\n >\n <div class=\"zs:flex zs:items-center\">\n @if (item().icon) {\n <i [ngClass]=\"[\n item().icon, \n item().iconClass ?? '',\n (item().icon && item().label) ? 'zs:mr-2' : ''\n ]\" aria-hidden=\"true\"></i>\n }\n <span class=\"zs:wrap-break-word\" [ngClass]=\"labelLineClass(item())\">{{ item().label }}</span>\n </div>\n <i class=\"fas fa-chevron-down zs:ml-auto zs:p-0.5 zs:text-xs\" aria-hidden=\"true\"></i>\n </button>\n\n <!-- ========================= Dropdown Menu ========================= -->\n <div\n [id]=\"'submenu-' + index()\"\n [ngClass]=\"{\n 'zs:block': isOpen(),\n 'zs:hidden': !isOpen(),\n 'zs:absolute zs:left-6 zs:w-50 zs:mt-1 zs:py-1 zs:bg-white zs:dark:bg-gray-800 \n zs:rounded-md shadow-md-all shadow-md-all-night': item().childrenOpenWindow,\n 'zs:px-4 zs:mt-1': !item().childrenOpenWindow\n }\"\n class=\"{{ zIndices.navItemDropdown }}\"\n role=\"menu\"\n [attr.aria-label]=\"item().label + ' submenu'\"\n >\n @for (child of item().children; track $index) {\n <ZS-nav-item\n [item]=\"child\"\n [collectionName]=\"collectionName() + '-' + index()\"\n (anyItemClickedEv)=\"handleChildClick($event)\"\n role=\"menuitem\"\n ></ZS-nav-item>\n }\n </div>\n\n </div>\n\n } @else {\n\n <!-- ========================= Leaf Item (No Children) ========================= -->\n <a\n [routerLink]=\"item().routerLink\"\n [routerLinkActive]=\"item().routerLinkActive ?? ''\"\n #rla=\"routerLinkActive\"\n [ngClass]=\"rla.isActive ? '' : getItemClasses(item())\"\n class=\"zs:flex zs:items-center zs:rounded-md zs:px-3 zs:py-2 \n zs:text-sm zs:font-medium zs:md:text-base\"\n (click)=\"onItemClick()\"\n role=\"menuitem\"\n >\n @if (item().icon) {\n <i [ngClass]=\"[\n item().icon,\n rla.isActive ? '' : item().iconClass ?? '',\n (item().icon && item().label) ? 'zs:mr-2' : ''\n ]\"\n aria-hidden=\"true\"></i>\n }\n <span class=\"zs:wrap-break-word zs:line-clamp-3\" [ngClass]=\"labelLineClass(item())\">{{ item().label }}</span>\n </a>\n }\n}" }]
|
|
380
380
|
}], ctorParameters: () => [], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }], collectionName: [{ type: i0.Input, args: [{ isSignal: true, alias: "collectionName", required: true }] }], anyItemClickedEv: [{ type: i0.Output, args: ["anyItemClickedEv"] }] } });
|
|
381
381
|
|
|
382
|
-
|
|
382
|
+
// Unified palette map with all configurations
|
|
383
|
+
const unifiedPaletteMap = new Map([
|
|
383
384
|
[
|
|
384
385
|
'secondary',
|
|
385
386
|
{
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
387
|
+
input: {
|
|
388
|
+
border: 'zs:border-slate-300 zs:dark:border-slate-600',
|
|
389
|
+
borderHover: 'zs:hover:border-slate-500 zs:dark:hover:border-slate-400',
|
|
390
|
+
inputBg: 'zs:bg-slate-50 zs:dark:bg-slate-900',
|
|
391
|
+
text: 'zs:text-slate-800 zs:dark:text-slate-300',
|
|
392
|
+
},
|
|
393
|
+
ring: {
|
|
394
|
+
ring: 'zs:focus-within:ring-slate-400 zs:dark:focus-within:ring-slate-600',
|
|
395
|
+
},
|
|
396
|
+
buttonSolid: {
|
|
397
|
+
btnBG: 'zs:bg-slate-500 zs:dark:bg-slate-700',
|
|
398
|
+
btnBGHover: 'zs:hover:bg-slate-600',
|
|
399
|
+
},
|
|
400
|
+
buttonOutline: {
|
|
401
|
+
border: 'zs:border-slate-500 zs:dark:border-slate-500',
|
|
402
|
+
btnBGHover: 'zs:hover:bg-slate-600 zs:dark:hover:bg-slate-600',
|
|
403
|
+
text: 'zs:text-slate-500 zs:dark:text-slate-500'
|
|
404
|
+
},
|
|
405
|
+
select: {
|
|
406
|
+
bgSelect: 'zs:bg-slate-200 zs:dark:bg-slate-800',
|
|
407
|
+
cleartext: 'zs:text-slate-700 zs:dark:text-slate-500',
|
|
408
|
+
cleartexthover: 'zs:hover:text-slate-500 zs:dark:hover:text-slate-300',
|
|
409
|
+
},
|
|
410
|
+
checkbox: {
|
|
411
|
+
checkBoxText: 'zs:text-slate-500 zs:dark:text-slate-700',
|
|
412
|
+
checkBoxTextHover: 'zs:hover:text-slate-600',
|
|
413
|
+
},
|
|
414
|
+
card: {
|
|
415
|
+
border: 'zs:border-slate-300 zs:dark:border-slate-700',
|
|
416
|
+
borderHover: 'zs:hover:border-slate-600 zs:dark:hover:border-slate-500',
|
|
417
|
+
},
|
|
418
|
+
modal: {
|
|
419
|
+
border: 'zs:border-slate-300 zs:dark:border-slate-600',
|
|
420
|
+
text: 'zs:text-slate-800 zs:dark:text-slate-300',
|
|
421
|
+
},
|
|
422
|
+
page404: {
|
|
423
|
+
btnBG: 'zs:bg-slate-500 zs:dark:bg-slate-700',
|
|
424
|
+
btnBGHover: 'zs:hover:bg-slate-600',
|
|
425
|
+
iconText: 'zs:text-slate-500 zs:dark:text-slate-700',
|
|
426
|
+
},
|
|
397
427
|
},
|
|
398
428
|
],
|
|
399
429
|
[
|
|
400
430
|
'primary',
|
|
401
431
|
{
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
432
|
+
input: {
|
|
433
|
+
border: 'zs:border-blue-200 zs:dark:border-blue-700',
|
|
434
|
+
borderHover: 'zs:hover:border-blue-400 zs:dark:hover:border-blue-500',
|
|
435
|
+
inputBg: 'zs:bg-white zs:dark:bg-slate-900',
|
|
436
|
+
text: 'zs:text-blue-900 zs:dark:text-blue-100',
|
|
437
|
+
},
|
|
438
|
+
ring: {
|
|
439
|
+
ring: 'zs:focus-within:ring-blue-400 zs:dark:focus-within:ring-blue-500',
|
|
440
|
+
},
|
|
441
|
+
buttonSolid: {
|
|
442
|
+
btnBG: 'zs:bg-blue-500 zs:dark:bg-blue-700',
|
|
443
|
+
btnBGHover: 'zs:hover:bg-blue-600',
|
|
444
|
+
},
|
|
445
|
+
buttonOutline: {
|
|
446
|
+
border: 'zs:border-blue-500 zs:dark:border-blue-600',
|
|
447
|
+
btnBGHover: 'zs:hover:bg-blue-600',
|
|
448
|
+
text: 'zs:text-blue-500 zs:dark:text-blue-500'
|
|
449
|
+
},
|
|
450
|
+
select: {
|
|
451
|
+
bgSelect: 'zs:bg-blue-200 zs:dark:bg-blue-800',
|
|
452
|
+
cleartext: 'zs:text-blue-800 zs:dark:text-blue-500',
|
|
453
|
+
cleartexthover: 'zs:hover:text-blue-600 zs:dark:hover:text-blue-300',
|
|
454
|
+
},
|
|
455
|
+
checkbox: {
|
|
456
|
+
checkBoxText: 'zs:text-blue-500 zs:dark:text-blue-700',
|
|
457
|
+
checkBoxTextHover: 'zs:hover:text-blue-600',
|
|
458
|
+
},
|
|
459
|
+
card: {
|
|
460
|
+
border: 'zs:border-blue-300 zs:dark:border-blue-700',
|
|
461
|
+
borderHover: 'zs:hover:border-blue-600 zs:dark:hover:border-blue-500',
|
|
462
|
+
},
|
|
463
|
+
modal: {
|
|
464
|
+
border: 'zs:border-blue-200 zs:dark:border-blue-700',
|
|
465
|
+
text: 'zs:text-blue-900 zs:dark:text-blue-100',
|
|
466
|
+
},
|
|
467
|
+
page404: {
|
|
468
|
+
btnBG: 'zs:bg-blue-500 zs:dark:bg-blue-700',
|
|
469
|
+
btnBGHover: 'zs:hover:bg-blue-600',
|
|
470
|
+
iconText: 'zs:text-blue-500 zs:dark:text-blue-700',
|
|
471
|
+
},
|
|
413
472
|
},
|
|
414
473
|
],
|
|
415
474
|
[
|
|
416
475
|
'success',
|
|
417
476
|
{
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
477
|
+
input: {
|
|
478
|
+
border: 'zs:border-green-300 zs:dark:border-green-600',
|
|
479
|
+
borderHover: 'zs:hover:border-green-500 zs:dark:hover:border-green-400',
|
|
480
|
+
inputBg: 'zs:bg-white zs:dark:bg-slate-900',
|
|
481
|
+
text: 'zs:text-green-800 zs:dark:text-green-300',
|
|
482
|
+
},
|
|
483
|
+
ring: {
|
|
484
|
+
ring: 'zs:focus-within:ring-green-400 zs:dark:focus-within:ring-green-600',
|
|
485
|
+
},
|
|
486
|
+
buttonSolid: {
|
|
487
|
+
btnBG: 'zs:bg-green-500 zs:dark:bg-green-700',
|
|
488
|
+
btnBGHover: 'zs:hover:bg-green-600',
|
|
489
|
+
},
|
|
490
|
+
buttonOutline: {
|
|
491
|
+
border: 'zs:border-green-500 zs:dark:border-green-600',
|
|
492
|
+
btnBGHover: 'zs:hover:bg-green-600',
|
|
493
|
+
text: 'zs:text-green-500 zs:dark:text-green-600'
|
|
494
|
+
},
|
|
495
|
+
select: {
|
|
496
|
+
bgSelect: 'zs:bg-green-200 zs:dark:bg-green-800',
|
|
497
|
+
cleartext: 'zs:text-green-800 zs:dark:text-green-500',
|
|
498
|
+
cleartexthover: 'zs:hover:text-green-600 zs:dark:hover:text-green-300',
|
|
499
|
+
},
|
|
500
|
+
checkbox: {
|
|
501
|
+
checkBoxText: 'zs:text-green-500 zs:dark:text-green-700',
|
|
502
|
+
checkBoxTextHover: 'zs:hover:text-green-600',
|
|
503
|
+
},
|
|
504
|
+
card: {
|
|
505
|
+
border: 'zs:border-green-300 zs:dark:border-green-700',
|
|
506
|
+
borderHover: 'zs:hover:border-green-600 zs:dark:hover:border-green-500',
|
|
507
|
+
},
|
|
508
|
+
modal: {
|
|
509
|
+
border: 'zs:border-green-300 zs:dark:border-green-600',
|
|
510
|
+
text: 'zs:text-green-800 zs:dark:text-green-300',
|
|
511
|
+
},
|
|
512
|
+
page404: {
|
|
513
|
+
btnBG: 'zs:bg-green-500 zs:dark:bg-green-700',
|
|
514
|
+
btnBGHover: 'zs:hover:bg-green-600',
|
|
515
|
+
iconText: 'zs:text-green-500 zs:dark:text-green-700',
|
|
516
|
+
},
|
|
429
517
|
},
|
|
430
518
|
],
|
|
431
519
|
[
|
|
432
520
|
'danger',
|
|
433
521
|
{
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
522
|
+
input: {
|
|
523
|
+
border: 'zs:border-red-300 zs:dark:border-red-600',
|
|
524
|
+
borderHover: 'zs:hover:border-red-500 zs:dark:hover:border-red-400',
|
|
525
|
+
inputBg: 'zs:bg-white zs:dark:bg-slate-900',
|
|
526
|
+
text: 'zs:text-red-800 zs:dark:text-red-300',
|
|
527
|
+
},
|
|
528
|
+
ring: {
|
|
529
|
+
ring: 'zs:focus-within:ring-red-400 zs:dark:focus-within:ring-red-600',
|
|
530
|
+
},
|
|
531
|
+
buttonSolid: {
|
|
532
|
+
btnBG: 'zs:bg-red-500 zs:dark:bg-red-700',
|
|
533
|
+
btnBGHover: 'zs:hover:bg-red-600',
|
|
534
|
+
},
|
|
535
|
+
buttonOutline: {
|
|
536
|
+
border: 'zs:border-red-500 zs:dark:border-red-600',
|
|
537
|
+
btnBGHover: 'zs:hover:bg-red-600',
|
|
538
|
+
text: 'zs:text-red-500 zs:dark:text-red-600'
|
|
539
|
+
},
|
|
540
|
+
select: {
|
|
541
|
+
bgSelect: 'zs:bg-red-200 zs:dark:bg-red-800',
|
|
542
|
+
cleartext: 'zs:text-red-800 zs:dark:text-red-500',
|
|
543
|
+
cleartexthover: 'zs:hover:text-red-600 zs:dark:hover:text-red-300',
|
|
544
|
+
},
|
|
545
|
+
checkbox: {
|
|
546
|
+
checkBoxText: 'zs:text-red-500 zs:dark:text-red-700',
|
|
547
|
+
checkBoxTextHover: 'zs:hover:text-red-600',
|
|
548
|
+
},
|
|
549
|
+
card: {
|
|
550
|
+
border: 'zs:border-red-300 zs:dark:border-red-700',
|
|
551
|
+
borderHover: 'zs:hover:border-red-600 zs:dark:hover:border-red-500',
|
|
552
|
+
},
|
|
553
|
+
modal: {
|
|
554
|
+
border: 'zs:border-red-300 zs:dark:border-red-600',
|
|
555
|
+
text: 'zs:text-red-800 zs:dark:text-red-300',
|
|
556
|
+
},
|
|
557
|
+
page404: {
|
|
558
|
+
btnBG: 'zs:bg-red-500 zs:dark:bg-red-700',
|
|
559
|
+
btnBGHover: 'zs:hover:bg-red-600',
|
|
560
|
+
iconText: 'zs:text-red-500 zs:dark:text-red-700',
|
|
561
|
+
},
|
|
445
562
|
},
|
|
446
563
|
],
|
|
447
564
|
[
|
|
448
565
|
'warning',
|
|
449
566
|
{
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
567
|
+
input: {
|
|
568
|
+
border: 'zs:border-yellow-300 zs:dark:border-yellow-600',
|
|
569
|
+
borderHover: 'zs:hover:border-yellow-500 zs:dark:hover:border-yellow-400',
|
|
570
|
+
inputBg: 'zs:bg-white zs:dark:bg-slate-900',
|
|
571
|
+
text: 'zs:text-amber-800 zs:dark:text-amber-300',
|
|
572
|
+
},
|
|
573
|
+
ring: {
|
|
574
|
+
ring: 'zs:focus-within:ring-yellow-400 zs:dark:focus-within:ring-yellow-600',
|
|
575
|
+
},
|
|
576
|
+
buttonSolid: {
|
|
577
|
+
btnBG: 'zs:bg-amber-500 zs:dark:bg-amber-700',
|
|
578
|
+
btnBGHover: 'zs:hover:bg-amber-600',
|
|
579
|
+
},
|
|
580
|
+
buttonOutline: {
|
|
581
|
+
border: 'zs:border-amber-500 zs:dark:border-amber-600',
|
|
582
|
+
btnBGHover: 'zs:hover:bg-amber-600',
|
|
583
|
+
text: 'zs:text-amber-500 zs:dark:text-amber-600'
|
|
584
|
+
},
|
|
585
|
+
select: {
|
|
586
|
+
bgSelect: 'zs:bg-amber-200 zs:dark:bg-amber-800',
|
|
587
|
+
cleartext: 'zs:text-amber-800 zs:dark:text-amber-500',
|
|
588
|
+
cleartexthover: 'zs:hover:text-amber-600 zs:dark:hover:text-amber-300',
|
|
589
|
+
},
|
|
590
|
+
checkbox: {
|
|
591
|
+
checkBoxText: 'zs:text-amber-500 zs:dark:text-amber-700',
|
|
592
|
+
checkBoxTextHover: 'zs:hover:text-amber-600',
|
|
593
|
+
},
|
|
594
|
+
card: {
|
|
595
|
+
border: 'zs:border-yellow-300 zs:dark:border-yellow-700',
|
|
596
|
+
borderHover: 'zs:hover:border-yellow-600 zs:dark:hover:border-yellow-500',
|
|
597
|
+
},
|
|
598
|
+
modal: {
|
|
599
|
+
border: 'zs:border-yellow-300 zs:dark:border-yellow-600',
|
|
600
|
+
text: 'zs:text-amber-800 zs:dark:text-amber-300',
|
|
601
|
+
},
|
|
602
|
+
page404: {
|
|
603
|
+
btnBG: 'zs:bg-amber-500 zs:dark:bg-amber-700',
|
|
604
|
+
btnBGHover: 'zs:hover:bg-amber-600',
|
|
605
|
+
iconText: 'zs:text-amber-500 zs:dark:text-amber-700',
|
|
606
|
+
},
|
|
461
607
|
},
|
|
462
608
|
],
|
|
463
609
|
[
|
|
464
610
|
'info',
|
|
465
611
|
{
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
612
|
+
input: {
|
|
613
|
+
border: 'zs:border-cyan-300 zs:dark:border-cyan-600',
|
|
614
|
+
borderHover: 'zs:hover:border-cyan-500 zs:dark:hover:border-cyan-400',
|
|
615
|
+
inputBg: 'zs:bg-white zs:dark:bg-slate-900',
|
|
616
|
+
text: 'zs:text-cyan-800 zs:dark:text-cyan-300',
|
|
617
|
+
},
|
|
618
|
+
ring: {
|
|
619
|
+
ring: 'zs:focus-within:ring-cyan-400 zs:dark:focus-within:ring-cyan-600',
|
|
620
|
+
},
|
|
621
|
+
buttonSolid: {
|
|
622
|
+
btnBG: 'zs:bg-cyan-500 zs:dark:bg-cyan-700',
|
|
623
|
+
btnBGHover: 'zs:hover:bg-cyan-600',
|
|
624
|
+
},
|
|
625
|
+
buttonOutline: {
|
|
626
|
+
border: 'zs:border-cyan-500 zs:dark:border-cyan-600',
|
|
627
|
+
btnBGHover: 'zs:hover:bg-cyan-600',
|
|
628
|
+
text: 'zs:text-cyan-500 zs:dark:text-cyan-600'
|
|
629
|
+
},
|
|
630
|
+
select: {
|
|
631
|
+
bgSelect: 'zs:bg-cyan-200 zs:dark:bg-cyan-800',
|
|
632
|
+
cleartext: 'zs:text-cyan-800 zs:dark:text-cyan-500',
|
|
633
|
+
cleartexthover: 'zs:hover:text-cyan-600 zs:dark:hover:text-cyan-300',
|
|
634
|
+
},
|
|
635
|
+
checkbox: {
|
|
636
|
+
checkBoxText: 'zs:text-cyan-500 zs:dark:text-cyan-700',
|
|
637
|
+
checkBoxTextHover: 'zs:hover:text-cyan-600',
|
|
638
|
+
},
|
|
639
|
+
card: {
|
|
640
|
+
border: 'zs:border-cyan-300 zs:dark:border-cyan-700',
|
|
641
|
+
borderHover: 'zs:hover:border-cyan-600 zs:dark:hover:border-cyan-500',
|
|
642
|
+
},
|
|
643
|
+
modal: {
|
|
644
|
+
border: 'zs:border-cyan-300 zs:dark:border-cyan-600',
|
|
645
|
+
text: 'zs:text-cyan-800 zs:dark:text-cyan-300',
|
|
646
|
+
},
|
|
647
|
+
page404: {
|
|
648
|
+
btnBG: 'zs:bg-cyan-500 zs:dark:bg-cyan-700',
|
|
649
|
+
btnBGHover: 'zs:hover:bg-cyan-600',
|
|
650
|
+
iconText: 'zs:text-cyan-500 zs:dark:text-cyan-700',
|
|
651
|
+
},
|
|
477
652
|
},
|
|
478
653
|
],
|
|
479
654
|
[
|
|
480
655
|
'dark',
|
|
481
656
|
{
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
657
|
+
input: {
|
|
658
|
+
border: 'zs:border-slate-900 zs:dark:border-slate-700',
|
|
659
|
+
borderHover: 'zs:hover:border-gray-500 zs:dark:hover:border-slate-500',
|
|
660
|
+
inputBg: 'zs:bg-slate-300 zs:dark:bg-slate-900',
|
|
661
|
+
text: 'zs:text-slate-900 zs:dark:text-slate-300',
|
|
662
|
+
},
|
|
663
|
+
ring: {
|
|
664
|
+
ring: 'zs:focus-within:ring-slate-700 zs:dark:focus-within:ring-slate-600',
|
|
665
|
+
},
|
|
666
|
+
buttonSolid: {
|
|
667
|
+
btnBG: 'zs:bg-slate-900 zs:dark:bg-slate-700',
|
|
668
|
+
btnBGHover: 'zs:hover:bg-slate-800 zs:dark:hover:bg-slate-700/70',
|
|
669
|
+
},
|
|
670
|
+
buttonOutline: {
|
|
671
|
+
border: 'zs:border-slate-900 zs:dark:border-slate-500',
|
|
672
|
+
btnBGHover: 'zs:hover:bg-slate-800 zs:dark:hover:bg-slate-700/70',
|
|
673
|
+
text: 'zs:text-slate-900 zs:dark:text-slate-500'
|
|
674
|
+
},
|
|
675
|
+
select: {
|
|
676
|
+
bgSelect: 'zs:bg-slate-400 zs:dark:bg-slate-800',
|
|
677
|
+
cleartext: 'zs:text-slate-700 zs:dark:text-slate-500',
|
|
678
|
+
cleartexthover: 'zs:hover:text-slate-900 zs:dark:hover:text-slate-700',
|
|
679
|
+
},
|
|
680
|
+
checkbox: {
|
|
681
|
+
checkBoxText: 'zs:text-slate-900 zs:dark:text-slate-700',
|
|
682
|
+
checkBoxTextHover: 'zs:hover:text-slate-700/70',
|
|
683
|
+
},
|
|
684
|
+
card: {
|
|
685
|
+
border: 'zs:border-slate-900 zs:dark:border-slate-700',
|
|
686
|
+
borderHover: 'zs:hover:border-gray-600 zs:dark:hover:border-slate-500',
|
|
687
|
+
},
|
|
688
|
+
modal: {
|
|
689
|
+
border: 'zs:border-slate-900 zs:dark:border-slate-700',
|
|
690
|
+
text: 'zs:text-slate-900 zs:dark:text-slate-300',
|
|
691
|
+
},
|
|
692
|
+
page404: {
|
|
693
|
+
btnBG: 'zs:bg-slate-900 zs:dark:bg-slate-700',
|
|
694
|
+
btnBGHover: 'zs:hover:bg-slate-800 zs:dark:hover:bg-slate-700/70',
|
|
695
|
+
iconText: 'zs:text-slate-900 zs:dark:text-slate-700',
|
|
696
|
+
},
|
|
493
697
|
},
|
|
494
698
|
],
|
|
495
699
|
[
|
|
496
700
|
'violet',
|
|
497
701
|
{
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
702
|
+
input: {
|
|
703
|
+
border: 'zs:border-violet-300 zs:dark:border-violet-600',
|
|
704
|
+
borderHover: 'zs:hover:border-violet-500 zs:dark:hover:border-violet-400',
|
|
705
|
+
inputBg: 'zs:bg-white zs:dark:bg-slate-900',
|
|
706
|
+
text: 'zs:text-violet-800 zs:dark:text-violet-300',
|
|
707
|
+
},
|
|
708
|
+
ring: {
|
|
709
|
+
ring: 'zs:focus-within:ring-violet-400 zs:dark:focus-within:ring-violet-600',
|
|
710
|
+
},
|
|
711
|
+
buttonSolid: {
|
|
712
|
+
btnBG: 'zs:bg-violet-500 zs:dark:bg-violet-700',
|
|
713
|
+
btnBGHover: 'zs:hover:bg-violet-600',
|
|
714
|
+
},
|
|
715
|
+
buttonOutline: {
|
|
716
|
+
border: 'zs:border-violet-500 zs:dark:border-violet-600',
|
|
717
|
+
btnBGHover: 'zs:hover:bg-violet-600',
|
|
718
|
+
text: 'zs:text-violet-500 zs:dark:text-violet-600'
|
|
719
|
+
},
|
|
720
|
+
select: {
|
|
721
|
+
bgSelect: 'zs:bg-violet-200 zs:dark:bg-violet-800',
|
|
722
|
+
cleartext: 'zs:text-violet-800 zs:dark:text-violet-500',
|
|
723
|
+
cleartexthover: 'zs:hover:text-violet-600 zs:dark:hover:text-violet-300',
|
|
724
|
+
},
|
|
725
|
+
checkbox: {
|
|
726
|
+
checkBoxText: 'zs:text-violet-500 zs:dark:text-violet-700',
|
|
727
|
+
checkBoxTextHover: 'zs:hover:text-violet-600',
|
|
728
|
+
},
|
|
729
|
+
card: {
|
|
730
|
+
border: 'zs:border-violet-300 zs:dark:border-violet-700',
|
|
731
|
+
borderHover: 'zs:hover:border-violet-600 zs:dark:hover:border-violet-500',
|
|
732
|
+
},
|
|
733
|
+
modal: {
|
|
734
|
+
border: 'zs:border-violet-300 zs:dark:border-violet-600',
|
|
735
|
+
text: 'zs:text-violet-800 zs:dark:text-violet-300',
|
|
736
|
+
},
|
|
737
|
+
page404: {
|
|
738
|
+
btnBG: 'zs:bg-violet-500 zs:dark:bg-violet-700',
|
|
739
|
+
btnBGHover: 'zs:hover:bg-violet-600',
|
|
740
|
+
iconText: 'zs:text-violet-500 zs:dark:text-violet-700',
|
|
741
|
+
},
|
|
509
742
|
},
|
|
510
743
|
],
|
|
511
744
|
[
|
|
512
745
|
'teal',
|
|
513
746
|
{
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
747
|
+
input: {
|
|
748
|
+
border: 'zs:border-teal-300 zs:dark:border-teal-600',
|
|
749
|
+
borderHover: 'zs:hover:border-teal-500 zs:dark:hover:border-teal-400',
|
|
750
|
+
inputBg: 'zs:bg-white zs:dark:bg-slate-900',
|
|
751
|
+
text: 'zs:text-teal-800 zs:dark:text-teal-300',
|
|
752
|
+
},
|
|
753
|
+
ring: {
|
|
754
|
+
ring: 'zs:focus-within:ring-teal-400 zs:dark:focus-within:ring-teal-600',
|
|
755
|
+
},
|
|
756
|
+
buttonSolid: {
|
|
757
|
+
btnBG: 'zs:bg-teal-500 zs:dark:bg-teal-700',
|
|
758
|
+
btnBGHover: 'zs:hover:bg-teal-600',
|
|
759
|
+
},
|
|
760
|
+
buttonOutline: {
|
|
761
|
+
border: 'zs:border-teal-500 zs:dark:border-teal-600',
|
|
762
|
+
btnBGHover: 'zs:hover:bg-teal-600',
|
|
763
|
+
text: 'zs:text-teal-500 zs:dark:text-teal-600'
|
|
764
|
+
},
|
|
765
|
+
select: {
|
|
766
|
+
bgSelect: 'zs:bg-teal-200 zs:dark:bg-teal-800',
|
|
767
|
+
cleartext: 'zs:text-teal-800 zs:dark:text-teal-500',
|
|
768
|
+
cleartexthover: 'zs:hover:text-teal-600 zs:dark:hover:text-teal-300',
|
|
769
|
+
},
|
|
770
|
+
checkbox: {
|
|
771
|
+
checkBoxText: 'zs:text-teal-500 zs:dark:text-teal-700',
|
|
772
|
+
checkBoxTextHover: 'zs:hover:text-teal-600',
|
|
773
|
+
},
|
|
774
|
+
card: {
|
|
775
|
+
border: 'zs:border-teal-300 zs:dark:border-teal-700',
|
|
776
|
+
borderHover: 'zs:hover:border-teal-600 zs:dark:hover:border-teal-500',
|
|
777
|
+
},
|
|
778
|
+
modal: {
|
|
779
|
+
border: 'zs:border-teal-300 zs:dark:border-teal-600',
|
|
780
|
+
text: 'zs:text-teal-800 zs:dark:text-teal-300',
|
|
781
|
+
},
|
|
782
|
+
page404: {
|
|
783
|
+
btnBG: 'zs:bg-teal-500 zs:dark:bg-teal-700',
|
|
784
|
+
btnBGHover: 'zs:hover:bg-teal-600',
|
|
785
|
+
iconText: 'zs:text-teal-500 zs:dark:text-teal-700',
|
|
786
|
+
},
|
|
525
787
|
},
|
|
526
788
|
],
|
|
527
789
|
]);
|
|
790
|
+
// Helper functions for backward compatibility
|
|
791
|
+
const inputPaletteMap = new Map(Array.from(unifiedPaletteMap).map(([key, value]) => [key, value.input]));
|
|
792
|
+
const ringPaletteMap = new Map(Array.from(unifiedPaletteMap).map(([key, value]) => [key, value.ring]));
|
|
793
|
+
const buttonSolidPaletteMap = new Map(Array.from(unifiedPaletteMap).map(([key, value]) => [key, value.buttonSolid]));
|
|
794
|
+
const buttonOutlinePaletteMap = new Map(Array.from(unifiedPaletteMap).map(([key, value]) => [key, value.buttonOutline]));
|
|
795
|
+
const selectPaletteMap = new Map(Array.from(unifiedPaletteMap).map(([key, value]) => [key, value.select]));
|
|
796
|
+
const checkboxTextPaletteMap = new Map(Array.from(unifiedPaletteMap).map(([key, value]) => [key, value.checkbox]));
|
|
797
|
+
const cardPaletteMap = new Map(Array.from(unifiedPaletteMap).map(([key, value]) => [key, value.card]));
|
|
798
|
+
const modalPaletteMap = new Map(Array.from(unifiedPaletteMap).map(([key, value]) => [key, value.modal]));
|
|
799
|
+
const page404PaletteMap = new Map(Array.from(unifiedPaletteMap).map(([key, value]) => [key, value.page404]));
|
|
528
800
|
const ColorMapping = new Map([
|
|
529
801
|
['slate', { text: 'zs:text-slate-600 zs:dark:text-slate-400', bg: 'zs:bg-slate-600 zs:dark:bg-slate-400', border: 'zs:border-slate-600 zs:dark:border-slate-400' }],
|
|
530
802
|
['gray', { text: 'zs:text-gray-600 zs:dark:text-gray-400', bg: 'zs:bg-gray-600 zs:dark:bg-gray-400', border: 'zs:border-gray-600 zs:dark:border-gray-400' }],
|
|
@@ -655,16 +927,13 @@ class Card {
|
|
|
655
927
|
const variant = this.variant();
|
|
656
928
|
const clickable = this.clickable();
|
|
657
929
|
const bodyClass = this.bodyClass();
|
|
658
|
-
const
|
|
659
|
-
|
|
660
|
-
borderHover: '',
|
|
661
|
-
ring: '',
|
|
662
|
-
};
|
|
930
|
+
const ringPalette = ringPaletteMap.get(style);
|
|
931
|
+
const cardPalette = cardPaletteMap.get(style);
|
|
663
932
|
const base = 'zs:w-full zs:h-full zs:overflow-hidden zs:flex zs:flex-col zs:gap-4 zs:rounded-lg zs:transition-all zs:duration-300';
|
|
664
933
|
// ---------------------
|
|
665
934
|
// Border Handling
|
|
666
935
|
// ---------------------
|
|
667
|
-
const border = (variant?.border ?? true) ? `zs:border ${
|
|
936
|
+
const border = (variant?.border ?? true) ? `zs:border ${cardPalette.border}` : 'zs:border-0';
|
|
668
937
|
// ---------------------
|
|
669
938
|
// Shadow Handling
|
|
670
939
|
// ---------------------
|
|
@@ -674,12 +943,12 @@ class Card {
|
|
|
674
943
|
// ---------------------
|
|
675
944
|
// Hover Border Handling
|
|
676
945
|
// ---------------------
|
|
677
|
-
const hoverBorder = (variant?.border_hover ?? true) ?
|
|
946
|
+
const hoverBorder = (variant?.border_hover ?? true) ? cardPalette.borderHover : '';
|
|
678
947
|
// ---------------------
|
|
679
948
|
// Clickable / Focus Effects
|
|
680
949
|
// ---------------------
|
|
681
950
|
const clickEffects = clickable
|
|
682
|
-
? `zs:cursor-pointer zs:hover:scale-[1.02] zs:active:scale-[0.97] zs:focus-visible:ring-2 ${
|
|
951
|
+
? `zs:cursor-pointer zs:hover:scale-[1.02] zs:active:scale-[0.97] zs:focus-visible:ring-2 ${ringPalette.ring}`
|
|
683
952
|
: '';
|
|
684
953
|
// ---------------------
|
|
685
954
|
// Combine Classes
|
|
@@ -1064,7 +1333,6 @@ class Button {
|
|
|
1064
1333
|
// ==============================================
|
|
1065
1334
|
// Computed Properties
|
|
1066
1335
|
// ==============================================
|
|
1067
|
-
palette = computed(() => FormPaletteMap.get(this.btnStyle()), ...(ngDevMode ? [{ debugName: "palette" }] : []));
|
|
1068
1336
|
solidTextColor = computed(() => {
|
|
1069
1337
|
if (['primary', 'dark', 'violet', 'secondary'].includes(this.btnStyle()))
|
|
1070
1338
|
return 'zs:text-slate-100';
|
|
@@ -1073,20 +1341,29 @@ class Button {
|
|
|
1073
1341
|
baseClasses = computed(() => {
|
|
1074
1342
|
const size = this.size();
|
|
1075
1343
|
const variant = this.variant();
|
|
1076
|
-
const
|
|
1077
|
-
const
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1344
|
+
const solidPalette = buttonSolidPaletteMap.get(this.btnStyle());
|
|
1345
|
+
const outlinePalette = buttonOutlinePaletteMap.get(this.btnStyle());
|
|
1346
|
+
const ringConfig = ringPaletteMap.get(this.btnStyle());
|
|
1347
|
+
const solidPadding = {
|
|
1348
|
+
xs: 'zs:px-2 zs:py-1',
|
|
1349
|
+
sm: 'zs:px-3.5 zs:py-1.75',
|
|
1350
|
+
md: 'zs:px-5 zs:py-2.5',
|
|
1351
|
+
lg: 'zs:px-6.5 zs:py-3.25',
|
|
1352
|
+
xl: 'zs:px-8 zs:py-4',
|
|
1353
|
+
}[size];
|
|
1354
|
+
const outlinePadding = {
|
|
1355
|
+
xs: 'zs:px-[calc(--spacing(2)-1px)] zs:py-[calc(--spacing(2)-1px)]',
|
|
1356
|
+
sm: 'zs:px-[calc(--spacing(3.5)-1px)] zs:py-[calc(--spacing(1.75)-1px)]',
|
|
1357
|
+
md: 'zs:px-[calc(--spacing(5)-1px)] zs:py-[calc(--spacing(2.5)-1px)]',
|
|
1358
|
+
lg: 'zs:px-[calc(--spacing(6.5)-1px)] zs:py-[calc(--spacing(3.25)-1px)]',
|
|
1359
|
+
xl: 'zs:px-[calc(--spacing(8)-1px)] zs:py-[calc(--spacing(4)-1px)]',
|
|
1360
|
+
}[size];
|
|
1361
|
+
const solidClasses = this.join(solidPalette.btnBG, solidPalette.btnBGHover, 'zs:hover:scale-[1.02]', 'zs:shadow-md zs:dark:shadow-slate-700/50', 'zs:hover:shadow-lg', 'zs:active:shadow-sm', ['dark', 'secondary'].includes(this.btnStyle()) ? 'zs:dark:hover:shadow-sm' : '', this.solidTextColor());
|
|
1362
|
+
const outlineClasses = this.join('zs:bg-transparent', 'zs:border-[1px]', outlinePalette.border, outlinePalette.btnBGHover, outlinePalette.text, 'zs:hover:text-gray-50', 'zs:hover:shadow-sm');
|
|
1086
1363
|
const stateClasses = this.disabled()
|
|
1087
1364
|
? 'zs:opacity-60 zs:cursor-not-allowed zs:shadow-none'
|
|
1088
|
-
: this.join('zs:
|
|
1089
|
-
return this.join('zs:inline-flex zs:items-center zs:justify-center', ['xl'].includes(size) ? 'zs:rounded-xl' : 'zs:rounded-lg', 'zs:focus-visible:ring-2', 'zs:select-none', 'zs:outline-hidden'
|
|
1365
|
+
: this.join('zs:active:scale-[0.97]', 'zs:transition-[background-color,color,border-color,box-shadow,opacity]', 'zs:duration-200', 'zs:ease-in-out');
|
|
1366
|
+
return this.join(variant === 'solid' ? solidPadding : outlinePadding, variant === 'solid' ? solidClasses : outlineClasses, stateClasses, ringConfig.ring, 'zs:inline-flex zs:items-center zs:justify-center', ['xl'].includes(size) ? 'zs:rounded-xl' : 'zs:rounded-lg', 'zs:focus-visible:ring-2', 'zs:select-none', 'zs:outline-hidden');
|
|
1090
1367
|
}, ...(ngDevMode ? [{ debugName: "baseClasses" }] : []));
|
|
1091
1368
|
// ==============================================
|
|
1092
1369
|
// Methods
|
|
@@ -1147,7 +1424,7 @@ class Modal {
|
|
|
1147
1424
|
show: true,
|
|
1148
1425
|
text: 'Cancel',
|
|
1149
1426
|
btnStyle: 'secondary',
|
|
1150
|
-
variant: '
|
|
1427
|
+
variant: 'outline',
|
|
1151
1428
|
size: 'md',
|
|
1152
1429
|
icon: null,
|
|
1153
1430
|
disabled: false
|
|
@@ -1178,7 +1455,7 @@ class Modal {
|
|
|
1178
1455
|
// ==============================================
|
|
1179
1456
|
// Computed Signals
|
|
1180
1457
|
// ==============================================
|
|
1181
|
-
palette = computed(() =>
|
|
1458
|
+
palette = computed(() => modalPaletteMap.get(this.modalStyle()), ...(ngDevMode ? [{ debugName: "palette" }] : []));
|
|
1182
1459
|
isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
1183
1460
|
positionClass = computed(() => positionMap[this.position()], ...(ngDevMode ? [{ debugName: "positionClass" }] : []));
|
|
1184
1461
|
setTimeId;
|
|
@@ -1212,11 +1489,11 @@ class Modal {
|
|
|
1212
1489
|
this.close();
|
|
1213
1490
|
}
|
|
1214
1491
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: Modal, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1215
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: Modal, isStandalone: true, selector: "ZS-modal", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, modalStyle: { classPropertyName: "modalStyle", publicName: "modalStyle", isSignal: true, isRequired: false, transformFunction: null }, showCancelIcon: { classPropertyName: "showCancelIcon", publicName: "showCancelIcon", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, cancelConfig: { classPropertyName: "cancelConfig", publicName: "cancelConfig", isSignal: true, isRequired: false, transformFunction: null }, confirmConfig: { classPropertyName: "confirmConfig", publicName: "confirmConfig", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, closeOnOverlay: { classPropertyName: "closeOnOverlay", publicName: "closeOnOverlay", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", confirmEv: "confirmEv", cancelEv: "cancelEv", closedEv: "closedEv" }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, ngImport: i0, template: "<!-- ========================= Overlay ========================= -->\n@if (isOpen()) {\n <div #modalRef\n class=\"zs:fixed zs:inset-0 zs:flex {{ zIndices.modal }} zs:bg-black/50 zs:dark:bg-black/70 zs:transition-all zs:duration-300\"\n [ngClass]=\"[positionClass(), open() ? 'animate-fadeIn' : 'animate-fadeOut']\"\n (click)=\"onOverlayClick($event)\"\n role=\"presentation\"\n [attr.inert]=\"isOpen() ? null : ''\"\n >\n\n <!-- ========================= Modal Container ========================= -->\n <div\n class=\"zs:relative zs:m-4 zs:bg-white zs:dark:bg-slate-900 zs:w-full zs:max-w-lg zs:mx-4 \n zs:rounded-2xl zs:shadow-lg zs:transition-all zs:duration-300 zs:outline-hidden\"\n [ngClass]=\"[\n 'zs:border', \n palette().border,\n palette().text,\n open() ? 'animate-modalIn' : 'animate-modalOut'\n ]\"\n (click)=\"$event.stopPropagation()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"'modal-title'\"\n [attr.aria-describedby]=\"'modal-body'\"\n tabindex=\"0\"\n (keydown.escape)=\"close()\"\n >\n\n <!-- ========================= Modal Header ========================= -->\n <div\n class=\"zs:flex zs:items-center zs:justify-between zs:px-4 zs:py-3 zs:border-b\"\n [class]=\"palette().border\"\n >\n <h3 id=\"modal-title\" class=\"zs:font-semibold zs:text-lg\">\n {{ title() }}\n </h3>\n @if(showCancelIcon()) {\n <button \n class=\"zs:text-xl zs:hover:opacity-85 zs:cursor-pointer zs:transition-colors zs:duration-200 zs:focus:outline-hidden zs:focus-visible:ring-2 zs:focus-visible:ring-offset-2 zs:focus-visible:ring-blue-500 zs:rounded-md
|
|
1492
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: Modal, isStandalone: true, selector: "ZS-modal", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, modalStyle: { classPropertyName: "modalStyle", publicName: "modalStyle", isSignal: true, isRequired: false, transformFunction: null }, showCancelIcon: { classPropertyName: "showCancelIcon", publicName: "showCancelIcon", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, cancelConfig: { classPropertyName: "cancelConfig", publicName: "cancelConfig", isSignal: true, isRequired: false, transformFunction: null }, confirmConfig: { classPropertyName: "confirmConfig", publicName: "confirmConfig", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, closeOnOverlay: { classPropertyName: "closeOnOverlay", publicName: "closeOnOverlay", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", confirmEv: "confirmEv", cancelEv: "cancelEv", closedEv: "closedEv" }, host: { listeners: { "document:keydown.escape": "onEscape()" } }, ngImport: i0, template: "<!-- ========================= Overlay ========================= -->\n@if (isOpen()) {\n <div #modalRef\n class=\"zs:fixed zs:inset-0 zs:flex {{ zIndices.modal }} zs:bg-black/50 zs:dark:bg-black/70 zs:transition-all zs:duration-300\"\n [ngClass]=\"[positionClass(), open() ? 'animate-fadeIn' : 'animate-fadeOut']\"\n (click)=\"onOverlayClick($event)\"\n role=\"presentation\"\n [attr.inert]=\"isOpen() ? null : ''\"\n >\n\n <!-- ========================= Modal Container ========================= -->\n <div\n class=\"zs:relative zs:m-4 zs:bg-white zs:dark:bg-slate-900 zs:w-full zs:max-w-lg zs:mx-4 \n zs:rounded-2xl zs:shadow-lg zs:transition-all zs:duration-300 zs:outline-hidden\"\n [ngClass]=\"[\n 'zs:border', \n palette().border,\n palette().text,\n open() ? 'animate-modalIn' : 'animate-modalOut'\n ]\"\n (click)=\"$event.stopPropagation()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"'modal-title'\"\n [attr.aria-describedby]=\"'modal-body'\"\n tabindex=\"0\"\n (keydown.escape)=\"close()\"\n >\n\n <!-- ========================= Modal Header ========================= -->\n <div\n class=\"zs:flex zs:items-center zs:justify-between zs:px-4 zs:py-3 zs:border-b\"\n [class]=\"palette().border\"\n >\n <h3 id=\"modal-title\" class=\"zs:font-semibold zs:text-lg\">\n {{ title() }}\n </h3>\n @if(showCancelIcon()) {\n <button \n class=\"zs:text-xl zs:hover:opacity-85 zs:cursor-pointer zs:transition-colors \n zs:duration-200 zs:focus:outline-hidden zs:focus-visible:ring-2 \n zs:focus-visible:ring-offset-2 zs:focus-visible:ring-blue-500 \n zs:rounded-md zs:hover:scale-[1.02] zs:active:scale-[0.97]\"\n (click)=\"close()\"\n aria-label=\"Close dialog\"\n >\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n }\n </div>\n\n <!-- ========================= Modal Body ========================= -->\n <div id=\"modal-body\" class=\"zs:p-4 scroll zs:max-h-[75vh] scroll-{{ modalStyle() }}\">\n <ng-content></ng-content>\n </div>\n\n <!-- ========================= Modal Footer ========================= -->\n @if (showFooter()) {\n <div\n class=\"zs:flex zs:justify-end zs:gap-3 zs:p-4 zs:border-t\"\n [class]=\"palette().border\"\n >\n @if (cancelMerged().show) {\n <ZS-button\n [btnStyle]=\"cancelMerged().btnStyle\"\n variant=\"solid\"\n type=\"button\"\n (clickedEv)=\"cancelEv.emit()\"\n [icon]=\"cancelMerged().icon\"\n [disabled]=\"cancelMerged().disabled\"\n [size]=\"cancelMerged().size\"\n [variant]=\"cancelMerged().variant\"\n aria-label=\"Cancel\"\n >\n {{ cancelMerged().text}}\n </ZS-button>\n }\n @if (confirmMerged().show) {\n <ZS-button\n type=\"button\"\n [btnStyle]=\"confirmMerged().btnStyle\"\n (clickedEv)=\"confirmEv.emit()\"\n [icon]=\"confirmMerged().icon\"\n [disabled]=\"confirmMerged().disabled\"\n [size]=\"confirmMerged().size\"\n [variant]=\"confirmMerged().variant\"\n aria-label=\"Confirm\"\n >\n {{ confirmMerged().text}}\n </ZS-button>\n }\n </div>\n }\n </div>\n </div>\n}", styles: ["@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes modalIn{0%{opacity:0;transform:scale(.9) translateY(10px)}to{opacity:1;transform:scale(1) translateY(0)}}@keyframes modalOut{0%{opacity:1;transform:scale(1) translateY(0)}to{opacity:0;transform:scale(.9) translateY(10px)}}.animate-fadeIn{animation:fadeIn .25s ease-out forwards}.animate-modalIn{animation:modalIn .25s ease-out forwards}.animate-fadeOut{animation:fadeOut .25s ease-in forwards}.animate-modalOut{animation:modalOut .25s ease-in forwards}\n"], dependencies: [{ kind: "component", type: Button, selector: "ZS-button", inputs: ["Id", "btnStyle", "variant", "size", "disabled", "icon", "type"], outputs: ["clickedEv"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1216
1493
|
}
|
|
1217
1494
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: Modal, decorators: [{
|
|
1218
1495
|
type: Component,
|
|
1219
|
-
args: [{ selector: 'ZS-modal', imports: [Button, CommonModule], template: "<!-- ========================= Overlay ========================= -->\n@if (isOpen()) {\n <div #modalRef\n class=\"zs:fixed zs:inset-0 zs:flex {{ zIndices.modal }} zs:bg-black/50 zs:dark:bg-black/70 zs:transition-all zs:duration-300\"\n [ngClass]=\"[positionClass(), open() ? 'animate-fadeIn' : 'animate-fadeOut']\"\n (click)=\"onOverlayClick($event)\"\n role=\"presentation\"\n [attr.inert]=\"isOpen() ? null : ''\"\n >\n\n <!-- ========================= Modal Container ========================= -->\n <div\n class=\"zs:relative zs:m-4 zs:bg-white zs:dark:bg-slate-900 zs:w-full zs:max-w-lg zs:mx-4 \n zs:rounded-2xl zs:shadow-lg zs:transition-all zs:duration-300 zs:outline-hidden\"\n [ngClass]=\"[\n 'zs:border', \n palette().border,\n palette().text,\n open() ? 'animate-modalIn' : 'animate-modalOut'\n ]\"\n (click)=\"$event.stopPropagation()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"'modal-title'\"\n [attr.aria-describedby]=\"'modal-body'\"\n tabindex=\"0\"\n (keydown.escape)=\"close()\"\n >\n\n <!-- ========================= Modal Header ========================= -->\n <div\n class=\"zs:flex zs:items-center zs:justify-between zs:px-4 zs:py-3 zs:border-b\"\n [class]=\"palette().border\"\n >\n <h3 id=\"modal-title\" class=\"zs:font-semibold zs:text-lg\">\n {{ title() }}\n </h3>\n @if(showCancelIcon()) {\n <button \n class=\"zs:text-xl zs:hover:opacity-85 zs:cursor-pointer zs:transition-colors zs:duration-200 zs:focus:outline-hidden zs:focus-visible:ring-2 zs:focus-visible:ring-offset-2 zs:focus-visible:ring-blue-500 zs:rounded-md
|
|
1496
|
+
args: [{ selector: 'ZS-modal', imports: [Button, CommonModule], template: "<!-- ========================= Overlay ========================= -->\n@if (isOpen()) {\n <div #modalRef\n class=\"zs:fixed zs:inset-0 zs:flex {{ zIndices.modal }} zs:bg-black/50 zs:dark:bg-black/70 zs:transition-all zs:duration-300\"\n [ngClass]=\"[positionClass(), open() ? 'animate-fadeIn' : 'animate-fadeOut']\"\n (click)=\"onOverlayClick($event)\"\n role=\"presentation\"\n [attr.inert]=\"isOpen() ? null : ''\"\n >\n\n <!-- ========================= Modal Container ========================= -->\n <div\n class=\"zs:relative zs:m-4 zs:bg-white zs:dark:bg-slate-900 zs:w-full zs:max-w-lg zs:mx-4 \n zs:rounded-2xl zs:shadow-lg zs:transition-all zs:duration-300 zs:outline-hidden\"\n [ngClass]=\"[\n 'zs:border', \n palette().border,\n palette().text,\n open() ? 'animate-modalIn' : 'animate-modalOut'\n ]\"\n (click)=\"$event.stopPropagation()\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"'modal-title'\"\n [attr.aria-describedby]=\"'modal-body'\"\n tabindex=\"0\"\n (keydown.escape)=\"close()\"\n >\n\n <!-- ========================= Modal Header ========================= -->\n <div\n class=\"zs:flex zs:items-center zs:justify-between zs:px-4 zs:py-3 zs:border-b\"\n [class]=\"palette().border\"\n >\n <h3 id=\"modal-title\" class=\"zs:font-semibold zs:text-lg\">\n {{ title() }}\n </h3>\n @if(showCancelIcon()) {\n <button \n class=\"zs:text-xl zs:hover:opacity-85 zs:cursor-pointer zs:transition-colors \n zs:duration-200 zs:focus:outline-hidden zs:focus-visible:ring-2 \n zs:focus-visible:ring-offset-2 zs:focus-visible:ring-blue-500 \n zs:rounded-md zs:hover:scale-[1.02] zs:active:scale-[0.97]\"\n (click)=\"close()\"\n aria-label=\"Close dialog\"\n >\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n }\n </div>\n\n <!-- ========================= Modal Body ========================= -->\n <div id=\"modal-body\" class=\"zs:p-4 scroll zs:max-h-[75vh] scroll-{{ modalStyle() }}\">\n <ng-content></ng-content>\n </div>\n\n <!-- ========================= Modal Footer ========================= -->\n @if (showFooter()) {\n <div\n class=\"zs:flex zs:justify-end zs:gap-3 zs:p-4 zs:border-t\"\n [class]=\"palette().border\"\n >\n @if (cancelMerged().show) {\n <ZS-button\n [btnStyle]=\"cancelMerged().btnStyle\"\n variant=\"solid\"\n type=\"button\"\n (clickedEv)=\"cancelEv.emit()\"\n [icon]=\"cancelMerged().icon\"\n [disabled]=\"cancelMerged().disabled\"\n [size]=\"cancelMerged().size\"\n [variant]=\"cancelMerged().variant\"\n aria-label=\"Cancel\"\n >\n {{ cancelMerged().text}}\n </ZS-button>\n }\n @if (confirmMerged().show) {\n <ZS-button\n type=\"button\"\n [btnStyle]=\"confirmMerged().btnStyle\"\n (clickedEv)=\"confirmEv.emit()\"\n [icon]=\"confirmMerged().icon\"\n [disabled]=\"confirmMerged().disabled\"\n [size]=\"confirmMerged().size\"\n [variant]=\"confirmMerged().variant\"\n aria-label=\"Confirm\"\n >\n {{ confirmMerged().text}}\n </ZS-button>\n }\n </div>\n }\n </div>\n </div>\n}", styles: ["@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes modalIn{0%{opacity:0;transform:scale(.9) translateY(10px)}to{opacity:1;transform:scale(1) translateY(0)}}@keyframes modalOut{0%{opacity:1;transform:scale(1) translateY(0)}to{opacity:0;transform:scale(.9) translateY(10px)}}.animate-fadeIn{animation:fadeIn .25s ease-out forwards}.animate-modalIn{animation:modalIn .25s ease-out forwards}.animate-fadeOut{animation:fadeOut .25s ease-in forwards}.animate-modalOut{animation:modalOut .25s ease-in forwards}\n"] }]
|
|
1220
1497
|
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], modalStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "modalStyle", required: false }] }], showCancelIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCancelIcon", required: false }] }], showFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFooter", required: false }] }], cancelConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelConfig", required: false }] }], confirmConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmConfig", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], closeOnOverlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnOverlay", required: false }] }], confirmEv: [{ type: i0.Output, args: ["confirmEv"] }], cancelEv: [{ type: i0.Output, args: ["cancelEv"] }], closedEv: [{ type: i0.Output, args: ["closedEv"] }], onEscape: [{
|
|
1221
1498
|
type: HostListener,
|
|
1222
1499
|
args: ['document:keydown.escape']
|
|
@@ -1358,14 +1635,14 @@ class Page404 {
|
|
|
1358
1635
|
if (this.pageStyle() === 'normal')
|
|
1359
1636
|
return {
|
|
1360
1637
|
btnBG: 'zs:bg-sky-500 zs:dark:bg-sky-600',
|
|
1361
|
-
|
|
1638
|
+
btnBGHover: 'zs:hover:bg-sky-600 zs:dark:hover:bg-sky-500',
|
|
1362
1639
|
iconText: 'zs:text-sky-600 zs:dark:text-sky-500'
|
|
1363
1640
|
};
|
|
1364
|
-
const pallete =
|
|
1641
|
+
const pallete = page404PaletteMap.get(this.pageStyle());
|
|
1365
1642
|
return {
|
|
1366
1643
|
btnBG: pallete.btnBG,
|
|
1367
|
-
|
|
1368
|
-
iconText: pallete.
|
|
1644
|
+
btnBGHover: pallete.btnBGHover,
|
|
1645
|
+
iconText: pallete.iconText
|
|
1369
1646
|
};
|
|
1370
1647
|
}, ...(ngDevMode ? [{ debugName: "style" }] : []));
|
|
1371
1648
|
// ========================================================================
|
|
@@ -1373,11 +1650,11 @@ class Page404 {
|
|
|
1373
1650
|
// ========================================================================
|
|
1374
1651
|
onAction = output();
|
|
1375
1652
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: Page404, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1376
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: Page404, isStandalone: true, selector: "ZS-page404", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, pageStyle: { classPropertyName: "pageStyle", publicName: "pageStyle", isSignal: true, isRequired: false, transformFunction: null }, showButton: { classPropertyName: "showButton", publicName: "showButton", isSignal: true, isRequired: false, transformFunction: null }, buttonText: { classPropertyName: "buttonText", publicName: "buttonText", isSignal: true, isRequired: false, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<!-- ========================= Page 404 Container ========================= -->\n<div class=\"zs:flex zs:flex-col zs:items-center zs:justify-center zs:min-h-[90vh]\n zs:text-center zs:transition-colors zs:duration-500 zs:animate-fadeIn\"\n [ngClass]=\"[style().iconText]\"\n >\n\n <!-- ========================= Icon ========================= --> \n <div class=\"zs:text-[136px] zs:mb-8 animate-float zs:opacity-90 zs:leading-none\">\n <i class=\"fa-solid\" [class]=\"icon()\"></i>\n </div>\n\n <!-- ========================= Title ========================= -->\n <h1 class=\"zs:text-6xl zs:font-black zs:tracking-widest zs:mb-2 \n zs:text-rose-600 zs:dark:text-rose-500 zs:select-none\n zs:drop-shadow-[0_0_8px_rgba(239,68,68,0.5)]\">\n 404\n </h1>\n\n\n <!-- ========================= Message ========================= -->\n <h2 class=\"zs:text-2xl zs:text-rose-600/80 zs:dark:text-rose-800/80 zs:font-semibold zs:mb-4\">\n {{ title() }}\n </h2>\n <p class=\"zs:text-base zs:max-w-md zs:text-gray-600 zs:dark:text-gray-400 zs:mb-8\">\n {{ message() }}\n </p>\n\n <!-- ========================= Button ========================= -->\n @if (showButton()) {\n <a\n [routerLink]=\"routerLink()\"\n (click)=\"onAction.emit()\"\n class=\"zs:px-6 zs:py-2 zs:rounded-full\n zs:text-white zs:font-medium zs:shadow-md\n zs:hover:shadow-lg zs:flex zs:items-center \n zs:justify-center zs:transition-all zs:duration-300 zs:ease-out \n zs:gap-1.5\"\n [ngClass]=\"[style().btnBG, style().
|
|
1653
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: Page404, isStandalone: true, selector: "ZS-page404", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, pageStyle: { classPropertyName: "pageStyle", publicName: "pageStyle", isSignal: true, isRequired: false, transformFunction: null }, showButton: { classPropertyName: "showButton", publicName: "showButton", isSignal: true, isRequired: false, transformFunction: null }, buttonText: { classPropertyName: "buttonText", publicName: "buttonText", isSignal: true, isRequired: false, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onAction: "onAction" }, ngImport: i0, template: "<!-- ========================= Page 404 Container ========================= -->\n<div class=\"zs:flex zs:flex-col zs:items-center zs:justify-center zs:min-h-[90vh]\n zs:text-center zs:transition-colors zs:duration-500 zs:animate-fadeIn\"\n [ngClass]=\"[style().iconText]\"\n >\n\n <!-- ========================= Icon ========================= --> \n <div class=\"zs:text-[136px] zs:mb-8 animate-float zs:opacity-90 zs:leading-none\">\n <i class=\"fa-solid\" [class]=\"icon()\"></i>\n </div>\n\n <!-- ========================= Title ========================= -->\n <h1 class=\"zs:text-6xl zs:font-black zs:tracking-widest zs:mb-2 \n zs:text-rose-600 zs:dark:text-rose-500 zs:select-none\n zs:drop-shadow-[0_0_8px_rgba(239,68,68,0.5)]\">\n 404\n </h1>\n\n\n <!-- ========================= Message ========================= -->\n <h2 class=\"zs:text-2xl zs:text-rose-600/80 zs:dark:text-rose-800/80 zs:font-semibold zs:mb-4\">\n {{ title() }}\n </h2>\n <p class=\"zs:text-base zs:max-w-md zs:text-gray-600 zs:dark:text-gray-400 zs:mb-8\">\n {{ message() }}\n </p>\n\n <!-- ========================= Button ========================= -->\n @if (showButton()) {\n <a\n [routerLink]=\"routerLink()\"\n (click)=\"onAction.emit()\"\n class=\"zs:px-6 zs:py-2 zs:rounded-full\n zs:text-white zs:font-medium zs:shadow-md\n zs:hover:shadow-lg zs:flex zs:items-center \n zs:justify-center zs:transition-all zs:duration-300 zs:ease-out \n zs:gap-1.5\"\n [ngClass]=\"[style().btnBG, style().btnBGHover]\"\n >\n <i class=\"fa-solid fa-house\"></i>\n {{ buttonText() }}\n </a>\n }\n</div>\n", styles: ["@keyframes float{0%{transform:translateY(0)}50%{transform:translateY(-10px)}to{transform:translateY(0)}}.animate-float{animation:float 3s ease-in-out infinite}\n"], dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1377
1654
|
}
|
|
1378
1655
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: Page404, decorators: [{
|
|
1379
1656
|
type: Component,
|
|
1380
|
-
args: [{ selector: 'ZS-page404', imports: [RouterModule, CommonModule], template: "<!-- ========================= Page 404 Container ========================= -->\n<div class=\"zs:flex zs:flex-col zs:items-center zs:justify-center zs:min-h-[90vh]\n zs:text-center zs:transition-colors zs:duration-500 zs:animate-fadeIn\"\n [ngClass]=\"[style().iconText]\"\n >\n\n <!-- ========================= Icon ========================= --> \n <div class=\"zs:text-[136px] zs:mb-8 animate-float zs:opacity-90 zs:leading-none\">\n <i class=\"fa-solid\" [class]=\"icon()\"></i>\n </div>\n\n <!-- ========================= Title ========================= -->\n <h1 class=\"zs:text-6xl zs:font-black zs:tracking-widest zs:mb-2 \n zs:text-rose-600 zs:dark:text-rose-500 zs:select-none\n zs:drop-shadow-[0_0_8px_rgba(239,68,68,0.5)]\">\n 404\n </h1>\n\n\n <!-- ========================= Message ========================= -->\n <h2 class=\"zs:text-2xl zs:text-rose-600/80 zs:dark:text-rose-800/80 zs:font-semibold zs:mb-4\">\n {{ title() }}\n </h2>\n <p class=\"zs:text-base zs:max-w-md zs:text-gray-600 zs:dark:text-gray-400 zs:mb-8\">\n {{ message() }}\n </p>\n\n <!-- ========================= Button ========================= -->\n @if (showButton()) {\n <a\n [routerLink]=\"routerLink()\"\n (click)=\"onAction.emit()\"\n class=\"zs:px-6 zs:py-2 zs:rounded-full\n zs:text-white zs:font-medium zs:shadow-md\n zs:hover:shadow-lg zs:flex zs:items-center \n zs:justify-center zs:transition-all zs:duration-300 zs:ease-out \n zs:gap-1.5\"\n [ngClass]=\"[style().btnBG, style().
|
|
1657
|
+
args: [{ selector: 'ZS-page404', imports: [RouterModule, CommonModule], template: "<!-- ========================= Page 404 Container ========================= -->\n<div class=\"zs:flex zs:flex-col zs:items-center zs:justify-center zs:min-h-[90vh]\n zs:text-center zs:transition-colors zs:duration-500 zs:animate-fadeIn\"\n [ngClass]=\"[style().iconText]\"\n >\n\n <!-- ========================= Icon ========================= --> \n <div class=\"zs:text-[136px] zs:mb-8 animate-float zs:opacity-90 zs:leading-none\">\n <i class=\"fa-solid\" [class]=\"icon()\"></i>\n </div>\n\n <!-- ========================= Title ========================= -->\n <h1 class=\"zs:text-6xl zs:font-black zs:tracking-widest zs:mb-2 \n zs:text-rose-600 zs:dark:text-rose-500 zs:select-none\n zs:drop-shadow-[0_0_8px_rgba(239,68,68,0.5)]\">\n 404\n </h1>\n\n\n <!-- ========================= Message ========================= -->\n <h2 class=\"zs:text-2xl zs:text-rose-600/80 zs:dark:text-rose-800/80 zs:font-semibold zs:mb-4\">\n {{ title() }}\n </h2>\n <p class=\"zs:text-base zs:max-w-md zs:text-gray-600 zs:dark:text-gray-400 zs:mb-8\">\n {{ message() }}\n </p>\n\n <!-- ========================= Button ========================= -->\n @if (showButton()) {\n <a\n [routerLink]=\"routerLink()\"\n (click)=\"onAction.emit()\"\n class=\"zs:px-6 zs:py-2 zs:rounded-full\n zs:text-white zs:font-medium zs:shadow-md\n zs:hover:shadow-lg zs:flex zs:items-center \n zs:justify-center zs:transition-all zs:duration-300 zs:ease-out \n zs:gap-1.5\"\n [ngClass]=\"[style().btnBG, style().btnBGHover]\"\n >\n <i class=\"fa-solid fa-house\"></i>\n {{ buttonText() }}\n </a>\n }\n</div>\n", styles: ["@keyframes float{0%{transform:translateY(0)}50%{transform:translateY(-10px)}to{transform:translateY(0)}}.animate-float{animation:float 3s ease-in-out infinite}\n"] }]
|
|
1381
1658
|
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], pageStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageStyle", required: false }] }], showButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showButton", required: false }] }], buttonText: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonText", required: false }] }], routerLink: [{ type: i0.Input, args: [{ isSignal: true, alias: "routerLink", required: false }] }], onAction: [{ type: i0.Output, args: ["onAction"] }] } });
|
|
1382
1659
|
|
|
1383
1660
|
// ========================================================================
|
|
@@ -1629,10 +1906,14 @@ class ThemeToggle {
|
|
|
1629
1906
|
currentTheme = signal('light', ...(ngDevMode ? [{ debugName: "currentTheme" }] : []));
|
|
1630
1907
|
isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
1631
1908
|
userSelectedTheme = signal(false, ...(ngDevMode ? [{ debugName: "userSelectedTheme" }] : []));
|
|
1909
|
+
lastEmittedTheme = null;
|
|
1910
|
+
lastManualTheme = null;
|
|
1632
1911
|
// ==============================================
|
|
1633
1912
|
// Inputs
|
|
1634
1913
|
// ==============================================
|
|
1635
1914
|
bodyClass = input('zs:bg-white zs:dark:bg-gray-900 zs:text-gray-900 zs:dark:text-gray-100', ...(ngDevMode ? [{ debugName: "bodyClass" }] : []));
|
|
1915
|
+
showDefaultUI = input(true, ...(ngDevMode ? [{ debugName: "showDefaultUI" }] : []));
|
|
1916
|
+
setManualTheme = input(null, ...(ngDevMode ? [{ debugName: "setManualTheme" }] : []));
|
|
1636
1917
|
// ==============================================
|
|
1637
1918
|
// Outputs
|
|
1638
1919
|
// ==============================================
|
|
@@ -1665,11 +1946,27 @@ class ThemeToggle {
|
|
|
1665
1946
|
effect(() => {
|
|
1666
1947
|
const theme = this.currentTheme();
|
|
1667
1948
|
document.documentElement.classList.toggle('dark', theme === 'dark');
|
|
1668
|
-
|
|
1949
|
+
const classes = this.bodyClass().split(' ');
|
|
1950
|
+
document.body.classList.value = ''; // clear only what YOU set
|
|
1951
|
+
classes.forEach(c => document.body.classList.add(c));
|
|
1669
1952
|
if (this.userSelectedTheme()) {
|
|
1670
1953
|
localStorage.setItem('theme', theme);
|
|
1671
1954
|
}
|
|
1672
1955
|
});
|
|
1956
|
+
effect(() => {
|
|
1957
|
+
const manual = this.setManualTheme();
|
|
1958
|
+
if (manual && manual !== this.lastManualTheme) {
|
|
1959
|
+
this.lastManualTheme = manual;
|
|
1960
|
+
this.setTheme(manual);
|
|
1961
|
+
}
|
|
1962
|
+
});
|
|
1963
|
+
effect(() => {
|
|
1964
|
+
const theme = this.currentTheme();
|
|
1965
|
+
if (theme !== this.lastEmittedTheme) {
|
|
1966
|
+
this.lastEmittedTheme = theme;
|
|
1967
|
+
this.themeChangeEv.emit(theme);
|
|
1968
|
+
}
|
|
1969
|
+
});
|
|
1673
1970
|
}
|
|
1674
1971
|
// ==============================================
|
|
1675
1972
|
// Component Methods
|
|
@@ -1678,10 +1975,11 @@ class ThemeToggle {
|
|
|
1678
1975
|
this.isOpen.set(!this.isOpen());
|
|
1679
1976
|
}
|
|
1680
1977
|
setTheme(theme) {
|
|
1681
|
-
this.currentTheme
|
|
1978
|
+
if (this.currentTheme() !== theme) {
|
|
1979
|
+
this.currentTheme.set(theme);
|
|
1980
|
+
this.userSelectedTheme.set(true);
|
|
1981
|
+
}
|
|
1682
1982
|
this.isOpen.set(false);
|
|
1683
|
-
this.themeChangeEv.emit(theme);
|
|
1684
|
-
this.userSelectedTheme.set(true);
|
|
1685
1983
|
}
|
|
1686
1984
|
// ==============================================
|
|
1687
1985
|
// Host Listeners
|
|
@@ -1693,12 +1991,12 @@ class ThemeToggle {
|
|
|
1693
1991
|
}
|
|
1694
1992
|
}
|
|
1695
1993
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: ThemeToggle, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1696
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: ThemeToggle, isStandalone: true, selector: "ZS-theme-toggle", inputs: { bodyClass: { classPropertyName: "bodyClass", publicName: "bodyClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { themeChangeEv: "themeChangeEv" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, ngImport: i0, template: "<!-- ========================= Theme Switcher Panel ========================= -->\n<div \n
|
|
1994
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: ThemeToggle, isStandalone: true, selector: "ZS-theme-toggle", inputs: { bodyClass: { classPropertyName: "bodyClass", publicName: "bodyClass", isSignal: true, isRequired: false, transformFunction: null }, showDefaultUI: { classPropertyName: "showDefaultUI", publicName: "showDefaultUI", isSignal: true, isRequired: false, transformFunction: null }, setManualTheme: { classPropertyName: "setManualTheme", publicName: "setManualTheme", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { themeChangeEv: "themeChangeEv" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, ngImport: i0, template: "<!-- ========================= Theme Switcher Panel ========================= -->\n@if(showDefaultUI()) {\n <div \n class=\"zs:fixed zs:left-0 zs:top-1/6 {{ zIndices.themeToggle }} zs:transform \n zs:-translate-y-1/2 zs:transition-all zs:duration-300\"\n [ngClass]=\"!isOpen() ? 'zs:-translate-x-24' : ''\"\n role=\"complementary\"\n aria-label=\"Theme switcher panel\"\n >\n <!-- ========================= Theme Selection Buttons ========================= -->\n <div class=\"zs:flex zs:items-center\">\n <div \n class=\"zs:flex zs:overflow-hidden zs:transition-all zs:duration-300\"\n role=\"group\"\n aria-label=\"Theme selection\"\n >\n <!-- Light Theme Button -->\n <button\n (click)=\"setTheme('light')\"\n type=\"button\"\n class=\"zs:px-3 zs:py-2 zs:rounded-l-none zs:border-l-0 zs:border-y \n zs:transition-colors zs:shrink-0\n zs:bg-white zs:text-gray-900 zs:border-gray-300\n zs:dark:bg-gray-800 zs:dark:text-gray-100 zs:dark:border-gray-600\n zs:hover:bg-gray-100 zs:dark:hover:bg-gray-700 zs:w-12\n zs:focus:outline-hidden zs:focus-visible:ring-2 zs:focus-visible:ring-offset-2 \n zs:focus-visible:ring-blue-500\"\n aria-label=\"Activate light theme\"\n [attr.aria-pressed]=\"currentTheme() === 'light'\"\n >\n <i class=\"fas fa-sun zs:text-yellow-500\" aria-hidden=\"true\"></i>\n </button>\n \n <!-- Dark Theme Button -->\n <button\n (click)=\"setTheme('dark')\"\n type=\"button\"\n class=\"zs:px-3 zs:py-2 zs:rounded-r-lg zs:border-y zs:border-r \n zs:transition-colors zs:shrink-0\n zs:bg-white zs:text-gray-900 zs:border-gray-300\n zs:dark:bg-gray-800 zs:dark:text-gray-100 zs:dark:border-gray-600\n zs:hover:bg-gray-100 zs:dark:hover:bg-gray-700 zs:w-12\n zs:focus:outline-hidden zs:focus-visible:ring-2 zs:focus-visible:ring-offset-2 \n zs:focus-visible:ring-blue-500\"\n aria-label=\"Activate dark theme\"\n [attr.aria-pressed]=\"currentTheme() === 'dark'\"\n >\n <i class=\"fas fa-moon\" aria-hidden=\"true\"></i>\n </button>\n </div>\n \n <!-- ========================= Toggle Button with Connector ========================= -->\n <div \n class=\"zs:relative\"\n [ngClass]=\"isOpen() ? 'zs:hidden' : ''\"\n >\n <!-- Connector Line -->\n <div\n class=\"zs:absolute zs:top-1/2 zs:right-0 zs:h-0.5 zs:w-3 zs:transform zs:-translate-y-1/2\n zs:bg-gray-300 zs:dark:bg-gray-600\"\n aria-hidden=\"true\"\n ></div>\n \n <!-- Toggle Button -->\n <button\n (click)=\"toggleOpen()\"\n type=\"button\"\n class=\"zs:relative zs:z-100 zs:w-12 zs:h-12 zs:rounded-full zs:rounded-l-none zs:border-l-0 \n zs:border-2\n zs:transition-all zs:duration-300 zs:flex zs:items-center zs:justify-center\n zs:bg-white zs:text-gray-900 zs:border-gray-300\n zs:dark:bg-gray-800 zs:dark:text-gray-100 zs:dark:border-gray-600\n zs:hover:bg-gray-100 zs:dark:hover:bg-gray-700\n zs:focus:outline-hidden zs:focus-visible:ring-2 zs:focus-visible:ring-offset-2 \n zs:focus-visible:ring-blue-500\"\n aria-label=\"Toggle theme switcher\"\n [attr.aria-expanded]=\"isOpen()\"\n aria-controls=\"theme-panel\"\n >\n @if (currentTheme() === 'dark') {\n <i class=\"fas fa-moon\" aria-hidden=\"true\"></i>\n } @else {\n <i class=\"fas fa-sun zs:text-yellow-500\" aria-hidden=\"true\"></i>\n }\n </button>\n </div>\n </div>\n </div>\n}", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1697
1995
|
}
|
|
1698
1996
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: ThemeToggle, decorators: [{
|
|
1699
1997
|
type: Component,
|
|
1700
|
-
args: [{ selector: 'ZS-theme-toggle', imports: [CommonModule], template: "<!-- ========================= Theme Switcher Panel ========================= -->\n<div \n
|
|
1701
|
-
}], ctorParameters: () => [], propDecorators: { bodyClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "bodyClass", required: false }] }], themeChangeEv: [{ type: i0.Output, args: ["themeChangeEv"] }], onDocumentClick: [{
|
|
1998
|
+
args: [{ selector: 'ZS-theme-toggle', imports: [CommonModule], template: "<!-- ========================= Theme Switcher Panel ========================= -->\n@if(showDefaultUI()) {\n <div \n class=\"zs:fixed zs:left-0 zs:top-1/6 {{ zIndices.themeToggle }} zs:transform \n zs:-translate-y-1/2 zs:transition-all zs:duration-300\"\n [ngClass]=\"!isOpen() ? 'zs:-translate-x-24' : ''\"\n role=\"complementary\"\n aria-label=\"Theme switcher panel\"\n >\n <!-- ========================= Theme Selection Buttons ========================= -->\n <div class=\"zs:flex zs:items-center\">\n <div \n class=\"zs:flex zs:overflow-hidden zs:transition-all zs:duration-300\"\n role=\"group\"\n aria-label=\"Theme selection\"\n >\n <!-- Light Theme Button -->\n <button\n (click)=\"setTheme('light')\"\n type=\"button\"\n class=\"zs:px-3 zs:py-2 zs:rounded-l-none zs:border-l-0 zs:border-y \n zs:transition-colors zs:shrink-0\n zs:bg-white zs:text-gray-900 zs:border-gray-300\n zs:dark:bg-gray-800 zs:dark:text-gray-100 zs:dark:border-gray-600\n zs:hover:bg-gray-100 zs:dark:hover:bg-gray-700 zs:w-12\n zs:focus:outline-hidden zs:focus-visible:ring-2 zs:focus-visible:ring-offset-2 \n zs:focus-visible:ring-blue-500\"\n aria-label=\"Activate light theme\"\n [attr.aria-pressed]=\"currentTheme() === 'light'\"\n >\n <i class=\"fas fa-sun zs:text-yellow-500\" aria-hidden=\"true\"></i>\n </button>\n \n <!-- Dark Theme Button -->\n <button\n (click)=\"setTheme('dark')\"\n type=\"button\"\n class=\"zs:px-3 zs:py-2 zs:rounded-r-lg zs:border-y zs:border-r \n zs:transition-colors zs:shrink-0\n zs:bg-white zs:text-gray-900 zs:border-gray-300\n zs:dark:bg-gray-800 zs:dark:text-gray-100 zs:dark:border-gray-600\n zs:hover:bg-gray-100 zs:dark:hover:bg-gray-700 zs:w-12\n zs:focus:outline-hidden zs:focus-visible:ring-2 zs:focus-visible:ring-offset-2 \n zs:focus-visible:ring-blue-500\"\n aria-label=\"Activate dark theme\"\n [attr.aria-pressed]=\"currentTheme() === 'dark'\"\n >\n <i class=\"fas fa-moon\" aria-hidden=\"true\"></i>\n </button>\n </div>\n \n <!-- ========================= Toggle Button with Connector ========================= -->\n <div \n class=\"zs:relative\"\n [ngClass]=\"isOpen() ? 'zs:hidden' : ''\"\n >\n <!-- Connector Line -->\n <div\n class=\"zs:absolute zs:top-1/2 zs:right-0 zs:h-0.5 zs:w-3 zs:transform zs:-translate-y-1/2\n zs:bg-gray-300 zs:dark:bg-gray-600\"\n aria-hidden=\"true\"\n ></div>\n \n <!-- Toggle Button -->\n <button\n (click)=\"toggleOpen()\"\n type=\"button\"\n class=\"zs:relative zs:z-100 zs:w-12 zs:h-12 zs:rounded-full zs:rounded-l-none zs:border-l-0 \n zs:border-2\n zs:transition-all zs:duration-300 zs:flex zs:items-center zs:justify-center\n zs:bg-white zs:text-gray-900 zs:border-gray-300\n zs:dark:bg-gray-800 zs:dark:text-gray-100 zs:dark:border-gray-600\n zs:hover:bg-gray-100 zs:dark:hover:bg-gray-700\n zs:focus:outline-hidden zs:focus-visible:ring-2 zs:focus-visible:ring-offset-2 \n zs:focus-visible:ring-blue-500\"\n aria-label=\"Toggle theme switcher\"\n [attr.aria-expanded]=\"isOpen()\"\n aria-controls=\"theme-panel\"\n >\n @if (currentTheme() === 'dark') {\n <i class=\"fas fa-moon\" aria-hidden=\"true\"></i>\n } @else {\n <i class=\"fas fa-sun zs:text-yellow-500\" aria-hidden=\"true\"></i>\n }\n </button>\n </div>\n </div>\n </div>\n}", styles: [":host{display:block}\n"] }]
|
|
1999
|
+
}], ctorParameters: () => [], propDecorators: { bodyClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "bodyClass", required: false }] }], showDefaultUI: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDefaultUI", required: false }] }], setManualTheme: [{ type: i0.Input, args: [{ isSignal: true, alias: "setManualTheme", required: false }] }], themeChangeEv: [{ type: i0.Output, args: ["themeChangeEv"] }], onDocumentClick: [{
|
|
1702
2000
|
type: HostListener,
|
|
1703
2001
|
args: ['document:click', ['$event']]
|
|
1704
2002
|
}] } });
|
|
@@ -1761,7 +2059,11 @@ class Checkbox {
|
|
|
1761
2059
|
// ==============================================
|
|
1762
2060
|
// Computed Signals
|
|
1763
2061
|
// ==============================================
|
|
1764
|
-
palette = computed(() =>
|
|
2062
|
+
palette = computed(() => {
|
|
2063
|
+
const checkboxTextPalette = checkboxTextPaletteMap.get(this.inputStyle());
|
|
2064
|
+
const ringPalette = ringPaletteMap.get(this.inputStyle());
|
|
2065
|
+
return { checkboxTextPalette, ringPalette };
|
|
2066
|
+
}, ...(ngDevMode ? [{ debugName: "palette" }] : []));
|
|
1765
2067
|
iconClasses = computed(() => {
|
|
1766
2068
|
const v = this.variant();
|
|
1767
2069
|
const s = this.shape();
|
|
@@ -1820,11 +2122,11 @@ class Checkbox {
|
|
|
1820
2122
|
}
|
|
1821
2123
|
}
|
|
1822
2124
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: Checkbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1823
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.9", type: Checkbox, isStandalone: true, selector: "ZS-checkbox", inputs: { Id: { classPropertyName: "Id", publicName: "Id", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, inputStyle: { classPropertyName: "inputStyle", publicName: "inputStyle", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "<div class=\"zs:flex zs:items-center zs:justify-start zs:w-full zs:select-none\">\n <!-- ===================== Checkbox Wrapper ===================== -->\n <div\n class=\"zs:cursor-pointer group leading-none\"\n >\n <!-- ===================== Hidden Input (Native for screen readers) ===================== -->\n <input\n type=\"checkbox\"\n class=\"zs:hidden\"\n [id]=\"Id()\"\n [checked]=\"isChecked()\"\n [disabled]=\"disabledOrReadonly()\"\n (change)=\"toggleChecked()\"\n />\n\n <!-- ===================== Custom Accessible Checkbox ===================== -->\n <span\n role=\"'checkbox'\"\n tabindex=\"0\"\n [attr.aria-checked]=\"isChecked()\"\n [attr.aria-disabled]=\"disabledOrReadonly()\"\n [attr.aria-labelledby]=\"Id() + '-label'\"\n [ngClass]=\"[\n sizeClass(),\n palette().checkBoxText,\n palette().checkBoxTextHover,\n palette().ring,\n 'zs:leading-none zs:inline-flex zs:items-center zs:justify-center zs:focus:outline-hidden zs:focus-visible:ring-2'\n ]\"\n (click)=\"toggleChecked()\"\n (keydown)=\"onKeyDown($event)\"\n >\n <i [class]=\"iconClasses()\"></i>\n </span>\n </div>\n\n <!-- ===================== Label (ZS-label component) ===================== -->\n <ZS-label [class]=\"(label() || hint()) ? 'zs:ml-1' : ''\"\n [id]=\"Id() + '-label'\"\n [label]=\"label()\"\n [hint]=\"hint()\"\n [hintId]=\"Id() + '-hint'\"\n [size]=\"size()\"\n [for]=\"Id()\"\n ></ZS-label>\n</div>", styles: [""], dependencies: [{ kind: "component", type: Label, selector: "ZS-label", inputs: ["label", "hint", "hintId", "size", "required", "for"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
2125
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.9", type: Checkbox, isStandalone: true, selector: "ZS-checkbox", inputs: { Id: { classPropertyName: "Id", publicName: "Id", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, inputStyle: { classPropertyName: "inputStyle", publicName: "inputStyle", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, ngImport: i0, template: "<div class=\"zs:flex zs:items-center zs:justify-start zs:w-full zs:select-none\">\n <!-- ===================== Checkbox Wrapper ===================== -->\n <div\n class=\"zs:cursor-pointer group leading-none\"\n >\n <!-- ===================== Hidden Input (Native for screen readers) ===================== -->\n <input\n type=\"checkbox\"\n class=\"zs:hidden\"\n [id]=\"Id()\"\n [checked]=\"isChecked()\"\n [disabled]=\"disabledOrReadonly()\"\n (change)=\"toggleChecked()\"\n />\n\n <!-- ===================== Custom Accessible Checkbox ===================== -->\n <span\n role=\"'checkbox'\"\n tabindex=\"0\"\n [attr.aria-checked]=\"isChecked()\"\n [attr.aria-disabled]=\"disabledOrReadonly()\"\n [attr.aria-labelledby]=\"Id() + '-label'\"\n [ngClass]=\"[\n sizeClass(),\n palette().checkboxTextPalette.checkBoxText,\n palette().checkboxTextPalette.checkBoxTextHover,\n palette().ringPalette.ring,\n 'zs:leading-none zs:inline-flex zs:items-center zs:justify-center zs:focus:outline-hidden zs:focus-visible:ring-2'\n ]\"\n (click)=\"toggleChecked()\"\n (keydown)=\"onKeyDown($event)\"\n >\n <i [class]=\"iconClasses()\"></i>\n </span>\n </div>\n\n <!-- ===================== Label (ZS-label component) ===================== -->\n <ZS-label [class]=\"(label() || hint()) ? 'zs:ml-1' : ''\"\n [id]=\"Id() + '-label'\"\n [label]=\"label()\"\n [hint]=\"hint()\"\n [hintId]=\"Id() + '-hint'\"\n [size]=\"size()\"\n [for]=\"Id()\"\n ></ZS-label>\n</div>", styles: [""], dependencies: [{ kind: "component", type: Label, selector: "ZS-label", inputs: ["label", "hint", "hintId", "size", "required", "for"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1824
2126
|
}
|
|
1825
2127
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: Checkbox, decorators: [{
|
|
1826
2128
|
type: Component,
|
|
1827
|
-
args: [{ selector: 'ZS-checkbox', imports: [Label, CommonModule], template: "<div class=\"zs:flex zs:items-center zs:justify-start zs:w-full zs:select-none\">\n <!-- ===================== Checkbox Wrapper ===================== -->\n <div\n class=\"zs:cursor-pointer group leading-none\"\n >\n <!-- ===================== Hidden Input (Native for screen readers) ===================== -->\n <input\n type=\"checkbox\"\n class=\"zs:hidden\"\n [id]=\"Id()\"\n [checked]=\"isChecked()\"\n [disabled]=\"disabledOrReadonly()\"\n (change)=\"toggleChecked()\"\n />\n\n <!-- ===================== Custom Accessible Checkbox ===================== -->\n <span\n role=\"'checkbox'\"\n tabindex=\"0\"\n [attr.aria-checked]=\"isChecked()\"\n [attr.aria-disabled]=\"disabledOrReadonly()\"\n [attr.aria-labelledby]=\"Id() + '-label'\"\n [ngClass]=\"[\n sizeClass(),\n palette().checkBoxText,\n palette().checkBoxTextHover,\n palette().ring,\n 'zs:leading-none zs:inline-flex zs:items-center zs:justify-center zs:focus:outline-hidden zs:focus-visible:ring-2'\n ]\"\n (click)=\"toggleChecked()\"\n (keydown)=\"onKeyDown($event)\"\n >\n <i [class]=\"iconClasses()\"></i>\n </span>\n </div>\n\n <!-- ===================== Label (ZS-label component) ===================== -->\n <ZS-label [class]=\"(label() || hint()) ? 'zs:ml-1' : ''\"\n [id]=\"Id() + '-label'\"\n [label]=\"label()\"\n [hint]=\"hint()\"\n [hintId]=\"Id() + '-hint'\"\n [size]=\"size()\"\n [for]=\"Id()\"\n ></ZS-label>\n</div>" }]
|
|
2129
|
+
args: [{ selector: 'ZS-checkbox', imports: [Label, CommonModule], template: "<div class=\"zs:flex zs:items-center zs:justify-start zs:w-full zs:select-none\">\n <!-- ===================== Checkbox Wrapper ===================== -->\n <div\n class=\"zs:cursor-pointer group leading-none\"\n >\n <!-- ===================== Hidden Input (Native for screen readers) ===================== -->\n <input\n type=\"checkbox\"\n class=\"zs:hidden\"\n [id]=\"Id()\"\n [checked]=\"isChecked()\"\n [disabled]=\"disabledOrReadonly()\"\n (change)=\"toggleChecked()\"\n />\n\n <!-- ===================== Custom Accessible Checkbox ===================== -->\n <span\n role=\"'checkbox'\"\n tabindex=\"0\"\n [attr.aria-checked]=\"isChecked()\"\n [attr.aria-disabled]=\"disabledOrReadonly()\"\n [attr.aria-labelledby]=\"Id() + '-label'\"\n [ngClass]=\"[\n sizeClass(),\n palette().checkboxTextPalette.checkBoxText,\n palette().checkboxTextPalette.checkBoxTextHover,\n palette().ringPalette.ring,\n 'zs:leading-none zs:inline-flex zs:items-center zs:justify-center zs:focus:outline-hidden zs:focus-visible:ring-2'\n ]\"\n (click)=\"toggleChecked()\"\n (keydown)=\"onKeyDown($event)\"\n >\n <i [class]=\"iconClasses()\"></i>\n </span>\n </div>\n\n <!-- ===================== Label (ZS-label component) ===================== -->\n <ZS-label [class]=\"(label() || hint()) ? 'zs:ml-1' : ''\"\n [id]=\"Id() + '-label'\"\n [label]=\"label()\"\n [hint]=\"hint()\"\n [hintId]=\"Id() + '-hint'\"\n [size]=\"size()\"\n [for]=\"Id()\"\n ></ZS-label>\n</div>" }]
|
|
1828
2130
|
}], propDecorators: { Id: [{ type: i0.Input, args: [{ isSignal: true, alias: "Id", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], inputStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputStyle", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], isReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "isReadonly", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
1829
2131
|
|
|
1830
2132
|
// ==============================================================================
|
|
@@ -1894,7 +2196,11 @@ class FileInput {
|
|
|
1894
2196
|
// ==============================================================================
|
|
1895
2197
|
// Computed Properties
|
|
1896
2198
|
// ==============================================================================
|
|
1897
|
-
palette = computed(() =>
|
|
2199
|
+
palette = computed(() => {
|
|
2200
|
+
const inputPalette = inputPaletteMap.get(this.inputStyle());
|
|
2201
|
+
const ringPalette = ringPaletteMap.get(this.inputStyle());
|
|
2202
|
+
return { inputPalette, ringPalette };
|
|
2203
|
+
}, ...(ngDevMode ? [{ debugName: "palette" }] : []));
|
|
1898
2204
|
hasFiles = computed(() => this.files().size > 0, ...(ngDevMode ? [{ debugName: "hasFiles" }] : []));
|
|
1899
2205
|
totalSize = computed(() => this.filesMapToList().reduce((sum, f) => sum + f.size, 0), ...(ngDevMode ? [{ debugName: "totalSize" }] : []));
|
|
1900
2206
|
disabledOrReadonly = computed(() => this.disabled() || this.isReadonly(), ...(ngDevMode ? [{ debugName: "disabledOrReadonly" }] : []));
|
|
@@ -2052,11 +2358,11 @@ class FileInput {
|
|
|
2052
2358
|
});
|
|
2053
2359
|
}
|
|
2054
2360
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: FileInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2055
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: FileInput, isStandalone: true, selector: "ZS-file", inputs: { Id: { classPropertyName: "Id", publicName: "Id", isSignal: true, isRequired: false, transformFunction: null }, iName: { classPropertyName: "iName", publicName: "iName", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, inputStyle: { classPropertyName: "inputStyle", publicName: "inputStyle", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, validateFns: { classPropertyName: "validateFns", publicName: "validateFns", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, allowPreview: { classPropertyName: "allowPreview", publicName: "allowPreview", isSignal: true, isRequired: false, transformFunction: null }, maxFiles: { classPropertyName: "maxFiles", publicName: "maxFiles", isSignal: true, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changeEv: "changeEv", files: "filesChange", touched: "touchedChange" }, viewQueries: [{ propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"zs:flex zs:flex-col zs:gap-2 zs:w-full\"\n [ngClass]=\"disabled() ? 'zs:opacity-60' : ''\"\n role=\"group\"\n [attr.aria-labelledby]=\"Id() + '-label'\"\n [attr.aria-describedby]=\"Id() + '-hint ' + Id() + '-error'\"\n>\n <!-- ========================= Label & Hint ========================= -->\n <ZS-label [class]=\"(label() || hint()) ? 'zs:mb-1' : ''\"\n [label]=\"label()\"\n [hint]=\"hint()\"\n [required]=\"required()\"\n [hintId]=\"Id() + '-hint'\"\n [for]=\"Id()\"\n [id]=\"Id() + '-label'\"\n >\n </ZS-label>\n\n <!-- ================= Input ================= -->\n <div\n [class]=\"[\n 'zs:relative zs:rounded-xl zs:flex zs:flex-col zs:justify-center zs:items-center zs:gap-2 zs:border-2 zs:border-dashed zs:transition-all zs:duration-200',\n palette().border,\n palette().ring,\n palette().borderHover,\n palette().inputBg\n ].join(' ')\"\n [ngClass]=\"disabledOrReadonly() ? 'cursor-not-allowed' : 'cursor-pointer'\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-disabled]=\"disabledOrReadonly()\"\n [attr.aria-label]=\"placeholder() || 'Upload file'\"\n (keydown.enter)=\"!disabledOrReadonly() && fileInput.click()\"\n (keydown.space)=\"!disabledOrReadonly() && fileInput.click()\"\n >\n <input\n #fileInput\n type=\"file\"\n [id]=\"Id()\"\n [name]=\"iName()\"\n [attr.accept]=\"accept()\"\n [attr.multiple]=\"multiple() ? '' : null\"\n [attr.autofocus]=\"autofocus() ? true : null\"\n class=\"zs:absolute zs:inset-0 zs:opacity-0 zs:cursor-pointer\"\n [disabled]=\"disabledOrReadonly()\"\n (change)=\"handleFileChange($event)\"\n [attr.aria-required]=\"required()\"\n [attr.aria-invalid]=\"!!error().length\"\n [attr.aria-describedby]=\"Id() + '-hint ' + Id() + '-error'\"\n />\n\n <div class=\"zs:flex zs:flex-col zs:items-center zs:justify-center zs:text-center zs:py-6 zs:pointer-events-none zs:select-none\">\n <i class=\"fa-solid fa-upload text-3xl mb-2\" [ngClass]=\"palette().text\" aria-hidden=\"true\"></i>\n <p class=\"zs:text-sm zs:text-gray-500 zs:dark:text-gray-400\">\n {{ placeholder() }}\n </p>\n </div>\n </div>\n\n <!-- ================= Files Preview ================= -->\n @if (hasFiles()) {\n <div\n class=\"zs:flex zs:flex-col zs:gap-2 zs:mt-3\"\n role=\"list\"\n aria-label=\"Uploaded files\"\n >\n @for (entry of files().entries(); track entry[0]) {\n <div\n class=\"zs:flex zs:flex-col zs:gap-1 zs:p-2 zs:rounded-lg zs:border zs:focus:outline-hidden zs:focus:ring-2 zs:focus:ring-offset-2\"\n [ngClass]=\"[palette().border, palette().inputBg]\"\n role=\"listitem\"\n tabindex=\"0\"\n >\n <span class=\"zs:block zs:text-sm zs:font-medium zs:truncate\">\n {{ entry[1].name }}\n </span>\n\n <div class=\"zs:flex zs:items-center zs:justify-between zs:gap-4\">\n <div class=\"zs:flex zs:items-center zs:gap-1\">\n <i class=\"text-lg fa-solid fa-file\" [ngClass]=\"palette().text\" aria-hidden=\"true\"></i>\n <span class=\"zs:text-xs zs:text-gray-500\">\n {{ formatSize(entry[1].size) }}\n </span>\n </div>\n\n <div class=\"zs:flex zs:gap-2\">\n @if (allowPreview() && entry[1].url?.startsWith('blob:')) {\n <ZS-button\n type=\"button\"\n (clickedEv)=\"preview(entry[1].url)\"\n [btnStyle]=\"inputStyle()\"\n size=\"sm\"\n aria-label=\"Preview {{ entry[1].name }}\"\n >\n Preview\n </ZS-button>\n }\n\n @if (!disabledOrReadonly()) {\n <ZS-button\n type=\"button\"\n variant=\"outline\"\n btnStyle=\"danger\"\n (clickedEv)=\"removeFile(entry[0])\"\n icon=\"fa-solid fa-trash\"\n aria-label=\"Remove {{ entry[1].name }}\"\n >\n </ZS-button>\n }\n </div>\n </div>\n </div>\n }\n </div>\n }\n\n <!-- ========================= Error Messages ========================= -->\n <ZS-input-errors\n [Id]=\"Id() + '-error'\"\n [errors]=\"[error()]\"\n aria-live=\"assertive\"\n role=\"alert\"\n >\n </ZS-input-errors>\n</div>\n", styles: [":host{@apply block w-full;}input[type=file]:disabled{@apply cursor-not-allowed opacity-60;}\n"], dependencies: [{ kind: "component", type: Label, selector: "ZS-label", inputs: ["label", "hint", "hintId", "size", "required", "for"] }, { kind: "component", type: InputErrors, selector: "ZS-input-errors", inputs: ["Id", "errors"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: Button, selector: "ZS-button", inputs: ["Id", "btnStyle", "variant", "size", "disabled", "icon", "type"], outputs: ["clickedEv"] }] });
|
|
2361
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: FileInput, isStandalone: true, selector: "ZS-file", inputs: { Id: { classPropertyName: "Id", publicName: "Id", isSignal: true, isRequired: false, transformFunction: null }, iName: { classPropertyName: "iName", publicName: "iName", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, inputStyle: { classPropertyName: "inputStyle", publicName: "inputStyle", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, validateFns: { classPropertyName: "validateFns", publicName: "validateFns", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, allowPreview: { classPropertyName: "allowPreview", publicName: "allowPreview", isSignal: true, isRequired: false, transformFunction: null }, maxFiles: { classPropertyName: "maxFiles", publicName: "maxFiles", isSignal: true, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changeEv: "changeEv", files: "filesChange", touched: "touchedChange" }, viewQueries: [{ propertyName: "fileInputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"zs:flex zs:flex-col zs:gap-2 zs:w-full\"\n [ngClass]=\"disabled() ? 'zs:opacity-60' : ''\"\n role=\"group\"\n [attr.aria-labelledby]=\"Id() + '-label'\"\n [attr.aria-describedby]=\"Id() + '-hint ' + Id() + '-error'\"\n>\n <!-- ========================= Label & Hint ========================= -->\n <ZS-label [class]=\"(label() || hint()) ? 'zs:mb-1' : ''\"\n [label]=\"label()\"\n [hint]=\"hint()\"\n [required]=\"required()\"\n [hintId]=\"Id() + '-hint'\"\n [for]=\"Id()\"\n [id]=\"Id() + '-label'\"\n >\n </ZS-label>\n\n <!-- ================= Input ================= -->\n <div\n [class]=\"[\n 'zs:relative zs:rounded-xl zs:flex zs:flex-col zs:justify-center zs:items-center zs:gap-2 zs:border-2 zs:border-dashed zs:transition-all zs:duration-200',\n palette().inputPalette.border,\n palette().ringPalette.ring,\n palette().inputPalette.borderHover,\n palette().inputPalette.inputBg\n ].join(' ')\"\n [ngClass]=\"disabledOrReadonly() ? 'cursor-not-allowed' : 'cursor-pointer'\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-disabled]=\"disabledOrReadonly()\"\n [attr.aria-label]=\"placeholder() || 'Upload file'\"\n (keydown.enter)=\"!disabledOrReadonly() && fileInput.click()\"\n (keydown.space)=\"!disabledOrReadonly() && fileInput.click()\"\n >\n <input\n #fileInput\n type=\"file\"\n [id]=\"Id()\"\n [name]=\"iName()\"\n [attr.accept]=\"accept()\"\n [attr.multiple]=\"multiple() ? '' : null\"\n [attr.autofocus]=\"autofocus() ? true : null\"\n class=\"zs:absolute zs:inset-0 zs:opacity-0 zs:cursor-pointer\"\n [disabled]=\"disabledOrReadonly()\"\n (change)=\"handleFileChange($event)\"\n [attr.aria-required]=\"required()\"\n [attr.aria-invalid]=\"!!error().length\"\n [attr.aria-describedby]=\"Id() + '-hint ' + Id() + '-error'\"\n />\n\n <div class=\"zs:flex zs:flex-col zs:items-center zs:justify-center zs:text-center zs:py-6 zs:pointer-events-none zs:select-none\">\n <i class=\"fa-solid fa-upload text-3xl mb-2\" [ngClass]=\"palette().inputPalette.text\" aria-hidden=\"true\"></i>\n <p class=\"zs:text-sm zs:text-gray-500 zs:dark:text-gray-400\">\n {{ placeholder() }}\n </p>\n </div>\n </div>\n\n <!-- ================= Files Preview ================= -->\n @if (hasFiles()) {\n <div\n class=\"zs:flex zs:flex-col zs:gap-2 zs:mt-3\"\n role=\"list\"\n aria-label=\"Uploaded files\"\n >\n @for (entry of files().entries(); track entry[0]) {\n <div\n class=\"zs:flex zs:flex-col zs:gap-1 zs:p-2 zs:rounded-lg zs:border zs:focus:outline-hidden zs:focus:ring-2 zs:focus:ring-offset-2\"\n [ngClass]=\"[palette().inputPalette.border, palette().inputPalette.inputBg]\"\n role=\"listitem\"\n tabindex=\"0\"\n >\n <span class=\"zs:block zs:text-sm zs:font-medium zs:truncate\">\n {{ entry[1].name }}\n </span>\n\n <div class=\"zs:flex zs:items-center zs:justify-between zs:gap-4\">\n <div class=\"zs:flex zs:items-center zs:gap-1\">\n <i class=\"text-lg fa-solid fa-file\" [ngClass]=\"palette().inputPalette.text\" aria-hidden=\"true\"></i>\n <span class=\"zs:text-xs zs:text-gray-500\">\n {{ formatSize(entry[1].size) }}\n </span>\n </div>\n\n <div class=\"zs:flex zs:gap-2\">\n @if (allowPreview() && entry[1].url?.startsWith('blob:')) {\n <ZS-button\n type=\"button\"\n (clickedEv)=\"preview(entry[1].url)\"\n [btnStyle]=\"inputStyle()\"\n size=\"sm\"\n aria-label=\"Preview {{ entry[1].name }}\"\n >\n Preview\n </ZS-button>\n }\n\n @if (!disabledOrReadonly()) {\n <ZS-button\n type=\"button\"\n variant=\"outline\"\n btnStyle=\"danger\"\n (clickedEv)=\"removeFile(entry[0])\"\n icon=\"fa-solid fa-trash\"\n aria-label=\"Remove {{ entry[1].name }}\"\n >\n </ZS-button>\n }\n </div>\n </div>\n </div>\n }\n </div>\n }\n\n <!-- ========================= Error Messages ========================= -->\n <ZS-input-errors\n [Id]=\"Id() + '-error'\"\n [errors]=\"[error()]\"\n aria-live=\"assertive\"\n role=\"alert\"\n >\n </ZS-input-errors>\n</div>\n", styles: [":host{@apply block w-full;}input[type=file]:disabled{@apply cursor-not-allowed opacity-60;}\n"], dependencies: [{ kind: "component", type: Label, selector: "ZS-label", inputs: ["label", "hint", "hintId", "size", "required", "for"] }, { kind: "component", type: InputErrors, selector: "ZS-input-errors", inputs: ["Id", "errors"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: Button, selector: "ZS-button", inputs: ["Id", "btnStyle", "variant", "size", "disabled", "icon", "type"], outputs: ["clickedEv"] }] });
|
|
2056
2362
|
}
|
|
2057
2363
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: FileInput, decorators: [{
|
|
2058
2364
|
type: Component,
|
|
2059
|
-
args: [{ selector: 'ZS-file', imports: [Label, InputErrors, CommonModule, Button], template: "<div\n class=\"zs:flex zs:flex-col zs:gap-2 zs:w-full\"\n [ngClass]=\"disabled() ? 'zs:opacity-60' : ''\"\n role=\"group\"\n [attr.aria-labelledby]=\"Id() + '-label'\"\n [attr.aria-describedby]=\"Id() + '-hint ' + Id() + '-error'\"\n>\n <!-- ========================= Label & Hint ========================= -->\n <ZS-label [class]=\"(label() || hint()) ? 'zs:mb-1' : ''\"\n [label]=\"label()\"\n [hint]=\"hint()\"\n [required]=\"required()\"\n [hintId]=\"Id() + '-hint'\"\n [for]=\"Id()\"\n [id]=\"Id() + '-label'\"\n >\n </ZS-label>\n\n <!-- ================= Input ================= -->\n <div\n [class]=\"[\n 'zs:relative zs:rounded-xl zs:flex zs:flex-col zs:justify-center zs:items-center zs:gap-2 zs:border-2 zs:border-dashed zs:transition-all zs:duration-200',\n palette().border,\n palette().ring,\n palette().borderHover,\n palette().inputBg\n ].join(' ')\"\n [ngClass]=\"disabledOrReadonly() ? 'cursor-not-allowed' : 'cursor-pointer'\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-disabled]=\"disabledOrReadonly()\"\n [attr.aria-label]=\"placeholder() || 'Upload file'\"\n (keydown.enter)=\"!disabledOrReadonly() && fileInput.click()\"\n (keydown.space)=\"!disabledOrReadonly() && fileInput.click()\"\n >\n <input\n #fileInput\n type=\"file\"\n [id]=\"Id()\"\n [name]=\"iName()\"\n [attr.accept]=\"accept()\"\n [attr.multiple]=\"multiple() ? '' : null\"\n [attr.autofocus]=\"autofocus() ? true : null\"\n class=\"zs:absolute zs:inset-0 zs:opacity-0 zs:cursor-pointer\"\n [disabled]=\"disabledOrReadonly()\"\n (change)=\"handleFileChange($event)\"\n [attr.aria-required]=\"required()\"\n [attr.aria-invalid]=\"!!error().length\"\n [attr.aria-describedby]=\"Id() + '-hint ' + Id() + '-error'\"\n />\n\n <div class=\"zs:flex zs:flex-col zs:items-center zs:justify-center zs:text-center zs:py-6 zs:pointer-events-none zs:select-none\">\n <i class=\"fa-solid fa-upload text-3xl mb-2\" [ngClass]=\"palette().text\" aria-hidden=\"true\"></i>\n <p class=\"zs:text-sm zs:text-gray-500 zs:dark:text-gray-400\">\n {{ placeholder() }}\n </p>\n </div>\n </div>\n\n <!-- ================= Files Preview ================= -->\n @if (hasFiles()) {\n <div\n class=\"zs:flex zs:flex-col zs:gap-2 zs:mt-3\"\n role=\"list\"\n aria-label=\"Uploaded files\"\n >\n @for (entry of files().entries(); track entry[0]) {\n <div\n class=\"zs:flex zs:flex-col zs:gap-1 zs:p-2 zs:rounded-lg zs:border zs:focus:outline-hidden zs:focus:ring-2 zs:focus:ring-offset-2\"\n [ngClass]=\"[palette().border, palette().inputBg]\"\n role=\"listitem\"\n tabindex=\"0\"\n >\n <span class=\"zs:block zs:text-sm zs:font-medium zs:truncate\">\n {{ entry[1].name }}\n </span>\n\n <div class=\"zs:flex zs:items-center zs:justify-between zs:gap-4\">\n <div class=\"zs:flex zs:items-center zs:gap-1\">\n <i class=\"text-lg fa-solid fa-file\" [ngClass]=\"palette().text\" aria-hidden=\"true\"></i>\n <span class=\"zs:text-xs zs:text-gray-500\">\n {{ formatSize(entry[1].size) }}\n </span>\n </div>\n\n <div class=\"zs:flex zs:gap-2\">\n @if (allowPreview() && entry[1].url?.startsWith('blob:')) {\n <ZS-button\n type=\"button\"\n (clickedEv)=\"preview(entry[1].url)\"\n [btnStyle]=\"inputStyle()\"\n size=\"sm\"\n aria-label=\"Preview {{ entry[1].name }}\"\n >\n Preview\n </ZS-button>\n }\n\n @if (!disabledOrReadonly()) {\n <ZS-button\n type=\"button\"\n variant=\"outline\"\n btnStyle=\"danger\"\n (clickedEv)=\"removeFile(entry[0])\"\n icon=\"fa-solid fa-trash\"\n aria-label=\"Remove {{ entry[1].name }}\"\n >\n </ZS-button>\n }\n </div>\n </div>\n </div>\n }\n </div>\n }\n\n <!-- ========================= Error Messages ========================= -->\n <ZS-input-errors\n [Id]=\"Id() + '-error'\"\n [errors]=\"[error()]\"\n aria-live=\"assertive\"\n role=\"alert\"\n >\n </ZS-input-errors>\n</div>\n", styles: [":host{@apply block w-full;}input[type=file]:disabled{@apply cursor-not-allowed opacity-60;}\n"] }]
|
|
2365
|
+
args: [{ selector: 'ZS-file', imports: [Label, InputErrors, CommonModule, Button], template: "<div\n class=\"zs:flex zs:flex-col zs:gap-2 zs:w-full\"\n [ngClass]=\"disabled() ? 'zs:opacity-60' : ''\"\n role=\"group\"\n [attr.aria-labelledby]=\"Id() + '-label'\"\n [attr.aria-describedby]=\"Id() + '-hint ' + Id() + '-error'\"\n>\n <!-- ========================= Label & Hint ========================= -->\n <ZS-label [class]=\"(label() || hint()) ? 'zs:mb-1' : ''\"\n [label]=\"label()\"\n [hint]=\"hint()\"\n [required]=\"required()\"\n [hintId]=\"Id() + '-hint'\"\n [for]=\"Id()\"\n [id]=\"Id() + '-label'\"\n >\n </ZS-label>\n\n <!-- ================= Input ================= -->\n <div\n [class]=\"[\n 'zs:relative zs:rounded-xl zs:flex zs:flex-col zs:justify-center zs:items-center zs:gap-2 zs:border-2 zs:border-dashed zs:transition-all zs:duration-200',\n palette().inputPalette.border,\n palette().ringPalette.ring,\n palette().inputPalette.borderHover,\n palette().inputPalette.inputBg\n ].join(' ')\"\n [ngClass]=\"disabledOrReadonly() ? 'cursor-not-allowed' : 'cursor-pointer'\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-disabled]=\"disabledOrReadonly()\"\n [attr.aria-label]=\"placeholder() || 'Upload file'\"\n (keydown.enter)=\"!disabledOrReadonly() && fileInput.click()\"\n (keydown.space)=\"!disabledOrReadonly() && fileInput.click()\"\n >\n <input\n #fileInput\n type=\"file\"\n [id]=\"Id()\"\n [name]=\"iName()\"\n [attr.accept]=\"accept()\"\n [attr.multiple]=\"multiple() ? '' : null\"\n [attr.autofocus]=\"autofocus() ? true : null\"\n class=\"zs:absolute zs:inset-0 zs:opacity-0 zs:cursor-pointer\"\n [disabled]=\"disabledOrReadonly()\"\n (change)=\"handleFileChange($event)\"\n [attr.aria-required]=\"required()\"\n [attr.aria-invalid]=\"!!error().length\"\n [attr.aria-describedby]=\"Id() + '-hint ' + Id() + '-error'\"\n />\n\n <div class=\"zs:flex zs:flex-col zs:items-center zs:justify-center zs:text-center zs:py-6 zs:pointer-events-none zs:select-none\">\n <i class=\"fa-solid fa-upload text-3xl mb-2\" [ngClass]=\"palette().inputPalette.text\" aria-hidden=\"true\"></i>\n <p class=\"zs:text-sm zs:text-gray-500 zs:dark:text-gray-400\">\n {{ placeholder() }}\n </p>\n </div>\n </div>\n\n <!-- ================= Files Preview ================= -->\n @if (hasFiles()) {\n <div\n class=\"zs:flex zs:flex-col zs:gap-2 zs:mt-3\"\n role=\"list\"\n aria-label=\"Uploaded files\"\n >\n @for (entry of files().entries(); track entry[0]) {\n <div\n class=\"zs:flex zs:flex-col zs:gap-1 zs:p-2 zs:rounded-lg zs:border zs:focus:outline-hidden zs:focus:ring-2 zs:focus:ring-offset-2\"\n [ngClass]=\"[palette().inputPalette.border, palette().inputPalette.inputBg]\"\n role=\"listitem\"\n tabindex=\"0\"\n >\n <span class=\"zs:block zs:text-sm zs:font-medium zs:truncate\">\n {{ entry[1].name }}\n </span>\n\n <div class=\"zs:flex zs:items-center zs:justify-between zs:gap-4\">\n <div class=\"zs:flex zs:items-center zs:gap-1\">\n <i class=\"text-lg fa-solid fa-file\" [ngClass]=\"palette().inputPalette.text\" aria-hidden=\"true\"></i>\n <span class=\"zs:text-xs zs:text-gray-500\">\n {{ formatSize(entry[1].size) }}\n </span>\n </div>\n\n <div class=\"zs:flex zs:gap-2\">\n @if (allowPreview() && entry[1].url?.startsWith('blob:')) {\n <ZS-button\n type=\"button\"\n (clickedEv)=\"preview(entry[1].url)\"\n [btnStyle]=\"inputStyle()\"\n size=\"sm\"\n aria-label=\"Preview {{ entry[1].name }}\"\n >\n Preview\n </ZS-button>\n }\n\n @if (!disabledOrReadonly()) {\n <ZS-button\n type=\"button\"\n variant=\"outline\"\n btnStyle=\"danger\"\n (clickedEv)=\"removeFile(entry[0])\"\n icon=\"fa-solid fa-trash\"\n aria-label=\"Remove {{ entry[1].name }}\"\n >\n </ZS-button>\n }\n </div>\n </div>\n </div>\n }\n </div>\n }\n\n <!-- ========================= Error Messages ========================= -->\n <ZS-input-errors\n [Id]=\"Id() + '-error'\"\n [errors]=\"[error()]\"\n aria-live=\"assertive\"\n role=\"alert\"\n >\n </ZS-input-errors>\n</div>\n", styles: [":host{@apply block w-full;}input[type=file]:disabled{@apply cursor-not-allowed opacity-60;}\n"] }]
|
|
2060
2366
|
}], propDecorators: { Id: [{ type: i0.Input, args: [{ isSignal: true, alias: "Id", required: false }] }], iName: [{ type: i0.Input, args: [{ isSignal: true, alias: "iName", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], inputStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputStyle", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], isReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "isReadonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], validateFns: [{ type: i0.Input, args: [{ isSignal: true, alias: "validateFns", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], maxSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSize", required: false }] }], allowPreview: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowPreview", required: false }] }], maxFiles: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFiles", required: false }] }], changeEv: [{ type: i0.Output, args: ["changeEv"] }], files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }, { type: i0.Output, args: ["filesChange"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], fileInputRef: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }] } });
|
|
2061
2367
|
|
|
2062
2368
|
// ==============================================================================
|
|
@@ -2173,9 +2479,10 @@ class Input {
|
|
|
2173
2479
|
containerClasses = computed(() => {
|
|
2174
2480
|
const baseClasses = 'zs:border zs:transition-all zs:duration-150 zs:focus-within:ring-2';
|
|
2175
2481
|
const hasError = this.error().length;
|
|
2176
|
-
let styleConfig =
|
|
2482
|
+
let styleConfig = inputPaletteMap.get(this.inputStyle());
|
|
2483
|
+
const ringConfig = ringPaletteMap.get(this.inputStyle());
|
|
2177
2484
|
if (hasError) {
|
|
2178
|
-
styleConfig =
|
|
2485
|
+
styleConfig = inputPaletteMap.get('danger');
|
|
2179
2486
|
}
|
|
2180
2487
|
const disabledClass = this.disabled() ? 'zs:opacity-60' : '';
|
|
2181
2488
|
const interactionClass = this.disabledOrReadonly()
|
|
@@ -2187,7 +2494,7 @@ class Input {
|
|
|
2187
2494
|
styleConfig.borderHover,
|
|
2188
2495
|
styleConfig.inputBg,
|
|
2189
2496
|
styleConfig.text,
|
|
2190
|
-
|
|
2497
|
+
ringConfig.ring,
|
|
2191
2498
|
disabledClass,
|
|
2192
2499
|
interactionClass,
|
|
2193
2500
|
]
|
|
@@ -2431,9 +2738,6 @@ class Range {
|
|
|
2431
2738
|
// Computed Properties
|
|
2432
2739
|
// ==============================================
|
|
2433
2740
|
disabledOrReadonly = computed(() => this.disabled() || this.isReadonly(), ...(ngDevMode ? [{ debugName: "disabledOrReadonly" }] : []));
|
|
2434
|
-
palette = computed(() => {
|
|
2435
|
-
return FormPaletteMap.get(this.inputStyle()) ?? FormPaletteMap.get('secondary');
|
|
2436
|
-
}, ...(ngDevMode ? [{ debugName: "palette" }] : []));
|
|
2437
2741
|
percent = computed(() => {
|
|
2438
2742
|
const range = this.max() - this.min();
|
|
2439
2743
|
return ((this.value() - this.min()) / range) * 100;
|
|
@@ -2469,6 +2773,11 @@ class Range {
|
|
|
2469
2773
|
};
|
|
2470
2774
|
return sizeClasses[this.size()];
|
|
2471
2775
|
}, ...(ngDevMode ? [{ debugName: "gapCLasses" }] : []));
|
|
2776
|
+
palette = computed(() => {
|
|
2777
|
+
const buttonSolidPalette = buttonSolidPaletteMap.get(this.inputStyle());
|
|
2778
|
+
const inputPalette = inputPaletteMap.get(this.inputStyle());
|
|
2779
|
+
return { buttonSolidPalette, inputPalette };
|
|
2780
|
+
}, ...(ngDevMode ? [{ debugName: "palette" }] : []));
|
|
2472
2781
|
rangeClasses = computed(() => {
|
|
2473
2782
|
const base = 'zs:relative zs:w-full zs:rounded-full zs:cursor-pointer';
|
|
2474
2783
|
const sizeClasses = this.rangeSizeClasses('height');
|
|
@@ -2476,9 +2785,9 @@ class Range {
|
|
|
2476
2785
|
const interactionClass = !this.disabledOrReadonly() ? 'zs:group' : '';
|
|
2477
2786
|
return [
|
|
2478
2787
|
sizeClasses,
|
|
2479
|
-
this.palette().border,
|
|
2480
|
-
this.palette().inputBg,
|
|
2481
|
-
this.palette().text,
|
|
2788
|
+
this.palette().inputPalette.border,
|
|
2789
|
+
this.palette().inputPalette.inputBg,
|
|
2790
|
+
this.palette().inputPalette.text,
|
|
2482
2791
|
base,
|
|
2483
2792
|
disabledClass,
|
|
2484
2793
|
interactionClass
|
|
@@ -2486,8 +2795,8 @@ class Range {
|
|
|
2486
2795
|
}, ...(ngDevMode ? [{ debugName: "rangeClasses" }] : []));
|
|
2487
2796
|
ThumbClasses = computed(() => {
|
|
2488
2797
|
return [
|
|
2489
|
-
this.palette().btnBG,
|
|
2490
|
-
this.palette().btnBGHover,
|
|
2798
|
+
this.palette().buttonSolidPalette.btnBG,
|
|
2799
|
+
this.palette().buttonSolidPalette.btnBGHover,
|
|
2491
2800
|
this.dragging() ? 'zs:scale-110 zs:shadow-lg' : '',
|
|
2492
2801
|
this.rangeSizeClasses('size')
|
|
2493
2802
|
].join(' ');
|
|
@@ -2561,11 +2870,11 @@ class Range {
|
|
|
2561
2870
|
});
|
|
2562
2871
|
}
|
|
2563
2872
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: Range, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2564
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: Range, isStandalone: true, selector: "ZS-range", inputs: { Id: { classPropertyName: "Id", publicName: "Id", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, inputStyle: { classPropertyName: "inputStyle", publicName: "inputStyle", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, viewQueries: [{ propertyName: "trackRef", first: true, predicate: ["track"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- ========================= Label ========================= -->\n<div class=\"zs:flex zs:flex-col zs:w-full zs:select-none\">\n <ZS-label [class]=\"(label() || hint()) ? 'zs:mb-1' : ''\"\n [label]=\"label()\"\n [hint]=\"hint()\"\n [hintId]=\"Id() + '-hint'\"\n [size]=\"size()\"\n [for]=\"Id()\"\n ></ZS-label>\n\n <!-- ========================= Slider Container ========================= -->\n <div class=\"zs:flex zs:items-center\"\n [class]=\"gapCLasses()\">\n \n <!-- ========================= Track ========================= -->\n <div\n #track\n [class]=\"rangeClasses()\"\n (mousedown)=\"onMouseDown($event)\"\n >\n \n <!-- ========================= Track Background ========================= -->\n <div\n class=\"zs:absolute zs:inset-0 zs:rounded-full zs:bg-linear-to-r zs:from-gray-200 zs:to-gray-300 zs:transition-all zs:duration-300 zs:group-hover:brightness-110\"\n [ngClass]=\"[\n ['secondary', 'dark'].includes(inputStyle()) ? 'zs:dark:from-gray-500 zs:dark:to-gray-600' : 'zs:dark:from-gray-700 zs:dark:to-gray-800',\n disabledOrReadonly() ? 'zs:cursor-not-allowed' : ''\n ]\"\n ></div>\n\n <!-- ========================= Fill (Progress) ========================= -->\n <div\n class=\"zs:absolute zs:left-0 zs:rounded-full zs:top-0 zs:h-full zs:transition-all zs:duration-200 zs:ease-out zs:shadow-sm\"\n [style.width.%]=\"percent()\"\n [ngClass]=\"[\n disabledOrReadonly() ? 'zs:cursor-not-allowed' : '',\n palette().btnBG,\n palette().btnBGHover\n ]\"\n ></div>\n\n <!-- ========================= Thumb (Handle) ========================= -->\n <div\n class=\"zs:absolute zs:top-1/2 zs:rounded-full zs:flex zs:items-center zs:justify-center \n zs:-translate-y-1/2 zs:transition-all zs:duration-200 zs:ease-out zs:shadow-md \n zs:group-hover:scale-110\"\n [style.left]=\"calcThumbPosition()\"\n [ngClass]=\"[ThumbClasses(), disabledOrReadonly() ? 'zs:cursor-not-allowed' : '']\"\n role=\"slider\"\n tabindex=\"0\"\n [attr.id]=\"Id()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"value()\"\n [attr.aria-disabled]=\"disabledOrReadonly() || null\"\n [attr.aria-readonly]=\"isReadonly() || null\"\n [attr.aria-labelledby]=\"Id() + '-label'\"\n [attr.aria-describedby]=\"hint() ? Id() + '-hint' : null\"\n aria-orientation=\"horizontal\"\n >\n <i class=\"fa-solid fa-circle zs:text-white\" [ngClass]=\"dotCLasses()\"></i>\n </div>\n </div>\n\n <!-- ========================= Value Display ========================= -->\n @if (showValue()) {\n <div class=\"zs:text-sm zs:text-gray-600 zs:dark:text-gray-300 zs:font-medium\">\n {{ value() }}\n </div>\n }\n </div>\n</div>", styles: [".thumb-active{transition:transform .1s ease-in-out}\n"], dependencies: [{ kind: "component", type: Label, selector: "ZS-label", inputs: ["label", "hint", "hintId", "size", "required", "for"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2873
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: Range, isStandalone: true, selector: "ZS-range", inputs: { Id: { classPropertyName: "Id", publicName: "Id", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, inputStyle: { classPropertyName: "inputStyle", publicName: "inputStyle", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "isReadonly", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, viewQueries: [{ propertyName: "trackRef", first: true, predicate: ["track"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- ========================= Label ========================= -->\n<div class=\"zs:flex zs:flex-col zs:w-full zs:select-none\">\n <ZS-label [class]=\"(label() || hint()) ? 'zs:mb-1' : ''\"\n [label]=\"label()\"\n [hint]=\"hint()\"\n [hintId]=\"Id() + '-hint'\"\n [size]=\"size()\"\n [for]=\"Id()\"\n ></ZS-label>\n\n <!-- ========================= Slider Container ========================= -->\n <div class=\"zs:flex zs:items-center\"\n [class]=\"gapCLasses()\">\n \n <!-- ========================= Track ========================= -->\n <div\n #track\n [class]=\"rangeClasses()\"\n (mousedown)=\"onMouseDown($event)\"\n >\n \n <!-- ========================= Track Background ========================= -->\n <div\n class=\"zs:absolute zs:inset-0 zs:rounded-full zs:bg-linear-to-r zs:from-gray-200 zs:to-gray-300 zs:transition-all zs:duration-300 zs:group-hover:brightness-110\"\n [ngClass]=\"[\n ['secondary', 'dark'].includes(inputStyle()) ? 'zs:dark:from-gray-500 zs:dark:to-gray-600' : 'zs:dark:from-gray-700 zs:dark:to-gray-800',\n disabledOrReadonly() ? 'zs:cursor-not-allowed' : ''\n ]\"\n ></div>\n\n <!-- ========================= Fill (Progress) ========================= -->\n <div\n class=\"zs:absolute zs:left-0 zs:rounded-full zs:top-0 zs:h-full zs:transition-all zs:duration-200 zs:ease-out zs:shadow-sm\"\n [style.width.%]=\"percent()\"\n [ngClass]=\"[\n disabledOrReadonly() ? 'zs:cursor-not-allowed' : '',\n palette().buttonSolidPalette.btnBG,\n palette().buttonSolidPalette.btnBGHover\n ]\"\n ></div>\n\n <!-- ========================= Thumb (Handle) ========================= -->\n <div\n class=\"zs:absolute zs:top-1/2 zs:rounded-full zs:flex zs:items-center zs:justify-center \n zs:-translate-y-1/2 zs:transition-all zs:duration-200 zs:ease-out zs:shadow-md \n zs:group-hover:scale-110\"\n [style.left]=\"calcThumbPosition()\"\n [ngClass]=\"[ThumbClasses(), disabledOrReadonly() ? 'zs:cursor-not-allowed' : '']\"\n role=\"slider\"\n tabindex=\"0\"\n [attr.id]=\"Id()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"value()\"\n [attr.aria-disabled]=\"disabledOrReadonly() || null\"\n [attr.aria-readonly]=\"isReadonly() || null\"\n [attr.aria-labelledby]=\"Id() + '-label'\"\n [attr.aria-describedby]=\"hint() ? Id() + '-hint' : null\"\n aria-orientation=\"horizontal\"\n >\n <i class=\"fa-solid fa-circle zs:text-white\" [ngClass]=\"dotCLasses()\"></i>\n </div>\n </div>\n\n <!-- ========================= Value Display ========================= -->\n @if (showValue()) {\n <div class=\"zs:text-sm zs:text-gray-600 zs:dark:text-gray-300 zs:font-medium\">\n {{ value() }}\n </div>\n }\n </div>\n</div>", styles: [".thumb-active{transition:transform .1s ease-in-out}\n"], dependencies: [{ kind: "component", type: Label, selector: "ZS-label", inputs: ["label", "hint", "hintId", "size", "required", "for"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2565
2874
|
}
|
|
2566
2875
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: Range, decorators: [{
|
|
2567
2876
|
type: Component,
|
|
2568
|
-
args: [{ selector: 'ZS-range', imports: [Label, CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- ========================= Label ========================= -->\n<div class=\"zs:flex zs:flex-col zs:w-full zs:select-none\">\n <ZS-label [class]=\"(label() || hint()) ? 'zs:mb-1' : ''\"\n [label]=\"label()\"\n [hint]=\"hint()\"\n [hintId]=\"Id() + '-hint'\"\n [size]=\"size()\"\n [for]=\"Id()\"\n ></ZS-label>\n\n <!-- ========================= Slider Container ========================= -->\n <div class=\"zs:flex zs:items-center\"\n [class]=\"gapCLasses()\">\n \n <!-- ========================= Track ========================= -->\n <div\n #track\n [class]=\"rangeClasses()\"\n (mousedown)=\"onMouseDown($event)\"\n >\n \n <!-- ========================= Track Background ========================= -->\n <div\n class=\"zs:absolute zs:inset-0 zs:rounded-full zs:bg-linear-to-r zs:from-gray-200 zs:to-gray-300 zs:transition-all zs:duration-300 zs:group-hover:brightness-110\"\n [ngClass]=\"[\n ['secondary', 'dark'].includes(inputStyle()) ? 'zs:dark:from-gray-500 zs:dark:to-gray-600' : 'zs:dark:from-gray-700 zs:dark:to-gray-800',\n disabledOrReadonly() ? 'zs:cursor-not-allowed' : ''\n ]\"\n ></div>\n\n <!-- ========================= Fill (Progress) ========================= -->\n <div\n class=\"zs:absolute zs:left-0 zs:rounded-full zs:top-0 zs:h-full zs:transition-all zs:duration-200 zs:ease-out zs:shadow-sm\"\n [style.width.%]=\"percent()\"\n [ngClass]=\"[\n disabledOrReadonly() ? 'zs:cursor-not-allowed' : '',\n palette().btnBG,\n palette().btnBGHover\n ]\"\n ></div>\n\n <!-- ========================= Thumb (Handle) ========================= -->\n <div\n class=\"zs:absolute zs:top-1/2 zs:rounded-full zs:flex zs:items-center zs:justify-center \n zs:-translate-y-1/2 zs:transition-all zs:duration-200 zs:ease-out zs:shadow-md \n zs:group-hover:scale-110\"\n [style.left]=\"calcThumbPosition()\"\n [ngClass]=\"[ThumbClasses(), disabledOrReadonly() ? 'zs:cursor-not-allowed' : '']\"\n role=\"slider\"\n tabindex=\"0\"\n [attr.id]=\"Id()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"value()\"\n [attr.aria-disabled]=\"disabledOrReadonly() || null\"\n [attr.aria-readonly]=\"isReadonly() || null\"\n [attr.aria-labelledby]=\"Id() + '-label'\"\n [attr.aria-describedby]=\"hint() ? Id() + '-hint' : null\"\n aria-orientation=\"horizontal\"\n >\n <i class=\"fa-solid fa-circle zs:text-white\" [ngClass]=\"dotCLasses()\"></i>\n </div>\n </div>\n\n <!-- ========================= Value Display ========================= -->\n @if (showValue()) {\n <div class=\"zs:text-sm zs:text-gray-600 zs:dark:text-gray-300 zs:font-medium\">\n {{ value() }}\n </div>\n }\n </div>\n</div>", styles: [".thumb-active{transition:transform .1s ease-in-out}\n"] }]
|
|
2877
|
+
args: [{ selector: 'ZS-range', imports: [Label, CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- ========================= Label ========================= -->\n<div class=\"zs:flex zs:flex-col zs:w-full zs:select-none\">\n <ZS-label [class]=\"(label() || hint()) ? 'zs:mb-1' : ''\"\n [label]=\"label()\"\n [hint]=\"hint()\"\n [hintId]=\"Id() + '-hint'\"\n [size]=\"size()\"\n [for]=\"Id()\"\n ></ZS-label>\n\n <!-- ========================= Slider Container ========================= -->\n <div class=\"zs:flex zs:items-center\"\n [class]=\"gapCLasses()\">\n \n <!-- ========================= Track ========================= -->\n <div\n #track\n [class]=\"rangeClasses()\"\n (mousedown)=\"onMouseDown($event)\"\n >\n \n <!-- ========================= Track Background ========================= -->\n <div\n class=\"zs:absolute zs:inset-0 zs:rounded-full zs:bg-linear-to-r zs:from-gray-200 zs:to-gray-300 zs:transition-all zs:duration-300 zs:group-hover:brightness-110\"\n [ngClass]=\"[\n ['secondary', 'dark'].includes(inputStyle()) ? 'zs:dark:from-gray-500 zs:dark:to-gray-600' : 'zs:dark:from-gray-700 zs:dark:to-gray-800',\n disabledOrReadonly() ? 'zs:cursor-not-allowed' : ''\n ]\"\n ></div>\n\n <!-- ========================= Fill (Progress) ========================= -->\n <div\n class=\"zs:absolute zs:left-0 zs:rounded-full zs:top-0 zs:h-full zs:transition-all zs:duration-200 zs:ease-out zs:shadow-sm\"\n [style.width.%]=\"percent()\"\n [ngClass]=\"[\n disabledOrReadonly() ? 'zs:cursor-not-allowed' : '',\n palette().buttonSolidPalette.btnBG,\n palette().buttonSolidPalette.btnBGHover\n ]\"\n ></div>\n\n <!-- ========================= Thumb (Handle) ========================= -->\n <div\n class=\"zs:absolute zs:top-1/2 zs:rounded-full zs:flex zs:items-center zs:justify-center \n zs:-translate-y-1/2 zs:transition-all zs:duration-200 zs:ease-out zs:shadow-md \n zs:group-hover:scale-110\"\n [style.left]=\"calcThumbPosition()\"\n [ngClass]=\"[ThumbClasses(), disabledOrReadonly() ? 'zs:cursor-not-allowed' : '']\"\n role=\"slider\"\n tabindex=\"0\"\n [attr.id]=\"Id()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"value()\"\n [attr.aria-disabled]=\"disabledOrReadonly() || null\"\n [attr.aria-readonly]=\"isReadonly() || null\"\n [attr.aria-labelledby]=\"Id() + '-label'\"\n [attr.aria-describedby]=\"hint() ? Id() + '-hint' : null\"\n aria-orientation=\"horizontal\"\n >\n <i class=\"fa-solid fa-circle zs:text-white\" [ngClass]=\"dotCLasses()\"></i>\n </div>\n </div>\n\n <!-- ========================= Value Display ========================= -->\n @if (showValue()) {\n <div class=\"zs:text-sm zs:text-gray-600 zs:dark:text-gray-300 zs:font-medium\">\n {{ value() }}\n </div>\n }\n </div>\n</div>", styles: [".thumb-active{transition:transform .1s ease-in-out}\n"] }]
|
|
2569
2878
|
}], ctorParameters: () => [], propDecorators: { Id: [{ type: i0.Input, args: [{ isSignal: true, alias: "Id", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], inputStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputStyle", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], isReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "isReadonly", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], trackRef: [{ type: i0.ViewChild, args: ['track', { isSignal: true }] }] } });
|
|
2570
2879
|
|
|
2571
2880
|
// =================================================================================================
|
|
@@ -2617,11 +2926,13 @@ class Select {
|
|
|
2617
2926
|
// =================================================================================================
|
|
2618
2927
|
styleEntry = computed(() => {
|
|
2619
2928
|
const hasError = this.error().length;
|
|
2620
|
-
let
|
|
2929
|
+
let inputEntry = inputPaletteMap.get(this.inputStyle());
|
|
2930
|
+
let selectEntry = selectPaletteMap.get(this.inputStyle());
|
|
2621
2931
|
if (hasError) {
|
|
2622
|
-
|
|
2932
|
+
selectEntry = selectPaletteMap.get('danger');
|
|
2933
|
+
inputEntry = inputPaletteMap.get('danger');
|
|
2623
2934
|
}
|
|
2624
|
-
return
|
|
2935
|
+
return { inputEntry, selectEntry };
|
|
2625
2936
|
}, ...(ngDevMode ? [{ debugName: "styleEntry" }] : []));
|
|
2626
2937
|
disabledOrReadonly = computed(() => this.disabled() || this.isReadonly(), ...(ngDevMode ? [{ debugName: "disabledOrReadonly" }] : []));
|
|
2627
2938
|
filteredItems = computed(() => {
|
|
@@ -2642,22 +2953,27 @@ class Select {
|
|
|
2642
2953
|
const cursorCls = this.disabledOrReadonly()
|
|
2643
2954
|
? 'zs:cursor-not-allowed'
|
|
2644
2955
|
: 'zs:cursor-text';
|
|
2956
|
+
const inputEntry = this.styleEntry().inputEntry;
|
|
2645
2957
|
return [
|
|
2646
2958
|
base,
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2959
|
+
inputEntry.border,
|
|
2960
|
+
inputEntry.borderHover,
|
|
2961
|
+
inputEntry.inputBg,
|
|
2962
|
+
inputEntry.text,
|
|
2651
2963
|
disabledCls,
|
|
2652
2964
|
cursorCls
|
|
2653
2965
|
].filter(Boolean).join(' ');
|
|
2654
2966
|
}, ...(ngDevMode ? [{ debugName: "containerClasses" }] : []));
|
|
2655
2967
|
clearClass = computed(() => {
|
|
2656
2968
|
const base = 'zs:mt-2 zs:text-sm zs:flex zs:items-center zs:transition-colors';
|
|
2657
|
-
return [
|
|
2969
|
+
return [
|
|
2970
|
+
base,
|
|
2971
|
+
this.styleEntry().selectEntry.cleartext,
|
|
2972
|
+
this.styleEntry().selectEntry.cleartexthover
|
|
2973
|
+
].filter(Boolean).join(' ');
|
|
2658
2974
|
}, ...(ngDevMode ? [{ debugName: "clearClass" }] : []));
|
|
2659
2975
|
showItemsClass = computed(() => {
|
|
2660
|
-
return this.styleEntry()
|
|
2976
|
+
return this.styleEntry().selectEntry.bgSelect ?? '';
|
|
2661
2977
|
}, ...(ngDevMode ? [{ debugName: "showItemsClass" }] : []));
|
|
2662
2978
|
error = computed(() => {
|
|
2663
2979
|
const selectedItems = this.selectedItems();
|
|
@@ -2683,7 +2999,7 @@ class Select {
|
|
|
2683
2999
|
// =================================================================================================
|
|
2684
3000
|
getBgSelectClasses = (selected) => {
|
|
2685
3001
|
return selected
|
|
2686
|
-
? `${this.styleEntry().bgSelect} zs:hover:opacity-80`
|
|
3002
|
+
? `${this.styleEntry().selectEntry.bgSelect} zs:hover:opacity-80`
|
|
2687
3003
|
: 'zs:hover:bg-gray-200/50 zs:dark:hover:bg-gray-600/40';
|
|
2688
3004
|
};
|
|
2689
3005
|
// =================================================================================================
|
|
@@ -2863,5 +3179,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImpor
|
|
|
2863
3179
|
* Generated bundle index. Do not edit.
|
|
2864
3180
|
*/
|
|
2865
3181
|
|
|
2866
|
-
export { ALERT_CONFIG, Alert, AlertService, Button, Card, Carousel, Checkbox, ColorMapping, Connection, ExtractorService, FileInput, Form,
|
|
3182
|
+
export { ALERT_CONFIG, Alert, AlertService, Button, Card, Carousel, Checkbox, ColorMapping, Connection, ExtractorService, FileInput, Form, Input, InputErrors, Label, Modal, NavItem, NavItemService, Navbar, NgxZsComponent, Page404, Pagination, Range, ScrollToTop, Select, Spinner, ThemeToggle, Toggle, buttonOutlinePaletteMap, buttonSolidPaletteMap, cardPaletteMap, checkboxTextPaletteMap, inputPaletteMap, modalPaletteMap, page404PaletteMap, ringPaletteMap, selectPaletteMap, unifiedPaletteMap };
|
|
2867
3183
|
//# sourceMappingURL=ziadshalaby-ngx-zs-component.mjs.map
|