@educarehq/solaris-components 0.4.4 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/educarehq-solaris-components.mjs +2410 -87
- package/fesm2022/educarehq-solaris-components.mjs.map +1 -1
- package/package.json +3 -3
- package/styles/layouts/dialog/dialog.styles.scss +35 -0
- package/styles/solaris-components.scss +2 -0
- package/styles/visual/avatar.styles.scss +6 -0
- package/types/educarehq-solaris-components.d.ts +945 -226
|
@@ -1,9 +1,9 @@
|
|
|
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, ViewChildren, ContentChildren, ApplicationRef, signal, computed, effect, HostListener, Optional, booleanAttribute, InjectionToken, makeEnvironmentProviders, PLATFORM_ID,
|
|
2
|
+
import { inject, ElementRef, Renderer2, Directive, TemplateRef, Injectable, ViewContainerRef, DestroyRef, Input, ContentChild, ViewEncapsulation, Component, EventEmitter, Output, HostBinding, ChangeDetectionStrategy, ViewChildren, ContentChildren, ApplicationRef, signal, computed, effect, HostListener, Optional, EnvironmentInjector, createComponent, input, booleanAttribute, InjectionToken, makeEnvironmentProviders, PLATFORM_ID, viewChild, numberAttribute, afterNextRender, ViewChild, Injector, output, forwardRef, Host } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { Overlay } from '@angular/cdk/overlay';
|
|
5
5
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
6
|
-
import { fromEvent, merge } from 'rxjs';
|
|
6
|
+
import { fromEvent, Subject, 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';
|
|
@@ -11,7 +11,7 @@ import * as i1 from '@angular/common';
|
|
|
11
11
|
import { NgClass, NgTemplateOutlet, CommonModule, NgStyle, isPlatformBrowser, DOCUMENT, NgOptimizedImage } from '@angular/common';
|
|
12
12
|
import { SolarisTranslationPipe, SOLARIS_TRANSLATION, SOLARIS_TRANSLATION_CONFIGURATION } from '@educarehq/solaris-services';
|
|
13
13
|
import * as i1$1 from '@angular/forms';
|
|
14
|
-
import { NG_VALUE_ACCESSOR, FormsModule, NgForm, FormGroupDirective, NgControl
|
|
14
|
+
import { NG_VALUE_ACCESSOR, FormsModule, NG_VALIDATORS, NgForm, FormGroupDirective, NgControl } from '@angular/forms';
|
|
15
15
|
import { getCountries, getCountryCallingCode, parsePhoneNumberFromString, AsYouType } from 'libphonenumber-js';
|
|
16
16
|
import intlTelInput from 'intl-tel-input';
|
|
17
17
|
|
|
@@ -978,10 +978,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
978
978
|
}]
|
|
979
979
|
}] });
|
|
980
980
|
|
|
981
|
-
function clamp$
|
|
981
|
+
function clamp$2(v, min, max) {
|
|
982
982
|
return Math.max(min, Math.min(max, v));
|
|
983
983
|
}
|
|
984
|
-
function initialXY(anchor, panel, placement, offset) {
|
|
984
|
+
function initialXY$1(anchor, panel, placement, offset) {
|
|
985
985
|
const axMid = anchor.left + anchor.width / 2;
|
|
986
986
|
const ayMid = anchor.top + anchor.height / 2;
|
|
987
987
|
switch (placement) {
|
|
@@ -1022,10 +1022,10 @@ function computePopoverPosition(anchorRect, panelRect, configuration) {
|
|
|
1022
1022
|
const bottom = y + panelRect.height;
|
|
1023
1023
|
return left >= pad && top >= pad && right <= vw - pad && bottom <= vh - pad;
|
|
1024
1024
|
};
|
|
1025
|
-
let pos = initialXY(anchorRect, panelRect, applied, configuration.offset);
|
|
1025
|
+
let pos = initialXY$1(anchorRect, panelRect, applied, configuration.offset);
|
|
1026
1026
|
if (configuration.autoFlip && !fits(pos.x, pos.y)) {
|
|
1027
1027
|
const flipped = flipPlacement(applied);
|
|
1028
|
-
const flippedPos = initialXY(anchorRect, panelRect, flipped, configuration.offset);
|
|
1028
|
+
const flippedPos = initialXY$1(anchorRect, panelRect, flipped, configuration.offset);
|
|
1029
1029
|
if (fits(flippedPos.x, flippedPos.y)) {
|
|
1030
1030
|
applied = flipped;
|
|
1031
1031
|
pos = flippedPos;
|
|
@@ -1033,8 +1033,8 @@ function computePopoverPosition(anchorRect, panelRect, configuration) {
|
|
|
1033
1033
|
}
|
|
1034
1034
|
if (configuration.autoShift) {
|
|
1035
1035
|
const pad = configuration.viewportPadding;
|
|
1036
|
-
pos.x = clamp$
|
|
1037
|
-
pos.y = clamp$
|
|
1036
|
+
pos.x = clamp$2(pos.x, pad, vw - pad - panelRect.width);
|
|
1037
|
+
pos.y = clamp$2(pos.y, pad, vh - pad - panelRect.height);
|
|
1038
1038
|
}
|
|
1039
1039
|
return { x: pos.x, y: pos.y, appliedPlacement: applied };
|
|
1040
1040
|
}
|
|
@@ -1509,7 +1509,340 @@ function coerceBoolean$2(v) {
|
|
|
1509
1509
|
return v === '' || v === true || v === 'true' || v === 1 || v === '1';
|
|
1510
1510
|
}
|
|
1511
1511
|
|
|
1512
|
-
|
|
1512
|
+
function clamp$1(value, min, max) {
|
|
1513
|
+
return Math.max(min, Math.min(max, value));
|
|
1514
|
+
}
|
|
1515
|
+
function oppositePosition(position) {
|
|
1516
|
+
switch (position) {
|
|
1517
|
+
case 'top': return 'bottom';
|
|
1518
|
+
case 'bottom': return 'top';
|
|
1519
|
+
case 'left': return 'right';
|
|
1520
|
+
case 'right': return 'left';
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
function initialXY(anchor, panel, position, offset) {
|
|
1524
|
+
const anchorCenterX = anchor.left + anchor.width / 2;
|
|
1525
|
+
const anchorCenterY = anchor.top + anchor.height / 2;
|
|
1526
|
+
switch (position) {
|
|
1527
|
+
case 'top':
|
|
1528
|
+
return {
|
|
1529
|
+
x: anchorCenterX - panel.width / 2,
|
|
1530
|
+
y: anchor.top - panel.height - offset,
|
|
1531
|
+
};
|
|
1532
|
+
case 'bottom':
|
|
1533
|
+
return {
|
|
1534
|
+
x: anchorCenterX - panel.width / 2,
|
|
1535
|
+
y: anchor.bottom + offset,
|
|
1536
|
+
};
|
|
1537
|
+
case 'right':
|
|
1538
|
+
return {
|
|
1539
|
+
x: anchor.right + offset,
|
|
1540
|
+
y: anchorCenterY - panel.height / 2,
|
|
1541
|
+
};
|
|
1542
|
+
case 'left':
|
|
1543
|
+
return {
|
|
1544
|
+
x: anchor.left - panel.width - offset,
|
|
1545
|
+
y: anchorCenterY - panel.height / 2,
|
|
1546
|
+
};
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
function computeFloatingPosition(anchorRect, panelRect, configuration) {
|
|
1550
|
+
const viewportWidth = window.innerWidth;
|
|
1551
|
+
const viewportHeight = window.innerHeight;
|
|
1552
|
+
const padding = configuration.viewportPadding;
|
|
1553
|
+
let appliedPosition = configuration.position;
|
|
1554
|
+
let position = initialXY(anchorRect, panelRect, appliedPosition, configuration.offset);
|
|
1555
|
+
const fits = (x, y) => {
|
|
1556
|
+
const left = x;
|
|
1557
|
+
const top = y;
|
|
1558
|
+
const right = x + panelRect.width;
|
|
1559
|
+
const bottom = y + panelRect.height;
|
|
1560
|
+
return (left >= padding &&
|
|
1561
|
+
top >= padding &&
|
|
1562
|
+
right <= viewportWidth - padding &&
|
|
1563
|
+
bottom <= viewportHeight - padding);
|
|
1564
|
+
};
|
|
1565
|
+
if (configuration.autoFlip && !fits(position.x, position.y)) {
|
|
1566
|
+
const flipped = oppositePosition(appliedPosition);
|
|
1567
|
+
const flippedPosition = initialXY(anchorRect, panelRect, flipped, configuration.offset);
|
|
1568
|
+
if (fits(flippedPosition.x, flippedPosition.y)) {
|
|
1569
|
+
appliedPosition = flipped;
|
|
1570
|
+
position = flippedPosition;
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
if (configuration.autoShift) {
|
|
1574
|
+
position.x = clamp$1(position.x, padding, viewportWidth - padding - panelRect.width);
|
|
1575
|
+
position.y = clamp$1(position.y, padding, viewportHeight - padding - panelRect.height);
|
|
1576
|
+
}
|
|
1577
|
+
return {
|
|
1578
|
+
x: position.x,
|
|
1579
|
+
y: position.y,
|
|
1580
|
+
appliedPosition,
|
|
1581
|
+
};
|
|
1582
|
+
}
|
|
1583
|
+
function repositionTooltipOverlay(anchor, overlayRef, options, setAppliedPosition) {
|
|
1584
|
+
const anchorRect = anchor.nativeElement.getBoundingClientRect();
|
|
1585
|
+
const panelRect = overlayRef.hostElement.getBoundingClientRect();
|
|
1586
|
+
const result = computeFloatingPosition(anchorRect, panelRect, options);
|
|
1587
|
+
overlayRef.setTransform(result.x, result.y);
|
|
1588
|
+
setAppliedPosition(result.appliedPosition);
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
class SolarisFloatingOverlayService {
|
|
1592
|
+
appRef = inject(ApplicationRef);
|
|
1593
|
+
injector = inject(EnvironmentInjector);
|
|
1594
|
+
create(component, options = {}) {
|
|
1595
|
+
const id = this.createId(options.idPrefix ?? 'solaris-floating');
|
|
1596
|
+
const host = document.createElement('div');
|
|
1597
|
+
host.id = id;
|
|
1598
|
+
host.style.position = 'fixed';
|
|
1599
|
+
host.style.top = '0';
|
|
1600
|
+
host.style.left = '0';
|
|
1601
|
+
host.style.display = 'block';
|
|
1602
|
+
host.style.width = 'max-content';
|
|
1603
|
+
host.style.maxWidth = 'max-content';
|
|
1604
|
+
host.style.zIndex = options.zIndex ?? 'var(--solaris-z-tooltip, 1200)';
|
|
1605
|
+
host.style.pointerEvents = options.pointerEvents ?? 'none';
|
|
1606
|
+
host.style.transform = 'translate3d(0, 0, 0)';
|
|
1607
|
+
if (options.panelClass?.trim()) {
|
|
1608
|
+
host.className = options.panelClass.trim();
|
|
1609
|
+
}
|
|
1610
|
+
document.body.appendChild(host);
|
|
1611
|
+
const componentRef = createComponent(component, {
|
|
1612
|
+
environmentInjector: this.injector,
|
|
1613
|
+
hostElement: host,
|
|
1614
|
+
});
|
|
1615
|
+
this.appRef.attachView(componentRef.hostView);
|
|
1616
|
+
componentRef.changeDetectorRef.detectChanges();
|
|
1617
|
+
return {
|
|
1618
|
+
id,
|
|
1619
|
+
hostElement: host,
|
|
1620
|
+
componentRef,
|
|
1621
|
+
setTransform(x, y) {
|
|
1622
|
+
host.style.transform = `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)`;
|
|
1623
|
+
},
|
|
1624
|
+
destroy: () => {
|
|
1625
|
+
this.appRef.detachView(componentRef.hostView);
|
|
1626
|
+
componentRef.destroy();
|
|
1627
|
+
host.remove();
|
|
1628
|
+
},
|
|
1629
|
+
};
|
|
1630
|
+
}
|
|
1631
|
+
reposition(context) {
|
|
1632
|
+
const anchorRect = context.anchor.getBoundingClientRect();
|
|
1633
|
+
const panelRect = context.overlayRef.hostElement.getBoundingClientRect();
|
|
1634
|
+
const result = computeFloatingPosition(anchorRect, panelRect, context.options);
|
|
1635
|
+
context.overlayRef.setTransform(result.x, result.y);
|
|
1636
|
+
context.setAppliedPosition(result.appliedPosition);
|
|
1637
|
+
}
|
|
1638
|
+
clearFloatingTimers(showTimer, hideTimer, raf) {
|
|
1639
|
+
globalThis.clearTimeout(showTimer);
|
|
1640
|
+
globalThis.clearTimeout(hideTimer);
|
|
1641
|
+
if (raf) {
|
|
1642
|
+
cancelAnimationFrame(raf);
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
destroyOverlay(overlayRef) {
|
|
1646
|
+
overlayRef?.destroy();
|
|
1647
|
+
}
|
|
1648
|
+
createId(prefix) {
|
|
1649
|
+
const random = typeof crypto !== 'undefined' && 'randomUUID' in crypto
|
|
1650
|
+
? crypto.randomUUID()
|
|
1651
|
+
: `${Date.now()}-${Math.round(Math.random() * 1_000_000)}`;
|
|
1652
|
+
return `${prefix}-${random}`;
|
|
1653
|
+
}
|
|
1654
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFloatingOverlayService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1655
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFloatingOverlayService, providedIn: 'root' });
|
|
1656
|
+
}
|
|
1657
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFloatingOverlayService, decorators: [{
|
|
1658
|
+
type: Injectable,
|
|
1659
|
+
args: [{
|
|
1660
|
+
providedIn: 'root',
|
|
1661
|
+
}]
|
|
1662
|
+
}] });
|
|
1663
|
+
|
|
1664
|
+
class SolarisRichTooltipPanel {
|
|
1665
|
+
template = input(null, ...(ngDevMode ? [{ debugName: "template" }] : []));
|
|
1666
|
+
position = input('top', ...(ngDevMode ? [{ debugName: "position" }] : []));
|
|
1667
|
+
variant = input('inverse', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
1668
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1669
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisRichTooltipPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1670
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisRichTooltipPanel, isStandalone: true, selector: "solaris-rich-tooltip-panel", inputs: { template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"solaris-rich-tooltip\" [attr.data-position]=\"position()\" [attr.data-variant]=\"variant()\"\r\n [attr.data-size]=\"size()\" role=\"tooltip\">\r\n <div class=\"solaris-rich-tooltip__content\">\r\n @if (template()) {\r\n <ng-container [ngTemplateOutlet]=\"template()\"></ng-container>\r\n }\r\n </div>\r\n\r\n <span class=\"solaris-rich-tooltip__arrow\" aria-hidden=\"true\"></span>\r\n</div>\r\n", styles: [":host{display:block;inline-size:max-content;max-inline-size:max-content}.solaris-rich-tooltip{--solaris-tooltip-padding-x: 1rem;--solaris-tooltip-padding-y: 1rem;--solaris-tooltip-max-width: 32rem;--solaris-tooltip-arrow-size: .8rem;--solaris-tooltip-fg: var(--solaris-color-text);--solaris-tooltip-shadow: var(--solaris-shadow-md);--solaris-tooltip-radius: var(--solaris-radius-md);--solaris-tooltip-bg: var(--solaris-color-surface-2);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-color-border) 75%, transparent);text-align:start;isolation:isolate;position:relative;pointer-events:auto;font-size:var(--solaris-fs-13);color:var(--solaris-tooltip-fg);background:var(--solaris-tooltip-bg);line-height:var(--solaris-lh-normal);box-shadow:var(--solaris-tooltip-shadow);border-radius:var(--solaris-tooltip-radius);animation:solaris-rich-tooltip-in .12s ease;border:1px solid var(--solaris-tooltip-border);max-inline-size:var(--solaris-tooltip-max-width);padding:var(--solaris-tooltip-padding-y) var(--solaris-tooltip-padding-x)}.solaris-rich-tooltip[data-size=sm]{--solaris-tooltip-max-width: 24rem;--solaris-tooltip-padding-y: .75rem;--solaris-tooltip-padding-x: .85rem;--solaris-tooltip-radius: var(--solaris-radius-sm)}.solaris-rich-tooltip[data-size=md]{--solaris-tooltip-max-width: 32rem}.solaris-rich-tooltip[data-size=lg]{--solaris-tooltip-max-width: 42rem;--solaris-tooltip-padding-y: 1.2rem;--solaris-tooltip-padding-x: 1.2rem;--solaris-tooltip-radius: var(--solaris-radius-lg)}.solaris-rich-tooltip[data-variant=default]{--solaris-tooltip-fg: var(--solaris-color-text);--solaris-tooltip-bg: var(--solaris-color-surface);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-color-border) 85%, transparent)}.solaris-rich-tooltip[data-variant=inverse]{--solaris-tooltip-fg: var(--solaris-color-surface);--solaris-tooltip-bg: color-mix(in srgb, var(--solaris-color-text) 92%, black);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-tooltip-bg) 82%, white)}.solaris-rich-tooltip[data-variant=primary]{--solaris-tooltip-fg: white;--solaris-tooltip-bg: var(--solaris-color-primary);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-color-primary) 75%, white)}.solaris-rich-tooltip__content{z-index:1;position:relative;min-inline-size:0}.solaris-rich-tooltip__arrow{z-index:0;position:absolute;transform:rotate(45deg);background:var(--solaris-tooltip-bg);block-size:var(--solaris-tooltip-arrow-size);inline-size:var(--solaris-tooltip-arrow-size);border:1px solid var(--solaris-tooltip-border)}.solaris-rich-tooltip[data-position=top] .solaris-rich-tooltip__arrow{inset-inline-start:50%;border-block-start-color:transparent;border-inline-start-color:transparent;transform:translate(-50%) rotate(45deg);inset-block-end:calc(var(--solaris-tooltip-arrow-size) / -2)}.solaris-rich-tooltip[data-position=bottom] .solaris-rich-tooltip__arrow{inset-inline-start:50%;border-block-end-color:transparent;border-inline-end-color:transparent;transform:translate(-50%) rotate(45deg);inset-block-start:calc(var(--solaris-tooltip-arrow-size) / -2)}.solaris-rich-tooltip[data-position=right] .solaris-rich-tooltip__arrow{inset-block-start:50%;border-inline-end-color:transparent;border-block-start-color:transparent;transform:translateY(-50%) rotate(45deg);inset-inline-start:calc(var(--solaris-tooltip-arrow-size) / -2)}.solaris-rich-tooltip[data-position=left] .solaris-rich-tooltip__arrow{inset-block-start:50%;border-block-end-color:transparent;border-inline-start-color:transparent;transform:translateY(-50%) rotate(45deg);inset-inline-end:calc(var(--solaris-tooltip-arrow-size) / -2)}@keyframes solaris-rich-tooltip-in{0%{opacity:0;filter:blur(.1rem);transform:scale(.98)}to{opacity:1;filter:blur(0);transform:scale(1)}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1671
|
+
}
|
|
1672
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisRichTooltipPanel, decorators: [{
|
|
1673
|
+
type: Component,
|
|
1674
|
+
args: [{ selector: 'solaris-rich-tooltip-panel', standalone: true, imports: [
|
|
1675
|
+
NgTemplateOutlet
|
|
1676
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"solaris-rich-tooltip\" [attr.data-position]=\"position()\" [attr.data-variant]=\"variant()\"\r\n [attr.data-size]=\"size()\" role=\"tooltip\">\r\n <div class=\"solaris-rich-tooltip__content\">\r\n @if (template()) {\r\n <ng-container [ngTemplateOutlet]=\"template()\"></ng-container>\r\n }\r\n </div>\r\n\r\n <span class=\"solaris-rich-tooltip__arrow\" aria-hidden=\"true\"></span>\r\n</div>\r\n", styles: [":host{display:block;inline-size:max-content;max-inline-size:max-content}.solaris-rich-tooltip{--solaris-tooltip-padding-x: 1rem;--solaris-tooltip-padding-y: 1rem;--solaris-tooltip-max-width: 32rem;--solaris-tooltip-arrow-size: .8rem;--solaris-tooltip-fg: var(--solaris-color-text);--solaris-tooltip-shadow: var(--solaris-shadow-md);--solaris-tooltip-radius: var(--solaris-radius-md);--solaris-tooltip-bg: var(--solaris-color-surface-2);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-color-border) 75%, transparent);text-align:start;isolation:isolate;position:relative;pointer-events:auto;font-size:var(--solaris-fs-13);color:var(--solaris-tooltip-fg);background:var(--solaris-tooltip-bg);line-height:var(--solaris-lh-normal);box-shadow:var(--solaris-tooltip-shadow);border-radius:var(--solaris-tooltip-radius);animation:solaris-rich-tooltip-in .12s ease;border:1px solid var(--solaris-tooltip-border);max-inline-size:var(--solaris-tooltip-max-width);padding:var(--solaris-tooltip-padding-y) var(--solaris-tooltip-padding-x)}.solaris-rich-tooltip[data-size=sm]{--solaris-tooltip-max-width: 24rem;--solaris-tooltip-padding-y: .75rem;--solaris-tooltip-padding-x: .85rem;--solaris-tooltip-radius: var(--solaris-radius-sm)}.solaris-rich-tooltip[data-size=md]{--solaris-tooltip-max-width: 32rem}.solaris-rich-tooltip[data-size=lg]{--solaris-tooltip-max-width: 42rem;--solaris-tooltip-padding-y: 1.2rem;--solaris-tooltip-padding-x: 1.2rem;--solaris-tooltip-radius: var(--solaris-radius-lg)}.solaris-rich-tooltip[data-variant=default]{--solaris-tooltip-fg: var(--solaris-color-text);--solaris-tooltip-bg: var(--solaris-color-surface);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-color-border) 85%, transparent)}.solaris-rich-tooltip[data-variant=inverse]{--solaris-tooltip-fg: var(--solaris-color-surface);--solaris-tooltip-bg: color-mix(in srgb, var(--solaris-color-text) 92%, black);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-tooltip-bg) 82%, white)}.solaris-rich-tooltip[data-variant=primary]{--solaris-tooltip-fg: white;--solaris-tooltip-bg: var(--solaris-color-primary);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-color-primary) 75%, white)}.solaris-rich-tooltip__content{z-index:1;position:relative;min-inline-size:0}.solaris-rich-tooltip__arrow{z-index:0;position:absolute;transform:rotate(45deg);background:var(--solaris-tooltip-bg);block-size:var(--solaris-tooltip-arrow-size);inline-size:var(--solaris-tooltip-arrow-size);border:1px solid var(--solaris-tooltip-border)}.solaris-rich-tooltip[data-position=top] .solaris-rich-tooltip__arrow{inset-inline-start:50%;border-block-start-color:transparent;border-inline-start-color:transparent;transform:translate(-50%) rotate(45deg);inset-block-end:calc(var(--solaris-tooltip-arrow-size) / -2)}.solaris-rich-tooltip[data-position=bottom] .solaris-rich-tooltip__arrow{inset-inline-start:50%;border-block-end-color:transparent;border-inline-end-color:transparent;transform:translate(-50%) rotate(45deg);inset-block-start:calc(var(--solaris-tooltip-arrow-size) / -2)}.solaris-rich-tooltip[data-position=right] .solaris-rich-tooltip__arrow{inset-block-start:50%;border-inline-end-color:transparent;border-block-start-color:transparent;transform:translateY(-50%) rotate(45deg);inset-inline-start:calc(var(--solaris-tooltip-arrow-size) / -2)}.solaris-rich-tooltip[data-position=left] .solaris-rich-tooltip__arrow{inset-block-start:50%;border-block-end-color:transparent;border-inline-start-color:transparent;transform:translateY(-50%) rotate(45deg);inset-inline-end:calc(var(--solaris-tooltip-arrow-size) / -2)}@keyframes solaris-rich-tooltip-in{0%{opacity:0;filter:blur(.1rem);transform:scale(.98)}to{opacity:1;filter:blur(0);transform:scale(1)}}\n"] }]
|
|
1677
|
+
}], propDecorators: { template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
1678
|
+
|
|
1679
|
+
class SolarisRichTooltipDirective {
|
|
1680
|
+
elementRef = inject(ElementRef);
|
|
1681
|
+
renderer = inject(Renderer2);
|
|
1682
|
+
floatingOverlay = inject(SolarisFloatingOverlayService);
|
|
1683
|
+
template = input(null, { ...(ngDevMode ? { debugName: "template" } : {}), alias: 'solaris-rich-tooltip' });
|
|
1684
|
+
tooltipPosition = input('top', { ...(ngDevMode ? { debugName: "tooltipPosition" } : {}), alias: 'tooltip-position' });
|
|
1685
|
+
tooltipVariant = input('inverse', { ...(ngDevMode ? { debugName: "tooltipVariant" } : {}), alias: 'tooltip-variant' });
|
|
1686
|
+
tooltipSize = input('md', { ...(ngDevMode ? { debugName: "tooltipSize" } : {}), alias: 'tooltip-size' });
|
|
1687
|
+
tooltipDisabled = input(false, { ...(ngDevMode ? { debugName: "tooltipDisabled" } : {}), alias: 'tooltip-disabled' });
|
|
1688
|
+
tooltipShowDelay = input(300, { ...(ngDevMode ? { debugName: "tooltipShowDelay" } : {}), alias: 'tooltip-show-delay' });
|
|
1689
|
+
tooltipHideDelay = input(120, { ...(ngDevMode ? { debugName: "tooltipHideDelay" } : {}), alias: 'tooltip-hide-delay' });
|
|
1690
|
+
tooltipOffset = input(8, { ...(ngDevMode ? { debugName: "tooltipOffset" } : {}), alias: 'tooltip-offset' });
|
|
1691
|
+
tooltipAutoFlip = input(true, { ...(ngDevMode ? { debugName: "tooltipAutoFlip" } : {}), alias: 'tooltip-auto-flip' });
|
|
1692
|
+
tooltipAutoShift = input(true, { ...(ngDevMode ? { debugName: "tooltipAutoShift" } : {}), alias: 'tooltip-auto-shift' });
|
|
1693
|
+
tooltipViewportPadding = input(8, { ...(ngDevMode ? { debugName: "tooltipViewportPadding" } : {}), alias: 'tooltip-viewport-padding' });
|
|
1694
|
+
overlayRef;
|
|
1695
|
+
showTimer = 0;
|
|
1696
|
+
hideTimer = 0;
|
|
1697
|
+
raf = 0;
|
|
1698
|
+
isTriggerHovered = false;
|
|
1699
|
+
isPanelHovered = false;
|
|
1700
|
+
hasFocusInside = false;
|
|
1701
|
+
cleanups = [];
|
|
1702
|
+
constructor() {
|
|
1703
|
+
const host = this.elementRef.nativeElement;
|
|
1704
|
+
this.cleanups.push(this.renderer.listen(host, 'mouseenter', () => {
|
|
1705
|
+
this.isTriggerHovered = true;
|
|
1706
|
+
this.scheduleShow();
|
|
1707
|
+
}), this.renderer.listen(host, 'mouseleave', () => {
|
|
1708
|
+
this.isTriggerHovered = false;
|
|
1709
|
+
this.scheduleHideIfSafe();
|
|
1710
|
+
}), this.renderer.listen(host, 'focusin', () => {
|
|
1711
|
+
this.hasFocusInside = true;
|
|
1712
|
+
this.scheduleShow();
|
|
1713
|
+
}), this.renderer.listen(host, 'focusout', () => {
|
|
1714
|
+
this.hasFocusInside = false;
|
|
1715
|
+
this.scheduleHideIfSafe();
|
|
1716
|
+
}), this.renderer.listen(host, 'keydown', (event) => {
|
|
1717
|
+
if (event.key === 'Escape') {
|
|
1718
|
+
this.hide();
|
|
1719
|
+
}
|
|
1720
|
+
}), this.renderer.listen(globalThis, 'resize', () => this.scheduleReposition()), this.renderer.listen(globalThis, 'scroll', () => this.scheduleReposition()), this.renderer.listen(document, 'keydown', (event) => {
|
|
1721
|
+
if (event.key === 'Escape') {
|
|
1722
|
+
this.hide();
|
|
1723
|
+
}
|
|
1724
|
+
}));
|
|
1725
|
+
effect(() => {
|
|
1726
|
+
if (!this.overlayRef)
|
|
1727
|
+
return;
|
|
1728
|
+
this.applyPanelInputs();
|
|
1729
|
+
this.scheduleReposition();
|
|
1730
|
+
});
|
|
1731
|
+
}
|
|
1732
|
+
scheduleShow() {
|
|
1733
|
+
if (this.tooltipDisabled())
|
|
1734
|
+
return;
|
|
1735
|
+
if (!this.template())
|
|
1736
|
+
return;
|
|
1737
|
+
globalThis.clearTimeout(this.hideTimer);
|
|
1738
|
+
globalThis.clearTimeout(this.showTimer);
|
|
1739
|
+
this.showTimer = globalThis.setTimeout(() => {
|
|
1740
|
+
this.show();
|
|
1741
|
+
}, this.tooltipShowDelay());
|
|
1742
|
+
}
|
|
1743
|
+
scheduleHideIfSafe() {
|
|
1744
|
+
globalThis.clearTimeout(this.showTimer);
|
|
1745
|
+
globalThis.clearTimeout(this.hideTimer);
|
|
1746
|
+
this.hideTimer = globalThis.setTimeout(() => {
|
|
1747
|
+
if (!this.isTriggerHovered && !this.isPanelHovered && !this.hasFocusInside) {
|
|
1748
|
+
this.hide();
|
|
1749
|
+
}
|
|
1750
|
+
}, this.tooltipHideDelay());
|
|
1751
|
+
}
|
|
1752
|
+
show() {
|
|
1753
|
+
if (this.overlayRef || this.tooltipDisabled())
|
|
1754
|
+
return;
|
|
1755
|
+
if (!this.template())
|
|
1756
|
+
return;
|
|
1757
|
+
this.overlayRef = this.floatingOverlay.create(SolarisRichTooltipPanel, {
|
|
1758
|
+
idPrefix: 'solaris-rich-tooltip',
|
|
1759
|
+
zIndex: 'var(--solaris-z-tooltip, 1200)',
|
|
1760
|
+
pointerEvents: 'auto',
|
|
1761
|
+
});
|
|
1762
|
+
this.applyPanelInputs();
|
|
1763
|
+
this.bindPanelInteractions();
|
|
1764
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'aria-describedby', this.overlayRef.id);
|
|
1765
|
+
requestAnimationFrame(() => this.reposition());
|
|
1766
|
+
}
|
|
1767
|
+
bindPanelInteractions() {
|
|
1768
|
+
if (!this.overlayRef)
|
|
1769
|
+
return;
|
|
1770
|
+
const panel = this.overlayRef.hostElement;
|
|
1771
|
+
this.cleanups.push(this.renderer.listen(panel, 'mouseenter', () => {
|
|
1772
|
+
this.isPanelHovered = true;
|
|
1773
|
+
globalThis.clearTimeout(this.hideTimer);
|
|
1774
|
+
}), this.renderer.listen(panel, 'mouseleave', () => {
|
|
1775
|
+
this.isPanelHovered = false;
|
|
1776
|
+
this.scheduleHideIfSafe();
|
|
1777
|
+
}), this.renderer.listen(panel, 'focusin', () => {
|
|
1778
|
+
this.hasFocusInside = true;
|
|
1779
|
+
globalThis.clearTimeout(this.hideTimer);
|
|
1780
|
+
}), this.renderer.listen(panel, 'focusout', () => {
|
|
1781
|
+
this.hasFocusInside = false;
|
|
1782
|
+
this.scheduleHideIfSafe();
|
|
1783
|
+
}));
|
|
1784
|
+
}
|
|
1785
|
+
hide() {
|
|
1786
|
+
this.floatingOverlay.clearFloatingTimers(this.showTimer, this.hideTimer, this.raf);
|
|
1787
|
+
this.raf = 0;
|
|
1788
|
+
this.renderer.removeAttribute(this.elementRef.nativeElement, 'aria-describedby');
|
|
1789
|
+
this.floatingOverlay.destroyOverlay(this.overlayRef);
|
|
1790
|
+
this.overlayRef = undefined;
|
|
1791
|
+
this.isPanelHovered = false;
|
|
1792
|
+
this.hasFocusInside = false;
|
|
1793
|
+
}
|
|
1794
|
+
applyPanelInputs() {
|
|
1795
|
+
if (!this.overlayRef)
|
|
1796
|
+
return;
|
|
1797
|
+
const panel = this.overlayRef.componentRef;
|
|
1798
|
+
panel.setInput('template', this.template());
|
|
1799
|
+
panel.setInput('position', this.tooltipPosition());
|
|
1800
|
+
panel.setInput('variant', this.tooltipVariant());
|
|
1801
|
+
panel.setInput('size', this.tooltipSize());
|
|
1802
|
+
panel.changeDetectorRef.detectChanges();
|
|
1803
|
+
}
|
|
1804
|
+
scheduleReposition() {
|
|
1805
|
+
if (!this.overlayRef)
|
|
1806
|
+
return;
|
|
1807
|
+
if (this.raf)
|
|
1808
|
+
return;
|
|
1809
|
+
this.raf = requestAnimationFrame(() => {
|
|
1810
|
+
this.raf = 0;
|
|
1811
|
+
this.reposition();
|
|
1812
|
+
});
|
|
1813
|
+
}
|
|
1814
|
+
reposition() {
|
|
1815
|
+
if (!this.overlayRef)
|
|
1816
|
+
return;
|
|
1817
|
+
repositionTooltipOverlay(this.elementRef, this.overlayRef, {
|
|
1818
|
+
position: this.tooltipPosition(),
|
|
1819
|
+
offset: this.tooltipOffset(),
|
|
1820
|
+
viewportPadding: this.tooltipViewportPadding(),
|
|
1821
|
+
autoFlip: this.tooltipAutoFlip(),
|
|
1822
|
+
autoShift: this.tooltipAutoShift(),
|
|
1823
|
+
}, (position) => {
|
|
1824
|
+
this.overlayRef?.componentRef.setInput('position', position);
|
|
1825
|
+
this.overlayRef?.componentRef.changeDetectorRef.detectChanges();
|
|
1826
|
+
});
|
|
1827
|
+
}
|
|
1828
|
+
ngOnDestroy() {
|
|
1829
|
+
this.hide();
|
|
1830
|
+
for (const cleanup of this.cleanups) {
|
|
1831
|
+
cleanup();
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisRichTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1835
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: SolarisRichTooltipDirective, isStandalone: true, selector: "[solaris-rich-tooltip]", inputs: { template: { classPropertyName: "template", publicName: "solaris-rich-tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltip-position", isSignal: true, isRequired: false, transformFunction: null }, tooltipVariant: { classPropertyName: "tooltipVariant", publicName: "tooltip-variant", isSignal: true, isRequired: false, transformFunction: null }, tooltipSize: { classPropertyName: "tooltipSize", publicName: "tooltip-size", isSignal: true, isRequired: false, transformFunction: null }, tooltipDisabled: { classPropertyName: "tooltipDisabled", publicName: "tooltip-disabled", isSignal: true, isRequired: false, transformFunction: null }, tooltipShowDelay: { classPropertyName: "tooltipShowDelay", publicName: "tooltip-show-delay", isSignal: true, isRequired: false, transformFunction: null }, tooltipHideDelay: { classPropertyName: "tooltipHideDelay", publicName: "tooltip-hide-delay", isSignal: true, isRequired: false, transformFunction: null }, tooltipOffset: { classPropertyName: "tooltipOffset", publicName: "tooltip-offset", isSignal: true, isRequired: false, transformFunction: null }, tooltipAutoFlip: { classPropertyName: "tooltipAutoFlip", publicName: "tooltip-auto-flip", isSignal: true, isRequired: false, transformFunction: null }, tooltipAutoShift: { classPropertyName: "tooltipAutoShift", publicName: "tooltip-auto-shift", isSignal: true, isRequired: false, transformFunction: null }, tooltipViewportPadding: { classPropertyName: "tooltipViewportPadding", publicName: "tooltip-viewport-padding", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
1836
|
+
}
|
|
1837
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisRichTooltipDirective, decorators: [{
|
|
1838
|
+
type: Directive,
|
|
1839
|
+
args: [{
|
|
1840
|
+
selector: '[solaris-rich-tooltip]',
|
|
1841
|
+
standalone: true,
|
|
1842
|
+
}]
|
|
1843
|
+
}], ctorParameters: () => [], propDecorators: { template: [{ type: i0.Input, args: [{ isSignal: true, alias: "solaris-rich-tooltip", required: false }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-position", required: false }] }], tooltipVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-variant", required: false }] }], tooltipSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-size", required: false }] }], tooltipDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-disabled", required: false }] }], tooltipShowDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-show-delay", required: false }] }], tooltipHideDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-hide-delay", required: false }] }], tooltipOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-offset", required: false }] }], tooltipAutoFlip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-auto-flip", required: false }] }], tooltipAutoShift: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-auto-shift", required: false }] }], tooltipViewportPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-viewport-padding", required: false }] }] } });
|
|
1844
|
+
|
|
1845
|
+
const PRESET_COLORS$4 = new Set([
|
|
1513
1846
|
'primary',
|
|
1514
1847
|
'surface',
|
|
1515
1848
|
'success',
|
|
@@ -1518,7 +1851,7 @@ const PRESET_COLORS$2 = new Set([
|
|
|
1518
1851
|
'info',
|
|
1519
1852
|
'gradient',
|
|
1520
1853
|
]);
|
|
1521
|
-
function resolveRadius$
|
|
1854
|
+
function resolveRadius$2(v) {
|
|
1522
1855
|
const s = String(v).trim();
|
|
1523
1856
|
switch (s) {
|
|
1524
1857
|
case 'none':
|
|
@@ -1535,7 +1868,7 @@ function resolveRadius$1(v) {
|
|
|
1535
1868
|
return s;
|
|
1536
1869
|
}
|
|
1537
1870
|
}
|
|
1538
|
-
class
|
|
1871
|
+
class SolarisButtonDirective {
|
|
1539
1872
|
elementRef = inject((ElementRef));
|
|
1540
1873
|
_loading = signal(false, ...(ngDevMode ? [{ debugName: "_loading" }] : []));
|
|
1541
1874
|
_disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : []));
|
|
@@ -1561,7 +1894,7 @@ class ButtonDirective {
|
|
|
1561
1894
|
if (v == null || String(v).trim() === '')
|
|
1562
1895
|
return;
|
|
1563
1896
|
const value = String(v).trim();
|
|
1564
|
-
if (PRESET_COLORS$
|
|
1897
|
+
if (PRESET_COLORS$4.has(value)) {
|
|
1565
1898
|
this._color.set(value);
|
|
1566
1899
|
this._customColor.set(null);
|
|
1567
1900
|
}
|
|
@@ -1635,7 +1968,7 @@ class ButtonDirective {
|
|
|
1635
1968
|
return this._badgeOverlay() ? 'true' : null;
|
|
1636
1969
|
}
|
|
1637
1970
|
get buttonRadius() {
|
|
1638
|
-
return this._radius() ? resolveRadius$
|
|
1971
|
+
return this._radius() ? resolveRadius$2(this._radius()) : null;
|
|
1639
1972
|
}
|
|
1640
1973
|
onClick(ev) {
|
|
1641
1974
|
if (!this.isAnchor())
|
|
@@ -1645,10 +1978,10 @@ class ButtonDirective {
|
|
|
1645
1978
|
ev.stopImmediatePropagation();
|
|
1646
1979
|
}
|
|
1647
1980
|
}
|
|
1648
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
1649
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "21.1.1", type:
|
|
1981
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1982
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "21.1.1", type: SolarisButtonDirective, 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 });
|
|
1650
1983
|
}
|
|
1651
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type:
|
|
1984
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisButtonDirective, decorators: [{
|
|
1652
1985
|
type: Directive,
|
|
1653
1986
|
args: [{
|
|
1654
1987
|
selector: 'button[solaris-button], a[solaris-button]',
|
|
@@ -2192,11 +2525,11 @@ class SolarisNotificationItemComponent {
|
|
|
2192
2525
|
return action.label ?? '';
|
|
2193
2526
|
}
|
|
2194
2527
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisNotificationItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2195
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisNotificationItemComponent, isStandalone: true, selector: "solaris-notification-item", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<article class=\"sn\" [attr.data-kind]=\"item().kind\" [attr.data-mode]=\"mode()\" [attr.data-expanded]=\"item().expanded ? 'true' : 'false'\"\r\n [attr.data-paused]=\"paused() ? 'true' : 'false'\" [attr.aria-live]=\"mode() === 'toast' ? item().ariaLive : null\"\r\n [attr.role]=\"item().ariaLive === 'assertive' ? 'alert' : 'status'\" (mouseenter)=\"onMouseEnter()\" (mouseleave)=\"onMouseLeave()\">\r\n <div class=\"sn__header\" [attr.data-align]=\"isCompactHeader() ? 'center' : 'start'\">\r\n <div class=\"sn__leading\">\r\n <span class=\"sn__icon\" aria-hidden=\"true\">\r\n <i class=\"ph\" [ngClass]=\"iconClass()\"></i>\r\n </span>\r\n\r\n <div class=\"sn__heading\">\r\n <strong class=\"sn__title\">{{ item().title }}</strong>\r\n\r\n @if (!item().expanded && item().description) {\r\n <p class=\"sn__description sn__description--clamped\">\r\n {{ item().description }}\r\n </p>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div class=\"sn__controls\">\r\n @if (item().expandable && item().description) {\r\n <button type=\"button\" class=\"sn__icon-btn\" [attr.aria-expanded]=\"item().expanded\"\r\n [attr.aria-label]=\"item().expanded ? intl.collapse() : intl.expand()\" (click)=\"toggleExpanded()\">\r\n <i class=\"ph\" [ngClass]=\"item().expanded ? 'ph-caret-up' : 'ph-caret-down'\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n\r\n @if (item().closeable) {\r\n <button type=\"button\" class=\"sn__icon-btn\" [attr.aria-label]=\"intl.close()\" (click)=\"close()\">\r\n <i class=\"ph ph-x\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (item().expanded && item().description) {\r\n <div class=\"sn__body\">\r\n <p class=\"sn__body-text\">{{ item().description }}</p>\r\n @if (item().actions.length) {\r\n <div class=\"sn__actions\">\r\n @for (action of item().actions; track action.id) {\r\n <button type=\"button\" solaris-button [variant]=\"action.variant ?? 'outline'\" [color]=\"action.color ?? 'surface'\"\r\n [size]=\"action.size ?? 'sm'\" [radius]=\"action.radius ?? 'md'\" [disabled]=\"action.disabled ?? false\"\r\n (click)=\"runAction(action)\">\r\n {{ resolveActionLabel(action) }}\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (mode() === 'toast' && item().duration !== null) {\r\n <div class=\"sn__footer\">\r\n @if (!paused()) {\r\n <p class=\"sn__timer\">\r\n {{ intl.autoClose(secondsLeft()) }}\r\n <button type=\"button\" class=\"sn__timer-link\" (click)=\"toggleUserPause()\">\r\n {{ intl.stopTimer() }}\r\n </button>.\r\n </p>\r\n } @else {\r\n <p class=\"sn__timer\">\r\n {{ intl.paused() }}\r\n <button type=\"button\" class=\"sn__timer-link\" (click)=\"toggleUserPause()\">\r\n {{ intl.resumeTimer() }}\r\n </button>.\r\n </p>\r\n }\r\n </div>\r\n\r\n <div class=\"sn__progress\" aria-hidden=\"true\">\r\n <span [style.width.%]=\"progress()\"></span>\r\n </div>\r\n }\r\n</article>\r\n", styles: [":host{display:block;pointer-events:auto}.sn{--sn-accent: var(--solaris-color-info);overflow:hidden;color:var(--solaris-color-text);border-radius:var(--solaris-radius-lg);background:var(--solaris-color-surface);border:.1rem solid var(--solaris-color-border);width:min(42rem,100vw - var(--solaris-space-4) * 2)}.sn[data-kind=success]{--sn-accent: var(--solaris-color-success)}.sn[data-kind=warning]{--sn-accent: var(--solaris-color-warning)}.sn[data-kind=error]{--sn-accent: var(--solaris-color-error)}.sn[data-kind=info]{--sn-accent: var(--solaris-color-info)}.sn__header{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--solaris-space-3);padding:var(--solaris-space-4)}.sn__leading{display:flex;align-items:flex-start;gap:var(--solaris-space-3);min-width:0;flex:1}.sn__header[data-align=center],.sn__header[data-align=center] .sn__leading,.sn__header[data-align=center] .sn__controls{align-items:center}.sn[data-expanded=true] .sn__header{padding-bottom:0}.sn__icon{display:grid;flex:0 0 auto;block-size:3.2rem;inline-size:3.2rem;place-items:center;color:var(--sn-accent);border-radius:var(--solaris-radius-full)}.sn__icon .ph{line-height:1;font-size:var(--solaris-fs-24)}.sn__heading{flex:1;min-width:0}.sn__title{display:block;margin:0;font-size:var(--solaris-fs-16);letter-spacing:var(--solaris-ls-0);line-height:var(--solaris-lh-tight);font-family:var(--solaris-font-sans-primary),ui-sans-serif,system-ui}.sn__description,.sn__body-text,.sn__timer{margin:0;font-size:var(--solaris-fs-12);line-height:var(--solaris-lh-relaxed);color:var(--solaris-color-text-muted)}.sn__description--clamped{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;margin-top:var(--solaris-space-1)}.sn__controls{flex:0 0 auto;align-items:center;display:inline-flex;gap:var(--solaris-space-1)}.sn__icon-btn{border:0;display:grid;place-items:center;inline-size:2.5rem;block-size:2.5rem;background:transparent;cursor:pointer;color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-full);transition:background-color .14s ease,color .14s ease,transform .14s ease}.sn__icon-btn:hover{color:var(--solaris-color-text);background:var(--solaris-color-surface-2)}.sn__icon-btn:focus-visible{outline-offset:.2rem;outline:.2rem solid var(--solaris-color-primary)}.sn__icon-btn .ph{line-height:1;font-size:var(--solaris-fs-18)}.sn__body{padding:0 var(--solaris-space-4) var(--solaris-space-4) calc(var(--solaris-space-4) + 3.2rem + var(--solaris-space-3))}.sn__actions{display:flex;flex-wrap:wrap;gap:var(--solaris-space-2);margin-top:var(--solaris-space-4)}.sn__footer{background:var(--solaris-color-surface-2);border-top:.1rem solid var(--solaris-color-border);padding:var(--solaris-space-3) var(--solaris-space-4)}.sn__timer-link{margin:0;padding:0;border:0;font:inherit;cursor:pointer;font-weight:700;background:transparent;color:var(--solaris-color-text)}.sn__timer-link:focus-visible{outline-offset:.2rem;border-radius:var(--solaris-radius-xs);outline:.2rem solid var(--solaris-color-primary)}.sn__progress{block-size:.4rem;background:transparent}.sn__progress>span{display:block;block-size:100%;inline-size:100%;background:var(--sn-accent);transition:width .1s linear}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type:
|
|
2528
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisNotificationItemComponent, isStandalone: true, selector: "solaris-notification-item", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<article class=\"sn\" [attr.data-kind]=\"item().kind\" [attr.data-mode]=\"mode()\" [attr.data-expanded]=\"item().expanded ? 'true' : 'false'\"\r\n [attr.data-paused]=\"paused() ? 'true' : 'false'\" [attr.aria-live]=\"mode() === 'toast' ? item().ariaLive : null\"\r\n [attr.role]=\"item().ariaLive === 'assertive' ? 'alert' : 'status'\" (mouseenter)=\"onMouseEnter()\" (mouseleave)=\"onMouseLeave()\">\r\n <div class=\"sn__header\" [attr.data-align]=\"isCompactHeader() ? 'center' : 'start'\">\r\n <div class=\"sn__leading\">\r\n <span class=\"sn__icon\" aria-hidden=\"true\">\r\n <i class=\"ph\" [ngClass]=\"iconClass()\"></i>\r\n </span>\r\n\r\n <div class=\"sn__heading\">\r\n <strong class=\"sn__title\">{{ item().title }}</strong>\r\n\r\n @if (!item().expanded && item().description) {\r\n <p class=\"sn__description sn__description--clamped\">\r\n {{ item().description }}\r\n </p>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div class=\"sn__controls\">\r\n @if (item().expandable && item().description) {\r\n <button type=\"button\" class=\"sn__icon-btn\" [attr.aria-expanded]=\"item().expanded\"\r\n [attr.aria-label]=\"item().expanded ? intl.collapse() : intl.expand()\" (click)=\"toggleExpanded()\">\r\n <i class=\"ph\" [ngClass]=\"item().expanded ? 'ph-caret-up' : 'ph-caret-down'\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n\r\n @if (item().closeable) {\r\n <button type=\"button\" class=\"sn__icon-btn\" [attr.aria-label]=\"intl.close()\" (click)=\"close()\">\r\n <i class=\"ph ph-x\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (item().expanded && item().description) {\r\n <div class=\"sn__body\">\r\n <p class=\"sn__body-text\">{{ item().description }}</p>\r\n @if (item().actions.length) {\r\n <div class=\"sn__actions\">\r\n @for (action of item().actions; track action.id) {\r\n <button type=\"button\" solaris-button [variant]=\"action.variant ?? 'outline'\" [color]=\"action.color ?? 'surface'\"\r\n [size]=\"action.size ?? 'sm'\" [radius]=\"action.radius ?? 'md'\" [disabled]=\"action.disabled ?? false\"\r\n (click)=\"runAction(action)\">\r\n {{ resolveActionLabel(action) }}\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (mode() === 'toast' && item().duration !== null) {\r\n <div class=\"sn__footer\">\r\n @if (!paused()) {\r\n <p class=\"sn__timer\">\r\n {{ intl.autoClose(secondsLeft()) }}\r\n <button type=\"button\" class=\"sn__timer-link\" (click)=\"toggleUserPause()\">\r\n {{ intl.stopTimer() }}\r\n </button>.\r\n </p>\r\n } @else {\r\n <p class=\"sn__timer\">\r\n {{ intl.paused() }}\r\n <button type=\"button\" class=\"sn__timer-link\" (click)=\"toggleUserPause()\">\r\n {{ intl.resumeTimer() }}\r\n </button>.\r\n </p>\r\n }\r\n </div>\r\n\r\n <div class=\"sn__progress\" aria-hidden=\"true\">\r\n <span [style.width.%]=\"progress()\"></span>\r\n </div>\r\n }\r\n</article>\r\n", styles: [":host{display:block;pointer-events:auto}.sn{--sn-accent: var(--solaris-color-info);overflow:hidden;color:var(--solaris-color-text);border-radius:var(--solaris-radius-lg);background:var(--solaris-color-surface);border:.1rem solid var(--solaris-color-border);width:min(42rem,100vw - var(--solaris-space-4) * 2)}.sn[data-kind=success]{--sn-accent: var(--solaris-color-success)}.sn[data-kind=warning]{--sn-accent: var(--solaris-color-warning)}.sn[data-kind=error]{--sn-accent: var(--solaris-color-error)}.sn[data-kind=info]{--sn-accent: var(--solaris-color-info)}.sn__header{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--solaris-space-3);padding:var(--solaris-space-4)}.sn__leading{display:flex;align-items:flex-start;gap:var(--solaris-space-3);min-width:0;flex:1}.sn__header[data-align=center],.sn__header[data-align=center] .sn__leading,.sn__header[data-align=center] .sn__controls{align-items:center}.sn[data-expanded=true] .sn__header{padding-bottom:0}.sn__icon{display:grid;flex:0 0 auto;block-size:3.2rem;inline-size:3.2rem;place-items:center;color:var(--sn-accent);border-radius:var(--solaris-radius-full)}.sn__icon .ph{line-height:1;font-size:var(--solaris-fs-24)}.sn__heading{flex:1;min-width:0}.sn__title{display:block;margin:0;font-size:var(--solaris-fs-16);letter-spacing:var(--solaris-ls-0);line-height:var(--solaris-lh-tight);font-family:var(--solaris-font-sans-primary),ui-sans-serif,system-ui}.sn__description,.sn__body-text,.sn__timer{margin:0;font-size:var(--solaris-fs-12);line-height:var(--solaris-lh-relaxed);color:var(--solaris-color-text-muted)}.sn__description--clamped{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;margin-top:var(--solaris-space-1)}.sn__controls{flex:0 0 auto;align-items:center;display:inline-flex;gap:var(--solaris-space-1)}.sn__icon-btn{border:0;display:grid;place-items:center;inline-size:2.5rem;block-size:2.5rem;background:transparent;cursor:pointer;color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-full);transition:background-color .14s ease,color .14s ease,transform .14s ease}.sn__icon-btn:hover{color:var(--solaris-color-text);background:var(--solaris-color-surface-2)}.sn__icon-btn:focus-visible{outline-offset:.2rem;outline:.2rem solid var(--solaris-color-primary)}.sn__icon-btn .ph{line-height:1;font-size:var(--solaris-fs-18)}.sn__body{padding:0 var(--solaris-space-4) var(--solaris-space-4) calc(var(--solaris-space-4) + 3.2rem + var(--solaris-space-3))}.sn__actions{display:flex;flex-wrap:wrap;gap:var(--solaris-space-2);margin-top:var(--solaris-space-4)}.sn__footer{background:var(--solaris-color-surface-2);border-top:.1rem solid var(--solaris-color-border);padding:var(--solaris-space-3) var(--solaris-space-4)}.sn__timer-link{margin:0;padding:0;border:0;font:inherit;cursor:pointer;font-weight:700;background:transparent;color:var(--solaris-color-text)}.sn__timer-link:focus-visible{outline-offset:.2rem;border-radius:var(--solaris-radius-xs);outline:.2rem solid var(--solaris-color-primary)}.sn__progress{block-size:.4rem;background:transparent}.sn__progress>span{display:block;block-size:100%;inline-size:100%;background:var(--sn-accent);transition:width .1s linear}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: SolarisButtonDirective, selector: "button[solaris-button], a[solaris-button]", inputs: ["size", "variant", "color", "textColor", "radius", "loading", "iconOnly", "disabled", "fullWidth", "badgeOverlay"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2196
2529
|
}
|
|
2197
2530
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisNotificationItemComponent, decorators: [{
|
|
2198
2531
|
type: Component,
|
|
2199
|
-
args: [{ selector: 'solaris-notification-item', standalone: true, imports: [NgClass,
|
|
2532
|
+
args: [{ selector: 'solaris-notification-item', standalone: true, imports: [NgClass, SolarisButtonDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<article class=\"sn\" [attr.data-kind]=\"item().kind\" [attr.data-mode]=\"mode()\" [attr.data-expanded]=\"item().expanded ? 'true' : 'false'\"\r\n [attr.data-paused]=\"paused() ? 'true' : 'false'\" [attr.aria-live]=\"mode() === 'toast' ? item().ariaLive : null\"\r\n [attr.role]=\"item().ariaLive === 'assertive' ? 'alert' : 'status'\" (mouseenter)=\"onMouseEnter()\" (mouseleave)=\"onMouseLeave()\">\r\n <div class=\"sn__header\" [attr.data-align]=\"isCompactHeader() ? 'center' : 'start'\">\r\n <div class=\"sn__leading\">\r\n <span class=\"sn__icon\" aria-hidden=\"true\">\r\n <i class=\"ph\" [ngClass]=\"iconClass()\"></i>\r\n </span>\r\n\r\n <div class=\"sn__heading\">\r\n <strong class=\"sn__title\">{{ item().title }}</strong>\r\n\r\n @if (!item().expanded && item().description) {\r\n <p class=\"sn__description sn__description--clamped\">\r\n {{ item().description }}\r\n </p>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div class=\"sn__controls\">\r\n @if (item().expandable && item().description) {\r\n <button type=\"button\" class=\"sn__icon-btn\" [attr.aria-expanded]=\"item().expanded\"\r\n [attr.aria-label]=\"item().expanded ? intl.collapse() : intl.expand()\" (click)=\"toggleExpanded()\">\r\n <i class=\"ph\" [ngClass]=\"item().expanded ? 'ph-caret-up' : 'ph-caret-down'\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n\r\n @if (item().closeable) {\r\n <button type=\"button\" class=\"sn__icon-btn\" [attr.aria-label]=\"intl.close()\" (click)=\"close()\">\r\n <i class=\"ph ph-x\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n\r\n @if (item().expanded && item().description) {\r\n <div class=\"sn__body\">\r\n <p class=\"sn__body-text\">{{ item().description }}</p>\r\n @if (item().actions.length) {\r\n <div class=\"sn__actions\">\r\n @for (action of item().actions; track action.id) {\r\n <button type=\"button\" solaris-button [variant]=\"action.variant ?? 'outline'\" [color]=\"action.color ?? 'surface'\"\r\n [size]=\"action.size ?? 'sm'\" [radius]=\"action.radius ?? 'md'\" [disabled]=\"action.disabled ?? false\"\r\n (click)=\"runAction(action)\">\r\n {{ resolveActionLabel(action) }}\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n @if (mode() === 'toast' && item().duration !== null) {\r\n <div class=\"sn__footer\">\r\n @if (!paused()) {\r\n <p class=\"sn__timer\">\r\n {{ intl.autoClose(secondsLeft()) }}\r\n <button type=\"button\" class=\"sn__timer-link\" (click)=\"toggleUserPause()\">\r\n {{ intl.stopTimer() }}\r\n </button>.\r\n </p>\r\n } @else {\r\n <p class=\"sn__timer\">\r\n {{ intl.paused() }}\r\n <button type=\"button\" class=\"sn__timer-link\" (click)=\"toggleUserPause()\">\r\n {{ intl.resumeTimer() }}\r\n </button>.\r\n </p>\r\n }\r\n </div>\r\n\r\n <div class=\"sn__progress\" aria-hidden=\"true\">\r\n <span [style.width.%]=\"progress()\"></span>\r\n </div>\r\n }\r\n</article>\r\n", styles: [":host{display:block;pointer-events:auto}.sn{--sn-accent: var(--solaris-color-info);overflow:hidden;color:var(--solaris-color-text);border-radius:var(--solaris-radius-lg);background:var(--solaris-color-surface);border:.1rem solid var(--solaris-color-border);width:min(42rem,100vw - var(--solaris-space-4) * 2)}.sn[data-kind=success]{--sn-accent: var(--solaris-color-success)}.sn[data-kind=warning]{--sn-accent: var(--solaris-color-warning)}.sn[data-kind=error]{--sn-accent: var(--solaris-color-error)}.sn[data-kind=info]{--sn-accent: var(--solaris-color-info)}.sn__header{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--solaris-space-3);padding:var(--solaris-space-4)}.sn__leading{display:flex;align-items:flex-start;gap:var(--solaris-space-3);min-width:0;flex:1}.sn__header[data-align=center],.sn__header[data-align=center] .sn__leading,.sn__header[data-align=center] .sn__controls{align-items:center}.sn[data-expanded=true] .sn__header{padding-bottom:0}.sn__icon{display:grid;flex:0 0 auto;block-size:3.2rem;inline-size:3.2rem;place-items:center;color:var(--sn-accent);border-radius:var(--solaris-radius-full)}.sn__icon .ph{line-height:1;font-size:var(--solaris-fs-24)}.sn__heading{flex:1;min-width:0}.sn__title{display:block;margin:0;font-size:var(--solaris-fs-16);letter-spacing:var(--solaris-ls-0);line-height:var(--solaris-lh-tight);font-family:var(--solaris-font-sans-primary),ui-sans-serif,system-ui}.sn__description,.sn__body-text,.sn__timer{margin:0;font-size:var(--solaris-fs-12);line-height:var(--solaris-lh-relaxed);color:var(--solaris-color-text-muted)}.sn__description--clamped{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;margin-top:var(--solaris-space-1)}.sn__controls{flex:0 0 auto;align-items:center;display:inline-flex;gap:var(--solaris-space-1)}.sn__icon-btn{border:0;display:grid;place-items:center;inline-size:2.5rem;block-size:2.5rem;background:transparent;cursor:pointer;color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-full);transition:background-color .14s ease,color .14s ease,transform .14s ease}.sn__icon-btn:hover{color:var(--solaris-color-text);background:var(--solaris-color-surface-2)}.sn__icon-btn:focus-visible{outline-offset:.2rem;outline:.2rem solid var(--solaris-color-primary)}.sn__icon-btn .ph{line-height:1;font-size:var(--solaris-fs-18)}.sn__body{padding:0 var(--solaris-space-4) var(--solaris-space-4) calc(var(--solaris-space-4) + 3.2rem + var(--solaris-space-3))}.sn__actions{display:flex;flex-wrap:wrap;gap:var(--solaris-space-2);margin-top:var(--solaris-space-4)}.sn__footer{background:var(--solaris-color-surface-2);border-top:.1rem solid var(--solaris-color-border);padding:var(--solaris-space-3) var(--solaris-space-4)}.sn__timer-link{margin:0;padding:0;border:0;font:inherit;cursor:pointer;font-weight:700;background:transparent;color:var(--solaris-color-text)}.sn__timer-link:focus-visible{outline-offset:.2rem;border-radius:var(--solaris-radius-xs);outline:.2rem solid var(--solaris-color-primary)}.sn__progress{block-size:.4rem;background:transparent}.sn__progress>span{display:block;block-size:100%;inline-size:100%;background:var(--sn-accent);transition:width .1s linear}\n"] }]
|
|
2200
2533
|
}], propDecorators: { item: [{ type: i0.Input, args: [{ isSignal: true, alias: "item", required: true }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }] } });
|
|
2201
2534
|
|
|
2202
2535
|
class SolarisNotificationCenterComponent {
|
|
@@ -2208,11 +2541,11 @@ class SolarisNotificationCenterComponent {
|
|
|
2208
2541
|
}
|
|
2209
2542
|
}
|
|
2210
2543
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisNotificationCenterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2211
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisNotificationCenterComponent, isStandalone: true, selector: "solaris-notification-center", host: { listeners: { "document:keydown.escape": "onEscape()" } }, ngImport: i0, template: "@if (notificationService.centerOpen()) {\r\n <div class=\"snc__backdrop\" (click)=\"notificationService.closeCenter()\"></div>\r\n\r\n <aside class=\"snc\" role=\"dialog\" aria-modal=\"true\" [attr.aria-label]=\"intl.centerTitle()\">\r\n <header class=\"snc__header\">\r\n <div>\r\n <strong class=\"snc__title\">{{ intl.centerTitle() }}</strong>\r\n </div>\r\n\r\n <div class=\"snc__controls\">\r\n <button type=\"button\" solaris-button variant=\"outline\" color=\"surface\" size=\"sm\" radius=\"md\"\r\n (click)=\"notificationService.clearHistory()\">\r\n {{ intl.clearHistory() }}\r\n </button>\r\n\r\n <button type=\"button\" class=\"snc__icon-btn\" [attr.aria-label]=\"intl.close()\" (click)=\"notificationService.closeCenter()\">\r\n <i class=\"ph ph-x\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n </header>\r\n\r\n <div class=\"snc__list\">\r\n @for (item of notificationService.centerItems(); track item.id) {\r\n <solaris-notification-item [item]=\"item\" mode=\"center\"/>\r\n } @empty {\r\n <div class=\"snc__empty\">\r\n {{ intl.emptyCenter() }}\r\n </div>\r\n }\r\n </div>\r\n </aside>\r\n}\r\n", styles: [".snc__backdrop{inset:0;position:fixed;pointer-events:auto;-webkit-backdrop-filter:blur(.2rem);backdrop-filter:blur(.2rem);background:#00000047;z-index:var(--solaris-z-overlay)}.snc{display:flex;position:fixed;overflow:hidden;pointer-events:auto;flex-direction:column;top:var(--solaris-space-4);z-index:var(--solaris-z-max);right:var(--solaris-space-4);bottom:var(--solaris-space-4);box-shadow:var(--solaris-shadow-lg);border-radius:var(--solaris-radius-lg);background:var(--solaris-color-surface);border:.1rem solid var(--solaris-color-border);width:min(46rem,100vw - var(--solaris-space-4) * 2)}.snc__header{display:flex;align-items:center;gap:var(--solaris-space-3);justify-content:space-between;padding:var(--solaris-space-4);border-bottom:.1rem solid var(--solaris-color-border)}.snc__title{font-size:var(--solaris-h-6);line-height:var(--solaris-lh-tight)}.snc__controls{display:flex;align-items:center;gap:var(--solaris-space-2)}.snc__icon-btn{border:0;display:grid;cursor:pointer;block-size:4rem;inline-size:4rem;place-items:center;background:transparent;color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-full)}.snc__icon-btn:hover{color:var(--solaris-color-text);background:var(--solaris-color-surface-2)}.snc__list{flex:1;display:flex;overflow:auto;flex-direction:column;gap:var(--solaris-space-3);padding:var(--solaris-space-4);background:var(--solaris-color-bg)}.snc__empty{display:grid;min-height:16rem;text-align:center;place-items:center;color:var(--solaris-color-text-muted)}\n"], dependencies: [{ kind: "directive", type:
|
|
2544
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisNotificationCenterComponent, isStandalone: true, selector: "solaris-notification-center", host: { listeners: { "document:keydown.escape": "onEscape()" } }, ngImport: i0, template: "@if (notificationService.centerOpen()) {\r\n <div class=\"snc__backdrop\" (click)=\"notificationService.closeCenter()\"></div>\r\n\r\n <aside class=\"snc\" role=\"dialog\" aria-modal=\"true\" [attr.aria-label]=\"intl.centerTitle()\">\r\n <header class=\"snc__header\">\r\n <div>\r\n <strong class=\"snc__title\">{{ intl.centerTitle() }}</strong>\r\n </div>\r\n\r\n <div class=\"snc__controls\">\r\n <button type=\"button\" solaris-button variant=\"outline\" color=\"surface\" size=\"sm\" radius=\"md\"\r\n (click)=\"notificationService.clearHistory()\">\r\n {{ intl.clearHistory() }}\r\n </button>\r\n\r\n <button type=\"button\" class=\"snc__icon-btn\" [attr.aria-label]=\"intl.close()\" (click)=\"notificationService.closeCenter()\">\r\n <i class=\"ph ph-x\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n </header>\r\n\r\n <div class=\"snc__list\">\r\n @for (item of notificationService.centerItems(); track item.id) {\r\n <solaris-notification-item [item]=\"item\" mode=\"center\"/>\r\n } @empty {\r\n <div class=\"snc__empty\">\r\n {{ intl.emptyCenter() }}\r\n </div>\r\n }\r\n </div>\r\n </aside>\r\n}\r\n", styles: [".snc__backdrop{inset:0;position:fixed;pointer-events:auto;-webkit-backdrop-filter:blur(.2rem);backdrop-filter:blur(.2rem);background:#00000047;z-index:var(--solaris-z-overlay)}.snc{display:flex;position:fixed;overflow:hidden;pointer-events:auto;flex-direction:column;top:var(--solaris-space-4);z-index:var(--solaris-z-max);right:var(--solaris-space-4);bottom:var(--solaris-space-4);box-shadow:var(--solaris-shadow-lg);border-radius:var(--solaris-radius-lg);background:var(--solaris-color-surface);border:.1rem solid var(--solaris-color-border);width:min(46rem,100vw - var(--solaris-space-4) * 2)}.snc__header{display:flex;align-items:center;gap:var(--solaris-space-3);justify-content:space-between;padding:var(--solaris-space-4);border-bottom:.1rem solid var(--solaris-color-border)}.snc__title{font-size:var(--solaris-h-6);line-height:var(--solaris-lh-tight)}.snc__controls{display:flex;align-items:center;gap:var(--solaris-space-2)}.snc__icon-btn{border:0;display:grid;cursor:pointer;block-size:4rem;inline-size:4rem;place-items:center;background:transparent;color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-full)}.snc__icon-btn:hover{color:var(--solaris-color-text);background:var(--solaris-color-surface-2)}.snc__list{flex:1;display:flex;overflow:auto;flex-direction:column;gap:var(--solaris-space-3);padding:var(--solaris-space-4);background:var(--solaris-color-bg)}.snc__empty{display:grid;min-height:16rem;text-align:center;place-items:center;color:var(--solaris-color-text-muted)}\n"], dependencies: [{ kind: "directive", type: SolarisButtonDirective, selector: "button[solaris-button], a[solaris-button]", inputs: ["size", "variant", "color", "textColor", "radius", "loading", "iconOnly", "disabled", "fullWidth", "badgeOverlay"] }, { kind: "component", type: SolarisNotificationItemComponent, selector: "solaris-notification-item", inputs: ["item", "mode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2212
2545
|
}
|
|
2213
2546
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisNotificationCenterComponent, decorators: [{
|
|
2214
2547
|
type: Component,
|
|
2215
|
-
args: [{ selector: 'solaris-notification-center', standalone: true, imports: [
|
|
2548
|
+
args: [{ selector: 'solaris-notification-center', standalone: true, imports: [SolarisButtonDirective, SolarisNotificationItemComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (notificationService.centerOpen()) {\r\n <div class=\"snc__backdrop\" (click)=\"notificationService.closeCenter()\"></div>\r\n\r\n <aside class=\"snc\" role=\"dialog\" aria-modal=\"true\" [attr.aria-label]=\"intl.centerTitle()\">\r\n <header class=\"snc__header\">\r\n <div>\r\n <strong class=\"snc__title\">{{ intl.centerTitle() }}</strong>\r\n </div>\r\n\r\n <div class=\"snc__controls\">\r\n <button type=\"button\" solaris-button variant=\"outline\" color=\"surface\" size=\"sm\" radius=\"md\"\r\n (click)=\"notificationService.clearHistory()\">\r\n {{ intl.clearHistory() }}\r\n </button>\r\n\r\n <button type=\"button\" class=\"snc__icon-btn\" [attr.aria-label]=\"intl.close()\" (click)=\"notificationService.closeCenter()\">\r\n <i class=\"ph ph-x\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n </header>\r\n\r\n <div class=\"snc__list\">\r\n @for (item of notificationService.centerItems(); track item.id) {\r\n <solaris-notification-item [item]=\"item\" mode=\"center\"/>\r\n } @empty {\r\n <div class=\"snc__empty\">\r\n {{ intl.emptyCenter() }}\r\n </div>\r\n }\r\n </div>\r\n </aside>\r\n}\r\n", styles: [".snc__backdrop{inset:0;position:fixed;pointer-events:auto;-webkit-backdrop-filter:blur(.2rem);backdrop-filter:blur(.2rem);background:#00000047;z-index:var(--solaris-z-overlay)}.snc{display:flex;position:fixed;overflow:hidden;pointer-events:auto;flex-direction:column;top:var(--solaris-space-4);z-index:var(--solaris-z-max);right:var(--solaris-space-4);bottom:var(--solaris-space-4);box-shadow:var(--solaris-shadow-lg);border-radius:var(--solaris-radius-lg);background:var(--solaris-color-surface);border:.1rem solid var(--solaris-color-border);width:min(46rem,100vw - var(--solaris-space-4) * 2)}.snc__header{display:flex;align-items:center;gap:var(--solaris-space-3);justify-content:space-between;padding:var(--solaris-space-4);border-bottom:.1rem solid var(--solaris-color-border)}.snc__title{font-size:var(--solaris-h-6);line-height:var(--solaris-lh-tight)}.snc__controls{display:flex;align-items:center;gap:var(--solaris-space-2)}.snc__icon-btn{border:0;display:grid;cursor:pointer;block-size:4rem;inline-size:4rem;place-items:center;background:transparent;color:var(--solaris-color-text-muted);border-radius:var(--solaris-radius-full)}.snc__icon-btn:hover{color:var(--solaris-color-text);background:var(--solaris-color-surface-2)}.snc__list{flex:1;display:flex;overflow:auto;flex-direction:column;gap:var(--solaris-space-3);padding:var(--solaris-space-4);background:var(--solaris-color-bg)}.snc__empty{display:grid;min-height:16rem;text-align:center;place-items:center;color:var(--solaris-color-text-muted)}\n"] }]
|
|
2216
2549
|
}], propDecorators: { onEscape: [{
|
|
2217
2550
|
type: HostListener,
|
|
2218
2551
|
args: ['document:keydown.escape']
|
|
@@ -2233,7 +2566,161 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
2233
2566
|
args: [{ selector: 'solaris-notification-host', standalone: true, imports: [SolarisNotificationItemComponent, SolarisNotificationCenterComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@for (position of positions; track position) {\r\n <section class=\"snh__stack\" [attr.data-position]=\"position\">\r\n @for (item of visibleByPosition(position); track item.id) {\r\n <solaris-notification-item [item]=\"item\" mode=\"toast\"/>\r\n }\r\n </section>\r\n}\r\n\r\n@if (withCenter()) { <solaris-notification-center/> }\r\n", styles: [":host{inset:0;position:fixed;pointer-events:none;z-index:var(--solaris-z-toast)}.snh__stack{display:flex;position:fixed;flex-direction:column;gap:var(--solaris-space-3);padding:var(--solaris-space-4);max-width:calc(100vw - var(--solaris-space-4) * 2)}.snh__stack[data-position=top-right]{top:0;right:0;align-items:flex-end}.snh__stack[data-position=top-left]{top:0;left:0;align-items:flex-start}.snh__stack[data-position=top-center]{top:0;left:50%;align-items:center;transform:translate(-50%)}.snh__stack[data-position=bottom-right]{right:0;bottom:0;align-items:flex-end}.snh__stack[data-position=bottom-left]{left:0;bottom:0;align-items:flex-start}.snh__stack[data-position=bottom-center]{left:50%;bottom:0;align-items:center;transform:translate(-50%)}\n"] }]
|
|
2234
2567
|
}], propDecorators: { withCenter: [{ type: i0.Input, args: [{ isSignal: true, alias: "withCenter", required: false }] }] } });
|
|
2235
2568
|
|
|
2236
|
-
|
|
2569
|
+
class SolarisTooltipPanel {
|
|
2570
|
+
text = input('', ...(ngDevMode ? [{ debugName: "text" }] : []));
|
|
2571
|
+
prefixIcon = input('', ...(ngDevMode ? [{ debugName: "prefixIcon" }] : []));
|
|
2572
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
2573
|
+
position = input('top', ...(ngDevMode ? [{ debugName: "position" }] : []));
|
|
2574
|
+
variant = input('inverse', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
2575
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisTooltipPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2576
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisTooltipPanel, isStandalone: true, selector: "solaris-tooltip-panel", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, prefixIcon: { classPropertyName: "prefixIcon", publicName: "prefixIcon", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"solaris-tooltip\" [attr.data-position]=\"position()\" [attr.data-variant]=\"variant()\"\r\n [attr.data-size]=\"size()\" role=\"tooltip\">\r\n @if (prefixIcon()) {\r\n <span class=\"solaris-tooltip__prefix\" aria-hidden=\"true\">\r\n <i [class]=\"prefixIcon()\"></i>\r\n </span>\r\n }\r\n\r\n <span class=\"solaris-tooltip__content\">\r\n {{ text() }}\r\n </span>\r\n\r\n <span class=\"solaris-tooltip__arrow\" aria-hidden=\"true\"></span>\r\n</div>\r\n", styles: [":host{display:block;isolation:isolate;pointer-events:none;inline-size:max-content;max-inline-size:max-content}.solaris-tooltip{--solaris-tooltip-padding-x: 1rem;--solaris-tooltip-max-width: 28rem;--solaris-tooltip-arrow-size: .8rem;--solaris-tooltip-padding-y: .75rem;--solaris-tooltip-gap: var(--solaris-space-2);--solaris-tooltip-fg: var(--solaris-color-text);--solaris-tooltip-font-size: var(--solaris-fs-12);--solaris-tooltip-shadow: var(--solaris-shadow-md);--solaris-tooltip-radius: var(--solaris-radius-md);--solaris-tooltip-bg: var(--solaris-color-surface);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-color-border) 75%, transparent);position:relative;display:inline-flex;align-items:center;gap:var(--solaris-tooltip-gap);max-inline-size:var(--solaris-tooltip-max-width);padding:var(--solaris-tooltip-padding-y) var(--solaris-tooltip-padding-x);color:var(--solaris-tooltip-fg);background:var(--solaris-tooltip-bg);box-shadow:var(--solaris-tooltip-shadow);border-radius:var(--solaris-tooltip-radius);border:1px solid var(--solaris-tooltip-border);font-weight:500;text-align:start;white-space:normal;line-height:var(--solaris-lh-normal);font-size:var(--solaris-tooltip-font-size);pointer-events:none;animation:solaris-tooltip-in .12s ease}.solaris-tooltip[data-size=sm]{--solaris-tooltip-max-width: 22rem;--solaris-tooltip-padding-y: .55rem;--solaris-tooltip-padding-x: .8rem;--solaris-tooltip-font-size: var(--solaris-fs-11);--solaris-tooltip-radius: var(--solaris-radius-sm)}.solaris-tooltip[data-size=md]{--solaris-tooltip-max-width: 28rem;--solaris-tooltip-padding-y: .75rem;--solaris-tooltip-padding-x: 1rem;--solaris-tooltip-font-size: var(--solaris-fs-12)}.solaris-tooltip[data-variant=default]{--solaris-tooltip-bg: var(--solaris-color-surface);--solaris-tooltip-fg: var(--solaris-color-text);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-color-border) 85%, transparent)}.solaris-tooltip[data-variant=inverse]{--solaris-tooltip-fg: var(--solaris-color-surface);--solaris-tooltip-bg: color-mix(in srgb, var(--solaris-color-text) 92%, black);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-tooltip-bg) 82%, white)}.solaris-tooltip[data-variant=primary]{--solaris-tooltip-fg: white;--solaris-tooltip-bg: var(--solaris-color-primary);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-color-primary) 75%, white)}.solaris-tooltip__prefix{opacity:.9;flex:0 0 auto;block-size:1.6rem;inline-size:1.6rem;place-items:center;color:currentColor;display:inline-grid}.solaris-tooltip__prefix i{display:block;line-height:1;font-size:var(--solaris-fs-16)}.solaris-tooltip__content{min-inline-size:0;overflow-wrap:anywhere}.solaris-tooltip__arrow{position:absolute;inline-size:var(--solaris-tooltip-arrow-size);block-size:var(--solaris-tooltip-arrow-size);background:var(--solaris-tooltip-bg);border:1px solid var(--solaris-tooltip-border);transform:rotate(45deg);z-index:0}.solaris-tooltip__content,.solaris-tooltip__prefix{position:relative;z-index:1}.solaris-tooltip[data-position=top] .solaris-tooltip__arrow{inset-inline-start:50%;border-block-start-color:transparent;border-inline-start-color:transparent;transform:translate(-50%) rotate(45deg);inset-block-end:calc(var(--solaris-tooltip-arrow-size) / -2)}.solaris-tooltip[data-position=bottom] .solaris-tooltip__arrow{inset-inline-start:50%;border-block-end-color:transparent;border-inline-end-color:transparent;transform:translate(-50%) rotate(45deg);inset-block-start:calc(var(--solaris-tooltip-arrow-size) / -2)}.solaris-tooltip[data-position=right] .solaris-tooltip__arrow{inset-block-start:50%;border-inline-end-color:transparent;border-block-start-color:transparent;transform:translateY(-50%) rotate(45deg);inset-inline-start:calc(var(--solaris-tooltip-arrow-size) / -2)}.solaris-tooltip[data-position=left] .solaris-tooltip__arrow{inset-block-start:50%;border-block-end-color:transparent;border-inline-start-color:transparent;transform:translateY(-50%) rotate(45deg);inset-inline-end:calc(var(--solaris-tooltip-arrow-size) / -2)}@keyframes solaris-tooltip-in{0%{opacity:0;filter:blur(.1rem);transform:scale(.98)}to{opacity:1;filter:blur(0);transform:scale(1)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2577
|
+
}
|
|
2578
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisTooltipPanel, decorators: [{
|
|
2579
|
+
type: Component,
|
|
2580
|
+
args: [{ selector: 'solaris-tooltip-panel', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"solaris-tooltip\" [attr.data-position]=\"position()\" [attr.data-variant]=\"variant()\"\r\n [attr.data-size]=\"size()\" role=\"tooltip\">\r\n @if (prefixIcon()) {\r\n <span class=\"solaris-tooltip__prefix\" aria-hidden=\"true\">\r\n <i [class]=\"prefixIcon()\"></i>\r\n </span>\r\n }\r\n\r\n <span class=\"solaris-tooltip__content\">\r\n {{ text() }}\r\n </span>\r\n\r\n <span class=\"solaris-tooltip__arrow\" aria-hidden=\"true\"></span>\r\n</div>\r\n", styles: [":host{display:block;isolation:isolate;pointer-events:none;inline-size:max-content;max-inline-size:max-content}.solaris-tooltip{--solaris-tooltip-padding-x: 1rem;--solaris-tooltip-max-width: 28rem;--solaris-tooltip-arrow-size: .8rem;--solaris-tooltip-padding-y: .75rem;--solaris-tooltip-gap: var(--solaris-space-2);--solaris-tooltip-fg: var(--solaris-color-text);--solaris-tooltip-font-size: var(--solaris-fs-12);--solaris-tooltip-shadow: var(--solaris-shadow-md);--solaris-tooltip-radius: var(--solaris-radius-md);--solaris-tooltip-bg: var(--solaris-color-surface);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-color-border) 75%, transparent);position:relative;display:inline-flex;align-items:center;gap:var(--solaris-tooltip-gap);max-inline-size:var(--solaris-tooltip-max-width);padding:var(--solaris-tooltip-padding-y) var(--solaris-tooltip-padding-x);color:var(--solaris-tooltip-fg);background:var(--solaris-tooltip-bg);box-shadow:var(--solaris-tooltip-shadow);border-radius:var(--solaris-tooltip-radius);border:1px solid var(--solaris-tooltip-border);font-weight:500;text-align:start;white-space:normal;line-height:var(--solaris-lh-normal);font-size:var(--solaris-tooltip-font-size);pointer-events:none;animation:solaris-tooltip-in .12s ease}.solaris-tooltip[data-size=sm]{--solaris-tooltip-max-width: 22rem;--solaris-tooltip-padding-y: .55rem;--solaris-tooltip-padding-x: .8rem;--solaris-tooltip-font-size: var(--solaris-fs-11);--solaris-tooltip-radius: var(--solaris-radius-sm)}.solaris-tooltip[data-size=md]{--solaris-tooltip-max-width: 28rem;--solaris-tooltip-padding-y: .75rem;--solaris-tooltip-padding-x: 1rem;--solaris-tooltip-font-size: var(--solaris-fs-12)}.solaris-tooltip[data-variant=default]{--solaris-tooltip-bg: var(--solaris-color-surface);--solaris-tooltip-fg: var(--solaris-color-text);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-color-border) 85%, transparent)}.solaris-tooltip[data-variant=inverse]{--solaris-tooltip-fg: var(--solaris-color-surface);--solaris-tooltip-bg: color-mix(in srgb, var(--solaris-color-text) 92%, black);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-tooltip-bg) 82%, white)}.solaris-tooltip[data-variant=primary]{--solaris-tooltip-fg: white;--solaris-tooltip-bg: var(--solaris-color-primary);--solaris-tooltip-border: color-mix(in srgb, var(--solaris-color-primary) 75%, white)}.solaris-tooltip__prefix{opacity:.9;flex:0 0 auto;block-size:1.6rem;inline-size:1.6rem;place-items:center;color:currentColor;display:inline-grid}.solaris-tooltip__prefix i{display:block;line-height:1;font-size:var(--solaris-fs-16)}.solaris-tooltip__content{min-inline-size:0;overflow-wrap:anywhere}.solaris-tooltip__arrow{position:absolute;inline-size:var(--solaris-tooltip-arrow-size);block-size:var(--solaris-tooltip-arrow-size);background:var(--solaris-tooltip-bg);border:1px solid var(--solaris-tooltip-border);transform:rotate(45deg);z-index:0}.solaris-tooltip__content,.solaris-tooltip__prefix{position:relative;z-index:1}.solaris-tooltip[data-position=top] .solaris-tooltip__arrow{inset-inline-start:50%;border-block-start-color:transparent;border-inline-start-color:transparent;transform:translate(-50%) rotate(45deg);inset-block-end:calc(var(--solaris-tooltip-arrow-size) / -2)}.solaris-tooltip[data-position=bottom] .solaris-tooltip__arrow{inset-inline-start:50%;border-block-end-color:transparent;border-inline-end-color:transparent;transform:translate(-50%) rotate(45deg);inset-block-start:calc(var(--solaris-tooltip-arrow-size) / -2)}.solaris-tooltip[data-position=right] .solaris-tooltip__arrow{inset-block-start:50%;border-inline-end-color:transparent;border-block-start-color:transparent;transform:translateY(-50%) rotate(45deg);inset-inline-start:calc(var(--solaris-tooltip-arrow-size) / -2)}.solaris-tooltip[data-position=left] .solaris-tooltip__arrow{inset-block-start:50%;border-block-end-color:transparent;border-inline-start-color:transparent;transform:translateY(-50%) rotate(45deg);inset-inline-end:calc(var(--solaris-tooltip-arrow-size) / -2)}@keyframes solaris-tooltip-in{0%{opacity:0;filter:blur(.1rem);transform:scale(.98)}to{opacity:1;filter:blur(0);transform:scale(1)}}\n"] }]
|
|
2581
|
+
}], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], prefixIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefixIcon", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
|
|
2582
|
+
|
|
2583
|
+
class SolarisTooltipDirective {
|
|
2584
|
+
elementRef = inject(ElementRef);
|
|
2585
|
+
floatingOverlay = inject(SolarisFloatingOverlayService);
|
|
2586
|
+
renderer = inject(Renderer2);
|
|
2587
|
+
text = input('', { ...(ngDevMode ? { debugName: "text" } : {}), alias: 'solaris-tooltip' });
|
|
2588
|
+
tooltipPosition = input('top', { ...(ngDevMode ? { debugName: "tooltipPosition" } : {}), alias: 'tooltip-position' });
|
|
2589
|
+
tooltipVariant = input('inverse', { ...(ngDevMode ? { debugName: "tooltipVariant" } : {}), alias: 'tooltip-variant' });
|
|
2590
|
+
tooltipSize = input('md', { ...(ngDevMode ? { debugName: "tooltipSize" } : {}), alias: 'tooltip-size' });
|
|
2591
|
+
tooltipPrefixIcon = input('', { ...(ngDevMode ? { debugName: "tooltipPrefixIcon" } : {}), alias: 'tooltip-prefix-icon' });
|
|
2592
|
+
tooltipDisabled = input(false, { ...(ngDevMode ? { debugName: "tooltipDisabled" } : {}), alias: 'tooltip-disabled' });
|
|
2593
|
+
tooltipShowDelay = input(300, { ...(ngDevMode ? { debugName: "tooltipShowDelay" } : {}), alias: 'tooltip-show-delay' });
|
|
2594
|
+
tooltipHideDelay = input(80, { ...(ngDevMode ? { debugName: "tooltipHideDelay" } : {}), alias: 'tooltip-hide-delay' });
|
|
2595
|
+
tooltipOffset = input(8, { ...(ngDevMode ? { debugName: "tooltipOffset" } : {}), alias: 'tooltip-offset' });
|
|
2596
|
+
tooltipAutoFlip = input(true, { ...(ngDevMode ? { debugName: "tooltipAutoFlip" } : {}), alias: 'tooltip-auto-flip' });
|
|
2597
|
+
tooltipAutoShift = input(true, { ...(ngDevMode ? { debugName: "tooltipAutoShift" } : {}), alias: 'tooltip-auto-shift' });
|
|
2598
|
+
tooltipViewportPadding = input(8, { ...(ngDevMode ? { debugName: "tooltipViewportPadding" } : {}), alias: 'tooltip-viewport-padding' });
|
|
2599
|
+
tooltipKey = input('', { ...(ngDevMode ? { debugName: "tooltipKey" } : {}), alias: 'tooltip-key' });
|
|
2600
|
+
tooltipParams = input(undefined, { ...(ngDevMode ? { debugName: "tooltipParams" } : {}), alias: 'tooltip-params' });
|
|
2601
|
+
overlayRef;
|
|
2602
|
+
showTimer = 0;
|
|
2603
|
+
hideTimer = 0;
|
|
2604
|
+
raf = 0;
|
|
2605
|
+
cleanups = [];
|
|
2606
|
+
resolvedText = computed(() => {
|
|
2607
|
+
const key = this.tooltipKey().trim();
|
|
2608
|
+
if (key) {
|
|
2609
|
+
return key;
|
|
2610
|
+
}
|
|
2611
|
+
return this.text().trim();
|
|
2612
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedText" }] : []));
|
|
2613
|
+
constructor() {
|
|
2614
|
+
const host = this.elementRef.nativeElement;
|
|
2615
|
+
this.cleanups.push(this.renderer.listen(host, 'mouseenter', () => this.scheduleShow()), this.renderer.listen(host, 'mouseleave', () => this.scheduleHide()), this.renderer.listen(host, 'focusin', () => this.scheduleShow()), this.renderer.listen(host, 'focusout', () => this.scheduleHide()), this.renderer.listen(host, 'keydown', (event) => {
|
|
2616
|
+
if (event.key === 'Escape') {
|
|
2617
|
+
this.hide();
|
|
2618
|
+
}
|
|
2619
|
+
}), this.renderer.listen(globalThis, 'resize', () => this.scheduleReposition()), this.renderer.listen(globalThis, 'scroll', () => this.scheduleReposition()));
|
|
2620
|
+
effect(() => {
|
|
2621
|
+
if (!this.overlayRef)
|
|
2622
|
+
return;
|
|
2623
|
+
this.applyPanelInputs();
|
|
2624
|
+
this.scheduleReposition();
|
|
2625
|
+
});
|
|
2626
|
+
}
|
|
2627
|
+
scheduleShow() {
|
|
2628
|
+
if (this.tooltipDisabled())
|
|
2629
|
+
return;
|
|
2630
|
+
if (!this.resolvedText())
|
|
2631
|
+
return;
|
|
2632
|
+
globalThis.clearTimeout(this.hideTimer);
|
|
2633
|
+
globalThis.clearTimeout(this.showTimer);
|
|
2634
|
+
this.showTimer = globalThis.setTimeout(() => {
|
|
2635
|
+
this.show();
|
|
2636
|
+
}, this.tooltipShowDelay());
|
|
2637
|
+
}
|
|
2638
|
+
scheduleHide() {
|
|
2639
|
+
globalThis.clearTimeout(this.showTimer);
|
|
2640
|
+
globalThis.clearTimeout(this.hideTimer);
|
|
2641
|
+
this.hideTimer = globalThis.setTimeout(() => {
|
|
2642
|
+
this.hide();
|
|
2643
|
+
}, this.tooltipHideDelay());
|
|
2644
|
+
}
|
|
2645
|
+
show() {
|
|
2646
|
+
if (this.overlayRef || this.tooltipDisabled())
|
|
2647
|
+
return;
|
|
2648
|
+
if (!this.resolvedText())
|
|
2649
|
+
return;
|
|
2650
|
+
this.overlayRef = this.floatingOverlay.create(SolarisTooltipPanel, {
|
|
2651
|
+
idPrefix: 'solaris-tooltip',
|
|
2652
|
+
zIndex: 'var(--solaris-z-tooltip, 1200)',
|
|
2653
|
+
pointerEvents: 'none',
|
|
2654
|
+
});
|
|
2655
|
+
this.applyPanelInputs();
|
|
2656
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'aria-describedby', this.overlayRef.id);
|
|
2657
|
+
requestAnimationFrame(() => this.reposition());
|
|
2658
|
+
}
|
|
2659
|
+
hide() {
|
|
2660
|
+
this.floatingOverlay.clearFloatingTimers(this.showTimer, this.hideTimer, this.raf);
|
|
2661
|
+
this.raf = 0;
|
|
2662
|
+
this.renderer.removeAttribute(this.elementRef.nativeElement, 'aria-describedby');
|
|
2663
|
+
this.floatingOverlay.destroyOverlay(this.overlayRef);
|
|
2664
|
+
this.overlayRef = undefined;
|
|
2665
|
+
}
|
|
2666
|
+
applyPanelInputs() {
|
|
2667
|
+
if (!this.overlayRef)
|
|
2668
|
+
return;
|
|
2669
|
+
const panel = this.overlayRef.componentRef;
|
|
2670
|
+
panel.setInput('text', this.resolvedText());
|
|
2671
|
+
panel.setInput('position', this.tooltipPosition());
|
|
2672
|
+
panel.setInput('variant', this.tooltipVariant());
|
|
2673
|
+
panel.setInput('size', this.tooltipSize());
|
|
2674
|
+
panel.setInput('prefixIcon', this.tooltipPrefixIcon());
|
|
2675
|
+
panel.changeDetectorRef.detectChanges();
|
|
2676
|
+
}
|
|
2677
|
+
scheduleReposition() {
|
|
2678
|
+
if (!this.overlayRef)
|
|
2679
|
+
return;
|
|
2680
|
+
if (this.raf)
|
|
2681
|
+
return;
|
|
2682
|
+
this.raf = requestAnimationFrame(() => {
|
|
2683
|
+
this.raf = 0;
|
|
2684
|
+
this.reposition();
|
|
2685
|
+
});
|
|
2686
|
+
}
|
|
2687
|
+
reposition() {
|
|
2688
|
+
if (!this.overlayRef)
|
|
2689
|
+
return;
|
|
2690
|
+
this.floatingOverlay.reposition({
|
|
2691
|
+
anchor: this.elementRef.nativeElement,
|
|
2692
|
+
overlayRef: this.overlayRef,
|
|
2693
|
+
options: {
|
|
2694
|
+
position: this.tooltipPosition(),
|
|
2695
|
+
offset: this.tooltipOffset(),
|
|
2696
|
+
viewportPadding: this.tooltipViewportPadding(),
|
|
2697
|
+
autoFlip: this.tooltipAutoFlip(),
|
|
2698
|
+
autoShift: this.tooltipAutoShift(),
|
|
2699
|
+
},
|
|
2700
|
+
setAppliedPosition: (position) => {
|
|
2701
|
+
this.overlayRef?.componentRef.setInput('position', position);
|
|
2702
|
+
this.overlayRef?.componentRef.changeDetectorRef.detectChanges();
|
|
2703
|
+
},
|
|
2704
|
+
});
|
|
2705
|
+
}
|
|
2706
|
+
ngOnDestroy() {
|
|
2707
|
+
this.hide();
|
|
2708
|
+
for (const cleanup of this.cleanups) {
|
|
2709
|
+
cleanup();
|
|
2710
|
+
}
|
|
2711
|
+
}
|
|
2712
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2713
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: SolarisTooltipDirective, isStandalone: true, selector: "[solaris-tooltip]", inputs: { text: { classPropertyName: "text", publicName: "solaris-tooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipPosition: { classPropertyName: "tooltipPosition", publicName: "tooltip-position", isSignal: true, isRequired: false, transformFunction: null }, tooltipVariant: { classPropertyName: "tooltipVariant", publicName: "tooltip-variant", isSignal: true, isRequired: false, transformFunction: null }, tooltipSize: { classPropertyName: "tooltipSize", publicName: "tooltip-size", isSignal: true, isRequired: false, transformFunction: null }, tooltipPrefixIcon: { classPropertyName: "tooltipPrefixIcon", publicName: "tooltip-prefix-icon", isSignal: true, isRequired: false, transformFunction: null }, tooltipDisabled: { classPropertyName: "tooltipDisabled", publicName: "tooltip-disabled", isSignal: true, isRequired: false, transformFunction: null }, tooltipShowDelay: { classPropertyName: "tooltipShowDelay", publicName: "tooltip-show-delay", isSignal: true, isRequired: false, transformFunction: null }, tooltipHideDelay: { classPropertyName: "tooltipHideDelay", publicName: "tooltip-hide-delay", isSignal: true, isRequired: false, transformFunction: null }, tooltipOffset: { classPropertyName: "tooltipOffset", publicName: "tooltip-offset", isSignal: true, isRequired: false, transformFunction: null }, tooltipAutoFlip: { classPropertyName: "tooltipAutoFlip", publicName: "tooltip-auto-flip", isSignal: true, isRequired: false, transformFunction: null }, tooltipAutoShift: { classPropertyName: "tooltipAutoShift", publicName: "tooltip-auto-shift", isSignal: true, isRequired: false, transformFunction: null }, tooltipViewportPadding: { classPropertyName: "tooltipViewportPadding", publicName: "tooltip-viewport-padding", isSignal: true, isRequired: false, transformFunction: null }, tooltipKey: { classPropertyName: "tooltipKey", publicName: "tooltip-key", isSignal: true, isRequired: false, transformFunction: null }, tooltipParams: { classPropertyName: "tooltipParams", publicName: "tooltip-params", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
2714
|
+
}
|
|
2715
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisTooltipDirective, decorators: [{
|
|
2716
|
+
type: Directive,
|
|
2717
|
+
args: [{
|
|
2718
|
+
selector: '[solaris-tooltip]',
|
|
2719
|
+
standalone: true,
|
|
2720
|
+
}]
|
|
2721
|
+
}], ctorParameters: () => [], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "solaris-tooltip", required: false }] }], tooltipPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-position", required: false }] }], tooltipVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-variant", required: false }] }], tooltipSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-size", required: false }] }], tooltipPrefixIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-prefix-icon", required: false }] }], tooltipDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-disabled", required: false }] }], tooltipShowDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-show-delay", required: false }] }], tooltipHideDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-hide-delay", required: false }] }], tooltipOffset: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-offset", required: false }] }], tooltipAutoFlip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-auto-flip", required: false }] }], tooltipAutoShift: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-auto-shift", required: false }] }], tooltipViewportPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-viewport-padding", required: false }] }], tooltipKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-key", required: false }] }], tooltipParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip-params", required: false }] }] } });
|
|
2722
|
+
|
|
2723
|
+
const PRESET_COLORS$3 = ['primary', 'success', 'warning', 'error', 'surface'];
|
|
2237
2724
|
class SolarisLoading {
|
|
2238
2725
|
marker = '';
|
|
2239
2726
|
label;
|
|
@@ -2311,7 +2798,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
2311
2798
|
args: [{ transform: coerceBoolean$1 }]
|
|
2312
2799
|
}] } });
|
|
2313
2800
|
function isPresetColor(v) {
|
|
2314
|
-
return PRESET_COLORS$
|
|
2801
|
+
return PRESET_COLORS$3.includes(v);
|
|
2315
2802
|
}
|
|
2316
2803
|
function coerceBoolean$1(v) {
|
|
2317
2804
|
return v === '' || v === true || v === 'true' || v === 1 || v === '1';
|
|
@@ -2552,6 +3039,203 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
2552
3039
|
args: ['attr.aria-orientation']
|
|
2553
3040
|
}] } });
|
|
2554
3041
|
|
|
3042
|
+
class SolarisDialogContainer {
|
|
3043
|
+
contentHost;
|
|
3044
|
+
title;
|
|
3045
|
+
titleKey;
|
|
3046
|
+
titleParams;
|
|
3047
|
+
description;
|
|
3048
|
+
descriptionKey;
|
|
3049
|
+
descriptionParams;
|
|
3050
|
+
size = 'md';
|
|
3051
|
+
showCloseButton = true;
|
|
3052
|
+
actions = [];
|
|
3053
|
+
ariaLabel;
|
|
3054
|
+
ariaLabelledBy;
|
|
3055
|
+
ariaDescribedBy;
|
|
3056
|
+
closeClick = new EventEmitter();
|
|
3057
|
+
actionClick = new EventEmitter();
|
|
3058
|
+
titleId = `solaris-dialog-title-${Math.round(Math.random() * 1_000_000)}`;
|
|
3059
|
+
descriptionId = `solaris-dialog-description-${Math.round(Math.random() * 1_000_000)}`;
|
|
3060
|
+
get hasHeader() {
|
|
3061
|
+
return !!this.title || !!this.titleKey || !!this.description || !!this.descriptionKey || this.showCloseButton;
|
|
3062
|
+
}
|
|
3063
|
+
get hasDescription() {
|
|
3064
|
+
return !!this.description || !!this.descriptionKey;
|
|
3065
|
+
}
|
|
3066
|
+
get hasActions() {
|
|
3067
|
+
return this.actions.length > 0;
|
|
3068
|
+
}
|
|
3069
|
+
get resolvedAriaLabelledBy() {
|
|
3070
|
+
if (this.ariaLabelledBy)
|
|
3071
|
+
return this.ariaLabelledBy;
|
|
3072
|
+
if (this.title || this.titleKey)
|
|
3073
|
+
return this.titleId;
|
|
3074
|
+
return null;
|
|
3075
|
+
}
|
|
3076
|
+
get resolvedAriaDescribedBy() {
|
|
3077
|
+
if (this.ariaDescribedBy)
|
|
3078
|
+
return this.ariaDescribedBy;
|
|
3079
|
+
if (this.description || this.descriptionKey)
|
|
3080
|
+
return this.descriptionId;
|
|
3081
|
+
return null;
|
|
3082
|
+
}
|
|
3083
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDialogContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3084
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisDialogContainer, isStandalone: true, selector: "solaris-dialog-container", inputs: { title: "title", titleKey: "titleKey", titleParams: "titleParams", description: "description", descriptionKey: "descriptionKey", descriptionParams: "descriptionParams", size: "size", showCloseButton: "showCloseButton", actions: "actions", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", ariaDescribedBy: "ariaDescribedBy" }, outputs: { closeClick: "closeClick", actionClick: "actionClick" }, viewQueries: [{ propertyName: "contentHost", first: true, predicate: ["contentHost"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<section class=\"solaris-dialog\" [attr.data-size]=\"size\" role=\"dialog\" aria-modal=\"true\" [attr.aria-label]=\"ariaLabel || null\"\r\n [attr.aria-labelledby]=\"resolvedAriaLabelledBy\" [attr.aria-describedby]=\"resolvedAriaDescribedBy\">\r\n @if (hasHeader) {\r\n <header class=\"solaris-dialog__header\">\r\n <div class=\"solaris-dialog__heading\">\r\n @if (title || titleKey) {\r\n <h2 class=\"solaris-dialog__title\" [id]=\"titleId\">\r\n @if (titleKey) {\r\n {{ titleKey }}\r\n } @else {\r\n {{ title }}\r\n }\r\n </h2>\r\n }\r\n\r\n @if (hasDescription) {\r\n <p class=\"solaris-dialog__description\" [id]=\"descriptionId\">\r\n @if (descriptionKey) {\r\n {{ descriptionKey }}\r\n } @else {\r\n {{ description }}\r\n }\r\n </p>\r\n }\r\n </div>\r\n\r\n @if (showCloseButton) {\r\n <button type=\"button\" class=\"solaris-dialog__close\" aria-label=\"Fechar\" (click)=\"closeClick.emit()\">\r\n <i class=\"ph ph-x\"></i>\r\n </button>\r\n }\r\n </header>\r\n }\r\n\r\n <div class=\"solaris-dialog__body\">\r\n <ng-template #contentHost></ng-template>\r\n </div>\r\n\r\n @if (hasActions) {\r\n <footer class=\"solaris-dialog__footer\">\r\n @for (action of actions; track action.label ?? action.labelKey ?? $index) {\r\n <button type=\"button\" class=\"solaris-dialog__action\" [attr.data-variant]=\"action.variant ?? 'secondary'\"\r\n [disabled]=\"action.disabled\" (click)=\"actionClick.emit(action)\">\r\n @if (action.labelKey) {\r\n {{ action.labelKey }}\r\n } @else {\r\n {{ action.label }}\r\n }\r\n </button>\r\n }\r\n </footer>\r\n }\r\n</section>\r\n", styles: [":host{display:grid;inline-size:100%;block-size:100%;pointer-events:none;max-inline-size:100%}:host>.solaris-dialog{pointer-events:auto}.solaris-dialog{--solaris-dialog-bg: var(--solaris-color-surface);--solaris-dialog-fg: var(--solaris-color-text);--solaris-dialog-border: color-mix(in srgb, var(--solaris-color-border) 82%, transparent);--solaris-dialog-radius: var(--solaris-radius-lg);--solaris-dialog-shadow: var(--solaris-shadow-lg);--solaris-dialog-padding: var(--solaris-space-5);--solaris-dialog-max-width: 56rem;--solaris-dialog-max-height: min(88vh, 72rem);inline-size:min(100vw - 3.2rem,var(--solaris-dialog-max-width));max-block-size:var(--solaris-dialog-max-height);display:grid;grid-template-rows:auto minmax(0,1fr) auto;color:var(--solaris-dialog-fg);background:var(--solaris-dialog-bg);border:1px solid var(--solaris-dialog-border);border-radius:var(--solaris-dialog-radius);box-shadow:var(--solaris-dialog-shadow);overflow:hidden;animation:solaris-dialog-in .14s ease}.solaris-dialog[data-size=sm]{--solaris-dialog-max-width: 40rem}.solaris-dialog[data-size=md]{--solaris-dialog-max-width: 56rem}.solaris-dialog[data-size=lg]{--solaris-dialog-max-width: 72rem}.solaris-dialog[data-size=xl]{--solaris-dialog-max-width: 96rem}.solaris-dialog[data-size=fullscreen]{inline-size:calc(100vw - 3.2rem);block-size:calc(100vh - 3.2rem);--solaris-dialog-max-width: none;--solaris-dialog-max-height: none}.solaris-dialog__header{min-inline-size:0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--solaris-space-4);align-items:start;padding:var(--solaris-dialog-padding);border-block-end:1px solid var(--solaris-dialog-border)}.solaris-dialog__heading{min-inline-size:0;display:grid;gap:var(--solaris-space-1)}.solaris-dialog__title{margin:0;color:var(--solaris-color-text);font-size:var(--solaris-fs-18);font-weight:750;line-height:var(--solaris-lh-tight)}.solaris-dialog__description{margin:0;color:var(--solaris-color-text-muted);font-size:var(--solaris-fs-13);line-height:var(--solaris-lh-normal)}.solaris-dialog__close{inline-size:3.2rem;block-size:3.2rem;padding:0;border:0;border-radius:var(--solaris-radius-full);background:transparent;color:var(--solaris-color-text-muted);display:inline-grid;place-items:center;cursor:pointer;outline:none;transition:background-color .12s ease,color .12s ease,box-shadow .12s ease}.solaris-dialog__close:hover,.solaris-dialog__close:focus-visible{color:var(--solaris-color-text);background:var(--solaris-color-surface-2)}.solaris-dialog__close:focus-visible{box-shadow:0 0 0 .3rem color-mix(in srgb,var(--solaris-color-primary) 24%,transparent)}.solaris-dialog__close i{line-height:1;font-size:var(--solaris-fs-18)}.solaris-dialog__body{min-block-size:0;overflow:auto;padding:var(--solaris-dialog-padding)}.solaris-dialog__footer{display:flex;justify-content:flex-end;align-items:center;gap:var(--solaris-space-2);padding:var(--solaris-space-4) var(--solaris-dialog-padding);border-block-start:1px solid var(--solaris-dialog-border);background:color-mix(in srgb,var(--solaris-color-surface-2) 45%,transparent)}.solaris-dialog__action{min-inline-size:8.8rem;min-block-size:3.6rem;padding-inline:var(--solaris-space-4);border-radius:var(--solaris-radius-sm);border:1px solid transparent;font:inherit;font-size:var(--solaris-fs-13);font-weight:650;cursor:pointer;transition:background-color .12s ease,border-color .12s ease,color .12s ease,opacity .12s ease}.solaris-dialog__action:disabled{cursor:not-allowed;opacity:.55}.solaris-dialog__action[data-variant=primary]{background:var(--solaris-color-primary);color:#fff}.solaris-dialog__action[data-variant=secondary]{background:var(--solaris-color-surface-2);color:var(--solaris-color-text);border-color:var(--solaris-color-border)}.solaris-dialog__action[data-variant=ghost]{background:transparent;color:var(--solaris-color-text-muted)}.solaris-dialog__action[data-variant=danger]{background:color-mix(in srgb,var(--solaris-color-error) 16%,var(--solaris-color-surface));color:var(--solaris-color-error);border-color:color-mix(in srgb,var(--solaris-color-error) 38%,var(--solaris-color-border))}@keyframes solaris-dialog-in{0%{opacity:0;transform:translateY(.8rem) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3085
|
+
}
|
|
3086
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDialogContainer, decorators: [{
|
|
3087
|
+
type: Component,
|
|
3088
|
+
args: [{ selector: 'solaris-dialog-container', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<section class=\"solaris-dialog\" [attr.data-size]=\"size\" role=\"dialog\" aria-modal=\"true\" [attr.aria-label]=\"ariaLabel || null\"\r\n [attr.aria-labelledby]=\"resolvedAriaLabelledBy\" [attr.aria-describedby]=\"resolvedAriaDescribedBy\">\r\n @if (hasHeader) {\r\n <header class=\"solaris-dialog__header\">\r\n <div class=\"solaris-dialog__heading\">\r\n @if (title || titleKey) {\r\n <h2 class=\"solaris-dialog__title\" [id]=\"titleId\">\r\n @if (titleKey) {\r\n {{ titleKey }}\r\n } @else {\r\n {{ title }}\r\n }\r\n </h2>\r\n }\r\n\r\n @if (hasDescription) {\r\n <p class=\"solaris-dialog__description\" [id]=\"descriptionId\">\r\n @if (descriptionKey) {\r\n {{ descriptionKey }}\r\n } @else {\r\n {{ description }}\r\n }\r\n </p>\r\n }\r\n </div>\r\n\r\n @if (showCloseButton) {\r\n <button type=\"button\" class=\"solaris-dialog__close\" aria-label=\"Fechar\" (click)=\"closeClick.emit()\">\r\n <i class=\"ph ph-x\"></i>\r\n </button>\r\n }\r\n </header>\r\n }\r\n\r\n <div class=\"solaris-dialog__body\">\r\n <ng-template #contentHost></ng-template>\r\n </div>\r\n\r\n @if (hasActions) {\r\n <footer class=\"solaris-dialog__footer\">\r\n @for (action of actions; track action.label ?? action.labelKey ?? $index) {\r\n <button type=\"button\" class=\"solaris-dialog__action\" [attr.data-variant]=\"action.variant ?? 'secondary'\"\r\n [disabled]=\"action.disabled\" (click)=\"actionClick.emit(action)\">\r\n @if (action.labelKey) {\r\n {{ action.labelKey }}\r\n } @else {\r\n {{ action.label }}\r\n }\r\n </button>\r\n }\r\n </footer>\r\n }\r\n</section>\r\n", styles: [":host{display:grid;inline-size:100%;block-size:100%;pointer-events:none;max-inline-size:100%}:host>.solaris-dialog{pointer-events:auto}.solaris-dialog{--solaris-dialog-bg: var(--solaris-color-surface);--solaris-dialog-fg: var(--solaris-color-text);--solaris-dialog-border: color-mix(in srgb, var(--solaris-color-border) 82%, transparent);--solaris-dialog-radius: var(--solaris-radius-lg);--solaris-dialog-shadow: var(--solaris-shadow-lg);--solaris-dialog-padding: var(--solaris-space-5);--solaris-dialog-max-width: 56rem;--solaris-dialog-max-height: min(88vh, 72rem);inline-size:min(100vw - 3.2rem,var(--solaris-dialog-max-width));max-block-size:var(--solaris-dialog-max-height);display:grid;grid-template-rows:auto minmax(0,1fr) auto;color:var(--solaris-dialog-fg);background:var(--solaris-dialog-bg);border:1px solid var(--solaris-dialog-border);border-radius:var(--solaris-dialog-radius);box-shadow:var(--solaris-dialog-shadow);overflow:hidden;animation:solaris-dialog-in .14s ease}.solaris-dialog[data-size=sm]{--solaris-dialog-max-width: 40rem}.solaris-dialog[data-size=md]{--solaris-dialog-max-width: 56rem}.solaris-dialog[data-size=lg]{--solaris-dialog-max-width: 72rem}.solaris-dialog[data-size=xl]{--solaris-dialog-max-width: 96rem}.solaris-dialog[data-size=fullscreen]{inline-size:calc(100vw - 3.2rem);block-size:calc(100vh - 3.2rem);--solaris-dialog-max-width: none;--solaris-dialog-max-height: none}.solaris-dialog__header{min-inline-size:0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--solaris-space-4);align-items:start;padding:var(--solaris-dialog-padding);border-block-end:1px solid var(--solaris-dialog-border)}.solaris-dialog__heading{min-inline-size:0;display:grid;gap:var(--solaris-space-1)}.solaris-dialog__title{margin:0;color:var(--solaris-color-text);font-size:var(--solaris-fs-18);font-weight:750;line-height:var(--solaris-lh-tight)}.solaris-dialog__description{margin:0;color:var(--solaris-color-text-muted);font-size:var(--solaris-fs-13);line-height:var(--solaris-lh-normal)}.solaris-dialog__close{inline-size:3.2rem;block-size:3.2rem;padding:0;border:0;border-radius:var(--solaris-radius-full);background:transparent;color:var(--solaris-color-text-muted);display:inline-grid;place-items:center;cursor:pointer;outline:none;transition:background-color .12s ease,color .12s ease,box-shadow .12s ease}.solaris-dialog__close:hover,.solaris-dialog__close:focus-visible{color:var(--solaris-color-text);background:var(--solaris-color-surface-2)}.solaris-dialog__close:focus-visible{box-shadow:0 0 0 .3rem color-mix(in srgb,var(--solaris-color-primary) 24%,transparent)}.solaris-dialog__close i{line-height:1;font-size:var(--solaris-fs-18)}.solaris-dialog__body{min-block-size:0;overflow:auto;padding:var(--solaris-dialog-padding)}.solaris-dialog__footer{display:flex;justify-content:flex-end;align-items:center;gap:var(--solaris-space-2);padding:var(--solaris-space-4) var(--solaris-dialog-padding);border-block-start:1px solid var(--solaris-dialog-border);background:color-mix(in srgb,var(--solaris-color-surface-2) 45%,transparent)}.solaris-dialog__action{min-inline-size:8.8rem;min-block-size:3.6rem;padding-inline:var(--solaris-space-4);border-radius:var(--solaris-radius-sm);border:1px solid transparent;font:inherit;font-size:var(--solaris-fs-13);font-weight:650;cursor:pointer;transition:background-color .12s ease,border-color .12s ease,color .12s ease,opacity .12s ease}.solaris-dialog__action:disabled{cursor:not-allowed;opacity:.55}.solaris-dialog__action[data-variant=primary]{background:var(--solaris-color-primary);color:#fff}.solaris-dialog__action[data-variant=secondary]{background:var(--solaris-color-surface-2);color:var(--solaris-color-text);border-color:var(--solaris-color-border)}.solaris-dialog__action[data-variant=ghost]{background:transparent;color:var(--solaris-color-text-muted)}.solaris-dialog__action[data-variant=danger]{background:color-mix(in srgb,var(--solaris-color-error) 16%,var(--solaris-color-surface));color:var(--solaris-color-error);border-color:color-mix(in srgb,var(--solaris-color-error) 38%,var(--solaris-color-border))}@keyframes solaris-dialog-in{0%{opacity:0;transform:translateY(.8rem) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}\n"] }]
|
|
3089
|
+
}], propDecorators: { contentHost: [{
|
|
3090
|
+
type: ViewChild,
|
|
3091
|
+
args: ['contentHost', { read: ViewContainerRef, static: true }]
|
|
3092
|
+
}], title: [{
|
|
3093
|
+
type: Input
|
|
3094
|
+
}], titleKey: [{
|
|
3095
|
+
type: Input
|
|
3096
|
+
}], titleParams: [{
|
|
3097
|
+
type: Input
|
|
3098
|
+
}], description: [{
|
|
3099
|
+
type: Input
|
|
3100
|
+
}], descriptionKey: [{
|
|
3101
|
+
type: Input
|
|
3102
|
+
}], descriptionParams: [{
|
|
3103
|
+
type: Input
|
|
3104
|
+
}], size: [{
|
|
3105
|
+
type: Input
|
|
3106
|
+
}], showCloseButton: [{
|
|
3107
|
+
type: Input
|
|
3108
|
+
}], actions: [{
|
|
3109
|
+
type: Input
|
|
3110
|
+
}], ariaLabel: [{
|
|
3111
|
+
type: Input
|
|
3112
|
+
}], ariaLabelledBy: [{
|
|
3113
|
+
type: Input
|
|
3114
|
+
}], ariaDescribedBy: [{
|
|
3115
|
+
type: Input
|
|
3116
|
+
}], closeClick: [{
|
|
3117
|
+
type: Output
|
|
3118
|
+
}], actionClick: [{
|
|
3119
|
+
type: Output
|
|
3120
|
+
}] } });
|
|
3121
|
+
|
|
3122
|
+
const SOLARIS_DIALOG_DATA = new InjectionToken('SOLARIS_DIALOG_DATA');
|
|
3123
|
+
|
|
3124
|
+
class SolarisDialogRef {
|
|
3125
|
+
closedSubject = new Subject();
|
|
3126
|
+
closeFn;
|
|
3127
|
+
afterClosed() {
|
|
3128
|
+
return this.closedSubject.asObservable();
|
|
3129
|
+
}
|
|
3130
|
+
close(result) {
|
|
3131
|
+
this.closeFn?.(result);
|
|
3132
|
+
}
|
|
3133
|
+
_attachCloseFn(fn) {
|
|
3134
|
+
this.closeFn = fn;
|
|
3135
|
+
}
|
|
3136
|
+
_finishClose(result) {
|
|
3137
|
+
this.closedSubject.next(result);
|
|
3138
|
+
this.closedSubject.complete();
|
|
3139
|
+
}
|
|
3140
|
+
}
|
|
3141
|
+
|
|
3142
|
+
class SolarisDialogService {
|
|
3143
|
+
appRef = inject(ApplicationRef);
|
|
3144
|
+
environmentInjector = inject(EnvironmentInjector);
|
|
3145
|
+
open(component, configuration = {}) {
|
|
3146
|
+
const dialogRef = new SolarisDialogRef();
|
|
3147
|
+
const backdrop = document.createElement('div');
|
|
3148
|
+
backdrop.className = 'solaris-dialog-backdrop';
|
|
3149
|
+
const host = document.createElement('div');
|
|
3150
|
+
const positionClass = `position-${configuration.position ?? 'center'}`;
|
|
3151
|
+
host.className = [
|
|
3152
|
+
'solaris-dialog-host',
|
|
3153
|
+
positionClass,
|
|
3154
|
+
configuration.panelClass ?? '',
|
|
3155
|
+
].filter(Boolean).join(' ');
|
|
3156
|
+
document.body.appendChild(backdrop);
|
|
3157
|
+
document.body.appendChild(host);
|
|
3158
|
+
const dialogInjector = Injector.create({
|
|
3159
|
+
providers: [
|
|
3160
|
+
{ provide: SOLARIS_DIALOG_DATA, useValue: configuration.data },
|
|
3161
|
+
{ provide: SolarisDialogRef, useValue: dialogRef },
|
|
3162
|
+
],
|
|
3163
|
+
parent: this.environmentInjector,
|
|
3164
|
+
});
|
|
3165
|
+
const containerRef = createComponent((SolarisDialogContainer), {
|
|
3166
|
+
environmentInjector: this.environmentInjector,
|
|
3167
|
+
hostElement: host,
|
|
3168
|
+
});
|
|
3169
|
+
containerRef.setInput('title', configuration.title);
|
|
3170
|
+
containerRef.setInput('titleKey', configuration.titleKey);
|
|
3171
|
+
containerRef.setInput('titleParams', configuration.titleParams);
|
|
3172
|
+
containerRef.setInput('description', configuration.description);
|
|
3173
|
+
containerRef.setInput('descriptionKey', configuration.descriptionKey);
|
|
3174
|
+
containerRef.setInput('descriptionParams', configuration.descriptionParams);
|
|
3175
|
+
containerRef.setInput('size', configuration.size ?? 'md');
|
|
3176
|
+
containerRef.setInput('showCloseButton', configuration.showCloseButton ?? !configuration.disableClose);
|
|
3177
|
+
containerRef.setInput('actions', configuration.actions ?? []);
|
|
3178
|
+
containerRef.setInput('ariaLabel', configuration.ariaLabel);
|
|
3179
|
+
containerRef.setInput('ariaLabelledBy', configuration.ariaLabelledBy);
|
|
3180
|
+
containerRef.setInput('ariaDescribedBy', configuration.ariaDescribedBy);
|
|
3181
|
+
this.appRef.attachView(containerRef.hostView);
|
|
3182
|
+
containerRef.changeDetectorRef.detectChanges();
|
|
3183
|
+
const contentRef = createComponent(component, {
|
|
3184
|
+
environmentInjector: this.environmentInjector,
|
|
3185
|
+
elementInjector: dialogInjector,
|
|
3186
|
+
});
|
|
3187
|
+
containerRef.instance.contentHost.insert(contentRef.hostView);
|
|
3188
|
+
contentRef.changeDetectorRef.detectChanges();
|
|
3189
|
+
const close = (result) => {
|
|
3190
|
+
this.appRef.detachView(contentRef.hostView);
|
|
3191
|
+
contentRef.destroy();
|
|
3192
|
+
this.appRef.detachView(containerRef.hostView);
|
|
3193
|
+
containerRef.destroy();
|
|
3194
|
+
backdrop.remove();
|
|
3195
|
+
host.remove();
|
|
3196
|
+
document.removeEventListener('keydown', onKeyDown, true);
|
|
3197
|
+
backdrop.removeEventListener('pointerdown', onBackdropClick, true);
|
|
3198
|
+
dialogRef._finishClose(result);
|
|
3199
|
+
};
|
|
3200
|
+
dialogRef._attachCloseFn(close);
|
|
3201
|
+
const closeOnBackdropClick = configuration.closeOnBackdropClick ?? !configuration.disableClose;
|
|
3202
|
+
const closeOnEscape = configuration.closeOnEscape ?? !configuration.disableClose;
|
|
3203
|
+
const onBackdropClick = () => {
|
|
3204
|
+
if (closeOnBackdropClick) {
|
|
3205
|
+
dialogRef.close();
|
|
3206
|
+
}
|
|
3207
|
+
};
|
|
3208
|
+
const onKeyDown = (event) => {
|
|
3209
|
+
if (event.key === 'Escape' && closeOnEscape) {
|
|
3210
|
+
dialogRef.close();
|
|
3211
|
+
}
|
|
3212
|
+
};
|
|
3213
|
+
backdrop.addEventListener('pointerdown', onBackdropClick, true);
|
|
3214
|
+
document.addEventListener('keydown', onKeyDown, true);
|
|
3215
|
+
containerRef.instance.closeClick.subscribe(() => {
|
|
3216
|
+
if (!configuration.disableClose) {
|
|
3217
|
+
dialogRef.close();
|
|
3218
|
+
}
|
|
3219
|
+
});
|
|
3220
|
+
containerRef.instance.actionClick.subscribe((action) => {
|
|
3221
|
+
if (action.disabled)
|
|
3222
|
+
return;
|
|
3223
|
+
if (action.closesDialog ?? true) {
|
|
3224
|
+
dialogRef.close(action.value);
|
|
3225
|
+
}
|
|
3226
|
+
});
|
|
3227
|
+
return dialogRef;
|
|
3228
|
+
}
|
|
3229
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3230
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDialogService, providedIn: 'root' });
|
|
3231
|
+
}
|
|
3232
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDialogService, decorators: [{
|
|
3233
|
+
type: Injectable,
|
|
3234
|
+
args: [{
|
|
3235
|
+
providedIn: 'root',
|
|
3236
|
+
}]
|
|
3237
|
+
}] });
|
|
3238
|
+
|
|
2555
3239
|
class SolarisDrawerHeaderDirective {
|
|
2556
3240
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisDrawerHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2557
3241
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisDrawerHeaderDirective, isStandalone: true, selector: "[solaris-drawer-header]", ngImport: i0 });
|
|
@@ -2943,13 +3627,13 @@ class SolarisFilterPanel {
|
|
|
2943
3627
|
this.setOpen(!this.isOpen());
|
|
2944
3628
|
}
|
|
2945
3629
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFilterPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2946
|
-
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:
|
|
3630
|
+
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: SolarisButtonDirective, 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 });
|
|
2947
3631
|
}
|
|
2948
3632
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisFilterPanel, decorators: [{
|
|
2949
3633
|
type: Component,
|
|
2950
3634
|
args: [{ selector: 'solaris-filter-panel', standalone: true, imports: [
|
|
2951
3635
|
SolarisTranslationPipe,
|
|
2952
|
-
|
|
3636
|
+
SolarisButtonDirective,
|
|
2953
3637
|
SolarisDrawerHeaderDirective,
|
|
2954
3638
|
SolarisDrawerFooterDirective,
|
|
2955
3639
|
SolarisDrawer
|
|
@@ -3173,7 +3857,7 @@ function uniqueId(prefix) {
|
|
|
3173
3857
|
return inject(SolarisIdGenerator).next(prefix);
|
|
3174
3858
|
}
|
|
3175
3859
|
|
|
3176
|
-
const PRESET_COLORS = new Set(['primary', 'success', 'warning', 'error', 'info']);
|
|
3860
|
+
const PRESET_COLORS$2 = new Set(['primary', 'success', 'warning', 'error', 'info']);
|
|
3177
3861
|
class SolarisCheckbox {
|
|
3178
3862
|
indeterminate = input(false, ...(ngDevMode ? [{ debugName: "indeterminate" }] : []));
|
|
3179
3863
|
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -3198,7 +3882,7 @@ class SolarisCheckbox {
|
|
|
3198
3882
|
const raw = String(this.color() ?? '').trim();
|
|
3199
3883
|
if (!raw || raw === 'custom')
|
|
3200
3884
|
return 'custom';
|
|
3201
|
-
return PRESET_COLORS.has(raw) ? raw : 'custom';
|
|
3885
|
+
return PRESET_COLORS$2.has(raw) ? raw : 'custom';
|
|
3202
3886
|
}, ...(ngDevMode ? [{ debugName: "colorKey" }] : []));
|
|
3203
3887
|
autoId = uniqueId('solaris-checkbox');
|
|
3204
3888
|
id = computed(() => this.inputId() ?? this.autoId, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
@@ -3271,7 +3955,7 @@ function resolveColor(v, fallback) {
|
|
|
3271
3955
|
const s = v == null ? '' : String(v).trim();
|
|
3272
3956
|
if (!s || s === 'custom')
|
|
3273
3957
|
return fallback;
|
|
3274
|
-
if (PRESET_COLORS.has(s))
|
|
3958
|
+
if (PRESET_COLORS$2.has(s))
|
|
3275
3959
|
return `var(--solaris-color-${s})`;
|
|
3276
3960
|
return s;
|
|
3277
3961
|
}
|
|
@@ -4005,7 +4689,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
4005
4689
|
args: [SolarisPageHeaderDescriptionDirective]
|
|
4006
4690
|
}] } });
|
|
4007
4691
|
|
|
4008
|
-
function resolveRadius(v) {
|
|
4692
|
+
function resolveRadius$1(v) {
|
|
4009
4693
|
const s = String(v).trim();
|
|
4010
4694
|
switch (s) {
|
|
4011
4695
|
case 'none':
|
|
@@ -4029,7 +4713,7 @@ class ButtonGroupDirective {
|
|
|
4029
4713
|
}
|
|
4030
4714
|
attr = '';
|
|
4031
4715
|
get groupRadius() {
|
|
4032
|
-
return this._radius ? resolveRadius(this._radius) : null;
|
|
4716
|
+
return this._radius ? resolveRadius$1(this._radius) : null;
|
|
4033
4717
|
}
|
|
4034
4718
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ButtonGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4035
4719
|
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 });
|
|
@@ -4050,40 +4734,1697 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
4050
4734
|
args: ['style.--solaris-button-group-radius']
|
|
4051
4735
|
}] } });
|
|
4052
4736
|
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
input
|
|
4064
|
-
}
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
}
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4737
|
+
const SOLARIS_RADIO_GROUP = new InjectionToken('SOLARIS_RADIO_GROUP');
|
|
4738
|
+
|
|
4739
|
+
const PRESET_COLORS$1 = new Set([
|
|
4740
|
+
'primary',
|
|
4741
|
+
'success',
|
|
4742
|
+
'warning',
|
|
4743
|
+
'error',
|
|
4744
|
+
'info'
|
|
4745
|
+
]);
|
|
4746
|
+
class SolarisRadio {
|
|
4747
|
+
ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : {}), alias: 'aria-label' });
|
|
4748
|
+
inputId = input(null, { ...(ngDevMode ? { debugName: "inputId" } : {}), alias: 'id' });
|
|
4749
|
+
inputName = input(null, { ...(ngDevMode ? { debugName: "inputName" } : {}), alias: 'name' });
|
|
4750
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
4751
|
+
variant = input('dot', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
4752
|
+
appearance = input('solid', ...(ngDevMode ? [{ debugName: "appearance" }] : []));
|
|
4753
|
+
color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
4754
|
+
value = input(true, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
4755
|
+
checkedInput = input(false, { ...(ngDevMode ? { debugName: "checkedInput" } : {}), alias: 'checked' });
|
|
4756
|
+
disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : {}), alias: 'disabled' });
|
|
4757
|
+
checkedChange = output();
|
|
4758
|
+
native;
|
|
4759
|
+
group = inject(SOLARIS_RADIO_GROUP, { optional: true });
|
|
4760
|
+
autoId = uniqueId('solaris-radio');
|
|
4761
|
+
autoName = uniqueId('solaris-radio-name');
|
|
4762
|
+
localChecked = signal(false, ...(ngDevMode ? [{ debugName: "localChecked" }] : []));
|
|
4763
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
4764
|
+
id = computed(() => this.inputId() ?? this.autoId, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
4765
|
+
name = computed(() => this.group?.name() ?? this.inputName() ?? this.autoName, ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
4766
|
+
disabled = computed(() => {
|
|
4767
|
+
return !!this.group?.disabled() || this.disabledInput() || this.cvaDisabled();
|
|
4768
|
+
}, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
4769
|
+
checked = computed(() => {
|
|
4770
|
+
if (this.group)
|
|
4771
|
+
return this.group.isSelected(this.value());
|
|
4772
|
+
return this.localChecked();
|
|
4773
|
+
}, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
4774
|
+
tabIndex = computed(() => {
|
|
4775
|
+
if (this.group)
|
|
4776
|
+
return this.group.tabIndexFor(this);
|
|
4777
|
+
return this.disabled() ? -1 : 0;
|
|
4778
|
+
}, ...(ngDevMode ? [{ debugName: "tabIndex" }] : []));
|
|
4779
|
+
customAccent = computed(() => {
|
|
4780
|
+
if (this.colorKey() !== 'custom')
|
|
4781
|
+
return null;
|
|
4782
|
+
const raw = String(this.color() ?? '').trim();
|
|
4783
|
+
return !raw || raw === 'custom' ? null : raw;
|
|
4784
|
+
}, ...(ngDevMode ? [{ debugName: "customAccent" }] : []));
|
|
4785
|
+
colorKey = computed(() => {
|
|
4786
|
+
const raw = String(this.color() ?? '').trim();
|
|
4787
|
+
if (!raw || raw === 'custom')
|
|
4788
|
+
return 'custom';
|
|
4789
|
+
return PRESET_COLORS$1.has(raw) ? raw : 'custom';
|
|
4790
|
+
}, ...(ngDevMode ? [{ debugName: "colorKey" }] : []));
|
|
4791
|
+
onChange = () => { };
|
|
4792
|
+
onTouched = () => { };
|
|
4793
|
+
constructor() {
|
|
4794
|
+
effect(() => {
|
|
4795
|
+
if (this.group)
|
|
4796
|
+
return;
|
|
4797
|
+
this.localChecked.set(this.checkedInput());
|
|
4798
|
+
});
|
|
4799
|
+
}
|
|
4800
|
+
onNativeChange() {
|
|
4801
|
+
if (this.disabled())
|
|
4802
|
+
return;
|
|
4803
|
+
if (this.group) {
|
|
4804
|
+
const wasChecked = this.checked();
|
|
4805
|
+
this.group.select(this);
|
|
4806
|
+
if (!wasChecked)
|
|
4807
|
+
this.checkedChange.emit(true);
|
|
4808
|
+
return;
|
|
4809
|
+
}
|
|
4810
|
+
if (this.localChecked()) {
|
|
4811
|
+
this.onTouched();
|
|
4812
|
+
return;
|
|
4813
|
+
}
|
|
4814
|
+
this.localChecked.set(true);
|
|
4815
|
+
this.onChange(true);
|
|
4816
|
+
this.checkedChange.emit(true);
|
|
4817
|
+
this.onTouched();
|
|
4818
|
+
}
|
|
4819
|
+
onNativeKeydown(event) {
|
|
4820
|
+
if (this.disabled())
|
|
4821
|
+
return;
|
|
4822
|
+
if (this.group) {
|
|
4823
|
+
this.group.handleKeydown(event, this);
|
|
4824
|
+
return;
|
|
4825
|
+
}
|
|
4826
|
+
if (event.key === ' ' || event.key === 'Enter') {
|
|
4827
|
+
event.preventDefault();
|
|
4828
|
+
this.onNativeChange();
|
|
4829
|
+
}
|
|
4830
|
+
}
|
|
4831
|
+
onBlur() {
|
|
4832
|
+
if (this.group) {
|
|
4833
|
+
this.group.notifyTouched();
|
|
4834
|
+
return;
|
|
4835
|
+
}
|
|
4836
|
+
this.onTouched();
|
|
4837
|
+
}
|
|
4838
|
+
focus() {
|
|
4839
|
+
this.native?.nativeElement.focus();
|
|
4840
|
+
}
|
|
4841
|
+
writeValue(value) {
|
|
4842
|
+
if (this.group)
|
|
4843
|
+
return;
|
|
4844
|
+
this.localChecked.set(!!value);
|
|
4845
|
+
}
|
|
4846
|
+
registerOnTouched(fn) {
|
|
4847
|
+
this.onTouched = fn;
|
|
4848
|
+
}
|
|
4849
|
+
setDisabledState(isDisabled) {
|
|
4850
|
+
this.cvaDisabled.set(isDisabled);
|
|
4851
|
+
}
|
|
4852
|
+
registerOnChange(fn) {
|
|
4853
|
+
this.onChange = fn;
|
|
4854
|
+
}
|
|
4855
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisRadio, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4856
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.1", type: SolarisRadio, isStandalone: true, selector: "solaris-radio", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, inputName: { classPropertyName: "inputName", publicName: "name", 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 }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, checkedInput: { classPropertyName: "checkedInput", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, host: { properties: { "attr.data-size": "size()", "attr.data-color": "colorKey()", "attr.data-variant": "variant()", "attr.data-appearance": "appearance()", "attr.data-disabled": "disabled() ? \"true\" : null", "attr.data-checked": "checked() ? \"true\" : null", "style.--solaris-radio-custom": "customAccent()" }, classAttribute: "solaris-radio-host" }, providers: [
|
|
4857
|
+
{
|
|
4858
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4859
|
+
useExisting: forwardRef(() => SolarisRadio),
|
|
4860
|
+
multi: true,
|
|
4861
|
+
},
|
|
4862
|
+
], viewQueries: [{ propertyName: "native", first: true, predicate: ["native"], descendants: true, static: true }], ngImport: i0, template: "<label class=\"solaris-radio\">\r\n <input #native class=\"solaris-radio__native\" type=\"radio\" [attr.id]=\"id()\" [attr.name]=\"name()\" [checked]=\"checked()\"\r\n [disabled]=\"disabled()\" [attr.aria-label]=\"ariaLabel() ?? null\" [attr.tabindex]=\"tabIndex()\"\r\n (change)=\"onNativeChange()\" (keydown)=\"onNativeKeydown($event)\" (blur)=\"onBlur()\"/>\r\n\r\n <span class=\"solaris-radio__control\" aria-hidden=\"true\">\r\n <span class=\"solaris-radio__inner\" aria-hidden=\"true\"></span>\r\n </span>\r\n\r\n <span class=\"solaris-radio__content\">\r\n <ng-content/>\r\n </span>\r\n</label>\r\n", styles: [":host{--_size: 2rem;--_dot: .8rem;--_icon-dot: .55rem;--_text: var(--solaris-color-text);--_radius: var(--solaris-radius-full);--_border: var(--solaris-color-border);--solaris-radio-border: var(--_border);--_muted: var(--solaris-color-text-muted);--solaris-radio-accent: var(--solaris-color-primary);--solaris-radio-on-accent: var(--solaris-color-primary-contrast, #fff);--solaris-radio-soft-fill: color-mix(in srgb, var(--solaris-radio-accent) 12%, transparent);display:inline-flex}:host([data-size=sm]){--_dot: .7rem;--_size: 1.8rem;--_icon-dot: .5rem}:host([data-size=md]){--_size: 2rem;--_dot: .8rem;--_icon-dot: .55rem}:host([data-size=lg]){--_size: 2.4rem;--_dot: .95rem;--_icon-dot: .65rem}:host([data-color=primary]){--solaris-radio-accent: var(--solaris-color-primary)}:host([data-color=success]){--solaris-radio-accent: var(--solaris-color-success)}:host([data-color=warning]){--solaris-radio-accent: var(--solaris-color-warning)}:host([data-color=error]){--solaris-radio-accent: var(--solaris-color-error)}:host([data-color=info]){--solaris-radio-accent: var(--solaris-color-info)}:host([data-color=custom]){--solaris-radio-accent: var(--solaris-radio-custom, var(--solaris-color-primary))}.solaris-radio{gap:.8rem;cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;color:var(--_text);display:inline-flex}.solaris-radio__native{opacity:0;width:1px;height:1px;position:absolute;pointer-events:none}.solaris-radio__control{flex:0 0 auto;width:var(--_size);height:var(--_size);display:grid;place-items:center;box-sizing:border-box;background:transparent;border-radius:var(--_radius);border:.1rem solid var(--solaris-radio-border)}.solaris-radio__content{gap:.2rem;line-height:1.3;display:inline-flex;flex-direction:column;justify-content:center;min-height:var(--_size)}.solaris-radio__inner{opacity:0;width:var(--_dot);height:var(--_dot);transform:scale(.4);background:var(--solaris-radio-accent);border-radius:var(--solaris-radius-full);transition:opacity .15s ease,transform .15s ease,background-color .15s ease}.solaris-radio:hover .solaris-radio__control{border-color:color-mix(in srgb,var(--solaris-radio-accent) 36%,var(--solaris-radio-border))}.solaris-radio__native:focus-visible+.solaris-radio__control{outline-offset:.2rem;outline:.2rem solid var(--solaris-radio-accent)}.solaris-radio__native:active+.solaris-radio__control{transform:scale(.98)}.solaris-radio__native:checked+.solaris-radio__control{border-color:var(--solaris-radio-accent)}.solaris-radio__native:checked+.solaris-radio__control .solaris-radio__inner{opacity:1;transform:scale(1)}:host([data-variant=dot][data-appearance=outline]) .solaris-radio__native:checked+.solaris-radio__control{background:transparent}:host([data-variant=dot][data-appearance=solid]) .solaris-radio__native:checked+.solaris-radio__control{background:var(--solaris-radio-soft-fill)}:host([data-variant=icon]) .solaris-radio__control{padding:.25rem;background-clip:content-box}:host([data-variant=icon]) .solaris-radio__inner{width:var(--_icon-dot);height:var(--_icon-dot)}:host([data-variant=icon][data-appearance=solid]) .solaris-radio__native:checked+.solaris-radio__control{background:var(--solaris-radio-accent)}:host([data-variant=icon][data-appearance=solid]) .solaris-radio__native:checked+.solaris-radio__control .solaris-radio__inner{background:var(--solaris-radio-on-accent)}:host([data-variant=icon][data-appearance=outline]) .solaris-radio__native:checked+.solaris-radio__control{background:transparent}:host([data-variant=icon][data-appearance=outline]) .solaris-radio__native:checked+.solaris-radio__control .solaris-radio__inner{background:var(--solaris-radio-accent)}:host([data-disabled=true]) .solaris-radio{opacity:.55;cursor:not-allowed}:host([data-disabled=true]) .solaris-radio__control{border-color:color-mix(in srgb,var(--_border) 70%,transparent)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4863
|
+
}
|
|
4864
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisRadio, decorators: [{
|
|
4865
|
+
type: Component,
|
|
4866
|
+
args: [{ selector: 'solaris-radio', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
4867
|
+
{
|
|
4868
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4869
|
+
useExisting: forwardRef(() => SolarisRadio),
|
|
4870
|
+
multi: true,
|
|
4871
|
+
},
|
|
4872
|
+
], host: {
|
|
4873
|
+
class: 'solaris-radio-host',
|
|
4874
|
+
'[attr.data-size]': 'size()',
|
|
4875
|
+
'[attr.data-color]': 'colorKey()',
|
|
4876
|
+
'[attr.data-variant]': 'variant()',
|
|
4877
|
+
'[attr.data-appearance]': 'appearance()',
|
|
4878
|
+
'[attr.data-disabled]': 'disabled() ? "true" : null',
|
|
4879
|
+
'[attr.data-checked]': 'checked() ? "true" : null',
|
|
4880
|
+
'[style.--solaris-radio-custom]': 'customAccent()',
|
|
4881
|
+
}, template: "<label class=\"solaris-radio\">\r\n <input #native class=\"solaris-radio__native\" type=\"radio\" [attr.id]=\"id()\" [attr.name]=\"name()\" [checked]=\"checked()\"\r\n [disabled]=\"disabled()\" [attr.aria-label]=\"ariaLabel() ?? null\" [attr.tabindex]=\"tabIndex()\"\r\n (change)=\"onNativeChange()\" (keydown)=\"onNativeKeydown($event)\" (blur)=\"onBlur()\"/>\r\n\r\n <span class=\"solaris-radio__control\" aria-hidden=\"true\">\r\n <span class=\"solaris-radio__inner\" aria-hidden=\"true\"></span>\r\n </span>\r\n\r\n <span class=\"solaris-radio__content\">\r\n <ng-content/>\r\n </span>\r\n</label>\r\n", styles: [":host{--_size: 2rem;--_dot: .8rem;--_icon-dot: .55rem;--_text: var(--solaris-color-text);--_radius: var(--solaris-radius-full);--_border: var(--solaris-color-border);--solaris-radio-border: var(--_border);--_muted: var(--solaris-color-text-muted);--solaris-radio-accent: var(--solaris-color-primary);--solaris-radio-on-accent: var(--solaris-color-primary-contrast, #fff);--solaris-radio-soft-fill: color-mix(in srgb, var(--solaris-radio-accent) 12%, transparent);display:inline-flex}:host([data-size=sm]){--_dot: .7rem;--_size: 1.8rem;--_icon-dot: .5rem}:host([data-size=md]){--_size: 2rem;--_dot: .8rem;--_icon-dot: .55rem}:host([data-size=lg]){--_size: 2.4rem;--_dot: .95rem;--_icon-dot: .65rem}:host([data-color=primary]){--solaris-radio-accent: var(--solaris-color-primary)}:host([data-color=success]){--solaris-radio-accent: var(--solaris-color-success)}:host([data-color=warning]){--solaris-radio-accent: var(--solaris-color-warning)}:host([data-color=error]){--solaris-radio-accent: var(--solaris-color-error)}:host([data-color=info]){--solaris-radio-accent: var(--solaris-color-info)}:host([data-color=custom]){--solaris-radio-accent: var(--solaris-radio-custom, var(--solaris-color-primary))}.solaris-radio{gap:.8rem;cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;color:var(--_text);display:inline-flex}.solaris-radio__native{opacity:0;width:1px;height:1px;position:absolute;pointer-events:none}.solaris-radio__control{flex:0 0 auto;width:var(--_size);height:var(--_size);display:grid;place-items:center;box-sizing:border-box;background:transparent;border-radius:var(--_radius);border:.1rem solid var(--solaris-radio-border)}.solaris-radio__content{gap:.2rem;line-height:1.3;display:inline-flex;flex-direction:column;justify-content:center;min-height:var(--_size)}.solaris-radio__inner{opacity:0;width:var(--_dot);height:var(--_dot);transform:scale(.4);background:var(--solaris-radio-accent);border-radius:var(--solaris-radius-full);transition:opacity .15s ease,transform .15s ease,background-color .15s ease}.solaris-radio:hover .solaris-radio__control{border-color:color-mix(in srgb,var(--solaris-radio-accent) 36%,var(--solaris-radio-border))}.solaris-radio__native:focus-visible+.solaris-radio__control{outline-offset:.2rem;outline:.2rem solid var(--solaris-radio-accent)}.solaris-radio__native:active+.solaris-radio__control{transform:scale(.98)}.solaris-radio__native:checked+.solaris-radio__control{border-color:var(--solaris-radio-accent)}.solaris-radio__native:checked+.solaris-radio__control .solaris-radio__inner{opacity:1;transform:scale(1)}:host([data-variant=dot][data-appearance=outline]) .solaris-radio__native:checked+.solaris-radio__control{background:transparent}:host([data-variant=dot][data-appearance=solid]) .solaris-radio__native:checked+.solaris-radio__control{background:var(--solaris-radio-soft-fill)}:host([data-variant=icon]) .solaris-radio__control{padding:.25rem;background-clip:content-box}:host([data-variant=icon]) .solaris-radio__inner{width:var(--_icon-dot);height:var(--_icon-dot)}:host([data-variant=icon][data-appearance=solid]) .solaris-radio__native:checked+.solaris-radio__control{background:var(--solaris-radio-accent)}:host([data-variant=icon][data-appearance=solid]) .solaris-radio__native:checked+.solaris-radio__control .solaris-radio__inner{background:var(--solaris-radio-on-accent)}:host([data-variant=icon][data-appearance=outline]) .solaris-radio__native:checked+.solaris-radio__control{background:transparent}:host([data-variant=icon][data-appearance=outline]) .solaris-radio__native:checked+.solaris-radio__control .solaris-radio__inner{background:var(--solaris-radio-accent)}:host([data-disabled=true]) .solaris-radio{opacity:.55;cursor:not-allowed}:host([data-disabled=true]) .solaris-radio__control{border-color:color-mix(in srgb,var(--_border) 70%,transparent)}\n"] }]
|
|
4882
|
+
}], ctorParameters: () => [], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], inputName: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], checkedInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }], native: [{
|
|
4883
|
+
type: ViewChild,
|
|
4884
|
+
args: ['native', { static: true }]
|
|
4885
|
+
}] } });
|
|
4886
|
+
|
|
4887
|
+
class SolarisRadioGroup {
|
|
4888
|
+
gap = input('md', ...(ngDevMode ? [{ debugName: "gap" }] : []));
|
|
4889
|
+
compareWith = input(Object.is, ...(ngDevMode ? [{ debugName: "compareWith" }] : []));
|
|
4890
|
+
nameInput = input(null, { ...(ngDevMode ? { debugName: "nameInput" } : {}), alias: 'name' });
|
|
4891
|
+
disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : {}), alias: 'disabled' });
|
|
4892
|
+
orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
4893
|
+
ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : {}), alias: 'aria-label' });
|
|
4894
|
+
valueChange = output();
|
|
4895
|
+
radiosQuery;
|
|
4896
|
+
destroyRef = inject(DestroyRef);
|
|
4897
|
+
autoName = uniqueId('solaris-radio-group');
|
|
4898
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
4899
|
+
internalValue = signal(null, ...(ngDevMode ? [{ debugName: "internalValue" }] : []));
|
|
4900
|
+
radiosVersion = signal(0, ...(ngDevMode ? [{ debugName: "radiosVersion" }] : []));
|
|
4901
|
+
name = computed(() => this.nameInput() ?? this.autoName, ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
4902
|
+
disabled = computed(() => this.disabledInput() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
4903
|
+
resolvedGap = computed(() => {
|
|
4904
|
+
const value = String(this.gap() ?? 'md').trim();
|
|
4905
|
+
switch (value) {
|
|
4906
|
+
case 'sm':
|
|
4907
|
+
return 'var(--solaris-space-2)';
|
|
4908
|
+
case 'md':
|
|
4909
|
+
return 'var(--solaris-space-3)';
|
|
4910
|
+
case 'lg':
|
|
4911
|
+
return 'var(--solaris-space-4)';
|
|
4912
|
+
default:
|
|
4913
|
+
return value;
|
|
4914
|
+
}
|
|
4915
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedGap" }] : []));
|
|
4916
|
+
onChange = () => { };
|
|
4917
|
+
onTouched = () => { };
|
|
4918
|
+
ngAfterContentInit() {
|
|
4919
|
+
this.bumpRadiosVersion();
|
|
4920
|
+
this.radiosQuery?.changes
|
|
4921
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
4922
|
+
.subscribe(() => this.bumpRadiosVersion());
|
|
4923
|
+
}
|
|
4924
|
+
isSelected(value) {
|
|
4925
|
+
return this.compareWith()(this.internalValue(), value);
|
|
4926
|
+
}
|
|
4927
|
+
select(radio) {
|
|
4928
|
+
if (this.disabled() || radio.disabled())
|
|
4929
|
+
return;
|
|
4930
|
+
const nextValue = radio.value();
|
|
4931
|
+
if (!this.isSelected(nextValue)) {
|
|
4932
|
+
this.internalValue.set(nextValue);
|
|
4933
|
+
this.onChange(nextValue);
|
|
4934
|
+
this.valueChange.emit(nextValue);
|
|
4935
|
+
}
|
|
4936
|
+
this.onTouched();
|
|
4937
|
+
this.bumpRadiosVersion();
|
|
4938
|
+
}
|
|
4939
|
+
tabIndexFor(radio) {
|
|
4940
|
+
this.radiosVersion();
|
|
4941
|
+
if (this.disabled() || radio.disabled())
|
|
4942
|
+
return -1;
|
|
4943
|
+
const enabled = this.enabledRadios();
|
|
4944
|
+
if (!enabled.length)
|
|
4945
|
+
return -1;
|
|
4946
|
+
const selected = enabled.find(item => this.isSelected(item.value()));
|
|
4947
|
+
const target = selected ?? enabled[0];
|
|
4948
|
+
return target === radio ? 0 : -1;
|
|
4949
|
+
}
|
|
4950
|
+
handleKeydown(event, current) {
|
|
4951
|
+
if (this.disabled())
|
|
4952
|
+
return;
|
|
4953
|
+
switch (event.key) {
|
|
4954
|
+
case 'ArrowRight':
|
|
4955
|
+
case 'ArrowDown':
|
|
4956
|
+
event.preventDefault();
|
|
4957
|
+
this.move(current, +1);
|
|
4958
|
+
break;
|
|
4959
|
+
case 'ArrowLeft':
|
|
4960
|
+
case 'ArrowUp':
|
|
4961
|
+
event.preventDefault();
|
|
4962
|
+
this.move(current, -1);
|
|
4963
|
+
break;
|
|
4964
|
+
case ' ':
|
|
4965
|
+
case 'Enter':
|
|
4966
|
+
event.preventDefault();
|
|
4967
|
+
this.select(current);
|
|
4968
|
+
break;
|
|
4969
|
+
default:
|
|
4970
|
+
break;
|
|
4971
|
+
}
|
|
4972
|
+
}
|
|
4973
|
+
notifyTouched() {
|
|
4974
|
+
this.onTouched();
|
|
4975
|
+
}
|
|
4976
|
+
writeValue(value) {
|
|
4977
|
+
this.internalValue.set(value);
|
|
4978
|
+
this.bumpRadiosVersion();
|
|
4979
|
+
}
|
|
4980
|
+
registerOnTouched(fn) {
|
|
4981
|
+
this.onTouched = fn;
|
|
4982
|
+
}
|
|
4983
|
+
setDisabledState(isDisabled) {
|
|
4984
|
+
this.cvaDisabled.set(isDisabled);
|
|
4985
|
+
this.bumpRadiosVersion();
|
|
4986
|
+
}
|
|
4987
|
+
registerOnChange(fn) {
|
|
4988
|
+
this.onChange = fn;
|
|
4989
|
+
}
|
|
4990
|
+
move(current, direction) {
|
|
4991
|
+
const enabled = this.enabledRadios();
|
|
4992
|
+
if (!enabled.length)
|
|
4993
|
+
return;
|
|
4994
|
+
const currentIndex = enabled.indexOf(current);
|
|
4995
|
+
const startIndex = Math.max(currentIndex, 0);
|
|
4996
|
+
const nextIndex = (startIndex + direction + enabled.length) % enabled.length;
|
|
4997
|
+
const next = enabled[nextIndex];
|
|
4998
|
+
this.select(next);
|
|
4999
|
+
next.focus();
|
|
5000
|
+
}
|
|
5001
|
+
enabledRadios() {
|
|
5002
|
+
this.radiosVersion();
|
|
5003
|
+
return (this.radiosQuery?.toArray() ?? []).filter(radio => !radio.disabled());
|
|
5004
|
+
}
|
|
5005
|
+
bumpRadiosVersion() {
|
|
5006
|
+
this.radiosVersion.update(value => value + 1);
|
|
5007
|
+
}
|
|
5008
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisRadioGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5009
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.1", type: SolarisRadioGroup, isStandalone: true, selector: "solaris-radio-group", inputs: { gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, nameInput: { classPropertyName: "nameInput", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { attributes: { "role": "radiogroup" }, properties: { "attr.data-orientation": "orientation()", "attr.aria-disabled": "disabled() ? \"true\" : null", "attr.aria-label": "ariaLabel() ?? null", "attr.aria-orientation": "orientation()", "style.--solaris-radio-group-gap": "resolvedGap()" }, classAttribute: "solaris-radio-group-host" }, providers: [
|
|
5010
|
+
{
|
|
5011
|
+
provide: NG_VALUE_ACCESSOR,
|
|
5012
|
+
useExisting: forwardRef(() => SolarisRadioGroup),
|
|
5013
|
+
multi: true,
|
|
5014
|
+
},
|
|
5015
|
+
{
|
|
5016
|
+
provide: SOLARIS_RADIO_GROUP,
|
|
5017
|
+
useExisting: forwardRef(() => SolarisRadioGroup),
|
|
5018
|
+
},
|
|
5019
|
+
], queries: [{ propertyName: "radiosQuery", predicate: i0.forwardRef(() => SolarisRadio), descendants: true }], ngImport: i0, template: "<ng-content/>\r\n", styles: [":host.solaris-radio-group-host{display:inline-flex;flex-direction:column;gap:var(--solaris-radio-group-gap, var(--solaris-space-3))}:host.solaris-radio-group-host[data-orientation=horizontal]{flex-wrap:wrap;flex-direction:row;align-items:flex-start}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5020
|
+
}
|
|
5021
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisRadioGroup, decorators: [{
|
|
5022
|
+
type: Component,
|
|
5023
|
+
args: [{ selector: 'solaris-radio-group', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
5024
|
+
{
|
|
5025
|
+
provide: NG_VALUE_ACCESSOR,
|
|
5026
|
+
useExisting: forwardRef(() => SolarisRadioGroup),
|
|
5027
|
+
multi: true,
|
|
5028
|
+
},
|
|
5029
|
+
{
|
|
5030
|
+
provide: SOLARIS_RADIO_GROUP,
|
|
5031
|
+
useExisting: forwardRef(() => SolarisRadioGroup),
|
|
5032
|
+
},
|
|
5033
|
+
], host: {
|
|
5034
|
+
class: 'solaris-radio-group-host',
|
|
5035
|
+
role: 'radiogroup',
|
|
5036
|
+
'[attr.data-orientation]': 'orientation()',
|
|
5037
|
+
'[attr.aria-disabled]': 'disabled() ? "true" : null',
|
|
5038
|
+
'[attr.aria-label]': 'ariaLabel() ?? null',
|
|
5039
|
+
'[attr.aria-orientation]': 'orientation()',
|
|
5040
|
+
'[style.--solaris-radio-group-gap]': 'resolvedGap()',
|
|
5041
|
+
}, template: "<ng-content/>\r\n", styles: [":host.solaris-radio-group-host{display:inline-flex;flex-direction:column;gap:var(--solaris-radio-group-gap, var(--solaris-space-3))}:host.solaris-radio-group-host[data-orientation=horizontal]{flex-wrap:wrap;flex-direction:row;align-items:flex-start}\n"] }]
|
|
5042
|
+
}], propDecorators: { gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], compareWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "compareWith", required: false }] }], nameInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], radiosQuery: [{
|
|
5043
|
+
type: ContentChildren,
|
|
5044
|
+
args: [forwardRef(() => SolarisRadio), { descendants: true }]
|
|
5045
|
+
}] } });
|
|
5046
|
+
|
|
5047
|
+
const SOLARIS_CARD_GROUP = new InjectionToken('SOLARIS_CARD_GROUP');
|
|
5048
|
+
|
|
5049
|
+
class SolarisCard {
|
|
5050
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
5051
|
+
orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
5052
|
+
radius = input(null, ...(ngDevMode ? [{ debugName: "radius" }] : []));
|
|
5053
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
5054
|
+
interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : {}), transform: booleanAttribute });
|
|
5055
|
+
resolvedRadius = computed(() => resolveRadius(this.radius()), ...(ngDevMode ? [{ debugName: "resolvedRadius" }] : []));
|
|
5056
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5057
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.1", type: SolarisCard, isStandalone: true, selector: "solaris-card", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-size": "size()", "attr.data-orientation": "orientation()", "attr.data-interactive": "interactive() ? \"true\" : null", "attr.data-disabled": "disabled() ? \"true\" : null", "attr.aria-disabled": "disabled() ? \"true\" : null", "style.--solaris-card-radius": "resolvedRadius()" }, classAttribute: "solaris-card-host" }, ngImport: i0, template: "<article class=\"solaris-card\">\r\n <div class=\"solaris-card__media\">\r\n <ng-content select=\"[solaris-card-media]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"solaris-card__content\">\r\n <div class=\"solaris-card__header\">\r\n <div class=\"solaris-card__header-main\">\r\n <div class=\"solaris-card__eyebrow\">\r\n <ng-content select=\"[solaris-card-eyebrow]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"solaris-card__title\">\r\n <ng-content select=\"[solaris-card-title]\"></ng-content>\r\n </div>\r\n </div>\r\n\r\n <div class=\"solaris-card__badge\">\r\n <ng-content select=\"[solaris-card-badge]\"></ng-content>\r\n </div>\r\n </div>\r\n\r\n <div class=\"solaris-card__description\">\r\n <ng-content select=\"[solaris-card-description]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"solaris-card__meta\">\r\n <ng-content select=\"[solaris-card-meta]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"solaris-card__footer\">\r\n <div class=\"solaris-card__footer-main\">\r\n <ng-content select=\"[solaris-card-footer]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"solaris-card__actions\">\r\n <ng-content select=\"[solaris-card-actions]\"></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n</article>\r\n", styles: [":host{display:block;--solaris-card-bg: var(--solaris-color-surface);--solaris-card-bg-hover: color-mix(in srgb, var(--solaris-card-bg) 92%, white);--solaris-card-border: var(--solaris-color-border);--solaris-card-border-hover: color-mix(in srgb, var(--solaris-color-primary) 18%, var(--solaris-card-border));--solaris-card-shadow: var(--solaris-shadow-xs);--solaris-card-shadow-hover: var(--solaris-shadow-sm);--solaris-card-title-color: var(--solaris-color-text);--solaris-card-description-color: var(--solaris-color-text-muted);--solaris-card-meta-color: var(--solaris-color-text);--solaris-card-eyebrow-color: var(--solaris-color-text-muted);--solaris-card-disabled-opacity: .62;--solaris-card-gap: var(--solaris-space-4);--solaris-card-padding-x: var(--solaris-space-5);--solaris-card-padding-y: var(--solaris-space-5);--solaris-card-content-gap: var(--solaris-space-3);--solaris-card-padding-top: var(--solaris-card-padding-y);--solaris-card-padding-left: var(--solaris-card-padding-x);--solaris-card-padding-right: var(--solaris-card-padding-x);--solaris-card-padding-bottom: var(--solaris-card-padding-y);--solaris-card-media-size: 7.2rem;--solaris-card-radius: var(--solaris-radius-lg)}:host([data-size=sm]){--solaris-card-padding-x: var(--solaris-space-4);--solaris-card-padding-y: var(--solaris-space-4);--solaris-card-gap: var(--solaris-space-3);--solaris-card-content-gap: var(--solaris-space-2);--solaris-card-media-size: 5.6rem}:host([data-size=md]){--solaris-card-padding-x: var(--solaris-space-5);--solaris-card-padding-y: var(--solaris-space-5);--solaris-card-gap: var(--solaris-space-4);--solaris-card-content-gap: var(--solaris-space-3);--solaris-card-media-size: 7.2rem}:host([data-size=lg]){--solaris-card-padding-x: var(--solaris-space-6);--solaris-card-padding-y: var(--solaris-space-6);--solaris-card-gap: var(--solaris-space-5);--solaris-card-content-gap: var(--solaris-space-4);--solaris-card-media-size: 8.8rem}.solaris-card{min-width:0;width:100%;display:flex;flex-direction:column;box-sizing:border-box;gap:var(--solaris-card-gap);color:var(--solaris-color-text);background:var(--solaris-card-bg);box-shadow:var(--solaris-card-shadow);border-radius:var(--solaris-card-radius);border:1px solid var(--solaris-card-border);padding:var(--solaris-card-padding-top) var(--solaris-card-padding-right) var(--solaris-card-padding-bottom) var(--solaris-card-padding-left)}:host([data-interactive=true]:not([data-disabled=true])) .solaris-card{cursor:pointer;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease,transform .12s ease}:host([data-interactive=true]:not([data-disabled=true])) .solaris-card:hover{background:var(--solaris-card-bg-hover);box-shadow:var(--solaris-card-shadow-hover);border-color:var(--solaris-card-border-hover)}:host([data-disabled=true]) .solaris-card{box-shadow:none;opacity:var(--solaris-card-disabled-opacity)}.solaris-card__media{min-width:0;overflow:hidden;border-radius:calc(var(--solaris-card-radius) - .2rem)}.solaris-card__content{min-width:0;display:flex;flex:1 1 auto;flex-direction:column;gap:var(--solaris-card-content-gap)}.solaris-card__header{min-width:0;display:flex;align-items:flex-start;justify-content:space-between;gap:var(--solaris-space-3)}.solaris-card__header-main{min-width:0;flex:1 1 auto;display:flex;flex-direction:column;gap:var(--solaris-space-2)}.solaris-card__eyebrow{color:var(--solaris-card-eyebrow-color);line-height:var(--solaris-lh-normal);letter-spacing:var(--solaris-ls-md);font-size:var(--solaris-fs-12);text-transform:uppercase}.solaris-card__title{min-width:0;color:var(--solaris-card-title-color);line-height:var(--solaris-lh-tight);font-size:var(--solaris-fs-16);font-weight:700}.solaris-card__description{color:var(--solaris-card-description-color);line-height:var(--solaris-lh-normal);font-size:var(--solaris-fs-14)}.solaris-card__meta{color:var(--solaris-card-meta-color);line-height:var(--solaris-lh-normal);font-size:var(--solaris-fs-14);font-weight:600}.solaris-card__badge{flex:0 0 auto;display:inline-flex;align-items:flex-start}.solaris-card__footer{min-width:0;display:flex;align-items:center;justify-content:space-between;gap:var(--solaris-space-3)}.solaris-card__footer-main{min-width:0;flex:1 1 auto}.solaris-card__actions{flex:0 0 auto;display:inline-flex;flex-wrap:wrap;gap:var(--solaris-space-2);align-items:center;justify-content:flex-end}:host([data-orientation=horizontal]) .solaris-card{flex-direction:row;align-items:stretch}:host([data-orientation=horizontal]) .solaris-card__media{flex:0 0 min(32%,var(--solaris-card-media-size));width:min(32%,var(--solaris-card-media-size))}:host([data-orientation=horizontal]) .solaris-card__content{justify-content:center}:host([data-orientation=compact]) .solaris-card{flex-direction:row;align-items:center;gap:var(--solaris-space-3)}:host([data-orientation=compact]) .solaris-card__media{flex:0 0 auto;width:var(--solaris-card-media-size)}:host([data-orientation=compact]) .solaris-card__content{gap:var(--solaris-space-2)}:host([data-orientation=compact]) .solaris-card__footer{margin-top:var(--solaris-space-1)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5058
|
+
}
|
|
5059
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCard, decorators: [{
|
|
5060
|
+
type: Component,
|
|
5061
|
+
args: [{ selector: 'solaris-card', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
5062
|
+
class: 'solaris-card-host',
|
|
5063
|
+
'[attr.data-size]': 'size()',
|
|
5064
|
+
'[attr.data-orientation]': 'orientation()',
|
|
5065
|
+
'[attr.data-interactive]': 'interactive() ? "true" : null',
|
|
5066
|
+
'[attr.data-disabled]': 'disabled() ? "true" : null',
|
|
5067
|
+
'[attr.aria-disabled]': 'disabled() ? "true" : null',
|
|
5068
|
+
'[style.--solaris-card-radius]': 'resolvedRadius()',
|
|
5069
|
+
}, template: "<article class=\"solaris-card\">\r\n <div class=\"solaris-card__media\">\r\n <ng-content select=\"[solaris-card-media]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"solaris-card__content\">\r\n <div class=\"solaris-card__header\">\r\n <div class=\"solaris-card__header-main\">\r\n <div class=\"solaris-card__eyebrow\">\r\n <ng-content select=\"[solaris-card-eyebrow]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"solaris-card__title\">\r\n <ng-content select=\"[solaris-card-title]\"></ng-content>\r\n </div>\r\n </div>\r\n\r\n <div class=\"solaris-card__badge\">\r\n <ng-content select=\"[solaris-card-badge]\"></ng-content>\r\n </div>\r\n </div>\r\n\r\n <div class=\"solaris-card__description\">\r\n <ng-content select=\"[solaris-card-description]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"solaris-card__meta\">\r\n <ng-content select=\"[solaris-card-meta]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"solaris-card__footer\">\r\n <div class=\"solaris-card__footer-main\">\r\n <ng-content select=\"[solaris-card-footer]\"></ng-content>\r\n </div>\r\n\r\n <div class=\"solaris-card__actions\">\r\n <ng-content select=\"[solaris-card-actions]\"></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n</article>\r\n", styles: [":host{display:block;--solaris-card-bg: var(--solaris-color-surface);--solaris-card-bg-hover: color-mix(in srgb, var(--solaris-card-bg) 92%, white);--solaris-card-border: var(--solaris-color-border);--solaris-card-border-hover: color-mix(in srgb, var(--solaris-color-primary) 18%, var(--solaris-card-border));--solaris-card-shadow: var(--solaris-shadow-xs);--solaris-card-shadow-hover: var(--solaris-shadow-sm);--solaris-card-title-color: var(--solaris-color-text);--solaris-card-description-color: var(--solaris-color-text-muted);--solaris-card-meta-color: var(--solaris-color-text);--solaris-card-eyebrow-color: var(--solaris-color-text-muted);--solaris-card-disabled-opacity: .62;--solaris-card-gap: var(--solaris-space-4);--solaris-card-padding-x: var(--solaris-space-5);--solaris-card-padding-y: var(--solaris-space-5);--solaris-card-content-gap: var(--solaris-space-3);--solaris-card-padding-top: var(--solaris-card-padding-y);--solaris-card-padding-left: var(--solaris-card-padding-x);--solaris-card-padding-right: var(--solaris-card-padding-x);--solaris-card-padding-bottom: var(--solaris-card-padding-y);--solaris-card-media-size: 7.2rem;--solaris-card-radius: var(--solaris-radius-lg)}:host([data-size=sm]){--solaris-card-padding-x: var(--solaris-space-4);--solaris-card-padding-y: var(--solaris-space-4);--solaris-card-gap: var(--solaris-space-3);--solaris-card-content-gap: var(--solaris-space-2);--solaris-card-media-size: 5.6rem}:host([data-size=md]){--solaris-card-padding-x: var(--solaris-space-5);--solaris-card-padding-y: var(--solaris-space-5);--solaris-card-gap: var(--solaris-space-4);--solaris-card-content-gap: var(--solaris-space-3);--solaris-card-media-size: 7.2rem}:host([data-size=lg]){--solaris-card-padding-x: var(--solaris-space-6);--solaris-card-padding-y: var(--solaris-space-6);--solaris-card-gap: var(--solaris-space-5);--solaris-card-content-gap: var(--solaris-space-4);--solaris-card-media-size: 8.8rem}.solaris-card{min-width:0;width:100%;display:flex;flex-direction:column;box-sizing:border-box;gap:var(--solaris-card-gap);color:var(--solaris-color-text);background:var(--solaris-card-bg);box-shadow:var(--solaris-card-shadow);border-radius:var(--solaris-card-radius);border:1px solid var(--solaris-card-border);padding:var(--solaris-card-padding-top) var(--solaris-card-padding-right) var(--solaris-card-padding-bottom) var(--solaris-card-padding-left)}:host([data-interactive=true]:not([data-disabled=true])) .solaris-card{cursor:pointer;transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease,transform .12s ease}:host([data-interactive=true]:not([data-disabled=true])) .solaris-card:hover{background:var(--solaris-card-bg-hover);box-shadow:var(--solaris-card-shadow-hover);border-color:var(--solaris-card-border-hover)}:host([data-disabled=true]) .solaris-card{box-shadow:none;opacity:var(--solaris-card-disabled-opacity)}.solaris-card__media{min-width:0;overflow:hidden;border-radius:calc(var(--solaris-card-radius) - .2rem)}.solaris-card__content{min-width:0;display:flex;flex:1 1 auto;flex-direction:column;gap:var(--solaris-card-content-gap)}.solaris-card__header{min-width:0;display:flex;align-items:flex-start;justify-content:space-between;gap:var(--solaris-space-3)}.solaris-card__header-main{min-width:0;flex:1 1 auto;display:flex;flex-direction:column;gap:var(--solaris-space-2)}.solaris-card__eyebrow{color:var(--solaris-card-eyebrow-color);line-height:var(--solaris-lh-normal);letter-spacing:var(--solaris-ls-md);font-size:var(--solaris-fs-12);text-transform:uppercase}.solaris-card__title{min-width:0;color:var(--solaris-card-title-color);line-height:var(--solaris-lh-tight);font-size:var(--solaris-fs-16);font-weight:700}.solaris-card__description{color:var(--solaris-card-description-color);line-height:var(--solaris-lh-normal);font-size:var(--solaris-fs-14)}.solaris-card__meta{color:var(--solaris-card-meta-color);line-height:var(--solaris-lh-normal);font-size:var(--solaris-fs-14);font-weight:600}.solaris-card__badge{flex:0 0 auto;display:inline-flex;align-items:flex-start}.solaris-card__footer{min-width:0;display:flex;align-items:center;justify-content:space-between;gap:var(--solaris-space-3)}.solaris-card__footer-main{min-width:0;flex:1 1 auto}.solaris-card__actions{flex:0 0 auto;display:inline-flex;flex-wrap:wrap;gap:var(--solaris-space-2);align-items:center;justify-content:flex-end}:host([data-orientation=horizontal]) .solaris-card{flex-direction:row;align-items:stretch}:host([data-orientation=horizontal]) .solaris-card__media{flex:0 0 min(32%,var(--solaris-card-media-size));width:min(32%,var(--solaris-card-media-size))}:host([data-orientation=horizontal]) .solaris-card__content{justify-content:center}:host([data-orientation=compact]) .solaris-card{flex-direction:row;align-items:center;gap:var(--solaris-space-3)}:host([data-orientation=compact]) .solaris-card__media{flex:0 0 auto;width:var(--solaris-card-media-size)}:host([data-orientation=compact]) .solaris-card__content{gap:var(--solaris-space-2)}:host([data-orientation=compact]) .solaris-card__footer{margin-top:var(--solaris-space-1)}\n"] }]
|
|
5070
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }] } });
|
|
5071
|
+
function resolveRadius(v) {
|
|
5072
|
+
const value = v == null || String(v).trim() === '' ? null : String(v).trim();
|
|
5073
|
+
if (!value)
|
|
5074
|
+
return null;
|
|
5075
|
+
switch (value) {
|
|
5076
|
+
case 'none':
|
|
5077
|
+
return '0';
|
|
5078
|
+
case 'sm':
|
|
5079
|
+
return 'var(--solaris-radius-sm)';
|
|
5080
|
+
case 'md':
|
|
5081
|
+
return 'var(--solaris-radius-md, var(--solaris-radius-sm))';
|
|
5082
|
+
case 'lg':
|
|
5083
|
+
return 'var(--solaris-radius-lg, var(--solaris-radius-md, var(--solaris-radius-sm)))';
|
|
5084
|
+
case 'full':
|
|
5085
|
+
return 'var(--solaris-radius-full)';
|
|
5086
|
+
default:
|
|
5087
|
+
return value;
|
|
5088
|
+
}
|
|
5089
|
+
}
|
|
5090
|
+
|
|
5091
|
+
const PRESET_COLORS = new Set([
|
|
5092
|
+
'primary',
|
|
5093
|
+
'success',
|
|
5094
|
+
'warning',
|
|
5095
|
+
'error',
|
|
5096
|
+
'info',
|
|
5097
|
+
]);
|
|
5098
|
+
class SolarisSelectionCard {
|
|
5099
|
+
value = input(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
5100
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
5101
|
+
color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
5102
|
+
orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
5103
|
+
radius = input(null, ...(ngDevMode ? [{ debugName: "radius" }] : []));
|
|
5104
|
+
appearance = input('outline', ...(ngDevMode ? [{ debugName: "appearance" }] : []));
|
|
5105
|
+
selectionIndicator = input('auto', ...(ngDevMode ? [{ debugName: "selectionIndicator" }] : []));
|
|
5106
|
+
invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : {}), transform: booleanAttribute });
|
|
5107
|
+
disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : {}), alias: 'disabled', transform: booleanAttribute });
|
|
5108
|
+
selectedInput = input(false, { ...(ngDevMode ? { debugName: "selectedInput" } : {}), alias: 'selected', transform: booleanAttribute });
|
|
5109
|
+
selectedChange = output();
|
|
5110
|
+
cardClick = output();
|
|
5111
|
+
elementRef = inject((ElementRef));
|
|
5112
|
+
group = inject(SOLARIS_CARD_GROUP, { optional: true });
|
|
5113
|
+
localSelected = signal(false, ...(ngDevMode ? [{ debugName: "localSelected" }] : []));
|
|
5114
|
+
disabled = computed(() => {
|
|
5115
|
+
return !!this.group?.disabled() || this.disabledInput();
|
|
5116
|
+
}, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
5117
|
+
selected = computed(() => {
|
|
5118
|
+
if (this.group)
|
|
5119
|
+
return this.group.isSelected(this.value());
|
|
5120
|
+
return this.localSelected();
|
|
5121
|
+
}, ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
5122
|
+
resolvedMode = computed(() => {
|
|
5123
|
+
if (this.group)
|
|
5124
|
+
return this.group.selectionMode();
|
|
5125
|
+
return inferStandaloneMode(this.selectionIndicator());
|
|
5126
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedMode" }] : []));
|
|
5127
|
+
onHostBlur() {
|
|
5128
|
+
this.group?.notifyTouched();
|
|
5129
|
+
}
|
|
5130
|
+
resolvedIndicator = computed(() => {
|
|
5131
|
+
const requested = this.selectionIndicator();
|
|
5132
|
+
if (requested !== 'auto')
|
|
5133
|
+
return requested;
|
|
5134
|
+
switch (this.resolvedMode()) {
|
|
5135
|
+
case 'single':
|
|
5136
|
+
return 'radio';
|
|
5137
|
+
case 'multiple':
|
|
5138
|
+
return 'checkbox';
|
|
5139
|
+
case 'none':
|
|
5140
|
+
default:
|
|
5141
|
+
return 'none';
|
|
5142
|
+
}
|
|
5143
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedIndicator" }] : []));
|
|
5144
|
+
tabIndex = computed(() => {
|
|
5145
|
+
if (this.disabled())
|
|
5146
|
+
return -1;
|
|
5147
|
+
if (this.group)
|
|
5148
|
+
return this.group.tabIndexFor(this);
|
|
5149
|
+
return 0;
|
|
5150
|
+
}, ...(ngDevMode ? [{ debugName: "tabIndex" }] : []));
|
|
5151
|
+
role = computed(() => {
|
|
5152
|
+
switch (this.resolvedMode()) {
|
|
5153
|
+
case 'single':
|
|
5154
|
+
return 'radio';
|
|
5155
|
+
case 'multiple':
|
|
5156
|
+
return 'checkbox';
|
|
5157
|
+
case 'none':
|
|
5158
|
+
default:
|
|
5159
|
+
return 'button';
|
|
5160
|
+
}
|
|
5161
|
+
}, ...(ngDevMode ? [{ debugName: "role" }] : []));
|
|
5162
|
+
ariaChecked = computed(() => {
|
|
5163
|
+
if (this.resolvedMode() === 'none')
|
|
5164
|
+
return null;
|
|
5165
|
+
return this.selected() ? 'true' : 'false';
|
|
5166
|
+
}, ...(ngDevMode ? [{ debugName: "ariaChecked" }] : []));
|
|
5167
|
+
customAccent = computed(() => {
|
|
5168
|
+
if (this.colorKey() !== 'custom')
|
|
5169
|
+
return null;
|
|
5170
|
+
const raw = String(this.color() ?? '').trim();
|
|
5171
|
+
return !raw || raw === 'custom' ? null : raw;
|
|
5172
|
+
}, ...(ngDevMode ? [{ debugName: "customAccent" }] : []));
|
|
5173
|
+
colorKey = computed(() => {
|
|
5174
|
+
const raw = String(this.color() ?? '').trim();
|
|
5175
|
+
if (!raw || raw === 'custom')
|
|
5176
|
+
return 'custom';
|
|
5177
|
+
return PRESET_COLORS.has(raw) ? raw : 'custom';
|
|
5178
|
+
}, ...(ngDevMode ? [{ debugName: "colorKey" }] : []));
|
|
5179
|
+
constructor() {
|
|
5180
|
+
effect(() => {
|
|
5181
|
+
if (this.group)
|
|
5182
|
+
return;
|
|
5183
|
+
this.localSelected.set(this.selectedInput());
|
|
5184
|
+
});
|
|
5185
|
+
}
|
|
5186
|
+
focus() {
|
|
5187
|
+
this.elementRef.nativeElement.focus();
|
|
5188
|
+
}
|
|
5189
|
+
onHostClick(event) {
|
|
5190
|
+
if (this.isActionZone(event.target))
|
|
5191
|
+
return;
|
|
5192
|
+
this.cardClick.emit(event);
|
|
5193
|
+
if (this.disabled())
|
|
5194
|
+
return;
|
|
5195
|
+
const previous = this.selected();
|
|
5196
|
+
if (this.group) {
|
|
5197
|
+
this.group.activate(this);
|
|
5198
|
+
if (previous !== this.selected())
|
|
5199
|
+
this.selectedChange.emit(this.selected());
|
|
5200
|
+
return;
|
|
5201
|
+
}
|
|
5202
|
+
const next = this.activateStandalone();
|
|
5203
|
+
if (next !== previous)
|
|
5204
|
+
this.selectedChange.emit(next);
|
|
5205
|
+
}
|
|
5206
|
+
onHostKeydown(event) {
|
|
5207
|
+
if (this.disabled())
|
|
5208
|
+
return;
|
|
5209
|
+
if (this.group) {
|
|
5210
|
+
this.group.handleKeydown(event, this);
|
|
5211
|
+
return;
|
|
5212
|
+
}
|
|
5213
|
+
if (event.key === ' ' || event.key === 'Enter') {
|
|
5214
|
+
event.preventDefault();
|
|
5215
|
+
const previous = this.selected();
|
|
5216
|
+
const next = this.activateStandalone();
|
|
5217
|
+
if (next !== previous)
|
|
5218
|
+
this.selectedChange.emit(next);
|
|
5219
|
+
}
|
|
5220
|
+
}
|
|
5221
|
+
activateStandalone() {
|
|
5222
|
+
switch (this.resolvedMode()) {
|
|
5223
|
+
case 'single':
|
|
5224
|
+
if (!this.localSelected())
|
|
5225
|
+
this.localSelected.set(true);
|
|
5226
|
+
return this.localSelected();
|
|
5227
|
+
case 'multiple':
|
|
5228
|
+
this.localSelected.update(value => !value);
|
|
5229
|
+
return this.localSelected();
|
|
5230
|
+
case 'none':
|
|
5231
|
+
default:
|
|
5232
|
+
return this.localSelected();
|
|
5233
|
+
}
|
|
5234
|
+
}
|
|
5235
|
+
isActionZone(target) {
|
|
5236
|
+
return target instanceof HTMLElement && !!target.closest('[data-card-actions="true"]');
|
|
5237
|
+
}
|
|
5238
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisSelectionCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5239
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisSelectionCard, isStandalone: true, selector: "solaris-selection-card", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, selectionIndicator: { classPropertyName: "selectionIndicator", publicName: "selectionIndicator", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, selectedInput: { classPropertyName: "selectedInput", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedChange: "selectedChange", cardClick: "cardClick" }, host: { listeners: { "click": "onHostClick($event)", "keydown": "onHostKeydown($event)", "blur": "onHostBlur()" }, properties: { "attr.data-size": "size()", "attr.data-orientation": "orientation()", "attr.data-selected": "selected() ? \"true\" : null", "attr.data-disabled": "disabled() ? \"true\" : null", "attr.data-invalid": "invalid() ? \"true\" : null", "attr.data-appearance": "appearance()", "attr.data-color": "colorKey()", "attr.data-indicator": "resolvedIndicator()", "attr.role": "role()", "attr.aria-checked": "ariaChecked()", "attr.aria-disabled": "disabled() ? \"true\" : null", "attr.tabindex": "tabIndex()", "style.--solaris-selection-card-custom": "customAccent()" }, classAttribute: "solaris-selection-card-host" }, ngImport: i0, template: "<div class=\"solaris-selection-card\">\r\n @if (resolvedIndicator() !== 'none') {\r\n <span class=\"solaris-selection-card__indicator\" aria-hidden=\"true\">\r\n <span class=\"solaris-selection-card__indicator-control\">\r\n @switch (resolvedIndicator()) {\r\n @case ('radio') {\r\n <span class=\"solaris-selection-card__indicator-dot\"></span>\r\n }\r\n @case ('checkbox') {\r\n <i class=\"ph ph-check solaris-selection-card__indicator-check\"></i>\r\n }\r\n @case ('icon') {\r\n <span class=\"solaris-selection-card__indicator-icon-dot\"></span>\r\n }\r\n }\r\n </span>\r\n </span>\r\n }\r\n\r\n <solaris-card\r\n class=\"solaris-selection-card__card\"\r\n [orientation]=\"orientation()\"\r\n [size]=\"size()\"\r\n [radius]=\"radius()\"\r\n [interactive]=\"!disabled()\"\r\n [disabled]=\"disabled()\">\r\n\r\n <div ngProjectAs=\"[solaris-card-media]\">\r\n <ng-content select=\"[solaris-card-media]\"></ng-content>\r\n </div>\r\n\r\n <div ngProjectAs=\"[solaris-card-eyebrow]\">\r\n <ng-content select=\"[solaris-card-eyebrow]\"></ng-content>\r\n </div>\r\n\r\n <div ngProjectAs=\"[solaris-card-title]\">\r\n <ng-content select=\"[solaris-card-title]\"></ng-content>\r\n </div>\r\n\r\n <div ngProjectAs=\"[solaris-card-description]\">\r\n <ng-content select=\"[solaris-card-description]\"></ng-content>\r\n </div>\r\n\r\n <div ngProjectAs=\"[solaris-card-meta]\">\r\n <ng-content select=\"[solaris-card-meta]\"></ng-content>\r\n </div>\r\n\r\n <div ngProjectAs=\"[solaris-card-badge]\">\r\n <ng-content select=\"[solaris-card-badge]\"></ng-content>\r\n </div>\r\n\r\n <div ngProjectAs=\"[solaris-card-footer]\">\r\n <ng-content select=\"[solaris-card-footer]\"></ng-content>\r\n </div>\r\n\r\n <div ngProjectAs=\"[solaris-card-actions]\">\r\n <ng-content select=\"[solaris-card-actions]\"></ng-content>\r\n </div>\r\n\r\n </solaris-card>\r\n</div>\r\n", styles: [":host{display:block;min-width:0;position:relative;outline:none;cursor:pointer;--ssc-accent: var(--solaris-color-primary);--ssc-bg: var(--solaris-color-surface);--ssc-bg-hover: color-mix(in srgb, var(--ssc-bg) 94%, white);--ssc-bg-selected: color-mix(in srgb, var(--ssc-accent) 8%, var(--solaris-color-surface));--ssc-border: var(--solaris-color-border);--ssc-border-hover: color-mix(in srgb, var(--ssc-accent) 20%, var(--ssc-border));--ssc-border-selected: color-mix(in srgb, var(--ssc-accent) 72%, var(--ssc-border));--ssc-border-invalid: var(--solaris-color-error);--ssc-shadow: var(--solaris-shadow-xs);--ssc-shadow-hover: var(--solaris-shadow-sm);--ssc-shadow-selected: var(--solaris-shadow-sm);--ssc-focus-ring: color-mix(in srgb, var(--ssc-accent) 26%, transparent);--ssc-indicator-size: 2rem;--ssc-indicator-check-size: 1rem;--ssc-indicator-dot-size: .8rem;--ssc-indicator-icon-dot-size: .55rem;--ssc-indicator-gap: var(--solaris-space-3);--ssc-pad-x: var(--solaris-space-6);--ssc-pad-y: var(--solaris-space-5);--ssc-pad-top: var(--ssc-pad-y);--ssc-pad-right: calc(var(--ssc-pad-x) + var(--ssc-indicator-size) + var(--ssc-indicator-gap));--ssc-pad-bottom: var(--ssc-pad-y);--ssc-pad-left: var(--ssc-pad-x);--ssc-indicator-top: var(--ssc-pad-y);--ssc-indicator-end: var(--ssc-pad-x);--ssc-min-height: 12rem}:host([data-size=sm]){--ssc-indicator-size: 1.8rem;--ssc-indicator-check-size: .9rem;--ssc-indicator-dot-size: .7rem;--ssc-indicator-icon-dot-size: .5rem;--ssc-pad-x: var(--solaris-space-5);--ssc-pad-y: var(--solaris-space-4);--ssc-min-height: 10rem}:host([data-size=md]){--ssc-indicator-size: 2rem;--ssc-indicator-check-size: 1rem;--ssc-indicator-dot-size: .8rem;--ssc-indicator-icon-dot-size: .55rem;--ssc-pad-x: var(--solaris-space-6);--ssc-pad-y: var(--solaris-space-5);--ssc-min-height: 12rem}:host([data-size=lg]){--ssc-indicator-size: 2.4rem;--ssc-indicator-check-size: 1.2rem;--ssc-indicator-dot-size: .95rem;--ssc-indicator-icon-dot-size: .65rem;--ssc-pad-x: var(--solaris-space-7);--ssc-pad-y: var(--solaris-space-6);--ssc-min-height: 14rem}:host([data-color=primary]){--ssc-accent: var(--solaris-color-primary)}:host([data-color=success]){--ssc-accent: var(--solaris-color-success)}:host([data-color=warning]){--ssc-accent: var(--solaris-color-warning)}:host([data-color=error]){--ssc-accent: var(--solaris-color-error)}:host([data-color=info]){--ssc-accent: var(--solaris-color-info)}:host([data-color=custom]){--ssc-accent: var(--solaris-selection-card-custom, var(--solaris-color-primary))}:host([data-invalid=true]){--ssc-border: var(--ssc-border-invalid);--ssc-border-hover: var(--ssc-border-invalid);--ssc-border-selected: var(--ssc-border-invalid)}:host([data-disabled=true]){cursor:not-allowed}:host(:focus-visible){outline:.2rem solid var(--ssc-focus-ring);outline-offset:.2rem;border-radius:var(--solaris-card-radius, var(--solaris-radius-lg))}.solaris-selection-card{min-width:0;min-height:var(--ssc-min-height);position:relative}.solaris-selection-card__card{display:block;min-width:0;--solaris-card-bg: var(--ssc-bg);--solaris-card-bg-hover: var(--ssc-bg-hover);--solaris-card-border: var(--ssc-border);--solaris-card-border-hover: var(--ssc-border-hover);--solaris-card-shadow: var(--ssc-shadow);--solaris-card-shadow-hover: var(--ssc-shadow-hover);--solaris-card-padding-x: var(--ssc-pad-x);--solaris-card-padding-y: var(--ssc-pad-y);--solaris-card-padding-top: var(--ssc-pad-top);--solaris-card-padding-right: var(--ssc-pad-right);--solaris-card-padding-bottom: var(--ssc-pad-bottom);--solaris-card-padding-left: var(--ssc-pad-left);min-height:inherit}:host([data-selected=true]) .solaris-selection-card__card{--solaris-card-bg: var(--ssc-bg-selected);--solaris-card-border: var(--ssc-border-selected);--solaris-card-border-hover: var(--ssc-border-selected);--solaris-card-shadow: var(--ssc-shadow-selected);--solaris-card-shadow-hover: var(--ssc-shadow-selected)}:host([data-appearance=soft][data-selected=true]) .solaris-selection-card__card{--solaris-card-bg: color-mix(in srgb, var(--ssc-accent) 12%, var(--solaris-color-surface))}:host([data-disabled=true]) .solaris-selection-card__card{--solaris-card-shadow: none;--solaris-card-shadow-hover: none}.solaris-selection-card__indicator{position:absolute;top:var(--ssc-indicator-top);right:var(--ssc-indicator-end);z-index:1;pointer-events:none}.solaris-selection-card__indicator-control{width:var(--ssc-indicator-size);height:var(--ssc-indicator-size);display:grid;place-items:center;box-sizing:border-box;color:transparent;background:transparent;border:.1rem solid var(--ssc-border);transition:border-color .15s ease,background-color .15s ease,color .15s ease,opacity .15s ease,transform .12s ease}.solaris-selection-card__indicator-dot,.solaris-selection-card__indicator-icon-dot,.solaris-selection-card__indicator-check{opacity:0;transform:scale(.45);transition:opacity .15s ease,transform .15s ease,color .15s ease,background-color .15s ease}.solaris-selection-card__indicator-dot{width:var(--ssc-indicator-dot-size);height:var(--ssc-indicator-dot-size);border-radius:var(--solaris-radius-full);background:var(--ssc-accent)}.solaris-selection-card__indicator-icon-dot{width:var(--ssc-indicator-icon-dot-size);height:var(--ssc-indicator-icon-dot-size);border-radius:var(--solaris-radius-full);background:var(--solaris-color-primary-contrast, #fff)}.solaris-selection-card__indicator-check{line-height:1;font-size:var(--ssc-indicator-check-size)}:host([data-indicator=radio]) .solaris-selection-card__indicator-control,:host([data-indicator=icon]) .solaris-selection-card__indicator-control{border-radius:var(--solaris-radius-full)}:host([data-indicator=checkbox]) .solaris-selection-card__indicator-control{border-radius:var(--solaris-radius-sm)}:host([data-selected=true][data-indicator=radio]) .solaris-selection-card__indicator-control{border-color:var(--ssc-accent)}:host([data-selected=true][data-indicator=radio]) .solaris-selection-card__indicator-dot{opacity:1;transform:scale(1)}:host([data-selected=true][data-indicator=checkbox]) .solaris-selection-card__indicator-control{color:var(--solaris-color-primary-contrast, #fff);border-color:var(--ssc-accent);background:var(--ssc-accent)}:host([data-selected=true][data-indicator=checkbox]) .solaris-selection-card__indicator-check{opacity:1;transform:scale(1)}:host([data-selected=true][data-indicator=icon]) .solaris-selection-card__indicator-control{border-color:var(--ssc-accent);background:var(--ssc-accent)}:host([data-selected=true][data-indicator=icon]) .solaris-selection-card__indicator-icon-dot{opacity:1;transform:scale(1)}:host([data-disabled=true]) .solaris-selection-card__indicator-control{opacity:.55}:host([data-orientation=compact]){--ssc-min-height: 8.8rem}:host([data-orientation=compact]) .solaris-selection-card__card{--ssc-pad-right: calc(var(--ssc-pad-x) + var(--ssc-indicator-size) + var(--solaris-space-2))}\n"], dependencies: [{ kind: "component", type: SolarisCard, selector: "solaris-card", inputs: ["size", "orientation", "radius", "disabled", "interactive"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5240
|
+
}
|
|
5241
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisSelectionCard, decorators: [{
|
|
5242
|
+
type: Component,
|
|
5243
|
+
args: [{ selector: 'solaris-selection-card', standalone: true, imports: [SolarisCard], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
5244
|
+
class: 'solaris-selection-card-host',
|
|
5245
|
+
'[attr.data-size]': 'size()',
|
|
5246
|
+
'[attr.data-orientation]': 'orientation()',
|
|
5247
|
+
'[attr.data-selected]': 'selected() ? "true" : null',
|
|
5248
|
+
'[attr.data-disabled]': 'disabled() ? "true" : null',
|
|
5249
|
+
'[attr.data-invalid]': 'invalid() ? "true" : null',
|
|
5250
|
+
'[attr.data-appearance]': 'appearance()',
|
|
5251
|
+
'[attr.data-color]': 'colorKey()',
|
|
5252
|
+
'[attr.data-indicator]': 'resolvedIndicator()',
|
|
5253
|
+
'[attr.role]': 'role()',
|
|
5254
|
+
'[attr.aria-checked]': 'ariaChecked()',
|
|
5255
|
+
'[attr.aria-disabled]': 'disabled() ? "true" : null',
|
|
5256
|
+
'[attr.tabindex]': 'tabIndex()',
|
|
5257
|
+
'[style.--solaris-selection-card-custom]': 'customAccent()',
|
|
5258
|
+
'(click)': 'onHostClick($event)',
|
|
5259
|
+
'(keydown)': 'onHostKeydown($event)',
|
|
5260
|
+
'(blur)': 'onHostBlur()',
|
|
5261
|
+
}, template: "<div class=\"solaris-selection-card\">\r\n @if (resolvedIndicator() !== 'none') {\r\n <span class=\"solaris-selection-card__indicator\" aria-hidden=\"true\">\r\n <span class=\"solaris-selection-card__indicator-control\">\r\n @switch (resolvedIndicator()) {\r\n @case ('radio') {\r\n <span class=\"solaris-selection-card__indicator-dot\"></span>\r\n }\r\n @case ('checkbox') {\r\n <i class=\"ph ph-check solaris-selection-card__indicator-check\"></i>\r\n }\r\n @case ('icon') {\r\n <span class=\"solaris-selection-card__indicator-icon-dot\"></span>\r\n }\r\n }\r\n </span>\r\n </span>\r\n }\r\n\r\n <solaris-card\r\n class=\"solaris-selection-card__card\"\r\n [orientation]=\"orientation()\"\r\n [size]=\"size()\"\r\n [radius]=\"radius()\"\r\n [interactive]=\"!disabled()\"\r\n [disabled]=\"disabled()\">\r\n\r\n <div ngProjectAs=\"[solaris-card-media]\">\r\n <ng-content select=\"[solaris-card-media]\"></ng-content>\r\n </div>\r\n\r\n <div ngProjectAs=\"[solaris-card-eyebrow]\">\r\n <ng-content select=\"[solaris-card-eyebrow]\"></ng-content>\r\n </div>\r\n\r\n <div ngProjectAs=\"[solaris-card-title]\">\r\n <ng-content select=\"[solaris-card-title]\"></ng-content>\r\n </div>\r\n\r\n <div ngProjectAs=\"[solaris-card-description]\">\r\n <ng-content select=\"[solaris-card-description]\"></ng-content>\r\n </div>\r\n\r\n <div ngProjectAs=\"[solaris-card-meta]\">\r\n <ng-content select=\"[solaris-card-meta]\"></ng-content>\r\n </div>\r\n\r\n <div ngProjectAs=\"[solaris-card-badge]\">\r\n <ng-content select=\"[solaris-card-badge]\"></ng-content>\r\n </div>\r\n\r\n <div ngProjectAs=\"[solaris-card-footer]\">\r\n <ng-content select=\"[solaris-card-footer]\"></ng-content>\r\n </div>\r\n\r\n <div ngProjectAs=\"[solaris-card-actions]\">\r\n <ng-content select=\"[solaris-card-actions]\"></ng-content>\r\n </div>\r\n\r\n </solaris-card>\r\n</div>\r\n", styles: [":host{display:block;min-width:0;position:relative;outline:none;cursor:pointer;--ssc-accent: var(--solaris-color-primary);--ssc-bg: var(--solaris-color-surface);--ssc-bg-hover: color-mix(in srgb, var(--ssc-bg) 94%, white);--ssc-bg-selected: color-mix(in srgb, var(--ssc-accent) 8%, var(--solaris-color-surface));--ssc-border: var(--solaris-color-border);--ssc-border-hover: color-mix(in srgb, var(--ssc-accent) 20%, var(--ssc-border));--ssc-border-selected: color-mix(in srgb, var(--ssc-accent) 72%, var(--ssc-border));--ssc-border-invalid: var(--solaris-color-error);--ssc-shadow: var(--solaris-shadow-xs);--ssc-shadow-hover: var(--solaris-shadow-sm);--ssc-shadow-selected: var(--solaris-shadow-sm);--ssc-focus-ring: color-mix(in srgb, var(--ssc-accent) 26%, transparent);--ssc-indicator-size: 2rem;--ssc-indicator-check-size: 1rem;--ssc-indicator-dot-size: .8rem;--ssc-indicator-icon-dot-size: .55rem;--ssc-indicator-gap: var(--solaris-space-3);--ssc-pad-x: var(--solaris-space-6);--ssc-pad-y: var(--solaris-space-5);--ssc-pad-top: var(--ssc-pad-y);--ssc-pad-right: calc(var(--ssc-pad-x) + var(--ssc-indicator-size) + var(--ssc-indicator-gap));--ssc-pad-bottom: var(--ssc-pad-y);--ssc-pad-left: var(--ssc-pad-x);--ssc-indicator-top: var(--ssc-pad-y);--ssc-indicator-end: var(--ssc-pad-x);--ssc-min-height: 12rem}:host([data-size=sm]){--ssc-indicator-size: 1.8rem;--ssc-indicator-check-size: .9rem;--ssc-indicator-dot-size: .7rem;--ssc-indicator-icon-dot-size: .5rem;--ssc-pad-x: var(--solaris-space-5);--ssc-pad-y: var(--solaris-space-4);--ssc-min-height: 10rem}:host([data-size=md]){--ssc-indicator-size: 2rem;--ssc-indicator-check-size: 1rem;--ssc-indicator-dot-size: .8rem;--ssc-indicator-icon-dot-size: .55rem;--ssc-pad-x: var(--solaris-space-6);--ssc-pad-y: var(--solaris-space-5);--ssc-min-height: 12rem}:host([data-size=lg]){--ssc-indicator-size: 2.4rem;--ssc-indicator-check-size: 1.2rem;--ssc-indicator-dot-size: .95rem;--ssc-indicator-icon-dot-size: .65rem;--ssc-pad-x: var(--solaris-space-7);--ssc-pad-y: var(--solaris-space-6);--ssc-min-height: 14rem}:host([data-color=primary]){--ssc-accent: var(--solaris-color-primary)}:host([data-color=success]){--ssc-accent: var(--solaris-color-success)}:host([data-color=warning]){--ssc-accent: var(--solaris-color-warning)}:host([data-color=error]){--ssc-accent: var(--solaris-color-error)}:host([data-color=info]){--ssc-accent: var(--solaris-color-info)}:host([data-color=custom]){--ssc-accent: var(--solaris-selection-card-custom, var(--solaris-color-primary))}:host([data-invalid=true]){--ssc-border: var(--ssc-border-invalid);--ssc-border-hover: var(--ssc-border-invalid);--ssc-border-selected: var(--ssc-border-invalid)}:host([data-disabled=true]){cursor:not-allowed}:host(:focus-visible){outline:.2rem solid var(--ssc-focus-ring);outline-offset:.2rem;border-radius:var(--solaris-card-radius, var(--solaris-radius-lg))}.solaris-selection-card{min-width:0;min-height:var(--ssc-min-height);position:relative}.solaris-selection-card__card{display:block;min-width:0;--solaris-card-bg: var(--ssc-bg);--solaris-card-bg-hover: var(--ssc-bg-hover);--solaris-card-border: var(--ssc-border);--solaris-card-border-hover: var(--ssc-border-hover);--solaris-card-shadow: var(--ssc-shadow);--solaris-card-shadow-hover: var(--ssc-shadow-hover);--solaris-card-padding-x: var(--ssc-pad-x);--solaris-card-padding-y: var(--ssc-pad-y);--solaris-card-padding-top: var(--ssc-pad-top);--solaris-card-padding-right: var(--ssc-pad-right);--solaris-card-padding-bottom: var(--ssc-pad-bottom);--solaris-card-padding-left: var(--ssc-pad-left);min-height:inherit}:host([data-selected=true]) .solaris-selection-card__card{--solaris-card-bg: var(--ssc-bg-selected);--solaris-card-border: var(--ssc-border-selected);--solaris-card-border-hover: var(--ssc-border-selected);--solaris-card-shadow: var(--ssc-shadow-selected);--solaris-card-shadow-hover: var(--ssc-shadow-selected)}:host([data-appearance=soft][data-selected=true]) .solaris-selection-card__card{--solaris-card-bg: color-mix(in srgb, var(--ssc-accent) 12%, var(--solaris-color-surface))}:host([data-disabled=true]) .solaris-selection-card__card{--solaris-card-shadow: none;--solaris-card-shadow-hover: none}.solaris-selection-card__indicator{position:absolute;top:var(--ssc-indicator-top);right:var(--ssc-indicator-end);z-index:1;pointer-events:none}.solaris-selection-card__indicator-control{width:var(--ssc-indicator-size);height:var(--ssc-indicator-size);display:grid;place-items:center;box-sizing:border-box;color:transparent;background:transparent;border:.1rem solid var(--ssc-border);transition:border-color .15s ease,background-color .15s ease,color .15s ease,opacity .15s ease,transform .12s ease}.solaris-selection-card__indicator-dot,.solaris-selection-card__indicator-icon-dot,.solaris-selection-card__indicator-check{opacity:0;transform:scale(.45);transition:opacity .15s ease,transform .15s ease,color .15s ease,background-color .15s ease}.solaris-selection-card__indicator-dot{width:var(--ssc-indicator-dot-size);height:var(--ssc-indicator-dot-size);border-radius:var(--solaris-radius-full);background:var(--ssc-accent)}.solaris-selection-card__indicator-icon-dot{width:var(--ssc-indicator-icon-dot-size);height:var(--ssc-indicator-icon-dot-size);border-radius:var(--solaris-radius-full);background:var(--solaris-color-primary-contrast, #fff)}.solaris-selection-card__indicator-check{line-height:1;font-size:var(--ssc-indicator-check-size)}:host([data-indicator=radio]) .solaris-selection-card__indicator-control,:host([data-indicator=icon]) .solaris-selection-card__indicator-control{border-radius:var(--solaris-radius-full)}:host([data-indicator=checkbox]) .solaris-selection-card__indicator-control{border-radius:var(--solaris-radius-sm)}:host([data-selected=true][data-indicator=radio]) .solaris-selection-card__indicator-control{border-color:var(--ssc-accent)}:host([data-selected=true][data-indicator=radio]) .solaris-selection-card__indicator-dot{opacity:1;transform:scale(1)}:host([data-selected=true][data-indicator=checkbox]) .solaris-selection-card__indicator-control{color:var(--solaris-color-primary-contrast, #fff);border-color:var(--ssc-accent);background:var(--ssc-accent)}:host([data-selected=true][data-indicator=checkbox]) .solaris-selection-card__indicator-check{opacity:1;transform:scale(1)}:host([data-selected=true][data-indicator=icon]) .solaris-selection-card__indicator-control{border-color:var(--ssc-accent);background:var(--ssc-accent)}:host([data-selected=true][data-indicator=icon]) .solaris-selection-card__indicator-icon-dot{opacity:1;transform:scale(1)}:host([data-disabled=true]) .solaris-selection-card__indicator-control{opacity:.55}:host([data-orientation=compact]){--ssc-min-height: 8.8rem}:host([data-orientation=compact]) .solaris-selection-card__card{--ssc-pad-right: calc(var(--ssc-pad-x) + var(--ssc-indicator-size) + var(--solaris-space-2))}\n"] }]
|
|
5262
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], selectionIndicator: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionIndicator", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], selectedInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], selectedChange: [{ type: i0.Output, args: ["selectedChange"] }], cardClick: [{ type: i0.Output, args: ["cardClick"] }] } });
|
|
5263
|
+
function inferStandaloneMode(indicator) {
|
|
5264
|
+
switch (indicator) {
|
|
5265
|
+
case 'radio':
|
|
5266
|
+
return 'single';
|
|
5267
|
+
case 'checkbox':
|
|
5268
|
+
case 'icon':
|
|
5269
|
+
case 'auto':
|
|
5270
|
+
default:
|
|
5271
|
+
return 'multiple';
|
|
5272
|
+
}
|
|
5273
|
+
}
|
|
5274
|
+
|
|
5275
|
+
class FieldErrorComponent {
|
|
5276
|
+
text;
|
|
5277
|
+
textKey;
|
|
5278
|
+
textParams;
|
|
5279
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: FieldErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5280
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: FieldErrorComponent, isStandalone: true, selector: "solaris-field-error", inputs: { text: "text", textKey: "textKey", textParams: "textParams" }, ngImport: i0, template: "<div class=\"solaris-field-error\" role=\"alert\" aria-live=\"polite\">\r\n <span class=\"solaris-field-error__text\">\r\n @if (textKey) { {{ textKey | translate:textParams }} }\r\n @else { {{ text }} }\r\n </span>\r\n</div>\r\n", styles: [".solaris-field-error{line-height:1.25;padding-left:.5rem;font-size:var(--solaris-fs-10);color:var(--solaris-color-error)}\n"], dependencies: [{ kind: "pipe", type: SolarisTranslationPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5281
|
+
}
|
|
5282
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: FieldErrorComponent, decorators: [{
|
|
5283
|
+
type: Component,
|
|
5284
|
+
args: [{ selector: 'solaris-field-error', standalone: true, imports: [SolarisTranslationPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"solaris-field-error\" role=\"alert\" aria-live=\"polite\">\r\n <span class=\"solaris-field-error__text\">\r\n @if (textKey) { {{ textKey | translate:textParams }} }\r\n @else { {{ text }} }\r\n </span>\r\n</div>\r\n", styles: [".solaris-field-error{line-height:1.25;padding-left:.5rem;font-size:var(--solaris-fs-10);color:var(--solaris-color-error)}\n"] }]
|
|
5285
|
+
}], propDecorators: { text: [{
|
|
5286
|
+
type: Input
|
|
5287
|
+
}], textKey: [{
|
|
5288
|
+
type: Input
|
|
5289
|
+
}], textParams: [{
|
|
5290
|
+
type: Input
|
|
5291
|
+
}] } });
|
|
5292
|
+
|
|
5293
|
+
class SolarisCardGroup {
|
|
5294
|
+
readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : {}), transform: booleanAttribute });
|
|
5295
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : {}), transform: booleanAttribute });
|
|
5296
|
+
submitted = input(false, { ...(ngDevMode ? { debugName: "submitted" } : {}), transform: booleanAttribute });
|
|
5297
|
+
selectOnFocus = input(false, { ...(ngDevMode ? { debugName: "selectOnFocus" } : {}), transform: booleanAttribute });
|
|
5298
|
+
disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : {}), transform: booleanAttribute });
|
|
5299
|
+
gap = input('md', ...(ngDevMode ? [{ debugName: "gap" }] : []));
|
|
5300
|
+
invalid = input(null, ...(ngDevMode ? [{ debugName: "invalid" }] : []));
|
|
5301
|
+
minSelected = input(null, ...(ngDevMode ? [{ debugName: "minSelected" }] : []));
|
|
5302
|
+
maxSelected = input(null, ...(ngDevMode ? [{ debugName: "maxSelected" }] : []));
|
|
5303
|
+
layout = input('stack', ...(ngDevMode ? [{ debugName: "layout" }] : []));
|
|
5304
|
+
compareWith = input(Object.is, ...(ngDevMode ? [{ debugName: "compareWith" }] : []));
|
|
5305
|
+
showErrors = input('dirtyOrTouched', ...(ngDevMode ? [{ debugName: "showErrors" }] : []));
|
|
5306
|
+
selectionMode = input('single', ...(ngDevMode ? [{ debugName: "selectionMode" }] : []));
|
|
5307
|
+
orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
5308
|
+
requiredErrorKey = input('solaris.cardGroup.errors.required', ...(ngDevMode ? [{ debugName: "requiredErrorKey" }] : []));
|
|
5309
|
+
minSelectedErrorKey = input('solaris.cardGroup.errors.minSelected', ...(ngDevMode ? [{ debugName: "minSelectedErrorKey" }] : []));
|
|
5310
|
+
maxSelectedErrorKey = input('solaris.cardGroup.errors.maxSelected', ...(ngDevMode ? [{ debugName: "maxSelectedErrorKey" }] : []));
|
|
5311
|
+
valueChange = output();
|
|
5312
|
+
selectionRejected = output();
|
|
5313
|
+
cardsQuery;
|
|
5314
|
+
destroyRef = inject(DestroyRef);
|
|
5315
|
+
controlTick = signal(0, ...(ngDevMode ? [{ debugName: "controlTick" }] : []));
|
|
5316
|
+
dirtyState = signal(false, ...(ngDevMode ? [{ debugName: "dirtyState" }] : []));
|
|
5317
|
+
cardsVersion = signal(0, ...(ngDevMode ? [{ debugName: "cardsVersion" }] : []));
|
|
5318
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
5319
|
+
touchedState = signal(false, ...(ngDevMode ? [{ debugName: "touchedState" }] : []));
|
|
5320
|
+
internalValue = signal(null, ...(ngDevMode ? [{ debugName: "internalValue" }] : []));
|
|
5321
|
+
onTouched = () => { };
|
|
5322
|
+
onChange = () => { };
|
|
5323
|
+
onValidatorChange = () => { };
|
|
5324
|
+
constructor() {
|
|
5325
|
+
effect(() => {
|
|
5326
|
+
this.selectionMode();
|
|
5327
|
+
this.required();
|
|
5328
|
+
this.minSelected();
|
|
5329
|
+
this.maxSelected();
|
|
5330
|
+
this.compareWith();
|
|
5331
|
+
this.internalValue();
|
|
5332
|
+
this.onValidatorChange();
|
|
5333
|
+
});
|
|
5334
|
+
}
|
|
5335
|
+
ngAfterContentInit() {
|
|
5336
|
+
this.bumpCardsVersion();
|
|
5337
|
+
this.cardsQuery?.changes
|
|
5338
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
5339
|
+
.subscribe(() => this.bumpCardsVersion());
|
|
5340
|
+
}
|
|
5341
|
+
resolvedGap = computed(() => {
|
|
5342
|
+
const value = String(this.gap() ?? 'md').trim();
|
|
5343
|
+
switch (value) {
|
|
5344
|
+
case 'sm':
|
|
5345
|
+
return 'var(--solaris-space-3)';
|
|
5346
|
+
case 'md':
|
|
5347
|
+
return 'var(--solaris-space-4)';
|
|
5348
|
+
case 'lg':
|
|
5349
|
+
return 'var(--solaris-space-5)';
|
|
5350
|
+
default:
|
|
5351
|
+
return value;
|
|
5352
|
+
}
|
|
5353
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedGap" }] : []));
|
|
5354
|
+
disabled = computed(() => this.disabledInput() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
5355
|
+
groupRole = computed(() => {
|
|
5356
|
+
switch (this.selectionMode()) {
|
|
5357
|
+
case 'single':
|
|
5358
|
+
return 'radiogroup';
|
|
5359
|
+
case 'multiple':
|
|
5360
|
+
case 'none':
|
|
5361
|
+
default:
|
|
5362
|
+
return 'group';
|
|
5363
|
+
}
|
|
5364
|
+
}, ...(ngDevMode ? [{ debugName: "groupRole" }] : []));
|
|
5365
|
+
selectionCount = computed(() => {
|
|
5366
|
+
const value = this.internalValue();
|
|
5367
|
+
if (Array.isArray(value))
|
|
5368
|
+
return value.length;
|
|
5369
|
+
if (value == null)
|
|
5370
|
+
return 0;
|
|
5371
|
+
return 1;
|
|
5372
|
+
}, ...(ngDevMode ? [{ debugName: "selectionCount" }] : []));
|
|
5373
|
+
validationError = computed(() => {
|
|
5374
|
+
if (this.disabled() || this.selectionMode() === 'none')
|
|
5375
|
+
return null;
|
|
5376
|
+
const count = this.selectionCount();
|
|
5377
|
+
if (this.required() && count === 0)
|
|
5378
|
+
return 'required';
|
|
5379
|
+
if (this.selectionMode() === 'multiple') {
|
|
5380
|
+
const min = this.minSelected();
|
|
5381
|
+
const max = this.maxSelected();
|
|
5382
|
+
if (min != null && count < min)
|
|
5383
|
+
return 'minSelected';
|
|
5384
|
+
if (max != null && count > max)
|
|
5385
|
+
return 'maxSelected';
|
|
5386
|
+
}
|
|
5387
|
+
return null;
|
|
5388
|
+
}, ...(ngDevMode ? [{ debugName: "validationError" }] : []));
|
|
5389
|
+
invalidComputed = computed(() => {
|
|
5390
|
+
const explicitInvalid = this.invalid();
|
|
5391
|
+
if (explicitInvalid !== null)
|
|
5392
|
+
return explicitInvalid;
|
|
5393
|
+
const localInvalid = this.validationError() !== null;
|
|
5394
|
+
if (this.showErrors() === 'always')
|
|
5395
|
+
return localInvalid;
|
|
5396
|
+
if (this.showErrors() === 'submitted')
|
|
5397
|
+
return localInvalid && this.submitted();
|
|
5398
|
+
return localInvalid && (this.touchedState() || this.dirtyState());
|
|
5399
|
+
}, ...(ngDevMode ? [{ debugName: "invalidComputed" }] : []));
|
|
5400
|
+
errorKeyComputed = computed(() => {
|
|
5401
|
+
switch (this.validationError()) {
|
|
5402
|
+
case 'required':
|
|
5403
|
+
return this.requiredErrorKey();
|
|
5404
|
+
case 'minSelected':
|
|
5405
|
+
return this.minSelectedErrorKey();
|
|
5406
|
+
case 'maxSelected':
|
|
5407
|
+
return this.maxSelectedErrorKey();
|
|
5408
|
+
default:
|
|
5409
|
+
return undefined;
|
|
5410
|
+
}
|
|
5411
|
+
}, ...(ngDevMode ? [{ debugName: "errorKeyComputed" }] : []));
|
|
5412
|
+
errorParamsComputed = computed(() => {
|
|
5413
|
+
switch (this.validationError()) {
|
|
5414
|
+
case 'minSelected':
|
|
5415
|
+
return { min: this.minSelected() ?? undefined };
|
|
5416
|
+
case 'maxSelected':
|
|
5417
|
+
return { max: this.maxSelected() ?? undefined };
|
|
5418
|
+
default:
|
|
5419
|
+
return undefined;
|
|
5420
|
+
}
|
|
5421
|
+
}, ...(ngDevMode ? [{ debugName: "errorParamsComputed" }] : []));
|
|
5422
|
+
isSelected(value) {
|
|
5423
|
+
const currentValue = this.internalValue();
|
|
5424
|
+
switch (this.selectionMode()) {
|
|
5425
|
+
case 'single':
|
|
5426
|
+
return !Array.isArray(currentValue) &&
|
|
5427
|
+
currentValue !== null &&
|
|
5428
|
+
this.compareWith()(currentValue, value);
|
|
5429
|
+
case 'multiple': {
|
|
5430
|
+
const list = Array.isArray(currentValue) ? currentValue : [];
|
|
5431
|
+
return list.some(item => this.compareWith()(item, value));
|
|
5432
|
+
}
|
|
5433
|
+
case 'none':
|
|
5434
|
+
default:
|
|
5435
|
+
return false;
|
|
5436
|
+
}
|
|
5437
|
+
}
|
|
5438
|
+
activate(card) {
|
|
5439
|
+
if (this.disabled() || card.disabled())
|
|
5440
|
+
return;
|
|
5441
|
+
this.notifyTouched();
|
|
5442
|
+
if (this.readonly()) {
|
|
5443
|
+
this.selectionRejected.emit({ reason: 'readonly', value: card.value() });
|
|
5444
|
+
return;
|
|
5445
|
+
}
|
|
5446
|
+
switch (this.selectionMode()) {
|
|
5447
|
+
case 'single': {
|
|
5448
|
+
const nextValue = card.value();
|
|
5449
|
+
const currentValue = this.internalValue();
|
|
5450
|
+
if (Array.isArray(currentValue) || currentValue === null
|
|
5451
|
+
|| !this.compareWith()(currentValue, nextValue)) {
|
|
5452
|
+
this.internalValue.set(nextValue);
|
|
5453
|
+
this.emitModelChange(nextValue);
|
|
5454
|
+
}
|
|
5455
|
+
break;
|
|
5456
|
+
}
|
|
5457
|
+
case 'multiple': {
|
|
5458
|
+
const currentValue = this.internalValue();
|
|
5459
|
+
const current = Array.isArray(currentValue) ? [...currentValue] : [];
|
|
5460
|
+
const cardValue = card.value();
|
|
5461
|
+
const index = current.findIndex(item => this.compareWith()(item, cardValue));
|
|
5462
|
+
if (index >= 0) {
|
|
5463
|
+
current.splice(index, 1);
|
|
5464
|
+
this.internalValue.set(current);
|
|
5465
|
+
this.emitModelChange(current);
|
|
5466
|
+
break;
|
|
5467
|
+
}
|
|
5468
|
+
const max = this.maxSelected();
|
|
5469
|
+
if (max != null && current.length >= max) {
|
|
5470
|
+
this.selectionRejected.emit({ reason: 'maxSelected', value: cardValue });
|
|
5471
|
+
return;
|
|
5472
|
+
}
|
|
5473
|
+
current.push(cardValue);
|
|
5474
|
+
this.internalValue.set(current);
|
|
5475
|
+
this.emitModelChange(current);
|
|
5476
|
+
break;
|
|
5477
|
+
}
|
|
5478
|
+
case 'none':
|
|
5479
|
+
default:
|
|
5480
|
+
break;
|
|
5481
|
+
}
|
|
5482
|
+
this.bumpCardsVersion();
|
|
5483
|
+
this.bumpControlTick();
|
|
5484
|
+
}
|
|
5485
|
+
tabIndexFor(card) {
|
|
5486
|
+
this.cardsVersion();
|
|
5487
|
+
if (this.disabled() || card.disabled())
|
|
5488
|
+
return -1;
|
|
5489
|
+
if (this.selectionMode() === 'none')
|
|
5490
|
+
return 0;
|
|
5491
|
+
const enabled = this.enabledCards();
|
|
5492
|
+
if (!enabled.length)
|
|
5493
|
+
return -1;
|
|
5494
|
+
const selected = enabled.find(item => this.isSelected(item.value()));
|
|
5495
|
+
const target = selected ?? enabled[0];
|
|
5496
|
+
return target === card ? 0 : -1;
|
|
5497
|
+
}
|
|
5498
|
+
handleKeydown(event, current) {
|
|
5499
|
+
if (this.disabled())
|
|
5500
|
+
return;
|
|
5501
|
+
if (this.selectionMode() === 'none')
|
|
5502
|
+
return;
|
|
5503
|
+
switch (event.key) {
|
|
5504
|
+
case 'ArrowRight':
|
|
5505
|
+
case 'ArrowDown':
|
|
5506
|
+
event.preventDefault();
|
|
5507
|
+
this.move(current, +1);
|
|
5508
|
+
break;
|
|
5509
|
+
case 'ArrowLeft':
|
|
5510
|
+
case 'ArrowUp':
|
|
5511
|
+
event.preventDefault();
|
|
5512
|
+
this.move(current, -1);
|
|
5513
|
+
break;
|
|
5514
|
+
case 'Home':
|
|
5515
|
+
event.preventDefault();
|
|
5516
|
+
this.focusFirst();
|
|
5517
|
+
break;
|
|
5518
|
+
case 'End':
|
|
5519
|
+
event.preventDefault();
|
|
5520
|
+
this.focusLast();
|
|
5521
|
+
break;
|
|
5522
|
+
case ' ':
|
|
5523
|
+
case 'Enter':
|
|
5524
|
+
event.preventDefault();
|
|
5525
|
+
this.activate(current);
|
|
5526
|
+
break;
|
|
5527
|
+
}
|
|
5528
|
+
}
|
|
5529
|
+
notifyTouched() {
|
|
5530
|
+
if (!this.touchedState()) {
|
|
5531
|
+
this.touchedState.set(true);
|
|
5532
|
+
}
|
|
5533
|
+
this.onTouched();
|
|
5534
|
+
this.bumpControlTick();
|
|
5535
|
+
}
|
|
5536
|
+
writeValue(value) {
|
|
5537
|
+
this.internalValue.set(this.normalizeIncomingValue(value, this.selectionMode()));
|
|
5538
|
+
this.bumpCardsVersion();
|
|
5539
|
+
this.bumpControlTick();
|
|
5540
|
+
}
|
|
5541
|
+
registerOnTouched(fn) {
|
|
5542
|
+
this.onTouched = fn;
|
|
5543
|
+
}
|
|
5544
|
+
setDisabledState(isDisabled) {
|
|
5545
|
+
this.cvaDisabled.set(isDisabled);
|
|
5546
|
+
this.bumpCardsVersion();
|
|
5547
|
+
this.bumpControlTick();
|
|
5548
|
+
}
|
|
5549
|
+
registerOnChange(fn) {
|
|
5550
|
+
this.onChange = fn;
|
|
5551
|
+
}
|
|
5552
|
+
validate(_) {
|
|
5553
|
+
switch (this.validationError()) {
|
|
5554
|
+
case 'required':
|
|
5555
|
+
return { required: true };
|
|
5556
|
+
case 'minSelected':
|
|
5557
|
+
return {
|
|
5558
|
+
minSelected: {
|
|
5559
|
+
min: this.minSelected(),
|
|
5560
|
+
actual: this.selectionCount(),
|
|
5561
|
+
},
|
|
5562
|
+
};
|
|
5563
|
+
case 'maxSelected':
|
|
5564
|
+
return {
|
|
5565
|
+
maxSelected: {
|
|
5566
|
+
max: this.maxSelected(),
|
|
5567
|
+
actual: this.selectionCount(),
|
|
5568
|
+
},
|
|
5569
|
+
};
|
|
5570
|
+
default:
|
|
5571
|
+
return null;
|
|
5572
|
+
}
|
|
5573
|
+
}
|
|
5574
|
+
registerOnValidatorChange(fn) {
|
|
5575
|
+
this.onValidatorChange = fn;
|
|
5576
|
+
}
|
|
5577
|
+
move(current, direction) {
|
|
5578
|
+
const enabled = this.enabledCards();
|
|
5579
|
+
if (!enabled.length)
|
|
5580
|
+
return;
|
|
5581
|
+
const currentIndex = enabled.indexOf(current);
|
|
5582
|
+
const startIndex = Math.max(currentIndex, 0);
|
|
5583
|
+
const nextIndex = (startIndex + direction + enabled.length) % enabled.length;
|
|
5584
|
+
const next = enabled[nextIndex];
|
|
5585
|
+
if (this.selectionMode() === 'single' && this.selectOnFocus()) {
|
|
5586
|
+
this.activate(next);
|
|
5587
|
+
}
|
|
5588
|
+
next.focus();
|
|
5589
|
+
}
|
|
5590
|
+
focusFirst() {
|
|
5591
|
+
const first = this.enabledCards()[0];
|
|
5592
|
+
if (!first)
|
|
5593
|
+
return;
|
|
5594
|
+
if (this.selectionMode() === 'single' && this.selectOnFocus()) {
|
|
5595
|
+
this.activate(first);
|
|
5596
|
+
}
|
|
5597
|
+
first.focus();
|
|
5598
|
+
}
|
|
5599
|
+
focusLast() {
|
|
5600
|
+
const enabled = this.enabledCards();
|
|
5601
|
+
const last = enabled.at(-1);
|
|
5602
|
+
if (!last)
|
|
5603
|
+
return;
|
|
5604
|
+
if (this.selectionMode() === 'single' && this.selectOnFocus()) {
|
|
5605
|
+
this.activate(last);
|
|
5606
|
+
}
|
|
5607
|
+
last.focus();
|
|
5608
|
+
}
|
|
5609
|
+
enabledCards() {
|
|
5610
|
+
this.cardsVersion();
|
|
5611
|
+
return (this.cardsQuery?.toArray() ?? []).filter(card => !card.disabled());
|
|
5612
|
+
}
|
|
5613
|
+
emitModelChange(value) {
|
|
5614
|
+
this.onChange(value);
|
|
5615
|
+
this.valueChange.emit(value);
|
|
5616
|
+
this.onValidatorChange();
|
|
5617
|
+
}
|
|
5618
|
+
normalizeIncomingValue(value, mode) {
|
|
5619
|
+
switch (mode) {
|
|
5620
|
+
case 'single':
|
|
5621
|
+
return Array.isArray(value) ? (value[0] ?? null) : value;
|
|
5622
|
+
case 'multiple':
|
|
5623
|
+
if (value == null)
|
|
5624
|
+
return [];
|
|
5625
|
+
return Array.isArray(value) ? value : [value];
|
|
5626
|
+
case 'none':
|
|
5627
|
+
default:
|
|
5628
|
+
return null;
|
|
5629
|
+
}
|
|
5630
|
+
}
|
|
5631
|
+
bumpCardsVersion() {
|
|
5632
|
+
this.cardsVersion.update(value => value + 1);
|
|
5633
|
+
}
|
|
5634
|
+
bumpControlTick() {
|
|
5635
|
+
this.controlTick.update(value => value + 1);
|
|
5636
|
+
}
|
|
5637
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5638
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisCardGroup, isStandalone: true, selector: "solaris-card-group", inputs: { readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, submitted: { classPropertyName: "submitted", publicName: "submitted", isSignal: true, isRequired: false, transformFunction: null }, selectOnFocus: { classPropertyName: "selectOnFocus", publicName: "selectOnFocus", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabledInput", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, minSelected: { classPropertyName: "minSelected", publicName: "minSelected", isSignal: true, isRequired: false, transformFunction: null }, maxSelected: { classPropertyName: "maxSelected", publicName: "maxSelected", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, showErrors: { classPropertyName: "showErrors", publicName: "showErrors", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, requiredErrorKey: { classPropertyName: "requiredErrorKey", publicName: "requiredErrorKey", isSignal: true, isRequired: false, transformFunction: null }, minSelectedErrorKey: { classPropertyName: "minSelectedErrorKey", publicName: "minSelectedErrorKey", isSignal: true, isRequired: false, transformFunction: null }, maxSelectedErrorKey: { classPropertyName: "maxSelectedErrorKey", publicName: "maxSelectedErrorKey", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", selectionRejected: "selectionRejected" }, host: { properties: { "attr.data-layout": "layout()", "attr.data-orientation": "orientation()", "attr.data-selection-mode": "selectionMode()", "attr.data-invalid": "invalidComputed() ? \"true\" : null", "attr.data-readonly": "readonly() ? \"true\" : null", "attr.role": "groupRole()", "attr.aria-disabled": "disabled() ? \"true\" : null", "attr.aria-invalid": "invalidComputed() ? \"true\" : null", "style.--solaris-card-group-gap": "resolvedGap()" }, classAttribute: "solaris-card-group-host" }, providers: [
|
|
5639
|
+
{
|
|
5640
|
+
provide: NG_VALUE_ACCESSOR,
|
|
5641
|
+
useExisting: forwardRef(() => SolarisCardGroup),
|
|
5642
|
+
multi: true,
|
|
5643
|
+
},
|
|
5644
|
+
{
|
|
5645
|
+
provide: NG_VALIDATORS,
|
|
5646
|
+
useExisting: forwardRef(() => SolarisCardGroup),
|
|
5647
|
+
multi: true,
|
|
5648
|
+
},
|
|
5649
|
+
{
|
|
5650
|
+
provide: SOLARIS_CARD_GROUP,
|
|
5651
|
+
useExisting: forwardRef(() => SolarisCardGroup),
|
|
5652
|
+
},
|
|
5653
|
+
], queries: [{ propertyName: "cardsQuery", predicate: i0.forwardRef(() => SolarisSelectionCard), descendants: true }], ngImport: i0, template: "<div class=\"solaris-card-group__control\">\r\n <ng-content></ng-content>\r\n</div>\r\n\r\n@if (errorKeyComputed()) {\r\n <solaris-field-error [textKey]=\"errorKeyComputed()\" [textParams]=\"errorParamsComputed()\"></solaris-field-error>\r\n} @else {\r\n <ng-content select=\"[card-group-message]\"></ng-content>\r\n}\r\n", styles: [":host.solaris-card-group-host{display:flex;min-width:0;gap:var(--solaris-card-group-gap, var(--solaris-space-4))}:host.solaris-card-group-host[data-layout=stack]{flex-direction:column}:host.solaris-card-group-host[data-layout=stack][data-orientation=horizontal]{flex-direction:row;flex-wrap:wrap;align-items:stretch}:host.solaris-card-group-host[data-layout=stack][data-orientation=compact]{flex-direction:column}:host.solaris-card-group-host[data-layout=grid]{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,24rem),1fr))}:host.solaris-card-group-host[data-layout=grid][data-orientation=compact]{grid-template-columns:repeat(auto-fit,minmax(min(100%,18rem),1fr))}:host.solaris-card-group-host[data-layout=grid][data-orientation=horizontal]{grid-template-columns:repeat(auto-fit,minmax(min(100%,28rem),1fr))}\n"], dependencies: [{ kind: "component", type: FieldErrorComponent, selector: "solaris-field-error", inputs: ["text", "textKey", "textParams"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5654
|
+
}
|
|
5655
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardGroup, decorators: [{
|
|
5656
|
+
type: Component,
|
|
5657
|
+
args: [{ selector: 'solaris-card-group', standalone: true, imports: [
|
|
5658
|
+
FieldErrorComponent
|
|
5659
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
5660
|
+
{
|
|
5661
|
+
provide: NG_VALUE_ACCESSOR,
|
|
5662
|
+
useExisting: forwardRef(() => SolarisCardGroup),
|
|
5663
|
+
multi: true,
|
|
5664
|
+
},
|
|
5665
|
+
{
|
|
5666
|
+
provide: NG_VALIDATORS,
|
|
5667
|
+
useExisting: forwardRef(() => SolarisCardGroup),
|
|
5668
|
+
multi: true,
|
|
5669
|
+
},
|
|
5670
|
+
{
|
|
5671
|
+
provide: SOLARIS_CARD_GROUP,
|
|
5672
|
+
useExisting: forwardRef(() => SolarisCardGroup),
|
|
5673
|
+
},
|
|
5674
|
+
], host: {
|
|
5675
|
+
class: 'solaris-card-group-host',
|
|
5676
|
+
'[attr.data-layout]': 'layout()',
|
|
5677
|
+
'[attr.data-orientation]': 'orientation()',
|
|
5678
|
+
'[attr.data-selection-mode]': 'selectionMode()',
|
|
5679
|
+
'[attr.data-invalid]': 'invalidComputed() ? "true" : null',
|
|
5680
|
+
'[attr.data-readonly]': 'readonly() ? "true" : null',
|
|
5681
|
+
'[attr.role]': 'groupRole()',
|
|
5682
|
+
'[attr.aria-disabled]': 'disabled() ? "true" : null',
|
|
5683
|
+
'[attr.aria-invalid]': 'invalidComputed() ? "true" : null',
|
|
5684
|
+
'[style.--solaris-card-group-gap]': 'resolvedGap()',
|
|
5685
|
+
}, template: "<div class=\"solaris-card-group__control\">\r\n <ng-content></ng-content>\r\n</div>\r\n\r\n@if (errorKeyComputed()) {\r\n <solaris-field-error [textKey]=\"errorKeyComputed()\" [textParams]=\"errorParamsComputed()\"></solaris-field-error>\r\n} @else {\r\n <ng-content select=\"[card-group-message]\"></ng-content>\r\n}\r\n", styles: [":host.solaris-card-group-host{display:flex;min-width:0;gap:var(--solaris-card-group-gap, var(--solaris-space-4))}:host.solaris-card-group-host[data-layout=stack]{flex-direction:column}:host.solaris-card-group-host[data-layout=stack][data-orientation=horizontal]{flex-direction:row;flex-wrap:wrap;align-items:stretch}:host.solaris-card-group-host[data-layout=stack][data-orientation=compact]{flex-direction:column}:host.solaris-card-group-host[data-layout=grid]{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,24rem),1fr))}:host.solaris-card-group-host[data-layout=grid][data-orientation=compact]{grid-template-columns:repeat(auto-fit,minmax(min(100%,18rem),1fr))}:host.solaris-card-group-host[data-layout=grid][data-orientation=horizontal]{grid-template-columns:repeat(auto-fit,minmax(min(100%,28rem),1fr))}\n"] }]
|
|
5686
|
+
}], ctorParameters: () => [], propDecorators: { readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], submitted: [{ type: i0.Input, args: [{ isSignal: true, alias: "submitted", required: false }] }], selectOnFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectOnFocus", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledInput", required: false }] }], gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], minSelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "minSelected", required: false }] }], maxSelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSelected", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], compareWith: [{ type: i0.Input, args: [{ isSignal: true, alias: "compareWith", required: false }] }], showErrors: [{ type: i0.Input, args: [{ isSignal: true, alias: "showErrors", required: false }] }], selectionMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectionMode", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], requiredErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredErrorKey", required: false }] }], minSelectedErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "minSelectedErrorKey", required: false }] }], maxSelectedErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSelectedErrorKey", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], selectionRejected: [{ type: i0.Output, args: ["selectionRejected"] }], cardsQuery: [{
|
|
5687
|
+
type: ContentChildren,
|
|
5688
|
+
args: [forwardRef(() => SolarisSelectionCard), { descendants: true }]
|
|
5689
|
+
}] } });
|
|
5690
|
+
|
|
5691
|
+
class SolarisCardMediaDirective {
|
|
5692
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardMediaDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
5693
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisCardMediaDirective, isStandalone: true, selector: "[solaris-card-media]", host: { classAttribute: "solaris-card-slot solaris-card-slot--media" }, ngImport: i0 });
|
|
5694
|
+
}
|
|
5695
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardMediaDirective, decorators: [{
|
|
5696
|
+
type: Directive,
|
|
5697
|
+
args: [{
|
|
5698
|
+
selector: '[solaris-card-media]',
|
|
5699
|
+
standalone: true,
|
|
5700
|
+
host: { class: 'solaris-card-slot solaris-card-slot--media' },
|
|
5701
|
+
}]
|
|
5702
|
+
}] });
|
|
5703
|
+
class SolarisCardEyebrowDirective {
|
|
5704
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardEyebrowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
5705
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisCardEyebrowDirective, isStandalone: true, selector: "[solaris-card-eyebrow]", host: { classAttribute: "solaris-card-slot solaris-card-slot--eyebrow" }, ngImport: i0 });
|
|
5706
|
+
}
|
|
5707
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardEyebrowDirective, decorators: [{
|
|
5708
|
+
type: Directive,
|
|
5709
|
+
args: [{
|
|
5710
|
+
selector: '[solaris-card-eyebrow]',
|
|
5711
|
+
standalone: true,
|
|
5712
|
+
host: { class: 'solaris-card-slot solaris-card-slot--eyebrow' },
|
|
5713
|
+
}]
|
|
5714
|
+
}] });
|
|
5715
|
+
class SolarisCardTitleDirective {
|
|
5716
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
5717
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisCardTitleDirective, isStandalone: true, selector: "[solaris-card-title]", host: { classAttribute: "solaris-card-slot solaris-card-slot--title" }, ngImport: i0 });
|
|
5718
|
+
}
|
|
5719
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardTitleDirective, decorators: [{
|
|
5720
|
+
type: Directive,
|
|
5721
|
+
args: [{
|
|
5722
|
+
selector: '[solaris-card-title]',
|
|
5723
|
+
standalone: true,
|
|
5724
|
+
host: { class: 'solaris-card-slot solaris-card-slot--title' },
|
|
5725
|
+
}]
|
|
5726
|
+
}] });
|
|
5727
|
+
class SolarisCardDescriptionDirective {
|
|
5728
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardDescriptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
5729
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisCardDescriptionDirective, isStandalone: true, selector: "[solaris-card-description]", host: { classAttribute: "solaris-card-slot solaris-card-slot--description" }, ngImport: i0 });
|
|
5730
|
+
}
|
|
5731
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardDescriptionDirective, decorators: [{
|
|
5732
|
+
type: Directive,
|
|
5733
|
+
args: [{
|
|
5734
|
+
selector: '[solaris-card-description]',
|
|
5735
|
+
standalone: true,
|
|
5736
|
+
host: { class: 'solaris-card-slot solaris-card-slot--description' },
|
|
5737
|
+
}]
|
|
5738
|
+
}] });
|
|
5739
|
+
class SolarisCardMetaDirective {
|
|
5740
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardMetaDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
5741
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisCardMetaDirective, isStandalone: true, selector: "[solaris-card-meta]", host: { classAttribute: "solaris-card-slot solaris-card-slot--meta" }, ngImport: i0 });
|
|
5742
|
+
}
|
|
5743
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardMetaDirective, decorators: [{
|
|
5744
|
+
type: Directive,
|
|
5745
|
+
args: [{
|
|
5746
|
+
selector: '[solaris-card-meta]',
|
|
5747
|
+
standalone: true,
|
|
5748
|
+
host: { class: 'solaris-card-slot solaris-card-slot--meta' },
|
|
5749
|
+
}]
|
|
5750
|
+
}] });
|
|
5751
|
+
class SolarisCardBadgeDirective {
|
|
5752
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardBadgeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
5753
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisCardBadgeDirective, isStandalone: true, selector: "[solaris-card-badge]", host: { classAttribute: "solaris-card-slot solaris-card-slot--badge" }, ngImport: i0 });
|
|
5754
|
+
}
|
|
5755
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardBadgeDirective, decorators: [{
|
|
5756
|
+
type: Directive,
|
|
5757
|
+
args: [{
|
|
5758
|
+
selector: '[solaris-card-badge]',
|
|
5759
|
+
standalone: true,
|
|
5760
|
+
host: { class: 'solaris-card-slot solaris-card-slot--badge' },
|
|
5761
|
+
}]
|
|
5762
|
+
}] });
|
|
5763
|
+
class SolarisCardActionsDirective {
|
|
5764
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardActionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
5765
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisCardActionsDirective, isStandalone: true, selector: "[solaris-card-actions]", host: { attributes: { "data-card-actions": "true" }, classAttribute: "solaris-card-slot solaris-card-slot--actions" }, ngImport: i0 });
|
|
5766
|
+
}
|
|
5767
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardActionsDirective, decorators: [{
|
|
5768
|
+
type: Directive,
|
|
5769
|
+
args: [{
|
|
5770
|
+
selector: '[solaris-card-actions]',
|
|
5771
|
+
standalone: true,
|
|
5772
|
+
host: {
|
|
5773
|
+
class: 'solaris-card-slot solaris-card-slot--actions',
|
|
5774
|
+
'data-card-actions': 'true',
|
|
5775
|
+
},
|
|
5776
|
+
}]
|
|
5777
|
+
}] });
|
|
5778
|
+
class SolarisCardFooterDirective {
|
|
5779
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
5780
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisCardFooterDirective, isStandalone: true, selector: "[solaris-card-footer]", host: { classAttribute: "solaris-card-slot solaris-card-slot--footer" }, ngImport: i0 });
|
|
5781
|
+
}
|
|
5782
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardFooterDirective, decorators: [{
|
|
5783
|
+
type: Directive,
|
|
5784
|
+
args: [{
|
|
5785
|
+
selector: '[solaris-card-footer]',
|
|
5786
|
+
standalone: true,
|
|
5787
|
+
host: { class: 'solaris-card-slot solaris-card-slot--footer' },
|
|
5788
|
+
}]
|
|
5789
|
+
}] });
|
|
5790
|
+
const SOLARIS_CARD_SLOT_DIRECTIVES = [
|
|
5791
|
+
SolarisCardMediaDirective,
|
|
5792
|
+
SolarisCardEyebrowDirective,
|
|
5793
|
+
SolarisCardTitleDirective,
|
|
5794
|
+
SolarisCardDescriptionDirective,
|
|
5795
|
+
SolarisCardMetaDirective,
|
|
5796
|
+
SolarisCardBadgeDirective,
|
|
5797
|
+
SolarisCardActionsDirective,
|
|
5798
|
+
SolarisCardFooterDirective,
|
|
5799
|
+
];
|
|
5800
|
+
|
|
5801
|
+
class SolarisAvatarOverlayDirective {
|
|
5802
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisAvatarOverlayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
5803
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisAvatarOverlayDirective, isStandalone: true, selector: "[solaris-avatar-overlay]", ngImport: i0 });
|
|
5804
|
+
}
|
|
5805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisAvatarOverlayDirective, decorators: [{
|
|
5806
|
+
type: Directive,
|
|
5807
|
+
args: [{
|
|
5808
|
+
selector: '[solaris-avatar-overlay]',
|
|
5809
|
+
standalone: true,
|
|
5810
|
+
}]
|
|
5811
|
+
}] });
|
|
5812
|
+
|
|
5813
|
+
class SolarisAvatarPresence {
|
|
5814
|
+
translation = inject(SOLARIS_TRANSLATION, { optional: true });
|
|
5815
|
+
translationConfiguration = inject(SOLARIS_TRANSLATION_CONFIGURATION, { optional: true });
|
|
5816
|
+
destroyRef = inject(DestroyRef);
|
|
5817
|
+
presence = input('offline', ...(ngDevMode ? [{ debugName: "presence" }] : []));
|
|
5818
|
+
timezone = input(null, ...(ngDevMode ? [{ debugName: "timezone" }] : []));
|
|
5819
|
+
lastSeenAt = input(null, ...(ngDevMode ? [{ debugName: "lastSeenAt" }] : []));
|
|
5820
|
+
quietHours = input(false, ...(ngDevMode ? [{ debugName: "quietHours" }] : []));
|
|
5821
|
+
workHoursStart = input(9, ...(ngDevMode ? [{ debugName: "workHoursStart" }] : []));
|
|
5822
|
+
workHoursEnd = input(18, ...(ngDevMode ? [{ debugName: "workHoursEnd" }] : []));
|
|
5823
|
+
shape = input('circle', ...(ngDevMode ? [{ debugName: "shape" }] : []));
|
|
5824
|
+
ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : {}), alias: 'aria-label' });
|
|
5825
|
+
ariaHidden = input(false, { ...(ngDevMode ? { debugName: "ariaHidden" } : {}), alias: 'aria-hidden', transform: booleanAttribute });
|
|
5826
|
+
hostClass = 'solaris-avatar-presence-host';
|
|
5827
|
+
nowTick = signal(Date.now(), ...(ngDevMode ? [{ debugName: "nowTick" }] : []));
|
|
5828
|
+
fallbackLanguage = this.translationConfiguration?.defaultLanguage ?? 'en-US';
|
|
5829
|
+
activeLanguage = this.translation
|
|
5830
|
+
? toSignal(this.translation.languageChanges(), {
|
|
5831
|
+
initialValue: this.translation.language(),
|
|
5832
|
+
})
|
|
5833
|
+
: signal(this.fallbackLanguage);
|
|
5834
|
+
browserTimezone = typeof Intl === 'undefined'
|
|
5835
|
+
? null
|
|
5836
|
+
: Intl.DateTimeFormat().resolvedOptions().timeZone || null;
|
|
5837
|
+
constructor() {
|
|
5838
|
+
if (globalThis.window !== undefined) {
|
|
5839
|
+
const intervalId = globalThis.setInterval(() => {
|
|
5840
|
+
this.nowTick.set(Date.now());
|
|
5841
|
+
}, 60_000);
|
|
5842
|
+
this.destroyRef.onDestroy(() => {
|
|
5843
|
+
globalThis.clearInterval(intervalId);
|
|
5844
|
+
});
|
|
5845
|
+
}
|
|
5846
|
+
}
|
|
5847
|
+
normalizedTimezone = computed(() => this.normalize(this.timezone()), ...(ngDevMode ? [{ debugName: "normalizedTimezone" }] : []));
|
|
5848
|
+
normalizedAriaLabel = computed(() => this.normalize(this.ariaLabel()), ...(ngDevMode ? [{ debugName: "normalizedAriaLabel" }] : []));
|
|
5849
|
+
parsedLastSeenAt = computed(() => this.parseDate(this.lastSeenAt()), ...(ngDevMode ? [{ debugName: "parsedLastSeenAt" }] : []));
|
|
5850
|
+
effectiveTimezone = computed(() => {
|
|
5851
|
+
return this.normalizedTimezone() || this.browserTimezone || null;
|
|
5852
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveTimezone" }] : []));
|
|
5853
|
+
intlLocale = computed(() => {
|
|
5854
|
+
const lang = this.activeLanguage() || this.fallbackLanguage || 'en-US';
|
|
5855
|
+
return lang.replace('_', '-');
|
|
5856
|
+
}, ...(ngDevMode ? [{ debugName: "intlLocale" }] : []));
|
|
5857
|
+
translationPrefix = computed(() => {
|
|
5858
|
+
const uiScope = this.translationConfiguration?.uiScope ?? 'ui';
|
|
5859
|
+
return `${uiScope}.solaris.avatar.presence`;
|
|
5860
|
+
}, ...(ngDevMode ? [{ debugName: "translationPrefix" }] : []));
|
|
5861
|
+
normalizedWorkHours = computed(() => {
|
|
5862
|
+
const start = this.coerceHour(this.workHoursStart(), 9, 0, 23);
|
|
5863
|
+
const end = this.coerceHour(this.workHoursEnd(), 18, 1, 24);
|
|
5864
|
+
if (end <= start) {
|
|
5865
|
+
return { start: 9, end: 18 };
|
|
5866
|
+
}
|
|
5867
|
+
return { start, end };
|
|
5868
|
+
}, ...(ngDevMode ? [{ debugName: "normalizedWorkHours" }] : []));
|
|
5869
|
+
currentTimeContext = computed(() => {
|
|
5870
|
+
this.nowTick();
|
|
5871
|
+
this.activeLanguage();
|
|
5872
|
+
const timezone = this.effectiveTimezone();
|
|
5873
|
+
if (!timezone || typeof Intl === 'undefined') {
|
|
5874
|
+
return null;
|
|
5875
|
+
}
|
|
5876
|
+
try {
|
|
5877
|
+
const formatter = new Intl.DateTimeFormat('en-US', {
|
|
5878
|
+
hour: 'numeric',
|
|
5879
|
+
weekday: 'short',
|
|
5880
|
+
hourCycle: 'h23',
|
|
5881
|
+
timeZone: timezone,
|
|
5882
|
+
});
|
|
5883
|
+
const parts = formatter.formatToParts(new Date(this.nowTick()));
|
|
5884
|
+
const hour = Number(parts.find((part) => part.type === 'hour')?.value ?? Number.NaN);
|
|
5885
|
+
const weekday = parts.find((part) => part.type === 'weekday')?.value ?? '';
|
|
5886
|
+
if (Number.isNaN(hour)) {
|
|
5887
|
+
return null;
|
|
5888
|
+
}
|
|
5889
|
+
const weekdayIndex = this.resolveWeekdayIndex(weekday);
|
|
5890
|
+
return {
|
|
5891
|
+
hour,
|
|
5892
|
+
timezone,
|
|
5893
|
+
isWeekend: weekdayIndex === 0 || weekdayIndex === 6,
|
|
5894
|
+
};
|
|
5895
|
+
}
|
|
5896
|
+
catch {
|
|
5897
|
+
return null;
|
|
5898
|
+
}
|
|
5899
|
+
}, ...(ngDevMode ? [{ debugName: "currentTimeContext" }] : []));
|
|
5900
|
+
isQuietHoursAuto = computed(() => {
|
|
5901
|
+
const context = this.currentTimeContext();
|
|
5902
|
+
if (!context) {
|
|
5903
|
+
return false;
|
|
5904
|
+
}
|
|
5905
|
+
if (context.isWeekend) {
|
|
5906
|
+
return true;
|
|
5907
|
+
}
|
|
5908
|
+
const { start, end } = this.normalizedWorkHours();
|
|
5909
|
+
return context.hour < start || context.hour >= end;
|
|
5910
|
+
}, ...(ngDevMode ? [{ debugName: "isQuietHoursAuto" }] : []));
|
|
5911
|
+
showQuietHoursAccent = computed(() => {
|
|
5912
|
+
const mode = this.quietHours();
|
|
5913
|
+
if (mode === true)
|
|
5914
|
+
return true;
|
|
5915
|
+
if (mode === false)
|
|
5916
|
+
return false;
|
|
5917
|
+
return this.isQuietHoursAuto();
|
|
5918
|
+
}, ...(ngDevMode ? [{ debugName: "showQuietHoursAccent" }] : []));
|
|
5919
|
+
showDndSlash = computed(() => this.presence() === 'dnd', ...(ngDevMode ? [{ debugName: "showDndSlash" }] : []));
|
|
5920
|
+
stateClasses = computed(() => ([
|
|
5921
|
+
`state-${this.presence()}`,
|
|
5922
|
+
this.showQuietHoursAccent() ? 'has-quiet-hours' : '',
|
|
5923
|
+
]), ...(ngDevMode ? [{ debugName: "stateClasses" }] : []));
|
|
5924
|
+
titleText = computed(() => {
|
|
5925
|
+
if (this.ariaHidden())
|
|
5926
|
+
return null;
|
|
5927
|
+
this.activeLanguage();
|
|
5928
|
+
return this.buildSemanticText();
|
|
5929
|
+
}, ...(ngDevMode ? [{ debugName: "titleText" }] : []));
|
|
5930
|
+
resolvedAriaLabel = computed(() => {
|
|
5931
|
+
if (this.ariaHidden())
|
|
5932
|
+
return null;
|
|
5933
|
+
this.activeLanguage();
|
|
5934
|
+
return this.normalizedAriaLabel() || this.buildSemanticText();
|
|
5935
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : []));
|
|
5936
|
+
buildSemanticText() {
|
|
5937
|
+
const parts = [this.translate(`states.${this.presence()}`)];
|
|
5938
|
+
if (this.presence() === 'offline') {
|
|
5939
|
+
const lastSeen = this.getLastSeenLabel(this.parsedLastSeenAt());
|
|
5940
|
+
if (lastSeen) {
|
|
5941
|
+
parts.push(lastSeen);
|
|
5942
|
+
}
|
|
5943
|
+
}
|
|
5944
|
+
if (this.showQuietHoursAccent()) {
|
|
5945
|
+
parts.push(this.translate('quietHours'));
|
|
5946
|
+
}
|
|
5947
|
+
return parts.join(' • ');
|
|
5948
|
+
}
|
|
5949
|
+
getLastSeenLabel(value) {
|
|
5950
|
+
if (!value || Number.isNaN(value.getTime())) {
|
|
5951
|
+
return null;
|
|
5952
|
+
}
|
|
5953
|
+
const now = new Date(this.nowTick());
|
|
5954
|
+
const diffMs = Math.max(0, now.getTime() - value.getTime());
|
|
5955
|
+
const minuteMs = 60_000;
|
|
5956
|
+
const hourMs = 60 * minuteMs;
|
|
5957
|
+
if (diffMs < minuteMs) {
|
|
5958
|
+
return this.translate('lastSeen.now');
|
|
5959
|
+
}
|
|
5960
|
+
if (diffMs < hourMs) {
|
|
5961
|
+
return this.translate('lastSeen.minutesAgo', {
|
|
5962
|
+
minutes: Math.floor(diffMs / minuteMs),
|
|
5963
|
+
});
|
|
5964
|
+
}
|
|
5965
|
+
if (diffMs < 6 * hourMs) {
|
|
5966
|
+
return this.translate('lastSeen.hoursAgo', {
|
|
5967
|
+
hours: Math.floor(diffMs / hourMs),
|
|
5968
|
+
});
|
|
5969
|
+
}
|
|
5970
|
+
const timeLabel = this.formatDate(value, {
|
|
5971
|
+
hour: '2-digit',
|
|
5972
|
+
minute: '2-digit',
|
|
5973
|
+
});
|
|
5974
|
+
if (this.isSameCalendarDay(value, now)) {
|
|
5975
|
+
return this.translate('lastSeen.todayAt', {
|
|
5976
|
+
time: timeLabel,
|
|
5977
|
+
});
|
|
5978
|
+
}
|
|
5979
|
+
const yesterday = new Date(now);
|
|
5980
|
+
yesterday.setDate(now.getDate() - 1);
|
|
5981
|
+
if (this.isSameCalendarDay(value, yesterday)) {
|
|
5982
|
+
return this.translate('lastSeen.yesterdayAt', {
|
|
5983
|
+
time: timeLabel,
|
|
5984
|
+
});
|
|
5985
|
+
}
|
|
5986
|
+
return this.translate('lastSeen.onDate', {
|
|
5987
|
+
date: this.formatDate(value, {
|
|
5988
|
+
day: '2-digit',
|
|
5989
|
+
month: '2-digit',
|
|
5990
|
+
year: 'numeric',
|
|
5991
|
+
hour: '2-digit',
|
|
5992
|
+
minute: '2-digit',
|
|
5993
|
+
}),
|
|
5994
|
+
});
|
|
5995
|
+
}
|
|
5996
|
+
formatDate(value, options) {
|
|
5997
|
+
try {
|
|
5998
|
+
return new Intl.DateTimeFormat(this.intlLocale(), options).format(value);
|
|
5999
|
+
}
|
|
6000
|
+
catch {
|
|
6001
|
+
return value.toLocaleString();
|
|
6002
|
+
}
|
|
6003
|
+
}
|
|
6004
|
+
translate(key, params) {
|
|
6005
|
+
const fullKey = `${this.translationPrefix()}.${key}`;
|
|
6006
|
+
if (this.translation) {
|
|
6007
|
+
const translated = this.translation.translate(fullKey, params);
|
|
6008
|
+
if (translated && translated !== fullKey) {
|
|
6009
|
+
return translated;
|
|
6010
|
+
}
|
|
6011
|
+
}
|
|
6012
|
+
return this.fallbackTranslate(key, params);
|
|
6013
|
+
}
|
|
6014
|
+
fallbackTranslate(key, params) {
|
|
6015
|
+
const isPt = this.intlLocale().toLowerCase().startsWith('pt');
|
|
6016
|
+
const dict = isPt
|
|
6017
|
+
? {
|
|
6018
|
+
'states.online': 'Online',
|
|
6019
|
+
'states.offline': 'Offline',
|
|
6020
|
+
'states.away': 'Ausente',
|
|
6021
|
+
'states.busy': 'Ocupado',
|
|
6022
|
+
'states.dnd': 'Não perturbe',
|
|
6023
|
+
'quietHours': 'Fora do expediente local',
|
|
6024
|
+
'lastSeen.now': 'Visto agora',
|
|
6025
|
+
'lastSeen.minutesAgo': `Visto há ${params?.['minutes'] ?? 0} min`,
|
|
6026
|
+
'lastSeen.hoursAgo': `Visto há ${params?.['hours'] ?? 0} h`,
|
|
6027
|
+
'lastSeen.todayAt': `Visto hoje às ${params?.['time'] ?? ''}`,
|
|
6028
|
+
'lastSeen.yesterdayAt': `Visto ontem às ${params?.['time'] ?? ''}`,
|
|
6029
|
+
'lastSeen.onDate': `Visto em ${params?.['date'] ?? ''}`,
|
|
6030
|
+
}
|
|
6031
|
+
: {
|
|
6032
|
+
'states.online': 'Online',
|
|
6033
|
+
'states.offline': 'Offline',
|
|
6034
|
+
'states.away': 'Away',
|
|
6035
|
+
'states.busy': 'Busy',
|
|
6036
|
+
'states.dnd': 'Do not disturb',
|
|
6037
|
+
'quietHours': 'Outside local working hours',
|
|
6038
|
+
'lastSeen.now': 'Seen just now',
|
|
6039
|
+
'lastSeen.minutesAgo': `Seen ${params?.['minutes'] ?? 0} min ago`,
|
|
6040
|
+
'lastSeen.hoursAgo': `Seen ${params?.['hours'] ?? 0} h ago`,
|
|
6041
|
+
'lastSeen.todayAt': `Seen today at ${params?.['time'] ?? ''}`,
|
|
6042
|
+
'lastSeen.yesterdayAt': `Seen yesterday at ${params?.['time'] ?? ''}`,
|
|
6043
|
+
'lastSeen.onDate': `Seen on ${params?.['date'] ?? ''}`,
|
|
6044
|
+
};
|
|
6045
|
+
return dict[key] ?? key;
|
|
6046
|
+
}
|
|
6047
|
+
isSameCalendarDay(a, b) {
|
|
6048
|
+
return a.getFullYear() === b.getFullYear()
|
|
6049
|
+
&& a.getMonth() === b.getMonth()
|
|
6050
|
+
&& a.getDate() === b.getDate();
|
|
6051
|
+
}
|
|
6052
|
+
resolveWeekdayIndex(weekday) {
|
|
6053
|
+
switch (weekday.toLowerCase()) {
|
|
6054
|
+
case 'sun': return 0;
|
|
6055
|
+
case 'mon': return 1;
|
|
6056
|
+
case 'tue': return 2;
|
|
6057
|
+
case 'wed': return 3;
|
|
6058
|
+
case 'thu': return 4;
|
|
6059
|
+
case 'fri': return 5;
|
|
6060
|
+
case 'sat': return 6;
|
|
6061
|
+
default: return -1;
|
|
6062
|
+
}
|
|
6063
|
+
}
|
|
6064
|
+
coerceHour(value, fallback, min, max) {
|
|
6065
|
+
const numeric = Number(value);
|
|
6066
|
+
if (Number.isNaN(numeric)) {
|
|
6067
|
+
return fallback;
|
|
6068
|
+
}
|
|
6069
|
+
return Math.min(Math.max(Math.floor(numeric), min), max);
|
|
6070
|
+
}
|
|
6071
|
+
parseDate(value) {
|
|
6072
|
+
if (value == null || value === '') {
|
|
6073
|
+
return null;
|
|
6074
|
+
}
|
|
6075
|
+
if (value instanceof Date) {
|
|
6076
|
+
return Number.isNaN(value.getTime()) ? null : value;
|
|
6077
|
+
}
|
|
6078
|
+
const parsed = new Date(value);
|
|
6079
|
+
return Number.isNaN(parsed.getTime()) ? null : parsed;
|
|
6080
|
+
}
|
|
6081
|
+
normalize(value) {
|
|
6082
|
+
return String(value ?? '').trim();
|
|
6083
|
+
}
|
|
6084
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisAvatarPresence, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6085
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisAvatarPresence, isStandalone: true, selector: "solaris-avatar-presence", inputs: { presence: { classPropertyName: "presence", publicName: "presence", isSignal: true, isRequired: false, transformFunction: null }, timezone: { classPropertyName: "timezone", publicName: "timezone", isSignal: true, isRequired: false, transformFunction: null }, lastSeenAt: { classPropertyName: "lastSeenAt", publicName: "lastSeenAt", isSignal: true, isRequired: false, transformFunction: null }, quietHours: { classPropertyName: "quietHours", publicName: "quietHours", isSignal: true, isRequired: false, transformFunction: null }, workHoursStart: { classPropertyName: "workHoursStart", publicName: "workHoursStart", isSignal: true, isRequired: false, transformFunction: null }, workHoursEnd: { classPropertyName: "workHoursEnd", publicName: "workHoursEnd", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaHidden: { classPropertyName: "ariaHidden", publicName: "aria-hidden", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClass" } }, ngImport: i0, template: "<span class=\"solaris-avatar-presence\" [attr.title]=\"titleText()\"\r\n [attr.aria-label]=\"resolvedAriaLabel()\" [attr.aria-hidden]=\"ariaHidden() ? 'true' : null\"\r\n [ngClass]=\"[...stateClasses(), shape() === 'square' ? 'shape-square' : 'shape-circle']\">\r\n <span class=\"solaris-avatar-presence__dot\" aria-hidden=\"true\">\r\n @if (showDndSlash()) {\r\n <span class=\"solaris-avatar-presence__slash\"></span>\r\n }\r\n </span>\r\n\r\n @if (showQuietHoursAccent()) {\r\n <span class=\"solaris-avatar-presence__quiet\" aria-hidden=\"true\">z</span>\r\n }\r\n</span>\r\n", styles: [".solaris-avatar-presence-host{display:inline-flex}.solaris-avatar-presence{--solaris-avatar-presence-fg: #e5e7ebff;--solaris-avatar-presence-dot-size: 1.8rem;--solaris-avatar-presence-quiet-size: .9rem;--solaris-avatar-presence-slash-width: .2rem;--solaris-avatar-presence-bg: var(--solaris-color-text-muted);--solaris-avatar-presence-ring: .15rem solid var(--solaris-color-surface-2);flex-shrink:0;line-height:1;-webkit-user-select:none;user-select:none;position:relative;display:inline-block;block-size:var(--solaris-avatar-presence-dot-size);inline-size:var(--solaris-avatar-presence-dot-size)}.solaris-avatar-presence__dot{inset:0;block-size:100%;inline-size:100%;min-block-size:0;min-inline-size:0;position:absolute;align-items:center;display:inline-flex;justify-content:center;box-shadow:var(--solaris-shadow-xs);color:var(--solaris-avatar-presence-fg);border-radius:var(--solaris-radius-full);border:var(--solaris-avatar-presence-ring);background:var(--solaris-avatar-presence-bg)}.solaris-avatar-presence.shape-square{--solaris-avatar-presence-dot-size: 1.6rem}.solaris-avatar-presence.shape-square .solaris-avatar-presence__dot{border-radius:.5rem}.solaris-avatar-presence.shape-square .solaris-avatar-presence__quiet{inset-block-end:-.25rem;inset-inline-end:-.05rem}.solaris-avatar-presence__slash{display:block;inline-size:70%;max-inline-size:100%;background:currentColor;border-radius:var(--solaris-radius-full);block-size:var(--solaris-avatar-presence-slash-width)}.solaris-avatar-presence__quiet{border:0;z-index:2;line-height:1;font-weight:900;box-shadow:none;position:absolute;font-size:1.125rem;align-items:center;display:inline-flex;justify-content:center;background:transparent;letter-spacing:-.1em;paint-order:stroke fill;text-transform:lowercase;inset-block-end:-.15rem;inset-inline-end:.15rem;-webkit-text-stroke:2px var(--solaris-color-surface);filter:drop-shadow(0 0 .08rem var(--solaris-color-surface)) drop-shadow(0 0 .08rem var(--solaris-color-surface));color:color-mix(in srgb,var(--solaris-color-text-muted) 92%,transparent)}.solaris-avatar-presence.state-online{--solaris-avatar-presence-bg: var(--solaris-color-success)}.solaris-avatar-presence.state-away{--solaris-avatar-presence-fg: var(--solaris-color-text);--solaris-avatar-presence-bg: var(--solaris-color-warning)}.solaris-avatar-presence.state-busy{--solaris-avatar-presence-bg: var(--solaris-color-error)}.solaris-avatar-presence.state-dnd{--solaris-avatar-presence-bg: color-mix(in srgb, var(--solaris-color-error) 75%, black);--solaris-avatar-presence-fg: color-mix(in srgb, #e5e7ebff 75%, transparent)}.solaris-avatar-presence.state-offline{--solaris-avatar-presence-bg: color-mix(in srgb, var(--solaris-color-text-muted) 60%, black)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6086
|
+
}
|
|
6087
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisAvatarPresence, decorators: [{
|
|
6088
|
+
type: Component,
|
|
6089
|
+
args: [{ selector: 'solaris-avatar-presence', standalone: true, imports: [NgClass], changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"solaris-avatar-presence\" [attr.title]=\"titleText()\"\r\n [attr.aria-label]=\"resolvedAriaLabel()\" [attr.aria-hidden]=\"ariaHidden() ? 'true' : null\"\r\n [ngClass]=\"[...stateClasses(), shape() === 'square' ? 'shape-square' : 'shape-circle']\">\r\n <span class=\"solaris-avatar-presence__dot\" aria-hidden=\"true\">\r\n @if (showDndSlash()) {\r\n <span class=\"solaris-avatar-presence__slash\"></span>\r\n }\r\n </span>\r\n\r\n @if (showQuietHoursAccent()) {\r\n <span class=\"solaris-avatar-presence__quiet\" aria-hidden=\"true\">z</span>\r\n }\r\n</span>\r\n", styles: [".solaris-avatar-presence-host{display:inline-flex}.solaris-avatar-presence{--solaris-avatar-presence-fg: #e5e7ebff;--solaris-avatar-presence-dot-size: 1.8rem;--solaris-avatar-presence-quiet-size: .9rem;--solaris-avatar-presence-slash-width: .2rem;--solaris-avatar-presence-bg: var(--solaris-color-text-muted);--solaris-avatar-presence-ring: .15rem solid var(--solaris-color-surface-2);flex-shrink:0;line-height:1;-webkit-user-select:none;user-select:none;position:relative;display:inline-block;block-size:var(--solaris-avatar-presence-dot-size);inline-size:var(--solaris-avatar-presence-dot-size)}.solaris-avatar-presence__dot{inset:0;block-size:100%;inline-size:100%;min-block-size:0;min-inline-size:0;position:absolute;align-items:center;display:inline-flex;justify-content:center;box-shadow:var(--solaris-shadow-xs);color:var(--solaris-avatar-presence-fg);border-radius:var(--solaris-radius-full);border:var(--solaris-avatar-presence-ring);background:var(--solaris-avatar-presence-bg)}.solaris-avatar-presence.shape-square{--solaris-avatar-presence-dot-size: 1.6rem}.solaris-avatar-presence.shape-square .solaris-avatar-presence__dot{border-radius:.5rem}.solaris-avatar-presence.shape-square .solaris-avatar-presence__quiet{inset-block-end:-.25rem;inset-inline-end:-.05rem}.solaris-avatar-presence__slash{display:block;inline-size:70%;max-inline-size:100%;background:currentColor;border-radius:var(--solaris-radius-full);block-size:var(--solaris-avatar-presence-slash-width)}.solaris-avatar-presence__quiet{border:0;z-index:2;line-height:1;font-weight:900;box-shadow:none;position:absolute;font-size:1.125rem;align-items:center;display:inline-flex;justify-content:center;background:transparent;letter-spacing:-.1em;paint-order:stroke fill;text-transform:lowercase;inset-block-end:-.15rem;inset-inline-end:.15rem;-webkit-text-stroke:2px var(--solaris-color-surface);filter:drop-shadow(0 0 .08rem var(--solaris-color-surface)) drop-shadow(0 0 .08rem var(--solaris-color-surface));color:color-mix(in srgb,var(--solaris-color-text-muted) 92%,transparent)}.solaris-avatar-presence.state-online{--solaris-avatar-presence-bg: var(--solaris-color-success)}.solaris-avatar-presence.state-away{--solaris-avatar-presence-fg: var(--solaris-color-text);--solaris-avatar-presence-bg: var(--solaris-color-warning)}.solaris-avatar-presence.state-busy{--solaris-avatar-presence-bg: var(--solaris-color-error)}.solaris-avatar-presence.state-dnd{--solaris-avatar-presence-bg: color-mix(in srgb, var(--solaris-color-error) 75%, black);--solaris-avatar-presence-fg: color-mix(in srgb, #e5e7ebff 75%, transparent)}.solaris-avatar-presence.state-offline{--solaris-avatar-presence-bg: color-mix(in srgb, var(--solaris-color-text-muted) 60%, black)}\n"] }]
|
|
6090
|
+
}], ctorParameters: () => [], propDecorators: { presence: [{ type: i0.Input, args: [{ isSignal: true, alias: "presence", required: false }] }], timezone: [{ type: i0.Input, args: [{ isSignal: true, alias: "timezone", required: false }] }], lastSeenAt: [{ type: i0.Input, args: [{ isSignal: true, alias: "lastSeenAt", required: false }] }], quietHours: [{ type: i0.Input, args: [{ isSignal: true, alias: "quietHours", required: false }] }], workHoursStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "workHoursStart", required: false }] }], workHoursEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "workHoursEnd", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-hidden", required: false }] }], hostClass: [{
|
|
6091
|
+
type: HostBinding,
|
|
6092
|
+
args: ['class']
|
|
6093
|
+
}] } });
|
|
6094
|
+
|
|
6095
|
+
class SolarisAvatar {
|
|
6096
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
6097
|
+
shape = input('circle', ...(ngDevMode ? [{ debugName: "shape" }] : []));
|
|
6098
|
+
variant = input('auto', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
6099
|
+
src = input(null, ...(ngDevMode ? [{ debugName: "src" }] : []));
|
|
6100
|
+
alt = input(null, ...(ngDevMode ? [{ debugName: "alt" }] : []));
|
|
6101
|
+
name = input(null, ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
6102
|
+
initials = input(null, ...(ngDevMode ? [{ debugName: "initials" }] : []));
|
|
6103
|
+
color = input('surface', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
6104
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : {}), transform: booleanAttribute });
|
|
6105
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
6106
|
+
interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : {}), transform: booleanAttribute });
|
|
6107
|
+
buttonType = input('button', ...(ngDevMode ? [{ debugName: "buttonType" }] : []));
|
|
6108
|
+
asButton = input(false, { ...(ngDevMode ? { debugName: "asButton" } : {}), transform: booleanAttribute });
|
|
6109
|
+
radius = input(null, ...(ngDevMode ? [{ debugName: "radius" }] : []));
|
|
6110
|
+
objectFit = input('cover', ...(ngDevMode ? [{ debugName: "objectFit" }] : []));
|
|
6111
|
+
ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : {}), alias: 'aria-label' });
|
|
6112
|
+
ariaHidden = input(false, { ...(ngDevMode ? { debugName: "ariaHidden" } : {}), alias: 'aria-hidden', transform: booleanAttribute });
|
|
6113
|
+
hostClass = 'solaris-avatar-host';
|
|
6114
|
+
imageFailed = signal(false, ...(ngDevMode ? [{ debugName: "imageFailed" }] : []));
|
|
6115
|
+
presetColors = new Set([
|
|
6116
|
+
'primary',
|
|
6117
|
+
'surface',
|
|
6118
|
+
'success',
|
|
6119
|
+
'warning',
|
|
6120
|
+
'error',
|
|
6121
|
+
'info',
|
|
6122
|
+
]);
|
|
6123
|
+
constructor() {
|
|
6124
|
+
effect(() => {
|
|
6125
|
+
this.src();
|
|
6126
|
+
this.imageFailed.set(false);
|
|
6127
|
+
});
|
|
6128
|
+
}
|
|
6129
|
+
normalizedSrc = computed(() => this.normalize(this.src()), ...(ngDevMode ? [{ debugName: "normalizedSrc" }] : []));
|
|
6130
|
+
normalizedAlt = computed(() => this.normalize(this.alt()), ...(ngDevMode ? [{ debugName: "normalizedAlt" }] : []));
|
|
6131
|
+
normalizedName = computed(() => this.normalize(this.name()), ...(ngDevMode ? [{ debugName: "normalizedName" }] : []));
|
|
6132
|
+
normalizedInitials = computed(() => this.normalize(this.initials()), ...(ngDevMode ? [{ debugName: "normalizedInitials" }] : []));
|
|
6133
|
+
normalizedAriaLabel = computed(() => this.normalize(this.ariaLabel()), ...(ngDevMode ? [{ debugName: "normalizedAriaLabel" }] : []));
|
|
6134
|
+
resolvedInitials = computed(() => {
|
|
6135
|
+
const explicit = this.normalizedInitials();
|
|
6136
|
+
if (explicit)
|
|
6137
|
+
return explicit.slice(0, 2).toUpperCase();
|
|
6138
|
+
const name = this.normalizedName();
|
|
6139
|
+
if (!name)
|
|
6140
|
+
return '';
|
|
6141
|
+
const parts = name.split(/\s+/).map(part => part.trim()).filter(Boolean);
|
|
6142
|
+
if (!parts.length)
|
|
6143
|
+
return '';
|
|
6144
|
+
if (parts.length === 1)
|
|
6145
|
+
return parts[0].slice(0, 1).toUpperCase();
|
|
6146
|
+
const first = parts[0]?.slice(0, 1) ?? '';
|
|
6147
|
+
const last = parts.at(-1)?.slice(0, 1) ?? '';
|
|
6148
|
+
return `${first}${last}`.toUpperCase();
|
|
6149
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedInitials" }] : []));
|
|
6150
|
+
showImage = computed(() => {
|
|
6151
|
+
if (this.loading())
|
|
6152
|
+
return false;
|
|
6153
|
+
const variant = this.variant();
|
|
6154
|
+
if (variant === 'letter' || variant === 'default')
|
|
6155
|
+
return false;
|
|
6156
|
+
return !!this.normalizedSrc() && !this.imageFailed();
|
|
6157
|
+
}, ...(ngDevMode ? [{ debugName: "showImage" }] : []));
|
|
6158
|
+
showLetter = computed(() => {
|
|
6159
|
+
if (this.loading())
|
|
6160
|
+
return false;
|
|
6161
|
+
const variant = this.variant();
|
|
6162
|
+
const initials = this.resolvedInitials();
|
|
6163
|
+
if (!initials)
|
|
6164
|
+
return false;
|
|
6165
|
+
if (variant === 'letter')
|
|
6166
|
+
return true;
|
|
6167
|
+
if (variant === 'default')
|
|
6168
|
+
return false;
|
|
6169
|
+
return !this.showImage();
|
|
6170
|
+
}, ...(ngDevMode ? [{ debugName: "showLetter" }] : []));
|
|
6171
|
+
showDefault = computed(() => {
|
|
6172
|
+
if (this.loading())
|
|
6173
|
+
return false;
|
|
6174
|
+
return !this.showImage() && !this.showLetter();
|
|
6175
|
+
}, ...(ngDevMode ? [{ debugName: "showDefault" }] : []));
|
|
6176
|
+
isCustomColor = computed(() => !this.presetColors.has(this.color()), ...(ngDevMode ? [{ debugName: "isCustomColor" }] : []));
|
|
6177
|
+
colorClass = computed(() => {
|
|
6178
|
+
return this.isCustomColor() ? 'color-custom' : `color-${this.color()}`;
|
|
6179
|
+
}, ...(ngDevMode ? [{ debugName: "colorClass" }] : []));
|
|
6180
|
+
customColorValue = computed(() => {
|
|
6181
|
+
return this.isCustomColor() ? String(this.color()) : null;
|
|
6182
|
+
}, ...(ngDevMode ? [{ debugName: "customColorValue" }] : []));
|
|
6183
|
+
resolvedRadius = computed(() => {
|
|
6184
|
+
const radius = this.normalize(this.radius());
|
|
6185
|
+
if (!radius) {
|
|
6186
|
+
return this.shape() === 'circle'
|
|
6187
|
+
? 'var(--solaris-avatar-radius-circle)'
|
|
6188
|
+
: 'var(--solaris-avatar-radius-square)';
|
|
6189
|
+
}
|
|
6190
|
+
switch (radius) {
|
|
6191
|
+
case 'none': return 'var(--solaris-radius-none)';
|
|
6192
|
+
case 'sm': return 'var(--solaris-radius-sm)';
|
|
6193
|
+
case 'md': return 'var(--solaris-radius-md)';
|
|
6194
|
+
case 'lg': return 'var(--solaris-radius-lg)';
|
|
6195
|
+
case 'full': return 'var(--solaris-radius-full)';
|
|
6196
|
+
default: return radius;
|
|
6197
|
+
}
|
|
6198
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedRadius" }] : []));
|
|
6199
|
+
rootClasses = computed(() => ([
|
|
6200
|
+
`size-${this.size()}`,
|
|
6201
|
+
`shape-${this.shape()}`,
|
|
6202
|
+
this.colorClass(),
|
|
6203
|
+
this.interactive() ? 'is-interactive' : '',
|
|
6204
|
+
this.disabled() ? 'is-disabled' : '',
|
|
6205
|
+
this.loading() ? 'is-loading' : '',
|
|
6206
|
+
this.asButton() ? 'is-button' : '',
|
|
6207
|
+
]), ...(ngDevMode ? [{ debugName: "rootClasses" }] : []));
|
|
6208
|
+
accessibleLabel = computed(() => {
|
|
6209
|
+
if (this.ariaHidden())
|
|
6210
|
+
return null;
|
|
6211
|
+
return this.normalizedAriaLabel()
|
|
6212
|
+
|| this.normalizedAlt()
|
|
6213
|
+
|| this.normalizedName()
|
|
6214
|
+
|| this.resolvedInitials()
|
|
6215
|
+
|| 'Avatar';
|
|
6216
|
+
}, ...(ngDevMode ? [{ debugName: "accessibleLabel" }] : []));
|
|
6217
|
+
rootRole = computed(() => {
|
|
6218
|
+
if (this.ariaHidden() || this.asButton())
|
|
6219
|
+
return null;
|
|
6220
|
+
return 'img';
|
|
6221
|
+
}, ...(ngDevMode ? [{ debugName: "rootRole" }] : []));
|
|
6222
|
+
onImageLoad() {
|
|
6223
|
+
this.imageFailed.set(false);
|
|
6224
|
+
}
|
|
6225
|
+
onImageError() {
|
|
6226
|
+
this.imageFailed.set(true);
|
|
6227
|
+
}
|
|
6228
|
+
normalize(value) {
|
|
6229
|
+
return String(value ?? '').trim();
|
|
6230
|
+
}
|
|
6231
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisAvatar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6232
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisAvatar, isStandalone: true, selector: "solaris-avatar", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, initials: { classPropertyName: "initials", publicName: "initials", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, buttonType: { classPropertyName: "buttonType", publicName: "buttonType", isSignal: true, isRequired: false, transformFunction: null }, asButton: { classPropertyName: "asButton", publicName: "asButton", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, objectFit: { classPropertyName: "objectFit", publicName: "objectFit", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaHidden: { classPropertyName: "ariaHidden", publicName: "aria-hidden", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClass" } }, ngImport: i0, template: "@if (asButton()) {\r\n <button class=\"solaris-avatar\" [ngClass]=\"rootClasses()\" [type]=\"buttonType()\" [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"accessibleLabel()\" [attr.aria-hidden]=\"ariaHidden() ? 'true' : null\"\r\n [style.--solaris-avatar-radius]=\"resolvedRadius()\" [style.--solaris-avatar-image-fit]=\"objectFit()\"\r\n [style.--solaris-avatar-custom-bg]=\"customColorValue()\">\r\n <span class=\"solaris-avatar__body\">\r\n @if (loading()) {\r\n <span class=\"solaris-avatar__skeleton\" aria-hidden=\"true\"></span>\r\n } @else if (showImage()) {\r\n <img class=\"solaris-avatar__image\" [src]=\"normalizedSrc()\" alt=\"\" aria-hidden=\"true\"\r\n decoding=\"async\" (load)=\"onImageLoad()\" (error)=\"onImageError()\">\r\n } @else if (showLetter()) {\r\n <span class=\"solaris-avatar__label\" aria-hidden=\"true\">\r\n {{ resolvedInitials() }}\r\n </span>\r\n } @else if (showDefault()) {\r\n <span class=\"solaris-avatar__placeholder\" aria-hidden=\"true\">\r\n <svg class=\"solaris-avatar__placeholder-svg\" viewBox=\"0 0 64 64\" preserveAspectRatio=\"xMidYMid meet\"\r\n xmlns=\"http://www.w3.org/2000/svg\">\r\n <circle class=\"solaris-avatar__placeholder-head\" cx=\"32\" cy=\"25\" r=\"14\"></circle>\r\n <path class=\"solaris-avatar__placeholder-body\" d=\"M2 64 C6 50, 18 42, 32 45 C46 42, 58 50, 62 64 Z\"></path>\r\n </svg>\r\n </span>\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-avatar__overlay\" aria-hidden=\"true\">\r\n <ng-content></ng-content>\r\n </span>\r\n </button>\r\n} @else {\r\n <span class=\"solaris-avatar\" [ngClass]=\"rootClasses()\" [attr.role]=\"rootRole()\" [attr.aria-label]=\"accessibleLabel()\"\r\n [attr.aria-hidden]=\"ariaHidden() ? 'true' : null\" [style.--solaris-avatar-radius]=\"resolvedRadius()\"\r\n [style.--solaris-avatar-image-fit]=\"objectFit()\" [style.--solaris-avatar-custom-bg]=\"customColorValue()\">\r\n <span class=\"solaris-avatar__body\">\r\n @if (loading()) {\r\n <span class=\"solaris-avatar__skeleton\" aria-hidden=\"true\"></span>\r\n } @else if (showImage()) {\r\n <img class=\"solaris-avatar__image\" [src]=\"normalizedSrc()\" alt=\"\" aria-hidden=\"true\"\r\n decoding=\"async\" (load)=\"onImageLoad()\" (error)=\"onImageError()\">\r\n } @else if (showLetter()) {\r\n <span class=\"solaris-avatar__label\" aria-hidden=\"true\">{{ resolvedInitials() }}</span>\r\n } @else if (showDefault()) {\r\n <span class=\"solaris-avatar__placeholder\" aria-hidden=\"true\">\r\n <svg class=\"solaris-avatar__placeholder-svg\" viewBox=\"0 0 64 64\" preserveAspectRatio=\"xMidYMid meet\"\r\n xmlns=\"http://www.w3.org/2000/svg\">\r\n <circle class=\"solaris-avatar__placeholder-head\" cx=\"32\" cy=\"25\" r=\"14\"></circle>\r\n <path class=\"solaris-avatar__placeholder-body\" d=\"M2 64 C6 50, 18 42, 32 45 C46 42, 58 50, 62 64 Z\"></path>\r\n </svg>\r\n </span>\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-avatar__overlay\" aria-hidden=\"true\">\r\n <ng-content></ng-content>\r\n </span>\r\n </span>\r\n}\r\n", styles: [".solaris-avatar-host{display:inline-flex;vertical-align:middle}.solaris-avatar{--solaris-avatar-size-xs: 2.4rem;--solaris-avatar-size-sm: 3.2rem;--solaris-avatar-size-md: 4rem;--solaris-avatar-size-lg: 4.8rem;--solaris-avatar-size-xl: 6.4rem;--solaris-avatar-radius-square: var(--solaris-radius-md);--solaris-avatar-radius-circle: var(--solaris-radius-full);--solaris-avatar-bg: var(--solaris-color-surface-2);--solaris-avatar-fg: var(--solaris-color-text);--solaris-avatar-border: color-mix(in srgb, var(--solaris-color-border) 85%, transparent);--solaris-avatar-placeholder-bg: var(--solaris-avatar-bg);--solaris-avatar-placeholder-fg: color-mix(in srgb, var(--solaris-avatar-fg) 62%, transparent);--solaris-avatar-ring-focus: 0 0 0 .3rem color-mix(in srgb, var(--solaris-color-primary) 26%, transparent);--solaris-avatar-shadow: none;--solaris-avatar-shadow-hover: var(--solaris-shadow-xs);--solaris-avatar-opacity-disabled: .56;--solaris-avatar-badge-size: 1.6rem;--solaris-avatar-badge-offset-x: 0;--solaris-avatar-badge-offset-y: 0;--solaris-avatar-badge-border: .2rem solid var(--solaris-color-surface);--solaris-avatar-image-fit: cover;--solaris-avatar-radius: var(--solaris-avatar-radius-circle);inline-size:var(--_avatar-size);block-size:var(--_avatar-size);padding:0;margin:0;border:0;background:transparent;color:inherit;font:inherit;text-decoration:none;position:relative;display:inline-grid;place-items:center;-webkit-user-select:none;user-select:none;overflow:visible;outline:none}.solaris-avatar.size-xs{--_avatar-size: var(--solaris-avatar-size-xs);--solaris-avatar-font-size: var(--solaris-fs-10);--solaris-avatar-badge-size: 1.2rem}.solaris-avatar.size-sm{--_avatar-size: var(--solaris-avatar-size-sm);--solaris-avatar-font-size: var(--solaris-fs-12);--solaris-avatar-badge-size: 1.4rem}.solaris-avatar.size-md{--_avatar-size: var(--solaris-avatar-size-md);--solaris-avatar-font-size: var(--solaris-fs-14);--solaris-avatar-badge-size: 1.6rem}.solaris-avatar.size-lg{--_avatar-size: var(--solaris-avatar-size-lg);--solaris-avatar-font-size: var(--solaris-fs-16);--solaris-avatar-badge-size: 1.8rem}.solaris-avatar.size-xl{--_avatar-size: var(--solaris-avatar-size-xl);--solaris-avatar-font-size: var(--solaris-fs-20);--solaris-avatar-badge-size: 2rem}.solaris-avatar.shape-circle{--solaris-avatar-radius: var(--solaris-avatar-radius-circle)}.solaris-avatar.shape-square{--solaris-avatar-radius: var(--solaris-avatar-radius-square)}.solaris-avatar__body{display:grid;block-size:100%;overflow:hidden;inline-size:100%;place-items:center;color:var(--solaris-avatar-fg);background:var(--solaris-avatar-bg);box-shadow:var(--solaris-avatar-shadow);border-radius:var(--solaris-avatar-radius);border:1px solid var(--solaris-avatar-border);transition:box-shadow .15s ease,transform .15s ease,opacity .15s ease}.solaris-avatar__image{inline-size:100%;block-size:100%;display:block;object-fit:var(--solaris-avatar-image-fit)}.solaris-avatar__label{font-size:var(--solaris-avatar-font-size);font-weight:700;line-height:1;letter-spacing:var(--solaris-ls-sm);text-transform:uppercase}.solaris-avatar__placeholder{display:grid;block-size:100%;inline-size:100%;place-items:stretch;color:var(--solaris-avatar-placeholder-fg)}.solaris-avatar__placeholder-svg{inline-size:100%;block-size:100%;display:block}.solaris-avatar__placeholder-head,.solaris-avatar__placeholder-body{fill:currentColor}.solaris-avatar__overlay{position:absolute;inset-inline-end:var(--solaris-avatar-badge-offset-x);inset-block-end:var(--solaris-avatar-badge-offset-y);z-index:3;display:inline-flex;align-items:center;justify-content:center;min-inline-size:var(--solaris-avatar-badge-size);min-block-size:var(--solaris-avatar-badge-size);transform:translate(35%,35%);pointer-events:none}.solaris-avatar__overlay:empty{display:none}.solaris-avatar__overlay>*{max-inline-size:100%;flex-shrink:0;pointer-events:auto}.solaris-avatar__skeleton{inline-size:100%;block-size:100%;display:block;border-radius:inherit;background:linear-gradient(90deg,color-mix(in srgb,var(--solaris-color-surface-2) 72%,transparent),color-mix(in srgb,white 18%,var(--solaris-color-surface-2)),color-mix(in srgb,var(--solaris-color-surface-2) 72%,transparent));background-size:200% 100%;animation:solaris-avatar-shimmer 1.2s linear infinite}.solaris-avatar.is-interactive:not(.is-disabled),.solaris-avatar.is-button:not(.is-disabled){cursor:pointer}.solaris-avatar.is-interactive:not(.is-disabled):hover .solaris-avatar__body,.solaris-avatar.is-button:not(.is-disabled):hover .solaris-avatar__body{box-shadow:var(--solaris-avatar-shadow-hover)}.solaris-avatar.is-button:focus-visible .solaris-avatar__body{box-shadow:var(--solaris-avatar-ring-focus)}.solaris-avatar.is-disabled{opacity:var(--solaris-avatar-opacity-disabled);cursor:not-allowed}.solaris-avatar.is-disabled .solaris-avatar__body,.solaris-avatar:disabled .solaris-avatar__body{box-shadow:none}.solaris-avatar.shape-square .solaris-avatar__overlay{transform:none;inset-block-end:-.15rem;inset-inline-end:-.15rem}.solaris-avatar.color-surface{--_base: var(--solaris-color-surface-2);--solaris-avatar-bg: color-mix(in srgb, var(--_base) 92%, white);--solaris-avatar-fg: var(--solaris-color-text);--solaris-avatar-border: color-mix(in srgb, var(--solaris-color-border) 70%, var(--_base))}.solaris-avatar.color-primary{--_base: var(--solaris-color-primary);--solaris-avatar-bg: color-mix(in srgb, var(--_base) 22%, var(--solaris-color-surface));--solaris-avatar-fg: color-mix(in srgb, var(--_base) 88%, white);--solaris-avatar-placeholder-fg: color-mix(in srgb, var(--_base) 52%, white);--solaris-avatar-border: color-mix(in srgb, var(--_base) 42%, var(--solaris-color-border))}.solaris-avatar.color-success{--_base: var(--solaris-color-success);--solaris-avatar-bg: color-mix(in srgb, var(--_base) 22%, var(--solaris-color-surface));--solaris-avatar-fg: color-mix(in srgb, var(--_base) 88%, white);--solaris-avatar-placeholder-fg: color-mix(in srgb, var(--_base) 52%, white);--solaris-avatar-border: color-mix(in srgb, var(--_base) 42%, var(--solaris-color-border))}.solaris-avatar.color-warning{--_base: var(--solaris-color-warning);--solaris-avatar-bg: color-mix(in srgb, var(--_base) 22%, var(--solaris-color-surface));--solaris-avatar-fg: color-mix(in srgb, var(--_base) 88%, black);--solaris-avatar-placeholder-fg: color-mix(in srgb, var(--_base) 52%, white);--solaris-avatar-border: color-mix(in srgb, var(--_base) 42%, var(--solaris-color-border))}.solaris-avatar.color-error{--_base: var(--solaris-color-error);--solaris-avatar-bg: color-mix(in srgb, var(--_base) 16%, var(--solaris-color-surface));--solaris-avatar-fg: color-mix(in srgb, var(--_base) 78%, white);--solaris-avatar-border: color-mix(in srgb, var(--_base) 34%, var(--solaris-color-border))}.solaris-avatar.color-info{--_base: var(--solaris-color-info);--solaris-avatar-bg: color-mix(in srgb, var(--_base) 16%, var(--solaris-color-surface));--solaris-avatar-fg: color-mix(in srgb, var(--_base) 78%, white);--solaris-avatar-border: color-mix(in srgb, var(--_base) 34%, var(--solaris-color-border))}.solaris-avatar.color-custom{--_base: var(--solaris-avatar-custom-bg, var(--solaris-color-surface-2));--solaris-avatar-fg: var(--_base);--solaris-avatar-bg: color-mix(in srgb, var(--_base) 18%, var(--solaris-color-surface));--solaris-avatar-border: color-mix(in srgb, var(--_base) 34%, var(--solaris-color-border))}@keyframes solaris-avatar-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6233
|
+
}
|
|
6234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisAvatar, decorators: [{
|
|
6235
|
+
type: Component,
|
|
6236
|
+
args: [{ selector: 'solaris-avatar', standalone: true, imports: [
|
|
6237
|
+
NgClass
|
|
6238
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (asButton()) {\r\n <button class=\"solaris-avatar\" [ngClass]=\"rootClasses()\" [type]=\"buttonType()\" [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"accessibleLabel()\" [attr.aria-hidden]=\"ariaHidden() ? 'true' : null\"\r\n [style.--solaris-avatar-radius]=\"resolvedRadius()\" [style.--solaris-avatar-image-fit]=\"objectFit()\"\r\n [style.--solaris-avatar-custom-bg]=\"customColorValue()\">\r\n <span class=\"solaris-avatar__body\">\r\n @if (loading()) {\r\n <span class=\"solaris-avatar__skeleton\" aria-hidden=\"true\"></span>\r\n } @else if (showImage()) {\r\n <img class=\"solaris-avatar__image\" [src]=\"normalizedSrc()\" alt=\"\" aria-hidden=\"true\"\r\n decoding=\"async\" (load)=\"onImageLoad()\" (error)=\"onImageError()\">\r\n } @else if (showLetter()) {\r\n <span class=\"solaris-avatar__label\" aria-hidden=\"true\">\r\n {{ resolvedInitials() }}\r\n </span>\r\n } @else if (showDefault()) {\r\n <span class=\"solaris-avatar__placeholder\" aria-hidden=\"true\">\r\n <svg class=\"solaris-avatar__placeholder-svg\" viewBox=\"0 0 64 64\" preserveAspectRatio=\"xMidYMid meet\"\r\n xmlns=\"http://www.w3.org/2000/svg\">\r\n <circle class=\"solaris-avatar__placeholder-head\" cx=\"32\" cy=\"25\" r=\"14\"></circle>\r\n <path class=\"solaris-avatar__placeholder-body\" d=\"M2 64 C6 50, 18 42, 32 45 C46 42, 58 50, 62 64 Z\"></path>\r\n </svg>\r\n </span>\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-avatar__overlay\" aria-hidden=\"true\">\r\n <ng-content></ng-content>\r\n </span>\r\n </button>\r\n} @else {\r\n <span class=\"solaris-avatar\" [ngClass]=\"rootClasses()\" [attr.role]=\"rootRole()\" [attr.aria-label]=\"accessibleLabel()\"\r\n [attr.aria-hidden]=\"ariaHidden() ? 'true' : null\" [style.--solaris-avatar-radius]=\"resolvedRadius()\"\r\n [style.--solaris-avatar-image-fit]=\"objectFit()\" [style.--solaris-avatar-custom-bg]=\"customColorValue()\">\r\n <span class=\"solaris-avatar__body\">\r\n @if (loading()) {\r\n <span class=\"solaris-avatar__skeleton\" aria-hidden=\"true\"></span>\r\n } @else if (showImage()) {\r\n <img class=\"solaris-avatar__image\" [src]=\"normalizedSrc()\" alt=\"\" aria-hidden=\"true\"\r\n decoding=\"async\" (load)=\"onImageLoad()\" (error)=\"onImageError()\">\r\n } @else if (showLetter()) {\r\n <span class=\"solaris-avatar__label\" aria-hidden=\"true\">{{ resolvedInitials() }}</span>\r\n } @else if (showDefault()) {\r\n <span class=\"solaris-avatar__placeholder\" aria-hidden=\"true\">\r\n <svg class=\"solaris-avatar__placeholder-svg\" viewBox=\"0 0 64 64\" preserveAspectRatio=\"xMidYMid meet\"\r\n xmlns=\"http://www.w3.org/2000/svg\">\r\n <circle class=\"solaris-avatar__placeholder-head\" cx=\"32\" cy=\"25\" r=\"14\"></circle>\r\n <path class=\"solaris-avatar__placeholder-body\" d=\"M2 64 C6 50, 18 42, 32 45 C46 42, 58 50, 62 64 Z\"></path>\r\n </svg>\r\n </span>\r\n }\r\n </span>\r\n\r\n <span class=\"solaris-avatar__overlay\" aria-hidden=\"true\">\r\n <ng-content></ng-content>\r\n </span>\r\n </span>\r\n}\r\n", styles: [".solaris-avatar-host{display:inline-flex;vertical-align:middle}.solaris-avatar{--solaris-avatar-size-xs: 2.4rem;--solaris-avatar-size-sm: 3.2rem;--solaris-avatar-size-md: 4rem;--solaris-avatar-size-lg: 4.8rem;--solaris-avatar-size-xl: 6.4rem;--solaris-avatar-radius-square: var(--solaris-radius-md);--solaris-avatar-radius-circle: var(--solaris-radius-full);--solaris-avatar-bg: var(--solaris-color-surface-2);--solaris-avatar-fg: var(--solaris-color-text);--solaris-avatar-border: color-mix(in srgb, var(--solaris-color-border) 85%, transparent);--solaris-avatar-placeholder-bg: var(--solaris-avatar-bg);--solaris-avatar-placeholder-fg: color-mix(in srgb, var(--solaris-avatar-fg) 62%, transparent);--solaris-avatar-ring-focus: 0 0 0 .3rem color-mix(in srgb, var(--solaris-color-primary) 26%, transparent);--solaris-avatar-shadow: none;--solaris-avatar-shadow-hover: var(--solaris-shadow-xs);--solaris-avatar-opacity-disabled: .56;--solaris-avatar-badge-size: 1.6rem;--solaris-avatar-badge-offset-x: 0;--solaris-avatar-badge-offset-y: 0;--solaris-avatar-badge-border: .2rem solid var(--solaris-color-surface);--solaris-avatar-image-fit: cover;--solaris-avatar-radius: var(--solaris-avatar-radius-circle);inline-size:var(--_avatar-size);block-size:var(--_avatar-size);padding:0;margin:0;border:0;background:transparent;color:inherit;font:inherit;text-decoration:none;position:relative;display:inline-grid;place-items:center;-webkit-user-select:none;user-select:none;overflow:visible;outline:none}.solaris-avatar.size-xs{--_avatar-size: var(--solaris-avatar-size-xs);--solaris-avatar-font-size: var(--solaris-fs-10);--solaris-avatar-badge-size: 1.2rem}.solaris-avatar.size-sm{--_avatar-size: var(--solaris-avatar-size-sm);--solaris-avatar-font-size: var(--solaris-fs-12);--solaris-avatar-badge-size: 1.4rem}.solaris-avatar.size-md{--_avatar-size: var(--solaris-avatar-size-md);--solaris-avatar-font-size: var(--solaris-fs-14);--solaris-avatar-badge-size: 1.6rem}.solaris-avatar.size-lg{--_avatar-size: var(--solaris-avatar-size-lg);--solaris-avatar-font-size: var(--solaris-fs-16);--solaris-avatar-badge-size: 1.8rem}.solaris-avatar.size-xl{--_avatar-size: var(--solaris-avatar-size-xl);--solaris-avatar-font-size: var(--solaris-fs-20);--solaris-avatar-badge-size: 2rem}.solaris-avatar.shape-circle{--solaris-avatar-radius: var(--solaris-avatar-radius-circle)}.solaris-avatar.shape-square{--solaris-avatar-radius: var(--solaris-avatar-radius-square)}.solaris-avatar__body{display:grid;block-size:100%;overflow:hidden;inline-size:100%;place-items:center;color:var(--solaris-avatar-fg);background:var(--solaris-avatar-bg);box-shadow:var(--solaris-avatar-shadow);border-radius:var(--solaris-avatar-radius);border:1px solid var(--solaris-avatar-border);transition:box-shadow .15s ease,transform .15s ease,opacity .15s ease}.solaris-avatar__image{inline-size:100%;block-size:100%;display:block;object-fit:var(--solaris-avatar-image-fit)}.solaris-avatar__label{font-size:var(--solaris-avatar-font-size);font-weight:700;line-height:1;letter-spacing:var(--solaris-ls-sm);text-transform:uppercase}.solaris-avatar__placeholder{display:grid;block-size:100%;inline-size:100%;place-items:stretch;color:var(--solaris-avatar-placeholder-fg)}.solaris-avatar__placeholder-svg{inline-size:100%;block-size:100%;display:block}.solaris-avatar__placeholder-head,.solaris-avatar__placeholder-body{fill:currentColor}.solaris-avatar__overlay{position:absolute;inset-inline-end:var(--solaris-avatar-badge-offset-x);inset-block-end:var(--solaris-avatar-badge-offset-y);z-index:3;display:inline-flex;align-items:center;justify-content:center;min-inline-size:var(--solaris-avatar-badge-size);min-block-size:var(--solaris-avatar-badge-size);transform:translate(35%,35%);pointer-events:none}.solaris-avatar__overlay:empty{display:none}.solaris-avatar__overlay>*{max-inline-size:100%;flex-shrink:0;pointer-events:auto}.solaris-avatar__skeleton{inline-size:100%;block-size:100%;display:block;border-radius:inherit;background:linear-gradient(90deg,color-mix(in srgb,var(--solaris-color-surface-2) 72%,transparent),color-mix(in srgb,white 18%,var(--solaris-color-surface-2)),color-mix(in srgb,var(--solaris-color-surface-2) 72%,transparent));background-size:200% 100%;animation:solaris-avatar-shimmer 1.2s linear infinite}.solaris-avatar.is-interactive:not(.is-disabled),.solaris-avatar.is-button:not(.is-disabled){cursor:pointer}.solaris-avatar.is-interactive:not(.is-disabled):hover .solaris-avatar__body,.solaris-avatar.is-button:not(.is-disabled):hover .solaris-avatar__body{box-shadow:var(--solaris-avatar-shadow-hover)}.solaris-avatar.is-button:focus-visible .solaris-avatar__body{box-shadow:var(--solaris-avatar-ring-focus)}.solaris-avatar.is-disabled{opacity:var(--solaris-avatar-opacity-disabled);cursor:not-allowed}.solaris-avatar.is-disabled .solaris-avatar__body,.solaris-avatar:disabled .solaris-avatar__body{box-shadow:none}.solaris-avatar.shape-square .solaris-avatar__overlay{transform:none;inset-block-end:-.15rem;inset-inline-end:-.15rem}.solaris-avatar.color-surface{--_base: var(--solaris-color-surface-2);--solaris-avatar-bg: color-mix(in srgb, var(--_base) 92%, white);--solaris-avatar-fg: var(--solaris-color-text);--solaris-avatar-border: color-mix(in srgb, var(--solaris-color-border) 70%, var(--_base))}.solaris-avatar.color-primary{--_base: var(--solaris-color-primary);--solaris-avatar-bg: color-mix(in srgb, var(--_base) 22%, var(--solaris-color-surface));--solaris-avatar-fg: color-mix(in srgb, var(--_base) 88%, white);--solaris-avatar-placeholder-fg: color-mix(in srgb, var(--_base) 52%, white);--solaris-avatar-border: color-mix(in srgb, var(--_base) 42%, var(--solaris-color-border))}.solaris-avatar.color-success{--_base: var(--solaris-color-success);--solaris-avatar-bg: color-mix(in srgb, var(--_base) 22%, var(--solaris-color-surface));--solaris-avatar-fg: color-mix(in srgb, var(--_base) 88%, white);--solaris-avatar-placeholder-fg: color-mix(in srgb, var(--_base) 52%, white);--solaris-avatar-border: color-mix(in srgb, var(--_base) 42%, var(--solaris-color-border))}.solaris-avatar.color-warning{--_base: var(--solaris-color-warning);--solaris-avatar-bg: color-mix(in srgb, var(--_base) 22%, var(--solaris-color-surface));--solaris-avatar-fg: color-mix(in srgb, var(--_base) 88%, black);--solaris-avatar-placeholder-fg: color-mix(in srgb, var(--_base) 52%, white);--solaris-avatar-border: color-mix(in srgb, var(--_base) 42%, var(--solaris-color-border))}.solaris-avatar.color-error{--_base: var(--solaris-color-error);--solaris-avatar-bg: color-mix(in srgb, var(--_base) 16%, var(--solaris-color-surface));--solaris-avatar-fg: color-mix(in srgb, var(--_base) 78%, white);--solaris-avatar-border: color-mix(in srgb, var(--_base) 34%, var(--solaris-color-border))}.solaris-avatar.color-info{--_base: var(--solaris-color-info);--solaris-avatar-bg: color-mix(in srgb, var(--_base) 16%, var(--solaris-color-surface));--solaris-avatar-fg: color-mix(in srgb, var(--_base) 78%, white);--solaris-avatar-border: color-mix(in srgb, var(--_base) 34%, var(--solaris-color-border))}.solaris-avatar.color-custom{--_base: var(--solaris-avatar-custom-bg, var(--solaris-color-surface-2));--solaris-avatar-fg: var(--_base);--solaris-avatar-bg: color-mix(in srgb, var(--_base) 18%, var(--solaris-color-surface));--solaris-avatar-border: color-mix(in srgb, var(--_base) 34%, var(--solaris-color-border))}@keyframes solaris-avatar-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}\n"] }]
|
|
6239
|
+
}], ctorParameters: () => [], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], initials: [{ type: i0.Input, args: [{ isSignal: true, alias: "initials", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], buttonType: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonType", required: false }] }], asButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "asButton", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], objectFit: [{ type: i0.Input, args: [{ isSignal: true, alias: "objectFit", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-hidden", required: false }] }], hostClass: [{
|
|
6240
|
+
type: HostBinding,
|
|
6241
|
+
args: ['class']
|
|
6242
|
+
}] } });
|
|
6243
|
+
|
|
6244
|
+
class SolarisPresenceAvatar {
|
|
6245
|
+
translationService = inject(SOLARIS_TRANSLATION);
|
|
6246
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
6247
|
+
shape = input('circle', ...(ngDevMode ? [{ debugName: "shape" }] : []));
|
|
6248
|
+
variant = input('auto', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
6249
|
+
src = input(null, ...(ngDevMode ? [{ debugName: "src" }] : []));
|
|
6250
|
+
alt = input(null, ...(ngDevMode ? [{ debugName: "alt" }] : []));
|
|
6251
|
+
name = input(null, ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
6252
|
+
initials = input(null, ...(ngDevMode ? [{ debugName: "initials" }] : []));
|
|
6253
|
+
color = input('surface', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
6254
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : {}), transform: booleanAttribute });
|
|
6255
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
6256
|
+
interactive = input(false, { ...(ngDevMode ? { debugName: "interactive" } : {}), transform: booleanAttribute });
|
|
6257
|
+
buttonType = input('button', ...(ngDevMode ? [{ debugName: "buttonType" }] : []));
|
|
6258
|
+
asButton = input(false, { ...(ngDevMode ? { debugName: "asButton" } : {}), transform: booleanAttribute });
|
|
6259
|
+
radius = input(null, ...(ngDevMode ? [{ debugName: "radius" }] : []));
|
|
6260
|
+
objectFit = input('cover', ...(ngDevMode ? [{ debugName: "objectFit" }] : []));
|
|
6261
|
+
ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : {}), alias: 'aria-label' });
|
|
6262
|
+
ariaHidden = input(false, { ...(ngDevMode ? { debugName: "ariaHidden" } : {}), alias: 'aria-hidden', transform: booleanAttribute });
|
|
6263
|
+
presence = input('offline', ...(ngDevMode ? [{ debugName: "presence" }] : []));
|
|
6264
|
+
presenceAriaLabel = input(null, ...(ngDevMode ? [{ debugName: "presenceAriaLabel" }] : []));
|
|
6265
|
+
timezone = input(null, ...(ngDevMode ? [{ debugName: "timezone" }] : []));
|
|
6266
|
+
lastSeenAt = input(null, ...(ngDevMode ? [{ debugName: "lastSeenAt" }] : []));
|
|
6267
|
+
quietHours = input('auto', ...(ngDevMode ? [{ debugName: "quietHours" }] : []));
|
|
6268
|
+
workHoursStart = input(9, ...(ngDevMode ? [{ debugName: "workHoursStart" }] : []));
|
|
6269
|
+
workHoursEnd = input(18, ...(ngDevMode ? [{ debugName: "workHoursEnd" }] : []));
|
|
6270
|
+
presenceTooltipKey = computed(() => {
|
|
6271
|
+
return this.translationService.translate(`ui.solaris.avatar.presence.states.${this.presence()}`);
|
|
6272
|
+
}, ...(ngDevMode ? [{ debugName: "presenceTooltipKey" }] : []));
|
|
6273
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPresenceAvatar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6274
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.1", type: SolarisPresenceAvatar, isStandalone: true, selector: "solaris-presence-avatar", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, initials: { classPropertyName: "initials", publicName: "initials", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, buttonType: { classPropertyName: "buttonType", publicName: "buttonType", isSignal: true, isRequired: false, transformFunction: null }, asButton: { classPropertyName: "asButton", publicName: "asButton", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, objectFit: { classPropertyName: "objectFit", publicName: "objectFit", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaHidden: { classPropertyName: "ariaHidden", publicName: "aria-hidden", isSignal: true, isRequired: false, transformFunction: null }, presence: { classPropertyName: "presence", publicName: "presence", isSignal: true, isRequired: false, transformFunction: null }, presenceAriaLabel: { classPropertyName: "presenceAriaLabel", publicName: "presenceAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, timezone: { classPropertyName: "timezone", publicName: "timezone", isSignal: true, isRequired: false, transformFunction: null }, lastSeenAt: { classPropertyName: "lastSeenAt", publicName: "lastSeenAt", isSignal: true, isRequired: false, transformFunction: null }, quietHours: { classPropertyName: "quietHours", publicName: "quietHours", isSignal: true, isRequired: false, transformFunction: null }, workHoursStart: { classPropertyName: "workHoursStart", publicName: "workHoursStart", isSignal: true, isRequired: false, transformFunction: null }, workHoursEnd: { classPropertyName: "workHoursEnd", publicName: "workHoursEnd", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<solaris-avatar [src]=\"src()\" [alt]=\"alt()\" [name]=\"name()\" [initials]=\"initials()\" [size]=\"size()\" [shape]=\"shape()\"\r\n [variant]=\"variant()\" [color]=\"color()\" [loading]=\"loading()\" [disabled]=\"disabled()\" [interactive]=\"interactive()\"\r\n [buttonType]=\"buttonType()\" [asButton]=\"asButton()\" [radius]=\"radius()\" [objectFit]=\"objectFit()\"\r\n [aria-label]=\"ariaLabel()\" [aria-hidden]=\"ariaHidden()\" solaris-tooltip [tooltip-key]=\"presenceTooltipKey()\"\r\n tooltip-variant=\"default\" tooltip-size=\"sm\" tooltip-prefix-icon=\"ph ph-info\">\r\n\r\n <span solaris-avatar-overlay class=\"solaris-presence-avatar__overlay\" aria-hidden=\"true\">\r\n <solaris-avatar-presence [presence]=\"presence()\" [timezone]=\"timezone()\" [lastSeenAt]=\"lastSeenAt()\"\r\n [quietHours]=\"quietHours()\" [workHoursStart]=\"workHoursStart()\" [workHoursEnd]=\"workHoursEnd()\"\r\n [aria-label]=\"presenceAriaLabel()\" [aria-hidden]=\"ariaHidden()\" [shape]=\"shape()\">\r\n </solaris-avatar-presence>\r\n </span>\r\n</solaris-avatar>\r\n", styles: [":host{display:inline-flex;vertical-align:middle}.solaris-presence-avatar__overlay{display:inline-flex;align-items:center;justify-content:center;line-height:1}:host(.shape-square) .solaris-presence-avatar__overlay{transform:translate(18%,18%)}\n"], dependencies: [{ kind: "component", type: SolarisAvatar, selector: "solaris-avatar", inputs: ["size", "shape", "variant", "src", "alt", "name", "initials", "color", "loading", "disabled", "interactive", "buttonType", "asButton", "radius", "objectFit", "aria-label", "aria-hidden"] }, { kind: "component", type: SolarisAvatarPresence, selector: "solaris-avatar-presence", inputs: ["presence", "timezone", "lastSeenAt", "quietHours", "workHoursStart", "workHoursEnd", "shape", "aria-label", "aria-hidden"] }, { kind: "directive", type: SolarisTooltipDirective, selector: "[solaris-tooltip]", inputs: ["solaris-tooltip", "tooltip-position", "tooltip-variant", "tooltip-size", "tooltip-prefix-icon", "tooltip-disabled", "tooltip-show-delay", "tooltip-hide-delay", "tooltip-offset", "tooltip-auto-flip", "tooltip-auto-shift", "tooltip-viewport-padding", "tooltip-key", "tooltip-params"] }, { kind: "directive", type: SolarisAvatarOverlayDirective, selector: "[solaris-avatar-overlay]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6275
|
+
}
|
|
6276
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisPresenceAvatar, decorators: [{
|
|
6277
|
+
type: Component,
|
|
6278
|
+
args: [{ selector: 'solaris-presence-avatar', standalone: true, imports: [
|
|
6279
|
+
SolarisAvatar,
|
|
6280
|
+
SolarisAvatarPresence,
|
|
6281
|
+
SolarisTooltipDirective,
|
|
6282
|
+
SolarisAvatarOverlayDirective,
|
|
6283
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<solaris-avatar [src]=\"src()\" [alt]=\"alt()\" [name]=\"name()\" [initials]=\"initials()\" [size]=\"size()\" [shape]=\"shape()\"\r\n [variant]=\"variant()\" [color]=\"color()\" [loading]=\"loading()\" [disabled]=\"disabled()\" [interactive]=\"interactive()\"\r\n [buttonType]=\"buttonType()\" [asButton]=\"asButton()\" [radius]=\"radius()\" [objectFit]=\"objectFit()\"\r\n [aria-label]=\"ariaLabel()\" [aria-hidden]=\"ariaHidden()\" solaris-tooltip [tooltip-key]=\"presenceTooltipKey()\"\r\n tooltip-variant=\"default\" tooltip-size=\"sm\" tooltip-prefix-icon=\"ph ph-info\">\r\n\r\n <span solaris-avatar-overlay class=\"solaris-presence-avatar__overlay\" aria-hidden=\"true\">\r\n <solaris-avatar-presence [presence]=\"presence()\" [timezone]=\"timezone()\" [lastSeenAt]=\"lastSeenAt()\"\r\n [quietHours]=\"quietHours()\" [workHoursStart]=\"workHoursStart()\" [workHoursEnd]=\"workHoursEnd()\"\r\n [aria-label]=\"presenceAriaLabel()\" [aria-hidden]=\"ariaHidden()\" [shape]=\"shape()\">\r\n </solaris-avatar-presence>\r\n </span>\r\n</solaris-avatar>\r\n", styles: [":host{display:inline-flex;vertical-align:middle}.solaris-presence-avatar__overlay{display:inline-flex;align-items:center;justify-content:center;line-height:1}:host(.shape-square) .solaris-presence-avatar__overlay{transform:translate(18%,18%)}\n"] }]
|
|
6284
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], initials: [{ type: i0.Input, args: [{ isSignal: true, alias: "initials", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], buttonType: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonType", required: false }] }], asButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "asButton", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], objectFit: [{ type: i0.Input, args: [{ isSignal: true, alias: "objectFit", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaHidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-hidden", required: false }] }], presence: [{ type: i0.Input, args: [{ isSignal: true, alias: "presence", required: false }] }], presenceAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "presenceAriaLabel", required: false }] }], timezone: [{ type: i0.Input, args: [{ isSignal: true, alias: "timezone", required: false }] }], lastSeenAt: [{ type: i0.Input, args: [{ isSignal: true, alias: "lastSeenAt", required: false }] }], quietHours: [{ type: i0.Input, args: [{ isSignal: true, alias: "quietHours", required: false }] }], workHoursStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "workHoursStart", required: false }] }], workHoursEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "workHoursEnd", required: false }] }] } });
|
|
6285
|
+
|
|
6286
|
+
class SolarisAvatarStack {
|
|
6287
|
+
items = input([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
6288
|
+
max = input(4, { ...(ngDevMode ? { debugName: "max" } : {}), transform: numberAttribute });
|
|
6289
|
+
showPresence = input(false, { ...(ngDevMode ? { debugName: "showPresence" } : {}), transform: booleanAttribute });
|
|
6290
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
6291
|
+
shape = input('circle', ...(ngDevMode ? [{ debugName: "shape" }] : []));
|
|
6292
|
+
overlap = input('md', ...(ngDevMode ? [{ debugName: "overlap" }] : []));
|
|
6293
|
+
visibleItems = computed(() => {
|
|
6294
|
+
const max = Math.max(1, this.max());
|
|
6295
|
+
return this.items().slice(0, max);
|
|
6296
|
+
}, ...(ngDevMode ? [{ debugName: "visibleItems" }] : []));
|
|
6297
|
+
hiddenCount = computed(() => {
|
|
6298
|
+
return Math.max(0, this.items().length - this.visibleItems().length);
|
|
6299
|
+
}, ...(ngDevMode ? [{ debugName: "hiddenCount" }] : []));
|
|
6300
|
+
hasHiddenItems = computed(() => this.hiddenCount() > 0, ...(ngDevMode ? [{ debugName: "hasHiddenItems" }] : []));
|
|
6301
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisAvatarStack, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6302
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisAvatarStack, isStandalone: true, selector: "solaris-avatar-stack", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, showPresence: { classPropertyName: "showPresence", publicName: "showPresence", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, overlap: { classPropertyName: "overlap", publicName: "overlap", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"solaris-avatar-stack\" [attr.data-size]=\"size()\"\r\n [attr.data-shape]=\"shape()\" [attr.data-overlap]=\"overlap()\">\r\n @for (item of visibleItems(); track item.name ?? item.src ?? $index) {\r\n <span class=\"solaris-avatar-stack__item\">\r\n @if (showPresence()) {\r\n <solaris-presence-avatar [size]=\"size()\" [shape]=\"shape()\" [src]=\"item.src ?? null\" [alt]=\"item.alt ?? null\"\r\n [name]=\"item.name ?? null\" [initials]=\"item.initials ?? null\" [presence]=\"item.presence ?? 'offline'\"\r\n [timezone]=\"item.timezone ?? null\" [lastSeenAt]=\"item.lastSeenAt ?? null\" [quietHours]=\"item.quietHours ?? false\"/>\r\n } @else {\r\n <solaris-avatar [size]=\"size()\" [shape]=\"shape()\" [src]=\"item.src ?? null\" [alt]=\"item.alt ?? null\"\r\n [name]=\"item.name ?? null\" [initials]=\"item.initials ?? null\"/>\r\n }\r\n </span>\r\n }\r\n\r\n @if (hasHiddenItems()) {\r\n <span class=\"solaris-avatar-stack__item solaris-avatar-stack__more\">\r\n +{{ hiddenCount() }}\r\n </span>\r\n }\r\n</div>\r\n", styles: [":host{display:inline-flex;vertical-align:middle}.solaris-avatar-stack{--solaris-avatar-stack-overlap: -.8rem;--solaris-avatar-stack-more-size: 4rem;--solaris-avatar-stack-more-bg: var(--solaris-color-surface-2);--solaris-avatar-stack-more-fg: var(--solaris-color-text);--solaris-avatar-stack-ring: .2rem solid var(--solaris-color-surface);isolation:isolate;align-items:center;display:inline-flex}.solaris-avatar-stack[data-overlap=sm]{--solaris-avatar-stack-overlap: -.4rem}.solaris-avatar-stack[data-overlap=md]{--solaris-avatar-stack-overlap: -.8rem}.solaris-avatar-stack[data-overlap=lg]{--solaris-avatar-stack-overlap: -1.2rem}.solaris-avatar-stack__item{flex:0 0 auto;position:relative;display:inline-flex;border-radius:var(--solaris-radius-full)}.solaris-avatar-stack__item+.solaris-avatar-stack__item{margin-inline-start:var(--solaris-avatar-stack-overlap)}.solaris-avatar-stack__item:nth-child(1){z-index:5}.solaris-avatar-stack__item:nth-child(2){z-index:4}.solaris-avatar-stack__item:nth-child(3){z-index:3}.solaris-avatar-stack__item:nth-child(4){z-index:2}.solaris-avatar-stack__item:nth-child(5){z-index:1}.solaris-avatar-stack__item solaris-presence-avatar{border-radius:inherit;filter:drop-shadow(0 0 0 var(--solaris-color-surface))}.solaris-avatar-stack__more{z-index:10;line-height:1;font-weight:400;place-items:center;display:inline-grid;font-size:var(--solaris-fs-14);box-shadow:var(--solaris-shadow-xs);border:var(--solaris-avatar-stack-ring);border-radius:var(--solaris-radius-full);color:var(--solaris-avatar-stack-more-fg);background:var(--solaris-avatar-stack-more-bg);block-size:var(--solaris-avatar-stack-more-size);inline-size:var(--solaris-avatar-stack-more-size)}.solaris-avatar-stack[data-size=xs]{--solaris-avatar-stack-more-size: 2.4rem;--solaris-avatar-stack-ring: .15rem solid var(--solaris-color-surface)}.solaris-avatar-stack[data-size=sm]{--solaris-avatar-stack-more-size: 3.2rem}.solaris-avatar-stack[data-size=md]{--solaris-avatar-stack-more-size: 4rem}.solaris-avatar-stack[data-size=lg]{--solaris-avatar-stack-more-size: 4.8rem}.solaris-avatar-stack[data-size=xl]{--solaris-avatar-stack-more-size: 6.4rem;--solaris-avatar-stack-ring: .25rem solid var(--solaris-color-surface)}.solaris-avatar-stack[data-shape=square] .solaris-avatar-stack__item,.solaris-avatar-stack[data-shape=square] .solaris-avatar-stack__more{border-radius:var(--solaris-radius-md)}.solaris-avatar-stack__item.solaris-avatar-stack__more{z-index:20}\n"], dependencies: [{ kind: "component", type: SolarisPresenceAvatar, selector: "solaris-presence-avatar", inputs: ["size", "shape", "variant", "src", "alt", "name", "initials", "color", "loading", "disabled", "interactive", "buttonType", "asButton", "radius", "objectFit", "aria-label", "aria-hidden", "presence", "presenceAriaLabel", "timezone", "lastSeenAt", "quietHours", "workHoursStart", "workHoursEnd"] }, { kind: "component", type: SolarisAvatar, selector: "solaris-avatar", inputs: ["size", "shape", "variant", "src", "alt", "name", "initials", "color", "loading", "disabled", "interactive", "buttonType", "asButton", "radius", "objectFit", "aria-label", "aria-hidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6303
|
+
}
|
|
6304
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisAvatarStack, decorators: [{
|
|
6305
|
+
type: Component,
|
|
6306
|
+
args: [{ selector: 'solaris-avatar-stack', standalone: true, imports: [
|
|
6307
|
+
SolarisPresenceAvatar,
|
|
6308
|
+
SolarisAvatar
|
|
6309
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"solaris-avatar-stack\" [attr.data-size]=\"size()\"\r\n [attr.data-shape]=\"shape()\" [attr.data-overlap]=\"overlap()\">\r\n @for (item of visibleItems(); track item.name ?? item.src ?? $index) {\r\n <span class=\"solaris-avatar-stack__item\">\r\n @if (showPresence()) {\r\n <solaris-presence-avatar [size]=\"size()\" [shape]=\"shape()\" [src]=\"item.src ?? null\" [alt]=\"item.alt ?? null\"\r\n [name]=\"item.name ?? null\" [initials]=\"item.initials ?? null\" [presence]=\"item.presence ?? 'offline'\"\r\n [timezone]=\"item.timezone ?? null\" [lastSeenAt]=\"item.lastSeenAt ?? null\" [quietHours]=\"item.quietHours ?? false\"/>\r\n } @else {\r\n <solaris-avatar [size]=\"size()\" [shape]=\"shape()\" [src]=\"item.src ?? null\" [alt]=\"item.alt ?? null\"\r\n [name]=\"item.name ?? null\" [initials]=\"item.initials ?? null\"/>\r\n }\r\n </span>\r\n }\r\n\r\n @if (hasHiddenItems()) {\r\n <span class=\"solaris-avatar-stack__item solaris-avatar-stack__more\">\r\n +{{ hiddenCount() }}\r\n </span>\r\n }\r\n</div>\r\n", styles: [":host{display:inline-flex;vertical-align:middle}.solaris-avatar-stack{--solaris-avatar-stack-overlap: -.8rem;--solaris-avatar-stack-more-size: 4rem;--solaris-avatar-stack-more-bg: var(--solaris-color-surface-2);--solaris-avatar-stack-more-fg: var(--solaris-color-text);--solaris-avatar-stack-ring: .2rem solid var(--solaris-color-surface);isolation:isolate;align-items:center;display:inline-flex}.solaris-avatar-stack[data-overlap=sm]{--solaris-avatar-stack-overlap: -.4rem}.solaris-avatar-stack[data-overlap=md]{--solaris-avatar-stack-overlap: -.8rem}.solaris-avatar-stack[data-overlap=lg]{--solaris-avatar-stack-overlap: -1.2rem}.solaris-avatar-stack__item{flex:0 0 auto;position:relative;display:inline-flex;border-radius:var(--solaris-radius-full)}.solaris-avatar-stack__item+.solaris-avatar-stack__item{margin-inline-start:var(--solaris-avatar-stack-overlap)}.solaris-avatar-stack__item:nth-child(1){z-index:5}.solaris-avatar-stack__item:nth-child(2){z-index:4}.solaris-avatar-stack__item:nth-child(3){z-index:3}.solaris-avatar-stack__item:nth-child(4){z-index:2}.solaris-avatar-stack__item:nth-child(5){z-index:1}.solaris-avatar-stack__item solaris-presence-avatar{border-radius:inherit;filter:drop-shadow(0 0 0 var(--solaris-color-surface))}.solaris-avatar-stack__more{z-index:10;line-height:1;font-weight:400;place-items:center;display:inline-grid;font-size:var(--solaris-fs-14);box-shadow:var(--solaris-shadow-xs);border:var(--solaris-avatar-stack-ring);border-radius:var(--solaris-radius-full);color:var(--solaris-avatar-stack-more-fg);background:var(--solaris-avatar-stack-more-bg);block-size:var(--solaris-avatar-stack-more-size);inline-size:var(--solaris-avatar-stack-more-size)}.solaris-avatar-stack[data-size=xs]{--solaris-avatar-stack-more-size: 2.4rem;--solaris-avatar-stack-ring: .15rem solid var(--solaris-color-surface)}.solaris-avatar-stack[data-size=sm]{--solaris-avatar-stack-more-size: 3.2rem}.solaris-avatar-stack[data-size=md]{--solaris-avatar-stack-more-size: 4rem}.solaris-avatar-stack[data-size=lg]{--solaris-avatar-stack-more-size: 4.8rem}.solaris-avatar-stack[data-size=xl]{--solaris-avatar-stack-more-size: 6.4rem;--solaris-avatar-stack-ring: .25rem solid var(--solaris-color-surface)}.solaris-avatar-stack[data-shape=square] .solaris-avatar-stack__item,.solaris-avatar-stack[data-shape=square] .solaris-avatar-stack__more{border-radius:var(--solaris-radius-md)}.solaris-avatar-stack__item.solaris-avatar-stack__more{z-index:20}\n"] }]
|
|
6310
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], showPresence: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPresence", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], overlap: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlap", required: false }] }] } });
|
|
6311
|
+
|
|
6312
|
+
class SolarisAvatarDropdown {
|
|
6313
|
+
items = input([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
6314
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
6315
|
+
shape = input('circle', ...(ngDevMode ? [{ debugName: "shape" }] : []));
|
|
6316
|
+
overlap = input('md', ...(ngDevMode ? [{ debugName: "overlap" }] : []));
|
|
6317
|
+
maxVisible = input(4, { ...(ngDevMode ? { debugName: "maxVisible" } : {}), transform: numberAttribute });
|
|
6318
|
+
placement = input('bottom-end', ...(ngDevMode ? [{ debugName: "placement" }] : []));
|
|
6319
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
6320
|
+
closeOnSelect = input(true, { ...(ngDevMode ? { debugName: "closeOnSelect" } : {}), transform: booleanAttribute });
|
|
6321
|
+
panelLabel = input('Avatar dropdown', ...(ngDevMode ? [{ debugName: "panelLabel" }] : []));
|
|
6322
|
+
itemSelect = new EventEmitter();
|
|
6323
|
+
openChange = new EventEmitter();
|
|
6324
|
+
onItemClick(item, index, popover) {
|
|
6325
|
+
if (item.disabled)
|
|
6326
|
+
return;
|
|
6327
|
+
this.itemSelect.emit({ item, index });
|
|
6328
|
+
if (this.closeOnSelect()) {
|
|
6329
|
+
popover.setOpen(false);
|
|
6330
|
+
}
|
|
6331
|
+
}
|
|
6332
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisAvatarDropdown, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6333
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisAvatarDropdown, isStandalone: true, selector: "solaris-avatar-dropdown", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, overlap: { classPropertyName: "overlap", publicName: "overlap", isSignal: true, isRequired: false, transformFunction: null }, maxVisible: { classPropertyName: "maxVisible", publicName: "maxVisible", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, closeOnSelect: { classPropertyName: "closeOnSelect", publicName: "closeOnSelect", isSignal: true, isRequired: false, transformFunction: null }, panelLabel: { classPropertyName: "panelLabel", publicName: "panelLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemSelect: "itemSelect", openChange: "openChange" }, ngImport: i0, template: "<solaris-popover #popover [placement]=\"placement()\" [offset]=\"8\" [autoFlip]=\"true\" [autoShift]=\"true\"\r\n [closeOnEscape]=\"true\" [closeOnOutsideClick]=\"true\" panelClass=\"solaris-avatar-dropdown-popover\"\r\n (openChange)=\"openChange.emit($event)\">\r\n <button type=\"button\" solaris-popover-trigger class=\"solaris-avatar-dropdown__trigger\" [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"panelLabel()\" [attr.aria-expanded]=\"popover.isOpen() ? 'true' : 'false'\"\r\n (click)=\"popover.toggle()\">\r\n <solaris-avatar-stack [items]=\"items()\" [max]=\"maxVisible()\" [size]=\"size()\" [shape]=\"shape()\" [overlap]=\"overlap()\"\r\n [showPresence]=\"false\"/>\r\n </button>\r\n\r\n <ng-template solaris-popover-panel>\r\n <div class=\"solaris-avatar-dropdown__panel\" role=\"listbox\" [attr.aria-label]=\"panelLabel()\">\r\n @for (item of items(); track item.id ?? item.name ?? item.src ?? $index) {\r\n <button type=\"button\" class=\"solaris-avatar-dropdown__item\" [disabled]=\"item.disabled\"\r\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\r\n (click)=\"onItemClick(item, $index, popover)\">\r\n <solaris-avatar size=\"sm\" [shape]=\"shape()\" [src]=\"item.src ?? null\" [alt]=\"item.alt ?? null\"\r\n [name]=\"item.name ?? null\" [initials]=\"item.initials ?? null\"/>\r\n\r\n <span class=\"solaris-avatar-dropdown__item-body\">\r\n <span class=\"solaris-avatar-dropdown__item-title\">\r\n {{ item.name || item.initials || 'User' }}\r\n </span>\r\n </span>\r\n </button>\r\n }\r\n </div>\r\n </ng-template>\r\n</solaris-popover>\r\n", styles: [":host{display:inline-flex;vertical-align:middle}.solaris-avatar-dropdown__trigger{border:0;margin:0;padding:0;outline:none;font:inherit;color:inherit;cursor:pointer;align-items:center;display:inline-flex;justify-content:center;background:transparent;border-radius:var(--solaris-radius-full)}.solaris-avatar-dropdown__trigger:disabled{opacity:.56;cursor:not-allowed}.solaris-avatar-dropdown__trigger:focus-visible{box-shadow:0 0 0 .3rem color-mix(in srgb,var(--solaris-color-primary) 26%,transparent)}.solaris-avatar-dropdown__panel{display:grid;overflow:auto;min-inline-size:22rem;max-inline-size:30rem;gap:var(--solaris-space-1);padding:var(--solaris-space-2);max-block-size:min(32rem,100vh - 4rem)}.solaris-avatar-dropdown__item{border:0;width:100%;min-width:0;font:inherit;display:grid;outline:none;cursor:pointer;text-align:start;align-items:center;background:transparent;gap:var(--solaris-space-3);padding:var(--solaris-space-2);color:var(--solaris-color-text);border-radius:var(--solaris-radius-sm);grid-template-columns:auto minmax(0,1fr);transition:background-color .12s ease,color .12s ease,opacity .12s ease}.solaris-avatar-dropdown__item:hover,.solaris-avatar-dropdown__item:focus-visible{background:color-mix(in srgb,var(--solaris-color-surface-2) 78%,transparent)}.solaris-avatar-dropdown__item:disabled{opacity:.52;cursor:not-allowed}.solaris-avatar-dropdown__item-body{gap:.2rem;display:grid;min-inline-size:0}.solaris-avatar-dropdown__item-title{overflow:hidden;font-weight:650;min-inline-size:0;white-space:nowrap;text-overflow:ellipsis;font-size:var(--solaris-fs-14);color:var(--solaris-color-text);line-height:var(--solaris-lh-tight)}.solaris-avatar-dropdown__item-description{min-inline-size:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--solaris-fs-12);line-height:var(--solaris-lh-normal);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: "component", type: SolarisAvatarStack, selector: "solaris-avatar-stack", inputs: ["items", "max", "showPresence", "size", "shape", "overlap"] }, { kind: "component", type: SolarisAvatar, selector: "solaris-avatar", inputs: ["size", "shape", "variant", "src", "alt", "name", "initials", "color", "loading", "disabled", "interactive", "buttonType", "asButton", "radius", "objectFit", "aria-label", "aria-hidden"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6334
|
+
}
|
|
6335
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisAvatarDropdown, decorators: [{
|
|
6336
|
+
type: Component,
|
|
6337
|
+
args: [{ selector: 'solaris-avatar-dropdown', standalone: true, imports: [
|
|
6338
|
+
SolarisPopover,
|
|
6339
|
+
SolarisPopoverTriggerDirective,
|
|
6340
|
+
SolarisPopoverPanelDirective,
|
|
6341
|
+
SolarisAvatarStack,
|
|
6342
|
+
SolarisAvatar
|
|
6343
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<solaris-popover #popover [placement]=\"placement()\" [offset]=\"8\" [autoFlip]=\"true\" [autoShift]=\"true\"\r\n [closeOnEscape]=\"true\" [closeOnOutsideClick]=\"true\" panelClass=\"solaris-avatar-dropdown-popover\"\r\n (openChange)=\"openChange.emit($event)\">\r\n <button type=\"button\" solaris-popover-trigger class=\"solaris-avatar-dropdown__trigger\" [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"panelLabel()\" [attr.aria-expanded]=\"popover.isOpen() ? 'true' : 'false'\"\r\n (click)=\"popover.toggle()\">\r\n <solaris-avatar-stack [items]=\"items()\" [max]=\"maxVisible()\" [size]=\"size()\" [shape]=\"shape()\" [overlap]=\"overlap()\"\r\n [showPresence]=\"false\"/>\r\n </button>\r\n\r\n <ng-template solaris-popover-panel>\r\n <div class=\"solaris-avatar-dropdown__panel\" role=\"listbox\" [attr.aria-label]=\"panelLabel()\">\r\n @for (item of items(); track item.id ?? item.name ?? item.src ?? $index) {\r\n <button type=\"button\" class=\"solaris-avatar-dropdown__item\" [disabled]=\"item.disabled\"\r\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\r\n (click)=\"onItemClick(item, $index, popover)\">\r\n <solaris-avatar size=\"sm\" [shape]=\"shape()\" [src]=\"item.src ?? null\" [alt]=\"item.alt ?? null\"\r\n [name]=\"item.name ?? null\" [initials]=\"item.initials ?? null\"/>\r\n\r\n <span class=\"solaris-avatar-dropdown__item-body\">\r\n <span class=\"solaris-avatar-dropdown__item-title\">\r\n {{ item.name || item.initials || 'User' }}\r\n </span>\r\n </span>\r\n </button>\r\n }\r\n </div>\r\n </ng-template>\r\n</solaris-popover>\r\n", styles: [":host{display:inline-flex;vertical-align:middle}.solaris-avatar-dropdown__trigger{border:0;margin:0;padding:0;outline:none;font:inherit;color:inherit;cursor:pointer;align-items:center;display:inline-flex;justify-content:center;background:transparent;border-radius:var(--solaris-radius-full)}.solaris-avatar-dropdown__trigger:disabled{opacity:.56;cursor:not-allowed}.solaris-avatar-dropdown__trigger:focus-visible{box-shadow:0 0 0 .3rem color-mix(in srgb,var(--solaris-color-primary) 26%,transparent)}.solaris-avatar-dropdown__panel{display:grid;overflow:auto;min-inline-size:22rem;max-inline-size:30rem;gap:var(--solaris-space-1);padding:var(--solaris-space-2);max-block-size:min(32rem,100vh - 4rem)}.solaris-avatar-dropdown__item{border:0;width:100%;min-width:0;font:inherit;display:grid;outline:none;cursor:pointer;text-align:start;align-items:center;background:transparent;gap:var(--solaris-space-3);padding:var(--solaris-space-2);color:var(--solaris-color-text);border-radius:var(--solaris-radius-sm);grid-template-columns:auto minmax(0,1fr);transition:background-color .12s ease,color .12s ease,opacity .12s ease}.solaris-avatar-dropdown__item:hover,.solaris-avatar-dropdown__item:focus-visible{background:color-mix(in srgb,var(--solaris-color-surface-2) 78%,transparent)}.solaris-avatar-dropdown__item:disabled{opacity:.52;cursor:not-allowed}.solaris-avatar-dropdown__item-body{gap:.2rem;display:grid;min-inline-size:0}.solaris-avatar-dropdown__item-title{overflow:hidden;font-weight:650;min-inline-size:0;white-space:nowrap;text-overflow:ellipsis;font-size:var(--solaris-fs-14);color:var(--solaris-color-text);line-height:var(--solaris-lh-tight)}.solaris-avatar-dropdown__item-description{min-inline-size:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--solaris-fs-12);line-height:var(--solaris-lh-normal);color:var(--solaris-color-text-muted)}\n"] }]
|
|
6344
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], overlap: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlap", required: false }] }], maxVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisible", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], closeOnSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnSelect", required: false }] }], panelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelLabel", required: false }] }], itemSelect: [{
|
|
6345
|
+
type: Output
|
|
6346
|
+
}], openChange: [{
|
|
6347
|
+
type: Output
|
|
6348
|
+
}] } });
|
|
6349
|
+
|
|
6350
|
+
class SolarisCardMediaOverlayDirective {
|
|
6351
|
+
attr = '';
|
|
6352
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardMediaOverlayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
6353
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: SolarisCardMediaOverlayDirective, isStandalone: true, selector: "[solaris-card-media-overlay]", host: { properties: { "attr.solaris-card-media-overlay": "this.attr" } }, ngImport: i0 });
|
|
6354
|
+
}
|
|
6355
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardMediaOverlayDirective, decorators: [{
|
|
6356
|
+
type: Directive,
|
|
6357
|
+
args: [{
|
|
6358
|
+
selector: '[solaris-card-media-overlay]',
|
|
6359
|
+
standalone: true,
|
|
6360
|
+
}]
|
|
6361
|
+
}], propDecorators: { attr: [{
|
|
6362
|
+
type: HostBinding,
|
|
6363
|
+
args: ['attr.solaris-card-media-overlay']
|
|
6364
|
+
}] } });
|
|
6365
|
+
|
|
6366
|
+
class SolarisCardMedia {
|
|
6367
|
+
variant = input('image', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
6368
|
+
src = input(null, ...(ngDevMode ? [{ debugName: "src" }] : []));
|
|
6369
|
+
alt = input(null, ...(ngDevMode ? [{ debugName: "alt" }] : []));
|
|
6370
|
+
ratio = input('16:9', ...(ngDevMode ? [{ debugName: "ratio" }] : []));
|
|
6371
|
+
fit = input('cover', ...(ngDevMode ? [{ debugName: "fit" }] : []));
|
|
6372
|
+
align = input('center', ...(ngDevMode ? [{ debugName: "align" }] : []));
|
|
6373
|
+
radius = input('inherit', ...(ngDevMode ? [{ debugName: "radius" }] : []));
|
|
6374
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : {}), transform: booleanAttribute });
|
|
6375
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
6376
|
+
normalizedSrc = computed(() => this.normalize(this.src()), ...(ngDevMode ? [{ debugName: "normalizedSrc" }] : []));
|
|
6377
|
+
normalizedAlt = computed(() => this.normalize(this.alt()), ...(ngDevMode ? [{ debugName: "normalizedAlt" }] : []));
|
|
6378
|
+
showImage = computed(() => {
|
|
6379
|
+
return !this.loading()
|
|
6380
|
+
&& this.variant() === 'image'
|
|
6381
|
+
&& !!this.normalizedSrc();
|
|
6382
|
+
}, ...(ngDevMode ? [{ debugName: "showImage" }] : []));
|
|
6383
|
+
normalize(value) {
|
|
6384
|
+
return String(value ?? '').trim();
|
|
6385
|
+
}
|
|
6386
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardMedia, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6387
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: SolarisCardMedia, isStandalone: true, selector: "solaris-card-media", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, ratio: { classPropertyName: "ratio", publicName: "ratio", isSignal: true, isRequired: false, transformFunction: null }, fit: { classPropertyName: "fit", publicName: "fit", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"solaris-card-media\" [class.is-loading]=\"loading()\" [class.is-disabled]=\"disabled()\" [attr.data-variant]=\"variant()\"\r\n [attr.data-ratio]=\"ratio()\" [attr.data-align]=\"align()\" [attr.data-radius]=\"radius()\" [style.--solaris-card-media-fit]=\"fit()\">\r\n <div class=\"solaris-card-media__surface\">\r\n @if (loading()) {\r\n <span class=\"solaris-card-media__skeleton\" aria-hidden=\"true\"></span>\r\n } @else if (showImage()) {\r\n <img class=\"solaris-card-media__image\" [src]=\"normalizedSrc()\" [alt]=\"normalizedAlt()\" decoding=\"async\">\r\n } @else {\r\n <div class=\"solaris-card-media__content\">\r\n <ng-content></ng-content>\r\n </div>\r\n }\r\n\r\n <div class=\"solaris-card-media__overlay\">\r\n <ng-content select=\"[solaris-card-media-overlay]\"></ng-content>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block;min-inline-size:0}.solaris-card-media{--solaris-card-media-bg: var(--solaris-color-surface-2);--solaris-card-media-border: color-mix( in srgb, var(--solaris-color-border) 78%, transparent );--solaris-card-media-radius: inherit;--solaris-card-media-fit: cover;--solaris-card-media-shadow: none;--solaris-card-media-min-height: 6rem;position:relative;display:block;min-inline-size:0}.solaris-card-media__surface{position:relative;overflow:hidden;display:grid;place-items:center;min-inline-size:0;min-block-size:var(--solaris-card-media-min-height);background:var(--solaris-card-media-bg);border:1px solid var(--solaris-card-media-border);border-radius:var(--solaris-card-media-radius);box-shadow:var(--solaris-card-media-shadow)}.solaris-card-media[data-ratio=auto] .solaris-card-media__surface{aspect-ratio:auto}.solaris-card-media[data-ratio=\"1:1\"] .solaris-card-media__surface{aspect-ratio:1/1}.solaris-card-media[data-ratio=\"4:3\"] .solaris-card-media__surface{aspect-ratio:4/3}.solaris-card-media[data-ratio=\"16:9\"] .solaris-card-media__surface{aspect-ratio:16/9}.solaris-card-media[data-ratio=\"21:9\"] .solaris-card-media__surface{aspect-ratio:21/9}.solaris-card-media[data-radius=none]{--solaris-card-media-radius: 0}.solaris-card-media[data-radius=sm]{--solaris-card-media-radius: var(--solaris-radius-sm)}.solaris-card-media[data-radius=md]{--solaris-card-media-radius: var(--solaris-radius-md)}.solaris-card-media[data-radius=lg]{--solaris-card-media-radius: var(--solaris-radius-lg)}.solaris-card-media[data-radius=inherit]{--solaris-card-media-radius: inherit}.solaris-card-media__image{inline-size:100%;block-size:100%;display:block;object-fit:var(--solaris-card-media-fit)}.solaris-card-media__content{inline-size:100%;block-size:100%;min-inline-size:0;display:flex;padding:var(--solaris-space-4)}.solaris-card-media[data-align=start] .solaris-card-media__content{align-items:flex-start;justify-content:flex-start}.solaris-card-media[data-align=center] .solaris-card-media__content{align-items:center;justify-content:center}.solaris-card-media[data-align=end] .solaris-card-media__content{align-items:flex-end;justify-content:flex-end}.solaris-card-media__overlay{position:absolute;inset-block-start:var(--solaris-space-3);inset-inline-end:var(--solaris-space-3);z-index:2;display:inline-flex;align-items:center;justify-content:center;gap:var(--solaris-space-2)}.solaris-card-media__overlay:empty{display:none}.solaris-card-media__skeleton{inline-size:100%;block-size:100%;display:block;background:linear-gradient(90deg,color-mix(in srgb,var(--solaris-color-surface-2) 72%,transparent),color-mix(in srgb,white 18%,var(--solaris-color-surface-2)),color-mix(in srgb,var(--solaris-color-surface-2) 72%,transparent));background-size:200% 100%;animation:solaris-card-media-shimmer 1.2s linear infinite}.solaris-card-media.is-disabled{opacity:.58}.solaris-card-media.is-disabled .solaris-card-media__surface{filter:grayscale(.08)}@keyframes solaris-card-media-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6388
|
+
}
|
|
6389
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: SolarisCardMedia, decorators: [{
|
|
6390
|
+
type: Component,
|
|
6391
|
+
args: [{ selector: 'solaris-card-media', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"solaris-card-media\" [class.is-loading]=\"loading()\" [class.is-disabled]=\"disabled()\" [attr.data-variant]=\"variant()\"\r\n [attr.data-ratio]=\"ratio()\" [attr.data-align]=\"align()\" [attr.data-radius]=\"radius()\" [style.--solaris-card-media-fit]=\"fit()\">\r\n <div class=\"solaris-card-media__surface\">\r\n @if (loading()) {\r\n <span class=\"solaris-card-media__skeleton\" aria-hidden=\"true\"></span>\r\n } @else if (showImage()) {\r\n <img class=\"solaris-card-media__image\" [src]=\"normalizedSrc()\" [alt]=\"normalizedAlt()\" decoding=\"async\">\r\n } @else {\r\n <div class=\"solaris-card-media__content\">\r\n <ng-content></ng-content>\r\n </div>\r\n }\r\n\r\n <div class=\"solaris-card-media__overlay\">\r\n <ng-content select=\"[solaris-card-media-overlay]\"></ng-content>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [":host{display:block;min-inline-size:0}.solaris-card-media{--solaris-card-media-bg: var(--solaris-color-surface-2);--solaris-card-media-border: color-mix( in srgb, var(--solaris-color-border) 78%, transparent );--solaris-card-media-radius: inherit;--solaris-card-media-fit: cover;--solaris-card-media-shadow: none;--solaris-card-media-min-height: 6rem;position:relative;display:block;min-inline-size:0}.solaris-card-media__surface{position:relative;overflow:hidden;display:grid;place-items:center;min-inline-size:0;min-block-size:var(--solaris-card-media-min-height);background:var(--solaris-card-media-bg);border:1px solid var(--solaris-card-media-border);border-radius:var(--solaris-card-media-radius);box-shadow:var(--solaris-card-media-shadow)}.solaris-card-media[data-ratio=auto] .solaris-card-media__surface{aspect-ratio:auto}.solaris-card-media[data-ratio=\"1:1\"] .solaris-card-media__surface{aspect-ratio:1/1}.solaris-card-media[data-ratio=\"4:3\"] .solaris-card-media__surface{aspect-ratio:4/3}.solaris-card-media[data-ratio=\"16:9\"] .solaris-card-media__surface{aspect-ratio:16/9}.solaris-card-media[data-ratio=\"21:9\"] .solaris-card-media__surface{aspect-ratio:21/9}.solaris-card-media[data-radius=none]{--solaris-card-media-radius: 0}.solaris-card-media[data-radius=sm]{--solaris-card-media-radius: var(--solaris-radius-sm)}.solaris-card-media[data-radius=md]{--solaris-card-media-radius: var(--solaris-radius-md)}.solaris-card-media[data-radius=lg]{--solaris-card-media-radius: var(--solaris-radius-lg)}.solaris-card-media[data-radius=inherit]{--solaris-card-media-radius: inherit}.solaris-card-media__image{inline-size:100%;block-size:100%;display:block;object-fit:var(--solaris-card-media-fit)}.solaris-card-media__content{inline-size:100%;block-size:100%;min-inline-size:0;display:flex;padding:var(--solaris-space-4)}.solaris-card-media[data-align=start] .solaris-card-media__content{align-items:flex-start;justify-content:flex-start}.solaris-card-media[data-align=center] .solaris-card-media__content{align-items:center;justify-content:center}.solaris-card-media[data-align=end] .solaris-card-media__content{align-items:flex-end;justify-content:flex-end}.solaris-card-media__overlay{position:absolute;inset-block-start:var(--solaris-space-3);inset-inline-end:var(--solaris-space-3);z-index:2;display:inline-flex;align-items:center;justify-content:center;gap:var(--solaris-space-2)}.solaris-card-media__overlay:empty{display:none}.solaris-card-media__skeleton{inline-size:100%;block-size:100%;display:block;background:linear-gradient(90deg,color-mix(in srgb,var(--solaris-color-surface-2) 72%,transparent),color-mix(in srgb,white 18%,var(--solaris-color-surface-2)),color-mix(in srgb,var(--solaris-color-surface-2) 72%,transparent));background-size:200% 100%;animation:solaris-card-media-shimmer 1.2s linear infinite}.solaris-card-media.is-disabled{opacity:.58}.solaris-card-media.is-disabled .solaris-card-media__surface{filter:grayscale(.08)}@keyframes solaris-card-media-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}\n"] }]
|
|
6392
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], ratio: [{ type: i0.Input, args: [{ isSignal: true, alias: "ratio", required: false }] }], fit: [{ type: i0.Input, args: [{ isSignal: true, alias: "fit", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
6393
|
+
|
|
6394
|
+
function sanitizePhoneInput(v) {
|
|
6395
|
+
let s = (v ?? '').replace(/[^\d+\-\s().]/g, '');
|
|
6396
|
+
s = s.replace(/\+/g, (_m, offset) => (offset === 0 ? '+' : ''));
|
|
6397
|
+
return s;
|
|
6398
|
+
}
|
|
6399
|
+
function insertAtCursor(input, text) {
|
|
6400
|
+
const start = input.selectionStart ?? input.value.length;
|
|
6401
|
+
const end = input.selectionEnd ?? input.value.length;
|
|
6402
|
+
input.value = input.value.slice(0, start) + text + input.value.slice(end);
|
|
6403
|
+
const pos = start + text.length;
|
|
6404
|
+
input.setSelectionRange(pos, pos);
|
|
6405
|
+
}
|
|
6406
|
+
function enforceMaxDigitsInPlace(input, maxDigits) {
|
|
6407
|
+
if (!maxDigits)
|
|
6408
|
+
return;
|
|
6409
|
+
const v = input.value ?? '';
|
|
6410
|
+
const sanitized = sanitizePhoneInput(v);
|
|
6411
|
+
const digits = (sanitized.match(/\d/g) ?? []).length;
|
|
6412
|
+
if (digits <= maxDigits) {
|
|
6413
|
+
if (sanitized !== v)
|
|
6414
|
+
input.value = sanitized;
|
|
6415
|
+
return;
|
|
6416
|
+
}
|
|
6417
|
+
let digitCount = 0;
|
|
6418
|
+
let out = '';
|
|
6419
|
+
for (const ch of sanitized) {
|
|
6420
|
+
if (/\d/.test(ch)) {
|
|
6421
|
+
if (digitCount >= maxDigits)
|
|
6422
|
+
break;
|
|
6423
|
+
digitCount++;
|
|
6424
|
+
}
|
|
6425
|
+
out += ch;
|
|
6426
|
+
}
|
|
6427
|
+
input.value = out;
|
|
4087
6428
|
}
|
|
4088
6429
|
function shouldBlockBeforeInput(ev, cfg) {
|
|
4089
6430
|
return !!ev.data && !cfg.allowedChars.test(ev.data);
|
|
@@ -4883,24 +7224,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
4883
7224
|
}]
|
|
4884
7225
|
}] });
|
|
4885
7226
|
|
|
4886
|
-
class FieldErrorComponent {
|
|
4887
|
-
text;
|
|
4888
|
-
textKey;
|
|
4889
|
-
textParams;
|
|
4890
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: FieldErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4891
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: FieldErrorComponent, isStandalone: true, selector: "solaris-field-error", inputs: { text: "text", textKey: "textKey", textParams: "textParams" }, ngImport: i0, template: "<div class=\"solaris-field-error\" role=\"alert\" aria-live=\"polite\">\r\n <span class=\"solaris-field-error__text\">\r\n @if (textKey) { {{ textKey | translate:textParams }} }\r\n @else { {{ text }} }\r\n </span>\r\n</div>\r\n", styles: [".solaris-field-error{line-height:1.25;padding-left:.5rem;font-size:var(--solaris-fs-10);color:var(--solaris-color-error)}\n"], dependencies: [{ kind: "pipe", type: SolarisTranslationPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4892
|
-
}
|
|
4893
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: FieldErrorComponent, decorators: [{
|
|
4894
|
-
type: Component,
|
|
4895
|
-
args: [{ selector: 'solaris-field-error', standalone: true, imports: [SolarisTranslationPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"solaris-field-error\" role=\"alert\" aria-live=\"polite\">\r\n <span class=\"solaris-field-error__text\">\r\n @if (textKey) { {{ textKey | translate:textParams }} }\r\n @else { {{ text }} }\r\n </span>\r\n</div>\r\n", styles: [".solaris-field-error{line-height:1.25;padding-left:.5rem;font-size:var(--solaris-fs-10);color:var(--solaris-color-error)}\n"] }]
|
|
4896
|
-
}], propDecorators: { text: [{
|
|
4897
|
-
type: Input
|
|
4898
|
-
}], textKey: [{
|
|
4899
|
-
type: Input
|
|
4900
|
-
}], textParams: [{
|
|
4901
|
-
type: Input
|
|
4902
|
-
}] } });
|
|
4903
|
-
|
|
4904
7227
|
class FormField {
|
|
4905
7228
|
field = inject(SolarisFormFieldController);
|
|
4906
7229
|
prefix;
|
|
@@ -4910,8 +7233,8 @@ class FormField {
|
|
|
4910
7233
|
hintKey = '';
|
|
4911
7234
|
labelKey = '';
|
|
4912
7235
|
radius = 'sm';
|
|
4913
|
-
appearance = 'filled';
|
|
4914
7236
|
showErrors = 'dirtyOrTouched';
|
|
7237
|
+
appearance = 'filled';
|
|
4915
7238
|
_tick = signal(0, ...(ngDevMode ? [{ debugName: "_tick" }] : []));
|
|
4916
7239
|
customErrorKey = input('', ...(ngDevMode ? [{ debugName: "customErrorKey" }] : []));
|
|
4917
7240
|
invalid = input(null, ...(ngDevMode ? [{ debugName: "invalid" }] : []));
|
|
@@ -5004,7 +7327,7 @@ class FormField {
|
|
|
5004
7327
|
return !!c?.disabled;
|
|
5005
7328
|
}, ...(ngDevMode ? [{ debugName: "disabledComputed" }] : []));
|
|
5006
7329
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: FormField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5007
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: FormField, isStandalone: true, selector: "solaris-form-field", inputs: { hint: { classPropertyName: "hint", publicName: "hint", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, hintKey: { classPropertyName: "hintKey", publicName: "hintKey", isSignal: false, isRequired: false, transformFunction: null }, labelKey: { classPropertyName: "labelKey", publicName: "labelKey", isSignal: false, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: false, isRequired: false, transformFunction: null },
|
|
7330
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: FormField, isStandalone: true, selector: "solaris-form-field", inputs: { hint: { classPropertyName: "hint", publicName: "hint", isSignal: false, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, hintKey: { classPropertyName: "hintKey", publicName: "hintKey", isSignal: false, isRequired: false, transformFunction: null }, labelKey: { classPropertyName: "labelKey", publicName: "labelKey", isSignal: false, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: false, isRequired: false, transformFunction: null }, showErrors: { classPropertyName: "showErrors", publicName: "showErrors", isSignal: false, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: false, isRequired: false, transformFunction: null }, customErrorKey: { classPropertyName: "customErrorKey", publicName: "customErrorKey", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, customErrorParams: { classPropertyName: "customErrorParams", publicName: "customErrorParams", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
5008
7331
|
SolarisFormFieldController,
|
|
5009
7332
|
{ provide: SOLARIS_FORM_FIELD_CONTROLLER, useExisting: SolarisFormFieldController },
|
|
5010
7333
|
], 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 [attr.data-disabled]=\"disabledComputed() ? '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() || disabledComputed()) {\r\n <span class=\"solaris-form-field__suffix\">\r\n @if (disabledComputed()) {\r\n <span class=\"solaris-form-field__status solaris-form-field__status--disabled\" aria-hidden=\"true\">\r\n <i class=\"ph ph-lock-simple\"></i>\r\n </span>\r\n } @else {\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 }\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;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(: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}.solaris-form-field[data-disabled=true] .solaris-form-field__frame{opacity:.45;cursor:not-allowed}.solaris-form-field[data-disabled=true] .solaris-form-field__frame *,.solaris-form-field[data-disabled=true] .solaris-form-field__label,.solaris-form-field[data-disabled=true] .solaris-form-field__hint{cursor:not-allowed}.solaris-form-field[data-disabled=true] .solaris-form-field__prefix,.solaris-form-field[data-disabled=true] .solaris-form-field__suffix,.solaris-form-field[data-disabled=true] .solaris-form-field__label,.solaris-form-field[data-disabled=true] .solaris-form-field__hint{color:var(--solaris-color-text-muted)}.solaris-form-field__status--disabled{opacity:.9;width:3.8rem;display:grid;height:3.8rem;place-items:center;color:var(--solaris-color-text-muted)}.solaris-form-field[data-disabled=true] .solaris-form-field__frame,.solaris-form-field[data-disabled=true] .solaris-form-field__control-slot,.solaris-form-field[data-disabled=true] .solaris-form-field__control-slot>*,.solaris-form-field[data-disabled=true] .solaris-form-field__control-slot :is(input,textarea,select,button){cursor:not-allowed!important}.solaris-form-field__status--disabled i{line-height:1;font-size:var(--solaris-fs-18)}\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 });
|
|
@@ -5031,10 +7354,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
5031
7354
|
type: Input
|
|
5032
7355
|
}], radius: [{
|
|
5033
7356
|
type: Input
|
|
5034
|
-
}], appearance: [{
|
|
5035
|
-
type: Input
|
|
5036
7357
|
}], showErrors: [{
|
|
5037
7358
|
type: Input
|
|
7359
|
+
}], appearance: [{
|
|
7360
|
+
type: Input
|
|
5038
7361
|
}], customErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "customErrorKey", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], customErrorParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "customErrorParams", required: false }] }] } });
|
|
5039
7362
|
|
|
5040
7363
|
class SolarisSelect {
|
|
@@ -5770,5 +8093,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
5770
8093
|
* Generated bundle index. Do not edit.
|
|
5771
8094
|
*/
|
|
5772
8095
|
|
|
5773
|
-
export {
|
|
8096
|
+
export { ButtonGroupDirective, FieldErrorComponent, FormField, InputTextDirective, PasswordToggle, SOLARIS_CARD_GROUP, SOLARIS_CARD_SLOT_DIRECTIVES, SOLARIS_DIALOG_DATA, SOLARIS_FORM_FIELD_CONTROLLER, SOLARIS_FORM_FIELD_FEATURES, SOLARIS_INPUT, SOLARIS_NOTIFICATION_CONFIG, SOLARIS_NOTIFICATION_DEFAULT_CONFIG, SOLARIS_NOTIFICATION_POSITIONS, SOLARIS_RADIO_GROUP, SolarisAvatar, SolarisAvatarDropdown, SolarisAvatarOverlayDirective, SolarisAvatarStack, SolarisBadge, SolarisBodyDirective, SolarisBreadcrumb, SolarisButtonDirective, SolarisCard, SolarisCardActionsDirective, SolarisCardBadgeDirective, SolarisCardDescriptionDirective, SolarisCardEyebrowDirective, SolarisCardFooterDirective, SolarisCardGroup, SolarisCardMedia, SolarisCardMediaDirective, SolarisCardMediaOverlayDirective, SolarisCardMetaDirective, SolarisCardTitleDirective, SolarisCheckbox, SolarisColumnCellDef, SolarisColumnHeaderDef, SolarisControlBridgeDirective, SolarisDialogContainer, SolarisDialogRef, SolarisDialogService, SolarisDivider, SolarisDrawer, SolarisDrawerFooterDirective, SolarisDrawerHeaderDirective, SolarisDropdownContent, SolarisDropdownContentPanelDirective, SolarisDropdownContentRegistry, SolarisDropdownContentTriggerDirective, SolarisEmailDirective, SolarisFilterBar, SolarisFilterChip, SolarisFilterField, SolarisFilterPanel, SolarisFilterPanelFooterDirective, SolarisFloatingOverlayService, SolarisFooterDirective, SolarisFormFieldController, SolarisHeaderDirective, SolarisIdGenerator, SolarisImageSliderComponent, SolarisLoading, SolarisLoadingOverlay, SolarisNotificationCenterComponent, SolarisNotificationHostComponent, SolarisNotificationIntlService, SolarisNotificationItemComponent, SolarisNotificationService, SolarisPage, SolarisPageHeader, SolarisPageHeaderBreadcrumbDirective, SolarisPageHeaderDescriptionDirective, SolarisPageHeaderTitle, SolarisPageHeaderTitleDirective, SolarisPasswordDirective, SolarisPhoneInput, SolarisPopover, SolarisPopoverPanelDirective, SolarisPopoverTriggerDirective, SolarisPrefixDirective, SolarisPresenceAvatar, SolarisRadio, SolarisRadioGroup, SolarisRichTooltipDirective, SolarisRichTooltipPanel, SolarisRowComponent, SolarisSectionComponent, SolarisSelect, SolarisSelectionCard, SolarisStepper, SolarisStepperItem, SolarisSuffixDirective, SolarisTab, SolarisTable, SolarisTableColumn, SolarisTableFilters, SolarisTableSkeleton, SolarisTabs, SolarisTooltipDirective, SolarisTooltipPanel, computeFloatingPosition, computePopoverPosition, provideSolarisNotifications, repositionTooltipOverlay, uniqueId };
|
|
5774
8097
|
//# sourceMappingURL=educarehq-solaris-components.mjs.map
|