@educarehq/solaris-components 0.2.4 → 0.2.5
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/educarehq-solaris-components.mjs +2741 -194
- package/fesm2022/educarehq-solaris-components.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/solaris-components.scss +2 -2
- package/types/educarehq-solaris-components.d.ts +698 -52
- package/styles/buttons/solaris-buttons.styles.scss +0 -262
- package/styles/forms/input-text.styles.scss +0 -14
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, Renderer2, Directive, TemplateRef, Injectable, ViewContainerRef, DestroyRef, Input, ContentChild, ViewEncapsulation, Component, EventEmitter, Output, HostBinding, ChangeDetectionStrategy, signal, ContentChildren, HostListener, Optional, viewChild, input, booleanAttribute, numberAttribute,
|
|
2
|
+
import { inject, ElementRef, Renderer2, Directive, TemplateRef, Injectable, ViewContainerRef, DestroyRef, Input, ContentChild, ViewEncapsulation, Component, EventEmitter, Output, HostBinding, ChangeDetectionStrategy, ApplicationRef, signal, computed, effect, ContentChildren, HostListener, Optional, viewChild, input, booleanAttribute, numberAttribute, afterNextRender, ViewChild, output, forwardRef, Host, InjectionToken, Injector } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { Overlay } from '@angular/cdk/overlay';
|
|
5
5
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
@@ -7,11 +7,12 @@ import { fromEvent, merge } from 'rxjs';
|
|
|
7
7
|
import { filter } from 'rxjs/operators';
|
|
8
8
|
import { CdkMenu, CdkMenuItem, CdkMenuTrigger } from '@angular/cdk/menu';
|
|
9
9
|
import { RouterLink } from '@angular/router';
|
|
10
|
-
import { NgClass, NgTemplateOutlet, NgStyle } from '@angular/common';
|
|
11
|
-
import {
|
|
10
|
+
import { NgClass, NgTemplateOutlet, NgStyle, DOCUMENT, NgOptimizedImage } from '@angular/common';
|
|
11
|
+
import { SolarisTranslationPipe } from '@educarehq/solaris-services';
|
|
12
|
+
import * as i1 from '@angular/forms';
|
|
13
|
+
import { NG_VALUE_ACCESSOR, FormsModule, NG_VALIDATORS, NgForm, FormGroupDirective, NgControl } from '@angular/forms';
|
|
12
14
|
import { getCountries, getCountryCallingCode, parsePhoneNumberFromString, AsYouType } from 'libphonenumber-js';
|
|
13
15
|
import intlTelInput from 'intl-tel-input';
|
|
14
|
-
import { SolarisTranslationPipe } from '@educarehq/solaris-services';
|
|
15
16
|
|
|
16
17
|
class SolarisDropdownContentTriggerDirective {
|
|
17
18
|
elementRef = inject((ElementRef));
|
|
@@ -452,6 +453,332 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
452
453
|
type: Output
|
|
453
454
|
}] } });
|
|
454
455
|
|
|
456
|
+
class SolarisPopoverTriggerDirective {
|
|
457
|
+
elementRef = inject((ElementRef));
|
|
458
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPopoverTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
459
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisPopoverTriggerDirective, isStandalone: true, selector: "[solaris-popover-trigger]", ngImport: i0 });
|
|
460
|
+
}
|
|
461
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPopoverTriggerDirective, decorators: [{
|
|
462
|
+
type: Directive,
|
|
463
|
+
args: [{
|
|
464
|
+
selector: '[solaris-popover-trigger]',
|
|
465
|
+
standalone: true,
|
|
466
|
+
}]
|
|
467
|
+
}] });
|
|
468
|
+
|
|
469
|
+
class SolarisPopoverPanelDirective {
|
|
470
|
+
templateRef = inject((TemplateRef));
|
|
471
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPopoverPanelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
472
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisPopoverPanelDirective, isStandalone: true, selector: "ng-template[solaris-popover-panel]", ngImport: i0 });
|
|
473
|
+
}
|
|
474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPopoverPanelDirective, decorators: [{
|
|
475
|
+
type: Directive,
|
|
476
|
+
args: [{
|
|
477
|
+
selector: 'ng-template[solaris-popover-panel]',
|
|
478
|
+
standalone: true,
|
|
479
|
+
}]
|
|
480
|
+
}] });
|
|
481
|
+
|
|
482
|
+
function clamp$1(v, min, max) {
|
|
483
|
+
return Math.max(min, Math.min(max, v));
|
|
484
|
+
}
|
|
485
|
+
function initialXY(anchor, panel, placement, offset) {
|
|
486
|
+
const axMid = anchor.left + anchor.width / 2;
|
|
487
|
+
const ayMid = anchor.top + anchor.height / 2;
|
|
488
|
+
switch (placement) {
|
|
489
|
+
case 'bottom-start': return { x: anchor.left, y: anchor.bottom + offset };
|
|
490
|
+
case 'bottom': return { x: axMid - panel.width / 2, y: anchor.bottom + offset };
|
|
491
|
+
case 'bottom-end': return { x: anchor.right - panel.width, y: anchor.bottom + offset };
|
|
492
|
+
case 'top-start': return { x: anchor.left, y: anchor.top - panel.height - offset };
|
|
493
|
+
case 'top': return { x: axMid - panel.width / 2, y: anchor.top - panel.height - offset };
|
|
494
|
+
case 'top-end': return { x: anchor.right - panel.width, y: anchor.top - panel.height - offset };
|
|
495
|
+
case 'right-start': return { x: anchor.right + offset, y: anchor.top };
|
|
496
|
+
case 'right': return { x: anchor.right + offset, y: ayMid - panel.height / 2 };
|
|
497
|
+
case 'right-end': return { x: anchor.right + offset, y: anchor.bottom - panel.height };
|
|
498
|
+
case 'left-start': return { x: anchor.left - panel.width - offset, y: anchor.top };
|
|
499
|
+
case 'left': return { x: anchor.left - panel.width - offset, y: ayMid - panel.height / 2 };
|
|
500
|
+
case 'left-end': return { x: anchor.left - panel.width - offset, y: anchor.bottom - panel.height };
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
function flipPlacement(p) {
|
|
504
|
+
if (p.startsWith('bottom'))
|
|
505
|
+
return p.replace('bottom', 'top');
|
|
506
|
+
if (p.startsWith('top'))
|
|
507
|
+
return p.replace('top', 'bottom');
|
|
508
|
+
if (p.startsWith('left'))
|
|
509
|
+
return p.replace('left', 'right');
|
|
510
|
+
if (p.startsWith('right'))
|
|
511
|
+
return p.replace('right', 'left');
|
|
512
|
+
return p;
|
|
513
|
+
}
|
|
514
|
+
function computePopoverPosition(anchorRect, panelRect, configuration) {
|
|
515
|
+
const vw = window.innerWidth;
|
|
516
|
+
const vh = window.innerHeight;
|
|
517
|
+
let applied = configuration.placement;
|
|
518
|
+
const fits = (x, y) => {
|
|
519
|
+
const pad = configuration.viewportPadding;
|
|
520
|
+
const left = x;
|
|
521
|
+
const top = y;
|
|
522
|
+
const right = x + panelRect.width;
|
|
523
|
+
const bottom = y + panelRect.height;
|
|
524
|
+
return left >= pad && top >= pad && right <= vw - pad && bottom <= vh - pad;
|
|
525
|
+
};
|
|
526
|
+
let pos = initialXY(anchorRect, panelRect, applied, configuration.offset);
|
|
527
|
+
if (configuration.autoFlip && !fits(pos.x, pos.y)) {
|
|
528
|
+
const flipped = flipPlacement(applied);
|
|
529
|
+
const flippedPos = initialXY(anchorRect, panelRect, flipped, configuration.offset);
|
|
530
|
+
if (fits(flippedPos.x, flippedPos.y)) {
|
|
531
|
+
applied = flipped;
|
|
532
|
+
pos = flippedPos;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
if (configuration.autoShift) {
|
|
536
|
+
const pad = configuration.viewportPadding;
|
|
537
|
+
pos.x = clamp$1(pos.x, pad, vw - pad - panelRect.width);
|
|
538
|
+
pos.y = clamp$1(pos.y, pad, vh - pad - panelRect.height);
|
|
539
|
+
}
|
|
540
|
+
return { x: pos.x, y: pos.y, appliedPlacement: applied };
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
class SolarisPopover {
|
|
544
|
+
appRef = inject(ApplicationRef);
|
|
545
|
+
destroyRef = inject(DestroyRef);
|
|
546
|
+
offset = 8;
|
|
547
|
+
panelClass = '';
|
|
548
|
+
autoFlip = true;
|
|
549
|
+
autoShift = true;
|
|
550
|
+
matchWidth = false;
|
|
551
|
+
viewportPadding = 8;
|
|
552
|
+
closeOnEscape = true;
|
|
553
|
+
closeOnOutsideClick = true;
|
|
554
|
+
anchorElement = null;
|
|
555
|
+
matchWidthElement = null;
|
|
556
|
+
placement = 'bottom-start';
|
|
557
|
+
openChange = new EventEmitter();
|
|
558
|
+
_internalOpen = signal(false, ...(ngDevMode ? [{ debugName: "_internalOpen" }] : []));
|
|
559
|
+
_openInput = signal(null, ...(ngDevMode ? [{ debugName: "_openInput" }] : []));
|
|
560
|
+
isOpen = computed(() => {
|
|
561
|
+
const v = this._openInput();
|
|
562
|
+
return typeof v === 'boolean' ? v : this._internalOpen();
|
|
563
|
+
}, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
564
|
+
set open(v) {
|
|
565
|
+
console.log(`[Popover#${this._id} ${this.panelClass}] input open=`, v);
|
|
566
|
+
this._openInput.set(v);
|
|
567
|
+
}
|
|
568
|
+
get open() {
|
|
569
|
+
return this._openInput();
|
|
570
|
+
}
|
|
571
|
+
panelDir;
|
|
572
|
+
triggerDir;
|
|
573
|
+
raf = 0;
|
|
574
|
+
static seq = 0;
|
|
575
|
+
_setting = false;
|
|
576
|
+
panelHost;
|
|
577
|
+
panelView;
|
|
578
|
+
_id = ++SolarisPopover.seq;
|
|
579
|
+
get dataOpen() {
|
|
580
|
+
return this.isOpen() ? 'true' : null;
|
|
581
|
+
}
|
|
582
|
+
constructor() {
|
|
583
|
+
effect(() => {
|
|
584
|
+
if (this.isOpen())
|
|
585
|
+
this.show();
|
|
586
|
+
else
|
|
587
|
+
this.hide();
|
|
588
|
+
});
|
|
589
|
+
effect((onCleanup) => {
|
|
590
|
+
if (!this.isOpen())
|
|
591
|
+
return;
|
|
592
|
+
const onResize = () => this.scheduleReposition();
|
|
593
|
+
const onScroll = () => this.scheduleReposition();
|
|
594
|
+
const onPointerDown = (ev) => {
|
|
595
|
+
if (!this.closeOnOutsideClick)
|
|
596
|
+
return;
|
|
597
|
+
const t = ev.target;
|
|
598
|
+
const triggerEl = this.triggerDir?.elementRef.nativeElement;
|
|
599
|
+
if (!t || !triggerEl || !this.panelHost)
|
|
600
|
+
return;
|
|
601
|
+
const clickedInsidePanel = this.panelHost.contains(t);
|
|
602
|
+
const clickedOnTrigger = triggerEl.contains(t);
|
|
603
|
+
if (!clickedInsidePanel && !clickedOnTrigger) {
|
|
604
|
+
console.log(`[Popover#${this._id} ${this.panelClass}] outside -> close`);
|
|
605
|
+
this.setOpen(false);
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
const onKeyDown = (ev) => {
|
|
609
|
+
if (!this.closeOnEscape)
|
|
610
|
+
return;
|
|
611
|
+
if (ev.key === 'Escape')
|
|
612
|
+
this.setOpen(false);
|
|
613
|
+
};
|
|
614
|
+
window.addEventListener('resize', onResize, { passive: true });
|
|
615
|
+
window.addEventListener('scroll', onScroll, { passive: true, capture: true });
|
|
616
|
+
document.addEventListener('pointerdown', onPointerDown, { capture: true });
|
|
617
|
+
document.addEventListener('keydown', onKeyDown, { capture: true });
|
|
618
|
+
onCleanup(() => {
|
|
619
|
+
window.removeEventListener('resize', onResize);
|
|
620
|
+
window.removeEventListener('scroll', onScroll, true);
|
|
621
|
+
document.removeEventListener('pointerdown', onPointerDown, true);
|
|
622
|
+
document.removeEventListener('keydown', onKeyDown, true);
|
|
623
|
+
});
|
|
624
|
+
});
|
|
625
|
+
this.destroyRef.onDestroy(() => this.unmountHard());
|
|
626
|
+
}
|
|
627
|
+
toggle() {
|
|
628
|
+
this.setOpen(!this.isOpen());
|
|
629
|
+
}
|
|
630
|
+
setOpen(next) {
|
|
631
|
+
const current = this.isOpen();
|
|
632
|
+
if (next === current)
|
|
633
|
+
return;
|
|
634
|
+
if (this._setting)
|
|
635
|
+
return;
|
|
636
|
+
this._setting = true;
|
|
637
|
+
try {
|
|
638
|
+
this.openChange.emit(next);
|
|
639
|
+
if (typeof this._openInput() !== 'boolean') {
|
|
640
|
+
this._internalOpen.set(next);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
finally {
|
|
644
|
+
queueMicrotask(() => (this._setting = false));
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
ensureMounted() {
|
|
648
|
+
if (this.panelHost || !this.triggerDir || !this.panelDir)
|
|
649
|
+
return;
|
|
650
|
+
const host = document.createElement('div');
|
|
651
|
+
host.style.top = '0px';
|
|
652
|
+
host.style.left = '0px';
|
|
653
|
+
host.style.display = 'none';
|
|
654
|
+
host.style.position = 'fixed';
|
|
655
|
+
host.style.zIndex = 'var(--solaris-z-dropdown)';
|
|
656
|
+
host.className = `solaris-popover-panel ${this.panelClass || ''}`.trim();
|
|
657
|
+
const view = this.panelDir.templateRef.createEmbeddedView({});
|
|
658
|
+
this.appRef.attachView(view);
|
|
659
|
+
view.detectChanges();
|
|
660
|
+
for (const node of view.rootNodes)
|
|
661
|
+
host.appendChild(node);
|
|
662
|
+
document.body.appendChild(host);
|
|
663
|
+
this.panelHost = host;
|
|
664
|
+
this.panelView = view;
|
|
665
|
+
}
|
|
666
|
+
show() {
|
|
667
|
+
this.ensureMounted();
|
|
668
|
+
if (!this.panelHost)
|
|
669
|
+
return;
|
|
670
|
+
this.panelHost.style.display = '';
|
|
671
|
+
this.scheduleReposition(true);
|
|
672
|
+
}
|
|
673
|
+
hide() {
|
|
674
|
+
if (!this.panelHost)
|
|
675
|
+
return;
|
|
676
|
+
this.panelHost.style.display = 'none';
|
|
677
|
+
}
|
|
678
|
+
unmountHard() {
|
|
679
|
+
if (this.raf)
|
|
680
|
+
cancelAnimationFrame(this.raf);
|
|
681
|
+
this.raf = 0;
|
|
682
|
+
if (this.panelView) {
|
|
683
|
+
this.appRef.detachView(this.panelView);
|
|
684
|
+
this.panelView.destroy();
|
|
685
|
+
this.panelView = undefined;
|
|
686
|
+
}
|
|
687
|
+
if (this.panelHost) {
|
|
688
|
+
this.panelHost.remove();
|
|
689
|
+
this.panelHost = undefined;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
scheduleReposition(immediate = false) {
|
|
693
|
+
if (!this.panelHost || !this.triggerDir)
|
|
694
|
+
return;
|
|
695
|
+
if (immediate) {
|
|
696
|
+
this.reposition();
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
if (this.raf)
|
|
700
|
+
return;
|
|
701
|
+
this.raf = requestAnimationFrame(() => {
|
|
702
|
+
this.raf = 0;
|
|
703
|
+
this.reposition();
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
reposition() {
|
|
707
|
+
const triggerEl = this.triggerDir?.elementRef.nativeElement;
|
|
708
|
+
const host = this.panelHost;
|
|
709
|
+
if (!triggerEl || !host)
|
|
710
|
+
return;
|
|
711
|
+
const anchorEl = this.anchorElement ?? triggerEl;
|
|
712
|
+
const anchorRect = anchorEl.getBoundingClientRect();
|
|
713
|
+
const widthEl = this.matchWidthElement ?? (this.matchWidth ? anchorEl : null);
|
|
714
|
+
if (this.matchWidth && widthEl) {
|
|
715
|
+
const w = widthEl.getBoundingClientRect().width;
|
|
716
|
+
host.style.boxSizing = 'border-box';
|
|
717
|
+
host.style.width = `${w}px`;
|
|
718
|
+
host.style.minWidth = `${w}px`;
|
|
719
|
+
host.style.maxWidth = `${w}px`;
|
|
720
|
+
}
|
|
721
|
+
else {
|
|
722
|
+
host.style.width = '';
|
|
723
|
+
host.style.minWidth = '';
|
|
724
|
+
host.style.maxWidth = '';
|
|
725
|
+
}
|
|
726
|
+
if (getComputedStyle(host).display === 'none')
|
|
727
|
+
return;
|
|
728
|
+
const panelRect = host.getBoundingClientRect();
|
|
729
|
+
const { x, y } = computePopoverPosition(anchorRect, panelRect, {
|
|
730
|
+
placement: this.placement,
|
|
731
|
+
offset: this.offset,
|
|
732
|
+
viewportPadding: this.viewportPadding,
|
|
733
|
+
autoFlip: this.autoFlip,
|
|
734
|
+
autoShift: this.autoShift,
|
|
735
|
+
matchWidth: this.matchWidth,
|
|
736
|
+
});
|
|
737
|
+
host.style.transform = `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)`;
|
|
738
|
+
}
|
|
739
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPopover, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
740
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.1", type: SolarisPopover, isStandalone: true, selector: "solaris-popover", inputs: { offset: "offset", panelClass: "panelClass", autoFlip: "autoFlip", autoShift: "autoShift", matchWidth: "matchWidth", viewportPadding: "viewportPadding", closeOnEscape: "closeOnEscape", closeOnOutsideClick: "closeOnOutsideClick", anchorElement: "anchorElement", matchWidthElement: "matchWidthElement", placement: "placement", open: "open" }, outputs: { openChange: "openChange" }, host: { properties: { "attr.data-open": "this.dataOpen" } }, queries: [{ propertyName: "panelDir", first: true, predicate: SolarisPopoverPanelDirective, descendants: true }, { propertyName: "triggerDir", first: true, predicate: SolarisPopoverTriggerDirective, descendants: true }], ngImport: i0, template: "<ng-content></ng-content>\r\n", styles: [":host{display:contents}.solaris-popover-panel{overflow:hidden;transform-origin:top left;box-shadow:var(--solaris-shadow-md);border-radius:var(--solaris-radius-sm);background:var(--solaris-color-surface);animation:solaris-popover-in .12s ease;border:1px solid var(--solaris-color-border)}@keyframes solaris-popover-in{0%{opacity:0;filter:blur(1px)}to{opacity:1;filter:blur(0)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
741
|
+
}
|
|
742
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPopover, decorators: [{
|
|
743
|
+
type: Component,
|
|
744
|
+
args: [{ selector: 'solaris-popover', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ng-content></ng-content>\r\n", styles: [":host{display:contents}.solaris-popover-panel{overflow:hidden;transform-origin:top left;box-shadow:var(--solaris-shadow-md);border-radius:var(--solaris-radius-sm);background:var(--solaris-color-surface);animation:solaris-popover-in .12s ease;border:1px solid var(--solaris-color-border)}@keyframes solaris-popover-in{0%{opacity:0;filter:blur(1px)}to{opacity:1;filter:blur(0)}}\n"] }]
|
|
745
|
+
}], ctorParameters: () => [], propDecorators: { offset: [{
|
|
746
|
+
type: Input
|
|
747
|
+
}], panelClass: [{
|
|
748
|
+
type: Input
|
|
749
|
+
}], autoFlip: [{
|
|
750
|
+
type: Input
|
|
751
|
+
}], autoShift: [{
|
|
752
|
+
type: Input
|
|
753
|
+
}], matchWidth: [{
|
|
754
|
+
type: Input
|
|
755
|
+
}], viewportPadding: [{
|
|
756
|
+
type: Input
|
|
757
|
+
}], closeOnEscape: [{
|
|
758
|
+
type: Input
|
|
759
|
+
}], closeOnOutsideClick: [{
|
|
760
|
+
type: Input
|
|
761
|
+
}], anchorElement: [{
|
|
762
|
+
type: Input
|
|
763
|
+
}], matchWidthElement: [{
|
|
764
|
+
type: Input
|
|
765
|
+
}], placement: [{
|
|
766
|
+
type: Input
|
|
767
|
+
}], openChange: [{
|
|
768
|
+
type: Output
|
|
769
|
+
}], open: [{
|
|
770
|
+
type: Input
|
|
771
|
+
}], panelDir: [{
|
|
772
|
+
type: ContentChild,
|
|
773
|
+
args: [SolarisPopoverPanelDirective]
|
|
774
|
+
}], triggerDir: [{
|
|
775
|
+
type: ContentChild,
|
|
776
|
+
args: [SolarisPopoverTriggerDirective]
|
|
777
|
+
}], dataOpen: [{
|
|
778
|
+
type: HostBinding,
|
|
779
|
+
args: ['attr.data-open']
|
|
780
|
+
}] } });
|
|
781
|
+
|
|
455
782
|
class SolarisTabs {
|
|
456
783
|
size = 'md';
|
|
457
784
|
disabled = false;
|
|
@@ -656,7 +983,7 @@ class SolarisLoadingOverlay {
|
|
|
656
983
|
return this.zIndex == null ? null : { 'z-index': String(this.zIndex) };
|
|
657
984
|
}
|
|
658
985
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisLoadingOverlay, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
659
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisLoadingOverlay, isStandalone: true, selector: "solaris-loading-overlay", inputs: { zIndex: ["z-index", "zIndex"], backdrop: "backdrop", appearance: "appearance", blur: ["blur", "blur", coerceBoolean$
|
|
986
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisLoadingOverlay, isStandalone: true, selector: "solaris-loading-overlay", inputs: { zIndex: ["z-index", "zIndex"], backdrop: "backdrop", appearance: "appearance", blur: ["blur", "blur", coerceBoolean$2], open: ["open", "open", coerceBoolean$2], lockScroll: ["lock-scroll", "lockScroll", coerceBoolean$2] }, host: { properties: { "attr.solaris-loading-overlay": "this.marker" } }, usesOnChanges: true, ngImport: i0, template: "@if (open) {\r\n <div class=\"solaris-loading-overlay\" [class.backdrop-soft]=\"backdrop === 'soft'\"\r\n [class.backdrop-strong]=\"backdrop === 'strong'\" [class.is-blur]=\"blur\"\r\n [class.appearance-card]=\"appearance === 'card'\" [class.appearance-minimal]=\"appearance === 'minimal'\"\r\n [ngStyle]=\"overlayStyle\" role=\"presentation\">\r\n <div class=\"solaris-loading-overlay__backdrop\" aria-hidden=\"true\"></div>\r\n\r\n <div class=\"solaris-loading-overlay__content\" role=\"status\" aria-live=\"polite\" aria-busy=\"true\">\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n}\r\n", styles: [":host{display:contents}.solaris-loading-overlay{--solaris-overlay-z: var(--solaris-z-overlay, 2000);position:fixed;inset:0;z-index:var(--solaris-overlay-z);display:grid;place-items:center;pointer-events:auto}.solaris-loading-overlay__backdrop{position:absolute;inset:0;background:#00000059}.solaris-loading-overlay.backdrop-strong .solaris-loading-overlay__backdrop{background:#0000008c}.solaris-loading-overlay.is-blur .solaris-loading-overlay__backdrop{-webkit-backdrop-filter:blur(.8rem);backdrop-filter:blur(.8rem)}.solaris-loading-overlay__content{position:relative;z-index:1;display:grid;place-items:center;gap:var(--solaris-space-3);color:var(--solaris-color-text);outline:none}.solaris-loading-overlay.appearance-card .solaris-loading-overlay__content{min-width:18rem;max-width:min(42rem,100vw - 4rem);padding:var(--solaris-space-6);border-radius:var(--solaris-radius-md);border:1px solid color-mix(in srgb,var(--solaris-color-border) 70%,transparent);background:color-mix(in srgb,var(--solaris-color-surface) 88%,transparent);box-shadow:var(--solaris-shadow-md)}.solaris-loading-overlay.appearance-minimal .solaris-loading-overlay__content{padding:0;border:0;background:transparent;box-shadow:none}:host ::ng-deep [solaris-loading-overlay-text]{font-size:var(--solaris-fs-14);color:color-mix(in srgb,var(--solaris-color-text) 85%,transparent);text-align:center}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
660
987
|
}
|
|
661
988
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisLoadingOverlay, decorators: [{
|
|
662
989
|
type: Component,
|
|
@@ -675,51 +1002,70 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
675
1002
|
type: Input
|
|
676
1003
|
}], blur: [{
|
|
677
1004
|
type: Input,
|
|
678
|
-
args: [{ transform: coerceBoolean$
|
|
1005
|
+
args: [{ transform: coerceBoolean$2 }]
|
|
679
1006
|
}], open: [{
|
|
680
1007
|
type: Input,
|
|
681
|
-
args: [{ transform: coerceBoolean$
|
|
1008
|
+
args: [{ transform: coerceBoolean$2 }]
|
|
682
1009
|
}], lockScroll: [{
|
|
683
1010
|
type: Input,
|
|
684
|
-
args: [{ alias: 'lock-scroll', transform: coerceBoolean$
|
|
1011
|
+
args: [{ alias: 'lock-scroll', transform: coerceBoolean$2 }]
|
|
685
1012
|
}] } });
|
|
686
|
-
function coerceBoolean$
|
|
1013
|
+
function coerceBoolean$2(v) {
|
|
687
1014
|
return v === '' || v === true || v === 'true' || v === 1 || v === '1';
|
|
688
1015
|
}
|
|
689
1016
|
|
|
1017
|
+
const PRESET_COLORS$2 = ['primary', 'success', 'warning', 'error', 'surface'];
|
|
690
1018
|
class SolarisLoading {
|
|
691
1019
|
marker = '';
|
|
692
1020
|
label;
|
|
693
1021
|
value = null;
|
|
694
|
-
size = 'md';
|
|
695
1022
|
type = 'spinner';
|
|
1023
|
+
size = 'md';
|
|
1024
|
+
speed = 'md';
|
|
696
1025
|
color = 'primary';
|
|
1026
|
+
easing = 'linear';
|
|
1027
|
+
trail = 'forward';
|
|
1028
|
+
dashDensity = 'md';
|
|
697
1029
|
indeterminate = false;
|
|
698
|
-
get ariaValueNow() {
|
|
699
|
-
if (this.type === 'progress' || this.type === 'bar') {
|
|
700
|
-
if (this.indeterminate)
|
|
701
|
-
return null;
|
|
702
|
-
if (this.value == null)
|
|
703
|
-
return null;
|
|
704
|
-
return clamp(this.value, 0, 100);
|
|
705
|
-
}
|
|
706
|
-
return null;
|
|
707
|
-
}
|
|
708
1030
|
get percent() {
|
|
709
1031
|
return clamp(this.value ?? 0, 0, 100);
|
|
710
1032
|
}
|
|
1033
|
+
get ariaLabel() {
|
|
1034
|
+
return this.label ?? 'Loading';
|
|
1035
|
+
}
|
|
1036
|
+
get dashedSpokes() {
|
|
1037
|
+
return buildSpokes(this.dashedCount, 0.12);
|
|
1038
|
+
}
|
|
1039
|
+
get inlineColor() {
|
|
1040
|
+
return isPresetColor(this.color) ? null : String(this.color);
|
|
1041
|
+
}
|
|
1042
|
+
get ariaValueNow() {
|
|
1043
|
+
if (this.role !== 'progressbar')
|
|
1044
|
+
return null;
|
|
1045
|
+
if (this.indeterminate || this.value == null)
|
|
1046
|
+
return null;
|
|
1047
|
+
return clamp(this.value, 0, 100);
|
|
1048
|
+
}
|
|
711
1049
|
get role() {
|
|
712
1050
|
return (this.type === 'progress' || this.type === 'bar') ? 'progressbar' : 'status';
|
|
713
1051
|
}
|
|
714
|
-
get
|
|
715
|
-
return this.
|
|
1052
|
+
get dataColor() {
|
|
1053
|
+
return isPresetColor(this.color) ? this.color : null;
|
|
1054
|
+
}
|
|
1055
|
+
get dashedCount() {
|
|
1056
|
+
switch (this.dashDensity) {
|
|
1057
|
+
case 'low': return 8;
|
|
1058
|
+
case 'high': return 16;
|
|
1059
|
+
case 'md':
|
|
1060
|
+
default: return 12;
|
|
1061
|
+
}
|
|
716
1062
|
}
|
|
717
1063
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisLoading, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
718
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisLoading, isStandalone: true, selector: "solaris-loading", inputs: { label: "label", value: "value", size: "size",
|
|
1064
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisLoading, isStandalone: true, selector: "solaris-loading", inputs: { label: "label", value: "value", type: "type", size: "size", speed: "speed", color: "color", easing: "easing", trail: "trail", dashDensity: "dashDensity", indeterminate: ["indeterminate", "indeterminate", coerceBoolean$1] }, host: { properties: { "attr.solaris-loading": "this.marker" } }, ngImport: i0, template: "<div class=\"solaris-loading\" [attr.data-type]=\"type\" [attr.data-size]=\"size\" [attr.data-color]=\"dataColor\"\r\n [attr.data-speed]=\"speed\" [attr.data-easing]=\"easing\" [class.is-indeterminate]=\"indeterminate || value === null\"\r\n [attr.role]=\"role\" [attr.aria-label]=\"ariaLabel\" [style.--solaris-loading-color]=\"inlineColor\"\r\n [attr.aria-valuemin]=\"role === 'progressbar' ? 0 : null\" [attr.aria-valuemax]=\"role === 'progressbar' ? 100 : null\"\r\n [attr.aria-valuenow]=\"role === 'progressbar' ? ariaValueNow : null\">\r\n\r\n @if (type === 'spinner') {\r\n <span class=\"solaris-loading__spinner\" aria-hidden=\"true\"></span>\r\n }\r\n\r\n @if (type === 'spinner-dashed') {\r\n <svg class=\"solaris-loading__spinner-stacked\" viewBox=\"0 0 44 44\" aria-hidden=\"true\">\r\n @for (spoke of dashedSpokes; track spoke.angle) {\r\n <line x1=\"22\" y1=\"6\" x2=\"22\" y2=\"12\" [attr.opacity]=\"spoke.opacity\"\r\n [attr.transform]=\"'rotate(' + spoke.angle + ' 22 22)'\">\r\n </line>\r\n }\r\n </svg>\r\n }\r\n\r\n @if (type === 'progress') {\r\n <svg class=\"solaris-loading__ring\" viewBox=\"0 0 44 44\" aria-hidden=\"true\">\r\n <circle class=\"ring-track\" cx=\"22\" cy=\"22\" r=\"18\"></circle>\r\n <circle class=\"ring-value\" cx=\"22\" cy=\"22\" r=\"18\" [attr.stroke-dasharray]=\"113.097\"\r\n [attr.stroke-dashoffset]=\"113.097 - (113.097 * percent / 100)\"></circle>\r\n </svg>\r\n\r\n <span class=\"solaris-loading__percent\" aria-hidden=\"true\">\r\n {{ percent }}%\r\n </span>\r\n }\r\n\r\n @if (type === 'bar') {\r\n <span class=\"solaris-loading__bar\" aria-hidden=\"true\">\r\n <span class=\"solaris-loading__bar-inner\" [style.width.%]=\"indeterminate || value === null ? 30 : percent\"></span>\r\n </span>\r\n }\r\n</div>\r\n", styles: [":host{display:inline-flex;min-width:0}.solaris-loading{--solaris-loading-size: 2rem;--solaris-loading-easing: linear;--solaris-loading-duration: .9s;--solaris-loading-color: var(--solaris-color-primary);--solaris-loading-stroke: clamp(.18rem, calc(var(--solaris-loading-size) * .13), .6rem);--solaris-loading-stacked-stroke: clamp(.14rem, calc(var(--solaris-loading-size) * .08), .32rem);display:inline-flex;align-items:center;justify-content:center;gap:var(--solaris-space-2);color:var(--solaris-loading-color)}.solaris-loading[data-size=xs]{--solaris-loading-size: 1.4rem}.solaris-loading[data-size=sm]{--solaris-loading-size: 1.8rem}.solaris-loading[data-size=md]{--solaris-loading-size: 2.2rem}.solaris-loading[data-size=lg]{--solaris-loading-size: 2.8rem}.solaris-loading[data-size=xl]{--solaris-loading-size: 6.4rem}.solaris-loading[data-color=primary]{--solaris-loading-color: var(--solaris-color-primary)}.solaris-loading[data-color=success]{--solaris-loading-color: var(--solaris-color-success)}.solaris-loading[data-color=warning]{--solaris-loading-color: var(--solaris-color-warning)}.solaris-loading[data-color=error]{--solaris-loading-color: var(--solaris-color-error)}.solaris-loading[data-color=surface]{--solaris-loading-color: var(--solaris-color-text-muted)}.solaris-loading[data-speed=slow]{--solaris-loading-duration: 1.4s}.solaris-loading[data-speed=md]{--solaris-loading-duration: .9s}.solaris-loading[data-speed=fast]{--solaris-loading-duration: .65s}.solaris-loading[data-easing=linear]{--solaris-loading-easing: linear}.solaris-loading[data-easing=smooth]{--solaris-loading-easing: cubic-bezier(.2, 0, 0, 1)}.solaris-loading[data-easing=snappy]{--solaris-loading-easing: cubic-bezier(.2, .9, .2, 1)}.solaris-loading__spinner{display:inline-block;width:var(--solaris-loading-size);height:var(--solaris-loading-size);border-radius:var(--solaris-radius-full);border:var(--solaris-loading-stroke) solid color-mix(in srgb,var(--solaris-loading-color) 22%,transparent);border-top-color:var(--solaris-loading-color);animation:solaris-spin var(--solaris-loading-duration) var(--solaris-loading-easing) infinite}.solaris-loading__spinner-stacked{transform-box:fill-box;transform-origin:50% 50%;width:var(--solaris-loading-size);height:var(--solaris-loading-size);animation:solaris-spin var(--solaris-loading-duration) var(--solaris-loading-easing) infinite}.solaris-loading__spinner-stacked line{stroke-linecap:round;stroke:var(--solaris-loading-color);stroke-width:var(--solaris-loading-stacked-stroke)}.solaris-loading[data-type=progress]{gap:var(--solaris-space-2)}.solaris-loading__ring{transform:rotate(-90deg);width:calc(var(--solaris-loading-size) * 1.2);height:calc(var(--solaris-loading-size) * 1.2)}.solaris-loading__ring .ring-track{fill:none;stroke-width:var(--solaris-loading-stroke);stroke:color-mix(in srgb,var(--solaris-loading-color) 18%,transparent)}.solaris-loading__ring .ring-value{fill:none;stroke-linecap:round;stroke:var(--solaris-loading-color);stroke-width:var(--solaris-loading-stroke);transition:stroke-dashoffset .16s var(--solaris-loading-easing)}.solaris-loading.is-indeterminate[data-type=progress] .ring-value{animation:solaris-ring var(--solaris-loading-duration) var(--solaris-loading-easing) infinite}.solaris-loading__percent{font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-loading[data-type=bar]{max-width:100%;justify-content:stretch;width:clamp(12rem,35vw,28rem)}.solaris-loading__bar{width:100%;min-width:0;display:block;flex:1 1 auto;height:.6rem;overflow:hidden;border-radius:var(--solaris-radius-full);background:color-mix(in srgb,var(--solaris-loading-color) 14%,transparent)}.solaris-loading__bar-inner{height:100%;display:block;background:var(--solaris-loading-color);border-radius:var(--solaris-radius-full);transition:width .16s var(--solaris-loading-easing)}.solaris-loading.is-indeterminate[data-type=bar] .solaris-loading__bar-inner{width:30%;animation:solaris-bar var(--solaris-loading-duration) var(--solaris-loading-easing) infinite}.solaris-loading[data-trail=reverse] .solaris-loading__spinner-stacked{transform:scaleX(-1)}@keyframes solaris-spin{to{transform:rotate(360deg)}}@keyframes solaris-ring{0%{stroke-dashoffset:113.097;opacity:.55}50%{stroke-dashoffset:28;opacity:1}to{stroke-dashoffset:113.097;opacity:.55}}@keyframes solaris-bar{0%{transform:translate(-120%)}50%{transform:translate(70%)}to{transform:translate(240%)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
719
1065
|
}
|
|
720
1066
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisLoading, decorators: [{
|
|
721
1067
|
type: Component,
|
|
722
|
-
args: [{ selector: 'solaris-loading', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"solaris-loading\" [
|
|
1068
|
+
args: [{ selector: 'solaris-loading', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"solaris-loading\" [attr.data-type]=\"type\" [attr.data-size]=\"size\" [attr.data-color]=\"dataColor\"\r\n [attr.data-speed]=\"speed\" [attr.data-easing]=\"easing\" [class.is-indeterminate]=\"indeterminate || value === null\"\r\n [attr.role]=\"role\" [attr.aria-label]=\"ariaLabel\" [style.--solaris-loading-color]=\"inlineColor\"\r\n [attr.aria-valuemin]=\"role === 'progressbar' ? 0 : null\" [attr.aria-valuemax]=\"role === 'progressbar' ? 100 : null\"\r\n [attr.aria-valuenow]=\"role === 'progressbar' ? ariaValueNow : null\">\r\n\r\n @if (type === 'spinner') {\r\n <span class=\"solaris-loading__spinner\" aria-hidden=\"true\"></span>\r\n }\r\n\r\n @if (type === 'spinner-dashed') {\r\n <svg class=\"solaris-loading__spinner-stacked\" viewBox=\"0 0 44 44\" aria-hidden=\"true\">\r\n @for (spoke of dashedSpokes; track spoke.angle) {\r\n <line x1=\"22\" y1=\"6\" x2=\"22\" y2=\"12\" [attr.opacity]=\"spoke.opacity\"\r\n [attr.transform]=\"'rotate(' + spoke.angle + ' 22 22)'\">\r\n </line>\r\n }\r\n </svg>\r\n }\r\n\r\n @if (type === 'progress') {\r\n <svg class=\"solaris-loading__ring\" viewBox=\"0 0 44 44\" aria-hidden=\"true\">\r\n <circle class=\"ring-track\" cx=\"22\" cy=\"22\" r=\"18\"></circle>\r\n <circle class=\"ring-value\" cx=\"22\" cy=\"22\" r=\"18\" [attr.stroke-dasharray]=\"113.097\"\r\n [attr.stroke-dashoffset]=\"113.097 - (113.097 * percent / 100)\"></circle>\r\n </svg>\r\n\r\n <span class=\"solaris-loading__percent\" aria-hidden=\"true\">\r\n {{ percent }}%\r\n </span>\r\n }\r\n\r\n @if (type === 'bar') {\r\n <span class=\"solaris-loading__bar\" aria-hidden=\"true\">\r\n <span class=\"solaris-loading__bar-inner\" [style.width.%]=\"indeterminate || value === null ? 30 : percent\"></span>\r\n </span>\r\n }\r\n</div>\r\n", styles: [":host{display:inline-flex;min-width:0}.solaris-loading{--solaris-loading-size: 2rem;--solaris-loading-easing: linear;--solaris-loading-duration: .9s;--solaris-loading-color: var(--solaris-color-primary);--solaris-loading-stroke: clamp(.18rem, calc(var(--solaris-loading-size) * .13), .6rem);--solaris-loading-stacked-stroke: clamp(.14rem, calc(var(--solaris-loading-size) * .08), .32rem);display:inline-flex;align-items:center;justify-content:center;gap:var(--solaris-space-2);color:var(--solaris-loading-color)}.solaris-loading[data-size=xs]{--solaris-loading-size: 1.4rem}.solaris-loading[data-size=sm]{--solaris-loading-size: 1.8rem}.solaris-loading[data-size=md]{--solaris-loading-size: 2.2rem}.solaris-loading[data-size=lg]{--solaris-loading-size: 2.8rem}.solaris-loading[data-size=xl]{--solaris-loading-size: 6.4rem}.solaris-loading[data-color=primary]{--solaris-loading-color: var(--solaris-color-primary)}.solaris-loading[data-color=success]{--solaris-loading-color: var(--solaris-color-success)}.solaris-loading[data-color=warning]{--solaris-loading-color: var(--solaris-color-warning)}.solaris-loading[data-color=error]{--solaris-loading-color: var(--solaris-color-error)}.solaris-loading[data-color=surface]{--solaris-loading-color: var(--solaris-color-text-muted)}.solaris-loading[data-speed=slow]{--solaris-loading-duration: 1.4s}.solaris-loading[data-speed=md]{--solaris-loading-duration: .9s}.solaris-loading[data-speed=fast]{--solaris-loading-duration: .65s}.solaris-loading[data-easing=linear]{--solaris-loading-easing: linear}.solaris-loading[data-easing=smooth]{--solaris-loading-easing: cubic-bezier(.2, 0, 0, 1)}.solaris-loading[data-easing=snappy]{--solaris-loading-easing: cubic-bezier(.2, .9, .2, 1)}.solaris-loading__spinner{display:inline-block;width:var(--solaris-loading-size);height:var(--solaris-loading-size);border-radius:var(--solaris-radius-full);border:var(--solaris-loading-stroke) solid color-mix(in srgb,var(--solaris-loading-color) 22%,transparent);border-top-color:var(--solaris-loading-color);animation:solaris-spin var(--solaris-loading-duration) var(--solaris-loading-easing) infinite}.solaris-loading__spinner-stacked{transform-box:fill-box;transform-origin:50% 50%;width:var(--solaris-loading-size);height:var(--solaris-loading-size);animation:solaris-spin var(--solaris-loading-duration) var(--solaris-loading-easing) infinite}.solaris-loading__spinner-stacked line{stroke-linecap:round;stroke:var(--solaris-loading-color);stroke-width:var(--solaris-loading-stacked-stroke)}.solaris-loading[data-type=progress]{gap:var(--solaris-space-2)}.solaris-loading__ring{transform:rotate(-90deg);width:calc(var(--solaris-loading-size) * 1.2);height:calc(var(--solaris-loading-size) * 1.2)}.solaris-loading__ring .ring-track{fill:none;stroke-width:var(--solaris-loading-stroke);stroke:color-mix(in srgb,var(--solaris-loading-color) 18%,transparent)}.solaris-loading__ring .ring-value{fill:none;stroke-linecap:round;stroke:var(--solaris-loading-color);stroke-width:var(--solaris-loading-stroke);transition:stroke-dashoffset .16s var(--solaris-loading-easing)}.solaris-loading.is-indeterminate[data-type=progress] .ring-value{animation:solaris-ring var(--solaris-loading-duration) var(--solaris-loading-easing) infinite}.solaris-loading__percent{font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-loading[data-type=bar]{max-width:100%;justify-content:stretch;width:clamp(12rem,35vw,28rem)}.solaris-loading__bar{width:100%;min-width:0;display:block;flex:1 1 auto;height:.6rem;overflow:hidden;border-radius:var(--solaris-radius-full);background:color-mix(in srgb,var(--solaris-loading-color) 14%,transparent)}.solaris-loading__bar-inner{height:100%;display:block;background:var(--solaris-loading-color);border-radius:var(--solaris-radius-full);transition:width .16s var(--solaris-loading-easing)}.solaris-loading.is-indeterminate[data-type=bar] .solaris-loading__bar-inner{width:30%;animation:solaris-bar var(--solaris-loading-duration) var(--solaris-loading-easing) infinite}.solaris-loading[data-trail=reverse] .solaris-loading__spinner-stacked{transform:scaleX(-1)}@keyframes solaris-spin{to{transform:rotate(360deg)}}@keyframes solaris-ring{0%{stroke-dashoffset:113.097;opacity:.55}50%{stroke-dashoffset:28;opacity:1}to{stroke-dashoffset:113.097;opacity:.55}}@keyframes solaris-bar{0%{transform:translate(-120%)}50%{transform:translate(70%)}to{transform:translate(240%)}}\n"] }]
|
|
723
1069
|
}], propDecorators: { marker: [{
|
|
724
1070
|
type: HostBinding,
|
|
725
1071
|
args: ['attr.solaris-loading']
|
|
@@ -727,50 +1073,97 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
727
1073
|
type: Input
|
|
728
1074
|
}], value: [{
|
|
729
1075
|
type: Input
|
|
1076
|
+
}], type: [{
|
|
1077
|
+
type: Input
|
|
730
1078
|
}], size: [{
|
|
731
1079
|
type: Input
|
|
732
|
-
}],
|
|
1080
|
+
}], speed: [{
|
|
733
1081
|
type: Input
|
|
734
1082
|
}], color: [{
|
|
735
1083
|
type: Input
|
|
1084
|
+
}], easing: [{
|
|
1085
|
+
type: Input
|
|
1086
|
+
}], trail: [{
|
|
1087
|
+
type: Input
|
|
1088
|
+
}], dashDensity: [{
|
|
1089
|
+
type: Input
|
|
736
1090
|
}], indeterminate: [{
|
|
737
1091
|
type: Input,
|
|
738
|
-
args: [{ transform:
|
|
1092
|
+
args: [{ transform: coerceBoolean$1 }]
|
|
739
1093
|
}] } });
|
|
1094
|
+
function isPresetColor(v) {
|
|
1095
|
+
return PRESET_COLORS$2.includes(v);
|
|
1096
|
+
}
|
|
1097
|
+
function coerceBoolean$1(v) {
|
|
1098
|
+
return v === '' || v === true || v === 'true' || v === 1 || v === '1';
|
|
1099
|
+
}
|
|
740
1100
|
function clamp(n, min, max) {
|
|
741
1101
|
return Math.max(min, Math.min(max, n));
|
|
742
1102
|
}
|
|
1103
|
+
const SPOKE_CACHE = new Map();
|
|
1104
|
+
function buildSpokes(count, minOpacity = 0.12) {
|
|
1105
|
+
const cached = SPOKE_CACHE.get(count);
|
|
1106
|
+
if (cached)
|
|
1107
|
+
return cached;
|
|
1108
|
+
const res = [];
|
|
1109
|
+
const step = 360 / count;
|
|
1110
|
+
const span = 1 - minOpacity;
|
|
1111
|
+
for (let i = 0; i < count; i++) {
|
|
1112
|
+
const t = count === 1 ? 0 : i / (count - 1);
|
|
1113
|
+
const opacity = 1 - span * t;
|
|
1114
|
+
res.push({ angle: i * step, opacity: Number(opacity.toFixed(2)) });
|
|
1115
|
+
}
|
|
1116
|
+
SPOKE_CACHE.set(count, res);
|
|
1117
|
+
return res;
|
|
1118
|
+
}
|
|
743
1119
|
|
|
744
1120
|
class SolarisBadge {
|
|
745
|
-
hostClass = 'solaris-badge-host';
|
|
746
1121
|
pill = false;
|
|
747
|
-
|
|
1122
|
+
customTextColor;
|
|
748
1123
|
interactive = false;
|
|
749
|
-
|
|
1124
|
+
size = 'md';
|
|
750
1125
|
variant = 'subtle';
|
|
1126
|
+
color = 'surface';
|
|
751
1127
|
ariaHidden = null;
|
|
1128
|
+
hostClass = 'solaris-badge-host';
|
|
1129
|
+
presetColors = new Set([
|
|
1130
|
+
'primary', 'success', 'warning', 'error', 'info', 'surface',
|
|
1131
|
+
]);
|
|
1132
|
+
get colorClass() {
|
|
1133
|
+
return this.isCustomColor ? 'color-custom' : `color-${this.color}`;
|
|
1134
|
+
}
|
|
1135
|
+
get isCustomColor() {
|
|
1136
|
+
return !this.presetColors.has(this.color);
|
|
1137
|
+
}
|
|
1138
|
+
get customColorValue() {
|
|
1139
|
+
return this.isCustomColor ? String(this.color) : null;
|
|
1140
|
+
}
|
|
752
1141
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisBadge, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
753
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.1", type: SolarisBadge, isStandalone: true, selector: "solaris-badge", inputs: { pill: "pill",
|
|
1142
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.1", type: SolarisBadge, isStandalone: true, selector: "solaris-badge", inputs: { pill: "pill", customTextColor: "customTextColor", interactive: "interactive", size: "size", variant: "variant", color: "color", ariaHidden: ["aria-hidden", "ariaHidden"] }, host: { properties: { "class": "this.hostClass" } }, ngImport: i0, template: "<span class=\"solaris-badge\" [attr.aria-hidden]=\"ariaHidden\"\r\n [ngClass]=\"[ 'variant-' + variant, colorClass,\r\n 'size-' + size, pill ? 'is-pill' : '',\r\n interactive ? 'is-interactive' : '' ]\"\r\n [style.--solaris-badge-custom]=\"customColorValue\"\r\n [style.--solaris-badge-custom-fg]=\"customTextColor\">\r\n <ng-content></ng-content>\r\n</span>\r\n", styles: [":host.solaris-badge-host{display:inline-flex}.solaris-badge{--solaris-badge-fg: var(--solaris-color-text);--solaris-badge-radius: var(--solaris-radius-full);--solaris-badge-fg-solid: var(--solaris-badge-fg);line-height:1;font-weight:600;-webkit-user-select:none;user-select:none;white-space:nowrap;align-items:center;display:inline-flex;gap:var(--solaris-space-2);border:1px solid transparent;letter-spacing:var(--solaris-ls-sm);border-radius:var(--solaris-badge-radius)}.solaris-badge.size-sm{padding:.3rem .6rem;font-size:var(--solaris-fs-10)}.solaris-badge.size-md{padding:.4rem .8rem;font-size:var(--solaris-fs-12)}.solaris-badge.size-lg{padding:.5rem 1rem;font-size:var(--solaris-fs-14)}.solaris-badge.is-pill{--solaris-badge-radius: var(--solaris-radius-full)}.solaris-badge.is-interactive{cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease,box-shadow .15s ease}.solaris-badge.is-interactive:hover{box-shadow:var(--solaris-shadow-xs)}.solaris-badge.color-surface{--_base: var(--solaris-color-surface-2);--solaris-badge-fg: var(--solaris-color-text);--solaris-badge-fg-solid: var(--solaris-color-primary-contrast, #fff);--solaris-badge-bg: color-mix(in srgb, var(--_base) 30%, transparent);--solaris-badge-border-solid: color-mix(in srgb, var(--_base) 70%, black);--solaris-badge-border: color-mix(in srgb, var(--_base) 55%, var(--solaris-color-border));--solaris-badge-bg-solid: linear-gradient(180deg, color-mix(in srgb, var(--_base) 92%, white), color-mix(in srgb, var(--_base) 75%, black))}.solaris-badge.color-primary{--_base: var(--solaris-color-primary);--solaris-badge-fg: var(--solaris-color-text);--solaris-badge-fg-solid: var(--solaris-color-primary-contrast, #fff);--solaris-badge-bg: color-mix(in srgb, var(--_base) 30%, transparent);--solaris-badge-border-solid: color-mix(in srgb, var(--_base) 70%, black);--solaris-badge-border: color-mix(in srgb, var(--_base) 55%, var(--solaris-color-border));--solaris-badge-bg-solid: linear-gradient(180deg, color-mix(in srgb, var(--_base) 92%, white), color-mix(in srgb, var(--_base) 82%, black))}.solaris-badge.color-success{--_base: var(--solaris-color-success);--solaris-badge-fg: var(--solaris-color-text);--solaris-badge-fg-solid: var(--solaris-color-primary-contrast, #fff);--solaris-badge-bg: color-mix(in srgb, var(--_base) 30%, transparent);--solaris-badge-border-solid: color-mix(in srgb, var(--_base) 70%, black);--solaris-badge-border: color-mix(in srgb, var(--_base) 55%, var(--solaris-color-border));--solaris-badge-bg-solid: linear-gradient(180deg, color-mix(in srgb, var(--_base) 92%, white), color-mix(in srgb, var(--_base) 75%, black))}.solaris-badge.color-warning{--_base: var(--solaris-color-warning);--solaris-badge-fg: var(--solaris-color-text);--solaris-badge-fg-solid: var(--solaris-color-primary-contrast, #fff);--solaris-badge-bg: color-mix(in srgb, var(--_base) 30%, transparent);--solaris-badge-border-solid: color-mix(in srgb, var(--_base) 70%, black);--solaris-badge-border: color-mix(in srgb, var(--_base) 55%, var(--solaris-color-border));--solaris-badge-bg-solid: linear-gradient(180deg, color-mix(in srgb, var(--_base) 92%, white), color-mix(in srgb, var(--_base) 75%, black))}.solaris-badge.color-error{--_base: var(--solaris-color-error);--solaris-badge-fg: var(--solaris-color-text);--solaris-badge-fg-solid: var(--solaris-color-primary-contrast, #fff);--solaris-badge-bg: color-mix(in srgb, var(--_base) 30%, transparent);--solaris-badge-border-solid: color-mix(in srgb, var(--_base) 70%, black);--solaris-badge-border: color-mix(in srgb, var(--_base) 55%, var(--solaris-color-border));--solaris-badge-bg-solid: linear-gradient(180deg, color-mix(in srgb, var(--_base) 92%, white), color-mix(in srgb, var(--_base) 82%, black))}.solaris-badge.color-info{--_base: var(--solaris-color-info);--solaris-badge-fg: var(--solaris-color-text);--solaris-badge-fg-solid: var(--solaris-color-primary-contrast, #fff);--solaris-badge-bg: color-mix(in srgb, var(--_base) 30%, transparent);--solaris-badge-border-solid: color-mix(in srgb, var(--_base) 70%, black);--solaris-badge-border: color-mix(in srgb, var(--_base) 55%, var(--solaris-color-border));--solaris-badge-bg-solid: linear-gradient(180deg, color-mix(in srgb, var(--_base) 92%, white), color-mix(in srgb, var(--_base) 82%, black))}.solaris-badge.color-custom{--_base: var(--solaris-badge-custom, var(--solaris-color-surface-2));--solaris-badge-fg-solid: var(--solaris-badge-custom-fg, #fff);--solaris-badge-bg: color-mix(in srgb, var(--_base) 30%, transparent);--solaris-badge-border-solid: color-mix(in srgb, var(--_base) 70%, black);--solaris-badge-fg: var(--solaris-badge-custom-fg, var(--solaris-color-text));--solaris-badge-border: color-mix(in srgb, var(--_base) 55%, var(--solaris-color-border));--solaris-badge-bg-solid: linear-gradient(180deg, color-mix(in srgb, var(--_base) 92%, white), color-mix(in srgb, var(--_base) 82%, black))}.solaris-badge.variant-solid{color:var(--solaris-badge-fg-solid);background:var(--solaris-badge-bg-solid, var(--solaris-badge-bg));border-color:var(--solaris-badge-border-solid, var(--solaris-badge-border))}.solaris-badge.variant-subtle{color:var(--solaris-badge-fg);background:var(--solaris-badge-bg);border-color:var(--solaris-badge-border)}.solaris-badge.variant-outline{border-color:var(--solaris-badge-border);color:color-mix(in srgb,var(--solaris-badge-border) 30%,white);background:color-mix(in srgb,var(--solaris-badge-border) 20%,transparent)}.solaris-badge.variant-solid.color-surface{color:var(--solaris-color-text);border-color:var(--solaris-color-border);background:var(--solaris-color-surface-2)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
754
1143
|
}
|
|
755
1144
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisBadge, decorators: [{
|
|
756
1145
|
type: Component,
|
|
757
|
-
args: [{ selector: 'solaris-badge', standalone: true, imports: [
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
}], pill: [{
|
|
1146
|
+
args: [{ selector: 'solaris-badge', standalone: true, imports: [
|
|
1147
|
+
NgClass
|
|
1148
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"solaris-badge\" [attr.aria-hidden]=\"ariaHidden\"\r\n [ngClass]=\"[ 'variant-' + variant, colorClass,\r\n 'size-' + size, pill ? 'is-pill' : '',\r\n interactive ? 'is-interactive' : '' ]\"\r\n [style.--solaris-badge-custom]=\"customColorValue\"\r\n [style.--solaris-badge-custom-fg]=\"customTextColor\">\r\n <ng-content></ng-content>\r\n</span>\r\n", styles: [":host.solaris-badge-host{display:inline-flex}.solaris-badge{--solaris-badge-fg: var(--solaris-color-text);--solaris-badge-radius: var(--solaris-radius-full);--solaris-badge-fg-solid: var(--solaris-badge-fg);line-height:1;font-weight:600;-webkit-user-select:none;user-select:none;white-space:nowrap;align-items:center;display:inline-flex;gap:var(--solaris-space-2);border:1px solid transparent;letter-spacing:var(--solaris-ls-sm);border-radius:var(--solaris-badge-radius)}.solaris-badge.size-sm{padding:.3rem .6rem;font-size:var(--solaris-fs-10)}.solaris-badge.size-md{padding:.4rem .8rem;font-size:var(--solaris-fs-12)}.solaris-badge.size-lg{padding:.5rem 1rem;font-size:var(--solaris-fs-14)}.solaris-badge.is-pill{--solaris-badge-radius: var(--solaris-radius-full)}.solaris-badge.is-interactive{cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease,box-shadow .15s ease}.solaris-badge.is-interactive:hover{box-shadow:var(--solaris-shadow-xs)}.solaris-badge.color-surface{--_base: var(--solaris-color-surface-2);--solaris-badge-fg: var(--solaris-color-text);--solaris-badge-fg-solid: var(--solaris-color-primary-contrast, #fff);--solaris-badge-bg: color-mix(in srgb, var(--_base) 30%, transparent);--solaris-badge-border-solid: color-mix(in srgb, var(--_base) 70%, black);--solaris-badge-border: color-mix(in srgb, var(--_base) 55%, var(--solaris-color-border));--solaris-badge-bg-solid: linear-gradient(180deg, color-mix(in srgb, var(--_base) 92%, white), color-mix(in srgb, var(--_base) 75%, black))}.solaris-badge.color-primary{--_base: var(--solaris-color-primary);--solaris-badge-fg: var(--solaris-color-text);--solaris-badge-fg-solid: var(--solaris-color-primary-contrast, #fff);--solaris-badge-bg: color-mix(in srgb, var(--_base) 30%, transparent);--solaris-badge-border-solid: color-mix(in srgb, var(--_base) 70%, black);--solaris-badge-border: color-mix(in srgb, var(--_base) 55%, var(--solaris-color-border));--solaris-badge-bg-solid: linear-gradient(180deg, color-mix(in srgb, var(--_base) 92%, white), color-mix(in srgb, var(--_base) 82%, black))}.solaris-badge.color-success{--_base: var(--solaris-color-success);--solaris-badge-fg: var(--solaris-color-text);--solaris-badge-fg-solid: var(--solaris-color-primary-contrast, #fff);--solaris-badge-bg: color-mix(in srgb, var(--_base) 30%, transparent);--solaris-badge-border-solid: color-mix(in srgb, var(--_base) 70%, black);--solaris-badge-border: color-mix(in srgb, var(--_base) 55%, var(--solaris-color-border));--solaris-badge-bg-solid: linear-gradient(180deg, color-mix(in srgb, var(--_base) 92%, white), color-mix(in srgb, var(--_base) 75%, black))}.solaris-badge.color-warning{--_base: var(--solaris-color-warning);--solaris-badge-fg: var(--solaris-color-text);--solaris-badge-fg-solid: var(--solaris-color-primary-contrast, #fff);--solaris-badge-bg: color-mix(in srgb, var(--_base) 30%, transparent);--solaris-badge-border-solid: color-mix(in srgb, var(--_base) 70%, black);--solaris-badge-border: color-mix(in srgb, var(--_base) 55%, var(--solaris-color-border));--solaris-badge-bg-solid: linear-gradient(180deg, color-mix(in srgb, var(--_base) 92%, white), color-mix(in srgb, var(--_base) 75%, black))}.solaris-badge.color-error{--_base: var(--solaris-color-error);--solaris-badge-fg: var(--solaris-color-text);--solaris-badge-fg-solid: var(--solaris-color-primary-contrast, #fff);--solaris-badge-bg: color-mix(in srgb, var(--_base) 30%, transparent);--solaris-badge-border-solid: color-mix(in srgb, var(--_base) 70%, black);--solaris-badge-border: color-mix(in srgb, var(--_base) 55%, var(--solaris-color-border));--solaris-badge-bg-solid: linear-gradient(180deg, color-mix(in srgb, var(--_base) 92%, white), color-mix(in srgb, var(--_base) 82%, black))}.solaris-badge.color-info{--_base: var(--solaris-color-info);--solaris-badge-fg: var(--solaris-color-text);--solaris-badge-fg-solid: var(--solaris-color-primary-contrast, #fff);--solaris-badge-bg: color-mix(in srgb, var(--_base) 30%, transparent);--solaris-badge-border-solid: color-mix(in srgb, var(--_base) 70%, black);--solaris-badge-border: color-mix(in srgb, var(--_base) 55%, var(--solaris-color-border));--solaris-badge-bg-solid: linear-gradient(180deg, color-mix(in srgb, var(--_base) 92%, white), color-mix(in srgb, var(--_base) 82%, black))}.solaris-badge.color-custom{--_base: var(--solaris-badge-custom, var(--solaris-color-surface-2));--solaris-badge-fg-solid: var(--solaris-badge-custom-fg, #fff);--solaris-badge-bg: color-mix(in srgb, var(--_base) 30%, transparent);--solaris-badge-border-solid: color-mix(in srgb, var(--_base) 70%, black);--solaris-badge-fg: var(--solaris-badge-custom-fg, var(--solaris-color-text));--solaris-badge-border: color-mix(in srgb, var(--_base) 55%, var(--solaris-color-border));--solaris-badge-bg-solid: linear-gradient(180deg, color-mix(in srgb, var(--_base) 92%, white), color-mix(in srgb, var(--_base) 82%, black))}.solaris-badge.variant-solid{color:var(--solaris-badge-fg-solid);background:var(--solaris-badge-bg-solid, var(--solaris-badge-bg));border-color:var(--solaris-badge-border-solid, var(--solaris-badge-border))}.solaris-badge.variant-subtle{color:var(--solaris-badge-fg);background:var(--solaris-badge-bg);border-color:var(--solaris-badge-border)}.solaris-badge.variant-outline{border-color:var(--solaris-badge-border);color:color-mix(in srgb,var(--solaris-badge-border) 30%,white);background:color-mix(in srgb,var(--solaris-badge-border) 20%,transparent)}.solaris-badge.variant-solid.color-surface{color:var(--solaris-color-text);border-color:var(--solaris-color-border);background:var(--solaris-color-surface-2)}\n"] }]
|
|
1149
|
+
}], propDecorators: { pill: [{
|
|
762
1150
|
type: Input
|
|
763
|
-
}],
|
|
1151
|
+
}], customTextColor: [{
|
|
764
1152
|
type: Input
|
|
765
1153
|
}], interactive: [{
|
|
766
1154
|
type: Input
|
|
767
|
-
}],
|
|
1155
|
+
}], size: [{
|
|
768
1156
|
type: Input
|
|
769
1157
|
}], variant: [{
|
|
770
1158
|
type: Input
|
|
1159
|
+
}], color: [{
|
|
1160
|
+
type: Input
|
|
771
1161
|
}], ariaHidden: [{
|
|
772
1162
|
type: Input,
|
|
773
1163
|
args: [{ alias: 'aria-hidden' }]
|
|
1164
|
+
}], hostClass: [{
|
|
1165
|
+
type: HostBinding,
|
|
1166
|
+
args: ['class']
|
|
774
1167
|
}] } });
|
|
775
1168
|
|
|
776
1169
|
class SolarisImageSliderComponent {
|
|
@@ -989,73 +1382,1593 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
989
1382
|
args: ['attr.aria-orientation']
|
|
990
1383
|
}] } });
|
|
991
1384
|
|
|
992
|
-
class
|
|
993
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
994
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type:
|
|
995
|
-
}
|
|
996
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisHeaderDirective, decorators: [{
|
|
997
|
-
type: Directive,
|
|
998
|
-
args: [{
|
|
999
|
-
selector: '[solaris-header]',
|
|
1000
|
-
standalone: true,
|
|
1001
|
-
}]
|
|
1002
|
-
}] });
|
|
1003
|
-
|
|
1004
|
-
class SolarisFooterDirective {
|
|
1005
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1006
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisFooterDirective, isStandalone: true, selector: "[solaris-footer]", ngImport: i0 });
|
|
1385
|
+
class SolarisDrawerHeaderDirective {
|
|
1386
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDrawerHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1387
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisDrawerHeaderDirective, isStandalone: true, selector: "[solaris-drawer-header]", ngImport: i0 });
|
|
1007
1388
|
}
|
|
1008
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
1389
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDrawerHeaderDirective, decorators: [{
|
|
1009
1390
|
type: Directive,
|
|
1010
1391
|
args: [{
|
|
1011
|
-
selector: '[solaris-
|
|
1392
|
+
selector: '[solaris-drawer-header]',
|
|
1012
1393
|
standalone: true,
|
|
1013
1394
|
}]
|
|
1014
1395
|
}] });
|
|
1015
1396
|
|
|
1016
|
-
class
|
|
1017
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
1018
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type:
|
|
1397
|
+
class SolarisDrawerFooterDirective {
|
|
1398
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDrawerFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1399
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisDrawerFooterDirective, isStandalone: true, selector: "[solaris-drawer-footer]", ngImport: i0 });
|
|
1019
1400
|
}
|
|
1020
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
1401
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDrawerFooterDirective, decorators: [{
|
|
1021
1402
|
type: Directive,
|
|
1022
1403
|
args: [{
|
|
1023
|
-
selector: '[solaris-
|
|
1404
|
+
selector: '[solaris-drawer-footer]',
|
|
1024
1405
|
standalone: true,
|
|
1025
1406
|
}]
|
|
1026
1407
|
}] });
|
|
1027
1408
|
|
|
1028
|
-
class
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1409
|
+
class SolarisDrawer {
|
|
1410
|
+
doc = inject(DOCUMENT);
|
|
1411
|
+
title = '';
|
|
1412
|
+
titleKey = '';
|
|
1413
|
+
panelClass = '';
|
|
1414
|
+
backdrop = true;
|
|
1415
|
+
showClose = true;
|
|
1416
|
+
trapFocus = true;
|
|
1417
|
+
backdropClass = '';
|
|
1418
|
+
showHeader = true;
|
|
1419
|
+
lockScroll = true;
|
|
1420
|
+
restoreFocus = true;
|
|
1421
|
+
closeOnEscape = true;
|
|
1422
|
+
width = 'min(26rem, 92vw)';
|
|
1423
|
+
side = 'right';
|
|
1424
|
+
height = 'min(70vh, 40rem)';
|
|
1425
|
+
closeOnOutsideClick = true;
|
|
1426
|
+
_openInput = signal(null, ...(ngDevMode ? [{ debugName: "_openInput" }] : []));
|
|
1427
|
+
_internalOpen = signal(false, ...(ngDevMode ? [{ debugName: "_internalOpen" }] : []));
|
|
1428
|
+
set open(v) { this._openInput.set(v); }
|
|
1429
|
+
get open() { return this._openInput(); }
|
|
1430
|
+
isOpen = computed(() => {
|
|
1431
|
+
const v = this._openInput();
|
|
1432
|
+
return typeof v === 'boolean' ? v : this._internalOpen();
|
|
1433
|
+
}, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
1434
|
+
openChange = new EventEmitter();
|
|
1435
|
+
headerSlot;
|
|
1436
|
+
footerSlot;
|
|
1437
|
+
panelEl;
|
|
1438
|
+
static seq = 0;
|
|
1439
|
+
_id = `solaris-drawer-${++SolarisDrawer.seq}`;
|
|
1440
|
+
static scrollLockCount = 0;
|
|
1441
|
+
static prevBodyOverflow = '';
|
|
1442
|
+
titleId = `${this._id}-title`;
|
|
1443
|
+
prevFocused = null;
|
|
1444
|
+
static prevBodyPaddingRight = '';
|
|
1445
|
+
get dataSide() { return this.side; }
|
|
1446
|
+
get dataOpen() { return this.isOpen() ? 'true' : null; }
|
|
1447
|
+
get hasCustomHeader() { return !!this.headerSlot; }
|
|
1448
|
+
get hasCustomFooter() { return !!this.footerSlot; }
|
|
1449
|
+
constructor() {
|
|
1450
|
+
effect((onCleanup) => {
|
|
1451
|
+
const open = this.isOpen();
|
|
1452
|
+
if (open) {
|
|
1453
|
+
this.onOpen();
|
|
1454
|
+
}
|
|
1455
|
+
else {
|
|
1456
|
+
this.onClose();
|
|
1457
|
+
}
|
|
1458
|
+
const onKeyDown = (ev) => {
|
|
1459
|
+
if (!this.isOpen())
|
|
1460
|
+
return;
|
|
1461
|
+
if (this.closeOnEscape && ev.key === 'Escape') {
|
|
1462
|
+
ev.preventDefault();
|
|
1463
|
+
this.setOpen(false);
|
|
1464
|
+
}
|
|
1465
|
+
};
|
|
1466
|
+
const onDocPointerDown = (ev) => {
|
|
1467
|
+
if (!this.isOpen())
|
|
1468
|
+
return;
|
|
1469
|
+
if (!this.closeOnOutsideClick)
|
|
1470
|
+
return;
|
|
1471
|
+
if (this.backdrop)
|
|
1472
|
+
return;
|
|
1473
|
+
const panel = this.panelEl?.nativeElement;
|
|
1474
|
+
const t = ev.target;
|
|
1475
|
+
if (!panel || !t)
|
|
1476
|
+
return;
|
|
1477
|
+
if (!panel.contains(t))
|
|
1478
|
+
this.setOpen(false);
|
|
1479
|
+
};
|
|
1480
|
+
const onFocusIn = (ev) => {
|
|
1481
|
+
if (!this.isOpen())
|
|
1482
|
+
return;
|
|
1483
|
+
if (!this.trapFocus)
|
|
1484
|
+
return;
|
|
1485
|
+
const panel = this.panelEl?.nativeElement;
|
|
1486
|
+
const target = ev.target;
|
|
1487
|
+
if (!panel || !target)
|
|
1488
|
+
return;
|
|
1489
|
+
if (!panel.contains(target)) {
|
|
1490
|
+
this.focusFirst();
|
|
1491
|
+
}
|
|
1492
|
+
};
|
|
1493
|
+
this.doc.addEventListener('keydown', onKeyDown, { capture: true });
|
|
1494
|
+
this.doc.addEventListener('pointerdown', onDocPointerDown, { capture: true });
|
|
1495
|
+
this.doc.addEventListener('focusin', onFocusIn, { capture: true });
|
|
1496
|
+
onCleanup(() => {
|
|
1497
|
+
this.doc.removeEventListener('keydown', onKeyDown, true);
|
|
1498
|
+
this.doc.removeEventListener('pointerdown', onDocPointerDown, true);
|
|
1499
|
+
this.doc.removeEventListener('focusin', onFocusIn, true);
|
|
1500
|
+
});
|
|
1501
|
+
});
|
|
1502
|
+
}
|
|
1503
|
+
toggle() {
|
|
1504
|
+
this.setOpen(!this.isOpen());
|
|
1505
|
+
}
|
|
1506
|
+
setOpen(next) {
|
|
1507
|
+
const cur = this.isOpen();
|
|
1508
|
+
if (next === cur)
|
|
1509
|
+
return;
|
|
1510
|
+
this.openChange.emit(next);
|
|
1511
|
+
if (typeof this._openInput() !== 'boolean') {
|
|
1512
|
+
this._internalOpen.set(next);
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
onBackdropClick() {
|
|
1516
|
+
if (!this.closeOnOutsideClick)
|
|
1517
|
+
return;
|
|
1518
|
+
this.setOpen(false);
|
|
1519
|
+
}
|
|
1520
|
+
onPanelKeydown(ev) {
|
|
1521
|
+
if (!this.trapFocus)
|
|
1522
|
+
return;
|
|
1523
|
+
if (ev.key !== 'Tab')
|
|
1524
|
+
return;
|
|
1525
|
+
const panel = this.panelEl?.nativeElement;
|
|
1526
|
+
if (!panel)
|
|
1527
|
+
return;
|
|
1528
|
+
const focusables = this.getFocusable(panel);
|
|
1529
|
+
if (!focusables.length)
|
|
1530
|
+
return;
|
|
1531
|
+
const first = focusables[0];
|
|
1532
|
+
const last = focusables.at(-1);
|
|
1533
|
+
const active = this.doc.activeElement;
|
|
1534
|
+
if (ev.shiftKey) {
|
|
1535
|
+
if (!active || active === first) {
|
|
1536
|
+
ev.preventDefault();
|
|
1537
|
+
if (last) {
|
|
1538
|
+
last.focus();
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
else if (!active || active === last) {
|
|
1543
|
+
ev.preventDefault();
|
|
1544
|
+
first.focus();
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
onOpen() {
|
|
1548
|
+
if (this.restoreFocus) {
|
|
1549
|
+
this.prevFocused = this.doc.activeElement;
|
|
1550
|
+
}
|
|
1551
|
+
if (this.lockScroll)
|
|
1552
|
+
this.lockBodyScroll();
|
|
1553
|
+
queueMicrotask(() => {
|
|
1554
|
+
requestAnimationFrame(() => this.focusFirst());
|
|
1555
|
+
});
|
|
1556
|
+
}
|
|
1557
|
+
onClose() {
|
|
1558
|
+
if (this.lockScroll)
|
|
1559
|
+
this.unlockBodyScroll();
|
|
1560
|
+
if (this.restoreFocus && this.prevFocused?.isConnected) {
|
|
1561
|
+
queueMicrotask(() => this.prevFocused?.focus?.());
|
|
1562
|
+
}
|
|
1563
|
+
this.prevFocused = null;
|
|
1564
|
+
}
|
|
1565
|
+
focusFirst() {
|
|
1566
|
+
const panel = this.panelEl?.nativeElement;
|
|
1567
|
+
if (!panel)
|
|
1568
|
+
return;
|
|
1569
|
+
const focusables = this.getFocusable(panel);
|
|
1570
|
+
if (focusables.length) {
|
|
1571
|
+
focusables[0].focus();
|
|
1572
|
+
return;
|
|
1573
|
+
}
|
|
1574
|
+
panel.focus?.();
|
|
1575
|
+
}
|
|
1576
|
+
getFocusable(root) {
|
|
1577
|
+
const selector = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
1578
|
+
const all = Array.from(root.querySelectorAll(selector));
|
|
1579
|
+
return all.filter(el => {
|
|
1580
|
+
const style = getComputedStyle(el);
|
|
1581
|
+
const visible = style.visibility !== 'hidden' && style.display !== 'none';
|
|
1582
|
+
const inDom = el.offsetParent !== null || style.position === 'fixed';
|
|
1583
|
+
return visible && inDom;
|
|
1584
|
+
});
|
|
1585
|
+
}
|
|
1586
|
+
lockBodyScroll() {
|
|
1587
|
+
const body = this.doc.body;
|
|
1588
|
+
if (!body)
|
|
1589
|
+
return;
|
|
1590
|
+
if (SolarisDrawer.scrollLockCount === 0) {
|
|
1591
|
+
SolarisDrawer.prevBodyOverflow = body.style.overflow;
|
|
1592
|
+
SolarisDrawer.prevBodyPaddingRight = body.style.paddingRight;
|
|
1593
|
+
const scrollbarW = Math.max(0, window.innerWidth - this.doc.documentElement.clientWidth);
|
|
1594
|
+
body.style.overflow = 'hidden';
|
|
1595
|
+
if (scrollbarW)
|
|
1596
|
+
body.style.paddingRight = `${scrollbarW}px`;
|
|
1597
|
+
}
|
|
1598
|
+
SolarisDrawer.scrollLockCount++;
|
|
1599
|
+
}
|
|
1600
|
+
unlockBodyScroll() {
|
|
1601
|
+
const body = this.doc.body;
|
|
1602
|
+
if (!body)
|
|
1603
|
+
return;
|
|
1604
|
+
SolarisDrawer.scrollLockCount = Math.max(0, SolarisDrawer.scrollLockCount - 1);
|
|
1605
|
+
if (SolarisDrawer.scrollLockCount === 0) {
|
|
1606
|
+
body.style.overflow = SolarisDrawer.prevBodyOverflow;
|
|
1607
|
+
body.style.paddingRight = SolarisDrawer.prevBodyPaddingRight;
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDrawer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1611
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisDrawer, isStandalone: true, selector: "solaris-drawer", inputs: { title: "title", titleKey: "titleKey", panelClass: "panelClass", backdrop: "backdrop", showClose: "showClose", trapFocus: "trapFocus", backdropClass: "backdropClass", showHeader: "showHeader", lockScroll: "lockScroll", restoreFocus: "restoreFocus", closeOnEscape: "closeOnEscape", width: "width", side: "side", height: "height", closeOnOutsideClick: "closeOnOutsideClick", open: "open" }, outputs: { openChange: "openChange" }, host: { properties: { "attr.data-side": "this.dataSide", "attr.data-open": "this.dataOpen" }, classAttribute: "solaris-drawer-host" }, queries: [{ propertyName: "headerSlot", first: true, predicate: SolarisDrawerHeaderDirective, descendants: true }, { propertyName: "footerSlot", first: true, predicate: SolarisDrawerFooterDirective, descendants: true }], viewQueries: [{ propertyName: "panelEl", first: true, predicate: ["panelEl"], descendants: true, read: ElementRef }], ngImport: i0, template: "@if (isOpen()) {\r\n @if (backdrop) {\r\n <div class=\"solaris-drawer__backdrop {{ backdropClass }}\" (click)=\"onBackdropClick()\" aria-hidden=\"true\"></div>\r\n }\r\n\r\n <aside #panelEl class=\"solaris-drawer__panel {{ panelClass }}\" role=\"dialog\" aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"showHeader ? titleId : null\" [style.--solaris-drawer-width]=\"width\"\r\n [style.--solaris-drawer-height]=\"height\" (keydown)=\"onPanelKeydown($event)\" tabindex=\"-1\">\r\n @if (showHeader) {\r\n <header class=\"solaris-drawer__header\">\r\n @if (hasCustomHeader) {\r\n <ng-content select=\"[solaris-drawer-header]\"></ng-content>\r\n } @else {\r\n <div class=\"solaris-drawer__title\" [id]=\"titleId\">{{ title }}</div>\r\n\r\n @if (showClose) {\r\n <button type=\"button\" class=\"solaris-drawer__close\" (click)=\"setOpen(false)\" aria-label=\"Close\">\r\n <i class=\"ph ph-x\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n }\r\n </header>\r\n }\r\n\r\n <div class=\"solaris-drawer__content\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n @if (hasCustomFooter) {\r\n <footer class=\"solaris-drawer__footer\">\r\n <ng-content select=\"[solaris-drawer-footer]\"></ng-content>\r\n </footer>\r\n }\r\n </aside>\r\n}\r\n", styles: [":host{display:contents}.solaris-drawer__backdrop{inset:0;position:fixed;background:#00000073;z-index:var(--solaris-z-fixed)}.solaris-drawer__panel{display:grid;outline:none;height:100vh;position:fixed;grid-template-rows:auto 1fr auto;box-shadow:var(--solaris-shadow-lg);background:var(--solaris-color-surface);z-index:calc(var(--solaris-z-fixed) + 1);border-left:1px solid var(--solaris-color-border);width:var(--solaris-drawer-width, min(26rem, 92vw))}:host([data-side=right]) .solaris-drawer__panel{top:0;right:0;animation:solaris-drawer-in-right .16s ease}:host([data-side=left]) .solaris-drawer__panel{top:0;left:0;border-left:none;border-right:1px solid var(--solaris-color-border);animation:solaris-drawer-in-left .16s ease}:host([data-side=bottom]) .solaris-drawer__panel{left:0;right:0;bottom:0;width:100%;height:var(--solaris-drawer-height, min(70vh, 40rem));border-left:none;border-right:none;border-top:1px solid var(--solaris-color-border);animation:solaris-drawer-in-bottom .16s ease}@keyframes solaris-drawer-in-right{0%{transform:translate(14px);opacity:.75}to{transform:translate(0);opacity:1}}@keyframes solaris-drawer-in-left{0%{transform:translate(-14px);opacity:.75}to{transform:translate(0);opacity:1}}@keyframes solaris-drawer-in-bottom{0%{transform:translateY(14px);opacity:.75}to{transform:translateY(0);opacity:1}}.solaris-drawer__header{width:100%;display:flex;align-items:center;justify-content:space-between;padding:var(--solaris-space-4);border-bottom:1px solid var(--solaris-color-border)}.solaris-drawer__title{font-size:var(--solaris-fs-14);color:var(--solaris-color-text)}.solaris-drawer__close{border:none;cursor:pointer;background:transparent;padding:var(--solaris-space-2);color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-sm)}.solaris-drawer__close:hover{background:var(--solaris-color-surface-2)}.solaris-drawer__content{overflow:auto;padding:var(--solaris-space-4)}.solaris-drawer__footer{padding:var(--solaris-space-4);border-top:1px solid var(--solaris-color-border)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1033
1612
|
}
|
|
1034
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
1613
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDrawer, decorators: [{
|
|
1035
1614
|
type: Component,
|
|
1036
|
-
args: [{ selector: 'solaris-
|
|
1037
|
-
|
|
1038
|
-
}, template: "<div class=\"solaris-page\" [ngClass]=\"['container-' + container]\">\r\n <header class=\"solaris-page__header\" [ngClass]=\"{ 'is-sticky': stickyHeader }\">\r\n <ng-content select=\"[solaris-header]\"></ng-content>\r\n @if (stickyHeader) { <solaris-divider class=\"solaris-page__header-divider\"/> }\r\n </header>\r\n\r\n <main class=\"solaris-page__body\">\r\n <ng-content select=\"[solaris-body]\"></ng-content>\r\n </main>\r\n\r\n <footer class=\"solaris-page__footer\">\r\n <solaris-divider class=\"solaris-page__footer-divider\"/>\r\n\r\n <div class=\"solaris-page__footer-content\">\r\n <ng-content select=\"[solaris-footer]\"></ng-content>\r\n </div>\r\n </footer>\r\n</div>\r\n", styles: [":host.solaris-page-host{display:block}.solaris-page{--solaris-page-gap: var(--solaris-space-8);--solaris-header-gap: var(--solaris-space-4);--solaris-footer-gap: var(--solaris-space-4);--solaris-page-padding-x: var(--solaris-space-8);--solaris-page-padding-y: var(--solaris-space-8);display:grid;min-height:100%;gap:var(--solaris-page-gap);color:var(--solaris-color-text);grid-template-rows:auto 1fr auto;padding:var(--solaris-page-padding-y) var(--solaris-page-padding-x)}.solaris-page.container-contained{margin-inline:auto}.solaris-page.container-fluid{max-width:none}.solaris-page__header{display:flex;flex-direction:column;gap:var(--solaris-header-gap)}.solaris-page__header.is-sticky{position:sticky;top:0;-webkit-backdrop-filter:blur(1rem);backdrop-filter:blur(1rem);z-index:var(--solaris-z-sticky, 100);padding:var(--solaris-page-padding-y) var(--solaris-page-padding-x) var(--solaris-space-4)}.solaris-page__body{min-width:0;display:flex;flex-direction:column;gap:var(--solaris-space-8)}.solaris-page__footer{display:flex;align-items:center;justify-content:space-between;gap:var(--solaris-footer-gap);padding-top:var(--solaris-space-4)}\n"] }]
|
|
1039
|
-
}], propDecorators: { stickyHeader: [{
|
|
1615
|
+
args: [{ selector: 'solaris-drawer', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'solaris-drawer-host' }, template: "@if (isOpen()) {\r\n @if (backdrop) {\r\n <div class=\"solaris-drawer__backdrop {{ backdropClass }}\" (click)=\"onBackdropClick()\" aria-hidden=\"true\"></div>\r\n }\r\n\r\n <aside #panelEl class=\"solaris-drawer__panel {{ panelClass }}\" role=\"dialog\" aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"showHeader ? titleId : null\" [style.--solaris-drawer-width]=\"width\"\r\n [style.--solaris-drawer-height]=\"height\" (keydown)=\"onPanelKeydown($event)\" tabindex=\"-1\">\r\n @if (showHeader) {\r\n <header class=\"solaris-drawer__header\">\r\n @if (hasCustomHeader) {\r\n <ng-content select=\"[solaris-drawer-header]\"></ng-content>\r\n } @else {\r\n <div class=\"solaris-drawer__title\" [id]=\"titleId\">{{ title }}</div>\r\n\r\n @if (showClose) {\r\n <button type=\"button\" class=\"solaris-drawer__close\" (click)=\"setOpen(false)\" aria-label=\"Close\">\r\n <i class=\"ph ph-x\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n }\r\n </header>\r\n }\r\n\r\n <div class=\"solaris-drawer__content\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n @if (hasCustomFooter) {\r\n <footer class=\"solaris-drawer__footer\">\r\n <ng-content select=\"[solaris-drawer-footer]\"></ng-content>\r\n </footer>\r\n }\r\n </aside>\r\n}\r\n", styles: [":host{display:contents}.solaris-drawer__backdrop{inset:0;position:fixed;background:#00000073;z-index:var(--solaris-z-fixed)}.solaris-drawer__panel{display:grid;outline:none;height:100vh;position:fixed;grid-template-rows:auto 1fr auto;box-shadow:var(--solaris-shadow-lg);background:var(--solaris-color-surface);z-index:calc(var(--solaris-z-fixed) + 1);border-left:1px solid var(--solaris-color-border);width:var(--solaris-drawer-width, min(26rem, 92vw))}:host([data-side=right]) .solaris-drawer__panel{top:0;right:0;animation:solaris-drawer-in-right .16s ease}:host([data-side=left]) .solaris-drawer__panel{top:0;left:0;border-left:none;border-right:1px solid var(--solaris-color-border);animation:solaris-drawer-in-left .16s ease}:host([data-side=bottom]) .solaris-drawer__panel{left:0;right:0;bottom:0;width:100%;height:var(--solaris-drawer-height, min(70vh, 40rem));border-left:none;border-right:none;border-top:1px solid var(--solaris-color-border);animation:solaris-drawer-in-bottom .16s ease}@keyframes solaris-drawer-in-right{0%{transform:translate(14px);opacity:.75}to{transform:translate(0);opacity:1}}@keyframes solaris-drawer-in-left{0%{transform:translate(-14px);opacity:.75}to{transform:translate(0);opacity:1}}@keyframes solaris-drawer-in-bottom{0%{transform:translateY(14px);opacity:.75}to{transform:translateY(0);opacity:1}}.solaris-drawer__header{width:100%;display:flex;align-items:center;justify-content:space-between;padding:var(--solaris-space-4);border-bottom:1px solid var(--solaris-color-border)}.solaris-drawer__title{font-size:var(--solaris-fs-14);color:var(--solaris-color-text)}.solaris-drawer__close{border:none;cursor:pointer;background:transparent;padding:var(--solaris-space-2);color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-sm)}.solaris-drawer__close:hover{background:var(--solaris-color-surface-2)}.solaris-drawer__content{overflow:auto;padding:var(--solaris-space-4)}.solaris-drawer__footer{padding:var(--solaris-space-4);border-top:1px solid var(--solaris-color-border)}\n"] }]
|
|
1616
|
+
}], ctorParameters: () => [], propDecorators: { title: [{
|
|
1040
1617
|
type: Input
|
|
1041
|
-
}],
|
|
1618
|
+
}], titleKey: [{
|
|
1619
|
+
type: Input
|
|
1620
|
+
}], panelClass: [{
|
|
1621
|
+
type: Input
|
|
1622
|
+
}], backdrop: [{
|
|
1623
|
+
type: Input
|
|
1624
|
+
}], showClose: [{
|
|
1625
|
+
type: Input
|
|
1626
|
+
}], trapFocus: [{
|
|
1627
|
+
type: Input
|
|
1628
|
+
}], backdropClass: [{
|
|
1629
|
+
type: Input
|
|
1630
|
+
}], showHeader: [{
|
|
1631
|
+
type: Input
|
|
1632
|
+
}], lockScroll: [{
|
|
1633
|
+
type: Input
|
|
1634
|
+
}], restoreFocus: [{
|
|
1635
|
+
type: Input
|
|
1636
|
+
}], closeOnEscape: [{
|
|
1637
|
+
type: Input
|
|
1638
|
+
}], width: [{
|
|
1639
|
+
type: Input
|
|
1640
|
+
}], side: [{
|
|
1641
|
+
type: Input
|
|
1642
|
+
}], height: [{
|
|
1042
1643
|
type: Input
|
|
1644
|
+
}], closeOnOutsideClick: [{
|
|
1645
|
+
type: Input
|
|
1646
|
+
}], open: [{
|
|
1647
|
+
type: Input
|
|
1648
|
+
}], openChange: [{
|
|
1649
|
+
type: Output
|
|
1650
|
+
}], headerSlot: [{
|
|
1651
|
+
type: ContentChild,
|
|
1652
|
+
args: [SolarisDrawerHeaderDirective]
|
|
1653
|
+
}], footerSlot: [{
|
|
1654
|
+
type: ContentChild,
|
|
1655
|
+
args: [SolarisDrawerFooterDirective]
|
|
1656
|
+
}], panelEl: [{
|
|
1657
|
+
type: ViewChild,
|
|
1658
|
+
args: ['panelEl', { read: ElementRef }]
|
|
1659
|
+
}], dataSide: [{
|
|
1660
|
+
type: HostBinding,
|
|
1661
|
+
args: ['attr.data-side']
|
|
1662
|
+
}], dataOpen: [{
|
|
1663
|
+
type: HostBinding,
|
|
1664
|
+
args: ['attr.data-open']
|
|
1043
1665
|
}] } });
|
|
1044
1666
|
|
|
1045
|
-
class
|
|
1046
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
1047
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type:
|
|
1667
|
+
class SolarisFilterPanelFooterDirective {
|
|
1668
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFilterPanelFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1669
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisFilterPanelFooterDirective, isStandalone: true, selector: "[solaris-filter-panel-footer]", ngImport: i0 });
|
|
1048
1670
|
}
|
|
1049
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
1671
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFilterPanelFooterDirective, decorators: [{
|
|
1050
1672
|
type: Directive,
|
|
1051
1673
|
args: [{
|
|
1052
|
-
selector: '[solaris-
|
|
1674
|
+
selector: '[solaris-filter-panel-footer]',
|
|
1053
1675
|
standalone: true,
|
|
1054
1676
|
}]
|
|
1055
1677
|
}] });
|
|
1056
1678
|
|
|
1057
|
-
class
|
|
1058
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
1679
|
+
class SolarisTableFilters {
|
|
1680
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisTableFilters, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1681
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.1", type: SolarisTableFilters, isStandalone: true, selector: "solaris-table-filters", host: { classAttribute: "solaris-table-filters" }, ngImport: i0, template: "<ng-content></ng-content>\r\n", styles: [":host{display:block;margin-bottom:var(--solaris-space-4)}:host ::ng-deep .solaris-table-filters__row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--solaris-space-3)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1682
|
+
}
|
|
1683
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisTableFilters, decorators: [{
|
|
1684
|
+
type: Component,
|
|
1685
|
+
args: [{ selector: 'solaris-table-filters', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'solaris-table-filters' }, template: "<ng-content></ng-content>\r\n", styles: [":host{display:block;margin-bottom:var(--solaris-space-4)}:host ::ng-deep .solaris-table-filters__row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--solaris-space-3)}\n"] }]
|
|
1686
|
+
}] });
|
|
1687
|
+
|
|
1688
|
+
class SolarisFilterField {
|
|
1689
|
+
label = '';
|
|
1690
|
+
labelKey = '';
|
|
1691
|
+
active = false;
|
|
1692
|
+
resetLabel = 'Reset';
|
|
1693
|
+
resetLabelKey = 'ui.solaris.common.reset';
|
|
1694
|
+
reset = new EventEmitter();
|
|
1695
|
+
get showReset() {
|
|
1696
|
+
return this.reset.observed;
|
|
1697
|
+
}
|
|
1698
|
+
onResetClick(ev) {
|
|
1699
|
+
ev.preventDefault();
|
|
1700
|
+
ev.stopPropagation();
|
|
1701
|
+
this.reset.emit();
|
|
1702
|
+
}
|
|
1703
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFilterField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1704
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisFilterField, isStandalone: true, selector: "solaris-filter-field", inputs: { label: "label", labelKey: "labelKey", active: "active", resetLabel: "resetLabel", resetLabelKey: "resetLabelKey" }, outputs: { reset: "reset" }, host: { classAttribute: "solaris-filter-field-host" }, ngImport: i0, template: "<div class=\"solaris-filter-field\">\r\n <div class=\"solaris-filter-field__head\">\r\n <span class=\"solaris-filter-field__label\">\r\n @if (labelKey) { {{ labelKey | translate }} } @else { {{ label }} }\r\n </span>\r\n\r\n @if (showReset) {\r\n <button type=\"button\" class=\"solaris-filter-field__reset\" (click)=\"onResetClick($event)\" [disabled]=\"!active\">\r\n @if (resetLabelKey) { {{ resetLabelKey | translate }} } @else { {{ resetLabel }} }\r\n </button>\r\n }\r\n </div>\r\n\r\n <div class=\"solaris-filter-field__body\">\r\n <ng-content></ng-content>\r\n </div>\r\n</div>\r\n", styles: [".solaris-filter-field{display:grid;gap:var(--solaris-space-2)}.solaris-filter-field__head{display:flex;align-items:center;gap:var(--solaris-space-3);justify-content:space-between}.solaris-filter-field__label{font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-filter-field__reset{border:none;cursor:pointer;font-weight:400;background:transparent;font-size:var(--solaris-fs-12);border-radius:var(--solaris-radius-sm);padding:var(--solaris-space-1) var(--solaris-space-2);color:color-mix(in srgb,var(--solaris-color-primary) 90%,transparent)}.solaris-filter-field__reset:hover:not(:disabled){background:color-mix(in srgb,var(--solaris-color-primary) 10%,transparent)}.solaris-filter-field__reset:disabled{opacity:.5;cursor:not-allowed;color:color-mix(in srgb,var(--solaris-color-text) 60%,transparent)}.solaris-filter-field__body{min-width:0}\n"], dependencies: [{ kind: "pipe", type: SolarisTranslationPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1705
|
+
}
|
|
1706
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFilterField, decorators: [{
|
|
1707
|
+
type: Component,
|
|
1708
|
+
args: [{ selector: 'solaris-filter-field', standalone: true, imports: [SolarisTranslationPipe], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'solaris-filter-field-host' }, template: "<div class=\"solaris-filter-field\">\r\n <div class=\"solaris-filter-field__head\">\r\n <span class=\"solaris-filter-field__label\">\r\n @if (labelKey) { {{ labelKey | translate }} } @else { {{ label }} }\r\n </span>\r\n\r\n @if (showReset) {\r\n <button type=\"button\" class=\"solaris-filter-field__reset\" (click)=\"onResetClick($event)\" [disabled]=\"!active\">\r\n @if (resetLabelKey) { {{ resetLabelKey | translate }} } @else { {{ resetLabel }} }\r\n </button>\r\n }\r\n </div>\r\n\r\n <div class=\"solaris-filter-field__body\">\r\n <ng-content></ng-content>\r\n </div>\r\n</div>\r\n", styles: [".solaris-filter-field{display:grid;gap:var(--solaris-space-2)}.solaris-filter-field__head{display:flex;align-items:center;gap:var(--solaris-space-3);justify-content:space-between}.solaris-filter-field__label{font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-filter-field__reset{border:none;cursor:pointer;font-weight:400;background:transparent;font-size:var(--solaris-fs-12);border-radius:var(--solaris-radius-sm);padding:var(--solaris-space-1) var(--solaris-space-2);color:color-mix(in srgb,var(--solaris-color-primary) 90%,transparent)}.solaris-filter-field__reset:hover:not(:disabled){background:color-mix(in srgb,var(--solaris-color-primary) 10%,transparent)}.solaris-filter-field__reset:disabled{opacity:.5;cursor:not-allowed;color:color-mix(in srgb,var(--solaris-color-text) 60%,transparent)}.solaris-filter-field__body{min-width:0}\n"] }]
|
|
1709
|
+
}], propDecorators: { label: [{
|
|
1710
|
+
type: Input
|
|
1711
|
+
}], labelKey: [{
|
|
1712
|
+
type: Input
|
|
1713
|
+
}], active: [{
|
|
1714
|
+
type: Input
|
|
1715
|
+
}], resetLabel: [{
|
|
1716
|
+
type: Input
|
|
1717
|
+
}], resetLabelKey: [{
|
|
1718
|
+
type: Input
|
|
1719
|
+
}], reset: [{
|
|
1720
|
+
type: Output
|
|
1721
|
+
}] } });
|
|
1722
|
+
|
|
1723
|
+
class SolarisFilterPanelChipsDirective {
|
|
1724
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFilterPanelChipsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1725
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisFilterPanelChipsDirective, isStandalone: true, selector: "[solaris-filter-panel-chips]", ngImport: i0 });
|
|
1726
|
+
}
|
|
1727
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFilterPanelChipsDirective, decorators: [{
|
|
1728
|
+
type: Directive,
|
|
1729
|
+
args: [{
|
|
1730
|
+
selector: '[solaris-filter-panel-chips]',
|
|
1731
|
+
standalone: true,
|
|
1732
|
+
}]
|
|
1733
|
+
}] });
|
|
1734
|
+
|
|
1735
|
+
const PRESET_COLORS$1 = new Set([
|
|
1736
|
+
'primary',
|
|
1737
|
+
'surface',
|
|
1738
|
+
'success',
|
|
1739
|
+
'warning',
|
|
1740
|
+
'error',
|
|
1741
|
+
'info',
|
|
1742
|
+
'gradient',
|
|
1743
|
+
]);
|
|
1744
|
+
function resolveRadius$1(v) {
|
|
1745
|
+
const s = String(v).trim();
|
|
1746
|
+
switch (s) {
|
|
1747
|
+
case 'none':
|
|
1748
|
+
return '0';
|
|
1749
|
+
case 'sm':
|
|
1750
|
+
return 'var(--solaris-radius-sm)';
|
|
1751
|
+
case 'md':
|
|
1752
|
+
return 'var(--solaris-radius-md, var(--solaris-radius-sm))';
|
|
1753
|
+
case 'lg':
|
|
1754
|
+
return 'var(--solaris-radius-lg, var(--solaris-radius-md, var(--solaris-radius-sm)))';
|
|
1755
|
+
case 'full':
|
|
1756
|
+
return 'var(--solaris-radius-full)';
|
|
1757
|
+
default:
|
|
1758
|
+
return s;
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
class ButtonDirective {
|
|
1762
|
+
elementRef = inject((ElementRef));
|
|
1763
|
+
_loading = signal(false, ...(ngDevMode ? [{ debugName: "_loading" }] : []));
|
|
1764
|
+
_disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
1765
|
+
_iconOnly = signal(false, ...(ngDevMode ? [{ debugName: "_iconOnly" }] : []));
|
|
1766
|
+
_fullWidth = signal(false, ...(ngDevMode ? [{ debugName: "_fullWidth" }] : []));
|
|
1767
|
+
_badgeOverlay = signal(false, ...(ngDevMode ? [{ debugName: "_badgeOverlay" }] : []));
|
|
1768
|
+
_textColor = signal(null, ...(ngDevMode ? [{ debugName: "_textColor" }] : []));
|
|
1769
|
+
_customColor = signal(null, ...(ngDevMode ? [{ debugName: "_customColor" }] : []));
|
|
1770
|
+
_size = signal('md', ...(ngDevMode ? [{ debugName: "_size" }] : []));
|
|
1771
|
+
_variant = signal('solid', ...(ngDevMode ? [{ debugName: "_variant" }] : []));
|
|
1772
|
+
_radius = signal(null, ...(ngDevMode ? [{ debugName: "_radius" }] : []));
|
|
1773
|
+
_color = signal('primary', ...(ngDevMode ? [{ debugName: "_color" }] : []));
|
|
1774
|
+
isAnchor = computed(() => this.elementRef.nativeElement.tagName.toLowerCase() === 'a', ...(ngDevMode ? [{ debugName: "isAnchor" }] : []));
|
|
1775
|
+
set size(v) {
|
|
1776
|
+
if (v)
|
|
1777
|
+
this._size.set(v);
|
|
1778
|
+
}
|
|
1779
|
+
set variant(v) {
|
|
1780
|
+
if (v)
|
|
1781
|
+
this._variant.set(v);
|
|
1782
|
+
}
|
|
1783
|
+
set color(v) {
|
|
1784
|
+
if (v == null || String(v).trim() === '')
|
|
1785
|
+
return;
|
|
1786
|
+
const value = String(v).trim();
|
|
1787
|
+
if (PRESET_COLORS$1.has(value)) {
|
|
1788
|
+
this._color.set(value);
|
|
1789
|
+
this._customColor.set(null);
|
|
1790
|
+
}
|
|
1791
|
+
else {
|
|
1792
|
+
this._color.set('custom');
|
|
1793
|
+
this._customColor.set(value);
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
set textColor(v) {
|
|
1797
|
+
const value = v == null || String(v).trim() === '' ? null : String(v).trim();
|
|
1798
|
+
this._textColor.set(value);
|
|
1799
|
+
}
|
|
1800
|
+
set radius(v) {
|
|
1801
|
+
const value = v == null || String(v).trim() === '' ? null : (v);
|
|
1802
|
+
this._radius.set(value);
|
|
1803
|
+
}
|
|
1804
|
+
set loading(v) {
|
|
1805
|
+
this._loading.set(v);
|
|
1806
|
+
}
|
|
1807
|
+
set iconOnly(v) {
|
|
1808
|
+
this._iconOnly.set(v);
|
|
1809
|
+
}
|
|
1810
|
+
set disabled(v) {
|
|
1811
|
+
this._disabled.set(v);
|
|
1812
|
+
}
|
|
1813
|
+
set fullWidth(v) {
|
|
1814
|
+
this._fullWidth.set(v);
|
|
1815
|
+
}
|
|
1816
|
+
set badgeOverlay(v) {
|
|
1817
|
+
this._badgeOverlay.set(v);
|
|
1818
|
+
}
|
|
1819
|
+
attr = '';
|
|
1820
|
+
get tabIndex() {
|
|
1821
|
+
return this.isAnchor() && (this._disabled() || this._loading()) ? -1 : null;
|
|
1822
|
+
}
|
|
1823
|
+
get ariaBusy() {
|
|
1824
|
+
return this._loading() ? 'true' : null;
|
|
1825
|
+
}
|
|
1826
|
+
get dataSize() {
|
|
1827
|
+
return this._size();
|
|
1828
|
+
}
|
|
1829
|
+
get dataColor() {
|
|
1830
|
+
return this._color();
|
|
1831
|
+
}
|
|
1832
|
+
get nativeDisabled() {
|
|
1833
|
+
const isButton = !this.isAnchor();
|
|
1834
|
+
return isButton && (this._disabled() || this._loading()) ? '' : null;
|
|
1835
|
+
}
|
|
1836
|
+
get dataVariant() {
|
|
1837
|
+
return this._variant();
|
|
1838
|
+
}
|
|
1839
|
+
get ariaDisabled() {
|
|
1840
|
+
return this.isAnchor() && (this._disabled() || this._loading()) ? 'true' : null;
|
|
1841
|
+
}
|
|
1842
|
+
get dataIconOnly() {
|
|
1843
|
+
return this._iconOnly() ? 'true' : null;
|
|
1844
|
+
}
|
|
1845
|
+
get dataFullWidth() {
|
|
1846
|
+
return this._fullWidth() ? 'true' : null;
|
|
1847
|
+
}
|
|
1848
|
+
get customColorValue() {
|
|
1849
|
+
return this._customColor() ?? null;
|
|
1850
|
+
}
|
|
1851
|
+
get dataCustomInk() {
|
|
1852
|
+
return this._textColor() ? 'true' : null;
|
|
1853
|
+
}
|
|
1854
|
+
get customInkValue() {
|
|
1855
|
+
return this._textColor() ?? null;
|
|
1856
|
+
}
|
|
1857
|
+
get dataBadgeOverlay() {
|
|
1858
|
+
return this._badgeOverlay() ? 'true' : null;
|
|
1859
|
+
}
|
|
1860
|
+
get buttonRadius() {
|
|
1861
|
+
return this._radius() ? resolveRadius$1(this._radius()) : null;
|
|
1862
|
+
}
|
|
1863
|
+
onClick(ev) {
|
|
1864
|
+
if (!this.isAnchor())
|
|
1865
|
+
return;
|
|
1866
|
+
if (this._disabled() || this._loading()) {
|
|
1867
|
+
ev.preventDefault();
|
|
1868
|
+
ev.stopImmediatePropagation();
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1872
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "21.1.1", type: ButtonDirective, isStandalone: true, selector: "button[solaris-button], a[solaris-button]", inputs: { size: "size", variant: "variant", color: "color", textColor: "textColor", radius: "radius", loading: ["loading", "loading", booleanAttribute], iconOnly: ["iconOnly", "iconOnly", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute], fullWidth: ["fullWidth", "fullWidth", booleanAttribute], badgeOverlay: ["badgeOverlay", "badgeOverlay", booleanAttribute] }, host: { listeners: { "click": "onClick($event)" }, properties: { "attr.solaris-button": "this.attr", "attr.tabindex": "this.tabIndex", "attr.aria-busy": "this.ariaBusy", "attr.data-size": "this.dataSize", "attr.data-color": "this.dataColor", "attr.disabled": "this.nativeDisabled", "attr.data-variant": "this.dataVariant", "attr.aria-disabled": "this.ariaDisabled", "attr.data-icon-only": "this.dataIconOnly", "attr.data-full-width": "this.dataFullWidth", "style.--sb-custom": "this.customColorValue", "attr.data-custom-ink": "this.dataCustomInk", "style.--sb-custom-ink": "this.customInkValue", "attr.data-badge-overlay": "this.dataBadgeOverlay", "style.--solaris-button-radius": "this.buttonRadius" } }, ngImport: i0 });
|
|
1873
|
+
}
|
|
1874
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ButtonDirective, decorators: [{
|
|
1875
|
+
type: Directive,
|
|
1876
|
+
args: [{
|
|
1877
|
+
selector: 'button[solaris-button], a[solaris-button]',
|
|
1878
|
+
standalone: true,
|
|
1879
|
+
}]
|
|
1880
|
+
}], propDecorators: { size: [{
|
|
1881
|
+
type: Input
|
|
1882
|
+
}], variant: [{
|
|
1883
|
+
type: Input
|
|
1884
|
+
}], color: [{
|
|
1885
|
+
type: Input
|
|
1886
|
+
}], textColor: [{
|
|
1887
|
+
type: Input
|
|
1888
|
+
}], radius: [{
|
|
1889
|
+
type: Input
|
|
1890
|
+
}], loading: [{
|
|
1891
|
+
type: Input,
|
|
1892
|
+
args: [{ transform: booleanAttribute }]
|
|
1893
|
+
}], iconOnly: [{
|
|
1894
|
+
type: Input,
|
|
1895
|
+
args: [{ transform: booleanAttribute }]
|
|
1896
|
+
}], disabled: [{
|
|
1897
|
+
type: Input,
|
|
1898
|
+
args: [{ transform: booleanAttribute }]
|
|
1899
|
+
}], fullWidth: [{
|
|
1900
|
+
type: Input,
|
|
1901
|
+
args: [{ transform: booleanAttribute }]
|
|
1902
|
+
}], badgeOverlay: [{
|
|
1903
|
+
type: Input,
|
|
1904
|
+
args: [{ transform: booleanAttribute }]
|
|
1905
|
+
}], attr: [{
|
|
1906
|
+
type: HostBinding,
|
|
1907
|
+
args: ['attr.solaris-button']
|
|
1908
|
+
}], tabIndex: [{
|
|
1909
|
+
type: HostBinding,
|
|
1910
|
+
args: ['attr.tabindex']
|
|
1911
|
+
}], ariaBusy: [{
|
|
1912
|
+
type: HostBinding,
|
|
1913
|
+
args: ['attr.aria-busy']
|
|
1914
|
+
}], dataSize: [{
|
|
1915
|
+
type: HostBinding,
|
|
1916
|
+
args: ['attr.data-size']
|
|
1917
|
+
}], dataColor: [{
|
|
1918
|
+
type: HostBinding,
|
|
1919
|
+
args: ['attr.data-color']
|
|
1920
|
+
}], nativeDisabled: [{
|
|
1921
|
+
type: HostBinding,
|
|
1922
|
+
args: ['attr.disabled']
|
|
1923
|
+
}], dataVariant: [{
|
|
1924
|
+
type: HostBinding,
|
|
1925
|
+
args: ['attr.data-variant']
|
|
1926
|
+
}], ariaDisabled: [{
|
|
1927
|
+
type: HostBinding,
|
|
1928
|
+
args: ['attr.aria-disabled']
|
|
1929
|
+
}], dataIconOnly: [{
|
|
1930
|
+
type: HostBinding,
|
|
1931
|
+
args: ['attr.data-icon-only']
|
|
1932
|
+
}], dataFullWidth: [{
|
|
1933
|
+
type: HostBinding,
|
|
1934
|
+
args: ['attr.data-full-width']
|
|
1935
|
+
}], customColorValue: [{
|
|
1936
|
+
type: HostBinding,
|
|
1937
|
+
args: ['style.--sb-custom']
|
|
1938
|
+
}], dataCustomInk: [{
|
|
1939
|
+
type: HostBinding,
|
|
1940
|
+
args: ['attr.data-custom-ink']
|
|
1941
|
+
}], customInkValue: [{
|
|
1942
|
+
type: HostBinding,
|
|
1943
|
+
args: ['style.--sb-custom-ink']
|
|
1944
|
+
}], dataBadgeOverlay: [{
|
|
1945
|
+
type: HostBinding,
|
|
1946
|
+
args: ['attr.data-badge-overlay']
|
|
1947
|
+
}], buttonRadius: [{
|
|
1948
|
+
type: HostBinding,
|
|
1949
|
+
args: ['style.--solaris-button-radius']
|
|
1950
|
+
}], onClick: [{
|
|
1951
|
+
type: HostListener,
|
|
1952
|
+
args: ['click', ['$event']]
|
|
1953
|
+
}] } });
|
|
1954
|
+
|
|
1955
|
+
class SolarisFilterPanel {
|
|
1956
|
+
count = 0;
|
|
1957
|
+
labelKey = '';
|
|
1958
|
+
titleKey = '';
|
|
1959
|
+
disabled = false;
|
|
1960
|
+
drawerSide = 'right';
|
|
1961
|
+
radius = 'sm';
|
|
1962
|
+
drawerWidth = 'min(30rem, 92vw)';
|
|
1963
|
+
label = 'ui.solaris.tables.filter.filters';
|
|
1964
|
+
title = 'ui.solaris.tables.filter.filters';
|
|
1965
|
+
_internalOpen = signal(false, ...(ngDevMode ? [{ debugName: "_internalOpen" }] : []));
|
|
1966
|
+
_openInput = signal(null, ...(ngDevMode ? [{ debugName: "_openInput" }] : []));
|
|
1967
|
+
_chipsSlot = signal(null, ...(ngDevMode ? [{ debugName: "_chipsSlot" }] : []));
|
|
1968
|
+
set open(v) { this._openInput.set(v); }
|
|
1969
|
+
get open() { return this._openInput(); }
|
|
1970
|
+
isOpen = computed(() => {
|
|
1971
|
+
const v = this._openInput();
|
|
1972
|
+
return typeof v === 'boolean' ? v : this._internalOpen();
|
|
1973
|
+
}, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
1974
|
+
apply = new EventEmitter();
|
|
1975
|
+
clearAll = new EventEmitter();
|
|
1976
|
+
openChange = new EventEmitter();
|
|
1977
|
+
footerSlot;
|
|
1978
|
+
set chipsSlot(v) {
|
|
1979
|
+
this._chipsSlot.set(v ?? null);
|
|
1980
|
+
}
|
|
1981
|
+
hasChips = computed(() => !!this._chipsSlot(), ...(ngDevMode ? [{ debugName: "hasChips" }] : []));
|
|
1982
|
+
get hasCustomFooter() { return !!this.footerSlot; }
|
|
1983
|
+
setOpen(next) {
|
|
1984
|
+
if (this.disabled)
|
|
1985
|
+
return;
|
|
1986
|
+
if (next === this.isOpen())
|
|
1987
|
+
return;
|
|
1988
|
+
this.openChange.emit(next);
|
|
1989
|
+
if (typeof this._openInput() !== 'boolean')
|
|
1990
|
+
this._internalOpen.set(next);
|
|
1991
|
+
}
|
|
1992
|
+
toggle() {
|
|
1993
|
+
this.setOpen(!this.isOpen());
|
|
1994
|
+
}
|
|
1995
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFilterPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1996
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisFilterPanel, isStandalone: true, selector: "solaris-filter-panel", inputs: { count: "count", labelKey: "labelKey", titleKey: "titleKey", disabled: "disabled", drawerSide: "drawerSide", radius: "radius", drawerWidth: "drawerWidth", label: "label", title: "title", open: "open" }, outputs: { apply: "apply", clearAll: "clearAll", openChange: "openChange" }, host: { classAttribute: "solaris-filter-panel-host" }, queries: [{ propertyName: "footerSlot", first: true, predicate: SolarisFilterPanelFooterDirective, descendants: true }, { propertyName: "chipsSlot", first: true, predicate: SolarisFilterPanelChipsDirective, descendants: true }], ngImport: i0, template: "<button type=\"button\" class=\"solaris-filter-panel__trigger\" [disabled]=\"disabled\" (click)=\"toggle()\"\r\n [attr.data-radius]=\"radius\">\r\n <i class=\"ph ph-sliders-horizontal\"></i>\r\n\r\n @if (labelKey) { {{ labelKey | translate }} } @else { {{ label | translate }} }\r\n\r\n @if (count > 0) {\r\n <span class=\"solaris-filter-panel__count\">{{ count }}</span>\r\n }\r\n</button>\r\n\r\n<solaris-drawer [open]=\"isOpen()\" (openChange)=\"setOpen($event)\" [side]=\"drawerSide\" [width]=\"drawerWidth\"\r\n [backdrop]=\"true\" [closeOnEscape]=\"true\" [closeOnOutsideClick]=\"true\" [lockScroll]=\"true\"\r\n [restoreFocus]=\"true\" [trapFocus]=\"true\" panelClass=\"solaris-filter-panel__drawer\">\r\n <div solaris-drawer-header class=\"solaris-filter-panel__header\">\r\n <div class=\"solaris-filter-panel__title\">\r\n @if (titleKey) { {{ titleKey | translate }} } @else { {{ title | translate }} }\r\n </div>\r\n\r\n <button type=\"button\" class=\"solaris-filter-panel__close\" (click)=\"setOpen(false)\">\r\n <i class=\"ph ph-x\"></i>\r\n </button>\r\n </div>\r\n\r\n @if (hasChips()) {\r\n <div class=\"solaris-filter-panel__chips\">\r\n <ng-content select=\"[solarisFilterPanelChips]\"></ng-content>\r\n </div>\r\n }\r\n\r\n <div class=\"solaris-filter-panel__content\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <footer solaris-drawer-footer class=\"solaris-filter-panel__footer\">\r\n <ng-content select=\"[solarisFilterPanelFooter]\"></ng-content>\r\n\r\n @if (!hasCustomFooter) {\r\n <div class=\"solaris-filter-panel__footer-default\">\r\n <button solaris-button color=\"surface\" variant=\"outline\" type=\"button\" (click)=\"clearAll.emit()\">\r\n {{ 'ui.solaris.common.clearAll' | translate }}\r\n </button>\r\n\r\n <button solaris-button type=\"button\" (click)=\"apply.emit()\">\r\n {{ 'ui.solaris.common.apply' | translate }}\r\n </button>\r\n </div>\r\n }\r\n </footer>\r\n</solaris-drawer>\r\n", styles: [".solaris-filter-panel__trigger{--solaris-filter-panel-radius: var(--solaris-radius-sm);cursor:pointer;align-items:center;display:inline-flex;padding:.55rem .9rem;gap:var(--solaris-space-2);color:var(--solaris-color-text);background:var(--solaris-color-surface);border:1px solid var(--solaris-color-border);height:var(--solaris-filter-bar-height, 3.8rem);border-radius:var(--solaris-filter-panel-radius)}.solaris-filter-panel__trigger[data-radius=sm]{--solaris-filter-panel-radius: var(--solaris-radius-sm)}.solaris-filter-panel__trigger[data-radius=md]{--solaris-filter-panel-radius: var(--solaris-radius-md)}.solaris-filter-panel__trigger[data-radius=full]{--solaris-filter-panel-radius: var(--solaris-radius-full)}.solaris-filter-panel__trigger:disabled{opacity:.55;cursor:not-allowed}.solaris-filter-panel__count{padding:.1rem .5rem;font-size:var(--solaris-fs-12);margin-left:var(--solaris-space-1);color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-full);background:var(--solaris-color-surface-2);border:1px solid var(--solaris-color-border)}:host ::ng-deep .solaris-filter-panel__drawer{width:min(30rem,92vw)}.solaris-filter-panel__header{width:100%;display:flex;align-items:center;justify-content:space-between;padding:var(--solaris-space-4)}.solaris-filter-panel__title{font-size:var(--solaris-fs-14);color:var(--solaris-color-text)}.solaris-filter-panel__close{border:none;cursor:pointer;background:transparent;padding:var(--solaris-space-2);color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-sm)}.solaris-filter-panel__close:hover{background:var(--solaris-color-surface-2)}.solaris-filter-panel__chips{display:flex;flex-wrap:wrap;gap:var(--solaris-space-2);border-bottom:1px solid var(--solaris-color-border);padding:var(--solaris-space-3) var(--solaris-space-4)}.solaris-filter-panel__content{min-height:0;overflow:auto;display:grid;align-content:flex-start;gap:var(--solaris-space-8);padding:var(--solaris-space-4)}.solaris-filter-panel__footer-default{display:grid;gap:var(--solaris-space-3);grid-template-columns:1fr 1fr}.solaris-filter-panel__footer-default button{font-weight:400;font-size:var(--solaris-fs-14)}\n"], dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[solaris-button], a[solaris-button]", inputs: ["size", "variant", "color", "textColor", "radius", "loading", "iconOnly", "disabled", "fullWidth", "badgeOverlay"] }, { kind: "directive", type: SolarisDrawerHeaderDirective, selector: "[solaris-drawer-header]" }, { kind: "directive", type: SolarisDrawerFooterDirective, selector: "[solaris-drawer-footer]" }, { kind: "component", type: SolarisDrawer, selector: "solaris-drawer", inputs: ["title", "titleKey", "panelClass", "backdrop", "showClose", "trapFocus", "backdropClass", "showHeader", "lockScroll", "restoreFocus", "closeOnEscape", "width", "side", "height", "closeOnOutsideClick", "open"], outputs: ["openChange"] }, { kind: "pipe", type: SolarisTranslationPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1997
|
+
}
|
|
1998
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFilterPanel, decorators: [{
|
|
1999
|
+
type: Component,
|
|
2000
|
+
args: [{ selector: 'solaris-filter-panel', standalone: true, imports: [
|
|
2001
|
+
SolarisTranslationPipe,
|
|
2002
|
+
ButtonDirective,
|
|
2003
|
+
SolarisDrawerHeaderDirective,
|
|
2004
|
+
SolarisDrawerFooterDirective,
|
|
2005
|
+
SolarisDrawer
|
|
2006
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'solaris-filter-panel-host' }, template: "<button type=\"button\" class=\"solaris-filter-panel__trigger\" [disabled]=\"disabled\" (click)=\"toggle()\"\r\n [attr.data-radius]=\"radius\">\r\n <i class=\"ph ph-sliders-horizontal\"></i>\r\n\r\n @if (labelKey) { {{ labelKey | translate }} } @else { {{ label | translate }} }\r\n\r\n @if (count > 0) {\r\n <span class=\"solaris-filter-panel__count\">{{ count }}</span>\r\n }\r\n</button>\r\n\r\n<solaris-drawer [open]=\"isOpen()\" (openChange)=\"setOpen($event)\" [side]=\"drawerSide\" [width]=\"drawerWidth\"\r\n [backdrop]=\"true\" [closeOnEscape]=\"true\" [closeOnOutsideClick]=\"true\" [lockScroll]=\"true\"\r\n [restoreFocus]=\"true\" [trapFocus]=\"true\" panelClass=\"solaris-filter-panel__drawer\">\r\n <div solaris-drawer-header class=\"solaris-filter-panel__header\">\r\n <div class=\"solaris-filter-panel__title\">\r\n @if (titleKey) { {{ titleKey | translate }} } @else { {{ title | translate }} }\r\n </div>\r\n\r\n <button type=\"button\" class=\"solaris-filter-panel__close\" (click)=\"setOpen(false)\">\r\n <i class=\"ph ph-x\"></i>\r\n </button>\r\n </div>\r\n\r\n @if (hasChips()) {\r\n <div class=\"solaris-filter-panel__chips\">\r\n <ng-content select=\"[solarisFilterPanelChips]\"></ng-content>\r\n </div>\r\n }\r\n\r\n <div class=\"solaris-filter-panel__content\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <footer solaris-drawer-footer class=\"solaris-filter-panel__footer\">\r\n <ng-content select=\"[solarisFilterPanelFooter]\"></ng-content>\r\n\r\n @if (!hasCustomFooter) {\r\n <div class=\"solaris-filter-panel__footer-default\">\r\n <button solaris-button color=\"surface\" variant=\"outline\" type=\"button\" (click)=\"clearAll.emit()\">\r\n {{ 'ui.solaris.common.clearAll' | translate }}\r\n </button>\r\n\r\n <button solaris-button type=\"button\" (click)=\"apply.emit()\">\r\n {{ 'ui.solaris.common.apply' | translate }}\r\n </button>\r\n </div>\r\n }\r\n </footer>\r\n</solaris-drawer>\r\n", styles: [".solaris-filter-panel__trigger{--solaris-filter-panel-radius: var(--solaris-radius-sm);cursor:pointer;align-items:center;display:inline-flex;padding:.55rem .9rem;gap:var(--solaris-space-2);color:var(--solaris-color-text);background:var(--solaris-color-surface);border:1px solid var(--solaris-color-border);height:var(--solaris-filter-bar-height, 3.8rem);border-radius:var(--solaris-filter-panel-radius)}.solaris-filter-panel__trigger[data-radius=sm]{--solaris-filter-panel-radius: var(--solaris-radius-sm)}.solaris-filter-panel__trigger[data-radius=md]{--solaris-filter-panel-radius: var(--solaris-radius-md)}.solaris-filter-panel__trigger[data-radius=full]{--solaris-filter-panel-radius: var(--solaris-radius-full)}.solaris-filter-panel__trigger:disabled{opacity:.55;cursor:not-allowed}.solaris-filter-panel__count{padding:.1rem .5rem;font-size:var(--solaris-fs-12);margin-left:var(--solaris-space-1);color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-full);background:var(--solaris-color-surface-2);border:1px solid var(--solaris-color-border)}:host ::ng-deep .solaris-filter-panel__drawer{width:min(30rem,92vw)}.solaris-filter-panel__header{width:100%;display:flex;align-items:center;justify-content:space-between;padding:var(--solaris-space-4)}.solaris-filter-panel__title{font-size:var(--solaris-fs-14);color:var(--solaris-color-text)}.solaris-filter-panel__close{border:none;cursor:pointer;background:transparent;padding:var(--solaris-space-2);color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-sm)}.solaris-filter-panel__close:hover{background:var(--solaris-color-surface-2)}.solaris-filter-panel__chips{display:flex;flex-wrap:wrap;gap:var(--solaris-space-2);border-bottom:1px solid var(--solaris-color-border);padding:var(--solaris-space-3) var(--solaris-space-4)}.solaris-filter-panel__content{min-height:0;overflow:auto;display:grid;align-content:flex-start;gap:var(--solaris-space-8);padding:var(--solaris-space-4)}.solaris-filter-panel__footer-default{display:grid;gap:var(--solaris-space-3);grid-template-columns:1fr 1fr}.solaris-filter-panel__footer-default button{font-weight:400;font-size:var(--solaris-fs-14)}\n"] }]
|
|
2007
|
+
}], propDecorators: { count: [{
|
|
2008
|
+
type: Input
|
|
2009
|
+
}], labelKey: [{
|
|
2010
|
+
type: Input
|
|
2011
|
+
}], titleKey: [{
|
|
2012
|
+
type: Input
|
|
2013
|
+
}], disabled: [{
|
|
2014
|
+
type: Input
|
|
2015
|
+
}], drawerSide: [{
|
|
2016
|
+
type: Input
|
|
2017
|
+
}], radius: [{
|
|
2018
|
+
type: Input
|
|
2019
|
+
}], drawerWidth: [{
|
|
2020
|
+
type: Input
|
|
2021
|
+
}], label: [{
|
|
2022
|
+
type: Input
|
|
2023
|
+
}], title: [{
|
|
2024
|
+
type: Input
|
|
2025
|
+
}], open: [{
|
|
2026
|
+
type: Input
|
|
2027
|
+
}], apply: [{
|
|
2028
|
+
type: Output
|
|
2029
|
+
}], clearAll: [{
|
|
2030
|
+
type: Output
|
|
2031
|
+
}], openChange: [{
|
|
2032
|
+
type: Output
|
|
2033
|
+
}], footerSlot: [{
|
|
2034
|
+
type: ContentChild,
|
|
2035
|
+
args: [SolarisFilterPanelFooterDirective]
|
|
2036
|
+
}], chipsSlot: [{
|
|
2037
|
+
type: ContentChild,
|
|
2038
|
+
args: [SolarisFilterPanelChipsDirective]
|
|
2039
|
+
}] } });
|
|
2040
|
+
|
|
2041
|
+
class SolarisFilterChip {
|
|
2042
|
+
label = '';
|
|
2043
|
+
value = '';
|
|
2044
|
+
labelKey = '';
|
|
2045
|
+
valueKey = '';
|
|
2046
|
+
disabled = false;
|
|
2047
|
+
removable = true;
|
|
2048
|
+
radius = 'md';
|
|
2049
|
+
remove = new EventEmitter();
|
|
2050
|
+
chipClick = new EventEmitter();
|
|
2051
|
+
onRemoveClick(ev) {
|
|
2052
|
+
ev.preventDefault();
|
|
2053
|
+
ev.stopPropagation();
|
|
2054
|
+
if (!this.disabled)
|
|
2055
|
+
this.remove.emit();
|
|
2056
|
+
}
|
|
2057
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFilterChip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2058
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisFilterChip, isStandalone: true, selector: "solaris-filter-chip", inputs: { label: "label", value: "value", labelKey: "labelKey", valueKey: "valueKey", disabled: "disabled", removable: "removable", radius: "radius" }, outputs: { remove: "remove", chipClick: "chipClick" }, host: { classAttribute: "solaris-filter-chip-host" }, ngImport: i0, template: "<button type=\"button\" class=\"solaris-filter-chip\" [disabled]=\"disabled\"\r\n (click)=\"chipClick.emit()\" [attr.data-radius]=\"radius\">\r\n <span class=\"solaris-filter-chip__label\">\r\n @if (labelKey) { {{ labelKey | translate }} } @else { {{ label }} }\r\n </span>\r\n\r\n <span class=\"solaris-filter-chip__value\">\r\n @if (valueKey) { {{ valueKey | translate }} } @else { {{ value }} }\r\n </span>\r\n\r\n @if (removable) {\r\n <span class=\"solaris-filter-chip__remove\"\r\n role=\"button\"\r\n tabindex=\"-1\"\r\n (click)=\"onRemoveClick($event)\">\r\n <i class=\"ph ph-x\" aria-hidden=\"true\"></i>\r\n </span>\r\n }\r\n</button>\r\n", styles: [".solaris-filter-chip{--solaris-filter-chip-radius: var(--solaris-radius-sm);max-width:100%;cursor:pointer;align-items:center;display:inline-flex;gap:var(--solaris-space-2);color:var(--solaris-color-text);padding:0 var(--solaris-space-3);background:var(--solaris-color-surface);border:1px solid var(--solaris-color-border);border-radius:var(--solaris-filter-chip-radius);height:var(--solaris-filter-bar-height, 3.8rem)}.solaris-filter-chip[data-radius=none]{--solaris-filter-chip-radius: var(--solaris-radius-none)}.solaris-filter-chip[data-radius=xs]{--solaris-filter-chip-radius: var(--solaris-radius-xs)}.solaris-filter-chip[data-radius=sm]{--solaris-filter-chip-radius: var(--solaris-radius-sm)}.solaris-filter-chip[data-radius=md]{--solaris-filter-chip-radius: var(--solaris-radius-md)}.solaris-filter-chip[data-radius=lg]{--solaris-filter-chip-radius: var(--solaris-radius-lg)}.solaris-filter-chip[data-radius=full]{--solaris-filter-chip-radius: var(--solaris-radius-full)}.solaris-filter-chip:disabled{opacity:.55;cursor:not-allowed}.solaris-filter-chip__label{white-space:nowrap;font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-filter-chip__value{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--solaris-fs-14)}.solaris-filter-chip__remove{align-items:center;display:inline-flex;justify-content:center;color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-full);width:calc(var(--solaris-filter-bar-height, 3.8rem) - 1.2rem);height:calc(var(--solaris-filter-bar-height, 3.8rem) - 1.2rem)}.solaris-filter-chip:hover .solaris-filter-chip__remove{color:var(--solaris-color-text);background:var(--solaris-color-surface-2)}\n"], dependencies: [{ kind: "pipe", type: SolarisTranslationPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2059
|
+
}
|
|
2060
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFilterChip, decorators: [{
|
|
2061
|
+
type: Component,
|
|
2062
|
+
args: [{ selector: 'solaris-filter-chip', standalone: true, imports: [
|
|
2063
|
+
SolarisTranslationPipe
|
|
2064
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'solaris-filter-chip-host' }, template: "<button type=\"button\" class=\"solaris-filter-chip\" [disabled]=\"disabled\"\r\n (click)=\"chipClick.emit()\" [attr.data-radius]=\"radius\">\r\n <span class=\"solaris-filter-chip__label\">\r\n @if (labelKey) { {{ labelKey | translate }} } @else { {{ label }} }\r\n </span>\r\n\r\n <span class=\"solaris-filter-chip__value\">\r\n @if (valueKey) { {{ valueKey | translate }} } @else { {{ value }} }\r\n </span>\r\n\r\n @if (removable) {\r\n <span class=\"solaris-filter-chip__remove\"\r\n role=\"button\"\r\n tabindex=\"-1\"\r\n (click)=\"onRemoveClick($event)\">\r\n <i class=\"ph ph-x\" aria-hidden=\"true\"></i>\r\n </span>\r\n }\r\n</button>\r\n", styles: [".solaris-filter-chip{--solaris-filter-chip-radius: var(--solaris-radius-sm);max-width:100%;cursor:pointer;align-items:center;display:inline-flex;gap:var(--solaris-space-2);color:var(--solaris-color-text);padding:0 var(--solaris-space-3);background:var(--solaris-color-surface);border:1px solid var(--solaris-color-border);border-radius:var(--solaris-filter-chip-radius);height:var(--solaris-filter-bar-height, 3.8rem)}.solaris-filter-chip[data-radius=none]{--solaris-filter-chip-radius: var(--solaris-radius-none)}.solaris-filter-chip[data-radius=xs]{--solaris-filter-chip-radius: var(--solaris-radius-xs)}.solaris-filter-chip[data-radius=sm]{--solaris-filter-chip-radius: var(--solaris-radius-sm)}.solaris-filter-chip[data-radius=md]{--solaris-filter-chip-radius: var(--solaris-radius-md)}.solaris-filter-chip[data-radius=lg]{--solaris-filter-chip-radius: var(--solaris-radius-lg)}.solaris-filter-chip[data-radius=full]{--solaris-filter-chip-radius: var(--solaris-radius-full)}.solaris-filter-chip:disabled{opacity:.55;cursor:not-allowed}.solaris-filter-chip__label{white-space:nowrap;font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-filter-chip__value{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--solaris-fs-14)}.solaris-filter-chip__remove{align-items:center;display:inline-flex;justify-content:center;color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-full);width:calc(var(--solaris-filter-bar-height, 3.8rem) - 1.2rem);height:calc(var(--solaris-filter-bar-height, 3.8rem) - 1.2rem)}.solaris-filter-chip:hover .solaris-filter-chip__remove{color:var(--solaris-color-text);background:var(--solaris-color-surface-2)}\n"] }]
|
|
2065
|
+
}], propDecorators: { label: [{
|
|
2066
|
+
type: Input
|
|
2067
|
+
}], value: [{
|
|
2068
|
+
type: Input
|
|
2069
|
+
}], labelKey: [{
|
|
2070
|
+
type: Input
|
|
2071
|
+
}], valueKey: [{
|
|
2072
|
+
type: Input
|
|
2073
|
+
}], disabled: [{
|
|
2074
|
+
type: Input
|
|
2075
|
+
}], removable: [{
|
|
2076
|
+
type: Input
|
|
2077
|
+
}], radius: [{
|
|
2078
|
+
type: Input
|
|
2079
|
+
}], remove: [{
|
|
2080
|
+
type: Output
|
|
2081
|
+
}], chipClick: [{
|
|
2082
|
+
type: Output
|
|
2083
|
+
}] } });
|
|
2084
|
+
|
|
2085
|
+
class SolarisTableSkeleton {
|
|
2086
|
+
rows = 10;
|
|
2087
|
+
columns = 6;
|
|
2088
|
+
selectable = false;
|
|
2089
|
+
gridTemplateColumns = '';
|
|
2090
|
+
rowsArray() { return Array.from({ length: this.rows }, (_, i) => i); }
|
|
2091
|
+
colsArray() { return Array.from({ length: this.columns }, (_, i) => i); }
|
|
2092
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisTableSkeleton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2093
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisTableSkeleton, isStandalone: true, selector: "solaris-table-skeleton", inputs: { rows: "rows", columns: "columns", selectable: "selectable", gridTemplateColumns: "gridTemplateColumns" }, ngImport: i0, template: "<div class=\"solaris-table-skeleton\" role=\"status\" aria-live=\"polite\">\r\n @for (r of rowsArray(); track r) {\r\n <div class=\"solaris-table-skeleton__row\" [style.gridTemplateColumns]=\"gridTemplateColumns\">\r\n\r\n @for (c of colsArray(); track c; let i = $index) {\r\n <div class=\"solaris-table-skeleton__cell\" [class.is-first]=\"i === 0\">\r\n @if (selectable && i === 0) {\r\n <span class=\"solaris-table-skeleton__select-prefix\">\r\n <span class=\"sk sk--circle\"></span>\r\n </span>\r\n }\r\n\r\n <span class=\"sk sk--line\"></span>\r\n </div>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".solaris-table-skeleton__row{display:grid;border-bottom:1px solid var(--solaris-color-border)}.solaris-table-skeleton__cell{min-width:0;display:flex;align-items:center;gap:var(--solaris-space-3);padding:var(--solaris-space-4)}.solaris-table-skeleton__select-prefix{flex:0 0 auto;align-items:center;display:inline-flex}.sk{display:block;animation:shimmer 1.1s linear infinite;border-radius:var(--solaris-radius-sm);background:linear-gradient(90deg,var(--solaris-color-surface-2),var(--solaris-color-surface),rgba(255,255,255,.06));background-size:200% 100%}.sk--line{height:1rem;width:100%}.sk--circle{height:1.1rem;width:1.1rem;border-radius:9999rem}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}\n"] });
|
|
2094
|
+
}
|
|
2095
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisTableSkeleton, decorators: [{
|
|
2096
|
+
type: Component,
|
|
2097
|
+
args: [{ selector: 'solaris-table-skeleton', standalone: true, template: "<div class=\"solaris-table-skeleton\" role=\"status\" aria-live=\"polite\">\r\n @for (r of rowsArray(); track r) {\r\n <div class=\"solaris-table-skeleton__row\" [style.gridTemplateColumns]=\"gridTemplateColumns\">\r\n\r\n @for (c of colsArray(); track c; let i = $index) {\r\n <div class=\"solaris-table-skeleton__cell\" [class.is-first]=\"i === 0\">\r\n @if (selectable && i === 0) {\r\n <span class=\"solaris-table-skeleton__select-prefix\">\r\n <span class=\"sk sk--circle\"></span>\r\n </span>\r\n }\r\n\r\n <span class=\"sk sk--line\"></span>\r\n </div>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".solaris-table-skeleton__row{display:grid;border-bottom:1px solid var(--solaris-color-border)}.solaris-table-skeleton__cell{min-width:0;display:flex;align-items:center;gap:var(--solaris-space-3);padding:var(--solaris-space-4)}.solaris-table-skeleton__select-prefix{flex:0 0 auto;align-items:center;display:inline-flex}.sk{display:block;animation:shimmer 1.1s linear infinite;border-radius:var(--solaris-radius-sm);background:linear-gradient(90deg,var(--solaris-color-surface-2),var(--solaris-color-surface),rgba(255,255,255,.06));background-size:200% 100%}.sk--line{height:1rem;width:100%}.sk--circle{height:1.1rem;width:1.1rem;border-radius:9999rem}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}\n"] }]
|
|
2098
|
+
}], propDecorators: { rows: [{
|
|
2099
|
+
type: Input
|
|
2100
|
+
}], columns: [{
|
|
2101
|
+
type: Input
|
|
2102
|
+
}], selectable: [{
|
|
2103
|
+
type: Input
|
|
2104
|
+
}], gridTemplateColumns: [{
|
|
2105
|
+
type: Input
|
|
2106
|
+
}] } });
|
|
2107
|
+
|
|
2108
|
+
class SolarisFilterBar {
|
|
2109
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFilterBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2110
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.1", type: SolarisFilterBar, isStandalone: true, selector: "solaris-filter-bar", host: { classAttribute: "solaris-filter-bar" }, ngImport: i0, template: "<ng-content></ng-content>\r\n", styles: [":host{--solaris-filter-bar-height: 3.8rem;display:flex;flex-wrap:wrap;align-items:center;gap:var(--solaris-space-3);min-height:var(--solaris-filter-bar-height)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2111
|
+
}
|
|
2112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFilterBar, decorators: [{
|
|
2113
|
+
type: Component,
|
|
2114
|
+
args: [{ selector: 'solaris-filter-bar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'solaris-filter-bar' }, template: "<ng-content></ng-content>\r\n", styles: [":host{--solaris-filter-bar-height: 3.8rem;display:flex;flex-wrap:wrap;align-items:center;gap:var(--solaris-space-3);min-height:var(--solaris-filter-bar-height)}\n"] }]
|
|
2115
|
+
}] });
|
|
2116
|
+
|
|
2117
|
+
class SolarisColumnCellDef {
|
|
2118
|
+
template;
|
|
2119
|
+
constructor(template) {
|
|
2120
|
+
this.template = template;
|
|
2121
|
+
}
|
|
2122
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisColumnCellDef, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2123
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisColumnCellDef, isStandalone: true, selector: "ng-template[solaris-column-cell]", ngImport: i0 });
|
|
2124
|
+
}
|
|
2125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisColumnCellDef, decorators: [{
|
|
2126
|
+
type: Directive,
|
|
2127
|
+
args: [{
|
|
2128
|
+
selector: 'ng-template[solaris-column-cell]',
|
|
2129
|
+
standalone: true,
|
|
2130
|
+
}]
|
|
2131
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
2132
|
+
class SolarisColumnHeaderDef {
|
|
2133
|
+
template;
|
|
2134
|
+
constructor(template) {
|
|
2135
|
+
this.template = template;
|
|
2136
|
+
}
|
|
2137
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisColumnHeaderDef, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2138
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisColumnHeaderDef, isStandalone: true, selector: "ng-template[solaris-column-header]", ngImport: i0 });
|
|
2139
|
+
}
|
|
2140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisColumnHeaderDef, decorators: [{
|
|
2141
|
+
type: Directive,
|
|
2142
|
+
args: [{
|
|
2143
|
+
selector: 'ng-template[solaris-column-header]',
|
|
2144
|
+
standalone: true,
|
|
2145
|
+
}]
|
|
2146
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
|
|
2147
|
+
|
|
2148
|
+
class SolarisIdGenerator {
|
|
2149
|
+
counters = new Map();
|
|
2150
|
+
next(prefix = 'solaris') {
|
|
2151
|
+
const current = this.counters.get(prefix) ?? 0;
|
|
2152
|
+
const next = current + 1;
|
|
2153
|
+
this.counters.set(prefix, next);
|
|
2154
|
+
return `${prefix}-${next}`;
|
|
2155
|
+
}
|
|
2156
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisIdGenerator, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2157
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisIdGenerator, providedIn: 'root' });
|
|
2158
|
+
}
|
|
2159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisIdGenerator, decorators: [{
|
|
2160
|
+
type: Injectable,
|
|
2161
|
+
args: [{ providedIn: 'root' }]
|
|
2162
|
+
}] });
|
|
2163
|
+
|
|
2164
|
+
class SolarisTableColumn {
|
|
2165
|
+
ids = inject(SolarisIdGenerator);
|
|
2166
|
+
id = this.ids.next('solaris-column');
|
|
2167
|
+
field;
|
|
2168
|
+
width;
|
|
2169
|
+
header;
|
|
2170
|
+
sortKey;
|
|
2171
|
+
minWidth;
|
|
2172
|
+
maxWidth;
|
|
2173
|
+
headerKey;
|
|
2174
|
+
headerIconClass;
|
|
2175
|
+
align = 'start';
|
|
2176
|
+
grow = false;
|
|
2177
|
+
resizable = true;
|
|
2178
|
+
sortable = false;
|
|
2179
|
+
cellDef;
|
|
2180
|
+
headerDef;
|
|
2181
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisTableColumn, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2182
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "21.1.1", type: SolarisTableColumn, isStandalone: true, selector: "solaris-column", inputs: { field: "field", width: "width", header: "header", sortKey: "sortKey", minWidth: "minWidth", maxWidth: "maxWidth", headerKey: "headerKey", headerIconClass: "headerIconClass", align: "align", grow: ["grow", "grow", booleanAttribute], resizable: ["resizable", "resizable", booleanAttribute], sortable: ["sortable", "sortable", booleanAttribute] }, queries: [{ propertyName: "cellDef", first: true, predicate: SolarisColumnCellDef, descendants: true }, { propertyName: "headerDef", first: true, predicate: SolarisColumnHeaderDef, descendants: true }], ngImport: i0, template: "", styles: [""] });
|
|
2183
|
+
}
|
|
2184
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisTableColumn, decorators: [{
|
|
2185
|
+
type: Component,
|
|
2186
|
+
args: [{ selector: 'solaris-column', standalone: true, template: "" }]
|
|
2187
|
+
}], propDecorators: { field: [{
|
|
2188
|
+
type: Input
|
|
2189
|
+
}], width: [{
|
|
2190
|
+
type: Input
|
|
2191
|
+
}], header: [{
|
|
2192
|
+
type: Input
|
|
2193
|
+
}], sortKey: [{
|
|
2194
|
+
type: Input
|
|
2195
|
+
}], minWidth: [{
|
|
2196
|
+
type: Input
|
|
2197
|
+
}], maxWidth: [{
|
|
2198
|
+
type: Input
|
|
2199
|
+
}], headerKey: [{
|
|
2200
|
+
type: Input
|
|
2201
|
+
}], headerIconClass: [{
|
|
2202
|
+
type: Input
|
|
2203
|
+
}], align: [{
|
|
2204
|
+
type: Input
|
|
2205
|
+
}], grow: [{
|
|
2206
|
+
type: Input,
|
|
2207
|
+
args: [{ transform: booleanAttribute }]
|
|
2208
|
+
}], resizable: [{
|
|
2209
|
+
type: Input,
|
|
2210
|
+
args: [{ transform: booleanAttribute }]
|
|
2211
|
+
}], sortable: [{
|
|
2212
|
+
type: Input,
|
|
2213
|
+
args: [{ transform: booleanAttribute }]
|
|
2214
|
+
}], cellDef: [{
|
|
2215
|
+
type: ContentChild,
|
|
2216
|
+
args: [SolarisColumnCellDef]
|
|
2217
|
+
}], headerDef: [{
|
|
2218
|
+
type: ContentChild,
|
|
2219
|
+
args: [SolarisColumnHeaderDef]
|
|
2220
|
+
}] } });
|
|
2221
|
+
|
|
2222
|
+
function uniqueId(prefix) {
|
|
2223
|
+
return inject(SolarisIdGenerator).next(prefix);
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
const PRESET_COLORS = new Set(['primary', 'success', 'warning', 'error', 'info']);
|
|
2227
|
+
class SolarisCheckbox {
|
|
2228
|
+
indeterminate = input(false, ...(ngDevMode ? [{ debugName: "indeterminate" }] : []));
|
|
2229
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
2230
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
2231
|
+
variant = input('square', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
2232
|
+
color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
2233
|
+
inputId = input(null, { ...(ngDevMode ? { debugName: "inputId" } : {}), alias: 'id' });
|
|
2234
|
+
appearance = input('solid', ...(ngDevMode ? [{ debugName: "appearance" }] : []));
|
|
2235
|
+
checkColor = input(null, ...(ngDevMode ? [{ debugName: "checkColor" }] : []));
|
|
2236
|
+
checked = signal(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
2237
|
+
disabled = signal(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
2238
|
+
checkedChange = output();
|
|
2239
|
+
indeterminateChange = output();
|
|
2240
|
+
native;
|
|
2241
|
+
customAccent = computed(() => {
|
|
2242
|
+
if (this.colorKey() !== 'custom')
|
|
2243
|
+
return null;
|
|
2244
|
+
const raw = String(this.color() ?? '').trim();
|
|
2245
|
+
return !raw || raw === 'custom' ? null : raw;
|
|
2246
|
+
}, ...(ngDevMode ? [{ debugName: "customAccent" }] : []));
|
|
2247
|
+
colorKey = computed(() => {
|
|
2248
|
+
const raw = String(this.color() ?? '').trim();
|
|
2249
|
+
if (!raw || raw === 'custom')
|
|
2250
|
+
return 'custom';
|
|
2251
|
+
return PRESET_COLORS.has(raw) ? raw : 'custom';
|
|
2252
|
+
}, ...(ngDevMode ? [{ debugName: "colorKey" }] : []));
|
|
2253
|
+
autoId = uniqueId('solaris-checkbox');
|
|
2254
|
+
id = computed(() => this.inputId() ?? this.autoId, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
2255
|
+
ink = computed(() => resolveColor(this.checkColor(), null), ...(ngDevMode ? [{ debugName: "ink" }] : []));
|
|
2256
|
+
onChange = () => { };
|
|
2257
|
+
onTouched = () => { };
|
|
2258
|
+
constructor() {
|
|
2259
|
+
effect(() => {
|
|
2260
|
+
const el = this.native?.nativeElement;
|
|
2261
|
+
if (!el)
|
|
2262
|
+
return;
|
|
2263
|
+
el.indeterminate = this.indeterminate();
|
|
2264
|
+
});
|
|
2265
|
+
}
|
|
2266
|
+
onNativeChange(next) {
|
|
2267
|
+
if (this.indeterminate())
|
|
2268
|
+
this.indeterminateChange.emit(false);
|
|
2269
|
+
this.checked.set(next);
|
|
2270
|
+
this.onChange(next);
|
|
2271
|
+
this.checkedChange.emit(next);
|
|
2272
|
+
this.onTouched();
|
|
2273
|
+
}
|
|
2274
|
+
onBlur() {
|
|
2275
|
+
this.onTouched();
|
|
2276
|
+
}
|
|
2277
|
+
writeValue(value) {
|
|
2278
|
+
this.checked.set(!!value);
|
|
2279
|
+
}
|
|
2280
|
+
registerOnTouched(fn) {
|
|
2281
|
+
this.onTouched = fn;
|
|
2282
|
+
}
|
|
2283
|
+
setDisabledState(isDisabled) {
|
|
2284
|
+
this.disabled.set(isDisabled);
|
|
2285
|
+
}
|
|
2286
|
+
registerOnChange(fn) {
|
|
2287
|
+
this.onChange = fn;
|
|
2288
|
+
}
|
|
2289
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2290
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisCheckbox, isStandalone: true, selector: "solaris-checkbox", inputs: { indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, checkColor: { classPropertyName: "checkColor", publicName: "checkColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange", indeterminateChange: "indeterminateChange" }, host: { properties: { "attr.data-size": "size()", "attr.data-color": "colorKey()", "attr.data-variant": "variant()", "attr.data-appearance": "appearance()", "style.--solaris-checkbox-ink": "ink()", "attr.data-disabled": "disabled() ? \"true\" : null", "style.--solaris-checkbox-custom": "customAccent()" }, classAttribute: "solaris-checkbox-host" }, providers: [
|
|
2291
|
+
{
|
|
2292
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2293
|
+
useExisting: forwardRef(() => SolarisCheckbox),
|
|
2294
|
+
multi: true,
|
|
2295
|
+
},
|
|
2296
|
+
], viewQueries: [{ propertyName: "native", first: true, predicate: ["native"], descendants: true, static: true }], ngImport: i0, template: "<label class=\"solaris-checkbox\">\r\n <input #native class=\"solaris-checkbox__native\" type=\"checkbox\" [attr.id]=\"id()\"\r\n [checked]=\"checked()\" [disabled]=\"disabled()\" [attr.aria-label]=\"ariaLabel() ?? null\"\r\n [attr.aria-checked]=\"indeterminate() ? 'mixed' : (checked() ? 'true' : 'false')\"\r\n (change)=\"onNativeChange(native.checked)\" (blur)=\"onBlur()\"/>\r\n\r\n <span class=\"solaris-checkbox__control\" aria-hidden=\"true\">\r\n @if (variant() === 'icon') {\r\n <span class=\"solaris-checkbox__dot\" aria-hidden=\"true\"></span>\r\n } @else {\r\n <i class=\"ph solaris-checkbox__icon\" [class.ph-check]=\"!indeterminate()\"\r\n [class.ph-minus]=\"indeterminate()\" aria-hidden=\"true\"></i>\r\n }\r\n </span>\r\n\r\n @if (variant() !== 'icon') {\r\n <span class=\"solaris-checkbox__content\"><ng-content/></span>\r\n }\r\n</label>\r\n", styles: [":host{--_hit: 2.4rem;--_size: 2rem;--_icon: 1.6rem;--_icon-ring: .5rem;--_text: var(--solaris-color-text);--_radius: var(--solaris-radius-sm);--_border: var(--solaris-color-border);--_muted: var(--solaris-color-text-muted);--solaris-checkbox-border: var(--_border);--solaris-checkbox-accent: var(--solaris-color-primary);--solaris-checkbox-on-accent: var(--solaris-color-primary-contrast, #fff)}:host([data-size=sm]){--_size: 1.8rem;--_icon: 1.4rem}:host([data-size=md]){--_size: 2rem;--_icon: 1.6rem}:host([data-size=lg]){--_size: 2.4rem;--_icon: 1.8rem}:host([data-variant=round]),:host([data-variant=icon]){--_radius: var(--solaris-radius-full)}:host([data-color=primary]){--solaris-checkbox-accent: var(--solaris-color-primary)}:host([data-color=success]){--solaris-checkbox-accent: var(--solaris-color-success)}:host([data-color=warning]){--solaris-checkbox-accent: var(--solaris-color-warning)}:host([data-color=error]){--solaris-checkbox-accent: var(--solaris-color-error)}:host([data-color=info]){--solaris-checkbox-accent: var(--solaris-color-info)}:host([data-color=custom]){--solaris-checkbox-accent: var(--solaris-checkbox-custom, var(--solaris-color-primary))}.solaris-checkbox{gap:.8rem;cursor:pointer;-webkit-user-select:none;user-select:none;color:var(--_text);display:inline-flex;align-items:flex-start}.solaris-checkbox__native{opacity:0;width:1px;height:1px;position:absolute;pointer-events:none}.solaris-checkbox__control{line-height:0;flex:0 0 auto;color:transparent;align-items:center;display:inline-flex;box-sizing:border-box;justify-content:center;border-radius:var(--_radius);background-color:transparent;width:max(var(--_size),var(--_size));height:max(var(--_size),var(--_size));border:.1rem solid var(--solaris-checkbox-border)}.solaris-checkbox__content{gap:.2rem;line-height:1.3;display:inline-flex;flex-direction:column}.solaris-checkbox__icon{opacity:0;line-height:1;display:block;font-weight:bolder;pointer-events:none;font-size:var(--_icon)}.solaris-checkbox__native:checked+.solaris-checkbox__control .solaris-checkbox__icon,.solaris-checkbox__native:indeterminate+.solaris-checkbox__control .solaris-checkbox__icon{opacity:1}.solaris-checkbox__native:checked+.solaris-checkbox__control,.solaris-checkbox__native:indeterminate+.solaris-checkbox__control{border-color:var(--solaris-checkbox-accent)}:host([data-color=primary]) .solaris-checkbox__native:checked+.solaris-checkbox__control,:host([data-color=primary]) .solaris-checkbox__native:indeterminate+.solaris-checkbox__control{border-color:var(--solaris-color-primary-tint)}:host([data-appearance=outline]) .solaris-checkbox__native:checked+.solaris-checkbox__control,:host([data-appearance=outline]) .solaris-checkbox__native:indeterminate+.solaris-checkbox__control{background-color:transparent;color:var(--solaris-checkbox-ink, var(--solaris-checkbox-accent))}:host([data-appearance=solid]) .solaris-checkbox__native:checked+.solaris-checkbox__control,:host([data-appearance=solid]) .solaris-checkbox__native:indeterminate+.solaris-checkbox__control{background-color:var(--solaris-checkbox-accent);color:var(--solaris-checkbox-ink, var(--solaris-checkbox-on-accent))}:host([data-variant=icon]) .solaris-checkbox__control{padding:var(--_icon-ring);background-clip:content-box}.solaris-checkbox__native:focus-visible+.solaris-checkbox__control{outline-offset:.2rem;outline:.2rem solid var(--solaris-checkbox-accent)}:host([data-disabled=true]) .solaris-checkbox{opacity:.55;cursor:not-allowed}:host([data-disabled=true]) .solaris-checkbox__control{border-color:color-mix(in srgb,var(--_border) 70%,transparent)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2297
|
+
}
|
|
2298
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCheckbox, decorators: [{
|
|
2299
|
+
type: Component,
|
|
2300
|
+
args: [{ selector: 'solaris-checkbox', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2301
|
+
{
|
|
2302
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2303
|
+
useExisting: forwardRef(() => SolarisCheckbox),
|
|
2304
|
+
multi: true,
|
|
2305
|
+
},
|
|
2306
|
+
], host: {
|
|
2307
|
+
class: 'solaris-checkbox-host',
|
|
2308
|
+
'[attr.data-size]': 'size()',
|
|
2309
|
+
'[attr.data-color]': 'colorKey()',
|
|
2310
|
+
'[attr.data-variant]': 'variant()',
|
|
2311
|
+
'[attr.data-appearance]': 'appearance()',
|
|
2312
|
+
'[style.--solaris-checkbox-ink]': 'ink()',
|
|
2313
|
+
'[attr.data-disabled]': 'disabled() ? "true" : null',
|
|
2314
|
+
'[style.--solaris-checkbox-custom]': 'customAccent()',
|
|
2315
|
+
}, template: "<label class=\"solaris-checkbox\">\r\n <input #native class=\"solaris-checkbox__native\" type=\"checkbox\" [attr.id]=\"id()\"\r\n [checked]=\"checked()\" [disabled]=\"disabled()\" [attr.aria-label]=\"ariaLabel() ?? null\"\r\n [attr.aria-checked]=\"indeterminate() ? 'mixed' : (checked() ? 'true' : 'false')\"\r\n (change)=\"onNativeChange(native.checked)\" (blur)=\"onBlur()\"/>\r\n\r\n <span class=\"solaris-checkbox__control\" aria-hidden=\"true\">\r\n @if (variant() === 'icon') {\r\n <span class=\"solaris-checkbox__dot\" aria-hidden=\"true\"></span>\r\n } @else {\r\n <i class=\"ph solaris-checkbox__icon\" [class.ph-check]=\"!indeterminate()\"\r\n [class.ph-minus]=\"indeterminate()\" aria-hidden=\"true\"></i>\r\n }\r\n </span>\r\n\r\n @if (variant() !== 'icon') {\r\n <span class=\"solaris-checkbox__content\"><ng-content/></span>\r\n }\r\n</label>\r\n", styles: [":host{--_hit: 2.4rem;--_size: 2rem;--_icon: 1.6rem;--_icon-ring: .5rem;--_text: var(--solaris-color-text);--_radius: var(--solaris-radius-sm);--_border: var(--solaris-color-border);--_muted: var(--solaris-color-text-muted);--solaris-checkbox-border: var(--_border);--solaris-checkbox-accent: var(--solaris-color-primary);--solaris-checkbox-on-accent: var(--solaris-color-primary-contrast, #fff)}:host([data-size=sm]){--_size: 1.8rem;--_icon: 1.4rem}:host([data-size=md]){--_size: 2rem;--_icon: 1.6rem}:host([data-size=lg]){--_size: 2.4rem;--_icon: 1.8rem}:host([data-variant=round]),:host([data-variant=icon]){--_radius: var(--solaris-radius-full)}:host([data-color=primary]){--solaris-checkbox-accent: var(--solaris-color-primary)}:host([data-color=success]){--solaris-checkbox-accent: var(--solaris-color-success)}:host([data-color=warning]){--solaris-checkbox-accent: var(--solaris-color-warning)}:host([data-color=error]){--solaris-checkbox-accent: var(--solaris-color-error)}:host([data-color=info]){--solaris-checkbox-accent: var(--solaris-color-info)}:host([data-color=custom]){--solaris-checkbox-accent: var(--solaris-checkbox-custom, var(--solaris-color-primary))}.solaris-checkbox{gap:.8rem;cursor:pointer;-webkit-user-select:none;user-select:none;color:var(--_text);display:inline-flex;align-items:flex-start}.solaris-checkbox__native{opacity:0;width:1px;height:1px;position:absolute;pointer-events:none}.solaris-checkbox__control{line-height:0;flex:0 0 auto;color:transparent;align-items:center;display:inline-flex;box-sizing:border-box;justify-content:center;border-radius:var(--_radius);background-color:transparent;width:max(var(--_size),var(--_size));height:max(var(--_size),var(--_size));border:.1rem solid var(--solaris-checkbox-border)}.solaris-checkbox__content{gap:.2rem;line-height:1.3;display:inline-flex;flex-direction:column}.solaris-checkbox__icon{opacity:0;line-height:1;display:block;font-weight:bolder;pointer-events:none;font-size:var(--_icon)}.solaris-checkbox__native:checked+.solaris-checkbox__control .solaris-checkbox__icon,.solaris-checkbox__native:indeterminate+.solaris-checkbox__control .solaris-checkbox__icon{opacity:1}.solaris-checkbox__native:checked+.solaris-checkbox__control,.solaris-checkbox__native:indeterminate+.solaris-checkbox__control{border-color:var(--solaris-checkbox-accent)}:host([data-color=primary]) .solaris-checkbox__native:checked+.solaris-checkbox__control,:host([data-color=primary]) .solaris-checkbox__native:indeterminate+.solaris-checkbox__control{border-color:var(--solaris-color-primary-tint)}:host([data-appearance=outline]) .solaris-checkbox__native:checked+.solaris-checkbox__control,:host([data-appearance=outline]) .solaris-checkbox__native:indeterminate+.solaris-checkbox__control{background-color:transparent;color:var(--solaris-checkbox-ink, var(--solaris-checkbox-accent))}:host([data-appearance=solid]) .solaris-checkbox__native:checked+.solaris-checkbox__control,:host([data-appearance=solid]) .solaris-checkbox__native:indeterminate+.solaris-checkbox__control{background-color:var(--solaris-checkbox-accent);color:var(--solaris-checkbox-ink, var(--solaris-checkbox-on-accent))}:host([data-variant=icon]) .solaris-checkbox__control{padding:var(--_icon-ring);background-clip:content-box}.solaris-checkbox__native:focus-visible+.solaris-checkbox__control{outline-offset:.2rem;outline:.2rem solid var(--solaris-checkbox-accent)}:host([data-disabled=true]) .solaris-checkbox{opacity:.55;cursor:not-allowed}:host([data-disabled=true]) .solaris-checkbox__control{border-color:color-mix(in srgb,var(--_border) 70%,transparent)}\n"] }]
|
|
2316
|
+
}], ctorParameters: () => [], propDecorators: { indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], checkColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkColor", required: false }] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }], indeterminateChange: [{ type: i0.Output, args: ["indeterminateChange"] }], native: [{
|
|
2317
|
+
type: ViewChild,
|
|
2318
|
+
args: ['native', { static: true }]
|
|
2319
|
+
}] } });
|
|
2320
|
+
function resolveColor(v, fallback) {
|
|
2321
|
+
const s = v == null ? '' : String(v).trim();
|
|
2322
|
+
if (!s || s === 'custom')
|
|
2323
|
+
return fallback;
|
|
2324
|
+
if (PRESET_COLORS.has(s))
|
|
2325
|
+
return `var(--solaris-color-${s})`;
|
|
2326
|
+
return s;
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
class SolarisTable {
|
|
2330
|
+
destroyRef = inject(DestroyRef);
|
|
2331
|
+
length = 0;
|
|
2332
|
+
pageIndex = 0;
|
|
2333
|
+
pageSize = 10;
|
|
2334
|
+
rowsCount = 0;
|
|
2335
|
+
loading = false;
|
|
2336
|
+
sort = [];
|
|
2337
|
+
selectable = false;
|
|
2338
|
+
tableDescription = '';
|
|
2339
|
+
selection = [];
|
|
2340
|
+
variant = 'grid';
|
|
2341
|
+
emptyIconClass = 'ph ph-database';
|
|
2342
|
+
pageSizeOptions = [10, 20, 50];
|
|
2343
|
+
emptyTextKey = 'ui.solaris.table.empty';
|
|
2344
|
+
sortChange = new EventEmitter();
|
|
2345
|
+
pageChange = new EventEmitter();
|
|
2346
|
+
selectionChange = new EventEmitter();
|
|
2347
|
+
columnQuery;
|
|
2348
|
+
tableRoot;
|
|
2349
|
+
needsScroll = signal(false, ...(ngDevMode ? [{ debugName: "needsScroll" }] : []));
|
|
2350
|
+
measuredReady = signal(false, ...(ngDevMode ? [{ debugName: "measuredReady" }] : []));
|
|
2351
|
+
sortState = signal([], ...(ngDevMode ? [{ debugName: "sortState" }] : []));
|
|
2352
|
+
measuredPx = signal([], ...(ngDevMode ? [{ debugName: "measuredPx" }] : []));
|
|
2353
|
+
columns = signal([], ...(ngDevMode ? [{ debugName: "columns" }] : []));
|
|
2354
|
+
selectionSig = signal([], ...(ngDevMode ? [{ debugName: "selectionSig" }] : []));
|
|
2355
|
+
rowKeys = signal(new Set(), ...(ngDevMode ? [{ debugName: "rowKeys" }] : []));
|
|
2356
|
+
manualPx = signal({}, ...(ngDevMode ? [{ debugName: "manualPx" }] : []));
|
|
2357
|
+
selectionSetSig = computed(() => new Set(this.selectionSig()), ...(ngDevMode ? [{ debugName: "selectionSetSig" }] : []));
|
|
2358
|
+
selectAllChecked = computed(() => {
|
|
2359
|
+
const keys = Array.from(this.rowKeys());
|
|
2360
|
+
if (!keys.length)
|
|
2361
|
+
return false;
|
|
2362
|
+
const sel = this.selectionSetSig();
|
|
2363
|
+
return keys.every(k => sel.has(k));
|
|
2364
|
+
}, ...(ngDevMode ? [{ debugName: "selectAllChecked" }] : []));
|
|
2365
|
+
selectAllIndeterminate = computed(() => {
|
|
2366
|
+
const keys = Array.from(this.rowKeys());
|
|
2367
|
+
if (!keys.length)
|
|
2368
|
+
return false;
|
|
2369
|
+
const sel = this.selectionSetSig();
|
|
2370
|
+
const any = keys.some(k => sel.has(k));
|
|
2371
|
+
return any && !this.selectAllChecked();
|
|
2372
|
+
}, ...(ngDevMode ? [{ debugName: "selectAllIndeterminate" }] : []));
|
|
2373
|
+
selectedCount = computed(() => this.selectionSig().length, ...(ngDevMode ? [{ debugName: "selectedCount" }] : []));
|
|
2374
|
+
gridTemplateColumns = computed(() => this.buildGridTemplateColumns(), ...(ngDevMode ? [{ debugName: "gridTemplateColumns" }] : []));
|
|
2375
|
+
rafId = null;
|
|
2376
|
+
resizeObserver;
|
|
2377
|
+
get rangeStart() {
|
|
2378
|
+
if (!this.length)
|
|
2379
|
+
return 0;
|
|
2380
|
+
return this.pageIndex * this.pageSize + 1;
|
|
2381
|
+
}
|
|
2382
|
+
get rangeEnd() {
|
|
2383
|
+
if (!this.length)
|
|
2384
|
+
return 0;
|
|
2385
|
+
return Math.min(this.length, (this.pageIndex + 1) * this.pageSize);
|
|
2386
|
+
}
|
|
2387
|
+
get totalPages() {
|
|
2388
|
+
return Math.max(1, Math.ceil((this.length || 0) / (this.pageSize || 1)));
|
|
2389
|
+
}
|
|
2390
|
+
ngAfterContentInit() {
|
|
2391
|
+
this.syncColumns();
|
|
2392
|
+
this.selectionSig.set(this.selection ?? []);
|
|
2393
|
+
this.sortState.set(this.sort ?? []);
|
|
2394
|
+
this.columnQuery.changes.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
2395
|
+
this.syncColumns();
|
|
2396
|
+
this.scheduleMeasure();
|
|
2397
|
+
});
|
|
2398
|
+
this.resizeObserver = new ResizeObserver(() => this.scheduleMeasure());
|
|
2399
|
+
this.resizeObserver.observe(this.tableRoot.nativeElement);
|
|
2400
|
+
this.destroyRef.onDestroy(() => this.resizeObserver?.disconnect());
|
|
2401
|
+
const fonts = document.fonts;
|
|
2402
|
+
if (fonts?.ready?.then)
|
|
2403
|
+
fonts.ready.then(() => this.scheduleMeasure());
|
|
2404
|
+
this.scheduleMeasure();
|
|
2405
|
+
}
|
|
2406
|
+
ngOnChanges(changes) {
|
|
2407
|
+
if (changes['sort'])
|
|
2408
|
+
this.sortState.set(this.sort ?? []);
|
|
2409
|
+
if (changes['selection'])
|
|
2410
|
+
this.selectionSig.set(this.selection ?? []);
|
|
2411
|
+
if (changes['variant'] || changes['rowsCount'] || changes['pageIndex'] || changes['pageSize'] || changes['loading']) {
|
|
2412
|
+
this.scheduleMeasure();
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
syncColumns() {
|
|
2416
|
+
this.columns.set(this.columnQuery?.toArray() ?? []);
|
|
2417
|
+
}
|
|
2418
|
+
scheduleMeasure() {
|
|
2419
|
+
if (this.loading)
|
|
2420
|
+
return;
|
|
2421
|
+
if (this.rafId != null)
|
|
2422
|
+
cancelAnimationFrame(this.rafId);
|
|
2423
|
+
this.rafId = requestAnimationFrame(() => {
|
|
2424
|
+
this.rafId = null;
|
|
2425
|
+
this.measureColumns();
|
|
2426
|
+
});
|
|
2427
|
+
}
|
|
2428
|
+
measureColumns() {
|
|
2429
|
+
const root = this.tableRoot?.nativeElement;
|
|
2430
|
+
if (!root)
|
|
2431
|
+
return;
|
|
2432
|
+
const cols = this.columns();
|
|
2433
|
+
if (!cols.length)
|
|
2434
|
+
return;
|
|
2435
|
+
const isGrid = this.variant === 'grid';
|
|
2436
|
+
const borderPx = isGrid ? 2 : 0;
|
|
2437
|
+
const safetyPx = isGrid ? 2 : 0;
|
|
2438
|
+
const perColOverhead = borderPx + safetyPx;
|
|
2439
|
+
const widths = [];
|
|
2440
|
+
for (let i = 0; i < cols.length; i++) {
|
|
2441
|
+
const col = cols[i];
|
|
2442
|
+
if (col.width) {
|
|
2443
|
+
widths[i] = -1;
|
|
2444
|
+
continue;
|
|
2445
|
+
}
|
|
2446
|
+
const manual = this.manualPx()[i];
|
|
2447
|
+
if (manual != null) {
|
|
2448
|
+
widths[i] = manual;
|
|
2449
|
+
continue;
|
|
2450
|
+
}
|
|
2451
|
+
const headerCell = root.querySelector(`.solaris-table__row--header [data-col-idx="${i}"]`);
|
|
2452
|
+
const bodyCells = Array.from(root.querySelectorAll(`.solaris-table__body [data-col-idx="${i}"]`));
|
|
2453
|
+
const headerW = headerCell ? this.measureHeaderCellWidth(headerCell) : 0;
|
|
2454
|
+
const bodyW = this.measureBodyCellsWidth(bodyCells);
|
|
2455
|
+
const cap = this.toPx(col.maxWidth ?? '18rem', root);
|
|
2456
|
+
const ideal = Math.max(headerW, bodyW);
|
|
2457
|
+
const withOverhead = ideal + perColOverhead;
|
|
2458
|
+
const min = col.minWidth ? this.toPx(col.minWidth, root) : 40;
|
|
2459
|
+
widths[i] = Math.max(min, Math.min(withOverhead, cap));
|
|
2460
|
+
}
|
|
2461
|
+
this.measuredPx.set(widths);
|
|
2462
|
+
this.measuredReady.set(true);
|
|
2463
|
+
this.updateScrollFlag();
|
|
2464
|
+
}
|
|
2465
|
+
measureHeaderCellWidth(cell) {
|
|
2466
|
+
const root = this.tableRoot?.nativeElement;
|
|
2467
|
+
if (!root)
|
|
2468
|
+
return 0;
|
|
2469
|
+
const clone = cell.cloneNode(true);
|
|
2470
|
+
clone.style.position = 'absolute';
|
|
2471
|
+
clone.style.left = '-99999px';
|
|
2472
|
+
clone.style.top = '0';
|
|
2473
|
+
clone.style.visibility = 'hidden';
|
|
2474
|
+
clone.style.pointerEvents = 'none';
|
|
2475
|
+
clone.style.width = 'max-content';
|
|
2476
|
+
clone.style.maxWidth = 'none';
|
|
2477
|
+
const resizer = clone.querySelector('.solaris-table__col-resizer');
|
|
2478
|
+
if (resizer)
|
|
2479
|
+
resizer.style.display = 'none';
|
|
2480
|
+
const headerContent = clone.querySelector('.solaris-table__header-content');
|
|
2481
|
+
if (headerContent) {
|
|
2482
|
+
headerContent.style.width = 'max-content';
|
|
2483
|
+
headerContent.style.justifyContent = 'flex-start';
|
|
2484
|
+
}
|
|
2485
|
+
const left = clone.querySelector('.solaris-table__header-left');
|
|
2486
|
+
if (left) {
|
|
2487
|
+
left.style.overflow = 'visible';
|
|
2488
|
+
left.style.maxWidth = 'none';
|
|
2489
|
+
left.style.minWidth = '0';
|
|
2490
|
+
}
|
|
2491
|
+
const text = clone.querySelector('.solaris-table__header-text');
|
|
2492
|
+
if (text) {
|
|
2493
|
+
text.style.maxWidth = 'none';
|
|
2494
|
+
text.style.overflow = 'visible';
|
|
2495
|
+
text.style.textOverflow = 'clip';
|
|
2496
|
+
text.style.whiteSpace = 'nowrap';
|
|
2497
|
+
text.style.display = 'inline-block';
|
|
2498
|
+
}
|
|
2499
|
+
const sortBtn = clone.querySelector('.solaris-table__sort-btn');
|
|
2500
|
+
if (sortBtn)
|
|
2501
|
+
sortBtn.style.width = 'max-content';
|
|
2502
|
+
root.appendChild(clone);
|
|
2503
|
+
const w = clone.getBoundingClientRect().width;
|
|
2504
|
+
clone.remove();
|
|
2505
|
+
return Math.ceil(w);
|
|
2506
|
+
}
|
|
2507
|
+
measureBodyCellsWidth(cells) {
|
|
2508
|
+
let max = 0;
|
|
2509
|
+
for (const cell of cells)
|
|
2510
|
+
max = Math.max(max, this.measureBodyCellWidth(cell));
|
|
2511
|
+
return max;
|
|
2512
|
+
}
|
|
2513
|
+
measureBodyCellWidth(cell) {
|
|
2514
|
+
const style = getComputedStyle(cell);
|
|
2515
|
+
const pad = Number.parseFloat(style.paddingLeft || '0') + Number.parseFloat(style.paddingRight || '0');
|
|
2516
|
+
const prefix = cell.querySelector('.solaris-row__select-prefix');
|
|
2517
|
+
const content = cell.querySelector('.solaris-row__content');
|
|
2518
|
+
const prefixW = prefix?.scrollWidth ?? 0;
|
|
2519
|
+
const contentW = content?.scrollWidth ?? cell.scrollWidth;
|
|
2520
|
+
const gap = prefix ? 12 : 0;
|
|
2521
|
+
return pad + prefixW + gap + contentW;
|
|
2522
|
+
}
|
|
2523
|
+
toPx(value, base) {
|
|
2524
|
+
const v = value.trim();
|
|
2525
|
+
if (v.endsWith('px'))
|
|
2526
|
+
return Number.parseFloat(v);
|
|
2527
|
+
if (v.endsWith('rem'))
|
|
2528
|
+
return Number.parseFloat(v) * Number.parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
2529
|
+
if (v.endsWith('em'))
|
|
2530
|
+
return Number.parseFloat(v) * Number.parseFloat(getComputedStyle(base).fontSize);
|
|
2531
|
+
const n = Number.parseFloat(v);
|
|
2532
|
+
return Number.isFinite(n) ? n : 280;
|
|
2533
|
+
}
|
|
2534
|
+
updateScrollFlag() {
|
|
2535
|
+
const root = this.tableRoot?.nativeElement;
|
|
2536
|
+
if (!root)
|
|
2537
|
+
return;
|
|
2538
|
+
requestAnimationFrame(() => {
|
|
2539
|
+
const needs = root.scrollWidth > root.clientWidth + 1;
|
|
2540
|
+
this.needsScroll.set(needs);
|
|
2541
|
+
});
|
|
2542
|
+
}
|
|
2543
|
+
clamp(n, min, max) {
|
|
2544
|
+
return Math.max(min, Math.min(max, n));
|
|
2545
|
+
}
|
|
2546
|
+
clearManualWidth(i) {
|
|
2547
|
+
const next = { ...this.manualPx() };
|
|
2548
|
+
delete next[i];
|
|
2549
|
+
this.manualPx.set(next);
|
|
2550
|
+
this.scheduleMeasure();
|
|
2551
|
+
}
|
|
2552
|
+
onResizeStart(ev, i) {
|
|
2553
|
+
ev.preventDefault();
|
|
2554
|
+
ev.stopPropagation();
|
|
2555
|
+
const root = this.tableRoot?.nativeElement;
|
|
2556
|
+
if (!root)
|
|
2557
|
+
return;
|
|
2558
|
+
const headerCell = this.getHeaderCell(i);
|
|
2559
|
+
if (!headerCell)
|
|
2560
|
+
return;
|
|
2561
|
+
const cols = this.columns();
|
|
2562
|
+
const col = cols[i];
|
|
2563
|
+
if (!col || col.width || !col.resizable)
|
|
2564
|
+
return;
|
|
2565
|
+
const startX = ev.clientX;
|
|
2566
|
+
const startW = this.manualPx()[i] ?? Math.round(headerCell.getBoundingClientRect().width);
|
|
2567
|
+
const min = col.minWidth ? this.toPx(col.minWidth, root) : 40;
|
|
2568
|
+
const hardMax = col.maxWidth ? this.toPx(col.maxWidth, root) : 9999;
|
|
2569
|
+
const maxSafe = this.computeResizeMax(i, min, hardMax, root);
|
|
2570
|
+
root.classList.add('is-resizing');
|
|
2571
|
+
ev.target.setPointerCapture?.(ev.pointerId);
|
|
2572
|
+
const onMove = (e) => {
|
|
2573
|
+
const dx = e.clientX - startX;
|
|
2574
|
+
const nextW = this.clamp(Math.round(startW + dx), min, maxSafe);
|
|
2575
|
+
const cur = this.manualPx();
|
|
2576
|
+
if (cur[i] === nextW)
|
|
2577
|
+
return;
|
|
2578
|
+
this.manualPx.set({ ...cur, [i]: nextW });
|
|
2579
|
+
};
|
|
2580
|
+
const cleanup = () => {
|
|
2581
|
+
root.classList.remove('is-resizing');
|
|
2582
|
+
globalThis.removeEventListener('pointermove', onMove);
|
|
2583
|
+
globalThis.removeEventListener('pointerup', cleanup);
|
|
2584
|
+
globalThis.removeEventListener('pointercancel', cleanup);
|
|
2585
|
+
};
|
|
2586
|
+
globalThis.addEventListener('pointermove', onMove);
|
|
2587
|
+
globalThis.addEventListener('pointerup', cleanup);
|
|
2588
|
+
globalThis.addEventListener('pointercancel', cleanup);
|
|
2589
|
+
}
|
|
2590
|
+
getHeaderCell(i) {
|
|
2591
|
+
const root = this.tableRoot?.nativeElement;
|
|
2592
|
+
if (!root)
|
|
2593
|
+
return null;
|
|
2594
|
+
return root.querySelector(`.solaris-table__row--header [data-col-idx="${i}"]`);
|
|
2595
|
+
}
|
|
2596
|
+
pxMinWidth(c, root) {
|
|
2597
|
+
return c.minWidth ? this.toPx(c.minWidth, root) : 0;
|
|
2598
|
+
}
|
|
2599
|
+
pxFixedWidth(c, root) {
|
|
2600
|
+
if (!c.width)
|
|
2601
|
+
return null;
|
|
2602
|
+
const w = c.width.trim();
|
|
2603
|
+
if (w.endsWith('px') || w.endsWith('rem') || w.endsWith('em'))
|
|
2604
|
+
return this.toPx(w, root);
|
|
2605
|
+
const n = Number.parseFloat(w);
|
|
2606
|
+
return Number.isFinite(n) ? n : null;
|
|
2607
|
+
}
|
|
2608
|
+
reservedWidthExcept(i, root) {
|
|
2609
|
+
const cols = this.columns();
|
|
2610
|
+
const manualMap = this.manualPx();
|
|
2611
|
+
let reserved = 0;
|
|
2612
|
+
for (let j = 0; j < cols.length; j++) {
|
|
2613
|
+
if (j === i)
|
|
2614
|
+
continue;
|
|
2615
|
+
const c = cols[j];
|
|
2616
|
+
if (c.width) {
|
|
2617
|
+
const px = this.pxFixedWidth(c, root);
|
|
2618
|
+
if (px != null) {
|
|
2619
|
+
reserved += px;
|
|
2620
|
+
continue;
|
|
2621
|
+
}
|
|
2622
|
+
const cell = this.getHeaderCell(j);
|
|
2623
|
+
reserved += Math.round(cell?.getBoundingClientRect().width ?? 48);
|
|
2624
|
+
continue;
|
|
2625
|
+
}
|
|
2626
|
+
const manual = manualMap[j];
|
|
2627
|
+
if (manual != null) {
|
|
2628
|
+
reserved += manual;
|
|
2629
|
+
continue;
|
|
2630
|
+
}
|
|
2631
|
+
if (c.grow) {
|
|
2632
|
+
reserved += this.pxMinWidth(c, root);
|
|
2633
|
+
continue;
|
|
2634
|
+
}
|
|
2635
|
+
reserved += 48;
|
|
2636
|
+
}
|
|
2637
|
+
return reserved;
|
|
2638
|
+
}
|
|
2639
|
+
readField(row, path) {
|
|
2640
|
+
if (!path)
|
|
2641
|
+
return '';
|
|
2642
|
+
const parts = path.split('.');
|
|
2643
|
+
let cur = row;
|
|
2644
|
+
for (const p of parts) {
|
|
2645
|
+
if (cur == null)
|
|
2646
|
+
return '';
|
|
2647
|
+
cur = cur[p];
|
|
2648
|
+
}
|
|
2649
|
+
return cur ?? '';
|
|
2650
|
+
}
|
|
2651
|
+
computeResizeMax(i, min, hardMax, root) {
|
|
2652
|
+
const available = root.clientWidth;
|
|
2653
|
+
const reserved = this.reservedWidthExcept(i, root);
|
|
2654
|
+
const safety = 8;
|
|
2655
|
+
const fitMax = Math.max(min, Math.floor(available - reserved - safety));
|
|
2656
|
+
return Math.max(min, Math.min(hardMax, fitMax));
|
|
2657
|
+
}
|
|
2658
|
+
registerRowKey(key) {
|
|
2659
|
+
const next = new Set(this.rowKeys());
|
|
2660
|
+
next.add(key);
|
|
2661
|
+
this.rowKeys.set(next);
|
|
2662
|
+
}
|
|
2663
|
+
unregisterRowKey(key) {
|
|
2664
|
+
const next = new Set(this.rowKeys());
|
|
2665
|
+
next.delete(key);
|
|
2666
|
+
this.rowKeys.set(next);
|
|
2667
|
+
}
|
|
2668
|
+
onToggleSelectAll(checked) {
|
|
2669
|
+
const keys = Array.from(this.rowKeys());
|
|
2670
|
+
const sel = new Set(this.selectionSig());
|
|
2671
|
+
if (checked)
|
|
2672
|
+
keys.forEach(k => sel.add(k));
|
|
2673
|
+
else
|
|
2674
|
+
keys.forEach(k => sel.delete(k));
|
|
2675
|
+
const out = Array.from(sel);
|
|
2676
|
+
this.selectionSig.set(out);
|
|
2677
|
+
this.selectionChange.emit(out);
|
|
2678
|
+
}
|
|
2679
|
+
toggleRow(key, checked) {
|
|
2680
|
+
const sel = new Set(this.selectionSig());
|
|
2681
|
+
if (checked)
|
|
2682
|
+
sel.add(key);
|
|
2683
|
+
else
|
|
2684
|
+
sel.delete(key);
|
|
2685
|
+
const out = Array.from(sel);
|
|
2686
|
+
this.selectionSig.set(out);
|
|
2687
|
+
this.selectionChange.emit(out);
|
|
2688
|
+
}
|
|
2689
|
+
isSelected(key) {
|
|
2690
|
+
return this.selectionSetSig().has(key);
|
|
2691
|
+
}
|
|
2692
|
+
getSortFor(col) {
|
|
2693
|
+
const key = col.sortKey ?? col.field;
|
|
2694
|
+
if (!key)
|
|
2695
|
+
return undefined;
|
|
2696
|
+
return this.sortState().find(s => s.key === key);
|
|
2697
|
+
}
|
|
2698
|
+
onHeaderSortClick(ev, col) {
|
|
2699
|
+
ev.stopPropagation();
|
|
2700
|
+
if (!col.sortable)
|
|
2701
|
+
return;
|
|
2702
|
+
const key = col.sortKey ?? col.field;
|
|
2703
|
+
if (!key)
|
|
2704
|
+
return;
|
|
2705
|
+
const multi = ev.shiftKey;
|
|
2706
|
+
let next = [...this.sortState()];
|
|
2707
|
+
if (!multi)
|
|
2708
|
+
next = next.filter(s => s.key === key);
|
|
2709
|
+
const idx = next.findIndex(s => s.key === key);
|
|
2710
|
+
if (idx === -1)
|
|
2711
|
+
next.push({ key, direction: 'asc', order: next.length + 1 });
|
|
2712
|
+
else {
|
|
2713
|
+
const cur = next[idx];
|
|
2714
|
+
if (cur.direction === 'asc')
|
|
2715
|
+
next[idx] = { ...cur, direction: 'desc' };
|
|
2716
|
+
else
|
|
2717
|
+
next.splice(idx, 1);
|
|
2718
|
+
}
|
|
2719
|
+
next = next.map((s, k) => ({ ...s, order: k + 1 }));
|
|
2720
|
+
this.sortState.set(next);
|
|
2721
|
+
this.sortChange.emit(next);
|
|
2722
|
+
}
|
|
2723
|
+
ariaSort(col) {
|
|
2724
|
+
const s = this.getSortFor(col);
|
|
2725
|
+
if (!s)
|
|
2726
|
+
return 'none';
|
|
2727
|
+
return s.direction === 'asc' ? 'ascending' : 'descending';
|
|
2728
|
+
}
|
|
2729
|
+
firstPage() { this.pageChange.emit({ pageIndex: 0, pageSize: this.pageSize }); }
|
|
2730
|
+
prevPage() { this.pageChange.emit({ pageIndex: Math.max(0, this.pageIndex - 1), pageSize: this.pageSize }); }
|
|
2731
|
+
nextPage() { this.pageChange.emit({ pageIndex: Math.min(this.totalPages - 1, this.pageIndex + 1), pageSize: this.pageSize }); }
|
|
2732
|
+
lastPage() { this.pageChange.emit({ pageIndex: this.totalPages - 1, pageSize: this.pageSize }); }
|
|
2733
|
+
changePageSize(size) { this.pageChange.emit({ pageIndex: 0, pageSize: size }); }
|
|
2734
|
+
buildGridTemplateColumns() {
|
|
2735
|
+
const cols = this.columns();
|
|
2736
|
+
const measured = this.measuredPx();
|
|
2737
|
+
const root = this.tableRoot?.nativeElement;
|
|
2738
|
+
const minPx = (c) => root && c.minWidth ? this.toPx(c.minWidth, root) : 0;
|
|
2739
|
+
const fixedWidthPx = (c) => {
|
|
2740
|
+
if (!root || !c.width)
|
|
2741
|
+
return null;
|
|
2742
|
+
const w = c.width.trim();
|
|
2743
|
+
if (w.endsWith('px') || w.endsWith('rem') || w.endsWith('em'))
|
|
2744
|
+
return this.toPx(w, root);
|
|
2745
|
+
const n = Number.parseFloat(w);
|
|
2746
|
+
return Number.isFinite(n) ? n : null;
|
|
2747
|
+
};
|
|
2748
|
+
if (!measured.length || measured.length !== cols.length) {
|
|
2749
|
+
return cols.map((c) => {
|
|
2750
|
+
if (c.width)
|
|
2751
|
+
return c.width;
|
|
2752
|
+
if (c.grow)
|
|
2753
|
+
return `minmax(${minPx(c)}px, 1fr)`;
|
|
2754
|
+
if (root && c.maxWidth) {
|
|
2755
|
+
const cap = this.toPx(c.maxWidth, root);
|
|
2756
|
+
return `minmax(0px, ${cap}px)`;
|
|
2757
|
+
}
|
|
2758
|
+
return 'minmax(0px, 1fr)';
|
|
2759
|
+
}).join(' ');
|
|
2760
|
+
}
|
|
2761
|
+
const available = root?.clientWidth ?? 0;
|
|
2762
|
+
const rawPx = [];
|
|
2763
|
+
const growMinSum = cols.reduce((acc, c) => acc + (c.grow ? minPx(c) : 0), 0);
|
|
2764
|
+
let fixedSum = 0;
|
|
2765
|
+
for (let i = 0; i < cols.length; i++) {
|
|
2766
|
+
const c = cols[i];
|
|
2767
|
+
if (c.width) {
|
|
2768
|
+
const px = fixedWidthPx(c);
|
|
2769
|
+
rawPx[i] = px ?? 0;
|
|
2770
|
+
fixedSum += px ?? 0;
|
|
2771
|
+
continue;
|
|
2772
|
+
}
|
|
2773
|
+
if (c.grow) {
|
|
2774
|
+
rawPx[i] = 0;
|
|
2775
|
+
continue;
|
|
2776
|
+
}
|
|
2777
|
+
const manual = this.manualPx()[i];
|
|
2778
|
+
const px = manual ?? (measured[i] > 0 ? measured[i] : 180);
|
|
2779
|
+
rawPx[i] = px;
|
|
2780
|
+
fixedSum += px;
|
|
2781
|
+
}
|
|
2782
|
+
if (!available) {
|
|
2783
|
+
return cols.map((c, i) => {
|
|
2784
|
+
if (c.width)
|
|
2785
|
+
return c.width;
|
|
2786
|
+
if (c.grow)
|
|
2787
|
+
return `minmax(${minPx(c)}px, 1fr)`;
|
|
2788
|
+
return `${rawPx[i]}px`;
|
|
2789
|
+
}).join(' ');
|
|
2790
|
+
}
|
|
2791
|
+
const fixedBudget = Math.max(0, available - growMinSum);
|
|
2792
|
+
const scale = fixedSum > fixedBudget && fixedSum > 0 ? (fixedBudget / fixedSum) : 1;
|
|
2793
|
+
return cols.map((c, i) => {
|
|
2794
|
+
if (c.width) {
|
|
2795
|
+
return c.width;
|
|
2796
|
+
}
|
|
2797
|
+
if (c.grow) {
|
|
2798
|
+
const min = minPx(c);
|
|
2799
|
+
return `minmax(${min}px, 1fr)`;
|
|
2800
|
+
}
|
|
2801
|
+
const px = Math.max(48, Math.floor(rawPx[i] * scale));
|
|
2802
|
+
return `${px}px`;
|
|
2803
|
+
}).join(' ');
|
|
2804
|
+
}
|
|
2805
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2806
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisTable, isStandalone: true, selector: "solaris-table", inputs: { length: "length", pageIndex: "pageIndex", pageSize: "pageSize", rowsCount: "rowsCount", loading: "loading", sort: "sort", selectable: "selectable", tableDescription: "tableDescription", selection: "selection", variant: "variant", emptyIconClass: "emptyIconClass", pageSizeOptions: "pageSizeOptions", emptyTextKey: "emptyTextKey" }, outputs: { sortChange: "sortChange", pageChange: "pageChange", selectionChange: "selectionChange" }, host: { properties: { "attr.data-scroll": "needsScroll() ? \"true\" : null" }, classAttribute: "solaris-table-host" }, queries: [{ propertyName: "columnQuery", predicate: SolarisTableColumn }], viewQueries: [{ propertyName: "tableRoot", first: true, predicate: ["tableRoot"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<ng-content select=\"solaris-table-filters\"></ng-content>\r\n\r\n<div class=\"solaris-table\" [class.solaris-table--grid]=\"variant === 'grid'\"\r\n [class.solaris-table--zebra]=\"variant === 'zebra'\">\r\n <div #tableRoot class=\"solaris-table__inner\" role=\"table\" [attr.aria-rowcount]=\"rowsCount\">\r\n <div class=\"solaris-table__header\" role=\"rowgroup\">\r\n <div class=\"solaris-table__row solaris-table__row--header\" role=\"row\" [style.gridTemplateColumns]=\"gridTemplateColumns()\">\r\n @for (col of columns(); track col.id; let i = $index) {\r\n <div class=\"solaris-table__cell solaris-table__cell--header\" role=\"columnheader\" [attr.data-col-idx]=\"i\"\r\n [attr.aria-sort]=\"ariaSort(col)\" [style.--solaris-col-max]=\"col.maxWidth || null\">\r\n\r\n <div class=\"solaris-table__header-content\">\r\n <span class=\"solaris-table__header-left\">\r\n @if (selectable && i === 0) {\r\n <span class=\"solaris-table__select-prefix\" (click)=\"$event.stopPropagation()\">\r\n <solaris-checkbox variant=\"square\" color=\"primary\" size=\"sm\" [ngModel]=\"selectAllChecked()\"\r\n (ngModelChange)=\"onToggleSelectAll($event)\" [indeterminate]=\"selectAllIndeterminate()\">\r\n </solaris-checkbox>\r\n </span>\r\n }\r\n\r\n @if (col.headerIconClass) { <i [class]=\"col.headerIconClass\"></i> }\r\n\r\n @if (col.headerDef?.template) {\r\n <ng-container [ngTemplateOutlet]=\"col.headerDef?.template\"></ng-container>\r\n } @else {\r\n @if (col.headerKey) {\r\n <span class=\"solaris-table__header-text\">{{ col.headerKey | translate }}</span>\r\n } @else {\r\n <span class=\"solaris-table__header-text\">{{ col.header }}</span>\r\n }\r\n }\r\n </span>\r\n\r\n @if (col.sortable) {\r\n <button type=\"button\" class=\"solaris-table__sort-btn\" (click)=\"onHeaderSortClick($event, col)\">\r\n <span class=\"solaris-table__sort\">\r\n <i class=\"ph ph-arrow-up\" [class.is-active]=\"getSortFor(col)?.direction === 'asc'\"></i>\r\n <i class=\"ph ph-arrow-down\" [class.is-active]=\"getSortFor(col)?.direction === 'desc'\"></i>\r\n\r\n @if (getSortFor(col)?.order && sortState().length > 1) {\r\n <span class=\"solaris-table__sort-order\">{{ getSortFor(col)!.order }}</span>\r\n }\r\n </span>\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (col.resizable && !col.width) {\r\n <span class=\"solaris-table__col-resizer\" role=\"separator\" aria-orientation=\"vertical\"\r\n (pointerdown)=\"onResizeStart($event, i)\" (dblclick)=\"clearManualWidth(i)\"\r\n (click)=\"$event.stopPropagation()\">\r\n </span>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div class=\"solaris-table__body\" role=\"rowgroup\">\r\n @if (loading) {\r\n <solaris-table-skeleton [rows]=\"pageSize\" [columns]=\"columns().length\" [selectable]=\"selectable\"\r\n [gridTemplateColumns]=\"gridTemplateColumns()\">\r\n </solaris-table-skeleton>\r\n } @else {\r\n @if (rowsCount === 0) {\r\n <div class=\"solaris-table__empty\" role=\"row\">\r\n <i [class]=\"emptyIconClass\"></i>\r\n <div class=\"solaris-table__empty-text\">{{ 'ui.solaris.tables.empty' | translate }}</div>\r\n </div>\r\n } @else {\r\n <ng-content select=\"solaris-row\"></ng-content>\r\n }\r\n }\r\n </div>\r\n\r\n <div class=\"solaris-table__footer\" role=\"rowgroup\">\r\n <div class=\"solaris-table__footer-left\">\r\n @if (selectedCount() > 0) {\r\n <div class=\"solaris-table__selected\">\r\n {{ selectedCount() }} {{ 'ui.solaris.tables.selection.selected' | translate }}\r\n </div>\r\n } @else if (tableDescription != null) {\r\n <div class=\"solaris-table__description\">\r\n {{ tableDescription }}\r\n </div>\r\n }\r\n </div>\r\n\r\n <div class=\"solaris-table__footer-right\">\r\n <div class=\"solaris-table__rows-per-page\">\r\n <span>{{ 'ui.solaris.tables.pagination.rowsPerPage' | translate }}:</span>\r\n <select [ngModel]=\"pageSize\" (ngModelChange)=\"changePageSize($event)\">\r\n @for (opt of pageSizeOptions; track opt) {\r\n <option [ngValue]=\"opt\">{{ opt }}</option>\r\n }\r\n </select>\r\n </div>\r\n\r\n <div class=\"solaris-table__range\">\r\n {{ rangeStart }}\u2013{{ rangeEnd }} {{ 'ui.solaris.common.of' | translate }} {{ length }}\r\n </div>\r\n\r\n <div class=\"solaris-table__pager\">\r\n <button type=\"button\" (click)=\"firstPage()\" [disabled]=\"pageIndex === 0\">\r\n <i class=\"ph ph-caret-line-left\"></i>\r\n </button>\r\n <button type=\"button\" (click)=\"prevPage()\" [disabled]=\"pageIndex === 0\">\r\n <i class=\"ph ph-caret-left\"></i>\r\n </button>\r\n <button type=\"button\" (click)=\"nextPage()\" [disabled]=\"pageIndex >= totalPages - 1\">\r\n <i class=\"ph ph-caret-right\"></i>\r\n </button>\r\n <button type=\"button\" (click)=\"lastPage()\" [disabled]=\"pageIndex >= totalPages - 1\">\r\n <i class=\"ph ph-caret-line-right\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".solaris-table-host{display:block;color:var(--solaris-color-text);font-family:var(--solaris-font-sans-primary),system-ui}.solaris-table{--solaris-table-row-hover-bg: var(--solaris-color-surface-2);--solaris-table-row-selected-bg: var(--solaris-color-surface-2);overflow:hidden;box-shadow:var(--solaris-shadow-sm);border-radius:var(--solaris-radius-lg);background:var(--solaris-color-surface);border:1px solid var(--solaris-color-border)}.solaris-table--grid{--solaris-table-cell-divider: 1px solid var(--solaris-color-border)}.solaris-table--zebra{--solaris-table-cell-divider: 0px solid transparent}.solaris-table__inner{overflow-x:hidden}:host([data-scroll=true]) .solaris-table__inner{overflow-x:auto}.solaris-table__inner.is-resizing{-webkit-user-select:none;user-select:none;cursor:col-resize}.solaris-table__row{width:100%;display:grid;min-height:3.25rem;align-items:stretch}.solaris-table__row--header{background:var(--solaris-color-surface-2);border-bottom:1px solid var(--solaris-color-border)}.solaris-table__cell{min-width:0;height:100%;display:flex;align-items:center;padding:var(--solaris-space-4);border-right:var(--solaris-table-cell-divider)}.solaris-table__cell,.solaris-row__cell{box-sizing:border-box}.solaris-table__cell:last-child{border-right:none}.solaris-table__cell--header{position:relative;padding:var(--solaris-space-3) var(--solaris-space-4)}.solaris-table__header-content{width:100%;min-width:0;align-items:center;display:inline-flex;gap:var(--solaris-space-2);justify-content:space-between}.solaris-table__header-left{min-width:0;overflow:hidden;align-items:center;display:inline-flex;gap:var(--solaris-space-2)}.solaris-table__header-left i.ph{font-size:var(--solaris-fs-14);color:var(--solaris-color-text-muted)}.solaris-table__select-prefix{flex:0 0 auto;align-items:center;display:inline-flex}.solaris-table__header-text{overflow:hidden;white-space:nowrap;display:inline-block;text-overflow:ellipsis;font-size:var(--solaris-fs-14);letter-spacing:var(--solaris-ls-sm);color:var(--solaris-color-text-muted);max-width:var(--solaris-col-max, 100%)}.solaris-table__sort-btn{border:none;flex:0 0 auto;cursor:pointer;background:transparent;padding:var(--solaris-space-1);color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-sm)}.solaris-table__sort-btn:hover{background:var(--solaris-color-surface-2)}.solaris-table__sort{display:inline-flex;align-items:center;gap:var(--solaris-space-1)}.solaris-table__sort i{opacity:.45;transition:opacity .14s ease,color .14s ease,transform .14s ease}.solaris-table__sort i.is-active{opacity:1;color:var(--solaris-color-primary)}.solaris-table__sort-order{font-size:var(--solaris-fs-10);margin-left:var(--solaris-space-1);color:var(--solaris-color-text-muted)}.solaris-table__col-resizer{top:0;right:0;z-index:10;width:12px;height:100%;cursor:col-resize;touch-action:none;position:absolute;pointer-events:auto}.solaris-table__col-resizer:after{top:20%;left:50%;width:1px;content:\"\";height:60%;position:absolute;background:transparent;transform:translate(-50%);transition:background .12s ease}.solaris-table__cell--header:hover .solaris-table__col-resizer:after{background:color-mix(in srgb,var(--solaris-color-border) 65%,transparent)}.solaris-table__body{background:var(--solaris-color-surface)}.solaris-table__empty{display:grid;place-items:center;gap:var(--solaris-space-3);padding:var(--solaris-space-8);color:var(--solaris-color-text-muted);border-bottom:1px solid var(--solaris-color-border)}.solaris-table__empty i{font-size:2rem}.solaris-table__empty-text{font-size:var(--solaris-fs-14)}.solaris-table__footer{display:flex;flex-wrap:wrap;align-items:center;gap:var(--solaris-space-4);justify-content:space-between;background:var(--solaris-color-surface);padding:var(--solaris-space-3) var(--solaris-space-4)}.solaris-table__footer-left,.solaris-table__footer-right{display:inline-flex;align-items:center;gap:var(--solaris-space-4)}.solaris-table__description,.solaris-table__selected{font-size:var(--solaris-fs-14);color:var(--solaris-color-text-muted)}.solaris-table__rows-per-page{display:inline-flex;align-items:center;gap:var(--solaris-space-2);margin-right:var(--solaris-space-8)}.solaris-table__rows-per-page span,.solaris-table__rows-per-page select{font-size:var(--solaris-fs-14);color:var(--solaris-color-text-muted)}.solaris-table__rows-per-page select{border:none;background:transparent}.solaris-table__range{font-size:var(--solaris-fs-14);color:var(--solaris-color-text-muted)}.solaris-table__pager{display:inline-flex;gap:var(--solaris-space-2)}.solaris-table__pager button{border:none;cursor:pointer;background:transparent;padding:var(--solaris-space-2);font-size:var(--solaris-fs-16);color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-sm);transition:background .14s ease,opacity .14s ease}.solaris-table__pager button:hover:not(:disabled){background:var(--solaris-color-surface-2)}.solaris-table__pager button:disabled{opacity:.4;cursor:not-allowed}@media(max-width:768px){.solaris-table__row--header{display:none}.solaris-table__footer-left,.solaris-table__footer-right{width:100%;justify-content:space-between}.solaris-table__col-resizer{display:none}}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SolarisCheckbox, selector: "solaris-checkbox", inputs: ["indeterminate", "ariaLabel", "size", "variant", "color", "id", "appearance", "checkColor"], outputs: ["checkedChange", "indeterminateChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SolarisTableSkeleton, selector: "solaris-table-skeleton", inputs: ["rows", "columns", "selectable", "gridTemplateColumns"] }, { kind: "pipe", type: SolarisTranslationPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2807
|
+
}
|
|
2808
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisTable, decorators: [{
|
|
2809
|
+
type: Component,
|
|
2810
|
+
args: [{ selector: 'solaris-table', standalone: true, imports: [
|
|
2811
|
+
FormsModule,
|
|
2812
|
+
SolarisCheckbox,
|
|
2813
|
+
NgTemplateOutlet,
|
|
2814
|
+
SolarisTableSkeleton,
|
|
2815
|
+
SolarisTranslationPipe,
|
|
2816
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
2817
|
+
class: 'solaris-table-host',
|
|
2818
|
+
'[attr.data-scroll]': 'needsScroll() ? "true" : null',
|
|
2819
|
+
}, template: "<ng-content select=\"solaris-table-filters\"></ng-content>\r\n\r\n<div class=\"solaris-table\" [class.solaris-table--grid]=\"variant === 'grid'\"\r\n [class.solaris-table--zebra]=\"variant === 'zebra'\">\r\n <div #tableRoot class=\"solaris-table__inner\" role=\"table\" [attr.aria-rowcount]=\"rowsCount\">\r\n <div class=\"solaris-table__header\" role=\"rowgroup\">\r\n <div class=\"solaris-table__row solaris-table__row--header\" role=\"row\" [style.gridTemplateColumns]=\"gridTemplateColumns()\">\r\n @for (col of columns(); track col.id; let i = $index) {\r\n <div class=\"solaris-table__cell solaris-table__cell--header\" role=\"columnheader\" [attr.data-col-idx]=\"i\"\r\n [attr.aria-sort]=\"ariaSort(col)\" [style.--solaris-col-max]=\"col.maxWidth || null\">\r\n\r\n <div class=\"solaris-table__header-content\">\r\n <span class=\"solaris-table__header-left\">\r\n @if (selectable && i === 0) {\r\n <span class=\"solaris-table__select-prefix\" (click)=\"$event.stopPropagation()\">\r\n <solaris-checkbox variant=\"square\" color=\"primary\" size=\"sm\" [ngModel]=\"selectAllChecked()\"\r\n (ngModelChange)=\"onToggleSelectAll($event)\" [indeterminate]=\"selectAllIndeterminate()\">\r\n </solaris-checkbox>\r\n </span>\r\n }\r\n\r\n @if (col.headerIconClass) { <i [class]=\"col.headerIconClass\"></i> }\r\n\r\n @if (col.headerDef?.template) {\r\n <ng-container [ngTemplateOutlet]=\"col.headerDef?.template\"></ng-container>\r\n } @else {\r\n @if (col.headerKey) {\r\n <span class=\"solaris-table__header-text\">{{ col.headerKey | translate }}</span>\r\n } @else {\r\n <span class=\"solaris-table__header-text\">{{ col.header }}</span>\r\n }\r\n }\r\n </span>\r\n\r\n @if (col.sortable) {\r\n <button type=\"button\" class=\"solaris-table__sort-btn\" (click)=\"onHeaderSortClick($event, col)\">\r\n <span class=\"solaris-table__sort\">\r\n <i class=\"ph ph-arrow-up\" [class.is-active]=\"getSortFor(col)?.direction === 'asc'\"></i>\r\n <i class=\"ph ph-arrow-down\" [class.is-active]=\"getSortFor(col)?.direction === 'desc'\"></i>\r\n\r\n @if (getSortFor(col)?.order && sortState().length > 1) {\r\n <span class=\"solaris-table__sort-order\">{{ getSortFor(col)!.order }}</span>\r\n }\r\n </span>\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (col.resizable && !col.width) {\r\n <span class=\"solaris-table__col-resizer\" role=\"separator\" aria-orientation=\"vertical\"\r\n (pointerdown)=\"onResizeStart($event, i)\" (dblclick)=\"clearManualWidth(i)\"\r\n (click)=\"$event.stopPropagation()\">\r\n </span>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div class=\"solaris-table__body\" role=\"rowgroup\">\r\n @if (loading) {\r\n <solaris-table-skeleton [rows]=\"pageSize\" [columns]=\"columns().length\" [selectable]=\"selectable\"\r\n [gridTemplateColumns]=\"gridTemplateColumns()\">\r\n </solaris-table-skeleton>\r\n } @else {\r\n @if (rowsCount === 0) {\r\n <div class=\"solaris-table__empty\" role=\"row\">\r\n <i [class]=\"emptyIconClass\"></i>\r\n <div class=\"solaris-table__empty-text\">{{ 'ui.solaris.tables.empty' | translate }}</div>\r\n </div>\r\n } @else {\r\n <ng-content select=\"solaris-row\"></ng-content>\r\n }\r\n }\r\n </div>\r\n\r\n <div class=\"solaris-table__footer\" role=\"rowgroup\">\r\n <div class=\"solaris-table__footer-left\">\r\n @if (selectedCount() > 0) {\r\n <div class=\"solaris-table__selected\">\r\n {{ selectedCount() }} {{ 'ui.solaris.tables.selection.selected' | translate }}\r\n </div>\r\n } @else if (tableDescription != null) {\r\n <div class=\"solaris-table__description\">\r\n {{ tableDescription }}\r\n </div>\r\n }\r\n </div>\r\n\r\n <div class=\"solaris-table__footer-right\">\r\n <div class=\"solaris-table__rows-per-page\">\r\n <span>{{ 'ui.solaris.tables.pagination.rowsPerPage' | translate }}:</span>\r\n <select [ngModel]=\"pageSize\" (ngModelChange)=\"changePageSize($event)\">\r\n @for (opt of pageSizeOptions; track opt) {\r\n <option [ngValue]=\"opt\">{{ opt }}</option>\r\n }\r\n </select>\r\n </div>\r\n\r\n <div class=\"solaris-table__range\">\r\n {{ rangeStart }}\u2013{{ rangeEnd }} {{ 'ui.solaris.common.of' | translate }} {{ length }}\r\n </div>\r\n\r\n <div class=\"solaris-table__pager\">\r\n <button type=\"button\" (click)=\"firstPage()\" [disabled]=\"pageIndex === 0\">\r\n <i class=\"ph ph-caret-line-left\"></i>\r\n </button>\r\n <button type=\"button\" (click)=\"prevPage()\" [disabled]=\"pageIndex === 0\">\r\n <i class=\"ph ph-caret-left\"></i>\r\n </button>\r\n <button type=\"button\" (click)=\"nextPage()\" [disabled]=\"pageIndex >= totalPages - 1\">\r\n <i class=\"ph ph-caret-right\"></i>\r\n </button>\r\n <button type=\"button\" (click)=\"lastPage()\" [disabled]=\"pageIndex >= totalPages - 1\">\r\n <i class=\"ph ph-caret-line-right\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".solaris-table-host{display:block;color:var(--solaris-color-text);font-family:var(--solaris-font-sans-primary),system-ui}.solaris-table{--solaris-table-row-hover-bg: var(--solaris-color-surface-2);--solaris-table-row-selected-bg: var(--solaris-color-surface-2);overflow:hidden;box-shadow:var(--solaris-shadow-sm);border-radius:var(--solaris-radius-lg);background:var(--solaris-color-surface);border:1px solid var(--solaris-color-border)}.solaris-table--grid{--solaris-table-cell-divider: 1px solid var(--solaris-color-border)}.solaris-table--zebra{--solaris-table-cell-divider: 0px solid transparent}.solaris-table__inner{overflow-x:hidden}:host([data-scroll=true]) .solaris-table__inner{overflow-x:auto}.solaris-table__inner.is-resizing{-webkit-user-select:none;user-select:none;cursor:col-resize}.solaris-table__row{width:100%;display:grid;min-height:3.25rem;align-items:stretch}.solaris-table__row--header{background:var(--solaris-color-surface-2);border-bottom:1px solid var(--solaris-color-border)}.solaris-table__cell{min-width:0;height:100%;display:flex;align-items:center;padding:var(--solaris-space-4);border-right:var(--solaris-table-cell-divider)}.solaris-table__cell,.solaris-row__cell{box-sizing:border-box}.solaris-table__cell:last-child{border-right:none}.solaris-table__cell--header{position:relative;padding:var(--solaris-space-3) var(--solaris-space-4)}.solaris-table__header-content{width:100%;min-width:0;align-items:center;display:inline-flex;gap:var(--solaris-space-2);justify-content:space-between}.solaris-table__header-left{min-width:0;overflow:hidden;align-items:center;display:inline-flex;gap:var(--solaris-space-2)}.solaris-table__header-left i.ph{font-size:var(--solaris-fs-14);color:var(--solaris-color-text-muted)}.solaris-table__select-prefix{flex:0 0 auto;align-items:center;display:inline-flex}.solaris-table__header-text{overflow:hidden;white-space:nowrap;display:inline-block;text-overflow:ellipsis;font-size:var(--solaris-fs-14);letter-spacing:var(--solaris-ls-sm);color:var(--solaris-color-text-muted);max-width:var(--solaris-col-max, 100%)}.solaris-table__sort-btn{border:none;flex:0 0 auto;cursor:pointer;background:transparent;padding:var(--solaris-space-1);color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-sm)}.solaris-table__sort-btn:hover{background:var(--solaris-color-surface-2)}.solaris-table__sort{display:inline-flex;align-items:center;gap:var(--solaris-space-1)}.solaris-table__sort i{opacity:.45;transition:opacity .14s ease,color .14s ease,transform .14s ease}.solaris-table__sort i.is-active{opacity:1;color:var(--solaris-color-primary)}.solaris-table__sort-order{font-size:var(--solaris-fs-10);margin-left:var(--solaris-space-1);color:var(--solaris-color-text-muted)}.solaris-table__col-resizer{top:0;right:0;z-index:10;width:12px;height:100%;cursor:col-resize;touch-action:none;position:absolute;pointer-events:auto}.solaris-table__col-resizer:after{top:20%;left:50%;width:1px;content:\"\";height:60%;position:absolute;background:transparent;transform:translate(-50%);transition:background .12s ease}.solaris-table__cell--header:hover .solaris-table__col-resizer:after{background:color-mix(in srgb,var(--solaris-color-border) 65%,transparent)}.solaris-table__body{background:var(--solaris-color-surface)}.solaris-table__empty{display:grid;place-items:center;gap:var(--solaris-space-3);padding:var(--solaris-space-8);color:var(--solaris-color-text-muted);border-bottom:1px solid var(--solaris-color-border)}.solaris-table__empty i{font-size:2rem}.solaris-table__empty-text{font-size:var(--solaris-fs-14)}.solaris-table__footer{display:flex;flex-wrap:wrap;align-items:center;gap:var(--solaris-space-4);justify-content:space-between;background:var(--solaris-color-surface);padding:var(--solaris-space-3) var(--solaris-space-4)}.solaris-table__footer-left,.solaris-table__footer-right{display:inline-flex;align-items:center;gap:var(--solaris-space-4)}.solaris-table__description,.solaris-table__selected{font-size:var(--solaris-fs-14);color:var(--solaris-color-text-muted)}.solaris-table__rows-per-page{display:inline-flex;align-items:center;gap:var(--solaris-space-2);margin-right:var(--solaris-space-8)}.solaris-table__rows-per-page span,.solaris-table__rows-per-page select{font-size:var(--solaris-fs-14);color:var(--solaris-color-text-muted)}.solaris-table__rows-per-page select{border:none;background:transparent}.solaris-table__range{font-size:var(--solaris-fs-14);color:var(--solaris-color-text-muted)}.solaris-table__pager{display:inline-flex;gap:var(--solaris-space-2)}.solaris-table__pager button{border:none;cursor:pointer;background:transparent;padding:var(--solaris-space-2);font-size:var(--solaris-fs-16);color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-sm);transition:background .14s ease,opacity .14s ease}.solaris-table__pager button:hover:not(:disabled){background:var(--solaris-color-surface-2)}.solaris-table__pager button:disabled{opacity:.4;cursor:not-allowed}@media(max-width:768px){.solaris-table__row--header{display:none}.solaris-table__footer-left,.solaris-table__footer-right{width:100%;justify-content:space-between}.solaris-table__col-resizer{display:none}}\n"] }]
|
|
2820
|
+
}], propDecorators: { length: [{
|
|
2821
|
+
type: Input
|
|
2822
|
+
}], pageIndex: [{
|
|
2823
|
+
type: Input
|
|
2824
|
+
}], pageSize: [{
|
|
2825
|
+
type: Input
|
|
2826
|
+
}], rowsCount: [{
|
|
2827
|
+
type: Input
|
|
2828
|
+
}], loading: [{
|
|
2829
|
+
type: Input
|
|
2830
|
+
}], sort: [{
|
|
2831
|
+
type: Input
|
|
2832
|
+
}], selectable: [{
|
|
2833
|
+
type: Input
|
|
2834
|
+
}], tableDescription: [{
|
|
2835
|
+
type: Input
|
|
2836
|
+
}], selection: [{
|
|
2837
|
+
type: Input
|
|
2838
|
+
}], variant: [{
|
|
2839
|
+
type: Input
|
|
2840
|
+
}], emptyIconClass: [{
|
|
2841
|
+
type: Input
|
|
2842
|
+
}], pageSizeOptions: [{
|
|
2843
|
+
type: Input
|
|
2844
|
+
}], emptyTextKey: [{
|
|
2845
|
+
type: Input
|
|
2846
|
+
}], sortChange: [{
|
|
2847
|
+
type: Output
|
|
2848
|
+
}], pageChange: [{
|
|
2849
|
+
type: Output
|
|
2850
|
+
}], selectionChange: [{
|
|
2851
|
+
type: Output
|
|
2852
|
+
}], columnQuery: [{
|
|
2853
|
+
type: ContentChildren,
|
|
2854
|
+
args: [SolarisTableColumn]
|
|
2855
|
+
}], tableRoot: [{
|
|
2856
|
+
type: ViewChild,
|
|
2857
|
+
args: ['tableRoot', { static: true }]
|
|
2858
|
+
}] } });
|
|
2859
|
+
|
|
2860
|
+
class SolarisRowComponent {
|
|
2861
|
+
table;
|
|
2862
|
+
destroyRef = inject(DestroyRef);
|
|
2863
|
+
rowKey;
|
|
2864
|
+
value;
|
|
2865
|
+
constructor(table) {
|
|
2866
|
+
this.table = table;
|
|
2867
|
+
}
|
|
2868
|
+
ngOnInit() {
|
|
2869
|
+
if (!this.table) {
|
|
2870
|
+
throw new Error('<solaris-row> deve ser usado dentro de <solaris-table>.');
|
|
2871
|
+
}
|
|
2872
|
+
if (this.table.selectable && (this.rowKey === null || this.rowKey === undefined)) {
|
|
2873
|
+
throw new Error('Quando selectable=true, <solaris-row> exige [rowKey].');
|
|
2874
|
+
}
|
|
2875
|
+
if (this.table.selectable) {
|
|
2876
|
+
this.table.registerRowKey(this.rowKey);
|
|
2877
|
+
this.destroyRef.onDestroy(() => this.table.unregisterRowKey(this.rowKey));
|
|
2878
|
+
}
|
|
2879
|
+
}
|
|
2880
|
+
get isSelected() {
|
|
2881
|
+
return this.table.isSelected(this.rowKey);
|
|
2882
|
+
}
|
|
2883
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisRowComponent, deps: [{ token: SolarisTable, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
2884
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisRowComponent, isStandalone: true, selector: "solaris-row", inputs: { rowKey: "rowKey", value: "value" }, host: { classAttribute: "solaris-row-host" }, ngImport: i0, template: "<div class=\"solaris-row\" role=\"row\" [attr.aria-selected]=\"isSelected\" [class.is-selected]=\"isSelected\"\r\n [style.gridTemplateColumns]=\"table.gridTemplateColumns()\">\r\n\r\n @for (col of table.columns(); track col.id; let i = $index) {\r\n <div class=\"solaris-row__cell\" role=\"cell\" [attr.data-col-idx]=\"i\" [class.align-end]=\"col.align === 'end'\"\r\n [class.align-center]=\"col.align === 'center'\" [style.--solaris-col-max]=\"col.maxWidth || null\">\r\n\r\n @if (table.selectable && i === 0) {\r\n <span class=\"solaris-row__select-prefix\">\r\n <solaris-checkbox variant=\"square\" color=\"primary\" size=\"sm\" [ngModel]=\"isSelected\"\r\n (ngModelChange)=\"table.toggleRow(rowKey, $event)\" [attr.aria-label]=\"'ui.solaris.tables.aria.selectRow' | translate\"/>\r\n </span>\r\n }\r\n\r\n <span class=\"solaris-row__label\">\r\n @if (col.headerKey) { {{ col.headerKey | translate }} } @else { {{ col.header }} }\r\n </span>\r\n\r\n <span class=\"solaris-row__content\">\r\n @if (col.cellDef?.template) {\r\n <ng-container [ngTemplateOutlet]=\"col.cellDef!.template\"\r\n [ngTemplateOutletContext]=\"{ $implicit: value, row: value, col: col }\"/>\r\n } @else {\r\n {{ table.readField(value, col.field) }}\r\n }\r\n </span>\r\n </div>\r\n }\r\n</div>\r\n", styles: [":host{display:block;--solaris-table-row-bg: transparent;--solaris-table-row-bg-hover: var(--solaris-table-row-hover-bg, var(--solaris-color-surface-2))}:host-context(.solaris-table--zebra):nth-child(2n){--solaris-table-row-bg: var(--solaris-color-surface-2)}:host-context(.solaris-table--zebra):nth-child(odd){--solaris-table-row-bg: var(--solaris-color-surface)}@supports (color: color-mix(in srgb,black 50%,white)){:host-context(.solaris-table--zebra):nth-child(2n){--solaris-table-row-bg-hover: color-mix(in srgb, var(--solaris-color-surface-2) 40%, var(--solaris-color-surface))}:host-context(.solaris-table--zebra):nth-child(odd){--solaris-table-row-bg-hover: color-mix(in srgb, var(--solaris-color-surface) 40%, var(--solaris-color-surface-2))}}.solaris-row{display:grid;align-items:stretch;background:var(--solaris-table-row-bg);transition:background .3s ease-in-out;border-bottom:1px solid var(--solaris-color-border)}.solaris-row:hover{background:var(--solaris-table-row-bg-hover)}.solaris-row.is-selected,.solaris-row.is-selected:hover{background:var(--solaris-table-row-selected-bg)}.solaris-row__cell{min-width:0;display:flex;align-items:center;align-self:stretch;gap:var(--solaris-space-3);padding:var(--solaris-space-4);border-right:var(--solaris-table-cell-divider)}.solaris-row__cell:last-child{border-right:none}.solaris-row__cell--select{justify-content:center}.align-end{justify-content:flex-end;text-align:right}.align-center{justify-content:center;text-align:center}.solaris-row__label{display:none;font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-row__content{overflow:hidden;white-space:nowrap;display:inline-block;text-overflow:ellipsis;font-size:var(--solaris-fs-14);color:var(--solaris-color-text-muted);max-width:var(--solaris-col-max, 100%)}.solaris-row__select-prefix{flex:0 0 auto;align-items:center;display:inline-flex}@media(max-width:768px){.solaris-row{display:block;border-bottom:none;padding:var(--solaris-space-4)}.solaris-row__cell{border-right:none;padding:var(--solaris-space-2) 0;align-items:flex-start;justify-content:space-between}.solaris-row__cell--select{justify-content:flex-end;padding-top:0}.solaris-row__label{display:inline;min-width:9rem}.solaris-row__content{max-width:100%;overflow:hidden;white-space:nowrap;display:inline-block;text-overflow:ellipsis}}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: SolarisCheckbox, selector: "solaris-checkbox", inputs: ["indeterminate", "ariaLabel", "size", "variant", "color", "id", "appearance", "checkColor"], outputs: ["checkedChange", "indeterminateChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: SolarisTranslationPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2885
|
+
}
|
|
2886
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisRowComponent, decorators: [{
|
|
2887
|
+
type: Component,
|
|
2888
|
+
args: [{ selector: 'solaris-row', standalone: true, imports: [
|
|
2889
|
+
FormsModule,
|
|
2890
|
+
SolarisCheckbox,
|
|
2891
|
+
SolarisTranslationPipe,
|
|
2892
|
+
NgTemplateOutlet
|
|
2893
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'solaris-row-host' }, template: "<div class=\"solaris-row\" role=\"row\" [attr.aria-selected]=\"isSelected\" [class.is-selected]=\"isSelected\"\r\n [style.gridTemplateColumns]=\"table.gridTemplateColumns()\">\r\n\r\n @for (col of table.columns(); track col.id; let i = $index) {\r\n <div class=\"solaris-row__cell\" role=\"cell\" [attr.data-col-idx]=\"i\" [class.align-end]=\"col.align === 'end'\"\r\n [class.align-center]=\"col.align === 'center'\" [style.--solaris-col-max]=\"col.maxWidth || null\">\r\n\r\n @if (table.selectable && i === 0) {\r\n <span class=\"solaris-row__select-prefix\">\r\n <solaris-checkbox variant=\"square\" color=\"primary\" size=\"sm\" [ngModel]=\"isSelected\"\r\n (ngModelChange)=\"table.toggleRow(rowKey, $event)\" [attr.aria-label]=\"'ui.solaris.tables.aria.selectRow' | translate\"/>\r\n </span>\r\n }\r\n\r\n <span class=\"solaris-row__label\">\r\n @if (col.headerKey) { {{ col.headerKey | translate }} } @else { {{ col.header }} }\r\n </span>\r\n\r\n <span class=\"solaris-row__content\">\r\n @if (col.cellDef?.template) {\r\n <ng-container [ngTemplateOutlet]=\"col.cellDef!.template\"\r\n [ngTemplateOutletContext]=\"{ $implicit: value, row: value, col: col }\"/>\r\n } @else {\r\n {{ table.readField(value, col.field) }}\r\n }\r\n </span>\r\n </div>\r\n }\r\n</div>\r\n", styles: [":host{display:block;--solaris-table-row-bg: transparent;--solaris-table-row-bg-hover: var(--solaris-table-row-hover-bg, var(--solaris-color-surface-2))}:host-context(.solaris-table--zebra):nth-child(2n){--solaris-table-row-bg: var(--solaris-color-surface-2)}:host-context(.solaris-table--zebra):nth-child(odd){--solaris-table-row-bg: var(--solaris-color-surface)}@supports (color: color-mix(in srgb,black 50%,white)){:host-context(.solaris-table--zebra):nth-child(2n){--solaris-table-row-bg-hover: color-mix(in srgb, var(--solaris-color-surface-2) 40%, var(--solaris-color-surface))}:host-context(.solaris-table--zebra):nth-child(odd){--solaris-table-row-bg-hover: color-mix(in srgb, var(--solaris-color-surface) 40%, var(--solaris-color-surface-2))}}.solaris-row{display:grid;align-items:stretch;background:var(--solaris-table-row-bg);transition:background .3s ease-in-out;border-bottom:1px solid var(--solaris-color-border)}.solaris-row:hover{background:var(--solaris-table-row-bg-hover)}.solaris-row.is-selected,.solaris-row.is-selected:hover{background:var(--solaris-table-row-selected-bg)}.solaris-row__cell{min-width:0;display:flex;align-items:center;align-self:stretch;gap:var(--solaris-space-3);padding:var(--solaris-space-4);border-right:var(--solaris-table-cell-divider)}.solaris-row__cell:last-child{border-right:none}.solaris-row__cell--select{justify-content:center}.align-end{justify-content:flex-end;text-align:right}.align-center{justify-content:center;text-align:center}.solaris-row__label{display:none;font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-row__content{overflow:hidden;white-space:nowrap;display:inline-block;text-overflow:ellipsis;font-size:var(--solaris-fs-14);color:var(--solaris-color-text-muted);max-width:var(--solaris-col-max, 100%)}.solaris-row__select-prefix{flex:0 0 auto;align-items:center;display:inline-flex}@media(max-width:768px){.solaris-row{display:block;border-bottom:none;padding:var(--solaris-space-4)}.solaris-row__cell{border-right:none;padding:var(--solaris-space-2) 0;align-items:flex-start;justify-content:space-between}.solaris-row__cell--select{justify-content:flex-end;padding-top:0}.solaris-row__label{display:inline;min-width:9rem}.solaris-row__content{max-width:100%;overflow:hidden;white-space:nowrap;display:inline-block;text-overflow:ellipsis}}\n"] }]
|
|
2894
|
+
}], ctorParameters: () => [{ type: SolarisTable, decorators: [{
|
|
2895
|
+
type: Optional
|
|
2896
|
+
}, {
|
|
2897
|
+
type: Host
|
|
2898
|
+
}] }], propDecorators: { rowKey: [{
|
|
2899
|
+
type: Input
|
|
2900
|
+
}], value: [{
|
|
2901
|
+
type: Input,
|
|
2902
|
+
args: [{ required: true }]
|
|
2903
|
+
}] } });
|
|
2904
|
+
|
|
2905
|
+
class SolarisHeaderDirective {
|
|
2906
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2907
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisHeaderDirective, isStandalone: true, selector: "[solaris-header]", ngImport: i0 });
|
|
2908
|
+
}
|
|
2909
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisHeaderDirective, decorators: [{
|
|
2910
|
+
type: Directive,
|
|
2911
|
+
args: [{
|
|
2912
|
+
selector: '[solaris-header]',
|
|
2913
|
+
standalone: true,
|
|
2914
|
+
}]
|
|
2915
|
+
}] });
|
|
2916
|
+
|
|
2917
|
+
class SolarisFooterDirective {
|
|
2918
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2919
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisFooterDirective, isStandalone: true, selector: "[solaris-footer]", ngImport: i0 });
|
|
2920
|
+
}
|
|
2921
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFooterDirective, decorators: [{
|
|
2922
|
+
type: Directive,
|
|
2923
|
+
args: [{
|
|
2924
|
+
selector: '[solaris-footer]',
|
|
2925
|
+
standalone: true,
|
|
2926
|
+
}]
|
|
2927
|
+
}] });
|
|
2928
|
+
|
|
2929
|
+
class SolarisBodyDirective {
|
|
2930
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisBodyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2931
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisBodyDirective, isStandalone: true, selector: "[solaris-body]", ngImport: i0 });
|
|
2932
|
+
}
|
|
2933
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisBodyDirective, decorators: [{
|
|
2934
|
+
type: Directive,
|
|
2935
|
+
args: [{
|
|
2936
|
+
selector: '[solaris-body]',
|
|
2937
|
+
standalone: true,
|
|
2938
|
+
}]
|
|
2939
|
+
}] });
|
|
2940
|
+
|
|
2941
|
+
class SolarisPage {
|
|
2942
|
+
stickyHeader = false;
|
|
2943
|
+
container = 'contained';
|
|
2944
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2945
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisPage, isStandalone: true, selector: "solaris-page", inputs: { stickyHeader: "stickyHeader", container: "container" }, host: { classAttribute: "solaris-page-host" }, ngImport: i0, template: "<div class=\"solaris-page\" [ngClass]=\"['container-' + container]\">\r\n <header class=\"solaris-page__header\" [ngClass]=\"{ 'is-sticky': stickyHeader }\">\r\n <ng-content select=\"[solaris-header]\"></ng-content>\r\n @if (stickyHeader) { <solaris-divider class=\"solaris-page__header-divider\"/> }\r\n </header>\r\n\r\n <main class=\"solaris-page__body\">\r\n <ng-content select=\"[solaris-body]\"></ng-content>\r\n </main>\r\n\r\n <footer class=\"solaris-page__footer\">\r\n <solaris-divider class=\"solaris-page__footer-divider\"/>\r\n\r\n <div class=\"solaris-page__footer-content\">\r\n <ng-content select=\"[solaris-footer]\"></ng-content>\r\n </div>\r\n </footer>\r\n</div>\r\n", styles: [":host.solaris-page-host{display:block}.solaris-page{--solaris-page-gap: var(--solaris-space-8);--solaris-header-gap: var(--solaris-space-4);--solaris-footer-gap: var(--solaris-space-4);--solaris-page-padding-x: var(--solaris-space-8);--solaris-page-padding-y: var(--solaris-space-8);display:grid;min-height:100%;gap:var(--solaris-page-gap);color:var(--solaris-color-text);grid-template-rows:auto 1fr auto;padding:var(--solaris-page-padding-y) var(--solaris-page-padding-x)}.solaris-page.container-contained{margin-inline:auto}.solaris-page.container-fluid{max-width:none}.solaris-page__header{display:flex;flex-direction:column;gap:var(--solaris-header-gap)}.solaris-page__header.is-sticky{position:sticky;top:0;-webkit-backdrop-filter:blur(1rem);backdrop-filter:blur(1rem);z-index:var(--solaris-z-sticky, 100);padding:var(--solaris-page-padding-y) var(--solaris-page-padding-x) var(--solaris-space-4)}.solaris-page__body{min-width:0;display:flex;flex-direction:column;gap:var(--solaris-space-8)}.solaris-page__footer{display:flex;align-items:center;justify-content:space-between;gap:var(--solaris-footer-gap);padding-top:var(--solaris-space-4)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: SolarisDivider, selector: "solaris-divider", inputs: ["label", "inset", "spacing", "variant", "strength", "orientation", "label-align"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2946
|
+
}
|
|
2947
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPage, decorators: [{
|
|
2948
|
+
type: Component,
|
|
2949
|
+
args: [{ selector: 'solaris-page', standalone: true, imports: [NgClass, SolarisDivider], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
2950
|
+
class: 'solaris-page-host',
|
|
2951
|
+
}, template: "<div class=\"solaris-page\" [ngClass]=\"['container-' + container]\">\r\n <header class=\"solaris-page__header\" [ngClass]=\"{ 'is-sticky': stickyHeader }\">\r\n <ng-content select=\"[solaris-header]\"></ng-content>\r\n @if (stickyHeader) { <solaris-divider class=\"solaris-page__header-divider\"/> }\r\n </header>\r\n\r\n <main class=\"solaris-page__body\">\r\n <ng-content select=\"[solaris-body]\"></ng-content>\r\n </main>\r\n\r\n <footer class=\"solaris-page__footer\">\r\n <solaris-divider class=\"solaris-page__footer-divider\"/>\r\n\r\n <div class=\"solaris-page__footer-content\">\r\n <ng-content select=\"[solaris-footer]\"></ng-content>\r\n </div>\r\n </footer>\r\n</div>\r\n", styles: [":host.solaris-page-host{display:block}.solaris-page{--solaris-page-gap: var(--solaris-space-8);--solaris-header-gap: var(--solaris-space-4);--solaris-footer-gap: var(--solaris-space-4);--solaris-page-padding-x: var(--solaris-space-8);--solaris-page-padding-y: var(--solaris-space-8);display:grid;min-height:100%;gap:var(--solaris-page-gap);color:var(--solaris-color-text);grid-template-rows:auto 1fr auto;padding:var(--solaris-page-padding-y) var(--solaris-page-padding-x)}.solaris-page.container-contained{margin-inline:auto}.solaris-page.container-fluid{max-width:none}.solaris-page__header{display:flex;flex-direction:column;gap:var(--solaris-header-gap)}.solaris-page__header.is-sticky{position:sticky;top:0;-webkit-backdrop-filter:blur(1rem);backdrop-filter:blur(1rem);z-index:var(--solaris-z-sticky, 100);padding:var(--solaris-page-padding-y) var(--solaris-page-padding-x) var(--solaris-space-4)}.solaris-page__body{min-width:0;display:flex;flex-direction:column;gap:var(--solaris-space-8)}.solaris-page__footer{display:flex;align-items:center;justify-content:space-between;gap:var(--solaris-footer-gap);padding-top:var(--solaris-space-4)}\n"] }]
|
|
2952
|
+
}], propDecorators: { stickyHeader: [{
|
|
2953
|
+
type: Input
|
|
2954
|
+
}], container: [{
|
|
2955
|
+
type: Input
|
|
2956
|
+
}] } });
|
|
2957
|
+
|
|
2958
|
+
class SolarisPageHeaderDescriptionDirective {
|
|
2959
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPageHeaderDescriptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2960
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisPageHeaderDescriptionDirective, isStandalone: true, selector: "[solaris-page-header-description]", ngImport: i0 });
|
|
2961
|
+
}
|
|
2962
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPageHeaderDescriptionDirective, decorators: [{
|
|
2963
|
+
type: Directive,
|
|
2964
|
+
args: [{
|
|
2965
|
+
selector: '[solaris-page-header-description]',
|
|
2966
|
+
standalone: true,
|
|
2967
|
+
}]
|
|
2968
|
+
}] });
|
|
2969
|
+
|
|
2970
|
+
class SolarisPageHeaderBreadcrumbDirective {
|
|
2971
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPageHeaderBreadcrumbDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1059
2972
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisPageHeaderBreadcrumbDirective, isStandalone: true, selector: "[solaris-page-header-breadcrumb]", ngImport: i0 });
|
|
1060
2973
|
}
|
|
1061
2974
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPageHeaderBreadcrumbDirective, decorators: [{
|
|
@@ -1142,129 +3055,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
1142
3055
|
args: [SolarisPageHeaderDescriptionDirective]
|
|
1143
3056
|
}] } });
|
|
1144
3057
|
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
class SolarisButtonDirective {
|
|
1162
|
-
el = inject((ElementRef));
|
|
1163
|
-
isAnchor = computed(() => this.el.nativeElement.tagName.toLowerCase() === 'a', ...(ngDevMode ? [{ debugName: "isAnchor" }] : []));
|
|
1164
|
-
_loading = signal(false, ...(ngDevMode ? [{ debugName: "_loading" }] : []));
|
|
1165
|
-
_disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
1166
|
-
_iconOnly = signal(false, ...(ngDevMode ? [{ debugName: "_iconOnly" }] : []));
|
|
1167
|
-
_fullWidth = signal(false, ...(ngDevMode ? [{ debugName: "_fullWidth" }] : []));
|
|
1168
|
-
_size = signal('md', ...(ngDevMode ? [{ debugName: "_size" }] : []));
|
|
1169
|
-
_color = signal('primary', ...(ngDevMode ? [{ debugName: "_color" }] : []));
|
|
1170
|
-
_variant = signal('solid', ...(ngDevMode ? [{ debugName: "_variant" }] : []));
|
|
1171
|
-
set size(v) { if (v)
|
|
1172
|
-
this._size.set(v); }
|
|
1173
|
-
set color(v) { if (v)
|
|
1174
|
-
this._color.set(v); }
|
|
1175
|
-
set fullWidth(v) {
|
|
1176
|
-
this._fullWidth.set(v);
|
|
1177
|
-
}
|
|
1178
|
-
set variant(v) { if (v)
|
|
1179
|
-
this._variant.set(v); }
|
|
1180
|
-
set loading(v) { this._loading.set(v); }
|
|
1181
|
-
set disabled(v) { this._disabled.set(v); }
|
|
1182
|
-
set iconOnly(v) { this._iconOnly.set(v); }
|
|
1183
|
-
get tabIndex() {
|
|
1184
|
-
return this.isAnchor() && (this._disabled() || this._loading()) ? -1 : null;
|
|
1185
|
-
}
|
|
1186
|
-
get nativeDisabled() {
|
|
1187
|
-
const isButton = !this.isAnchor();
|
|
1188
|
-
return isButton && (this._disabled() || this._loading()) ? '' : null;
|
|
3058
|
+
function resolveRadius(v) {
|
|
3059
|
+
const s = String(v).trim();
|
|
3060
|
+
switch (s) {
|
|
3061
|
+
case 'none':
|
|
3062
|
+
return '0';
|
|
3063
|
+
case 'sm':
|
|
3064
|
+
return 'var(--solaris-radius-sm)';
|
|
3065
|
+
case 'md':
|
|
3066
|
+
return 'var(--solaris-radius-md, var(--solaris-radius-sm))';
|
|
3067
|
+
case 'lg':
|
|
3068
|
+
return 'var(--solaris-radius-lg, var(--solaris-radius-md, var(--solaris-radius-sm)))';
|
|
3069
|
+
case 'full':
|
|
3070
|
+
return 'var(--solaris-radius-full)';
|
|
3071
|
+
default:
|
|
3072
|
+
return s;
|
|
1189
3073
|
}
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
3074
|
+
}
|
|
3075
|
+
class ButtonGroupDirective {
|
|
3076
|
+
_radius = null;
|
|
3077
|
+
set radius(v) {
|
|
3078
|
+
this._radius = v == null || String(v).trim() === '' ? null : (v);
|
|
1193
3079
|
}
|
|
1194
|
-
|
|
1195
|
-
get
|
|
1196
|
-
|
|
1197
|
-
get ariaBusy() { return this._loading() ? 'true' : null; }
|
|
1198
|
-
get dataIconOnly() { return this._iconOnly() ? 'true' : null; }
|
|
1199
|
-
get dataFullWidth() { return this._fullWidth() ? 'true' : null; }
|
|
1200
|
-
onClick(ev) {
|
|
1201
|
-
if (!this.isAnchor())
|
|
1202
|
-
return;
|
|
1203
|
-
if (this._disabled() || this._loading()) {
|
|
1204
|
-
ev.preventDefault();
|
|
1205
|
-
ev.stopImmediatePropagation();
|
|
1206
|
-
}
|
|
3080
|
+
attr = '';
|
|
3081
|
+
get groupRadius() {
|
|
3082
|
+
return this._radius ? resolveRadius(this._radius) : null;
|
|
1207
3083
|
}
|
|
1208
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
1209
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
3084
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ButtonGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3085
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: ButtonGroupDirective, isStandalone: true, selector: "[solaris-button-group]", inputs: { radius: "radius" }, host: { properties: { "attr.solaris-button-group": "this.attr", "style.--solaris-button-group-radius": "this.groupRadius" } }, ngImport: i0 });
|
|
1210
3086
|
}
|
|
1211
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
3087
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ButtonGroupDirective, decorators: [{
|
|
1212
3088
|
type: Directive,
|
|
1213
3089
|
args: [{
|
|
1214
|
-
selector: '
|
|
3090
|
+
selector: '[solaris-button-group]',
|
|
1215
3091
|
standalone: true,
|
|
1216
3092
|
}]
|
|
1217
|
-
}], propDecorators: {
|
|
1218
|
-
type: Input
|
|
1219
|
-
}], color: [{
|
|
1220
|
-
type: Input
|
|
1221
|
-
}], fullWidth: [{
|
|
1222
|
-
type: Input,
|
|
1223
|
-
args: [{ transform: booleanAttribute }]
|
|
1224
|
-
}], variant: [{
|
|
3093
|
+
}], propDecorators: { radius: [{
|
|
1225
3094
|
type: Input
|
|
1226
|
-
}], loading: [{
|
|
1227
|
-
type: Input,
|
|
1228
|
-
args: [{ transform: booleanAttribute }]
|
|
1229
|
-
}], disabled: [{
|
|
1230
|
-
type: Input,
|
|
1231
|
-
args: [{ transform: booleanAttribute }]
|
|
1232
|
-
}], iconOnly: [{
|
|
1233
|
-
type: Input,
|
|
1234
|
-
args: [{ transform: booleanAttribute }]
|
|
1235
|
-
}], tabIndex: [{
|
|
1236
|
-
type: HostBinding,
|
|
1237
|
-
args: ['attr.tabindex']
|
|
1238
|
-
}], nativeDisabled: [{
|
|
1239
|
-
type: HostBinding,
|
|
1240
|
-
args: ['attr.disabled']
|
|
1241
3095
|
}], attr: [{
|
|
1242
3096
|
type: HostBinding,
|
|
1243
|
-
args: ['attr.solaris-button']
|
|
1244
|
-
}],
|
|
1245
|
-
type: HostBinding,
|
|
1246
|
-
args: ['attr.aria-disabled']
|
|
1247
|
-
}], dataSize: [{
|
|
1248
|
-
type: HostBinding,
|
|
1249
|
-
args: ['attr.data-size']
|
|
1250
|
-
}], dataColor: [{
|
|
1251
|
-
type: HostBinding,
|
|
1252
|
-
args: ['attr.data-color']
|
|
1253
|
-
}], dataVariant: [{
|
|
1254
|
-
type: HostBinding,
|
|
1255
|
-
args: ['attr.data-variant']
|
|
1256
|
-
}], ariaBusy: [{
|
|
1257
|
-
type: HostBinding,
|
|
1258
|
-
args: ['attr.aria-busy']
|
|
1259
|
-
}], dataIconOnly: [{
|
|
1260
|
-
type: HostBinding,
|
|
1261
|
-
args: ['attr.data-icon-only']
|
|
1262
|
-
}], dataFullWidth: [{
|
|
3097
|
+
args: ['attr.solaris-button-group']
|
|
3098
|
+
}], groupRadius: [{
|
|
1263
3099
|
type: HostBinding,
|
|
1264
|
-
args: ['
|
|
1265
|
-
}], onClick: [{
|
|
1266
|
-
type: HostListener,
|
|
1267
|
-
args: ['click', ['$event']]
|
|
3100
|
+
args: ['style.--solaris-button-group-radius']
|
|
1268
3101
|
}] } });
|
|
1269
3102
|
|
|
1270
3103
|
function sanitizePhoneInput(v) {
|
|
@@ -1882,7 +3715,7 @@ class SolarisPasswordDirective {
|
|
|
1882
3715
|
this._onChange = fn;
|
|
1883
3716
|
}
|
|
1884
3717
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPasswordDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1885
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisPasswordDirective, isStandalone: true, selector: "input[solaris-password]
|
|
3718
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisPasswordDirective, isStandalone: true, selector: "input[solaris-password]", inputs: { minLength: "minLength", requireUpper: "requireUpper", requireLower: "requireLower", requireNumber: "requireNumber", requireSpecial: "requireSpecial", requireUpperKebab: "requireUpperKebab", requireLowerKebab: "requireLowerKebab", requireNumberKebab: "requireNumberKebab", minLengthKebab: "minLengthKebab", requireSpecialKebab: "requireSpecialKebab" }, host: { properties: { "attr.type": "this.type", "attr.spellcheck": "this.spellcheck", "attr.solaris-password": "this.marker", "attr.solaris-input": "this.solarisInput", "attr.autocapitalize": "this.autocapitalize", "attr.autocomplete": "this.autocomplete" } }, providers: [
|
|
1886
3719
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => SolarisPasswordDirective), multi: true },
|
|
1887
3720
|
{ provide: SOLARIS_FORM_FIELD_FEATURES, useValue: { kind: 'password' }, multi: true }
|
|
1888
3721
|
], ngImport: i0 });
|
|
@@ -1890,7 +3723,7 @@ class SolarisPasswordDirective {
|
|
|
1890
3723
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPasswordDirective, decorators: [{
|
|
1891
3724
|
type: Directive,
|
|
1892
3725
|
args: [{
|
|
1893
|
-
selector: 'input[solaris-password]
|
|
3726
|
+
selector: 'input[solaris-password]',
|
|
1894
3727
|
standalone: true,
|
|
1895
3728
|
providers: [
|
|
1896
3729
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => SolarisPasswordDirective), multi: true },
|
|
@@ -2108,6 +3941,8 @@ class FormField {
|
|
|
2108
3941
|
hintKey = '';
|
|
2109
3942
|
labelKey = '';
|
|
2110
3943
|
invalid = null;
|
|
3944
|
+
radius = 'sm';
|
|
3945
|
+
appearance = 'filled';
|
|
2111
3946
|
showErrors = 'dirtyOrTouched';
|
|
2112
3947
|
_tick = signal(0, ...(ngDevMode ? [{ debugName: "_tick" }] : []));
|
|
2113
3948
|
constructor() {
|
|
@@ -2184,17 +4019,17 @@ class FormField {
|
|
|
2184
4019
|
return 'solaris.validation.invalid';
|
|
2185
4020
|
}, ...(ngDevMode ? [{ debugName: "errorKey" }] : []));
|
|
2186
4021
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: FormField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2187
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: FormField, isStandalone: true, selector: "solaris-form-field", inputs: { hint: "hint", label: "label", hintKey: "hintKey", labelKey: "labelKey", invalid: "invalid", showErrors: "showErrors" }, providers: [
|
|
4022
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: FormField, isStandalone: true, selector: "solaris-form-field", inputs: { hint: "hint", label: "label", hintKey: "hintKey", labelKey: "labelKey", invalid: "invalid", radius: "radius", appearance: "appearance", showErrors: "showErrors" }, providers: [
|
|
2188
4023
|
SolarisFormFieldController,
|
|
2189
4024
|
{ provide: SOLARIS_FORM_FIELD_CONTROLLER, useExisting: SolarisFormFieldController },
|
|
2190
|
-
], queries: [{ propertyName: "prefix", first: true, predicate: SolarisPrefixDirective, descendants: true }, { propertyName: "suffix", first: true, predicate: SolarisSuffixDirective, descendants: true }], ngImport: i0, template: "<div class=\"solaris-form-field\" [class.solaris-form-field--has-prefix]=\"hasPrefix\"\r\n [attr.data-invalid]=\"invalidComputed() ? 'true' : null\">\r\n @if ((label || labelKey)) {\r\n <label class=\"solaris-form-field__label\">\r\n @if (labelKey) { {{ labelKey | translate }} }\r\n @else if (label) { {{ label }} }\r\n </label>\r\n }\r\n\r\n <div class=\"solaris-form-field__frame\">\r\n @if (hasPrefix) {\r\n <span class=\"solaris-form-field__prefix\" aria-hidden=\"true\">\r\n <ng-content select=\"[solaris-prefix]\"></ng-content>\r\n </span>\r\n }\r\n\r\n <div class=\"solaris-form-field__body\">\r\n <div class=\"solaris-form-field__control-slot\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n @if (hasSuffix || showPasswordToggle() || invalidComputed()) {\r\n <span class=\"solaris-form-field__suffix\">\r\n <ng-content select=\"[solaris-suffix]\"></ng-content>\r\n\r\n @if (showPasswordToggle()) {\r\n <solaris-password-toggle></solaris-password-toggle>\r\n }\r\n\r\n @if (invalidComputed()) {\r\n <span class=\"solaris-form-field__status\" aria-hidden=\"true\">\r\n <i class=\"ph ph-warning-circle\"></i>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (errorKey()) {\r\n <solaris-field-error [textKey]=\"errorKey()\" [textParams]=\"errorParams()\"></solaris-field-error>\r\n } @else {\r\n <ng-content select=\"[form-field-message]\"></ng-content>\r\n }\r\n\r\n @if (hint || hintKey) {\r\n <div class=\"solaris-form-field__hint\">\r\n @if (hintKey) { {{ hintKey | translate }} }\r\n @else { {{ hint }} }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".solaris-form-field{display:grid;gap:var(--solaris-space-2)}.solaris-form-field__label{font-weight:600;font-size:var(--solaris-fs-14);color:var(--solaris-color-text);margin-left:var(--solaris-space-1)}.solaris-form-field__frame{display:grid;min-height:3.8rem;align-items:stretch;grid-template-columns:1fr;
|
|
4025
|
+
], queries: [{ propertyName: "prefix", first: true, predicate: SolarisPrefixDirective, descendants: true }, { propertyName: "suffix", first: true, predicate: SolarisSuffixDirective, descendants: true }], ngImport: i0, template: "<div class=\"solaris-form-field\" [class.solaris-form-field--has-prefix]=\"hasPrefix\" [attr.data-appearance]=\"appearance\"\r\n [attr.data-invalid]=\"invalidComputed() ? 'true' : null\" [attr.data-radius]=\"radius\">\r\n @if ((label || labelKey)) {\r\n <label class=\"solaris-form-field__label\">\r\n @if (labelKey) { {{ labelKey | translate }} }\r\n @else if (label) { {{ label }} }\r\n </label>\r\n }\r\n\r\n <div class=\"solaris-form-field__frame\">\r\n @if (hasPrefix) {\r\n <span class=\"solaris-form-field__prefix\" aria-hidden=\"true\">\r\n <ng-content select=\"[solaris-prefix]\"></ng-content>\r\n </span>\r\n }\r\n\r\n <div class=\"solaris-form-field__body\">\r\n <div class=\"solaris-form-field__control-slot\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n @if (hasSuffix || showPasswordToggle() || invalidComputed()) {\r\n <span class=\"solaris-form-field__suffix\">\r\n <ng-content select=\"[solaris-suffix]\"></ng-content>\r\n\r\n @if (showPasswordToggle()) {\r\n <solaris-password-toggle></solaris-password-toggle>\r\n }\r\n\r\n @if (invalidComputed()) {\r\n <span class=\"solaris-form-field__status\" aria-hidden=\"true\">\r\n <i class=\"ph ph-warning-circle\"></i>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (errorKey()) {\r\n <solaris-field-error [textKey]=\"errorKey()\" [textParams]=\"errorParams()\"></solaris-field-error>\r\n } @else {\r\n <ng-content select=\"[form-field-message]\"></ng-content>\r\n }\r\n\r\n @if (hint || hintKey) {\r\n <div class=\"solaris-form-field__hint\">\r\n @if (hintKey) { {{ hintKey | translate }} }\r\n @else { {{ hint }} }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".solaris-form-field{display:grid;gap:var(--solaris-space-2);--solaris-form-field-radius: var(--solaris-radius-sm);--solaris-form-field-bg: var(--solaris-color-surface-2);--solaris-form-field-border: var(--solaris-color-border);--solaris-form-field-border-hover: color-mix(in srgb, var(--solaris-color-border) 70%, var(--solaris-color-text-muted))}.solaris-form-field[data-radius=none]{--solaris-form-field-radius: var(--solaris-radius-none)}.solaris-form-field[data-radius=xs]{--solaris-form-field-radius: var(--solaris-radius-xs)}.solaris-form-field[data-radius=sm]{--solaris-form-field-radius: var(--solaris-radius-sm)}.solaris-form-field[data-radius=md]{--solaris-form-field-radius: var(--solaris-radius-md)}.solaris-form-field[data-radius=lg]{--solaris-form-field-radius: var(--solaris-radius-lg)}.solaris-form-field[data-radius=full]{--solaris-form-field-radius: var(--solaris-radius-full)}.solaris-form-field[data-appearance=outline]{--solaris-form-field-bg: transparent;--solaris-form-field-border: color-mix(in srgb, var(--solaris-color-border) 85%, transparent);--solaris-form-field-border-hover: color-mix(in srgb, var(--solaris-color-border) 65%, var(--solaris-color-text-muted))}.solaris-form-field__label{font-weight:600;font-size:var(--solaris-fs-14);color:var(--solaris-color-text);margin-left:var(--solaris-space-1)}.solaris-form-field__frame{display:grid;min-height:3.8rem;align-items:stretch;grid-template-columns:1fr;background:var(--solaris-form-field-bg);border-radius:var(--solaris-form-field-radius);border:1px solid var(--solaris-form-field-border);transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.solaris-form-field--has-prefix .solaris-form-field__frame{grid-template-columns:3.8rem 1fr}.solaris-form-field__prefix{opacity:.5;display:grid;width:3.8rem;line-height:0;place-items:center;font-size:var(--solaris-fs-14);color:var(--solaris-color-text-muted);transition:opacity .3s ease,filter .3s ease;border-right:1px solid color-mix(in srgb,var(--solaris-color-border) 85%,transparent)}.solaris-form-field__frame:hover .solaris-form-field__prefix,.solaris-form-field__frame:focus-within .solaris-form-field__prefix{opacity:1;filter:brightness(1.05)}.solaris-form-field__prefix :is(i,svg,[solarisPrefixIcon]){display:block;line-height:1}.solaris-form-field__prefix i.ph{opacity:.6;font-size:var(--solaris-fs-18)}.solaris-form-field__prefix svg{width:var(--solaris-fs-18);height:var(--solaris-fs-18)}.solaris-form-field__body{min-width:0;display:grid;padding-right:0;position:relative;align-items:center;padding-left:var(--solaris-space-3);grid-template-columns:minmax(0,1fr) auto}.solaris-form-field__control-slot{width:100%;min-width:0;display:flex;flex:1 1 auto;align-items:center}.solaris-form-field__control-slot>*{flex:1 1 0;width:100%;min-width:0}.solaris-form-field__control-slot :is(input,textarea){margin:0;border:0;width:100%;min-width:0;outline:none;padding:.9rem 0;background:transparent;font-size:var(--solaris-fs-14);color:var(--solaris-color-text);line-height:var(--solaris-lh-normal)}.solaris-form-field__control-slot :is(input,textarea)::placeholder{opacity:.9;color:var(--solaris-color-text-muted)}.solaris-form-field__suffix{display:inline-flex;align-items:center;justify-content:center;padding-right:var(--solaris-space-3);gap:var(--solaris-space-2)}.solaris-form-field__suffix :is(button,a){height:3.6rem;align-self:stretch;align-items:center;display:inline-flex}.solaris-form-field__status{width:3.8rem;display:grid;opacity:.95;height:3.8rem;place-items:center;color:var(--solaris-color-error)}.solaris-form-field__status i.ph{line-height:1;font-size:var(--solaris-fs-18)}.solaris-form-field__hint{font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-form-field__frame:has(:is(input,textarea,button)[disabled]){opacity:.45}.solaris-form-field__frame:has(:is(input,textarea,button)[disabled]) .solaris-form-field__prefix,.solaris-form-field__frame:has(:is(input,textarea,button)[disabled]) :is(.solaris-form-field__label,.solaris-form-field__hint){color:var(--solaris-color-text-muted)}.solaris-form-field__frame:has(:focus-visible){box-shadow:0 0 .5rem .25rem color-mix(in srgb,var(--solaris-color-primary) 5%,transparent);border-color:color-mix(in srgb,var(--solaris-color-primary) 70%,var(--solaris-color-border))}.solaris-form-field[data-invalid=true] .solaris-form-field__frame{box-shadow:0 0 .5rem .25rem color-mix(in srgb,var(--solaris-color-error) 5%,transparent);border-color:color-mix(in srgb,var(--solaris-color-error) 70%,var(--solaris-color-border))}.solaris-form-field[data-invalid=true] .solaris-form-field__frame:focus-within{border-color:color-mix(in srgb,var(--solaris-color-error) 80%,var(--solaris-color-border));box-shadow:0 0 .5rem .25rem color-mix(in srgb,var(--solaris-color-error) 16%,transparent)}.solaris-form-field[data-invalid=true] .solaris-form-field__prefix{border-right-color:color-mix(in srgb,var(--solaris-color-error) 30%,var(--solaris-color-border));color:color-mix(in srgb,var(--solaris-color-error) 75%,var(--solaris-color-text-muted))}.solaris-form-field[data-invalid=true] .solaris-form-field__control-slot :is(input,textarea)::placeholder{color:color-mix(in srgb,var(--solaris-color-error) 45%,var(--solaris-color-text-muted))}.solaris-form-field__body:has(solaris-phone-input){padding-left:0}\n"], dependencies: [{ kind: "component", type: PasswordToggle, selector: "solaris-password-toggle" }, { kind: "component", type: FieldErrorComponent, selector: "solaris-field-error", inputs: ["text", "textKey", "textParams"] }, { kind: "pipe", type: SolarisTranslationPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2191
4026
|
}
|
|
2192
4027
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: FormField, decorators: [{
|
|
2193
4028
|
type: Component,
|
|
2194
4029
|
args: [{ selector: 'solaris-form-field', standalone: true, imports: [PasswordToggle, FieldErrorComponent, SolarisTranslationPipe], providers: [
|
|
2195
4030
|
SolarisFormFieldController,
|
|
2196
4031
|
{ provide: SOLARIS_FORM_FIELD_CONTROLLER, useExisting: SolarisFormFieldController },
|
|
2197
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"solaris-form-field\" [class.solaris-form-field--has-prefix]=\"hasPrefix\"\r\n [attr.data-invalid]=\"invalidComputed() ? 'true' : null\">\r\n @if ((label || labelKey)) {\r\n <label class=\"solaris-form-field__label\">\r\n @if (labelKey) { {{ labelKey | translate }} }\r\n @else if (label) { {{ label }} }\r\n </label>\r\n }\r\n\r\n <div class=\"solaris-form-field__frame\">\r\n @if (hasPrefix) {\r\n <span class=\"solaris-form-field__prefix\" aria-hidden=\"true\">\r\n <ng-content select=\"[solaris-prefix]\"></ng-content>\r\n </span>\r\n }\r\n\r\n <div class=\"solaris-form-field__body\">\r\n <div class=\"solaris-form-field__control-slot\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n @if (hasSuffix || showPasswordToggle() || invalidComputed()) {\r\n <span class=\"solaris-form-field__suffix\">\r\n <ng-content select=\"[solaris-suffix]\"></ng-content>\r\n\r\n @if (showPasswordToggle()) {\r\n <solaris-password-toggle></solaris-password-toggle>\r\n }\r\n\r\n @if (invalidComputed()) {\r\n <span class=\"solaris-form-field__status\" aria-hidden=\"true\">\r\n <i class=\"ph ph-warning-circle\"></i>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (errorKey()) {\r\n <solaris-field-error [textKey]=\"errorKey()\" [textParams]=\"errorParams()\"></solaris-field-error>\r\n } @else {\r\n <ng-content select=\"[form-field-message]\"></ng-content>\r\n }\r\n\r\n @if (hint || hintKey) {\r\n <div class=\"solaris-form-field__hint\">\r\n @if (hintKey) { {{ hintKey | translate }} }\r\n @else { {{ hint }} }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".solaris-form-field{display:grid;gap:var(--solaris-space-2)}.solaris-form-field__label{font-weight:600;font-size:var(--solaris-fs-14);color:var(--solaris-color-text);margin-left:var(--solaris-space-1)}.solaris-form-field__frame{display:grid;min-height:3.8rem;align-items:stretch;grid-template-columns:1fr;
|
|
4032
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"solaris-form-field\" [class.solaris-form-field--has-prefix]=\"hasPrefix\" [attr.data-appearance]=\"appearance\"\r\n [attr.data-invalid]=\"invalidComputed() ? 'true' : null\" [attr.data-radius]=\"radius\">\r\n @if ((label || labelKey)) {\r\n <label class=\"solaris-form-field__label\">\r\n @if (labelKey) { {{ labelKey | translate }} }\r\n @else if (label) { {{ label }} }\r\n </label>\r\n }\r\n\r\n <div class=\"solaris-form-field__frame\">\r\n @if (hasPrefix) {\r\n <span class=\"solaris-form-field__prefix\" aria-hidden=\"true\">\r\n <ng-content select=\"[solaris-prefix]\"></ng-content>\r\n </span>\r\n }\r\n\r\n <div class=\"solaris-form-field__body\">\r\n <div class=\"solaris-form-field__control-slot\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n @if (hasSuffix || showPasswordToggle() || invalidComputed()) {\r\n <span class=\"solaris-form-field__suffix\">\r\n <ng-content select=\"[solaris-suffix]\"></ng-content>\r\n\r\n @if (showPasswordToggle()) {\r\n <solaris-password-toggle></solaris-password-toggle>\r\n }\r\n\r\n @if (invalidComputed()) {\r\n <span class=\"solaris-form-field__status\" aria-hidden=\"true\">\r\n <i class=\"ph ph-warning-circle\"></i>\r\n </span>\r\n }\r\n </span>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (errorKey()) {\r\n <solaris-field-error [textKey]=\"errorKey()\" [textParams]=\"errorParams()\"></solaris-field-error>\r\n } @else {\r\n <ng-content select=\"[form-field-message]\"></ng-content>\r\n }\r\n\r\n @if (hint || hintKey) {\r\n <div class=\"solaris-form-field__hint\">\r\n @if (hintKey) { {{ hintKey | translate }} }\r\n @else { {{ hint }} }\r\n </div>\r\n }\r\n</div>\r\n", styles: [".solaris-form-field{display:grid;gap:var(--solaris-space-2);--solaris-form-field-radius: var(--solaris-radius-sm);--solaris-form-field-bg: var(--solaris-color-surface-2);--solaris-form-field-border: var(--solaris-color-border);--solaris-form-field-border-hover: color-mix(in srgb, var(--solaris-color-border) 70%, var(--solaris-color-text-muted))}.solaris-form-field[data-radius=none]{--solaris-form-field-radius: var(--solaris-radius-none)}.solaris-form-field[data-radius=xs]{--solaris-form-field-radius: var(--solaris-radius-xs)}.solaris-form-field[data-radius=sm]{--solaris-form-field-radius: var(--solaris-radius-sm)}.solaris-form-field[data-radius=md]{--solaris-form-field-radius: var(--solaris-radius-md)}.solaris-form-field[data-radius=lg]{--solaris-form-field-radius: var(--solaris-radius-lg)}.solaris-form-field[data-radius=full]{--solaris-form-field-radius: var(--solaris-radius-full)}.solaris-form-field[data-appearance=outline]{--solaris-form-field-bg: transparent;--solaris-form-field-border: color-mix(in srgb, var(--solaris-color-border) 85%, transparent);--solaris-form-field-border-hover: color-mix(in srgb, var(--solaris-color-border) 65%, var(--solaris-color-text-muted))}.solaris-form-field__label{font-weight:600;font-size:var(--solaris-fs-14);color:var(--solaris-color-text);margin-left:var(--solaris-space-1)}.solaris-form-field__frame{display:grid;min-height:3.8rem;align-items:stretch;grid-template-columns:1fr;background:var(--solaris-form-field-bg);border-radius:var(--solaris-form-field-radius);border:1px solid var(--solaris-form-field-border);transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.solaris-form-field--has-prefix .solaris-form-field__frame{grid-template-columns:3.8rem 1fr}.solaris-form-field__prefix{opacity:.5;display:grid;width:3.8rem;line-height:0;place-items:center;font-size:var(--solaris-fs-14);color:var(--solaris-color-text-muted);transition:opacity .3s ease,filter .3s ease;border-right:1px solid color-mix(in srgb,var(--solaris-color-border) 85%,transparent)}.solaris-form-field__frame:hover .solaris-form-field__prefix,.solaris-form-field__frame:focus-within .solaris-form-field__prefix{opacity:1;filter:brightness(1.05)}.solaris-form-field__prefix :is(i,svg,[solarisPrefixIcon]){display:block;line-height:1}.solaris-form-field__prefix i.ph{opacity:.6;font-size:var(--solaris-fs-18)}.solaris-form-field__prefix svg{width:var(--solaris-fs-18);height:var(--solaris-fs-18)}.solaris-form-field__body{min-width:0;display:grid;padding-right:0;position:relative;align-items:center;padding-left:var(--solaris-space-3);grid-template-columns:minmax(0,1fr) auto}.solaris-form-field__control-slot{width:100%;min-width:0;display:flex;flex:1 1 auto;align-items:center}.solaris-form-field__control-slot>*{flex:1 1 0;width:100%;min-width:0}.solaris-form-field__control-slot :is(input,textarea){margin:0;border:0;width:100%;min-width:0;outline:none;padding:.9rem 0;background:transparent;font-size:var(--solaris-fs-14);color:var(--solaris-color-text);line-height:var(--solaris-lh-normal)}.solaris-form-field__control-slot :is(input,textarea)::placeholder{opacity:.9;color:var(--solaris-color-text-muted)}.solaris-form-field__suffix{display:inline-flex;align-items:center;justify-content:center;padding-right:var(--solaris-space-3);gap:var(--solaris-space-2)}.solaris-form-field__suffix :is(button,a){height:3.6rem;align-self:stretch;align-items:center;display:inline-flex}.solaris-form-field__status{width:3.8rem;display:grid;opacity:.95;height:3.8rem;place-items:center;color:var(--solaris-color-error)}.solaris-form-field__status i.ph{line-height:1;font-size:var(--solaris-fs-18)}.solaris-form-field__hint{font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-form-field__frame:has(:is(input,textarea,button)[disabled]){opacity:.45}.solaris-form-field__frame:has(:is(input,textarea,button)[disabled]) .solaris-form-field__prefix,.solaris-form-field__frame:has(:is(input,textarea,button)[disabled]) :is(.solaris-form-field__label,.solaris-form-field__hint){color:var(--solaris-color-text-muted)}.solaris-form-field__frame:has(:focus-visible){box-shadow:0 0 .5rem .25rem color-mix(in srgb,var(--solaris-color-primary) 5%,transparent);border-color:color-mix(in srgb,var(--solaris-color-primary) 70%,var(--solaris-color-border))}.solaris-form-field[data-invalid=true] .solaris-form-field__frame{box-shadow:0 0 .5rem .25rem color-mix(in srgb,var(--solaris-color-error) 5%,transparent);border-color:color-mix(in srgb,var(--solaris-color-error) 70%,var(--solaris-color-border))}.solaris-form-field[data-invalid=true] .solaris-form-field__frame:focus-within{border-color:color-mix(in srgb,var(--solaris-color-error) 80%,var(--solaris-color-border));box-shadow:0 0 .5rem .25rem color-mix(in srgb,var(--solaris-color-error) 16%,transparent)}.solaris-form-field[data-invalid=true] .solaris-form-field__prefix{border-right-color:color-mix(in srgb,var(--solaris-color-error) 30%,var(--solaris-color-border));color:color-mix(in srgb,var(--solaris-color-error) 75%,var(--solaris-color-text-muted))}.solaris-form-field[data-invalid=true] .solaris-form-field__control-slot :is(input,textarea)::placeholder{color:color-mix(in srgb,var(--solaris-color-error) 45%,var(--solaris-color-text-muted))}.solaris-form-field__body:has(solaris-phone-input){padding-left:0}\n"] }]
|
|
2198
4033
|
}], ctorParameters: () => [], propDecorators: { prefix: [{
|
|
2199
4034
|
type: ContentChild,
|
|
2200
4035
|
args: [SolarisPrefixDirective]
|
|
@@ -2211,15 +4046,727 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
2211
4046
|
type: Input
|
|
2212
4047
|
}], invalid: [{
|
|
2213
4048
|
type: Input
|
|
4049
|
+
}], radius: [{
|
|
4050
|
+
type: Input
|
|
4051
|
+
}], appearance: [{
|
|
4052
|
+
type: Input
|
|
2214
4053
|
}], showErrors: [{
|
|
2215
4054
|
type: Input
|
|
2216
4055
|
}] } });
|
|
2217
4056
|
|
|
4057
|
+
class SolarisSelect {
|
|
4058
|
+
destroyRef = inject(DestroyRef);
|
|
4059
|
+
injector = inject(Injector);
|
|
4060
|
+
field = inject(SolarisFormFieldController, { optional: true });
|
|
4061
|
+
tokenEl;
|
|
4062
|
+
measureSlot;
|
|
4063
|
+
triggerWrap;
|
|
4064
|
+
triggerInput;
|
|
4065
|
+
get dataOpen() {
|
|
4066
|
+
return this.open() ? 'true' : null;
|
|
4067
|
+
}
|
|
4068
|
+
get dataCompact() {
|
|
4069
|
+
return this.compactInput() ? 'true' : null;
|
|
4070
|
+
}
|
|
4071
|
+
_rootNodes = signal([], ...(ngDevMode ? [{ debugName: "_rootNodes" }] : []));
|
|
4072
|
+
set items(v) {
|
|
4073
|
+
console.count('[Select] items setter');
|
|
4074
|
+
console.log('[Select] items length:', (v ?? []).length);
|
|
4075
|
+
this._rootNodes.set(v ?? []);
|
|
4076
|
+
this.resetStack();
|
|
4077
|
+
const cur = this._value();
|
|
4078
|
+
const next = this.sanitizeValue(cur);
|
|
4079
|
+
const changed = !this.sameCvaValue(cur, next);
|
|
4080
|
+
console.log('[Select] sanitize changed?', changed, 'cur:', cur, 'next:', next);
|
|
4081
|
+
if (changed)
|
|
4082
|
+
this._value.set(next);
|
|
4083
|
+
}
|
|
4084
|
+
sameCvaValue(a, b) {
|
|
4085
|
+
if (this.multiple) {
|
|
4086
|
+
const aa = Array.isArray(a) ? a : [];
|
|
4087
|
+
const bb = Array.isArray(b) ? b : [];
|
|
4088
|
+
if (aa.length !== bb.length)
|
|
4089
|
+
return false;
|
|
4090
|
+
for (let i = 0; i < aa.length; i++) {
|
|
4091
|
+
if (!this.eq(aa[i], bb[i]))
|
|
4092
|
+
return false;
|
|
4093
|
+
}
|
|
4094
|
+
return true;
|
|
4095
|
+
}
|
|
4096
|
+
if (a == null && b == null)
|
|
4097
|
+
return true;
|
|
4098
|
+
if (a == null || b == null)
|
|
4099
|
+
return false;
|
|
4100
|
+
return this.eq(a, b);
|
|
4101
|
+
}
|
|
4102
|
+
_multiple = false;
|
|
4103
|
+
set multiple(v) {
|
|
4104
|
+
this._multiple = v;
|
|
4105
|
+
const cur = this._value();
|
|
4106
|
+
if (this._multiple && !Array.isArray(cur))
|
|
4107
|
+
this._value.set([]);
|
|
4108
|
+
if (!this._multiple && Array.isArray(cur))
|
|
4109
|
+
this._value.set(null);
|
|
4110
|
+
}
|
|
4111
|
+
get multiple() { return this._multiple; }
|
|
4112
|
+
valueKey;
|
|
4113
|
+
backKey = '';
|
|
4114
|
+
placeholder = '';
|
|
4115
|
+
placeholderKey = '';
|
|
4116
|
+
searchable = true;
|
|
4117
|
+
selectedCountKey = '';
|
|
4118
|
+
selectedFirst = true;
|
|
4119
|
+
searchPlaceholder = '';
|
|
4120
|
+
selectedCountText = '';
|
|
4121
|
+
panelMaxHeight = '32rem';
|
|
4122
|
+
searchPlaceholderKey = '';
|
|
4123
|
+
selectionSeparator = ', ';
|
|
4124
|
+
compareWith;
|
|
4125
|
+
backText = 'ui.solaris.common.back';
|
|
4126
|
+
selectionDisplay = 'auto';
|
|
4127
|
+
_disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
4128
|
+
set disabled(v) {
|
|
4129
|
+
this._disabled.set(v);
|
|
4130
|
+
if (v)
|
|
4131
|
+
this.open.set(false);
|
|
4132
|
+
}
|
|
4133
|
+
get disabled() { return this._disabled(); }
|
|
4134
|
+
open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
4135
|
+
searchTerm = signal('', ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
|
|
4136
|
+
activeIndex = signal(0, ...(ngDevMode ? [{ debugName: "activeIndex" }] : []));
|
|
4137
|
+
showCount = signal(false, ...(ngDevMode ? [{ debugName: "showCount" }] : []));
|
|
4138
|
+
showToken = computed(() => {
|
|
4139
|
+
return this.selectedCount() > 0;
|
|
4140
|
+
}, ...(ngDevMode ? [{ debugName: "showToken" }] : []));
|
|
4141
|
+
selectedText = computed(() => {
|
|
4142
|
+
const items = this.selectedItems();
|
|
4143
|
+
if (!items.length)
|
|
4144
|
+
return '';
|
|
4145
|
+
return items.map(it => this.itemLabel(it)).filter(Boolean).join(this.selectionSeparator);
|
|
4146
|
+
}, ...(ngDevMode ? [{ debugName: "selectedText" }] : []));
|
|
4147
|
+
triggerValue = computed(() => {
|
|
4148
|
+
if (this.isSearchMode())
|
|
4149
|
+
return this.searchTerm();
|
|
4150
|
+
return '';
|
|
4151
|
+
}, ...(ngDevMode ? [{ debugName: "triggerValue" }] : []));
|
|
4152
|
+
activeOptionId = computed(() => {
|
|
4153
|
+
const idx = this.activeIndex();
|
|
4154
|
+
const row = this.itemRows()[idx];
|
|
4155
|
+
return row?.id ?? null;
|
|
4156
|
+
}, ...(ngDevMode ? [{ debugName: "activeOptionId" }] : []));
|
|
4157
|
+
inputPlaceholder = computed(() => {
|
|
4158
|
+
if (this.selectedCount() > 0)
|
|
4159
|
+
return '';
|
|
4160
|
+
if (this.searchTerm().length > 0)
|
|
4161
|
+
return '';
|
|
4162
|
+
return this.searchPlaceholder || 'Search...';
|
|
4163
|
+
}, ...(ngDevMode ? [{ debugName: "inputPlaceholder" }] : []));
|
|
4164
|
+
_value = signal(null, ...(ngDevMode ? [{ debugName: "_value" }] : []));
|
|
4165
|
+
selectedItems = computed(() => {
|
|
4166
|
+
const all = [];
|
|
4167
|
+
this.collectAllItems(this._rootNodes(), all);
|
|
4168
|
+
const v = this._value();
|
|
4169
|
+
if (this.multiple) {
|
|
4170
|
+
const arr = Array.isArray(v) ? v : [];
|
|
4171
|
+
return all.filter(it => arr.some(s => this.eq(s, it.value)));
|
|
4172
|
+
}
|
|
4173
|
+
return all.filter(it => v != null && this.eq(v, it.value));
|
|
4174
|
+
}, ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
|
|
4175
|
+
_stack = signal([], ...(ngDevMode ? [{ debugName: "_stack" }] : []));
|
|
4176
|
+
viewModel = computed(() => {
|
|
4177
|
+
const lvl = this.currentLevel();
|
|
4178
|
+
const ordered = this.applySelectedFirst(lvl.nodes);
|
|
4179
|
+
const filtered = this.filterNodes(ordered, this.searchTerm());
|
|
4180
|
+
return this.buildRows(filtered);
|
|
4181
|
+
}, ...(ngDevMode ? [{ debugName: "viewModel" }] : []));
|
|
4182
|
+
rows = computed(() => this.viewModel().rows, ...(ngDevMode ? [{ debugName: "rows" }] : []));
|
|
4183
|
+
canGoBack = computed(() => this._stack().length > 1, ...(ngDevMode ? [{ debugName: "canGoBack" }] : []));
|
|
4184
|
+
selectedCount = computed(() => this.selectedItems().length, ...(ngDevMode ? [{ debugName: "selectedCount" }] : []));
|
|
4185
|
+
isSearchMode = computed(() => this.open() && this.searchable, ...(ngDevMode ? [{ debugName: "isSearchMode" }] : []));
|
|
4186
|
+
itemRows = computed(() => this.viewModel().itemRows, ...(ngDevMode ? [{ debugName: "itemRows" }] : []));
|
|
4187
|
+
compactInput = computed(() => this.selectedCount() > 0 && this.searchTerm().length === 0, ...(ngDevMode ? [{ debugName: "compactInput" }] : []));
|
|
4188
|
+
currentLevel = computed(() => this._stack().at(-1) ?? { nodes: this._rootNodes() }, ...(ngDevMode ? [{ debugName: "currentLevel" }] : []));
|
|
4189
|
+
static seq = 0;
|
|
4190
|
+
_measureNonce = 0;
|
|
4191
|
+
resizeObs;
|
|
4192
|
+
matchWidthEl = null;
|
|
4193
|
+
propagateTouched = () => { };
|
|
4194
|
+
propagateChange = () => { };
|
|
4195
|
+
resolvedNgControl = undefined;
|
|
4196
|
+
_id = `solaris-select-${++SolarisSelect.seq}`;
|
|
4197
|
+
constructor() {
|
|
4198
|
+
this.resetStack();
|
|
4199
|
+
effect(() => {
|
|
4200
|
+
this.selectedText();
|
|
4201
|
+
this.compactInput();
|
|
4202
|
+
this.scheduleAutoMeasure();
|
|
4203
|
+
});
|
|
4204
|
+
effect(() => {
|
|
4205
|
+
const isOpen = this.open();
|
|
4206
|
+
if (isOpen) {
|
|
4207
|
+
this.activeIndex.set(0);
|
|
4208
|
+
this.scheduleFocusTrigger();
|
|
4209
|
+
}
|
|
4210
|
+
else {
|
|
4211
|
+
this.propagateTouched();
|
|
4212
|
+
this.searchTerm.set('');
|
|
4213
|
+
this.resetStack();
|
|
4214
|
+
}
|
|
4215
|
+
});
|
|
4216
|
+
}
|
|
4217
|
+
ngOnInit() {
|
|
4218
|
+
this.resolveNgControlOnce();
|
|
4219
|
+
}
|
|
4220
|
+
ngAfterViewInit() {
|
|
4221
|
+
const trigger = this.triggerWrap?.nativeElement;
|
|
4222
|
+
if (trigger) {
|
|
4223
|
+
this.matchWidthEl =
|
|
4224
|
+
trigger.closest('.solaris-form-field')?.querySelector('.solaris-form-field__frame')
|
|
4225
|
+
?? null;
|
|
4226
|
+
}
|
|
4227
|
+
const el = this.triggerWrap?.nativeElement;
|
|
4228
|
+
if (!el)
|
|
4229
|
+
return;
|
|
4230
|
+
if (typeof ResizeObserver === 'undefined')
|
|
4231
|
+
return;
|
|
4232
|
+
this.resizeObs = new ResizeObserver(() => this.scheduleAutoMeasure(true));
|
|
4233
|
+
this.resizeObs.observe(el);
|
|
4234
|
+
if (document.fonts?.ready) {
|
|
4235
|
+
document.fonts.ready.then(() => this.scheduleAutoMeasure(true));
|
|
4236
|
+
}
|
|
4237
|
+
this.destroyRef.onDestroy(() => this.resizeObs?.disconnect());
|
|
4238
|
+
}
|
|
4239
|
+
writeValue(obj) {
|
|
4240
|
+
console.count('[Select] writeValue');
|
|
4241
|
+
console.log('[Select] writeValue obj:', obj);
|
|
4242
|
+
this._value.set(this.sanitizeValue(obj));
|
|
4243
|
+
}
|
|
4244
|
+
registerOnChange(fn) {
|
|
4245
|
+
console.count('[Select] registerOnChange');
|
|
4246
|
+
this.propagateChange = fn;
|
|
4247
|
+
}
|
|
4248
|
+
registerOnTouched(fn) { this.propagateTouched = fn; }
|
|
4249
|
+
setDisabledState(isDisabled) { this._disabled.set(isDisabled); }
|
|
4250
|
+
eq(a, b) {
|
|
4251
|
+
if (this.compareWith)
|
|
4252
|
+
return this.compareWith(a, b);
|
|
4253
|
+
if (this.valueKey)
|
|
4254
|
+
return a?.[this.valueKey] === b?.[this.valueKey];
|
|
4255
|
+
return Object.is(a, b);
|
|
4256
|
+
}
|
|
4257
|
+
resolveNgControlOnce() {
|
|
4258
|
+
if (this.resolvedNgControl !== undefined)
|
|
4259
|
+
return;
|
|
4260
|
+
this.resolvedNgControl = this.injector.get(NgControl, null, {
|
|
4261
|
+
self: true,
|
|
4262
|
+
optional: true,
|
|
4263
|
+
});
|
|
4264
|
+
if (this.resolvedNgControl) {
|
|
4265
|
+
this.field?.registerControl(this.resolvedNgControl);
|
|
4266
|
+
}
|
|
4267
|
+
}
|
|
4268
|
+
itemLabel(item) {
|
|
4269
|
+
return item.label ?? item.searchText ?? '';
|
|
4270
|
+
}
|
|
4271
|
+
collectAllItems(nodes, out) {
|
|
4272
|
+
for (const n of nodes) {
|
|
4273
|
+
if (n.kind === 'item') {
|
|
4274
|
+
out.push(n);
|
|
4275
|
+
if (n.children?.length)
|
|
4276
|
+
this.collectAllItems(n.children, out);
|
|
4277
|
+
}
|
|
4278
|
+
else if (n.kind === 'group') {
|
|
4279
|
+
this.collectAllItems(n.items, out);
|
|
4280
|
+
}
|
|
4281
|
+
}
|
|
4282
|
+
}
|
|
4283
|
+
resetStack() {
|
|
4284
|
+
this._stack.set([{ nodes: this._rootNodes() }]);
|
|
4285
|
+
}
|
|
4286
|
+
goBack() {
|
|
4287
|
+
if (!this.canGoBack())
|
|
4288
|
+
return;
|
|
4289
|
+
const s = [...this._stack()];
|
|
4290
|
+
s.pop();
|
|
4291
|
+
this._stack.set(s);
|
|
4292
|
+
this.activeIndex.set(0);
|
|
4293
|
+
this.scheduleFocusTrigger();
|
|
4294
|
+
}
|
|
4295
|
+
enterChildren(item) {
|
|
4296
|
+
if (!item.children?.length)
|
|
4297
|
+
return;
|
|
4298
|
+
this._stack.set([...this._stack(), { title: item.childrenTitle, titleKey: item.childrenTitleKey, nodes: item.children }]);
|
|
4299
|
+
this.activeIndex.set(0);
|
|
4300
|
+
this.scheduleFocusTrigger();
|
|
4301
|
+
}
|
|
4302
|
+
filterNodes(nodes, termRaw) {
|
|
4303
|
+
const term = termRaw.trim().toLowerCase();
|
|
4304
|
+
if (!term)
|
|
4305
|
+
return nodes;
|
|
4306
|
+
const matchItem = (it) => {
|
|
4307
|
+
const hay = [it.searchText, it.label, it.description, it.endText].filter(Boolean).join(' ').toLowerCase();
|
|
4308
|
+
return hay.includes(term);
|
|
4309
|
+
};
|
|
4310
|
+
const walk = (list) => {
|
|
4311
|
+
const res = [];
|
|
4312
|
+
for (const n of list) {
|
|
4313
|
+
if (n.kind === 'divider') {
|
|
4314
|
+
res.push(n);
|
|
4315
|
+
continue;
|
|
4316
|
+
}
|
|
4317
|
+
if (n.kind === 'group') {
|
|
4318
|
+
const sub = walk(n.items);
|
|
4319
|
+
if (sub.some(x => x.kind !== 'divider'))
|
|
4320
|
+
res.push({ ...n, items: sub });
|
|
4321
|
+
continue;
|
|
4322
|
+
}
|
|
4323
|
+
if (n.children?.length) {
|
|
4324
|
+
const sub = walk(n.children);
|
|
4325
|
+
if (matchItem(n) || sub.some(x => x.kind !== 'divider'))
|
|
4326
|
+
res.push({ ...n, children: sub });
|
|
4327
|
+
}
|
|
4328
|
+
else if (matchItem(n)) {
|
|
4329
|
+
res.push(n);
|
|
4330
|
+
}
|
|
4331
|
+
}
|
|
4332
|
+
return this.cleanupDividers(res);
|
|
4333
|
+
};
|
|
4334
|
+
return walk(nodes);
|
|
4335
|
+
}
|
|
4336
|
+
cleanupDividers(nodes) {
|
|
4337
|
+
const out = [];
|
|
4338
|
+
for (const n of nodes) {
|
|
4339
|
+
if (n.kind === 'divider') {
|
|
4340
|
+
if (!out.length)
|
|
4341
|
+
continue;
|
|
4342
|
+
if (out.at(-1)?.kind === 'divider')
|
|
4343
|
+
continue;
|
|
4344
|
+
}
|
|
4345
|
+
out.push(n);
|
|
4346
|
+
}
|
|
4347
|
+
while (out.length && out[0].kind === 'divider')
|
|
4348
|
+
out.shift();
|
|
4349
|
+
while (out.length && out.at(-1)?.kind === 'divider')
|
|
4350
|
+
out.pop();
|
|
4351
|
+
return out;
|
|
4352
|
+
}
|
|
4353
|
+
applySelectedFirst(nodes) {
|
|
4354
|
+
if (!this.multiple || !this.selectedFirst)
|
|
4355
|
+
return nodes;
|
|
4356
|
+
const selected = (it) => {
|
|
4357
|
+
const v = this._value();
|
|
4358
|
+
const arr = Array.isArray(v) ? v : [];
|
|
4359
|
+
return arr.some(s => this.eq(s, it.value));
|
|
4360
|
+
};
|
|
4361
|
+
const reorderSegment = (segment) => {
|
|
4362
|
+
const items = [];
|
|
4363
|
+
const others = [];
|
|
4364
|
+
for (const n of segment) {
|
|
4365
|
+
if (n.kind === 'item')
|
|
4366
|
+
items.push(n);
|
|
4367
|
+
else if (n.kind === 'group')
|
|
4368
|
+
others.push({ ...n, items: this.applySelectedFirst(n.items) });
|
|
4369
|
+
else
|
|
4370
|
+
others.push(n);
|
|
4371
|
+
}
|
|
4372
|
+
const sel = [];
|
|
4373
|
+
const non = [];
|
|
4374
|
+
for (const it of items)
|
|
4375
|
+
(selected(it) ? sel : non).push(it);
|
|
4376
|
+
return [...sel, ...non, ...others];
|
|
4377
|
+
};
|
|
4378
|
+
const res = [];
|
|
4379
|
+
let buf = [];
|
|
4380
|
+
const flush = () => {
|
|
4381
|
+
if (!buf.length)
|
|
4382
|
+
return;
|
|
4383
|
+
res.push(...reorderSegment(buf));
|
|
4384
|
+
buf = [];
|
|
4385
|
+
};
|
|
4386
|
+
for (const n of nodes) {
|
|
4387
|
+
if (n.kind === 'divider') {
|
|
4388
|
+
flush();
|
|
4389
|
+
res.push(n);
|
|
4390
|
+
}
|
|
4391
|
+
else
|
|
4392
|
+
buf.push(n);
|
|
4393
|
+
}
|
|
4394
|
+
flush();
|
|
4395
|
+
return this.cleanupDividers(res);
|
|
4396
|
+
}
|
|
4397
|
+
buildRows(nodes) {
|
|
4398
|
+
const rows = [];
|
|
4399
|
+
let optionIndex = 0;
|
|
4400
|
+
const pushItem = (it) => {
|
|
4401
|
+
const hasChildren = !!it.children?.length;
|
|
4402
|
+
const selectable = !hasChildren;
|
|
4403
|
+
const disabled = !!it.disabled;
|
|
4404
|
+
const selected = selectable ? this.isSelected(it.value) : false;
|
|
4405
|
+
rows.push({
|
|
4406
|
+
kind: 'item',
|
|
4407
|
+
key: `item-${optionIndex}-${this.itemLabel(it)}-${String(it.value)}`,
|
|
4408
|
+
id: `${this._id}-opt-${optionIndex}`,
|
|
4409
|
+
optionIndex,
|
|
4410
|
+
item: it,
|
|
4411
|
+
disabled,
|
|
4412
|
+
selected,
|
|
4413
|
+
hasChildren,
|
|
4414
|
+
selectable,
|
|
4415
|
+
});
|
|
4416
|
+
optionIndex++;
|
|
4417
|
+
};
|
|
4418
|
+
const walk = (list) => {
|
|
4419
|
+
for (const n of list) {
|
|
4420
|
+
if (n.kind === 'divider') {
|
|
4421
|
+
rows.push({ kind: 'divider', key: `div-${rows.length}` });
|
|
4422
|
+
continue;
|
|
4423
|
+
}
|
|
4424
|
+
if (n.kind === 'group') {
|
|
4425
|
+
rows.push({
|
|
4426
|
+
kind: 'group',
|
|
4427
|
+
key: `grp-${rows.length}-${n.label ?? n.labelKey ?? ''}`,
|
|
4428
|
+
label: n.label,
|
|
4429
|
+
labelKey: n.labelKey,
|
|
4430
|
+
});
|
|
4431
|
+
walk(n.items);
|
|
4432
|
+
continue;
|
|
4433
|
+
}
|
|
4434
|
+
pushItem(n);
|
|
4435
|
+
}
|
|
4436
|
+
};
|
|
4437
|
+
walk(nodes);
|
|
4438
|
+
const itemRows = rows.filter(r => r.kind === 'item');
|
|
4439
|
+
return { rows, itemRows };
|
|
4440
|
+
}
|
|
4441
|
+
isSelected(value) {
|
|
4442
|
+
const v = this._value();
|
|
4443
|
+
if (this.multiple) {
|
|
4444
|
+
const arr = Array.isArray(v) ? v : [];
|
|
4445
|
+
return arr.some(s => this.eq(s, value));
|
|
4446
|
+
}
|
|
4447
|
+
return v != null && this.eq(v, value);
|
|
4448
|
+
}
|
|
4449
|
+
setValue(next) {
|
|
4450
|
+
console.count('[Select] setValue (user)');
|
|
4451
|
+
const cur = this._value();
|
|
4452
|
+
console.log('[Select] setValue cur:', cur, 'next:', next);
|
|
4453
|
+
if (this.sameCvaValue(cur, next))
|
|
4454
|
+
return;
|
|
4455
|
+
this._value.set(next);
|
|
4456
|
+
this.propagateChange(next);
|
|
4457
|
+
}
|
|
4458
|
+
toggleItem(value) {
|
|
4459
|
+
if (!this.multiple)
|
|
4460
|
+
return;
|
|
4461
|
+
const cur = this._value();
|
|
4462
|
+
const arr = Array.isArray(cur) ? [...cur] : [];
|
|
4463
|
+
const idx = arr.findIndex(v => this.eq(v, value));
|
|
4464
|
+
if (idx >= 0)
|
|
4465
|
+
arr.splice(idx, 1);
|
|
4466
|
+
else
|
|
4467
|
+
arr.push(value);
|
|
4468
|
+
this.setValue(arr);
|
|
4469
|
+
}
|
|
4470
|
+
selectSingle(value) {
|
|
4471
|
+
if (this.multiple)
|
|
4472
|
+
return;
|
|
4473
|
+
this.setValue(value);
|
|
4474
|
+
this.open.set(false);
|
|
4475
|
+
}
|
|
4476
|
+
onOptionClick(item) {
|
|
4477
|
+
if (this.disabled)
|
|
4478
|
+
return;
|
|
4479
|
+
if (item.children?.length) {
|
|
4480
|
+
this.enterChildren(item);
|
|
4481
|
+
return;
|
|
4482
|
+
}
|
|
4483
|
+
if (this.multiple)
|
|
4484
|
+
this.toggleItem(item.value);
|
|
4485
|
+
else
|
|
4486
|
+
this.selectSingle(item.value);
|
|
4487
|
+
}
|
|
4488
|
+
openFromTrigger() {
|
|
4489
|
+
if (this.disabled)
|
|
4490
|
+
return;
|
|
4491
|
+
if (!this.open())
|
|
4492
|
+
this.open.set(true);
|
|
4493
|
+
}
|
|
4494
|
+
toggleOpen() {
|
|
4495
|
+
if (this.disabled)
|
|
4496
|
+
return;
|
|
4497
|
+
const next = !this.open();
|
|
4498
|
+
if (next)
|
|
4499
|
+
this.searchTerm.set('');
|
|
4500
|
+
this.open.set(next);
|
|
4501
|
+
}
|
|
4502
|
+
onTriggerInput(v) {
|
|
4503
|
+
if (this.disabled)
|
|
4504
|
+
return;
|
|
4505
|
+
if (!this.open())
|
|
4506
|
+
this.open.set(true);
|
|
4507
|
+
this.searchTerm.set(v);
|
|
4508
|
+
this.activeIndex.set(0);
|
|
4509
|
+
}
|
|
4510
|
+
onTriggerKeydown(ev) {
|
|
4511
|
+
if (this.disabled)
|
|
4512
|
+
return;
|
|
4513
|
+
if (!this.open()) {
|
|
4514
|
+
if (ev.key === 'ArrowDown' || ev.key === 'Enter') {
|
|
4515
|
+
ev.preventDefault();
|
|
4516
|
+
this.searchTerm.set('');
|
|
4517
|
+
this.open.set(true);
|
|
4518
|
+
this.activeIndex.set(0);
|
|
4519
|
+
return;
|
|
4520
|
+
}
|
|
4521
|
+
if (this.searchable && ev.key.length === 1 && !ev.ctrlKey && !ev.metaKey && !ev.altKey) {
|
|
4522
|
+
ev.preventDefault();
|
|
4523
|
+
this.searchTerm.set(ev.key);
|
|
4524
|
+
this.open.set(true);
|
|
4525
|
+
this.activeIndex.set(0);
|
|
4526
|
+
return;
|
|
4527
|
+
}
|
|
4528
|
+
return;
|
|
4529
|
+
}
|
|
4530
|
+
if (ev.key === 'ArrowDown' || ev.key === 'ArrowUp' || ev.key === 'Home' || ev.key === 'End' || ev.key === 'Enter' || ev.key === 'Escape') {
|
|
4531
|
+
this.onPanelKeydown(ev);
|
|
4532
|
+
return;
|
|
4533
|
+
}
|
|
4534
|
+
if ((ev.key === 'Backspace' || ev.key === 'ArrowLeft') && this.canGoBack() && !this.searchTerm()) {
|
|
4535
|
+
ev.preventDefault();
|
|
4536
|
+
this.goBack();
|
|
4537
|
+
}
|
|
4538
|
+
}
|
|
4539
|
+
onPanelKeydown(ev) {
|
|
4540
|
+
const items = this.itemRows();
|
|
4541
|
+
if (!items.length)
|
|
4542
|
+
return;
|
|
4543
|
+
const max = items.length - 1;
|
|
4544
|
+
const clamp = (n) => Math.max(0, Math.min(max, n));
|
|
4545
|
+
switch (ev.key) {
|
|
4546
|
+
case 'ArrowDown':
|
|
4547
|
+
ev.preventDefault();
|
|
4548
|
+
this.activeIndex.set(clamp(this.activeIndex() + 1));
|
|
4549
|
+
break;
|
|
4550
|
+
case 'ArrowUp':
|
|
4551
|
+
ev.preventDefault();
|
|
4552
|
+
this.activeIndex.set(clamp(this.activeIndex() - 1));
|
|
4553
|
+
break;
|
|
4554
|
+
case 'Home':
|
|
4555
|
+
ev.preventDefault();
|
|
4556
|
+
this.activeIndex.set(0);
|
|
4557
|
+
break;
|
|
4558
|
+
case 'End':
|
|
4559
|
+
ev.preventDefault();
|
|
4560
|
+
this.activeIndex.set(max);
|
|
4561
|
+
break;
|
|
4562
|
+
case 'Enter':
|
|
4563
|
+
ev.preventDefault();
|
|
4564
|
+
this.onOptionClick(items[this.activeIndex()].item);
|
|
4565
|
+
break;
|
|
4566
|
+
case 'ArrowRight': {
|
|
4567
|
+
const row = items[this.activeIndex()];
|
|
4568
|
+
if (row?.hasChildren) {
|
|
4569
|
+
ev.preventDefault();
|
|
4570
|
+
this.enterChildren(row.item);
|
|
4571
|
+
}
|
|
4572
|
+
break;
|
|
4573
|
+
}
|
|
4574
|
+
case 'Escape':
|
|
4575
|
+
ev.preventDefault();
|
|
4576
|
+
this.open.set(false);
|
|
4577
|
+
break;
|
|
4578
|
+
}
|
|
4579
|
+
}
|
|
4580
|
+
scheduleAutoMeasure(force = false) {
|
|
4581
|
+
if (!this.multiple) {
|
|
4582
|
+
this.showCount.set(false);
|
|
4583
|
+
return;
|
|
4584
|
+
}
|
|
4585
|
+
if (this.selectionDisplay === 'count') {
|
|
4586
|
+
this.showCount.set(true);
|
|
4587
|
+
return;
|
|
4588
|
+
}
|
|
4589
|
+
if (this.selectionDisplay === 'list') {
|
|
4590
|
+
this.showCount.set(false);
|
|
4591
|
+
return;
|
|
4592
|
+
}
|
|
4593
|
+
const nonce = ++this._measureNonce;
|
|
4594
|
+
requestAnimationFrame(() => {
|
|
4595
|
+
requestAnimationFrame(() => {
|
|
4596
|
+
if (nonce !== this._measureNonce)
|
|
4597
|
+
return;
|
|
4598
|
+
this.measureAuto(force);
|
|
4599
|
+
});
|
|
4600
|
+
});
|
|
4601
|
+
}
|
|
4602
|
+
measureAuto(_force) {
|
|
4603
|
+
if (!this.multiple) {
|
|
4604
|
+
this.showCount.set(false);
|
|
4605
|
+
return;
|
|
4606
|
+
}
|
|
4607
|
+
if (this.selectionDisplay === 'count') {
|
|
4608
|
+
this.showCount.set(true);
|
|
4609
|
+
return;
|
|
4610
|
+
}
|
|
4611
|
+
if (this.selectionDisplay === 'list') {
|
|
4612
|
+
this.showCount.set(false);
|
|
4613
|
+
return;
|
|
4614
|
+
}
|
|
4615
|
+
if (!this.compactInput()) {
|
|
4616
|
+
if (this.showCount())
|
|
4617
|
+
this.showCount.set(false);
|
|
4618
|
+
return;
|
|
4619
|
+
}
|
|
4620
|
+
const wrap = this.triggerWrap?.nativeElement;
|
|
4621
|
+
const inputEl = this.triggerInput?.nativeElement;
|
|
4622
|
+
const measureEl = this.measureSlot?.nativeElement;
|
|
4623
|
+
if (!wrap || !inputEl || !measureEl)
|
|
4624
|
+
return;
|
|
4625
|
+
const text = this.selectedText();
|
|
4626
|
+
if (!text) {
|
|
4627
|
+
if (this.showCount())
|
|
4628
|
+
this.showCount.set(false);
|
|
4629
|
+
}
|
|
4630
|
+
const ws = getComputedStyle(wrap);
|
|
4631
|
+
const padL = this.px(ws.paddingLeft);
|
|
4632
|
+
const padR = this.px(ws.paddingRight);
|
|
4633
|
+
const gap = this.px(ws.columnGap || ws.gap);
|
|
4634
|
+
const contentWidth = wrap.clientWidth - padL - padR;
|
|
4635
|
+
const inputWidth = inputEl.getBoundingClientRect().width;
|
|
4636
|
+
const tokenMaxWidth = Math.max(0, contentWidth - gap - inputWidth);
|
|
4637
|
+
const needed = Math.ceil(measureEl.scrollWidth);
|
|
4638
|
+
const available = Math.floor(tokenMaxWidth);
|
|
4639
|
+
const current = this.showCount();
|
|
4640
|
+
const marginForward = 1;
|
|
4641
|
+
const marginBack = 3;
|
|
4642
|
+
const next = current ? (needed > (available - marginBack)) : (needed > (available + marginForward));
|
|
4643
|
+
if (next !== current)
|
|
4644
|
+
this.showCount.set(next);
|
|
4645
|
+
}
|
|
4646
|
+
px(v) {
|
|
4647
|
+
const first = (v ?? '0').split(' ')[0];
|
|
4648
|
+
const n = Number.parseFloat(first);
|
|
4649
|
+
return Number.isFinite(n) ? n : 0;
|
|
4650
|
+
}
|
|
4651
|
+
scheduleFocusTrigger() {
|
|
4652
|
+
requestAnimationFrame(() => {
|
|
4653
|
+
this.triggerInput?.nativeElement?.focus?.();
|
|
4654
|
+
if (this.searchable)
|
|
4655
|
+
this.triggerInput?.nativeElement?.select?.();
|
|
4656
|
+
});
|
|
4657
|
+
}
|
|
4658
|
+
isSelectableValue(v) {
|
|
4659
|
+
if (v == null)
|
|
4660
|
+
return false;
|
|
4661
|
+
let selectable = false;
|
|
4662
|
+
const walk = (nodes) => {
|
|
4663
|
+
for (const n of nodes) {
|
|
4664
|
+
if (n.kind === 'group') {
|
|
4665
|
+
walk(n.items);
|
|
4666
|
+
continue;
|
|
4667
|
+
}
|
|
4668
|
+
if (n.kind === 'item') {
|
|
4669
|
+
if (this.eq(n.value, v)) {
|
|
4670
|
+
selectable = !n.children?.length;
|
|
4671
|
+
return;
|
|
4672
|
+
}
|
|
4673
|
+
if (n.children?.length)
|
|
4674
|
+
walk(n.children);
|
|
4675
|
+
}
|
|
4676
|
+
}
|
|
4677
|
+
};
|
|
4678
|
+
walk(this._rootNodes());
|
|
4679
|
+
return selectable;
|
|
4680
|
+
}
|
|
4681
|
+
sanitizeValue(next) {
|
|
4682
|
+
if (this.multiple) {
|
|
4683
|
+
const arr = Array.isArray(next) ? next : [];
|
|
4684
|
+
return arr.filter(v => this.isSelectableValue(v));
|
|
4685
|
+
}
|
|
4686
|
+
return this.isSelectableValue(next) ? next : null;
|
|
4687
|
+
}
|
|
4688
|
+
selectedCountLabel() {
|
|
4689
|
+
const count = this.selectedCount();
|
|
4690
|
+
if (this.selectedCountText)
|
|
4691
|
+
return this.selectedCountText.replace('{count}', String(count));
|
|
4692
|
+
return `${count} selecionados`;
|
|
4693
|
+
}
|
|
4694
|
+
trackRow = (_, r) => r.key;
|
|
4695
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4696
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisSelect, isStandalone: true, selector: "solaris-select", inputs: { items: "items", multiple: "multiple", valueKey: "valueKey", backKey: "backKey", placeholder: "placeholder", placeholderKey: "placeholderKey", searchable: "searchable", selectedCountKey: "selectedCountKey", selectedFirst: "selectedFirst", searchPlaceholder: "searchPlaceholder", selectedCountText: "selectedCountText", panelMaxHeight: "panelMaxHeight", searchPlaceholderKey: "searchPlaceholderKey", selectionSeparator: "selectionSeparator", compareWith: "compareWith", backText: "backText", selectionDisplay: "selectionDisplay", disabled: "disabled" }, host: { properties: { "attr.data-open": "this.dataOpen", "attr.data-compact": "this.dataCompact" } }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SolarisSelect), multi: true }], viewQueries: [{ propertyName: "tokenEl", first: true, predicate: ["tokenEl"], descendants: true, read: ElementRef }, { propertyName: "measureSlot", first: true, predicate: ["measureSlot"], descendants: true, read: ElementRef }, { propertyName: "triggerWrap", first: true, predicate: ["triggerWrap"], descendants: true, read: ElementRef }, { propertyName: "triggerInput", first: true, predicate: ["triggerInput"], descendants: true, read: ElementRef }], ngImport: i0, template: "<solaris-popover [open]=\"open()\" (openChange)=\"open.set($event)\" placement=\"bottom-start\" [offset]=\"6\"\r\n [matchWidth]=\"true\" [anchorElement]=\"matchWidthEl\" [matchWidthElement]=\"matchWidthEl\"\r\n [closeOnOutsideClick]=\"true\" [closeOnEscape]=\"true\" panelClass=\"solaris-select__popover\">\r\n <div #triggerWrap solaris-popover-trigger class=\"solaris-select__trigger\" (click)=\"openFromTrigger()\">\r\n @if (showToken()) {\r\n <span #tokenEl class=\"solaris-select__token\" aria-hidden=\"true\">\r\n @if (multiple && showCount()) {\r\n @if (selectedCountKey) { {{ selectedCountKey | translate:{ count: selectedCount() } }} }\r\n @else { {{ selectedCountLabel() }} }\r\n } @else {\r\n {{ selectedText() }}\r\n }\r\n </span>\r\n }\r\n\r\n <input #triggerInput type=\"text\" class=\"solaris-select__input\" [disabled]=\"disabled\"\r\n [attr.aria-activedescendant]=\"open() ? activeOptionId() : null\" (click)=\"openFromTrigger()\"\r\n [readonly]=\"!isSearchMode()\" role=\"combobox\" aria-autocomplete=\"list\" aria-haspopup=\"listbox\"\r\n aria-controls=\"{{ _id }}-listbox\" aria-expanded=\"false\" [attr.aria-expanded]=\"open() ? 'true' : 'false'\"\r\n [attr.placeholder]=\"inputPlaceholder()\" (focus)=\"openFromTrigger()\" (input)=\"onTriggerInput(triggerInput.value)\"\r\n [value]=\"triggerValue()\" (keydown)=\"onTriggerKeydown($event)\"/>\r\n\r\n <button type=\"button\" class=\"solaris-select__chevron-btn\" [disabled]=\"disabled\" (click)=\"toggleOpen()\"\r\n [attr.aria-label]=\"('ui.solaris.aria.toggleOptions' | translate)\">\r\n <i class=\"ph ph-caret-down\" aria-hidden=\"true\"></i>\r\n </button>\r\n\r\n <span class=\"solaris-select__measure solaris-select__token\" #measureSlot aria-hidden=\"true\">\r\n {{ selectedText() }}\r\n </span>\r\n </div>\r\n\r\n <ng-template solaris-popover-panel>\r\n <div class=\"solaris-select__panel\" (keydown)=\"onPanelKeydown($event)\" [style.max-height]=\"panelMaxHeight\">\r\n @if (canGoBack()) {\r\n <div class=\"solaris-select__nav\">\r\n <button type=\"button\" class=\"solaris-select__back\" (click)=\"goBack()\">\r\n <i class=\"ph ph-arrow-left\"></i>\r\n <span>\r\n @if (backKey) { {{ backKey | translate }} }\r\n @else { {{ backText | translate }} }\r\n </span>\r\n </button>\r\n\r\n <div class=\"solaris-select__title\">\r\n @if (currentLevel().titleKey) { {{ currentLevel().titleKey! | translate }} }\r\n @else { {{ currentLevel().title ?? '' }} }\r\n </div>\r\n </div>\r\n }\r\n\r\n <div class=\"solaris-select__list\" role=\"listbox\" [id]=\"_id + '-listbox'\"\r\n [attr.aria-multiselectable]=\"multiple ? 'true' : null\"\r\n [attr.aria-activedescendant]=\"activeOptionId()\">\r\n @for (row of rows(); track trackRow($index, row)) {\r\n @if (row.kind === 'group') {\r\n <div class=\"solaris-select__group\">\r\n @if (row.labelKey) { {{ row.labelKey | translate }} }\r\n @else { {{ row.label }} }\r\n </div>\r\n }\r\n\r\n @if (row.kind === 'divider') {\r\n <div class=\"solaris-select__divider\" aria-hidden=\"true\"></div>\r\n }\r\n\r\n @if (row.kind === 'item') {\r\n <button type=\"button\" class=\"solaris-select__option\" [id]=\"row.id\" [disabled]=\"row.disabled\"\r\n [attr.aria-selected]=\"row.selected ? 'true' : 'false'\" [class.is-active]=\"row.optionIndex === activeIndex()\"\r\n [class.is-selected]=\"row.selected\" [class.is-navigable]=\"row.hasChildren\" (click)=\"onOptionClick(row.item)\">\r\n <span class=\"solaris-select__option-leading\">\r\n @if (multiple) {\r\n @if (!row.hasChildren) {\r\n <span class=\"solaris-select__checkbox\" aria-hidden=\"true\" [class.is-checked]=\"row.selected\">\r\n <i class=\"ph ph-check\"></i>\r\n </span>\r\n } @else {\r\n @if (row.item.imageUrl) {\r\n <img class=\"solaris-select__avatar\" [ngSrc]=\"row.item.imageUrl\" alt=\"\" fill/>\r\n } @else if (row.item.icon) {\r\n <i class=\"solaris-select__icon\" [class]=\"row.item.icon\" aria-hidden=\"true\"></i>\r\n } @else {\r\n <span class=\"solaris-select__checkbox-spacer\" aria-hidden=\"true\"></span>\r\n }\r\n }\r\n }\r\n\r\n @if (!multiple) {\r\n @if (row.item.imageUrl) {\r\n <img class=\"solaris-select__avatar\" [ngSrc]=\"row.item.imageUrl\" alt=\"\" fill />\r\n } @else if (row.item.icon) {\r\n <i class=\"solaris-select__icon\" [class]=\"row.item.icon\" aria-hidden=\"true\"></i>\r\n }\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-select__option-main\">\r\n <span class=\"solaris-select__option-label\">\r\n @if (row.item.labelKey) { {{ row.item.labelKey | translate }} }\r\n @else { {{ row.item.label }} }\r\n </span>\r\n\r\n @if (row.item.description || row.item.descriptionKey) {\r\n <span class=\"solaris-select__option-desc\">\r\n @if (row.item.descriptionKey) { {{ row.item.descriptionKey | translate }} }\r\n @else { {{ row.item.description }} }\r\n </span>\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-select__option-end\">\r\n @if (row.item.endTextKey) {\r\n <span class=\"solaris-select__end-text\">{{ row.item.endTextKey | translate }}</span>\r\n } @else if (row.item.endText) {\r\n <span class=\"solaris-select__end-text\">{{ row.item.endText }}</span>\r\n }\r\n\r\n @if (!multiple && row.selected) {\r\n <i class=\"ph ph-check\" aria-hidden=\"true\"></i>\r\n }\r\n\r\n @if (row.hasChildren) {\r\n <i class=\"ph ph-caret-right\" aria-hidden=\"true\"></i>\r\n }\r\n </span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n</solaris-popover>\r\n", styles: [":host{width:100%;display:block}.solaris-select__trigger{width:100%;min-width:0;display:flex;position:relative;align-items:center;padding-right:2.8rem;gap:var(--solaris-space-2)}.solaris-select__token{opacity:1;min-width:0;flex:0 1 auto;max-width:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--solaris-color-text)}.solaris-select__input{border:0;width:1px;outline:none;min-width:6rem;padding:1rem 0;background:transparent;font-size:var(--solaris-fs-14);color:var(--solaris-color-text);line-height:var(--solaris-lh-normal)}:host([data-compact=true]) .solaris-select__input{flex:0 0 2ch;width:2ch;min-width:2ch}.solaris-select__input::placeholder{opacity:.9;color:var(--solaris-color-text-muted)}.solaris-select__chevron-btn i.ph{margin-right:1.5rem;transform:rotate(0);transition:transform .16s ease,opacity .16s ease}:host([data-open=true]) .solaris-select__chevron-btn i.ph{transform:rotate(180deg);opacity:.95}.solaris-select__display{top:0;left:0;bottom:0;display:flex;right:2.8rem;overflow:hidden;position:absolute;align-items:center;white-space:nowrap;pointer-events:none;text-overflow:ellipsis}.solaris-select__display.is-hidden{opacity:0}.solaris-select__input::placeholder,.solaris-select__placeholder{opacity:.9;color:var(--solaris-color-text-muted)}.solaris-select__input::placeholder,.solaris-select__placeholder,.solaris-select__token{font-size:var(--solaris-fs-14)}.solaris-select__chevron-btn{top:50%;right:0;border:0;display:grid;width:2.8rem;opacity:.85;height:3.6rem;cursor:pointer;position:absolute;place-items:center;background:transparent;transform:translateY(-50%);color:var(--solaris-color-text-muted)}.solaris-select__chevron-btn:disabled{opacity:.5;cursor:not-allowed}.solaris-select__measure{top:-9999px;left:-9999px;position:absolute;visibility:hidden;pointer-events:none;max-width:none!important;overflow:visible!important;width:max-content!important;white-space:nowrap!important;text-overflow:clip!important;display:inline-block!important}.solaris-select__popover{padding:var(--solaris-space-2)}.solaris-select__panel{display:grid;overflow:auto;max-height:32rem;padding:.25rem;gap:var(--solaris-space-2);border-radius:var(--solaris-radius-sm);background:var(--solaris-color-surface-2);border:1px solid var(--solaris-color-border)}.solaris-select__checkbox-spacer{width:1.6rem;height:1.6rem}.solaris-select__nav{display:grid;align-items:center;padding-right:1rem;gap:var(--solaris-space-2);grid-template-columns:auto 1fr}.solaris-select__back{border:0;cursor:pointer;align-items:center;display:inline-flex;background:transparent;gap:var(--solaris-space-1);padding:var(--solaris-space-2);color:var(--solaris-color-text);border-radius:var(--solaris-radius-sm)}.solaris-select__back:hover{background:var(--solaris-color-surface-2)}.solaris-select__title{justify-self:end;font-size:var(--solaris-fs-12);padding-right:var(--solaris-space-1);color:var(--solaris-color-text-muted)}.solaris-select__list{gap:.25rem;display:grid}.solaris-select__group{opacity:.9;padding:.4rem .6rem;text-transform:uppercase;font-size:var(--solaris-fs-10);letter-spacing:var(--solaris-ls-md);color:var(--solaris-color-text-muted)}.solaris-select__divider{height:1px;margin:.35rem .2rem;background:color-mix(in srgb,var(--solaris-color-border) 75%,transparent)}.solaris-select__option{width:100%;border:0;display:grid;cursor:pointer;text-align:left;align-items:center;padding:.7rem .8rem;background:transparent;gap:var(--solaris-space-4);color:var(--solaris-color-text);grid-template-columns:auto 1fr auto;border-radius:var(--solaris-radius-sm)}.solaris-select__option:hover{background:var(--solaris-color-surface-2)}.solaris-select__option.is-active{background:color-mix(in srgb,var(--solaris-color-primary) 7%,var(--solaris-color-surface-2))}.solaris-select__option:disabled{opacity:.45;cursor:not-allowed}.solaris-select__option-leading{align-items:center;display:inline-flex;gap:var(--solaris-space-2)}.solaris-select__checkbox{display:grid;width:1.6rem;height:1.6rem;place-items:center;border-radius:.4rem;background:var(--solaris-color-surface);color:var(--solaris-color-primary-contrast);border:1px solid color-mix(in srgb,var(--solaris-color-border) 85%,transparent)}.solaris-select__checkbox i.ph{opacity:0;line-height:1;font-size:1.2rem;transform:scale(.9);transition:opacity .12s ease,transform .12s ease}.solaris-select__checkbox.is-checked{background:var(--solaris-color-primary);border-color:color-mix(in srgb,var(--solaris-color-primary) 70%,var(--solaris-color-border))}.solaris-select__checkbox.is-checked i.ph{opacity:1;transform:scale(1)}.solaris-select__avatar{width:1.8rem;height:1.8rem;object-fit:cover;border-radius:var(--solaris-radius-full)}.solaris-select__icon{opacity:.9;font-size:var(--solaris-fs-16);color:var(--solaris-color-text-muted)}.solaris-select__option-main{min-width:0;gap:.15rem;display:grid}.solaris-select__option-label{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.solaris-select__option-desc{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-select__option-end{opacity:.9;align-items:center;display:inline-flex;gap:var(--solaris-space-2);color:var(--solaris-color-text-muted)}.solaris-select__option-end i.ph-check{color:var(--solaris-color-success)}.solaris-select__end-text{font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}\n"], dependencies: [{ kind: "component", type: SolarisPopover, selector: "solaris-popover", inputs: ["offset", "panelClass", "autoFlip", "autoShift", "matchWidth", "viewportPadding", "closeOnEscape", "closeOnOutsideClick", "anchorElement", "matchWidthElement", "placement", "open"], outputs: ["openChange"] }, { kind: "directive", type: SolarisPopoverTriggerDirective, selector: "[solaris-popover-trigger]" }, { kind: "directive", type: SolarisPopoverPanelDirective, selector: "ng-template[solaris-popover-panel]" }, { kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "decoding", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }, { kind: "pipe", type: SolarisTranslationPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4697
|
+
}
|
|
4698
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisSelect, decorators: [{
|
|
4699
|
+
type: Component,
|
|
4700
|
+
args: [{ selector: 'solaris-select', standalone: true, imports: [
|
|
4701
|
+
SolarisPopover,
|
|
4702
|
+
SolarisPopoverTriggerDirective,
|
|
4703
|
+
SolarisPopoverPanelDirective,
|
|
4704
|
+
SolarisTranslationPipe,
|
|
4705
|
+
NgOptimizedImage,
|
|
4706
|
+
], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SolarisSelect), multi: true }], changeDetection: ChangeDetectionStrategy.OnPush, template: "<solaris-popover [open]=\"open()\" (openChange)=\"open.set($event)\" placement=\"bottom-start\" [offset]=\"6\"\r\n [matchWidth]=\"true\" [anchorElement]=\"matchWidthEl\" [matchWidthElement]=\"matchWidthEl\"\r\n [closeOnOutsideClick]=\"true\" [closeOnEscape]=\"true\" panelClass=\"solaris-select__popover\">\r\n <div #triggerWrap solaris-popover-trigger class=\"solaris-select__trigger\" (click)=\"openFromTrigger()\">\r\n @if (showToken()) {\r\n <span #tokenEl class=\"solaris-select__token\" aria-hidden=\"true\">\r\n @if (multiple && showCount()) {\r\n @if (selectedCountKey) { {{ selectedCountKey | translate:{ count: selectedCount() } }} }\r\n @else { {{ selectedCountLabel() }} }\r\n } @else {\r\n {{ selectedText() }}\r\n }\r\n </span>\r\n }\r\n\r\n <input #triggerInput type=\"text\" class=\"solaris-select__input\" [disabled]=\"disabled\"\r\n [attr.aria-activedescendant]=\"open() ? activeOptionId() : null\" (click)=\"openFromTrigger()\"\r\n [readonly]=\"!isSearchMode()\" role=\"combobox\" aria-autocomplete=\"list\" aria-haspopup=\"listbox\"\r\n aria-controls=\"{{ _id }}-listbox\" aria-expanded=\"false\" [attr.aria-expanded]=\"open() ? 'true' : 'false'\"\r\n [attr.placeholder]=\"inputPlaceholder()\" (focus)=\"openFromTrigger()\" (input)=\"onTriggerInput(triggerInput.value)\"\r\n [value]=\"triggerValue()\" (keydown)=\"onTriggerKeydown($event)\"/>\r\n\r\n <button type=\"button\" class=\"solaris-select__chevron-btn\" [disabled]=\"disabled\" (click)=\"toggleOpen()\"\r\n [attr.aria-label]=\"('ui.solaris.aria.toggleOptions' | translate)\">\r\n <i class=\"ph ph-caret-down\" aria-hidden=\"true\"></i>\r\n </button>\r\n\r\n <span class=\"solaris-select__measure solaris-select__token\" #measureSlot aria-hidden=\"true\">\r\n {{ selectedText() }}\r\n </span>\r\n </div>\r\n\r\n <ng-template solaris-popover-panel>\r\n <div class=\"solaris-select__panel\" (keydown)=\"onPanelKeydown($event)\" [style.max-height]=\"panelMaxHeight\">\r\n @if (canGoBack()) {\r\n <div class=\"solaris-select__nav\">\r\n <button type=\"button\" class=\"solaris-select__back\" (click)=\"goBack()\">\r\n <i class=\"ph ph-arrow-left\"></i>\r\n <span>\r\n @if (backKey) { {{ backKey | translate }} }\r\n @else { {{ backText | translate }} }\r\n </span>\r\n </button>\r\n\r\n <div class=\"solaris-select__title\">\r\n @if (currentLevel().titleKey) { {{ currentLevel().titleKey! | translate }} }\r\n @else { {{ currentLevel().title ?? '' }} }\r\n </div>\r\n </div>\r\n }\r\n\r\n <div class=\"solaris-select__list\" role=\"listbox\" [id]=\"_id + '-listbox'\"\r\n [attr.aria-multiselectable]=\"multiple ? 'true' : null\"\r\n [attr.aria-activedescendant]=\"activeOptionId()\">\r\n @for (row of rows(); track trackRow($index, row)) {\r\n @if (row.kind === 'group') {\r\n <div class=\"solaris-select__group\">\r\n @if (row.labelKey) { {{ row.labelKey | translate }} }\r\n @else { {{ row.label }} }\r\n </div>\r\n }\r\n\r\n @if (row.kind === 'divider') {\r\n <div class=\"solaris-select__divider\" aria-hidden=\"true\"></div>\r\n }\r\n\r\n @if (row.kind === 'item') {\r\n <button type=\"button\" class=\"solaris-select__option\" [id]=\"row.id\" [disabled]=\"row.disabled\"\r\n [attr.aria-selected]=\"row.selected ? 'true' : 'false'\" [class.is-active]=\"row.optionIndex === activeIndex()\"\r\n [class.is-selected]=\"row.selected\" [class.is-navigable]=\"row.hasChildren\" (click)=\"onOptionClick(row.item)\">\r\n <span class=\"solaris-select__option-leading\">\r\n @if (multiple) {\r\n @if (!row.hasChildren) {\r\n <span class=\"solaris-select__checkbox\" aria-hidden=\"true\" [class.is-checked]=\"row.selected\">\r\n <i class=\"ph ph-check\"></i>\r\n </span>\r\n } @else {\r\n @if (row.item.imageUrl) {\r\n <img class=\"solaris-select__avatar\" [ngSrc]=\"row.item.imageUrl\" alt=\"\" fill/>\r\n } @else if (row.item.icon) {\r\n <i class=\"solaris-select__icon\" [class]=\"row.item.icon\" aria-hidden=\"true\"></i>\r\n } @else {\r\n <span class=\"solaris-select__checkbox-spacer\" aria-hidden=\"true\"></span>\r\n }\r\n }\r\n }\r\n\r\n @if (!multiple) {\r\n @if (row.item.imageUrl) {\r\n <img class=\"solaris-select__avatar\" [ngSrc]=\"row.item.imageUrl\" alt=\"\" fill />\r\n } @else if (row.item.icon) {\r\n <i class=\"solaris-select__icon\" [class]=\"row.item.icon\" aria-hidden=\"true\"></i>\r\n }\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-select__option-main\">\r\n <span class=\"solaris-select__option-label\">\r\n @if (row.item.labelKey) { {{ row.item.labelKey | translate }} }\r\n @else { {{ row.item.label }} }\r\n </span>\r\n\r\n @if (row.item.description || row.item.descriptionKey) {\r\n <span class=\"solaris-select__option-desc\">\r\n @if (row.item.descriptionKey) { {{ row.item.descriptionKey | translate }} }\r\n @else { {{ row.item.description }} }\r\n </span>\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-select__option-end\">\r\n @if (row.item.endTextKey) {\r\n <span class=\"solaris-select__end-text\">{{ row.item.endTextKey | translate }}</span>\r\n } @else if (row.item.endText) {\r\n <span class=\"solaris-select__end-text\">{{ row.item.endText }}</span>\r\n }\r\n\r\n @if (!multiple && row.selected) {\r\n <i class=\"ph ph-check\" aria-hidden=\"true\"></i>\r\n }\r\n\r\n @if (row.hasChildren) {\r\n <i class=\"ph ph-caret-right\" aria-hidden=\"true\"></i>\r\n }\r\n </span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n</solaris-popover>\r\n", styles: [":host{width:100%;display:block}.solaris-select__trigger{width:100%;min-width:0;display:flex;position:relative;align-items:center;padding-right:2.8rem;gap:var(--solaris-space-2)}.solaris-select__token{opacity:1;min-width:0;flex:0 1 auto;max-width:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--solaris-color-text)}.solaris-select__input{border:0;width:1px;outline:none;min-width:6rem;padding:1rem 0;background:transparent;font-size:var(--solaris-fs-14);color:var(--solaris-color-text);line-height:var(--solaris-lh-normal)}:host([data-compact=true]) .solaris-select__input{flex:0 0 2ch;width:2ch;min-width:2ch}.solaris-select__input::placeholder{opacity:.9;color:var(--solaris-color-text-muted)}.solaris-select__chevron-btn i.ph{margin-right:1.5rem;transform:rotate(0);transition:transform .16s ease,opacity .16s ease}:host([data-open=true]) .solaris-select__chevron-btn i.ph{transform:rotate(180deg);opacity:.95}.solaris-select__display{top:0;left:0;bottom:0;display:flex;right:2.8rem;overflow:hidden;position:absolute;align-items:center;white-space:nowrap;pointer-events:none;text-overflow:ellipsis}.solaris-select__display.is-hidden{opacity:0}.solaris-select__input::placeholder,.solaris-select__placeholder{opacity:.9;color:var(--solaris-color-text-muted)}.solaris-select__input::placeholder,.solaris-select__placeholder,.solaris-select__token{font-size:var(--solaris-fs-14)}.solaris-select__chevron-btn{top:50%;right:0;border:0;display:grid;width:2.8rem;opacity:.85;height:3.6rem;cursor:pointer;position:absolute;place-items:center;background:transparent;transform:translateY(-50%);color:var(--solaris-color-text-muted)}.solaris-select__chevron-btn:disabled{opacity:.5;cursor:not-allowed}.solaris-select__measure{top:-9999px;left:-9999px;position:absolute;visibility:hidden;pointer-events:none;max-width:none!important;overflow:visible!important;width:max-content!important;white-space:nowrap!important;text-overflow:clip!important;display:inline-block!important}.solaris-select__popover{padding:var(--solaris-space-2)}.solaris-select__panel{display:grid;overflow:auto;max-height:32rem;padding:.25rem;gap:var(--solaris-space-2);border-radius:var(--solaris-radius-sm);background:var(--solaris-color-surface-2);border:1px solid var(--solaris-color-border)}.solaris-select__checkbox-spacer{width:1.6rem;height:1.6rem}.solaris-select__nav{display:grid;align-items:center;padding-right:1rem;gap:var(--solaris-space-2);grid-template-columns:auto 1fr}.solaris-select__back{border:0;cursor:pointer;align-items:center;display:inline-flex;background:transparent;gap:var(--solaris-space-1);padding:var(--solaris-space-2);color:var(--solaris-color-text);border-radius:var(--solaris-radius-sm)}.solaris-select__back:hover{background:var(--solaris-color-surface-2)}.solaris-select__title{justify-self:end;font-size:var(--solaris-fs-12);padding-right:var(--solaris-space-1);color:var(--solaris-color-text-muted)}.solaris-select__list{gap:.25rem;display:grid}.solaris-select__group{opacity:.9;padding:.4rem .6rem;text-transform:uppercase;font-size:var(--solaris-fs-10);letter-spacing:var(--solaris-ls-md);color:var(--solaris-color-text-muted)}.solaris-select__divider{height:1px;margin:.35rem .2rem;background:color-mix(in srgb,var(--solaris-color-border) 75%,transparent)}.solaris-select__option{width:100%;border:0;display:grid;cursor:pointer;text-align:left;align-items:center;padding:.7rem .8rem;background:transparent;gap:var(--solaris-space-4);color:var(--solaris-color-text);grid-template-columns:auto 1fr auto;border-radius:var(--solaris-radius-sm)}.solaris-select__option:hover{background:var(--solaris-color-surface-2)}.solaris-select__option.is-active{background:color-mix(in srgb,var(--solaris-color-primary) 7%,var(--solaris-color-surface-2))}.solaris-select__option:disabled{opacity:.45;cursor:not-allowed}.solaris-select__option-leading{align-items:center;display:inline-flex;gap:var(--solaris-space-2)}.solaris-select__checkbox{display:grid;width:1.6rem;height:1.6rem;place-items:center;border-radius:.4rem;background:var(--solaris-color-surface);color:var(--solaris-color-primary-contrast);border:1px solid color-mix(in srgb,var(--solaris-color-border) 85%,transparent)}.solaris-select__checkbox i.ph{opacity:0;line-height:1;font-size:1.2rem;transform:scale(.9);transition:opacity .12s ease,transform .12s ease}.solaris-select__checkbox.is-checked{background:var(--solaris-color-primary);border-color:color-mix(in srgb,var(--solaris-color-primary) 70%,var(--solaris-color-border))}.solaris-select__checkbox.is-checked i.ph{opacity:1;transform:scale(1)}.solaris-select__avatar{width:1.8rem;height:1.8rem;object-fit:cover;border-radius:var(--solaris-radius-full)}.solaris-select__icon{opacity:.9;font-size:var(--solaris-fs-16);color:var(--solaris-color-text-muted)}.solaris-select__option-main{min-width:0;gap:.15rem;display:grid}.solaris-select__option-label{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.solaris-select__option-desc{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}.solaris-select__option-end{opacity:.9;align-items:center;display:inline-flex;gap:var(--solaris-space-2);color:var(--solaris-color-text-muted)}.solaris-select__option-end i.ph-check{color:var(--solaris-color-success)}.solaris-select__end-text{font-size:var(--solaris-fs-12);color:var(--solaris-color-text-muted)}\n"] }]
|
|
4707
|
+
}], ctorParameters: () => [], propDecorators: { field: [{
|
|
4708
|
+
type: Optional
|
|
4709
|
+
}], tokenEl: [{
|
|
4710
|
+
type: ViewChild,
|
|
4711
|
+
args: ['tokenEl', { read: ElementRef }]
|
|
4712
|
+
}], measureSlot: [{
|
|
4713
|
+
type: ViewChild,
|
|
4714
|
+
args: ['measureSlot', { read: ElementRef }]
|
|
4715
|
+
}], triggerWrap: [{
|
|
4716
|
+
type: ViewChild,
|
|
4717
|
+
args: ['triggerWrap', { read: ElementRef }]
|
|
4718
|
+
}], triggerInput: [{
|
|
4719
|
+
type: ViewChild,
|
|
4720
|
+
args: ['triggerInput', { read: ElementRef }]
|
|
4721
|
+
}], dataOpen: [{
|
|
4722
|
+
type: HostBinding,
|
|
4723
|
+
args: ['attr.data-open']
|
|
4724
|
+
}], dataCompact: [{
|
|
4725
|
+
type: HostBinding,
|
|
4726
|
+
args: ['attr.data-compact']
|
|
4727
|
+
}], items: [{
|
|
4728
|
+
type: Input
|
|
4729
|
+
}], multiple: [{
|
|
4730
|
+
type: Input
|
|
4731
|
+
}], valueKey: [{
|
|
4732
|
+
type: Input
|
|
4733
|
+
}], backKey: [{
|
|
4734
|
+
type: Input
|
|
4735
|
+
}], placeholder: [{
|
|
4736
|
+
type: Input
|
|
4737
|
+
}], placeholderKey: [{
|
|
4738
|
+
type: Input
|
|
4739
|
+
}], searchable: [{
|
|
4740
|
+
type: Input
|
|
4741
|
+
}], selectedCountKey: [{
|
|
4742
|
+
type: Input
|
|
4743
|
+
}], selectedFirst: [{
|
|
4744
|
+
type: Input
|
|
4745
|
+
}], searchPlaceholder: [{
|
|
4746
|
+
type: Input
|
|
4747
|
+
}], selectedCountText: [{
|
|
4748
|
+
type: Input
|
|
4749
|
+
}], panelMaxHeight: [{
|
|
4750
|
+
type: Input
|
|
4751
|
+
}], searchPlaceholderKey: [{
|
|
4752
|
+
type: Input
|
|
4753
|
+
}], selectionSeparator: [{
|
|
4754
|
+
type: Input
|
|
4755
|
+
}], compareWith: [{
|
|
4756
|
+
type: Input
|
|
4757
|
+
}], backText: [{
|
|
4758
|
+
type: Input
|
|
4759
|
+
}], selectionDisplay: [{
|
|
4760
|
+
type: Input
|
|
4761
|
+
}], disabled: [{
|
|
4762
|
+
type: Input
|
|
4763
|
+
}] } });
|
|
4764
|
+
|
|
2218
4765
|
/// <reference path="./typings/intl-tel-input-utils.d.ts" />
|
|
2219
4766
|
|
|
2220
4767
|
/**
|
|
2221
4768
|
* Generated bundle index. Do not edit.
|
|
2222
4769
|
*/
|
|
2223
4770
|
|
|
2224
|
-
export { FieldErrorComponent, FormField, InputTextDirective, PasswordToggle, SOLARIS_FORM_FIELD_CONTROLLER, SOLARIS_FORM_FIELD_FEATURES, SOLARIS_INPUT, SolarisBadge, SolarisBodyDirective, SolarisBreadcrumb,
|
|
4771
|
+
export { ButtonDirective, ButtonGroupDirective, FieldErrorComponent, FormField, InputTextDirective, PasswordToggle, SOLARIS_FORM_FIELD_CONTROLLER, SOLARIS_FORM_FIELD_FEATURES, SOLARIS_INPUT, SolarisBadge, SolarisBodyDirective, SolarisBreadcrumb, SolarisCheckbox, SolarisColumnCellDef, SolarisColumnHeaderDef, SolarisControlBridgeDirective, SolarisDivider, SolarisDrawer, SolarisDrawerFooterDirective, SolarisDrawerHeaderDirective, SolarisDropdownContent, SolarisDropdownContentPanelDirective, SolarisDropdownContentRegistry, SolarisDropdownContentTriggerDirective, SolarisEmailDirective, SolarisFilterBar, SolarisFilterChip, SolarisFilterField, SolarisFilterPanel, SolarisFilterPanelFooterDirective, SolarisFooterDirective, SolarisFormFieldController, SolarisHeaderDirective, SolarisIdGenerator, SolarisImageSliderComponent, SolarisLoading, SolarisLoadingOverlay, SolarisPage, SolarisPageHeader, SolarisPageHeaderBreadcrumbDirective, SolarisPageHeaderDescriptionDirective, SolarisPageHeaderTitle, SolarisPageHeaderTitleDirective, SolarisPasswordDirective, SolarisPhoneInput, SolarisPopover, SolarisPopoverPanelDirective, SolarisPopoverTriggerDirective, SolarisPrefixDirective, SolarisRowComponent, SolarisSectionComponent, SolarisSelect, SolarisSuffixDirective, SolarisTab, SolarisTable, SolarisTableColumn, SolarisTableFilters, SolarisTableSkeleton, SolarisTabs, computePopoverPosition, uniqueId };
|
|
2225
4772
|
//# sourceMappingURL=educarehq-solaris-components.mjs.map
|