@educarehq/solaris-ui 0.11.2 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/educarehq-solaris-ui.mjs +700 -23
- package/fesm2022/educarehq-solaris-ui.mjs.map +1 -1
- package/package.json +7 -5
- package/styles/_button.scss +79 -74
- package/styles/token/color/_dark.scss +23 -23
- package/styles/token/color/_light.scss +9 -9
- package/types/educarehq-solaris-ui.d.ts +157 -8
|
@@ -4,6 +4,11 @@ import { isPlatformBrowser, NgTemplateOutlet, DOCUMENT as DOCUMENT$1 } from '@an
|
|
|
4
4
|
import { FormControlDirective, FormControlName, NgModel, NG_VALUE_ACCESSOR, NgControl, FormsModule } from '@angular/forms';
|
|
5
5
|
import { Overlay, OverlayConfig } from '@angular/cdk/overlay';
|
|
6
6
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
7
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
8
|
+
import { getCountries, getCountryCallingCode, Metadata, AsYouType, parsePhoneNumberFromString, getExampleNumber } from 'libphonenumber-js';
|
|
9
|
+
import * as FLAG_3X2 from 'country-flag-icons/string/3x2';
|
|
10
|
+
import { hasFlag } from 'country-flag-icons';
|
|
11
|
+
import examples from 'libphonenumber-js/examples.mobile.json';
|
|
7
12
|
import { CdkTrapFocus } from '@angular/cdk/a11y';
|
|
8
13
|
import { Subject } from 'rxjs';
|
|
9
14
|
import { TestBed } from '@angular/core/testing';
|
|
@@ -114,6 +119,12 @@ const SOLARIS_TRANSLATE_DEFAULT_CONFIG = {
|
|
|
114
119
|
'solaris.password-field.strength.weak': 'Weak',
|
|
115
120
|
'solaris.password-field.strength.medium': 'Medium',
|
|
116
121
|
'solaris.password-field.strength.strong': 'Strong',
|
|
122
|
+
'solaris.phone-field.required': 'Phone number is required.',
|
|
123
|
+
'solaris.phone-field.invalid': 'Enter a valid phone number.',
|
|
124
|
+
'solaris.phone-field.search.placeholder': 'Search country or code',
|
|
125
|
+
'solaris.phone-field.empty': 'No countries available',
|
|
126
|
+
'solaris.phone-field.noResults': 'No results found',
|
|
127
|
+
'solaris.phone-field.country': 'Select country code',
|
|
117
128
|
},
|
|
118
129
|
'pt-BR': {
|
|
119
130
|
'solaris.button.loading': 'Carregando...',
|
|
@@ -184,6 +195,12 @@ const SOLARIS_TRANSLATE_DEFAULT_CONFIG = {
|
|
|
184
195
|
'solaris.password-field.strength.weak': 'Fraca',
|
|
185
196
|
'solaris.password-field.strength.medium': 'Média',
|
|
186
197
|
'solaris.password-field.strength.strong': 'Forte',
|
|
198
|
+
'solaris.phone-field.required': 'O número de telefone é obrigatório.',
|
|
199
|
+
'solaris.phone-field.invalid': 'Insira um número de telefone válido.',
|
|
200
|
+
'solaris.phone-field.search.placeholder': 'Buscar país ou código',
|
|
201
|
+
'solaris.phone-field.empty': 'Nenhum país disponível',
|
|
202
|
+
'solaris.phone-field.noResults': 'Nenhum resultado encontrado',
|
|
203
|
+
'solaris.phone-field.country': 'Selecionar código do país',
|
|
187
204
|
},
|
|
188
205
|
},
|
|
189
206
|
useBrowserLocale: true,
|
|
@@ -2642,18 +2659,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2642
2659
|
// SECURITY_EXCEPTION_FILE: ElementRef.nativeElement.setAttribute required for default <button> type behavior.
|
|
2643
2660
|
// SECURITY_EXCEPTION_FILE: createComponent/insertBefore/appendChild required to render the spinner and icon components inside a native button host (directive has no template).
|
|
2644
2661
|
class SolarisButtonDirective {
|
|
2662
|
+
iconPosition = input('start', ...(ngDevMode ? [{ debugName: "iconPosition" }] : /* istanbul ignore next */ []));
|
|
2645
2663
|
appearance = input('solid', ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
2646
2664
|
color = input('neutral', ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
2665
|
+
shape = input('normal', ...(ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []));
|
|
2647
2666
|
radius = input('md', ...(ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []));
|
|
2648
2667
|
density = input(...(ngDevMode ? [undefined, { debugName: "density" }] : /* istanbul ignore next */ []));
|
|
2649
|
-
shape = input('normal', ...(ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []));
|
|
2650
|
-
loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
2651
|
-
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
2652
2668
|
fullWidth = input(false, ...(ngDevMode ? [{ debugName: "fullWidth" }] : /* istanbul ignore next */ []));
|
|
2669
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
2670
|
+
loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
2653
2671
|
loadingLabelKey = input(...(ngDevMode ? [undefined, { debugName: "loadingLabelKey" }] : /* istanbul ignore next */ []));
|
|
2654
2672
|
loadingLabel = input(...(ngDevMode ? [undefined, { debugName: "loadingLabel" }] : /* istanbul ignore next */ []));
|
|
2655
2673
|
icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
2656
|
-
iconPosition = input('start', ...(ngDevMode ? [{ debugName: "iconPosition" }] : /* istanbul ignore next */ []));
|
|
2657
2674
|
computedIconPosition = computed(() => {
|
|
2658
2675
|
return this.icon() ? this.iconPosition() : null;
|
|
2659
2676
|
}, ...(ngDevMode ? [{ debugName: "computedIconPosition" }] : /* istanbul ignore next */ []));
|
|
@@ -2695,10 +2712,12 @@ class SolarisButtonDirective {
|
|
|
2695
2712
|
}
|
|
2696
2713
|
// Apply variant attributes synchronously so the element never flashes the
|
|
2697
2714
|
// base style before Angular's first change detection (SSR/hydration FOUC).
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
el.
|
|
2701
|
-
el.
|
|
2715
|
+
// Apply variant attributes synchronously so the element never flashes the
|
|
2716
|
+
// base style before Angular's first change detection (SSR/hydration FOUC).
|
|
2717
|
+
el.dataset['appearance'] = this.appearance();
|
|
2718
|
+
el.dataset['color'] = this.color();
|
|
2719
|
+
el.dataset['radius'] = this.radius();
|
|
2720
|
+
el.dataset['shape'] = this.shape();
|
|
2702
2721
|
effect(() => {
|
|
2703
2722
|
if (this.loading()) {
|
|
2704
2723
|
this.attachSpinner();
|
|
@@ -2783,7 +2802,7 @@ class SolarisButtonDirective {
|
|
|
2783
2802
|
}
|
|
2784
2803
|
}
|
|
2785
2804
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2786
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.17", type: SolarisButtonDirective, isStandalone: true, selector: "[solaris-button]", inputs: {
|
|
2805
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.17", type: SolarisButtonDirective, isStandalone: true, selector: "[solaris-button]", inputs: { iconPosition: { classPropertyName: "iconPosition", publicName: "iconPosition", 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 }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, loadingLabelKey: { classPropertyName: "loadingLabelKey", publicName: "loadingLabelKey", isSignal: true, isRequired: false, transformFunction: null }, loadingLabel: { classPropertyName: "loadingLabel", publicName: "loadingLabel", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick($event)" }, properties: { "attr.data-appearance": "appearance()", "attr.data-color": "color()", "attr.data-radius": "radius()", "attr.data-density": "effectiveDensity()", "attr.data-shape": "shape()", "attr.data-loading": "loading() ? \"\" : null", "attr.data-full-width": "fullWidth() ? \"\" : null", "attr.data-icon-position": "computedIconPosition()", "attr.aria-busy": "loading() ? \"true\" : null", "attr.aria-label": "loading() ? resolvedLoadingLabel() : null", "attr.aria-disabled": "isEffectivelyDisabled() ? \"true\" : null", "attr.disabled": "isButton && isEffectivelyDisabled() ? \"\" : null", "tabindex": "isAnchor && isEffectivelyDisabled() ? \"-1\" : null" } }, ngImport: i0 });
|
|
2787
2806
|
}
|
|
2788
2807
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisButtonDirective, decorators: [{
|
|
2789
2808
|
type: Directive,
|
|
@@ -2806,7 +2825,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2806
2825
|
'[tabindex]': 'isAnchor && isEffectivelyDisabled() ? "-1" : null',
|
|
2807
2826
|
},
|
|
2808
2827
|
}]
|
|
2809
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
2828
|
+
}], ctorParameters: () => [], propDecorators: { iconPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPosition", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], loadingLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingLabelKey", required: false }] }], loadingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingLabel", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], onClick: [{
|
|
2810
2829
|
type: HostListener,
|
|
2811
2830
|
args: ['click', ['$event']]
|
|
2812
2831
|
}] } });
|
|
@@ -3793,14 +3812,14 @@ class SolarisPopoverPanelComponent {
|
|
|
3793
3812
|
}
|
|
3794
3813
|
}
|
|
3795
3814
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisPopoverPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3796
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.17", type: SolarisPopoverPanelComponent, isStandalone: true, selector: "solaris-popover-panel", host: { properties: { "attr.tabindex": "data.autoFocus === \"panel\" ? \"-1\" : null" }, classAttribute: "solaris-popover-panel" }, ngImport: i0, template: "<div\n class=\"solaris-popover-panel__container\"\n [attr.data-appearance]=\"data.appearance\"\n [attr.data-padding]=\"data.padding\"\n [attr.data-radius]=\"data.radius\"\n [attr.data-connected-side]=\"data.connectedSide ?? null\"\n [attr.role]=\"data.role\"\n [id]=\"data.panelId\"\n tabindex=\"-1\"\n>\n <ng-container *ngTemplateOutlet=\"data.contentTemplate\" />\n</div>\n", styles: [":host{--solaris-popover-border-width: 0;--solaris-popover-min-width: auto;--solaris-popover-max-width: none;--solaris-popover-border-color: transparent;--solaris-popover-radius: var(--solaris-radius-md);--solaris-popover-shadow: var(--solaris-shadow-lg);--solaris-popover-padding: var(--solaris-spacing-3);--solaris-popover-color: var(--solaris-text-default);--solaris-popover-background: var(--solaris-surface-raised);width:100%;outline:none;display:block}.solaris-popover-panel__container{width:100%;outline:none;box-sizing:border-box;color:var(--solaris-popover-color);padding:var(--solaris-popover-padding);box-shadow:var(--solaris-popover-shadow);min-width:var(--solaris-popover-min-width);max-width:var(--solaris-popover-max-width);border-radius:var(--solaris-popover-radius);background:var(--solaris-popover-background);border:var(--solaris-popover-border-width) solid var(--solaris-popover-border-color)}.solaris-popover-panel__container[data-appearance=outline]{background:var(--solaris-surface-base);border:var(--solaris-border-width-sm) solid var(--solaris-border-subtle)}.solaris-popover-panel__container[data-padding=none]{--solaris-popover-padding: 0}.solaris-popover-panel__container[data-padding=sm]{--solaris-popover-padding: var(--solaris-spacing-2)}.solaris-popover-panel__container[data-padding=md]{--solaris-popover-padding: var(--solaris-spacing-3)}.solaris-popover-panel__container[data-padding=lg]{--solaris-popover-padding: var(--solaris-spacing-4)}.solaris-popover-panel__container[data-radius=none]{border-radius:var(--solaris-radius-none)}.solaris-popover-panel__container[data-radius=sm]{border-radius:var(--solaris-radius-sm)}.solaris-popover-panel__container[data-radius=md]{border-radius:var(--solaris-radius-md)}.solaris-popover-panel__container[data-radius=lg]{border-radius:var(--solaris-radius-lg)}.solaris-popover-panel__container[data-radius=xl]{border-radius:var(--solaris-radius-xl)}.solaris-popover-panel__container[data-connected-side=bottom][data-form-field]{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.solaris-popover-panel__container[data-connected-side=top][data-form-field]{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3815
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.17", type: SolarisPopoverPanelComponent, isStandalone: true, selector: "solaris-popover-panel", host: { properties: { "attr.tabindex": "data.autoFocus === \"panel\" ? \"-1\" : null" }, classAttribute: "solaris-popover-panel" }, ngImport: i0, template: "<div\n class=\"solaris-popover-panel__container\"\n [attr.data-appearance]=\"data.appearance\"\n [attr.data-padding]=\"data.padding\"\n [attr.data-radius]=\"data.radius\"\n [attr.data-connected-side]=\"data.connectedSide ?? null\"\n [attr.role]=\"data.role\"\n [id]=\"data.panelId\"\n tabindex=\"-1\"\n>\n <ng-container *ngTemplateOutlet=\"data.contentTemplate\" />\n</div>\n", styles: [":host{--solaris-popover-border-width: 0;--solaris-popover-min-width: auto;--solaris-popover-max-width: none;--solaris-popover-border-color: transparent;--solaris-popover-radius: var(--solaris-radius-md);--solaris-popover-shadow: var(--solaris-shadow-lg);--solaris-popover-padding: var(--solaris-spacing-3);--solaris-popover-color: var(--solaris-text-default);--solaris-popover-background: var(--solaris-surface-raised);width:100%;outline:none;display:block}.solaris-popover-panel__container{width:100%;outline:none;box-sizing:border-box;color:var(--solaris-popover-color);padding:var(--solaris-popover-padding);box-shadow:var(--solaris-popover-shadow);min-width:var(--solaris-popover-min-width);max-width:var(--solaris-popover-max-width);border-radius:var(--solaris-popover-radius);background:var(--solaris-popover-background);border:var(--solaris-popover-border-width) solid var(--solaris-popover-border-color)}.solaris-popover-panel__container[data-appearance=outline]{background:var(--solaris-surface-base);border:var(--solaris-border-width-sm) solid var(--solaris-border-subtle)}.solaris-popover-panel__container[data-appearance=filled]{border:var(--solaris-border-width-sm) solid var(--solaris-border-subtle)}.solaris-popover-panel__container[data-padding=none]{--solaris-popover-padding: 0}.solaris-popover-panel__container[data-padding=sm]{--solaris-popover-padding: var(--solaris-spacing-2)}.solaris-popover-panel__container[data-padding=md]{--solaris-popover-padding: var(--solaris-spacing-3)}.solaris-popover-panel__container[data-padding=lg]{--solaris-popover-padding: var(--solaris-spacing-4)}.solaris-popover-panel__container[data-radius=none]{border-radius:var(--solaris-radius-none)}.solaris-popover-panel__container[data-radius=sm]{border-radius:var(--solaris-radius-sm)}.solaris-popover-panel__container[data-radius=md]{border-radius:var(--solaris-radius-md)}.solaris-popover-panel__container[data-radius=lg]{border-radius:var(--solaris-radius-lg)}.solaris-popover-panel__container[data-radius=xl]{border-radius:var(--solaris-radius-xl)}.solaris-popover-panel__container[data-connected-side=bottom][data-form-field]{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.solaris-popover-panel__container[data-connected-side=top][data-form-field]{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3797
3816
|
}
|
|
3798
3817
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisPopoverPanelComponent, decorators: [{
|
|
3799
3818
|
type: Component,
|
|
3800
3819
|
args: [{ selector: 'solaris-popover-panel', standalone: true, imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
3801
3820
|
class: 'solaris-popover-panel',
|
|
3802
3821
|
'[attr.tabindex]': 'data.autoFocus === "panel" ? "-1" : null',
|
|
3803
|
-
}, template: "<div\n class=\"solaris-popover-panel__container\"\n [attr.data-appearance]=\"data.appearance\"\n [attr.data-padding]=\"data.padding\"\n [attr.data-radius]=\"data.radius\"\n [attr.data-connected-side]=\"data.connectedSide ?? null\"\n [attr.role]=\"data.role\"\n [id]=\"data.panelId\"\n tabindex=\"-1\"\n>\n <ng-container *ngTemplateOutlet=\"data.contentTemplate\" />\n</div>\n", styles: [":host{--solaris-popover-border-width: 0;--solaris-popover-min-width: auto;--solaris-popover-max-width: none;--solaris-popover-border-color: transparent;--solaris-popover-radius: var(--solaris-radius-md);--solaris-popover-shadow: var(--solaris-shadow-lg);--solaris-popover-padding: var(--solaris-spacing-3);--solaris-popover-color: var(--solaris-text-default);--solaris-popover-background: var(--solaris-surface-raised);width:100%;outline:none;display:block}.solaris-popover-panel__container{width:100%;outline:none;box-sizing:border-box;color:var(--solaris-popover-color);padding:var(--solaris-popover-padding);box-shadow:var(--solaris-popover-shadow);min-width:var(--solaris-popover-min-width);max-width:var(--solaris-popover-max-width);border-radius:var(--solaris-popover-radius);background:var(--solaris-popover-background);border:var(--solaris-popover-border-width) solid var(--solaris-popover-border-color)}.solaris-popover-panel__container[data-appearance=outline]{background:var(--solaris-surface-base);border:var(--solaris-border-width-sm) solid var(--solaris-border-subtle)}.solaris-popover-panel__container[data-padding=none]{--solaris-popover-padding: 0}.solaris-popover-panel__container[data-padding=sm]{--solaris-popover-padding: var(--solaris-spacing-2)}.solaris-popover-panel__container[data-padding=md]{--solaris-popover-padding: var(--solaris-spacing-3)}.solaris-popover-panel__container[data-padding=lg]{--solaris-popover-padding: var(--solaris-spacing-4)}.solaris-popover-panel__container[data-radius=none]{border-radius:var(--solaris-radius-none)}.solaris-popover-panel__container[data-radius=sm]{border-radius:var(--solaris-radius-sm)}.solaris-popover-panel__container[data-radius=md]{border-radius:var(--solaris-radius-md)}.solaris-popover-panel__container[data-radius=lg]{border-radius:var(--solaris-radius-lg)}.solaris-popover-panel__container[data-radius=xl]{border-radius:var(--solaris-radius-xl)}.solaris-popover-panel__container[data-connected-side=bottom][data-form-field]{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.solaris-popover-panel__container[data-connected-side=top][data-form-field]{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}\n"] }]
|
|
3822
|
+
}, template: "<div\n class=\"solaris-popover-panel__container\"\n [attr.data-appearance]=\"data.appearance\"\n [attr.data-padding]=\"data.padding\"\n [attr.data-radius]=\"data.radius\"\n [attr.data-connected-side]=\"data.connectedSide ?? null\"\n [attr.role]=\"data.role\"\n [id]=\"data.panelId\"\n tabindex=\"-1\"\n>\n <ng-container *ngTemplateOutlet=\"data.contentTemplate\" />\n</div>\n", styles: [":host{--solaris-popover-border-width: 0;--solaris-popover-min-width: auto;--solaris-popover-max-width: none;--solaris-popover-border-color: transparent;--solaris-popover-radius: var(--solaris-radius-md);--solaris-popover-shadow: var(--solaris-shadow-lg);--solaris-popover-padding: var(--solaris-spacing-3);--solaris-popover-color: var(--solaris-text-default);--solaris-popover-background: var(--solaris-surface-raised);width:100%;outline:none;display:block}.solaris-popover-panel__container{width:100%;outline:none;box-sizing:border-box;color:var(--solaris-popover-color);padding:var(--solaris-popover-padding);box-shadow:var(--solaris-popover-shadow);min-width:var(--solaris-popover-min-width);max-width:var(--solaris-popover-max-width);border-radius:var(--solaris-popover-radius);background:var(--solaris-popover-background);border:var(--solaris-popover-border-width) solid var(--solaris-popover-border-color)}.solaris-popover-panel__container[data-appearance=outline]{background:var(--solaris-surface-base);border:var(--solaris-border-width-sm) solid var(--solaris-border-subtle)}.solaris-popover-panel__container[data-appearance=filled]{border:var(--solaris-border-width-sm) solid var(--solaris-border-subtle)}.solaris-popover-panel__container[data-padding=none]{--solaris-popover-padding: 0}.solaris-popover-panel__container[data-padding=sm]{--solaris-popover-padding: var(--solaris-spacing-2)}.solaris-popover-panel__container[data-padding=md]{--solaris-popover-padding: var(--solaris-spacing-3)}.solaris-popover-panel__container[data-padding=lg]{--solaris-popover-padding: var(--solaris-spacing-4)}.solaris-popover-panel__container[data-radius=none]{border-radius:var(--solaris-radius-none)}.solaris-popover-panel__container[data-radius=sm]{border-radius:var(--solaris-radius-sm)}.solaris-popover-panel__container[data-radius=md]{border-radius:var(--solaris-radius-md)}.solaris-popover-panel__container[data-radius=lg]{border-radius:var(--solaris-radius-lg)}.solaris-popover-panel__container[data-radius=xl]{border-radius:var(--solaris-radius-xl)}.solaris-popover-panel__container[data-connected-side=bottom][data-form-field]{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.solaris-popover-panel__container[data-connected-side=top][data-form-field]{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}\n"] }]
|
|
3804
3823
|
}] });
|
|
3805
3824
|
|
|
3806
3825
|
function getBasePosition(placement, align) {
|
|
@@ -4081,11 +4100,13 @@ class SolarisPopoverTriggerDirective {
|
|
|
4081
4100
|
this.panelContainerRef.dataset['formField'] = '';
|
|
4082
4101
|
}
|
|
4083
4102
|
}
|
|
4084
|
-
this.
|
|
4085
|
-
this.connectedSide
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
formFieldWrapper
|
|
4103
|
+
if (this.solarisPopoverTopConnected()) {
|
|
4104
|
+
this.elementRef.nativeElement.dataset['connectedSide'] =
|
|
4105
|
+
this.connectedSide;
|
|
4106
|
+
const formFieldWrapper = this.elementRef.nativeElement.querySelector(':scope > .solaris-form-field__control-wrapper');
|
|
4107
|
+
if (formFieldWrapper) {
|
|
4108
|
+
formFieldWrapper.dataset['connectedSide'] = this.connectedSide;
|
|
4109
|
+
}
|
|
4089
4110
|
}
|
|
4090
4111
|
});
|
|
4091
4112
|
}
|
|
@@ -9445,6 +9466,662 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
9445
9466
|
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<solaris-form-field\n [hint]=\"hint()\"\n [label]=\"label()\"\n [radius]=\"radius()\"\n [density]=\"density()\"\n [hintKey]=\"hintKey()\"\n [labelKey]=\"labelKey()\"\n [errorKey]=\"errorKey()\"\n [required]=\"required()\"\n [optional]=\"optional()\"\n [readonly]=\"readonly()\"\n [appearance]=\"appearance()\"\n [invalid]=\"isFieldInvalid()\"\n [error]=\"error() || computedError()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [hasPrefix]=\"hasPrefix()\"\n [hasSuffix]=\"hasSuffix()\"\n>\n @if (prefix() && !projectedPrefix()) {\n <span solaris-form-prefix>\n <solaris-icon [name]=\"prefix() ?? ''\" [decorative]=\"true\" />\n </span>\n }\n <ng-content\n select=\"[solaris-form-prefix]\"\n ngProjectAs=\"[solaris-form-prefix]\"\n />\n <input\n type=\"email\"\n #inputElement\n solaris-input\n data-bwignore=\"true\"\n [density]=\"density()\"\n (blur)=\"onInputBlur()\"\n [readonly]=\"readonly()\"\n (focus)=\"onInputFocus()\"\n [attr.id]=\"id() ?? null\"\n (input)=\"onInput($event)\"\n [value]=\"internalValue()\"\n [attr.inputmode]=\"'email'\"\n [attr.spellcheck]=\"'false'\"\n [attr.name]=\"name() ?? null\"\n [attr.autocapitalize]=\"'none'\"\n [attr.autocomplete]=\"autocomplete()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [attr.maxlength]=\"maxLength() ?? null\"\n [attr.placeholder]=\"placeholderText() || null\"\n />\n @if (suffix() && !projectedSuffix()) {\n <span solaris-form-suffix>\n <solaris-icon [name]=\"suffix() ?? ''\" [decorative]=\"true\" />\n </span>\n }\n <ng-content\n select=\"[solaris-form-suffix]\"\n ngProjectAs=\"[solaris-form-suffix]\"\n />\n <ng-content\n select=\"[solaris-form-label-action]\"\n ngProjectAs=\"[solaris-form-label-action]\"\n />\n</solaris-form-field>\n", styles: [":host{display:block;box-sizing:border-box}\n"] }]
|
|
9446
9467
|
}], propDecorators: { inputElementRef: [{ type: i0.ViewChild, args: ['inputElement', { isSignal: true }] }], projectedPrefix: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SolarisFormPrefixDirective), { isSignal: true }] }], projectedSuffix: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SolarisFormSuffixDirective), { isSignal: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], hintKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintKey", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], labelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelKey", required: false }] }], errorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorKey", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], invalidError: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidError", required: false }] }], requiredError: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredError", required: false }] }], placeholderKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholderKey", required: false }] }], invalidErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidErrorKey", required: false }] }], requiredErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredErrorKey", required: false }] }], allowedDomainError: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedDomainError", required: false }] }], blockedDomainError: [{ type: i0.Input, args: [{ isSignal: true, alias: "blockedDomainError", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], trimOnBlur: [{ type: i0.Input, args: [{ isSignal: true, alias: "trimOnBlur", required: false }] }], allowedDomainErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedDomainErrorKey", required: false }] }], blockedDomainErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "blockedDomainErrorKey", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], normalizeLowercase: [{ type: i0.Input, args: [{ isSignal: true, alias: "normalizeLowercase", required: false }] }], allowedDomains: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedDomains", required: false }] }], blockedDomains: [{ type: i0.Input, args: [{ isSignal: true, alias: "blockedDomains", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], validateDomain: [{ type: i0.Input, args: [{ isSignal: true, alias: "validateDomain", required: false }] }], prefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefix", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }] } });
|
|
9447
9468
|
|
|
9469
|
+
// SECURITY_EXCEPTION_FILE: this pipe trusts a string only when rendered via [innerHTML] in the
|
|
9470
|
+
// phone-field country list. The value is a flag SVG returned by the pinned `country-flag-icons`
|
|
9471
|
+
// dependency (static data). It is never derived from user input, so bypassing Angular's sanitizer
|
|
9472
|
+
// here is safe and justified. A test documents this behavior.
|
|
9473
|
+
class SolarisSafeHtmlPipe {
|
|
9474
|
+
sanitizer = inject(DomSanitizer);
|
|
9475
|
+
transform(value) {
|
|
9476
|
+
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
9477
|
+
}
|
|
9478
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisSafeHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
9479
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.17", ngImport: i0, type: SolarisSafeHtmlPipe, isStandalone: true, name: "solarisSafeHtml" });
|
|
9480
|
+
}
|
|
9481
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisSafeHtmlPipe, decorators: [{
|
|
9482
|
+
type: Pipe,
|
|
9483
|
+
args: [{
|
|
9484
|
+
name: 'solarisSafeHtml',
|
|
9485
|
+
standalone: true,
|
|
9486
|
+
}]
|
|
9487
|
+
}] });
|
|
9488
|
+
|
|
9489
|
+
class SolarisPhoneCountryListComponent {
|
|
9490
|
+
countries = input([], ...(ngDevMode ? [{ debugName: "countries" }] : /* istanbul ignore next */ []));
|
|
9491
|
+
selectedCode = input(...(ngDevMode ? [undefined, { debugName: "selectedCode" }] : /* istanbul ignore next */ []));
|
|
9492
|
+
searchable = input(true, ...(ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []));
|
|
9493
|
+
searchPlaceholder = input('', ...(ngDevMode ? [{ debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []));
|
|
9494
|
+
noResultsText = input('', ...(ngDevMode ? [{ debugName: "noResultsText" }] : /* istanbul ignore next */ []));
|
|
9495
|
+
emptyText = input('', ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
|
|
9496
|
+
maxHeight = input(...(ngDevMode ? [undefined, { debugName: "maxHeight" }] : /* istanbul ignore next */ []));
|
|
9497
|
+
countrySelected = output();
|
|
9498
|
+
closeRequest = output();
|
|
9499
|
+
listId = nextIdFor('solaris-phone-country-list');
|
|
9500
|
+
searchQuery = signal('', ...(ngDevMode ? [{ debugName: "searchQuery" }] : /* istanbul ignore next */ []));
|
|
9501
|
+
activeIndex = signal(-1, ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
9502
|
+
filtered = computed(() => {
|
|
9503
|
+
const query = this.searchQuery().toLowerCase().trim();
|
|
9504
|
+
const list = this.countries();
|
|
9505
|
+
if (!query) {
|
|
9506
|
+
return list;
|
|
9507
|
+
}
|
|
9508
|
+
return list.filter((country) => country.name.toLowerCase().includes(query) ||
|
|
9509
|
+
country.code.toLowerCase().includes(query) ||
|
|
9510
|
+
country.callingCode.includes(query));
|
|
9511
|
+
}, ...(ngDevMode ? [{ debugName: "filtered" }] : /* istanbul ignore next */ []));
|
|
9512
|
+
showEmpty = computed(() => {
|
|
9513
|
+
return this.countries().length === 0;
|
|
9514
|
+
}, ...(ngDevMode ? [{ debugName: "showEmpty" }] : /* istanbul ignore next */ []));
|
|
9515
|
+
showNoResults = computed(() => {
|
|
9516
|
+
return this.countries().length > 0 && this.filtered().length === 0;
|
|
9517
|
+
}, ...(ngDevMode ? [{ debugName: "showNoResults" }] : /* istanbul ignore next */ []));
|
|
9518
|
+
activeDescendantId = computed(() => {
|
|
9519
|
+
const index = this.activeIndex();
|
|
9520
|
+
if (index < 0 || index >= this.filtered().length) {
|
|
9521
|
+
return null;
|
|
9522
|
+
}
|
|
9523
|
+
return this.optionId(index);
|
|
9524
|
+
}, ...(ngDevMode ? [{ debugName: "activeDescendantId" }] : /* istanbul ignore next */ []));
|
|
9525
|
+
optionId(index) {
|
|
9526
|
+
return `${this.listId}-option-${index}`;
|
|
9527
|
+
}
|
|
9528
|
+
onSearch(event) {
|
|
9529
|
+
const target = event.target;
|
|
9530
|
+
this.searchQuery.set(target.value);
|
|
9531
|
+
this.activeIndex.set(-1);
|
|
9532
|
+
}
|
|
9533
|
+
onSearchKeydown(event) {
|
|
9534
|
+
switch (event.key) {
|
|
9535
|
+
case 'ArrowDown':
|
|
9536
|
+
event.preventDefault();
|
|
9537
|
+
this.moveActive(1);
|
|
9538
|
+
break;
|
|
9539
|
+
case 'ArrowUp':
|
|
9540
|
+
event.preventDefault();
|
|
9541
|
+
this.moveActive(-1);
|
|
9542
|
+
break;
|
|
9543
|
+
case 'Enter':
|
|
9544
|
+
event.preventDefault();
|
|
9545
|
+
this.selectActive();
|
|
9546
|
+
break;
|
|
9547
|
+
case 'Escape':
|
|
9548
|
+
event.preventDefault();
|
|
9549
|
+
if (this.searchQuery()) {
|
|
9550
|
+
this.searchQuery.set('');
|
|
9551
|
+
this.activeIndex.set(-1);
|
|
9552
|
+
}
|
|
9553
|
+
else {
|
|
9554
|
+
this.closeRequest.emit();
|
|
9555
|
+
}
|
|
9556
|
+
break;
|
|
9557
|
+
case 'Tab':
|
|
9558
|
+
this.closeRequest.emit();
|
|
9559
|
+
break;
|
|
9560
|
+
}
|
|
9561
|
+
}
|
|
9562
|
+
onListClick(event) {
|
|
9563
|
+
const target = event.target;
|
|
9564
|
+
const optionEl = target.closest('.solaris-phone-country-list__option');
|
|
9565
|
+
if (!optionEl) {
|
|
9566
|
+
return;
|
|
9567
|
+
}
|
|
9568
|
+
const current = event.currentTarget;
|
|
9569
|
+
const index = Array.from(current.children).indexOf(optionEl);
|
|
9570
|
+
const list = this.filtered();
|
|
9571
|
+
if (index >= 0 && index < list.length) {
|
|
9572
|
+
this.countrySelected.emit(list[index]);
|
|
9573
|
+
}
|
|
9574
|
+
}
|
|
9575
|
+
onListKeydown(event) {
|
|
9576
|
+
const list = this.filtered();
|
|
9577
|
+
if (list.length === 0) {
|
|
9578
|
+
return;
|
|
9579
|
+
}
|
|
9580
|
+
let index = this.activeIndex();
|
|
9581
|
+
switch (event.key) {
|
|
9582
|
+
case 'ArrowDown':
|
|
9583
|
+
event.preventDefault();
|
|
9584
|
+
index = index >= list.length - 1 ? 0 : index + 1;
|
|
9585
|
+
break;
|
|
9586
|
+
case 'ArrowUp':
|
|
9587
|
+
event.preventDefault();
|
|
9588
|
+
index = index <= 0 ? list.length - 1 : index - 1;
|
|
9589
|
+
break;
|
|
9590
|
+
case 'Home':
|
|
9591
|
+
event.preventDefault();
|
|
9592
|
+
index = 0;
|
|
9593
|
+
break;
|
|
9594
|
+
case 'End':
|
|
9595
|
+
event.preventDefault();
|
|
9596
|
+
index = list.length - 1;
|
|
9597
|
+
break;
|
|
9598
|
+
case 'Enter':
|
|
9599
|
+
case ' ':
|
|
9600
|
+
event.preventDefault();
|
|
9601
|
+
if (index >= 0 && index < list.length) {
|
|
9602
|
+
this.countrySelected.emit(list[index]);
|
|
9603
|
+
}
|
|
9604
|
+
return;
|
|
9605
|
+
case 'Escape':
|
|
9606
|
+
event.preventDefault();
|
|
9607
|
+
this.closeRequest.emit();
|
|
9608
|
+
return;
|
|
9609
|
+
case 'Tab':
|
|
9610
|
+
this.closeRequest.emit();
|
|
9611
|
+
return;
|
|
9612
|
+
default:
|
|
9613
|
+
return;
|
|
9614
|
+
}
|
|
9615
|
+
this.activeIndex.set(index);
|
|
9616
|
+
}
|
|
9617
|
+
moveActive(direction) {
|
|
9618
|
+
const list = this.filtered();
|
|
9619
|
+
if (list.length === 0) {
|
|
9620
|
+
return;
|
|
9621
|
+
}
|
|
9622
|
+
let index = this.activeIndex();
|
|
9623
|
+
index =
|
|
9624
|
+
index < 0
|
|
9625
|
+
? direction === 1
|
|
9626
|
+
? 0
|
|
9627
|
+
: list.length - 1
|
|
9628
|
+
: (index + direction + list.length) % list.length;
|
|
9629
|
+
this.activeIndex.set(index);
|
|
9630
|
+
}
|
|
9631
|
+
selectActive() {
|
|
9632
|
+
const list = this.filtered();
|
|
9633
|
+
const index = this.activeIndex();
|
|
9634
|
+
if (index >= 0 && index < list.length) {
|
|
9635
|
+
this.countrySelected.emit(list[index]);
|
|
9636
|
+
}
|
|
9637
|
+
}
|
|
9638
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisPhoneCountryListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9639
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SolarisPhoneCountryListComponent, isStandalone: true, selector: "solaris-phone-country-list", inputs: { countries: { classPropertyName: "countries", publicName: "countries", isSignal: true, isRequired: false, transformFunction: null }, selectedCode: { classPropertyName: "selectedCode", publicName: "selectedCode", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, noResultsText: { classPropertyName: "noResultsText", publicName: "noResultsText", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { countrySelected: "countrySelected", closeRequest: "closeRequest" }, ngImport: i0, template: "<div class=\"solaris-phone-country-list\">\n @if (searchable()) {\n <div class=\"solaris-phone-country-list__search\">\n <solaris-icon\n name=\"search\"\n [decorative]=\"true\"\n class=\"solaris-phone-country-list__search-icon\"\n />\n <input\n type=\"text\"\n class=\"solaris-phone-country-list__search-input\"\n role=\"searchbox\"\n autocomplete=\"off\"\n [attr.placeholder]=\"searchPlaceholder()\"\n [value]=\"searchQuery()\"\n (input)=\"onSearch($event)\"\n (keydown)=\"onSearchKeydown($event)\"\n />\n </div>\n }\n\n @if (showEmpty()) {\n <div class=\"solaris-phone-country-list__empty\">\n <span class=\"solaris-phone-country-list__empty-text\">{{\n emptyText()\n }}</span>\n </div>\n } @else if (showNoResults()) {\n <div class=\"solaris-phone-country-list__no-results\">\n <span class=\"solaris-phone-country-list__no-results-text\">{{\n noResultsText()\n }}</span>\n </div>\n } @else {\n <div\n class=\"solaris-phone-country-list__list\"\n role=\"listbox\"\n [attr.id]=\"listId\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n tabindex=\"-1\"\n [style.max-height]=\"maxHeight()\"\n (click)=\"onListClick($event)\"\n (keydown)=\"onListKeydown($event)\"\n >\n @for (country of filtered(); track country.code; let index = $index) {\n <div\n class=\"solaris-phone-country-list__option\"\n role=\"option\"\n [attr.id]=\"optionId(index)\"\n [attr.data-active]=\"activeIndex() === index ? '' : null\"\n [attr.data-selected]=\"selectedCode() === country.code ? '' : null\"\n [attr.aria-selected]=\"selectedCode() === country.code\"\n >\n <span\n class=\"solaris-phone-country-list__flag\"\n [innerHTML]=\"country.flag | solarisSafeHtml\"\n ></span>\n <span class=\"solaris-phone-country-list__name\">{{\n country.name\n }}</span>\n <span class=\"solaris-phone-country-list__code\"\n >+{{ country.callingCode }}</span\n >\n </div>\n }\n </div>\n }\n</div>\n", styles: [":host{--solaris-phone-country-option-radius: var(--solaris-radius-sm);--solaris-phone-country-search-bg: var(--solaris-surface-subtle);--solaris-phone-country-option-hover-bg: var(--solaris-surface-muted);--solaris-phone-country-option-active-bg: var(--solaris-primary-surface);--solaris-phone-country-option-active-color: var(--solaris-primary-text);width:260px;display:block;max-width:100%;box-sizing:border-box}.solaris-phone-country-list{display:flex;box-sizing:border-box;flex-direction:column;gap:var(--solaris-spacing-2)}.solaris-phone-country-list__search{display:flex;align-items:center;box-sizing:border-box;gap:var(--solaris-spacing-2);padding:0 var(--solaris-spacing-3);border-radius:var(--solaris-phone-country-option-radius);background:var(--solaris-phone-country-search-bg)}.solaris-phone-country-list__search-icon{flex-shrink:0;color:var(--solaris-text-muted)}.solaris-phone-country-list__search-input{all:unset;box-sizing:border-box;flex:1;min-width:0;padding:var(--solaris-spacing-2) 0;color:var(--solaris-text-default);font-size:var(--solaris-font-size-sm);line-height:var(--solaris-line-height-md)}.solaris-phone-country-list__search-input::placeholder{color:var(--solaris-text-muted)}.solaris-phone-country-list__search-input:focus-visible{outline:none}.solaris-phone-country-list__list{display:flex;overflow-y:auto;max-height:320px;scrollbar-width:thin;box-sizing:border-box;flex-direction:column;gap:var(--solaris-spacing-1);scrollbar-color:var(--solaris-border-soft) transparent}.solaris-phone-country-list__list::-webkit-scrollbar{width:6px}.solaris-phone-country-list__list::-webkit-scrollbar-track{background:transparent}.solaris-phone-country-list__list::-webkit-scrollbar-thumb{background:var(--solaris-border-soft);border-radius:var(--solaris-radius-full)}.solaris-phone-country-list__list::-webkit-scrollbar-thumb:hover{background:var(--solaris-border-strong)}.solaris-phone-country-list__option{display:flex;cursor:pointer;align-items:center;box-sizing:border-box;gap:var(--solaris-spacing-3);font-size:var(--solaris-font-size-sm);line-height:var(--solaris-line-height-md);border-radius:var(--solaris-phone-country-option-radius);padding:var(--solaris-spacing-2) var(--solaris-spacing-3)}.solaris-phone-country-list__option:hover{background:var(--solaris-phone-country-option-hover-bg)}.solaris-phone-country-list__option[data-active]{background:var(--solaris-phone-country-option-active-bg);color:var(--solaris-phone-country-option-active-color)}.solaris-phone-country-list__flag{flex-shrink:0;line-height:1;align-items:center;display:inline-flex;justify-content:center;width:var(--solaris-font-size-xl);font-size:var(--solaris-font-size-lg)}.solaris-phone-country-list__flag svg{display:block;width:100%;height:auto}.solaris-phone-country-list__name{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.solaris-phone-country-list__code{flex-shrink:0;color:var(--solaris-text-muted)}.solaris-phone-country-list__empty,.solaris-phone-country-list__no-results{padding:var(--solaris-spacing-3);color:var(--solaris-text-muted);font-size:var(--solaris-font-size-sm);line-height:var(--solaris-line-height-md)}@media(prefers-reduced-motion:reduce){.solaris-phone-country-list__option{transition:none}}\n"], dependencies: [{ kind: "component", type: SolarisIconComponent, selector: "solaris-icon", inputs: ["name", "ariaLabel", "decorative", "inheritColor"] }, { kind: "pipe", type: SolarisSafeHtmlPipe, name: "solarisSafeHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9640
|
+
}
|
|
9641
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisPhoneCountryListComponent, decorators: [{
|
|
9642
|
+
type: Component,
|
|
9643
|
+
args: [{ selector: 'solaris-phone-country-list', standalone: true, imports: [SolarisIconComponent, SolarisSafeHtmlPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"solaris-phone-country-list\">\n @if (searchable()) {\n <div class=\"solaris-phone-country-list__search\">\n <solaris-icon\n name=\"search\"\n [decorative]=\"true\"\n class=\"solaris-phone-country-list__search-icon\"\n />\n <input\n type=\"text\"\n class=\"solaris-phone-country-list__search-input\"\n role=\"searchbox\"\n autocomplete=\"off\"\n [attr.placeholder]=\"searchPlaceholder()\"\n [value]=\"searchQuery()\"\n (input)=\"onSearch($event)\"\n (keydown)=\"onSearchKeydown($event)\"\n />\n </div>\n }\n\n @if (showEmpty()) {\n <div class=\"solaris-phone-country-list__empty\">\n <span class=\"solaris-phone-country-list__empty-text\">{{\n emptyText()\n }}</span>\n </div>\n } @else if (showNoResults()) {\n <div class=\"solaris-phone-country-list__no-results\">\n <span class=\"solaris-phone-country-list__no-results-text\">{{\n noResultsText()\n }}</span>\n </div>\n } @else {\n <div\n class=\"solaris-phone-country-list__list\"\n role=\"listbox\"\n [attr.id]=\"listId\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n tabindex=\"-1\"\n [style.max-height]=\"maxHeight()\"\n (click)=\"onListClick($event)\"\n (keydown)=\"onListKeydown($event)\"\n >\n @for (country of filtered(); track country.code; let index = $index) {\n <div\n class=\"solaris-phone-country-list__option\"\n role=\"option\"\n [attr.id]=\"optionId(index)\"\n [attr.data-active]=\"activeIndex() === index ? '' : null\"\n [attr.data-selected]=\"selectedCode() === country.code ? '' : null\"\n [attr.aria-selected]=\"selectedCode() === country.code\"\n >\n <span\n class=\"solaris-phone-country-list__flag\"\n [innerHTML]=\"country.flag | solarisSafeHtml\"\n ></span>\n <span class=\"solaris-phone-country-list__name\">{{\n country.name\n }}</span>\n <span class=\"solaris-phone-country-list__code\"\n >+{{ country.callingCode }}</span\n >\n </div>\n }\n </div>\n }\n</div>\n", styles: [":host{--solaris-phone-country-option-radius: var(--solaris-radius-sm);--solaris-phone-country-search-bg: var(--solaris-surface-subtle);--solaris-phone-country-option-hover-bg: var(--solaris-surface-muted);--solaris-phone-country-option-active-bg: var(--solaris-primary-surface);--solaris-phone-country-option-active-color: var(--solaris-primary-text);width:260px;display:block;max-width:100%;box-sizing:border-box}.solaris-phone-country-list{display:flex;box-sizing:border-box;flex-direction:column;gap:var(--solaris-spacing-2)}.solaris-phone-country-list__search{display:flex;align-items:center;box-sizing:border-box;gap:var(--solaris-spacing-2);padding:0 var(--solaris-spacing-3);border-radius:var(--solaris-phone-country-option-radius);background:var(--solaris-phone-country-search-bg)}.solaris-phone-country-list__search-icon{flex-shrink:0;color:var(--solaris-text-muted)}.solaris-phone-country-list__search-input{all:unset;box-sizing:border-box;flex:1;min-width:0;padding:var(--solaris-spacing-2) 0;color:var(--solaris-text-default);font-size:var(--solaris-font-size-sm);line-height:var(--solaris-line-height-md)}.solaris-phone-country-list__search-input::placeholder{color:var(--solaris-text-muted)}.solaris-phone-country-list__search-input:focus-visible{outline:none}.solaris-phone-country-list__list{display:flex;overflow-y:auto;max-height:320px;scrollbar-width:thin;box-sizing:border-box;flex-direction:column;gap:var(--solaris-spacing-1);scrollbar-color:var(--solaris-border-soft) transparent}.solaris-phone-country-list__list::-webkit-scrollbar{width:6px}.solaris-phone-country-list__list::-webkit-scrollbar-track{background:transparent}.solaris-phone-country-list__list::-webkit-scrollbar-thumb{background:var(--solaris-border-soft);border-radius:var(--solaris-radius-full)}.solaris-phone-country-list__list::-webkit-scrollbar-thumb:hover{background:var(--solaris-border-strong)}.solaris-phone-country-list__option{display:flex;cursor:pointer;align-items:center;box-sizing:border-box;gap:var(--solaris-spacing-3);font-size:var(--solaris-font-size-sm);line-height:var(--solaris-line-height-md);border-radius:var(--solaris-phone-country-option-radius);padding:var(--solaris-spacing-2) var(--solaris-spacing-3)}.solaris-phone-country-list__option:hover{background:var(--solaris-phone-country-option-hover-bg)}.solaris-phone-country-list__option[data-active]{background:var(--solaris-phone-country-option-active-bg);color:var(--solaris-phone-country-option-active-color)}.solaris-phone-country-list__flag{flex-shrink:0;line-height:1;align-items:center;display:inline-flex;justify-content:center;width:var(--solaris-font-size-xl);font-size:var(--solaris-font-size-lg)}.solaris-phone-country-list__flag svg{display:block;width:100%;height:auto}.solaris-phone-country-list__name{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.solaris-phone-country-list__code{flex-shrink:0;color:var(--solaris-text-muted)}.solaris-phone-country-list__empty,.solaris-phone-country-list__no-results{padding:var(--solaris-spacing-3);color:var(--solaris-text-muted);font-size:var(--solaris-font-size-sm);line-height:var(--solaris-line-height-md)}@media(prefers-reduced-motion:reduce){.solaris-phone-country-list__option{transition:none}}\n"] }]
|
|
9644
|
+
}], propDecorators: { countries: [{ type: i0.Input, args: [{ isSignal: true, alias: "countries", required: false }] }], selectedCode: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedCode", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], noResultsText: [{ type: i0.Input, args: [{ isSignal: true, alias: "noResultsText", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], countrySelected: [{ type: i0.Output, args: ["countrySelected"] }], closeRequest: [{ type: i0.Output, args: ["closeRequest"] }] } });
|
|
9645
|
+
|
|
9646
|
+
// SECURITY_EXCEPTION_FILE: flag SVG strings are returned from the pinned, trusted `country-flag-icons`
|
|
9647
|
+
// dependency (static data, never user input). They are rendered safely through a sanitizing pipe
|
|
9648
|
+
// (SolarisSafeHtmlPipe) and this module never interpolates user-controlled values into SVG markup.
|
|
9649
|
+
const FLAG_INDEX = FLAG_3X2;
|
|
9650
|
+
function flagEmojiFallback(code) {
|
|
9651
|
+
return code
|
|
9652
|
+
.toUpperCase()
|
|
9653
|
+
.replace(/./g, (char) => String.fromCodePoint(0x1f1e6 + (char.charCodeAt(0) - 65)));
|
|
9654
|
+
}
|
|
9655
|
+
function getCountryFlag(code) {
|
|
9656
|
+
if (hasFlag(code)) {
|
|
9657
|
+
return FLAG_INDEX[code] ?? flagEmojiFallback(code);
|
|
9658
|
+
}
|
|
9659
|
+
return flagEmojiFallback(code);
|
|
9660
|
+
}
|
|
9661
|
+
function buildCountries(locale = 'en-US') {
|
|
9662
|
+
const displayNames = new Intl.DisplayNames([locale], { type: 'region' });
|
|
9663
|
+
return getCountries()
|
|
9664
|
+
.map((code) => {
|
|
9665
|
+
const cc = code;
|
|
9666
|
+
const name = displayNames.of(code) ?? code;
|
|
9667
|
+
return {
|
|
9668
|
+
code,
|
|
9669
|
+
callingCode: String(getCountryCallingCode(cc)),
|
|
9670
|
+
name,
|
|
9671
|
+
flag: getCountryFlag(code),
|
|
9672
|
+
};
|
|
9673
|
+
})
|
|
9674
|
+
.sort((a, b) => a.name.localeCompare(b.name, locale));
|
|
9675
|
+
}
|
|
9676
|
+
|
|
9677
|
+
const SOLARIS_PHONE_COUNTRY_LIST = new InjectionToken('SOLARIS_PHONE_COUNTRY_LIST', {
|
|
9678
|
+
factory: () => buildCountries,
|
|
9679
|
+
});
|
|
9680
|
+
|
|
9681
|
+
function getMaxNationalNumberLength(country) {
|
|
9682
|
+
const metadata = new Metadata();
|
|
9683
|
+
metadata.selectNumberingPlan(country);
|
|
9684
|
+
const lengths = metadata.numberingPlan?.possibleLengths() ?? [];
|
|
9685
|
+
return lengths.length > 0 ? Math.max(...lengths) : 0;
|
|
9686
|
+
}
|
|
9687
|
+
function formatAsYouType(value, country) {
|
|
9688
|
+
return new AsYouType(country).input(value);
|
|
9689
|
+
}
|
|
9690
|
+
function toE164(value, country) {
|
|
9691
|
+
const parsed = parsePhoneNumberFromString(value, country);
|
|
9692
|
+
return parsed?.number ?? '';
|
|
9693
|
+
}
|
|
9694
|
+
function toValidE164(value, country) {
|
|
9695
|
+
const parsed = parsePhoneNumberFromString(value, country);
|
|
9696
|
+
return parsed && parsed.isValid() ? parsed.number : '';
|
|
9697
|
+
}
|
|
9698
|
+
function detectCountry(value) {
|
|
9699
|
+
const parsed = parsePhoneNumberFromString(value);
|
|
9700
|
+
return parsed?.country;
|
|
9701
|
+
}
|
|
9702
|
+
function formatE164(value) {
|
|
9703
|
+
const parsed = parsePhoneNumberFromString(value);
|
|
9704
|
+
return parsed ? parsed.formatNational() : value;
|
|
9705
|
+
}
|
|
9706
|
+
function getExampleNumberFor(country) {
|
|
9707
|
+
const number = getExampleNumber(country, examples);
|
|
9708
|
+
return number ? number.formatNational() : '';
|
|
9709
|
+
}
|
|
9710
|
+
|
|
9711
|
+
// SECURITY_EXCEPTION_FILE: nativeElement.value assignment is required to keep the native input in
|
|
9712
|
+
// sync with the as-you-type formatted value. Angular's data binding may not reflect synchronous
|
|
9713
|
+
// value changes to the native input. Same approach is standard for CVA blur/format normalization.
|
|
9714
|
+
// SECURITY_EXCEPTION_FILE: nativeElement.value read in onInput to obtain the current raw value.
|
|
9715
|
+
class SolarisPhoneFieldComponent {
|
|
9716
|
+
translateService = inject(SolarisTranslateService);
|
|
9717
|
+
countryListFactory = inject(SOLARIS_PHONE_COUNTRY_LIST);
|
|
9718
|
+
inputElementRef = viewChild('inputElement', ...(ngDevMode ? [{ debugName: "inputElementRef" }] : /* istanbul ignore next */ []));
|
|
9719
|
+
popoverTrigger = viewChild(SolarisPopoverTriggerDirective, ...(ngDevMode ? [{ debugName: "popoverTrigger" }] : /* istanbul ignore next */ []));
|
|
9720
|
+
projectedPrefix = contentChild(SolarisFormPrefixDirective, ...(ngDevMode ? [{ debugName: "projectedPrefix" }] : /* istanbul ignore next */ []));
|
|
9721
|
+
projectedSuffix = contentChild(SolarisFormSuffixDirective, ...(ngDevMode ? [{ debugName: "projectedSuffix" }] : /* istanbul ignore next */ []));
|
|
9722
|
+
id = input(...(ngDevMode ? [undefined, { debugName: "id" }] : /* istanbul ignore next */ []));
|
|
9723
|
+
name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
|
|
9724
|
+
hintKey = input(...(ngDevMode ? [undefined, { debugName: "hintKey" }] : /* istanbul ignore next */ []));
|
|
9725
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
9726
|
+
labelKey = input(...(ngDevMode ? [undefined, { debugName: "labelKey" }] : /* istanbul ignore next */ []));
|
|
9727
|
+
errorKey = input(...(ngDevMode ? [undefined, { debugName: "errorKey" }] : /* istanbul ignore next */ []));
|
|
9728
|
+
value = input('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
9729
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
9730
|
+
error = input('', ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
9731
|
+
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
9732
|
+
invalidError = input(...(ngDevMode ? [undefined, { debugName: "invalidError" }] : /* istanbul ignore next */ []));
|
|
9733
|
+
requiredError = input(...(ngDevMode ? [undefined, { debugName: "requiredError" }] : /* istanbul ignore next */ []));
|
|
9734
|
+
placeholderKey = input(...(ngDevMode ? [undefined, { debugName: "placeholderKey" }] : /* istanbul ignore next */ []));
|
|
9735
|
+
invalidErrorKey = input(...(ngDevMode ? [undefined, { debugName: "invalidErrorKey" }] : /* istanbul ignore next */ []));
|
|
9736
|
+
requiredErrorKey = input(...(ngDevMode ? [undefined, { debugName: "requiredErrorKey" }] : /* istanbul ignore next */ []));
|
|
9737
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
9738
|
+
optional = input(false, ...(ngDevMode ? [{ debugName: "optional" }] : /* istanbul ignore next */ []));
|
|
9739
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
9740
|
+
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
9741
|
+
autocomplete = input('tel', ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
9742
|
+
invalid = input(...(ngDevMode ? [undefined, { debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
9743
|
+
density = input(...(ngDevMode ? [undefined, { debugName: "density" }] : /* istanbul ignore next */ []));
|
|
9744
|
+
radius = input('md', ...(ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []));
|
|
9745
|
+
appearance = input('outline', ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
9746
|
+
maxLength = input(...(ngDevMode ? [undefined, { debugName: "maxLength" }] : /* istanbul ignore next */ []));
|
|
9747
|
+
suffix = input(...(ngDevMode ? [undefined, { debugName: "suffix" }] : /* istanbul ignore next */ []));
|
|
9748
|
+
defaultCountry = input(...(ngDevMode ? [undefined, { debugName: "defaultCountry" }] : /* istanbul ignore next */ []));
|
|
9749
|
+
country = input(...(ngDevMode ? [undefined, { debugName: "country" }] : /* istanbul ignore next */ []));
|
|
9750
|
+
searchable = input(true, ...(ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []));
|
|
9751
|
+
allowAnyCountry = input(true, ...(ngDevMode ? [{ debugName: "allowAnyCountry" }] : /* istanbul ignore next */ []));
|
|
9752
|
+
countryList = input(...(ngDevMode ? [undefined, { debugName: "countryList" }] : /* istanbul ignore next */ []));
|
|
9753
|
+
emptyText = input(...(ngDevMode ? [undefined, { debugName: "emptyText" }] : /* istanbul ignore next */ []));
|
|
9754
|
+
emptyTextKey = input(...(ngDevMode ? [undefined, { debugName: "emptyTextKey" }] : /* istanbul ignore next */ []));
|
|
9755
|
+
noResultsText = input(...(ngDevMode ? [undefined, { debugName: "noResultsText" }] : /* istanbul ignore next */ []));
|
|
9756
|
+
noResultsTextKey = input(...(ngDevMode ? [undefined, { debugName: "noResultsTextKey" }] : /* istanbul ignore next */ []));
|
|
9757
|
+
searchPlaceholder = input(...(ngDevMode ? [undefined, { debugName: "searchPlaceholder" }] : /* istanbul ignore next */ []));
|
|
9758
|
+
searchPlaceholderKey = input(...(ngDevMode ? [undefined, { debugName: "searchPlaceholderKey" }] : /* istanbul ignore next */ []));
|
|
9759
|
+
countryButtonLabel = input(...(ngDevMode ? [undefined, { debugName: "countryButtonLabel" }] : /* istanbul ignore next */ []));
|
|
9760
|
+
countryButtonLabelKey = input(...(ngDevMode ? [undefined, { debugName: "countryButtonLabelKey" }] : /* istanbul ignore next */ []));
|
|
9761
|
+
panelMaxWidth = input(...(ngDevMode ? [undefined, { debugName: "panelMaxWidth" }] : /* istanbul ignore next */ []));
|
|
9762
|
+
panelMaxHeight = input(...(ngDevMode ? [undefined, { debugName: "panelMaxHeight" }] : /* istanbul ignore next */ []));
|
|
9763
|
+
valueChange = output();
|
|
9764
|
+
countryChange = output();
|
|
9765
|
+
internalValue = signal('', ...(ngDevMode ? [{ debugName: "internalValue" }] : /* istanbul ignore next */ []));
|
|
9766
|
+
displayValue = signal('', ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
|
|
9767
|
+
internalDisabled = signal(false, ...(ngDevMode ? [{ debugName: "internalDisabled" }] : /* istanbul ignore next */ []));
|
|
9768
|
+
internalFocused = signal(false, ...(ngDevMode ? [{ debugName: "internalFocused" }] : /* istanbul ignore next */ []));
|
|
9769
|
+
touched = signal(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
9770
|
+
dirty = signal(false, ...(ngDevMode ? [{ debugName: "dirty" }] : /* istanbul ignore next */ []));
|
|
9771
|
+
selectedCountry = signal(undefined, ...(ngDevMode ? [{ debugName: "selectedCountry" }] : /* istanbul ignore next */ []));
|
|
9772
|
+
panelOpen = signal(false, ...(ngDevMode ? [{ debugName: "panelOpen" }] : /* istanbul ignore next */ []));
|
|
9773
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
9774
|
+
onChange = () => { };
|
|
9775
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
9776
|
+
onTouched = () => { };
|
|
9777
|
+
popoverSubscriptions = [];
|
|
9778
|
+
allCountries = computed(() => {
|
|
9779
|
+
return this.countryListFactory(this.translateService.locale);
|
|
9780
|
+
}, ...(ngDevMode ? [{ debugName: "allCountries" }] : /* istanbul ignore next */ []));
|
|
9781
|
+
countries = computed(() => {
|
|
9782
|
+
const list = this.allCountries();
|
|
9783
|
+
const restrict = this.countryList();
|
|
9784
|
+
if (restrict && restrict.length > 0) {
|
|
9785
|
+
return list.filter((country) => restrict.includes(country.code));
|
|
9786
|
+
}
|
|
9787
|
+
return list;
|
|
9788
|
+
}, ...(ngDevMode ? [{ debugName: "countries" }] : /* istanbul ignore next */ []));
|
|
9789
|
+
effectiveCountry = computed(() => {
|
|
9790
|
+
const explicit = this.country();
|
|
9791
|
+
if (explicit)
|
|
9792
|
+
return explicit;
|
|
9793
|
+
const selected = this.selectedCountry();
|
|
9794
|
+
if (selected)
|
|
9795
|
+
return selected;
|
|
9796
|
+
const fromValue = this.internalValue()
|
|
9797
|
+
? detectCountry(this.internalValue())
|
|
9798
|
+
: undefined;
|
|
9799
|
+
if (fromValue && this.countryAllowed(fromValue))
|
|
9800
|
+
return fromValue;
|
|
9801
|
+
const def = this.defaultCountry();
|
|
9802
|
+
if (def)
|
|
9803
|
+
return def;
|
|
9804
|
+
const first = this.countries()[0];
|
|
9805
|
+
return first?.code ?? 'US';
|
|
9806
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveCountry" }] : /* istanbul ignore next */ []));
|
|
9807
|
+
selectedCountryObject = computed(() => {
|
|
9808
|
+
const code = this.effectiveCountry();
|
|
9809
|
+
return (this.countries().find((country) => country.code === code) ??
|
|
9810
|
+
this.countries()[0]);
|
|
9811
|
+
}, ...(ngDevMode ? [{ debugName: "selectedCountryObject" }] : /* istanbul ignore next */ []));
|
|
9812
|
+
selectedFlag = computed(() => this.selectedCountryObject()?.flag ?? '', ...(ngDevMode ? [{ debugName: "selectedFlag" }] : /* istanbul ignore next */ []));
|
|
9813
|
+
selectedCallingCode = computed(() => this.selectedCountryObject()?.callingCode ?? '', ...(ngDevMode ? [{ debugName: "selectedCallingCode" }] : /* istanbul ignore next */ []));
|
|
9814
|
+
hasPrefix = computed(() => true, ...(ngDevMode ? [{ debugName: "hasPrefix" }] : /* istanbul ignore next */ []));
|
|
9815
|
+
hasSuffix = computed(() => {
|
|
9816
|
+
return !!this.projectedSuffix() || !!this.suffix();
|
|
9817
|
+
}, ...(ngDevMode ? [{ debugName: "hasSuffix" }] : /* istanbul ignore next */ []));
|
|
9818
|
+
isEffectivelyDisabled = computed(() => {
|
|
9819
|
+
return this.disabled() || this.internalDisabled();
|
|
9820
|
+
}, ...(ngDevMode ? [{ debugName: "isEffectivelyDisabled" }] : /* istanbul ignore next */ []));
|
|
9821
|
+
isEffectivelyReadonly = computed(() => {
|
|
9822
|
+
return this.readonly();
|
|
9823
|
+
}, ...(ngDevMode ? [{ debugName: "isEffectivelyReadonly" }] : /* istanbul ignore next */ []));
|
|
9824
|
+
canOpen = computed(() => {
|
|
9825
|
+
return (this.allowAnyCountry() &&
|
|
9826
|
+
!this.isEffectivelyDisabled() &&
|
|
9827
|
+
!this.isEffectivelyReadonly());
|
|
9828
|
+
}, ...(ngDevMode ? [{ debugName: "canOpen" }] : /* istanbul ignore next */ []));
|
|
9829
|
+
popoverAppearance = computed(() => {
|
|
9830
|
+
const appearance = this.appearance();
|
|
9831
|
+
if (appearance === 'outline')
|
|
9832
|
+
return 'outline';
|
|
9833
|
+
if (appearance === 'filled')
|
|
9834
|
+
return 'filled';
|
|
9835
|
+
return 'surface';
|
|
9836
|
+
}, ...(ngDevMode ? [{ debugName: "popoverAppearance" }] : /* istanbul ignore next */ []));
|
|
9837
|
+
effectiveMaxLength = computed(() => {
|
|
9838
|
+
const explicit = this.maxLength();
|
|
9839
|
+
if (explicit !== undefined) {
|
|
9840
|
+
return explicit;
|
|
9841
|
+
}
|
|
9842
|
+
return getMaxNationalNumberLength(this.effectiveCountry());
|
|
9843
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveMaxLength" }] : /* istanbul ignore next */ []));
|
|
9844
|
+
placeholderText = computed(() => {
|
|
9845
|
+
const key = this.placeholderKey();
|
|
9846
|
+
if (key) {
|
|
9847
|
+
return this.translateService.translate(key);
|
|
9848
|
+
}
|
|
9849
|
+
if (this.placeholder() != null) {
|
|
9850
|
+
return this.placeholder();
|
|
9851
|
+
}
|
|
9852
|
+
return getExampleNumberFor(this.effectiveCountry());
|
|
9853
|
+
}, ...(ngDevMode ? [{ debugName: "placeholderText" }] : /* istanbul ignore next */ []));
|
|
9854
|
+
searchPlaceholderText = computed(() => {
|
|
9855
|
+
const key = this.searchPlaceholderKey();
|
|
9856
|
+
if (key) {
|
|
9857
|
+
return this.translateService.translate(key);
|
|
9858
|
+
}
|
|
9859
|
+
if (this.searchPlaceholder()) {
|
|
9860
|
+
return this.searchPlaceholder();
|
|
9861
|
+
}
|
|
9862
|
+
return this.translateWithDefault('solaris.phone-field.search.placeholder', 'Search country or code');
|
|
9863
|
+
}, ...(ngDevMode ? [{ debugName: "searchPlaceholderText" }] : /* istanbul ignore next */ []));
|
|
9864
|
+
emptyTextValue = computed(() => {
|
|
9865
|
+
const key = this.emptyTextKey();
|
|
9866
|
+
if (key) {
|
|
9867
|
+
return this.translateService.translate(key);
|
|
9868
|
+
}
|
|
9869
|
+
if (this.emptyText()) {
|
|
9870
|
+
return this.emptyText();
|
|
9871
|
+
}
|
|
9872
|
+
return this.translateWithDefault('solaris.phone-field.empty', 'No countries available');
|
|
9873
|
+
}, ...(ngDevMode ? [{ debugName: "emptyTextValue" }] : /* istanbul ignore next */ []));
|
|
9874
|
+
noResultsTextValue = computed(() => {
|
|
9875
|
+
const key = this.noResultsTextKey();
|
|
9876
|
+
if (key) {
|
|
9877
|
+
return this.translateService.translate(key);
|
|
9878
|
+
}
|
|
9879
|
+
if (this.noResultsText()) {
|
|
9880
|
+
return this.noResultsText();
|
|
9881
|
+
}
|
|
9882
|
+
return this.translateWithDefault('solaris.phone-field.noResults', 'No results found');
|
|
9883
|
+
}, ...(ngDevMode ? [{ debugName: "noResultsTextValue" }] : /* istanbul ignore next */ []));
|
|
9884
|
+
countryButtonLabelText = computed(() => {
|
|
9885
|
+
const key = this.countryButtonLabelKey();
|
|
9886
|
+
if (key) {
|
|
9887
|
+
return this.translateService.translate(key);
|
|
9888
|
+
}
|
|
9889
|
+
if (this.countryButtonLabel()) {
|
|
9890
|
+
return this.countryButtonLabel();
|
|
9891
|
+
}
|
|
9892
|
+
return this.translateWithDefault('solaris.phone-field.country', 'Select country code');
|
|
9893
|
+
}, ...(ngDevMode ? [{ debugName: "countryButtonLabelText" }] : /* istanbul ignore next */ []));
|
|
9894
|
+
computedError = computed(() => {
|
|
9895
|
+
const manualError = this.error() || this.translateKey(this.errorKey());
|
|
9896
|
+
if (manualError)
|
|
9897
|
+
return manualError;
|
|
9898
|
+
const isTouchedOrDirty = this.touched() || this.dirty();
|
|
9899
|
+
if (!isTouchedOrDirty || this.internalFocused())
|
|
9900
|
+
return '';
|
|
9901
|
+
if (!this.displayValue() || this.displayValue().trim().length === 0) {
|
|
9902
|
+
if (this.required()) {
|
|
9903
|
+
return this.buildError(this.requiredError(), this.requiredErrorKey(), 'solaris.phone-field.required', 'Phone number is required.');
|
|
9904
|
+
}
|
|
9905
|
+
return '';
|
|
9906
|
+
}
|
|
9907
|
+
if (!this.internalValue()) {
|
|
9908
|
+
return this.buildError(this.invalidError(), this.invalidErrorKey(), 'solaris.phone-field.invalid', 'Enter a valid phone number.');
|
|
9909
|
+
}
|
|
9910
|
+
return '';
|
|
9911
|
+
}, ...(ngDevMode ? [{ debugName: "computedError" }] : /* istanbul ignore next */ []));
|
|
9912
|
+
isFieldInvalid = computed(() => {
|
|
9913
|
+
const manual = this.invalid();
|
|
9914
|
+
if (manual !== undefined) {
|
|
9915
|
+
return manual;
|
|
9916
|
+
}
|
|
9917
|
+
if (this.internalFocused()) {
|
|
9918
|
+
return false;
|
|
9919
|
+
}
|
|
9920
|
+
const isTouchedOrDirty = this.touched() || this.dirty();
|
|
9921
|
+
if (!isTouchedOrDirty) {
|
|
9922
|
+
return false;
|
|
9923
|
+
}
|
|
9924
|
+
return !!this.computedError();
|
|
9925
|
+
}, ...(ngDevMode ? [{ debugName: "isFieldInvalid" }] : /* istanbul ignore next */ []));
|
|
9926
|
+
constructor() {
|
|
9927
|
+
effect(() => {
|
|
9928
|
+
const value = this.value();
|
|
9929
|
+
if (value !== this.lastAppliedValue) {
|
|
9930
|
+
this.lastAppliedValue = value;
|
|
9931
|
+
this.internalValue.set(value);
|
|
9932
|
+
this.applyDisplayFromValue(value);
|
|
9933
|
+
}
|
|
9934
|
+
});
|
|
9935
|
+
}
|
|
9936
|
+
lastAppliedValue = '';
|
|
9937
|
+
ngAfterViewInit() {
|
|
9938
|
+
const trigger = this.popoverTrigger();
|
|
9939
|
+
if (trigger) {
|
|
9940
|
+
const openedSub = trigger.solarisPopoverOpened.subscribe(() => {
|
|
9941
|
+
this.panelOpen.set(true);
|
|
9942
|
+
});
|
|
9943
|
+
const closedSub = trigger.solarisPopoverClosed.subscribe(() => {
|
|
9944
|
+
this.panelOpen.set(false);
|
|
9945
|
+
this.markAsTouched();
|
|
9946
|
+
});
|
|
9947
|
+
this.popoverSubscriptions.push(() => openedSub.unsubscribe(), () => closedSub.unsubscribe());
|
|
9948
|
+
}
|
|
9949
|
+
}
|
|
9950
|
+
ngOnDestroy() {
|
|
9951
|
+
this.popoverSubscriptions.forEach((fn) => fn());
|
|
9952
|
+
}
|
|
9953
|
+
writeValue(value) {
|
|
9954
|
+
const safe = value ?? '';
|
|
9955
|
+
this.internalValue.set(safe);
|
|
9956
|
+
this.applyDisplayFromValue(safe);
|
|
9957
|
+
}
|
|
9958
|
+
registerOnChange(fn) {
|
|
9959
|
+
this.onChange = fn;
|
|
9960
|
+
}
|
|
9961
|
+
registerOnTouched(fn) {
|
|
9962
|
+
this.onTouched = fn;
|
|
9963
|
+
}
|
|
9964
|
+
setDisabledState(isDisabled) {
|
|
9965
|
+
this.internalDisabled.set(isDisabled);
|
|
9966
|
+
}
|
|
9967
|
+
onInput(event) {
|
|
9968
|
+
const target = event.target;
|
|
9969
|
+
const raw = target.value;
|
|
9970
|
+
if (!this.dirty()) {
|
|
9971
|
+
this.dirty.set(true);
|
|
9972
|
+
}
|
|
9973
|
+
const startsWithPlus = raw.trim().startsWith('+');
|
|
9974
|
+
let country = this.effectiveCountry();
|
|
9975
|
+
let digits = raw.replace(/\D+/g, '');
|
|
9976
|
+
if (startsWithPlus) {
|
|
9977
|
+
const detected = detectCountry(raw);
|
|
9978
|
+
if (detected && !this.country() && this.countryAllowed(detected)) {
|
|
9979
|
+
this.selectedCountry.set(detected);
|
|
9980
|
+
this.countryChange.emit(detected);
|
|
9981
|
+
country = detected;
|
|
9982
|
+
}
|
|
9983
|
+
const callingCode = this.selectedCallingCode();
|
|
9984
|
+
if (callingCode && digits.startsWith(callingCode)) {
|
|
9985
|
+
digits = digits.slice(callingCode.length);
|
|
9986
|
+
}
|
|
9987
|
+
}
|
|
9988
|
+
digits = digits.slice(0, this.effectiveMaxLength());
|
|
9989
|
+
const formatted = formatAsYouType(digits, country);
|
|
9990
|
+
this.displayValue.set(formatted);
|
|
9991
|
+
if (target.value !== formatted) {
|
|
9992
|
+
target.value = formatted;
|
|
9993
|
+
}
|
|
9994
|
+
const e164 = toValidE164(formatted, country);
|
|
9995
|
+
if (e164) {
|
|
9996
|
+
this.internalValue.set(e164);
|
|
9997
|
+
this.onChange(e164);
|
|
9998
|
+
this.valueChange.emit(e164);
|
|
9999
|
+
}
|
|
10000
|
+
else {
|
|
10001
|
+
this.internalValue.set('');
|
|
10002
|
+
this.onChange('');
|
|
10003
|
+
this.valueChange.emit('');
|
|
10004
|
+
}
|
|
10005
|
+
}
|
|
10006
|
+
onInputFocus() {
|
|
10007
|
+
this.internalFocused.set(true);
|
|
10008
|
+
}
|
|
10009
|
+
onInputBlur() {
|
|
10010
|
+
this.internalFocused.set(false);
|
|
10011
|
+
this.markAsTouched();
|
|
10012
|
+
}
|
|
10013
|
+
onCountryToggle(event) {
|
|
10014
|
+
event.stopPropagation();
|
|
10015
|
+
if (this.canOpen()) {
|
|
10016
|
+
this.popoverTrigger()?.toggle();
|
|
10017
|
+
}
|
|
10018
|
+
}
|
|
10019
|
+
closeCountryPanel() {
|
|
10020
|
+
this.popoverTrigger()?.close();
|
|
10021
|
+
}
|
|
10022
|
+
onInputClick(event) {
|
|
10023
|
+
event.stopPropagation();
|
|
10024
|
+
}
|
|
10025
|
+
selectCountry(country) {
|
|
10026
|
+
this.selectedCountry.set(country.code);
|
|
10027
|
+
this.countryChange.emit(country.code);
|
|
10028
|
+
const digits = this.displayValue().replace(/\D+/g, '');
|
|
10029
|
+
if (digits) {
|
|
10030
|
+
const formatted = formatAsYouType(digits, country.code);
|
|
10031
|
+
this.displayValue.set(formatted);
|
|
10032
|
+
const e164 = toValidE164(formatted, country.code);
|
|
10033
|
+
if (e164) {
|
|
10034
|
+
this.internalValue.set(e164);
|
|
10035
|
+
this.onChange(e164);
|
|
10036
|
+
this.valueChange.emit(e164);
|
|
10037
|
+
}
|
|
10038
|
+
}
|
|
10039
|
+
this.popoverTrigger()?.close();
|
|
10040
|
+
}
|
|
10041
|
+
applyDisplayFromValue(e164) {
|
|
10042
|
+
if (!e164) {
|
|
10043
|
+
this.displayValue.set('');
|
|
10044
|
+
return;
|
|
10045
|
+
}
|
|
10046
|
+
const country = detectCountry(e164);
|
|
10047
|
+
if (country && !this.country() && this.countryAllowed(country)) {
|
|
10048
|
+
this.selectedCountry.set(country);
|
|
10049
|
+
}
|
|
10050
|
+
this.displayValue.set(formatE164(e164));
|
|
10051
|
+
}
|
|
10052
|
+
countryAllowed(code) {
|
|
10053
|
+
return this.countries().some((country) => country.code === code);
|
|
10054
|
+
}
|
|
10055
|
+
markAsTouched() {
|
|
10056
|
+
if (!this.touched()) {
|
|
10057
|
+
this.touched.set(true);
|
|
10058
|
+
this.onTouched();
|
|
10059
|
+
}
|
|
10060
|
+
}
|
|
10061
|
+
translateWithDefault(key, defaultText, params) {
|
|
10062
|
+
const result = this.translateService.translate(key, params);
|
|
10063
|
+
return result !== key ? result : defaultText;
|
|
10064
|
+
}
|
|
10065
|
+
translateKey(key) {
|
|
10066
|
+
if (key) {
|
|
10067
|
+
const translated = this.translateService.translate(key);
|
|
10068
|
+
return translated !== key ? translated : undefined;
|
|
10069
|
+
}
|
|
10070
|
+
return undefined;
|
|
10071
|
+
}
|
|
10072
|
+
buildError(direct, key, fallbackKey, fallbackDefault) {
|
|
10073
|
+
return (direct ??
|
|
10074
|
+
this.translateKey(key) ??
|
|
10075
|
+
this.translateWithDefault(fallbackKey, fallbackDefault));
|
|
10076
|
+
}
|
|
10077
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisPhoneFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10078
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SolarisPhoneFieldComponent, isStandalone: true, selector: "solaris-phone-field", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, hintKey: { classPropertyName: "hintKey", publicName: "hintKey", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, labelKey: { classPropertyName: "labelKey", publicName: "labelKey", isSignal: true, isRequired: false, transformFunction: null }, errorKey: { classPropertyName: "errorKey", publicName: "errorKey", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, invalidError: { classPropertyName: "invalidError", publicName: "invalidError", isSignal: true, isRequired: false, transformFunction: null }, requiredError: { classPropertyName: "requiredError", publicName: "requiredError", isSignal: true, isRequired: false, transformFunction: null }, placeholderKey: { classPropertyName: "placeholderKey", publicName: "placeholderKey", isSignal: true, isRequired: false, transformFunction: null }, invalidErrorKey: { classPropertyName: "invalidErrorKey", publicName: "invalidErrorKey", isSignal: true, isRequired: false, transformFunction: null }, requiredErrorKey: { classPropertyName: "requiredErrorKey", publicName: "requiredErrorKey", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", 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 }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null }, defaultCountry: { classPropertyName: "defaultCountry", publicName: "defaultCountry", isSignal: true, isRequired: false, transformFunction: null }, country: { classPropertyName: "country", publicName: "country", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, allowAnyCountry: { classPropertyName: "allowAnyCountry", publicName: "allowAnyCountry", isSignal: true, isRequired: false, transformFunction: null }, countryList: { classPropertyName: "countryList", publicName: "countryList", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, emptyTextKey: { classPropertyName: "emptyTextKey", publicName: "emptyTextKey", isSignal: true, isRequired: false, transformFunction: null }, noResultsText: { classPropertyName: "noResultsText", publicName: "noResultsText", isSignal: true, isRequired: false, transformFunction: null }, noResultsTextKey: { classPropertyName: "noResultsTextKey", publicName: "noResultsTextKey", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholderKey: { classPropertyName: "searchPlaceholderKey", publicName: "searchPlaceholderKey", isSignal: true, isRequired: false, transformFunction: null }, countryButtonLabel: { classPropertyName: "countryButtonLabel", publicName: "countryButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, countryButtonLabelKey: { classPropertyName: "countryButtonLabelKey", publicName: "countryButtonLabelKey", isSignal: true, isRequired: false, transformFunction: null }, panelMaxWidth: { classPropertyName: "panelMaxWidth", publicName: "panelMaxWidth", isSignal: true, isRequired: false, transformFunction: null }, panelMaxHeight: { classPropertyName: "panelMaxHeight", publicName: "panelMaxHeight", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", countryChange: "countryChange" }, host: { properties: { "attr.data-open": "panelOpen() ? \"\" : null" }, classAttribute: "solaris-phone-field" }, providers: [
|
|
10079
|
+
{
|
|
10080
|
+
provide: NG_VALUE_ACCESSOR,
|
|
10081
|
+
useExisting: forwardRef(() => SolarisPhoneFieldComponent),
|
|
10082
|
+
multi: true,
|
|
10083
|
+
},
|
|
10084
|
+
], queries: [{ propertyName: "projectedPrefix", first: true, predicate: SolarisFormPrefixDirective, descendants: true, isSignal: true }, { propertyName: "projectedSuffix", first: true, predicate: SolarisFormSuffixDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "inputElementRef", first: true, predicate: ["inputElement"], descendants: true, isSignal: true }, { propertyName: "popoverTrigger", first: true, predicate: SolarisPopoverTriggerDirective, descendants: true, isSignal: true }], ngImport: i0, template: "<solaris-form-field\n [hint]=\"hint()\"\n [label]=\"label()\"\n [radius]=\"radius()\"\n [density]=\"density()\"\n [hintKey]=\"hintKey()\"\n [labelKey]=\"labelKey()\"\n [errorKey]=\"errorKey()\"\n [required]=\"required()\"\n [optional]=\"optional()\"\n [readonly]=\"isEffectivelyReadonly()\"\n [appearance]=\"appearance()\"\n [invalid]=\"isFieldInvalid()\"\n [error]=\"error() || computedError()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [hasPrefix]=\"hasPrefix()\"\n [hasSuffix]=\"hasSuffix()\"\n solaris-popover-trigger\n [solarisPopoverTriggerFor]=\"countryPopover\"\n [solarisPopoverDisabled]=\"!canOpen()\"\n [solarisPopoverPlacement]=\"'bottom'\"\n [solarisPopoverAlign]=\"'start'\"\n [solarisPopoverOffset]=\"8\"\n [solarisPopoverPadding]=\"'none'\"\n [solarisPopoverRadius]=\"radius()\"\n [solarisPopoverMaxWidth]=\"panelMaxWidth()\"\n [solarisPopoverAppearance]=\"popoverAppearance()\"\n [solarisPopoverAutoFocus]=\"'first-tabbable'\"\n [solarisPopoverAriaHasPopup]=\"'listbox'\"\n>\n <button\n type=\"button\"\n class=\"solaris-phone-field__country\"\n solaris-form-prefix\n [attr.aria-label]=\"countryButtonLabelText()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-expanded]=\"panelOpen() ? 'true' : 'false'\"\n [disabled]=\"!canOpen()\"\n (click)=\"onCountryToggle($event)\"\n >\n <span\n class=\"solaris-phone-field__flag\"\n [innerHTML]=\"selectedFlag() | solarisSafeHtml\"\n ></span>\n <solaris-icon\n class=\"solaris-phone-field__chevron\"\n name=\"chevron-down\"\n [decorative]=\"true\"\n />\n </button>\n\n <span class=\"solaris-phone-field__dial-code\"\n >+{{ selectedCallingCode() }}</span\n >\n\n <input\n type=\"tel\"\n #inputElement\n solaris-input\n data-bwignore=\"true\"\n [density]=\"density()\"\n (blur)=\"onInputBlur()\"\n [readonly]=\"isEffectivelyReadonly()\"\n (focus)=\"onInputFocus()\"\n (click)=\"onInputClick($event)\"\n [attr.id]=\"id() ?? null\"\n (input)=\"onInput($event)\"\n [value]=\"displayValue()\"\n [attr.inputmode]=\"'tel'\"\n [attr.autocapitalize]=\"'none'\"\n [attr.spellcheck]=\"'false'\"\n [attr.name]=\"name() ?? null\"\n [attr.autocomplete]=\"autocomplete()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [attr.maxlength]=\"maxLength() ?? null\"\n [attr.placeholder]=\"placeholderText() || null\"\n />\n\n @if (suffix() && !projectedSuffix()) {\n <span solaris-form-suffix>\n <solaris-icon [name]=\"suffix() ?? ''\" [decorative]=\"true\" />\n </span>\n }\n <ng-content\n select=\"[solaris-form-suffix]\"\n ngProjectAs=\"[solaris-form-suffix]\"\n />\n <ng-content\n select=\"[solaris-form-label-action]\"\n ngProjectAs=\"[solaris-form-label-action]\"\n />\n</solaris-form-field>\n\n<ng-template #countryPopover=\"solarisPopover\" solaris-popover>\n <solaris-phone-country-list\n [countries]=\"countries()\"\n [selectedCode]=\"effectiveCountry()\"\n [searchable]=\"searchable()\"\n [searchPlaceholder]=\"searchPlaceholderText()\"\n [noResultsText]=\"noResultsTextValue()\"\n [emptyText]=\"emptyTextValue()\"\n [maxHeight]=\"panelMaxHeight()\"\n (countrySelected)=\"selectCountry($event)\"\n (closeRequest)=\"closeCountryPanel()\"\n />\n</ng-template>\n", styles: [":host{--solaris-phone-field-country-gap: var(--solaris-spacing-1);--solaris-phone-field-country-padding-inline: var(--solaris-spacing-2);--solaris-phone-field-dial-code-color: var(--solaris-text-muted);--solaris-phone-field-flag-size: var(--solaris-font-size-sm);--solaris-phone-field-chevron-size: var(--solaris-font-size-xs);display:block;box-sizing:border-box}:host .solaris-phone-field__country.solaris-form-prefix{all:unset;display:inline-flex;box-sizing:border-box;align-items:center;gap:var(--solaris-phone-field-country-gap);padding-inline:var(--solaris-phone-field-country-padding-inline);cursor:pointer;color:var(--solaris-text-default);font-size:var(--solaris-font-size-sm);line-height:var(--solaris-line-height-md)}:host .solaris-phone-field__country.solaris-form-prefix:focus-visible{outline-offset:2px;outline:2px solid var(--solaris-primary-base)}:host .solaris-phone-field__country.solaris-form-prefix[disabled]{cursor:not-allowed;opacity:.5}.solaris-phone-field__flag{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--solaris-phone-field-flag-size);font-size:var(--solaris-font-size-sm);line-height:1}.solaris-phone-field__flag svg{display:block;width:100%;height:auto}:host .solaris-phone-field__country .solaris-phone-field__chevron{flex-shrink:0;color:var(--solaris-text-muted);block-size:var(--solaris-phone-field-chevron-size);inline-size:var(--solaris-phone-field-chevron-size);transition:transform var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}:host([data-open]) .solaris-phone-field__chevron{transform:rotate(180deg)}.solaris-phone-field__dial-code{flex:0 0 auto;-webkit-user-select:none;user-select:none;cursor:default;color:var(--solaris-phone-field-dial-code-color);font-size:var(--solaris-font-size-sm);line-height:var(--solaris-line-height-md);margin-inline-end:var(--solaris-spacing-1)}@media(prefers-reduced-motion:reduce){.solaris-phone-field__chevron{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: SolarisFormFieldComponent, selector: "solaris-form-field", inputs: ["hintKey", "labelKey", "hint", "errorKey", "label", "error", "optionalLabel", "requiredLabel", "optionalLabelKey", "requiredLabelKey", "required", "optional", "invalid", "disabled", "readonly", "density", "radius", "appearance", "control", "hasPrefix", "hasSuffix", "prefix", "suffix"] }, { kind: "directive", type: SolarisFormPrefixDirective, selector: "[solaris-form-prefix]" }, { kind: "directive", type: SolarisFormSuffixDirective, selector: "[solaris-form-suffix]" }, { kind: "directive", type: SolarisInputDirective, selector: "[solaris-input]", inputs: ["appearance", "radius", "size", "density", "invalid", "fullWidth"] }, { kind: "component", type: SolarisIconComponent, selector: "solaris-icon", inputs: ["name", "ariaLabel", "decorative", "inheritColor"] }, { kind: "directive", type: SolarisPopoverDirective, selector: "ng-template[solaris-popover]", exportAs: ["solarisPopover"] }, { kind: "directive", type: SolarisPopoverTriggerDirective, selector: "[solaris-popover-trigger]", inputs: ["solarisPopoverTriggerFor", "solarisPopoverOpen", "solarisPopoverDisabled", "solarisPopoverPlacement", "solarisPopoverAlign", "solarisPopoverOffset", "solarisPopoverMatchTriggerWidth", "solarisPopoverMinWidth", "solarisPopoverMaxWidth", "solarisPopoverCloseOnOutsideClick", "solarisPopoverCloseOnEscape", "solarisPopoverRestoreFocus", "solarisPopoverAutoFocus", "solarisPopoverScrollStrategy", "solarisPopoverPanelRole", "solarisPopoverAriaHasPopup", "solarisPopoverAppearance", "solarisPopoverPadding", "solarisPopoverRadius", "solarisPopoverTopConnected"], outputs: ["solarisPopoverOpened", "solarisPopoverClosed", "solarisPopoverOpenChange"] }, { kind: "component", type: SolarisPhoneCountryListComponent, selector: "solaris-phone-country-list", inputs: ["countries", "selectedCode", "searchable", "searchPlaceholder", "noResultsText", "emptyText", "maxHeight"], outputs: ["countrySelected", "closeRequest"] }, { kind: "pipe", type: SolarisSafeHtmlPipe, name: "solarisSafeHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10085
|
+
}
|
|
10086
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisPhoneFieldComponent, decorators: [{
|
|
10087
|
+
type: Component,
|
|
10088
|
+
args: [{ selector: 'solaris-phone-field', standalone: true, imports: [
|
|
10089
|
+
FormsModule,
|
|
10090
|
+
SolarisFormFieldComponent,
|
|
10091
|
+
SolarisFormPrefixDirective,
|
|
10092
|
+
SolarisFormSuffixDirective,
|
|
10093
|
+
SolarisInputDirective,
|
|
10094
|
+
SolarisIconComponent,
|
|
10095
|
+
SolarisPopoverDirective,
|
|
10096
|
+
SolarisPopoverTriggerDirective,
|
|
10097
|
+
SolarisPhoneCountryListComponent,
|
|
10098
|
+
SolarisSafeHtmlPipe,
|
|
10099
|
+
], providers: [
|
|
10100
|
+
{
|
|
10101
|
+
provide: NG_VALUE_ACCESSOR,
|
|
10102
|
+
useExisting: forwardRef(() => SolarisPhoneFieldComponent),
|
|
10103
|
+
multi: true,
|
|
10104
|
+
},
|
|
10105
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
10106
|
+
class: 'solaris-phone-field',
|
|
10107
|
+
'[attr.data-open]': 'panelOpen() ? "" : null',
|
|
10108
|
+
}, template: "<solaris-form-field\n [hint]=\"hint()\"\n [label]=\"label()\"\n [radius]=\"radius()\"\n [density]=\"density()\"\n [hintKey]=\"hintKey()\"\n [labelKey]=\"labelKey()\"\n [errorKey]=\"errorKey()\"\n [required]=\"required()\"\n [optional]=\"optional()\"\n [readonly]=\"isEffectivelyReadonly()\"\n [appearance]=\"appearance()\"\n [invalid]=\"isFieldInvalid()\"\n [error]=\"error() || computedError()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [hasPrefix]=\"hasPrefix()\"\n [hasSuffix]=\"hasSuffix()\"\n solaris-popover-trigger\n [solarisPopoverTriggerFor]=\"countryPopover\"\n [solarisPopoverDisabled]=\"!canOpen()\"\n [solarisPopoverPlacement]=\"'bottom'\"\n [solarisPopoverAlign]=\"'start'\"\n [solarisPopoverOffset]=\"8\"\n [solarisPopoverPadding]=\"'none'\"\n [solarisPopoverRadius]=\"radius()\"\n [solarisPopoverMaxWidth]=\"panelMaxWidth()\"\n [solarisPopoverAppearance]=\"popoverAppearance()\"\n [solarisPopoverAutoFocus]=\"'first-tabbable'\"\n [solarisPopoverAriaHasPopup]=\"'listbox'\"\n>\n <button\n type=\"button\"\n class=\"solaris-phone-field__country\"\n solaris-form-prefix\n [attr.aria-label]=\"countryButtonLabelText()\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-expanded]=\"panelOpen() ? 'true' : 'false'\"\n [disabled]=\"!canOpen()\"\n (click)=\"onCountryToggle($event)\"\n >\n <span\n class=\"solaris-phone-field__flag\"\n [innerHTML]=\"selectedFlag() | solarisSafeHtml\"\n ></span>\n <solaris-icon\n class=\"solaris-phone-field__chevron\"\n name=\"chevron-down\"\n [decorative]=\"true\"\n />\n </button>\n\n <span class=\"solaris-phone-field__dial-code\"\n >+{{ selectedCallingCode() }}</span\n >\n\n <input\n type=\"tel\"\n #inputElement\n solaris-input\n data-bwignore=\"true\"\n [density]=\"density()\"\n (blur)=\"onInputBlur()\"\n [readonly]=\"isEffectivelyReadonly()\"\n (focus)=\"onInputFocus()\"\n (click)=\"onInputClick($event)\"\n [attr.id]=\"id() ?? null\"\n (input)=\"onInput($event)\"\n [value]=\"displayValue()\"\n [attr.inputmode]=\"'tel'\"\n [attr.autocapitalize]=\"'none'\"\n [attr.spellcheck]=\"'false'\"\n [attr.name]=\"name() ?? null\"\n [attr.autocomplete]=\"autocomplete()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [attr.maxlength]=\"maxLength() ?? null\"\n [attr.placeholder]=\"placeholderText() || null\"\n />\n\n @if (suffix() && !projectedSuffix()) {\n <span solaris-form-suffix>\n <solaris-icon [name]=\"suffix() ?? ''\" [decorative]=\"true\" />\n </span>\n }\n <ng-content\n select=\"[solaris-form-suffix]\"\n ngProjectAs=\"[solaris-form-suffix]\"\n />\n <ng-content\n select=\"[solaris-form-label-action]\"\n ngProjectAs=\"[solaris-form-label-action]\"\n />\n</solaris-form-field>\n\n<ng-template #countryPopover=\"solarisPopover\" solaris-popover>\n <solaris-phone-country-list\n [countries]=\"countries()\"\n [selectedCode]=\"effectiveCountry()\"\n [searchable]=\"searchable()\"\n [searchPlaceholder]=\"searchPlaceholderText()\"\n [noResultsText]=\"noResultsTextValue()\"\n [emptyText]=\"emptyTextValue()\"\n [maxHeight]=\"panelMaxHeight()\"\n (countrySelected)=\"selectCountry($event)\"\n (closeRequest)=\"closeCountryPanel()\"\n />\n</ng-template>\n", styles: [":host{--solaris-phone-field-country-gap: var(--solaris-spacing-1);--solaris-phone-field-country-padding-inline: var(--solaris-spacing-2);--solaris-phone-field-dial-code-color: var(--solaris-text-muted);--solaris-phone-field-flag-size: var(--solaris-font-size-sm);--solaris-phone-field-chevron-size: var(--solaris-font-size-xs);display:block;box-sizing:border-box}:host .solaris-phone-field__country.solaris-form-prefix{all:unset;display:inline-flex;box-sizing:border-box;align-items:center;gap:var(--solaris-phone-field-country-gap);padding-inline:var(--solaris-phone-field-country-padding-inline);cursor:pointer;color:var(--solaris-text-default);font-size:var(--solaris-font-size-sm);line-height:var(--solaris-line-height-md)}:host .solaris-phone-field__country.solaris-form-prefix:focus-visible{outline-offset:2px;outline:2px solid var(--solaris-primary-base)}:host .solaris-phone-field__country.solaris-form-prefix[disabled]{cursor:not-allowed;opacity:.5}.solaris-phone-field__flag{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:var(--solaris-phone-field-flag-size);font-size:var(--solaris-font-size-sm);line-height:1}.solaris-phone-field__flag svg{display:block;width:100%;height:auto}:host .solaris-phone-field__country .solaris-phone-field__chevron{flex-shrink:0;color:var(--solaris-text-muted);block-size:var(--solaris-phone-field-chevron-size);inline-size:var(--solaris-phone-field-chevron-size);transition:transform var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}:host([data-open]) .solaris-phone-field__chevron{transform:rotate(180deg)}.solaris-phone-field__dial-code{flex:0 0 auto;-webkit-user-select:none;user-select:none;cursor:default;color:var(--solaris-phone-field-dial-code-color);font-size:var(--solaris-font-size-sm);line-height:var(--solaris-line-height-md);margin-inline-end:var(--solaris-spacing-1)}@media(prefers-reduced-motion:reduce){.solaris-phone-field__chevron{transition:none}}\n"] }]
|
|
10109
|
+
}], ctorParameters: () => [], propDecorators: { inputElementRef: [{ type: i0.ViewChild, args: ['inputElement', { isSignal: true }] }], popoverTrigger: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SolarisPopoverTriggerDirective), { isSignal: true }] }], projectedPrefix: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SolarisFormPrefixDirective), { isSignal: true }] }], projectedSuffix: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SolarisFormSuffixDirective), { isSignal: true }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], hintKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintKey", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], labelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelKey", required: false }] }], errorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorKey", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], invalidError: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidError", required: false }] }], requiredError: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredError", required: false }] }], placeholderKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholderKey", required: false }] }], invalidErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidErrorKey", required: false }] }], requiredErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredErrorKey", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }], defaultCountry: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultCountry", required: false }] }], country: [{ type: i0.Input, args: [{ isSignal: true, alias: "country", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], allowAnyCountry: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowAnyCountry", required: false }] }], countryList: [{ type: i0.Input, args: [{ isSignal: true, alias: "countryList", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], emptyTextKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyTextKey", required: false }] }], noResultsText: [{ type: i0.Input, args: [{ isSignal: true, alias: "noResultsText", required: false }] }], noResultsTextKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "noResultsTextKey", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], searchPlaceholderKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholderKey", required: false }] }], countryButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "countryButtonLabel", required: false }] }], countryButtonLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "countryButtonLabelKey", required: false }] }], panelMaxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelMaxWidth", required: false }] }], panelMaxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelMaxHeight", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], countryChange: [{ type: i0.Output, args: ["countryChange"] }] } });
|
|
10110
|
+
|
|
10111
|
+
function solarisPhoneValidator(country) {
|
|
10112
|
+
return (control) => {
|
|
10113
|
+
const value = control.value;
|
|
10114
|
+
if (value == null || value === '') {
|
|
10115
|
+
return null;
|
|
10116
|
+
}
|
|
10117
|
+
const parsed = parsePhoneNumberFromString(String(value), country);
|
|
10118
|
+
if (!parsed || !parsed.isValid()) {
|
|
10119
|
+
return { solarisPhoneInvalid: true };
|
|
10120
|
+
}
|
|
10121
|
+
return null;
|
|
10122
|
+
};
|
|
10123
|
+
}
|
|
10124
|
+
|
|
9448
10125
|
class SolarisSkeletonComponent {
|
|
9449
10126
|
variant = input('text', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
9450
10127
|
animation = input('pulse', ...(ngDevMode ? [{ debugName: "animation" }] : /* istanbul ignore next */ []));
|
|
@@ -10113,7 +10790,7 @@ class SolarisToastComponent {
|
|
|
10113
10790
|
return key;
|
|
10114
10791
|
}
|
|
10115
10792
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10116
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SolarisToastComponent, isStandalone: true, selector: "solaris-toast", inputs: { entry: { classPropertyName: "entry", publicName: "entry", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dismiss: "dismiss" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focusin": "onFocusIn()", "focusout": "onFocusOut()" }, properties: { "attr.role": "hostRole()", "attr.aria-live": "hostAriaLive()", "attr.data-variant": "hostDataVariant()", "attr.data-icon-size": "hostDataIconSize()", "attr.data-appearance": "hostDataAppearance()", "attr.data-media-shape": "hostDataMediaShape()", "attr.data-actions-align": "hostDataActionsAlign()", "attr.data-center-content": "centerContent()", "attr.data-actions-no-desc": "hasActionsNoDescription()" } }, ngImport: i0, template: "<div class=\"solaris-toast__root\">\n @if (showIcon()) {\n <div class=\"solaris-toast__media\">\n <div class=\"solaris-toast__icon\">\n <solaris-icon\n [name]=\"entry().resolvedIcon\"\n [decorative]=\"entry().options.iconDecorative !== false\"\n />\n </div>\n </div>\n }\n\n <div class=\"solaris-toast__content\">\n @if (showTitle()) {\n <div class=\"solaris-toast__title\">{{ entry().resolvedTitle }}</div>\n }\n\n @if (showDescription()) {\n <div\n class=\"solaris-toast__description\"\n [class.solaris-toast__description--truncated]=\"isTruncated()\"\n [style.--solaris-toast-max-lines]=\"entry().resolvedMaxCollapsedLines\"\n >\n {{ entry().resolvedDescription }}\n </div>\n }\n\n @if (showActions()) {\n <div class=\"solaris-toast__actions\">\n @for (action of entry().resolvedActions; track $index) {\n <button\n solaris-button\n [appearance]=\"action.appearance ?? 'ghost'\"\n [color]=\"action.color ?? 'neutral'\"\n size=\"sm\"\n [disabled]=\"action.disabled ?? false\"\n (click)=\"handleActionClick(action)\"\n >\n {{ action.label }}\n </button>\n }\n </div>\n }\n </div>\n\n <div class=\"solaris-toast__trailing\">\n @if (isExpandable()) {\n <button\n type=\"button\"\n class=\"solaris-toast__trailing-btn\"\n [attr.aria-label]=\"expandButtonLabel()\"\n [attr.aria-expanded]=\"expanded()\"\n (click)=\"toggleExpanded()\"\n >\n <solaris-icon\n class=\"solaris-toast__expand-icon\"\n [class.solaris-toast__expand-icon--expanded]=\"expanded()\"\n name=\"chevron-down\"\n [decorative]=\"true\"\n />\n </button>\n }\n\n @if (showClose()) {\n <button\n type=\"button\"\n class=\"solaris-toast__trailing-btn\"\n [attr.aria-label]=\"entry().resolvedCloseLabel\"\n (click)=\"handleDismiss()\"\n >\n <solaris-icon name=\"x\" [decorative]=\"true\" />\n </button>\n }\n </div>\n</div>\n\n@if (showProgressBar()) {\n <div\n class=\"solaris-toast__progress\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"progressValue()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-label]=\"\n isProcessProgress()\n ? translate('solaris.toast.progress')\n : translate('solaris.toast.remaining')\n \"\n >\n <div\n class=\"solaris-toast__progress-bar\"\n [style.width.%]=\"progressValue()\"\n ></div>\n </div>\n}\n\n@if (showCountdownText()) {\n <div class=\"solaris-toast__countdown-text\">\n <span class=\"solaris-toast__countdown-message\">{{ countdownText() }}</span>\n <button\n type=\"button\"\n class=\"solaris-toast__countdown-toggle\"\n (click)=\"togglePause()\"\n >\n {{ pauseButtonLabel() }}\n </button>\n </div>\n}\n", styles: [":host{--solaris-toast-max-lines: 2;--solaris-toast-width: 800px;--solaris-toast-border-width: 0;--solaris-toast-max-width: 800px;--solaris-toast-border-color: transparent;--solaris-toast-gap: var(--solaris-spacing-3);--solaris-toast-radius: var(--solaris-radius-md);--solaris-toast-shadow: var(--solaris-shadow-lg);--solaris-toast-padding: var(--solaris-spacing-2);--solaris-toast-color: var(--solaris-text-default);--solaris-toast-close-size: var(--solaris-spacing-4);--solaris-toast-media-size: var(--solaris-spacing-6);--solaris-toast-icon-color: var(--solaris-text-muted);--solaris-toast-content-gap: var(--solaris-spacing-1);--solaris-toast-actions-gap: var(--solaris-spacing-2);--solaris-toast-radius-value: var(--solaris-radius-md);--solaris-toast-icon-size: var(--solaris-font-size-lg);--solaris-toast-shadow-value: var(--solaris-shadow-lg);--solaris-toast-title-color: var(--solaris-text-strong);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-action-color: var(--solaris-primary-base);--solaris-toast-progress-color: var(--solaris-text-muted);--solaris-toast-progress-height: var(--solaris-spacing-1);--solaris-toast-description-color: var(--solaris-text-muted);--solaris-toast-close-icon-size: var(--solaris-font-size-lg);display:block;overflow:hidden;pointer-events:auto;box-sizing:border-box;width:var(--solaris-toast-width);max-width:var(--solaris-toast-max-width);box-shadow:var(--solaris-toast-shadow-value);border-radius:var(--solaris-toast-radius-value);animation:solaris-toast-enter var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}.solaris-toast__root{display:flex;box-sizing:border-box;align-items:flex-start;gap:var(--solaris-toast-gap);color:var(--solaris-toast-color);padding:var(--solaris-toast-padding);border-radius:var(--solaris-radius-md);background:var(--solaris-toast-background);border:var(--solaris-toast-border-width) solid var(--solaris-toast-border-color)}:host([data-center-content=true]) .solaris-toast__root{align-items:center}:host([data-center-content=true]) .solaris-toast__trailing{align-self:center}:host([data-center-content=true]) .solaris-toast__media{margin-top:0}.solaris-toast__media{display:grid;flex-shrink:0;overflow:hidden;place-items:center;margin-top:var(--solaris-spacing-1);width:var(--solaris-toast-media-size);height:var(--solaris-toast-media-size)}.solaris-toast__icon solaris-icon,.solaris-toast__icon svg{display:block;width:var(--solaris-toast-icon-size);height:var(--solaris-toast-icon-size)}.solaris-toast__icon{display:grid;place-items:center;color:var(--solaris-toast-icon-color)}.solaris-toast__content{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--solaris-toast-content-gap);font-size:var(--solaris-font-size-sm);line-height:var(--solaris-line-height-md)}.solaris-toast__title{margin:0;word-break:normal;overflow-wrap:break-word;font-size:var(--solaris-font-size-md);line-height:var(--solaris-line-height-sm);font-weight:var(--solaris-font-weight-semibold);color:var(--solaris-toast-title-color)}.solaris-toast__description--truncated{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--solaris-toast-max-lines)}.solaris-toast__description{margin:0;word-break:normal;overflow-wrap:break-word;font-size:var(--solaris-font-size-xs);line-height:var(--solaris-line-height-md);color:var(--solaris-toast-description-color)}.solaris-toast__trailing{display:flex;flex-shrink:0;align-self:flex-start;gap:var(--solaris-spacing-2)}.solaris-toast__trailing-btn:hover{color:var(--solaris-text-default)}.solaris-toast__trailing-btn:focus-visible{outline-offset:2px;outline:2px solid var(--solaris-primary-base)}.solaris-toast__trailing-btn solaris-icon,.solaris-toast__trailing-btn svg{display:block;width:var(--solaris-toast-close-icon-size);height:var(--solaris-toast-close-icon-size)}.solaris-toast__trailing-btn{all:unset;display:grid;flex-shrink:0;cursor:pointer;place-items:center;box-sizing:border-box;background:transparent;color:var(--solaris-text-muted);width:var(--solaris-toast-close-size);height:var(--solaris-toast-close-size);border-radius:var(--solaris-radius-sm);transition:color var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}.solaris-toast__expand-icon--expanded{transform:rotate(180deg)}.solaris-toast__expand-icon{transition:transform var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}.solaris-toast__actions{display:flex;flex-wrap:wrap;gap:var(--solaris-toast-actions-gap);margin-block-start:var(--solaris-spacing-2)}:host([data-actions-align=start]) .solaris-toast__actions{justify-content:flex-start}:host([data-actions-align=center]) .solaris-toast__actions{justify-content:center}:host([data-actions-align=end]) .solaris-toast__actions{justify-content:flex-end}:host([data-actions-align=stretch]) .solaris-toast__actions [solaris-button]{flex:1}:host([data-actions-align=stretch]) .solaris-toast__actions{justify-content:stretch}.solaris-toast__progress{overflow:hidden;background:var(--solaris-surface-muted);height:var(--solaris-toast-progress-height)}.solaris-toast__progress-bar{height:100%;transition:width .1s var(--solaris-motion-easing-standard);background:var(--solaris-toast-progress-color)}.solaris-toast__countdown-text{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--solaris-spacing-1);color:var(--solaris-text-muted);background:var(--solaris-bg-page);font-size:var(--solaris-font-size-xs);line-height:var(--solaris-line-height-md);padding:var(--solaris-toast-padding) var(--solaris-spacing-4)}.solaris-toast__countdown-toggle:hover{text-decoration:underline}.solaris-toast__countdown-toggle:focus-visible{outline-offset:2px;text-decoration:underline;border-radius:var(--solaris-radius-sm);outline:2px solid var(--solaris-primary-base)}.solaris-toast__countdown-toggle{all:unset;cursor:pointer;white-space:nowrap;line-height:inherit;text-decoration:none;color:var(--solaris-text-default);font-weight:var(--solaris-font-weight-bold)}:host([data-icon-size=sm]){--solaris-toast-media-size: var(--solaris-spacing-6);--solaris-toast-icon-size: var(--solaris-font-size-lg)}:host([data-icon-size=md]){--solaris-toast-media-size: var(--solaris-spacing-8);--solaris-toast-icon-size: var(--solaris-font-size-2xl)}:host([data-icon-size=lg]){--solaris-toast-media-size: var(--solaris-spacing-10);--solaris-toast-icon-size: var(--solaris-font-size-3xl)}:host([data-media-shape=circle]) .solaris-toast__media{border-radius:50%}:host([data-media-shape=rounded]) .solaris-toast__media{border-radius:var(--solaris-radius-md)}:host([data-media-shape=square]) .solaris-toast__media{border-radius:0}:host([data-variant=neutral][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-text-muted);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-text-muted)}:host([data-variant=neutral][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-text-muted);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-text-muted);--solaris-toast-border-color: var(--solaris-border-default);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=info][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-info-base);--solaris-toast-progress-color: var(--solaris-info-base);--solaris-toast-background: var(--solaris-surface-raised)}:host([data-variant=info][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-info-base);--solaris-toast-border-color: var(--solaris-info-border);--solaris-toast-progress-color: var(--solaris-info-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=success][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-success-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-success-base)}:host([data-variant=success][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-success-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-success-border);--solaris-toast-progress-color: var(--solaris-success-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=warning][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-warning-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-warning-base)}:host([data-variant=warning][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-warning-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-warning-border);--solaris-toast-progress-color: var(--solaris-warning-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=danger][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-danger-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-danger-base)}:host([data-variant=danger][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-danger-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-danger-border);--solaris-toast-progress-color: var(--solaris-danger-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=loading][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-primary-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-primary-base)}:host([data-variant=loading][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-primary-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-primary-border);--solaris-toast-progress-color: var(--solaris-primary-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=custom]){--solaris-toast-color: var( --solaris-toast-custom-color, var(--solaris-text-default) );--solaris-toast-icon-color: var( --solaris-toast-custom-icon-color, var(--solaris-text-muted) );--solaris-toast-background: var( --solaris-toast-custom-background, var(--solaris-surface-raised) );--solaris-toast-border-color: var( --solaris-toast-custom-border-color, var(--solaris-border-default) );--solaris-toast-progress-color: var( --solaris-toast-custom-progress-color, var(--solaris-primary-base) )}:host([data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent}:host([data-appearance=outline]){--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=loading]) .solaris-toast__icon{animation:solaris-toast-spin 1s var(--solaris-motion-easing-linear) infinite}@keyframes solaris-toast-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes solaris-toast-enter{0%{opacity:0;transform:translateY(-16px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){:host{animation:none}:host([data-variant=loading]) .solaris-toast__icon{animation:none}}:host-context([data-reduced-motion=true]){animation:none}:host([data-reduced-motion=true][data-variant=loading]) .solaris-toast__icon{animation:none}@media(width<=640px){:host{--solaris-toast-width: 100%;--solaris-toast-max-width: 100%}}\n"], dependencies: [{ kind: "component", type: SolarisIconComponent, selector: "solaris-icon", inputs: ["name", "ariaLabel", "decorative", "inheritColor"] }, { kind: "directive", type: SolarisButtonDirective, selector: "[solaris-button]", inputs: ["appearance", "color", "radius", "density", "shape", "loading", "disabled", "fullWidth", "loadingLabelKey", "loadingLabel", "icon", "iconPosition"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10793
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SolarisToastComponent, isStandalone: true, selector: "solaris-toast", inputs: { entry: { classPropertyName: "entry", publicName: "entry", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dismiss: "dismiss" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focusin": "onFocusIn()", "focusout": "onFocusOut()" }, properties: { "attr.role": "hostRole()", "attr.aria-live": "hostAriaLive()", "attr.data-variant": "hostDataVariant()", "attr.data-icon-size": "hostDataIconSize()", "attr.data-appearance": "hostDataAppearance()", "attr.data-media-shape": "hostDataMediaShape()", "attr.data-actions-align": "hostDataActionsAlign()", "attr.data-center-content": "centerContent()", "attr.data-actions-no-desc": "hasActionsNoDescription()" } }, ngImport: i0, template: "<div class=\"solaris-toast__root\">\n <div class=\"solaris-toast__bar\"></div>\n\n @if (showIcon()) {\n <div class=\"solaris-toast__media\">\n <div class=\"solaris-toast__icon\">\n <solaris-icon\n [name]=\"entry().resolvedIcon\"\n [decorative]=\"entry().options.iconDecorative !== false\"\n />\n </div>\n </div>\n }\n\n <div class=\"solaris-toast__content\">\n @if (showTitle()) {\n <div class=\"solaris-toast__title\">{{ entry().resolvedTitle }}</div>\n }\n\n @if (showDescription()) {\n <div\n class=\"solaris-toast__description\"\n [class.solaris-toast__description--truncated]=\"isTruncated()\"\n [style.--solaris-toast-max-lines]=\"entry().resolvedMaxCollapsedLines\"\n >\n {{ entry().resolvedDescription }}\n </div>\n }\n\n @if (showActions()) {\n <div class=\"solaris-toast__actions\">\n @for (action of entry().resolvedActions; track $index) {\n <button\n solaris-button\n [appearance]=\"action.appearance ?? 'ghost'\"\n [color]=\"action.color ?? 'neutral'\"\n size=\"sm\"\n [disabled]=\"action.disabled ?? false\"\n (click)=\"handleActionClick(action)\"\n >\n {{ action.label }}\n </button>\n }\n </div>\n }\n </div>\n\n <div class=\"solaris-toast__trailing\">\n @if (isExpandable()) {\n <button\n type=\"button\"\n class=\"solaris-toast__trailing-btn\"\n [attr.aria-label]=\"expandButtonLabel()\"\n [attr.aria-expanded]=\"expanded()\"\n (click)=\"toggleExpanded()\"\n >\n <solaris-icon\n class=\"solaris-toast__expand-icon\"\n [class.solaris-toast__expand-icon--expanded]=\"expanded()\"\n name=\"chevron-down\"\n [decorative]=\"true\"\n />\n </button>\n }\n\n @if (showClose()) {\n <button\n type=\"button\"\n class=\"solaris-toast__trailing-btn\"\n [attr.aria-label]=\"entry().resolvedCloseLabel\"\n (click)=\"handleDismiss()\"\n >\n <solaris-icon name=\"x\" [decorative]=\"true\" />\n </button>\n }\n </div>\n</div>\n\n@if (showProgressBar()) {\n <div\n class=\"solaris-toast__progress\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"progressValue()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-label]=\"\n isProcessProgress()\n ? translate('solaris.toast.progress')\n : translate('solaris.toast.remaining')\n \"\n >\n <div\n class=\"solaris-toast__progress-bar\"\n [style.width.%]=\"progressValue()\"\n ></div>\n </div>\n}\n\n@if (showCountdownText()) {\n <div class=\"solaris-toast__countdown-text\">\n <span class=\"solaris-toast__countdown-message\">{{ countdownText() }}</span>\n <button\n type=\"button\"\n class=\"solaris-toast__countdown-toggle\"\n (click)=\"togglePause()\"\n >\n {{ pauseButtonLabel() }}\n </button>\n </div>\n}\n", styles: [":host{--solaris-toast-max-lines: 2;--solaris-toast-border-width: 0;--solaris-toast-max-width: 800px;--solaris-toast-width: fit-content;--solaris-toast-border-color: transparent;--solaris-toast-gap: var(--solaris-spacing-3);--solaris-toast-radius: var(--solaris-radius-md);--solaris-toast-shadow: var(--solaris-shadow-lg);--solaris-toast-padding: var(--solaris-spacing-3);--solaris-toast-color: var(--solaris-text-default);--solaris-toast-close-size: var(--solaris-spacing-4);--solaris-toast-media-size: var(--solaris-spacing-6);--solaris-toast-icon-color: var(--solaris-text-muted);--solaris-toast-content-gap: var(--solaris-spacing-1);--solaris-toast-actions-gap: var(--solaris-spacing-2);--solaris-toast-radius-value: var(--solaris-radius-md);--solaris-toast-icon-size: var(--solaris-font-size-lg);--solaris-toast-shadow-value: var(--solaris-shadow-lg);--solaris-toast-title-color: var(--solaris-text-strong);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-action-color: var(--solaris-primary-base);--solaris-toast-progress-color: var(--solaris-text-muted);--solaris-toast-progress-height: var(--solaris-spacing-1);--solaris-toast-description-color: var(--solaris-text-muted);--solaris-toast-close-icon-size: var(--solaris-font-size-lg);display:block;overflow:hidden;pointer-events:auto;box-sizing:border-box;width:var(--solaris-toast-width);margin-top:var(--solaris-spacing-4);max-width:var(--solaris-toast-max-width);box-shadow:var(--solaris-toast-shadow-value);border-radius:var(--solaris-toast-radius-value);animation:solaris-toast-enter var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}.solaris-toast__root{display:flex;box-sizing:border-box;align-items:flex-start;gap:var(--solaris-toast-gap);color:var(--solaris-toast-color);padding:var(--solaris-toast-padding);border-radius:var(--solaris-radius-md);background:var(--solaris-toast-background);border:var(--solaris-toast-border-width) solid var(--solaris-toast-border-color)}:host([data-center-content=true]) .solaris-toast__root{align-items:center}:host([data-center-content=true]) .solaris-toast__trailing{align-self:center}:host([data-center-content=true]) .solaris-toast__media{margin-top:0}.solaris-toast__bar{width:3px;flex-shrink:0;align-self:stretch;border-radius:var(--solaris-radius-full);background:var(--solaris-toast-icon-color)}.solaris-toast__media{display:grid;flex-shrink:0;overflow:hidden;place-items:center;margin-top:var(--solaris-spacing-1);width:var(--solaris-toast-media-size);height:var(--solaris-toast-media-size)}.solaris-toast__icon solaris-icon,.solaris-toast__icon svg{display:block;width:var(--solaris-toast-icon-size);height:var(--solaris-toast-icon-size)}.solaris-toast__icon{display:grid;place-items:center;color:var(--solaris-toast-icon-color)}.solaris-toast__content{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--solaris-toast-content-gap);font-size:var(--solaris-font-size-sm);line-height:var(--solaris-line-height-md)}.solaris-toast__title{margin:0;word-break:normal;overflow-wrap:break-word;font-size:var(--solaris-font-size-md);line-height:var(--solaris-line-height-sm);font-weight:var(--solaris-font-weight-semibold);color:var(--solaris-toast-title-color)}.solaris-toast__description--truncated{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--solaris-toast-max-lines)}.solaris-toast__description{margin:0;word-break:normal;overflow-wrap:break-word;font-size:var(--solaris-font-size-xs);line-height:var(--solaris-line-height-md);color:var(--solaris-toast-description-color)}.solaris-toast__trailing{display:flex;flex-shrink:0;align-self:flex-start;gap:var(--solaris-spacing-2)}.solaris-toast__trailing-btn:hover{color:var(--solaris-text-default)}.solaris-toast__trailing-btn:focus-visible{outline-offset:2px;outline:2px solid var(--solaris-primary-base)}.solaris-toast__trailing-btn solaris-icon,.solaris-toast__trailing-btn svg{display:block;width:var(--solaris-toast-close-icon-size);height:var(--solaris-toast-close-icon-size)}.solaris-toast__trailing-btn{all:unset;display:grid;flex-shrink:0;cursor:pointer;place-items:center;box-sizing:border-box;background:transparent;color:var(--solaris-text-muted);width:var(--solaris-toast-close-size);height:var(--solaris-toast-close-size);border-radius:var(--solaris-radius-sm);transition:color var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}.solaris-toast__expand-icon--expanded{transform:rotate(180deg)}.solaris-toast__expand-icon{transition:transform var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}.solaris-toast__actions{display:flex;flex-wrap:wrap;gap:var(--solaris-toast-actions-gap);margin-block-start:var(--solaris-spacing-2)}:host([data-actions-align=start]) .solaris-toast__actions{justify-content:flex-start}:host([data-actions-align=center]) .solaris-toast__actions{justify-content:center}:host([data-actions-align=end]) .solaris-toast__actions{justify-content:flex-end}:host([data-actions-align=stretch]) .solaris-toast__actions [solaris-button]{flex:1}:host([data-actions-align=stretch]) .solaris-toast__actions{justify-content:stretch}.solaris-toast__progress{overflow:hidden;background:var(--solaris-surface-muted);height:var(--solaris-toast-progress-height)}.solaris-toast__progress-bar{height:100%;transition:width .1s var(--solaris-motion-easing-standard);background:var(--solaris-toast-progress-color)}.solaris-toast__countdown-text{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--solaris-spacing-1);color:var(--solaris-text-muted);background:var(--solaris-bg-page);font-size:var(--solaris-font-size-xs);line-height:var(--solaris-line-height-md);padding:var(--solaris-toast-padding) var(--solaris-spacing-4)}.solaris-toast__countdown-toggle:hover{text-decoration:underline}.solaris-toast__countdown-toggle:focus-visible{outline-offset:2px;text-decoration:underline;border-radius:var(--solaris-radius-sm);outline:2px solid var(--solaris-primary-base)}.solaris-toast__countdown-toggle{all:unset;cursor:pointer;white-space:nowrap;line-height:inherit;text-decoration:none;color:var(--solaris-text-default);font-weight:var(--solaris-font-weight-bold)}:host([data-icon-size=sm]){--solaris-toast-media-size: var(--solaris-spacing-6);--solaris-toast-icon-size: var(--solaris-font-size-lg)}:host([data-icon-size=md]){--solaris-toast-media-size: var(--solaris-spacing-8);--solaris-toast-icon-size: var(--solaris-font-size-2xl)}:host([data-icon-size=lg]){--solaris-toast-media-size: var(--solaris-spacing-10);--solaris-toast-icon-size: var(--solaris-font-size-3xl)}:host([data-media-shape=circle]) .solaris-toast__media{border-radius:50%}:host([data-media-shape=rounded]) .solaris-toast__media{border-radius:var(--solaris-radius-md)}:host([data-media-shape=square]) .solaris-toast__media{border-radius:0}:host([data-variant=neutral][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-text-muted);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-text-muted)}:host([data-variant=neutral][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-text-muted);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-text-muted);--solaris-toast-border-color: var(--solaris-border-default);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=info][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-info-base);--solaris-toast-progress-color: var(--solaris-info-base);--solaris-toast-background: var(--solaris-surface-raised)}:host([data-variant=info][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-info-base);--solaris-toast-border-color: var(--solaris-info-border);--solaris-toast-progress-color: var(--solaris-info-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=success][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-success-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-success-base)}:host([data-variant=success][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-success-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-success-border);--solaris-toast-progress-color: var(--solaris-success-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=warning][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-warning-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-warning-base)}:host([data-variant=warning][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-warning-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-warning-border);--solaris-toast-progress-color: var(--solaris-warning-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=danger][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-danger-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-danger-base)}:host([data-variant=danger][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-danger-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-danger-border);--solaris-toast-progress-color: var(--solaris-danger-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=loading][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-primary-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-primary-base)}:host([data-variant=loading][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-primary-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-primary-border);--solaris-toast-progress-color: var(--solaris-primary-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=custom]){--solaris-toast-color: var( --solaris-toast-custom-color, var(--solaris-text-default) );--solaris-toast-icon-color: var( --solaris-toast-custom-icon-color, var(--solaris-text-muted) );--solaris-toast-background: var( --solaris-toast-custom-background, var(--solaris-surface-raised) );--solaris-toast-border-color: var( --solaris-toast-custom-border-color, var(--solaris-border-default) );--solaris-toast-progress-color: var( --solaris-toast-custom-progress-color, var(--solaris-primary-base) )}:host([data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent}:host([data-appearance=outline]){--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=loading]) .solaris-toast__icon{animation:solaris-toast-spin 1s var(--solaris-motion-easing-linear) infinite}@keyframes solaris-toast-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes solaris-toast-enter{0%{opacity:0;transform:translateY(-16px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){:host{animation:none}:host([data-variant=loading]) .solaris-toast__icon{animation:none}}:host-context([data-reduced-motion=true]){animation:none}:host([data-reduced-motion=true][data-variant=loading]) .solaris-toast__icon{animation:none}@media(width<=640px){:host{--solaris-toast-width: 100%;--solaris-toast-max-width: 100%}}\n"], dependencies: [{ kind: "component", type: SolarisIconComponent, selector: "solaris-icon", inputs: ["name", "ariaLabel", "decorative", "inheritColor"] }, { kind: "directive", type: SolarisButtonDirective, selector: "[solaris-button]", inputs: ["iconPosition", "appearance", "color", "shape", "radius", "density", "fullWidth", "disabled", "loading", "loadingLabelKey", "loadingLabel", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10117
10794
|
}
|
|
10118
10795
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisToastComponent, decorators: [{
|
|
10119
10796
|
type: Component,
|
|
@@ -10127,7 +10804,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
10127
10804
|
'[attr.data-actions-align]': 'hostDataActionsAlign()',
|
|
10128
10805
|
'[attr.data-center-content]': 'centerContent()',
|
|
10129
10806
|
'[attr.data-actions-no-desc]': 'hasActionsNoDescription()',
|
|
10130
|
-
}, template: "<div class=\"solaris-toast__root\">\n @if (showIcon()) {\n <div class=\"solaris-toast__media\">\n <div class=\"solaris-toast__icon\">\n <solaris-icon\n [name]=\"entry().resolvedIcon\"\n [decorative]=\"entry().options.iconDecorative !== false\"\n />\n </div>\n </div>\n }\n\n <div class=\"solaris-toast__content\">\n @if (showTitle()) {\n <div class=\"solaris-toast__title\">{{ entry().resolvedTitle }}</div>\n }\n\n @if (showDescription()) {\n <div\n class=\"solaris-toast__description\"\n [class.solaris-toast__description--truncated]=\"isTruncated()\"\n [style.--solaris-toast-max-lines]=\"entry().resolvedMaxCollapsedLines\"\n >\n {{ entry().resolvedDescription }}\n </div>\n }\n\n @if (showActions()) {\n <div class=\"solaris-toast__actions\">\n @for (action of entry().resolvedActions; track $index) {\n <button\n solaris-button\n [appearance]=\"action.appearance ?? 'ghost'\"\n [color]=\"action.color ?? 'neutral'\"\n size=\"sm\"\n [disabled]=\"action.disabled ?? false\"\n (click)=\"handleActionClick(action)\"\n >\n {{ action.label }}\n </button>\n }\n </div>\n }\n </div>\n\n <div class=\"solaris-toast__trailing\">\n @if (isExpandable()) {\n <button\n type=\"button\"\n class=\"solaris-toast__trailing-btn\"\n [attr.aria-label]=\"expandButtonLabel()\"\n [attr.aria-expanded]=\"expanded()\"\n (click)=\"toggleExpanded()\"\n >\n <solaris-icon\n class=\"solaris-toast__expand-icon\"\n [class.solaris-toast__expand-icon--expanded]=\"expanded()\"\n name=\"chevron-down\"\n [decorative]=\"true\"\n />\n </button>\n }\n\n @if (showClose()) {\n <button\n type=\"button\"\n class=\"solaris-toast__trailing-btn\"\n [attr.aria-label]=\"entry().resolvedCloseLabel\"\n (click)=\"handleDismiss()\"\n >\n <solaris-icon name=\"x\" [decorative]=\"true\" />\n </button>\n }\n </div>\n</div>\n\n@if (showProgressBar()) {\n <div\n class=\"solaris-toast__progress\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"progressValue()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-label]=\"\n isProcessProgress()\n ? translate('solaris.toast.progress')\n : translate('solaris.toast.remaining')\n \"\n >\n <div\n class=\"solaris-toast__progress-bar\"\n [style.width.%]=\"progressValue()\"\n ></div>\n </div>\n}\n\n@if (showCountdownText()) {\n <div class=\"solaris-toast__countdown-text\">\n <span class=\"solaris-toast__countdown-message\">{{ countdownText() }}</span>\n <button\n type=\"button\"\n class=\"solaris-toast__countdown-toggle\"\n (click)=\"togglePause()\"\n >\n {{ pauseButtonLabel() }}\n </button>\n </div>\n}\n", styles: [":host{--solaris-toast-max-lines: 2;--solaris-toast-width: 800px;--solaris-toast-border-width: 0;--solaris-toast-max-width: 800px;--solaris-toast-border-color: transparent;--solaris-toast-gap: var(--solaris-spacing-3);--solaris-toast-radius: var(--solaris-radius-md);--solaris-toast-shadow: var(--solaris-shadow-lg);--solaris-toast-padding: var(--solaris-spacing-2);--solaris-toast-color: var(--solaris-text-default);--solaris-toast-close-size: var(--solaris-spacing-4);--solaris-toast-media-size: var(--solaris-spacing-6);--solaris-toast-icon-color: var(--solaris-text-muted);--solaris-toast-content-gap: var(--solaris-spacing-1);--solaris-toast-actions-gap: var(--solaris-spacing-2);--solaris-toast-radius-value: var(--solaris-radius-md);--solaris-toast-icon-size: var(--solaris-font-size-lg);--solaris-toast-shadow-value: var(--solaris-shadow-lg);--solaris-toast-title-color: var(--solaris-text-strong);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-action-color: var(--solaris-primary-base);--solaris-toast-progress-color: var(--solaris-text-muted);--solaris-toast-progress-height: var(--solaris-spacing-1);--solaris-toast-description-color: var(--solaris-text-muted);--solaris-toast-close-icon-size: var(--solaris-font-size-lg);display:block;overflow:hidden;pointer-events:auto;box-sizing:border-box;width:var(--solaris-toast-width);max-width:var(--solaris-toast-max-width);box-shadow:var(--solaris-toast-shadow-value);border-radius:var(--solaris-toast-radius-value);animation:solaris-toast-enter var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}.solaris-toast__root{display:flex;box-sizing:border-box;align-items:flex-start;gap:var(--solaris-toast-gap);color:var(--solaris-toast-color);padding:var(--solaris-toast-padding);border-radius:var(--solaris-radius-md);background:var(--solaris-toast-background);border:var(--solaris-toast-border-width) solid var(--solaris-toast-border-color)}:host([data-center-content=true]) .solaris-toast__root{align-items:center}:host([data-center-content=true]) .solaris-toast__trailing{align-self:center}:host([data-center-content=true]) .solaris-toast__media{margin-top:0}.solaris-toast__media{display:grid;flex-shrink:0;overflow:hidden;place-items:center;margin-top:var(--solaris-spacing-1);width:var(--solaris-toast-media-size);height:var(--solaris-toast-media-size)}.solaris-toast__icon solaris-icon,.solaris-toast__icon svg{display:block;width:var(--solaris-toast-icon-size);height:var(--solaris-toast-icon-size)}.solaris-toast__icon{display:grid;place-items:center;color:var(--solaris-toast-icon-color)}.solaris-toast__content{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--solaris-toast-content-gap);font-size:var(--solaris-font-size-sm);line-height:var(--solaris-line-height-md)}.solaris-toast__title{margin:0;word-break:normal;overflow-wrap:break-word;font-size:var(--solaris-font-size-md);line-height:var(--solaris-line-height-sm);font-weight:var(--solaris-font-weight-semibold);color:var(--solaris-toast-title-color)}.solaris-toast__description--truncated{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--solaris-toast-max-lines)}.solaris-toast__description{margin:0;word-break:normal;overflow-wrap:break-word;font-size:var(--solaris-font-size-xs);line-height:var(--solaris-line-height-md);color:var(--solaris-toast-description-color)}.solaris-toast__trailing{display:flex;flex-shrink:0;align-self:flex-start;gap:var(--solaris-spacing-2)}.solaris-toast__trailing-btn:hover{color:var(--solaris-text-default)}.solaris-toast__trailing-btn:focus-visible{outline-offset:2px;outline:2px solid var(--solaris-primary-base)}.solaris-toast__trailing-btn solaris-icon,.solaris-toast__trailing-btn svg{display:block;width:var(--solaris-toast-close-icon-size);height:var(--solaris-toast-close-icon-size)}.solaris-toast__trailing-btn{all:unset;display:grid;flex-shrink:0;cursor:pointer;place-items:center;box-sizing:border-box;background:transparent;color:var(--solaris-text-muted);width:var(--solaris-toast-close-size);height:var(--solaris-toast-close-size);border-radius:var(--solaris-radius-sm);transition:color var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}.solaris-toast__expand-icon--expanded{transform:rotate(180deg)}.solaris-toast__expand-icon{transition:transform var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}.solaris-toast__actions{display:flex;flex-wrap:wrap;gap:var(--solaris-toast-actions-gap);margin-block-start:var(--solaris-spacing-2)}:host([data-actions-align=start]) .solaris-toast__actions{justify-content:flex-start}:host([data-actions-align=center]) .solaris-toast__actions{justify-content:center}:host([data-actions-align=end]) .solaris-toast__actions{justify-content:flex-end}:host([data-actions-align=stretch]) .solaris-toast__actions [solaris-button]{flex:1}:host([data-actions-align=stretch]) .solaris-toast__actions{justify-content:stretch}.solaris-toast__progress{overflow:hidden;background:var(--solaris-surface-muted);height:var(--solaris-toast-progress-height)}.solaris-toast__progress-bar{height:100%;transition:width .1s var(--solaris-motion-easing-standard);background:var(--solaris-toast-progress-color)}.solaris-toast__countdown-text{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--solaris-spacing-1);color:var(--solaris-text-muted);background:var(--solaris-bg-page);font-size:var(--solaris-font-size-xs);line-height:var(--solaris-line-height-md);padding:var(--solaris-toast-padding) var(--solaris-spacing-4)}.solaris-toast__countdown-toggle:hover{text-decoration:underline}.solaris-toast__countdown-toggle:focus-visible{outline-offset:2px;text-decoration:underline;border-radius:var(--solaris-radius-sm);outline:2px solid var(--solaris-primary-base)}.solaris-toast__countdown-toggle{all:unset;cursor:pointer;white-space:nowrap;line-height:inherit;text-decoration:none;color:var(--solaris-text-default);font-weight:var(--solaris-font-weight-bold)}:host([data-icon-size=sm]){--solaris-toast-media-size: var(--solaris-spacing-6);--solaris-toast-icon-size: var(--solaris-font-size-lg)}:host([data-icon-size=md]){--solaris-toast-media-size: var(--solaris-spacing-8);--solaris-toast-icon-size: var(--solaris-font-size-2xl)}:host([data-icon-size=lg]){--solaris-toast-media-size: var(--solaris-spacing-10);--solaris-toast-icon-size: var(--solaris-font-size-3xl)}:host([data-media-shape=circle]) .solaris-toast__media{border-radius:50%}:host([data-media-shape=rounded]) .solaris-toast__media{border-radius:var(--solaris-radius-md)}:host([data-media-shape=square]) .solaris-toast__media{border-radius:0}:host([data-variant=neutral][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-text-muted);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-text-muted)}:host([data-variant=neutral][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-text-muted);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-text-muted);--solaris-toast-border-color: var(--solaris-border-default);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=info][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-info-base);--solaris-toast-progress-color: var(--solaris-info-base);--solaris-toast-background: var(--solaris-surface-raised)}:host([data-variant=info][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-info-base);--solaris-toast-border-color: var(--solaris-info-border);--solaris-toast-progress-color: var(--solaris-info-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=success][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-success-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-success-base)}:host([data-variant=success][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-success-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-success-border);--solaris-toast-progress-color: var(--solaris-success-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=warning][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-warning-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-warning-base)}:host([data-variant=warning][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-warning-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-warning-border);--solaris-toast-progress-color: var(--solaris-warning-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=danger][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-danger-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-danger-base)}:host([data-variant=danger][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-danger-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-danger-border);--solaris-toast-progress-color: var(--solaris-danger-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=loading][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-primary-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-primary-base)}:host([data-variant=loading][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-primary-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-primary-border);--solaris-toast-progress-color: var(--solaris-primary-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=custom]){--solaris-toast-color: var( --solaris-toast-custom-color, var(--solaris-text-default) );--solaris-toast-icon-color: var( --solaris-toast-custom-icon-color, var(--solaris-text-muted) );--solaris-toast-background: var( --solaris-toast-custom-background, var(--solaris-surface-raised) );--solaris-toast-border-color: var( --solaris-toast-custom-border-color, var(--solaris-border-default) );--solaris-toast-progress-color: var( --solaris-toast-custom-progress-color, var(--solaris-primary-base) )}:host([data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent}:host([data-appearance=outline]){--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=loading]) .solaris-toast__icon{animation:solaris-toast-spin 1s var(--solaris-motion-easing-linear) infinite}@keyframes solaris-toast-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes solaris-toast-enter{0%{opacity:0;transform:translateY(-16px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){:host{animation:none}:host([data-variant=loading]) .solaris-toast__icon{animation:none}}:host-context([data-reduced-motion=true]){animation:none}:host([data-reduced-motion=true][data-variant=loading]) .solaris-toast__icon{animation:none}@media(width<=640px){:host{--solaris-toast-width: 100%;--solaris-toast-max-width: 100%}}\n"] }]
|
|
10807
|
+
}, template: "<div class=\"solaris-toast__root\">\n <div class=\"solaris-toast__bar\"></div>\n\n @if (showIcon()) {\n <div class=\"solaris-toast__media\">\n <div class=\"solaris-toast__icon\">\n <solaris-icon\n [name]=\"entry().resolvedIcon\"\n [decorative]=\"entry().options.iconDecorative !== false\"\n />\n </div>\n </div>\n }\n\n <div class=\"solaris-toast__content\">\n @if (showTitle()) {\n <div class=\"solaris-toast__title\">{{ entry().resolvedTitle }}</div>\n }\n\n @if (showDescription()) {\n <div\n class=\"solaris-toast__description\"\n [class.solaris-toast__description--truncated]=\"isTruncated()\"\n [style.--solaris-toast-max-lines]=\"entry().resolvedMaxCollapsedLines\"\n >\n {{ entry().resolvedDescription }}\n </div>\n }\n\n @if (showActions()) {\n <div class=\"solaris-toast__actions\">\n @for (action of entry().resolvedActions; track $index) {\n <button\n solaris-button\n [appearance]=\"action.appearance ?? 'ghost'\"\n [color]=\"action.color ?? 'neutral'\"\n size=\"sm\"\n [disabled]=\"action.disabled ?? false\"\n (click)=\"handleActionClick(action)\"\n >\n {{ action.label }}\n </button>\n }\n </div>\n }\n </div>\n\n <div class=\"solaris-toast__trailing\">\n @if (isExpandable()) {\n <button\n type=\"button\"\n class=\"solaris-toast__trailing-btn\"\n [attr.aria-label]=\"expandButtonLabel()\"\n [attr.aria-expanded]=\"expanded()\"\n (click)=\"toggleExpanded()\"\n >\n <solaris-icon\n class=\"solaris-toast__expand-icon\"\n [class.solaris-toast__expand-icon--expanded]=\"expanded()\"\n name=\"chevron-down\"\n [decorative]=\"true\"\n />\n </button>\n }\n\n @if (showClose()) {\n <button\n type=\"button\"\n class=\"solaris-toast__trailing-btn\"\n [attr.aria-label]=\"entry().resolvedCloseLabel\"\n (click)=\"handleDismiss()\"\n >\n <solaris-icon name=\"x\" [decorative]=\"true\" />\n </button>\n }\n </div>\n</div>\n\n@if (showProgressBar()) {\n <div\n class=\"solaris-toast__progress\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"progressValue()\"\n [attr.aria-valuemin]=\"0\"\n [attr.aria-valuemax]=\"100\"\n [attr.aria-label]=\"\n isProcessProgress()\n ? translate('solaris.toast.progress')\n : translate('solaris.toast.remaining')\n \"\n >\n <div\n class=\"solaris-toast__progress-bar\"\n [style.width.%]=\"progressValue()\"\n ></div>\n </div>\n}\n\n@if (showCountdownText()) {\n <div class=\"solaris-toast__countdown-text\">\n <span class=\"solaris-toast__countdown-message\">{{ countdownText() }}</span>\n <button\n type=\"button\"\n class=\"solaris-toast__countdown-toggle\"\n (click)=\"togglePause()\"\n >\n {{ pauseButtonLabel() }}\n </button>\n </div>\n}\n", styles: [":host{--solaris-toast-max-lines: 2;--solaris-toast-border-width: 0;--solaris-toast-max-width: 800px;--solaris-toast-width: fit-content;--solaris-toast-border-color: transparent;--solaris-toast-gap: var(--solaris-spacing-3);--solaris-toast-radius: var(--solaris-radius-md);--solaris-toast-shadow: var(--solaris-shadow-lg);--solaris-toast-padding: var(--solaris-spacing-3);--solaris-toast-color: var(--solaris-text-default);--solaris-toast-close-size: var(--solaris-spacing-4);--solaris-toast-media-size: var(--solaris-spacing-6);--solaris-toast-icon-color: var(--solaris-text-muted);--solaris-toast-content-gap: var(--solaris-spacing-1);--solaris-toast-actions-gap: var(--solaris-spacing-2);--solaris-toast-radius-value: var(--solaris-radius-md);--solaris-toast-icon-size: var(--solaris-font-size-lg);--solaris-toast-shadow-value: var(--solaris-shadow-lg);--solaris-toast-title-color: var(--solaris-text-strong);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-action-color: var(--solaris-primary-base);--solaris-toast-progress-color: var(--solaris-text-muted);--solaris-toast-progress-height: var(--solaris-spacing-1);--solaris-toast-description-color: var(--solaris-text-muted);--solaris-toast-close-icon-size: var(--solaris-font-size-lg);display:block;overflow:hidden;pointer-events:auto;box-sizing:border-box;width:var(--solaris-toast-width);margin-top:var(--solaris-spacing-4);max-width:var(--solaris-toast-max-width);box-shadow:var(--solaris-toast-shadow-value);border-radius:var(--solaris-toast-radius-value);animation:solaris-toast-enter var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}.solaris-toast__root{display:flex;box-sizing:border-box;align-items:flex-start;gap:var(--solaris-toast-gap);color:var(--solaris-toast-color);padding:var(--solaris-toast-padding);border-radius:var(--solaris-radius-md);background:var(--solaris-toast-background);border:var(--solaris-toast-border-width) solid var(--solaris-toast-border-color)}:host([data-center-content=true]) .solaris-toast__root{align-items:center}:host([data-center-content=true]) .solaris-toast__trailing{align-self:center}:host([data-center-content=true]) .solaris-toast__media{margin-top:0}.solaris-toast__bar{width:3px;flex-shrink:0;align-self:stretch;border-radius:var(--solaris-radius-full);background:var(--solaris-toast-icon-color)}.solaris-toast__media{display:grid;flex-shrink:0;overflow:hidden;place-items:center;margin-top:var(--solaris-spacing-1);width:var(--solaris-toast-media-size);height:var(--solaris-toast-media-size)}.solaris-toast__icon solaris-icon,.solaris-toast__icon svg{display:block;width:var(--solaris-toast-icon-size);height:var(--solaris-toast-icon-size)}.solaris-toast__icon{display:grid;place-items:center;color:var(--solaris-toast-icon-color)}.solaris-toast__content{flex:1;min-width:0;display:flex;flex-direction:column;gap:var(--solaris-toast-content-gap);font-size:var(--solaris-font-size-sm);line-height:var(--solaris-line-height-md)}.solaris-toast__title{margin:0;word-break:normal;overflow-wrap:break-word;font-size:var(--solaris-font-size-md);line-height:var(--solaris-line-height-sm);font-weight:var(--solaris-font-weight-semibold);color:var(--solaris-toast-title-color)}.solaris-toast__description--truncated{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--solaris-toast-max-lines)}.solaris-toast__description{margin:0;word-break:normal;overflow-wrap:break-word;font-size:var(--solaris-font-size-xs);line-height:var(--solaris-line-height-md);color:var(--solaris-toast-description-color)}.solaris-toast__trailing{display:flex;flex-shrink:0;align-self:flex-start;gap:var(--solaris-spacing-2)}.solaris-toast__trailing-btn:hover{color:var(--solaris-text-default)}.solaris-toast__trailing-btn:focus-visible{outline-offset:2px;outline:2px solid var(--solaris-primary-base)}.solaris-toast__trailing-btn solaris-icon,.solaris-toast__trailing-btn svg{display:block;width:var(--solaris-toast-close-icon-size);height:var(--solaris-toast-close-icon-size)}.solaris-toast__trailing-btn{all:unset;display:grid;flex-shrink:0;cursor:pointer;place-items:center;box-sizing:border-box;background:transparent;color:var(--solaris-text-muted);width:var(--solaris-toast-close-size);height:var(--solaris-toast-close-size);border-radius:var(--solaris-radius-sm);transition:color var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}.solaris-toast__expand-icon--expanded{transform:rotate(180deg)}.solaris-toast__expand-icon{transition:transform var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}.solaris-toast__actions{display:flex;flex-wrap:wrap;gap:var(--solaris-toast-actions-gap);margin-block-start:var(--solaris-spacing-2)}:host([data-actions-align=start]) .solaris-toast__actions{justify-content:flex-start}:host([data-actions-align=center]) .solaris-toast__actions{justify-content:center}:host([data-actions-align=end]) .solaris-toast__actions{justify-content:flex-end}:host([data-actions-align=stretch]) .solaris-toast__actions [solaris-button]{flex:1}:host([data-actions-align=stretch]) .solaris-toast__actions{justify-content:stretch}.solaris-toast__progress{overflow:hidden;background:var(--solaris-surface-muted);height:var(--solaris-toast-progress-height)}.solaris-toast__progress-bar{height:100%;transition:width .1s var(--solaris-motion-easing-standard);background:var(--solaris-toast-progress-color)}.solaris-toast__countdown-text{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--solaris-spacing-1);color:var(--solaris-text-muted);background:var(--solaris-bg-page);font-size:var(--solaris-font-size-xs);line-height:var(--solaris-line-height-md);padding:var(--solaris-toast-padding) var(--solaris-spacing-4)}.solaris-toast__countdown-toggle:hover{text-decoration:underline}.solaris-toast__countdown-toggle:focus-visible{outline-offset:2px;text-decoration:underline;border-radius:var(--solaris-radius-sm);outline:2px solid var(--solaris-primary-base)}.solaris-toast__countdown-toggle{all:unset;cursor:pointer;white-space:nowrap;line-height:inherit;text-decoration:none;color:var(--solaris-text-default);font-weight:var(--solaris-font-weight-bold)}:host([data-icon-size=sm]){--solaris-toast-media-size: var(--solaris-spacing-6);--solaris-toast-icon-size: var(--solaris-font-size-lg)}:host([data-icon-size=md]){--solaris-toast-media-size: var(--solaris-spacing-8);--solaris-toast-icon-size: var(--solaris-font-size-2xl)}:host([data-icon-size=lg]){--solaris-toast-media-size: var(--solaris-spacing-10);--solaris-toast-icon-size: var(--solaris-font-size-3xl)}:host([data-media-shape=circle]) .solaris-toast__media{border-radius:50%}:host([data-media-shape=rounded]) .solaris-toast__media{border-radius:var(--solaris-radius-md)}:host([data-media-shape=square]) .solaris-toast__media{border-radius:0}:host([data-variant=neutral][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-text-muted);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-text-muted)}:host([data-variant=neutral][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-text-muted);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-text-muted);--solaris-toast-border-color: var(--solaris-border-default);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=info][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-info-base);--solaris-toast-progress-color: var(--solaris-info-base);--solaris-toast-background: var(--solaris-surface-raised)}:host([data-variant=info][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-info-base);--solaris-toast-border-color: var(--solaris-info-border);--solaris-toast-progress-color: var(--solaris-info-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=success][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-success-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-success-base)}:host([data-variant=success][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-success-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-success-border);--solaris-toast-progress-color: var(--solaris-success-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=warning][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-warning-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-warning-base)}:host([data-variant=warning][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-warning-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-warning-border);--solaris-toast-progress-color: var(--solaris-warning-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=danger][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-danger-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-danger-base)}:host([data-variant=danger][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-danger-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-danger-border);--solaris-toast-progress-color: var(--solaris-danger-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=loading][data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent;--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-primary-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-progress-color: var(--solaris-primary-base)}:host([data-variant=loading][data-appearance=outline]){--solaris-toast-color: var(--solaris-text-default);--solaris-toast-icon-color: var(--solaris-primary-base);--solaris-toast-background: var(--solaris-surface-raised);--solaris-toast-border-color: var(--solaris-primary-border);--solaris-toast-progress-color: var(--solaris-primary-base);--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=custom]){--solaris-toast-color: var( --solaris-toast-custom-color, var(--solaris-text-default) );--solaris-toast-icon-color: var( --solaris-toast-custom-icon-color, var(--solaris-text-muted) );--solaris-toast-background: var( --solaris-toast-custom-background, var(--solaris-surface-raised) );--solaris-toast-border-color: var( --solaris-toast-custom-border-color, var(--solaris-border-default) );--solaris-toast-progress-color: var( --solaris-toast-custom-progress-color, var(--solaris-primary-base) )}:host([data-appearance=surface]){--solaris-toast-border-width: 0;--solaris-toast-border-color: transparent}:host([data-appearance=outline]){--solaris-toast-border-width: var(--solaris-border-width-sm)}:host([data-variant=loading]) .solaris-toast__icon{animation:solaris-toast-spin 1s var(--solaris-motion-easing-linear) infinite}@keyframes solaris-toast-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes solaris-toast-enter{0%{opacity:0;transform:translateY(-16px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@media(prefers-reduced-motion:reduce){:host{animation:none}:host([data-variant=loading]) .solaris-toast__icon{animation:none}}:host-context([data-reduced-motion=true]){animation:none}:host([data-reduced-motion=true][data-variant=loading]) .solaris-toast__icon{animation:none}@media(width<=640px){:host{--solaris-toast-width: 100%;--solaris-toast-max-width: 100%}}\n"] }]
|
|
10131
10808
|
}], ctorParameters: () => [], propDecorators: { entry: [{ type: i0.Input, args: [{ isSignal: true, alias: "entry", required: true }] }], dismiss: [{ type: i0.Output, args: ["dismiss"] }], onMouseEnter: [{
|
|
10132
10809
|
type: HostListener,
|
|
10133
10810
|
args: ['mouseenter']
|
|
@@ -10152,14 +10829,14 @@ class SolarisToastContainerComponent {
|
|
|
10152
10829
|
this.toastService.dismiss(id);
|
|
10153
10830
|
}
|
|
10154
10831
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisToastContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10155
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SolarisToastContainerComponent, isStandalone: true, selector: "solaris-toast-container", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-position": "position()" }, classAttribute: "solaris-toast-container" }, ngImport: i0, template: "@for (entry of entries(); track entry.id) {\n <solaris-toast [entry]=\"entry\" (dismiss)=\"dismiss($event)\" />\n}\n", styles: [":host{--solaris-toast-z-index: var(--solaris-z-index-toast);
|
|
10832
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SolarisToastContainerComponent, isStandalone: true, selector: "solaris-toast-container", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-position": "position()" }, classAttribute: "solaris-toast-container" }, ngImport: i0, template: "@for (entry of entries(); track entry.id) {\n <solaris-toast [entry]=\"entry\" (dismiss)=\"dismiss($event)\" />\n}\n", styles: [":host{--solaris-toast-z-index: var(--solaris-z-index-toast);inset:0;display:flex;position:fixed;overflow:hidden;max-height:100dvh;pointer-events:none;box-sizing:border-box;flex-direction:column;gap:var(--solaris-toast-gap);padding:var(--solaris-spacing-4);z-index:var(--solaris-toast-z-index)}:host([data-position=top-start]){align-items:flex-start;justify-content:flex-start}:host([data-position=top-center]){align-items:center;justify-content:flex-start}:host([data-position=top-end]){align-items:flex-end;justify-content:flex-start}:host([data-position=bottom-start]){align-items:flex-start;justify-content:flex-end}:host([data-position=bottom-center]){align-items:center;justify-content:flex-end}:host([data-position=bottom-end]){align-items:flex-end;justify-content:flex-end}@media(width<=640px){:host{padding:var(--solaris-spacing-2);max-width:100vw;width:100%}:host([data-position=top-start]),:host([data-position=top-center]),:host([data-position=top-end]){align-items:stretch}:host([data-position=bottom-start]),:host([data-position=bottom-center]),:host([data-position=bottom-end]){align-items:stretch}}\n"], dependencies: [{ kind: "component", type: i0.forwardRef(() => SolarisToastComponent), selector: "solaris-toast", inputs: ["entry"], outputs: ["dismiss"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10156
10833
|
}
|
|
10157
10834
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisToastContainerComponent, decorators: [{
|
|
10158
10835
|
type: Component,
|
|
10159
10836
|
args: [{ selector: 'solaris-toast-container', standalone: true, imports: [forwardRef(() => SolarisToastComponent)], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
10160
10837
|
class: 'solaris-toast-container',
|
|
10161
10838
|
'[attr.data-position]': 'position()',
|
|
10162
|
-
}, template: "@for (entry of entries(); track entry.id) {\n <solaris-toast [entry]=\"entry\" (dismiss)=\"dismiss($event)\" />\n}\n", styles: [":host{--solaris-toast-z-index: var(--solaris-z-index-toast);
|
|
10839
|
+
}, template: "@for (entry of entries(); track entry.id) {\n <solaris-toast [entry]=\"entry\" (dismiss)=\"dismiss($event)\" />\n}\n", styles: [":host{--solaris-toast-z-index: var(--solaris-z-index-toast);inset:0;display:flex;position:fixed;overflow:hidden;max-height:100dvh;pointer-events:none;box-sizing:border-box;flex-direction:column;gap:var(--solaris-toast-gap);padding:var(--solaris-spacing-4);z-index:var(--solaris-toast-z-index)}:host([data-position=top-start]){align-items:flex-start;justify-content:flex-start}:host([data-position=top-center]){align-items:center;justify-content:flex-start}:host([data-position=top-end]){align-items:flex-end;justify-content:flex-start}:host([data-position=bottom-start]){align-items:flex-start;justify-content:flex-end}:host([data-position=bottom-center]){align-items:center;justify-content:flex-end}:host([data-position=bottom-end]){align-items:flex-end;justify-content:flex-end}@media(width<=640px){:host{padding:var(--solaris-spacing-2);max-width:100vw;width:100%}:host([data-position=top-start]),:host([data-position=top-center]),:host([data-position=top-end]){align-items:stretch}:host([data-position=bottom-start]),:host([data-position=bottom-center]),:host([data-position=bottom-end]){align-items:stretch}}\n"] }]
|
|
10163
10840
|
}], propDecorators: { position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }] } });
|
|
10164
10841
|
|
|
10165
10842
|
const SOLARIS_DIALOG_DATA = new InjectionToken('SolarisDialogData');
|
|
@@ -10198,7 +10875,7 @@ class SolarisDialogActionsComponent {
|
|
|
10198
10875
|
this.actionExecuted.emit(action);
|
|
10199
10876
|
}
|
|
10200
10877
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisDialogActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10201
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SolarisDialogActionsComponent, isStandalone: true, selector: "solaris-dialog-actions", inputs: { actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, stack: { classPropertyName: "stack", publicName: "stack", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionExecuted: "actionExecuted" }, host: { properties: { "attr.data-align": "align()", "attr.data-stack": "stack()" }, classAttribute: "solaris-dialog-actions" }, ngImport: i0, template: "<div class=\"solaris-dialog-actions__inner\">\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n solaris-button\n (click)=\"handleAction(action)\"\n [color]=\"action.color ?? 'neutral'\"\n [disabled]=\"action.disabled ?? false\"\n [appearance]=\"action.appearance ?? 'solid'\"\n >\n {{ action.label }}\n </button>\n }\n</div>\n", styles: [":host{display:block;padding:var(--solaris-spacing-3) var(--solaris-spacing-4)}.solaris-dialog-actions__inner{display:flex;flex-wrap:wrap;gap:var(--solaris-spacing-2)}:host([data-align=start]) .solaris-dialog-actions__inner{justify-content:flex-start}:host([data-align=center]) .solaris-dialog-actions__inner{justify-content:center}:host([data-align=end]) .solaris-dialog-actions__inner{justify-content:flex-end}:host([data-align=space-between]) .solaris-dialog-actions__inner{justify-content:space-between}:host([data-stack=vertical]) .solaris-dialog-actions__inner{flex-direction:column}:host([data-stack=horizontal]) .solaris-dialog-actions__inner{flex-direction:row}\n"], dependencies: [{ kind: "directive", type: SolarisButtonDirective, selector: "[solaris-button]", inputs: ["appearance", "color", "
|
|
10878
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SolarisDialogActionsComponent, isStandalone: true, selector: "solaris-dialog-actions", inputs: { actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, stack: { classPropertyName: "stack", publicName: "stack", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionExecuted: "actionExecuted" }, host: { properties: { "attr.data-align": "align()", "attr.data-stack": "stack()" }, classAttribute: "solaris-dialog-actions" }, ngImport: i0, template: "<div class=\"solaris-dialog-actions__inner\">\n @for (action of actions(); track $index) {\n <button\n type=\"button\"\n solaris-button\n (click)=\"handleAction(action)\"\n [color]=\"action.color ?? 'neutral'\"\n [disabled]=\"action.disabled ?? false\"\n [appearance]=\"action.appearance ?? 'solid'\"\n >\n {{ action.label }}\n </button>\n }\n</div>\n", styles: [":host{display:block;padding:var(--solaris-spacing-3) var(--solaris-spacing-4)}.solaris-dialog-actions__inner{display:flex;flex-wrap:wrap;gap:var(--solaris-spacing-2)}:host([data-align=start]) .solaris-dialog-actions__inner{justify-content:flex-start}:host([data-align=center]) .solaris-dialog-actions__inner{justify-content:center}:host([data-align=end]) .solaris-dialog-actions__inner{justify-content:flex-end}:host([data-align=space-between]) .solaris-dialog-actions__inner{justify-content:space-between}:host([data-stack=vertical]) .solaris-dialog-actions__inner{flex-direction:column}:host([data-stack=horizontal]) .solaris-dialog-actions__inner{flex-direction:row}\n"], dependencies: [{ kind: "directive", type: SolarisButtonDirective, selector: "[solaris-button]", inputs: ["iconPosition", "appearance", "color", "shape", "radius", "density", "fullWidth", "disabled", "loading", "loadingLabelKey", "loadingLabel", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10202
10879
|
}
|
|
10203
10880
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisDialogActionsComponent, decorators: [{
|
|
10204
10881
|
type: Component,
|
|
@@ -13933,5 +14610,5 @@ function provideSolaris(config) {
|
|
|
13933
14610
|
* Generated bundle index. Do not edit.
|
|
13934
14611
|
*/
|
|
13935
14612
|
|
|
13936
|
-
export { SOLARIS_ACCESSIBILITY_CONFIG, SOLARIS_BUILT_IN_ICONS, SOLARIS_DIALOG_CONFIG, SOLARIS_DIALOG_DATA, SOLARIS_DIALOG_REF, SOLARIS_ICONS_CONFIG, SOLARIS_SEGMENTED_CONTROL, SOLARIS_STEPPER, SOLARIS_TABS, SOLARIS_THEME_CONFIG, SOLARIS_TOAST_CONFIG, SOLARIS_TRANSLATE_CONFIG, SolarisAccessibilityService, SolarisAccordionComponent, SolarisAlertActionsComponent, SolarisAlertComponent, SolarisAlertDescriptionDirective, SolarisAlertTitleDirective, SolarisBadgeComponent, SolarisBadgeIconDirective, SolarisBreadcrumbComponent, SolarisButtonDirective, SolarisButtonGroupComponent, SolarisButtonIconDirective, SolarisCardActionsDirective, SolarisCardComponent, SolarisCardContentDirective, SolarisCardDescriptionDirective, SolarisCardFooterDirective, SolarisCardHeaderDirective, SolarisCardMediaDirective, SolarisCardTitleDirective, SolarisCheckboxComponent, SolarisCheckboxGroupComponent, SolarisCollapsibleComponent, SolarisDialogActionsComponent, SolarisDialogComponent, SolarisDialogContainerComponent, SolarisDialogContentComponent, SolarisDialogFlowComponent, SolarisDialogHeaderComponent, SolarisDialogRef, SolarisDialogService, SolarisDialogStepComponent, SolarisDividerComponent, SolarisDividerStackComponent, SolarisDropdownMenuComponent, SolarisDropdownMenuGroupComponent, SolarisDropdownMenuItemComponent, SolarisDropdownMenuLabelComponent, SolarisDropdownMenuTriggerDirective, SolarisDropdownSubmenuComponent, SolarisDropdownSubmenuTriggerComponent, SolarisEditableTabComponent, SolarisEditableTabsComponent, SolarisEmailFieldComponent, SolarisFormErrorComponent, SolarisFormFieldComponent, SolarisFormHintComponent, SolarisFormLabelActionDirective, SolarisFormLabelComponent, SolarisFormPrefixDirective, SolarisFormSuffixDirective, SolarisIconButtonBadgeDirective, SolarisIconButtonDirective, SolarisIconComponent, SolarisIconRegistryService, SolarisInputDirective, SolarisLoadingTextComponent, SolarisMultiSelectComponent, SolarisOptionComponent, SolarisOptionDescriptionDirective, SolarisOptionGroupComponent, SolarisOptionLabelDirective, SolarisOptionLeadingDirective, SolarisOptionMetaDirective, SolarisOptionTrailingDirective, SolarisPasswordFieldComponent, SolarisPopoverDirective, SolarisPopoverPanelComponent, SolarisPopoverTriggerDirective, SolarisProgressComponent, SolarisRadioComponent, SolarisRadioGroupComponent, SolarisSegmentedControlComponent, SolarisSegmentedItemComponent, SolarisSelectComponent, SolarisSkeletonComponent, SolarisSpinnerComponent, SolarisStepComponent, SolarisStepperActionsComponent, SolarisStepperComponent, SolarisStepperContentComponent, SolarisSwitchComponent, SolarisSwitchGroupComponent, SolarisTabComponent, SolarisTabPanelComponent, SolarisTabsComponent, SolarisTextareaDirective, SolarisThemeService, SolarisToastComponent, SolarisToastContainerComponent, SolarisToastService, SolarisTooltipDirective, SolarisTooltipPanelComponent, SolarisTranslatePipe, SolarisTranslateService, SolarisVisuallyHiddenDirective, configureSolarisTesting, nextIdFor, provideSolaris, provideSolarisAccessibilityTesting, provideSolarisTesting, provideSolarisThemeTesting, provideSolarisTranslateTesting, resolveElementId, solarisAllowedDomainsValidator, solarisBlockedDomainsValidator, solarisEmailValidator, solarisPasswordValidator };
|
|
14613
|
+
export { SOLARIS_ACCESSIBILITY_CONFIG, SOLARIS_BUILT_IN_ICONS, SOLARIS_DIALOG_CONFIG, SOLARIS_DIALOG_DATA, SOLARIS_DIALOG_REF, SOLARIS_ICONS_CONFIG, SOLARIS_SEGMENTED_CONTROL, SOLARIS_STEPPER, SOLARIS_TABS, SOLARIS_THEME_CONFIG, SOLARIS_TOAST_CONFIG, SOLARIS_TRANSLATE_CONFIG, SolarisAccessibilityService, SolarisAccordionComponent, SolarisAlertActionsComponent, SolarisAlertComponent, SolarisAlertDescriptionDirective, SolarisAlertTitleDirective, SolarisBadgeComponent, SolarisBadgeIconDirective, SolarisBreadcrumbComponent, SolarisButtonDirective, SolarisButtonGroupComponent, SolarisButtonIconDirective, SolarisCardActionsDirective, SolarisCardComponent, SolarisCardContentDirective, SolarisCardDescriptionDirective, SolarisCardFooterDirective, SolarisCardHeaderDirective, SolarisCardMediaDirective, SolarisCardTitleDirective, SolarisCheckboxComponent, SolarisCheckboxGroupComponent, SolarisCollapsibleComponent, SolarisDialogActionsComponent, SolarisDialogComponent, SolarisDialogContainerComponent, SolarisDialogContentComponent, SolarisDialogFlowComponent, SolarisDialogHeaderComponent, SolarisDialogRef, SolarisDialogService, SolarisDialogStepComponent, SolarisDividerComponent, SolarisDividerStackComponent, SolarisDropdownMenuComponent, SolarisDropdownMenuGroupComponent, SolarisDropdownMenuItemComponent, SolarisDropdownMenuLabelComponent, SolarisDropdownMenuTriggerDirective, SolarisDropdownSubmenuComponent, SolarisDropdownSubmenuTriggerComponent, SolarisEditableTabComponent, SolarisEditableTabsComponent, SolarisEmailFieldComponent, SolarisFormErrorComponent, SolarisFormFieldComponent, SolarisFormHintComponent, SolarisFormLabelActionDirective, SolarisFormLabelComponent, SolarisFormPrefixDirective, SolarisFormSuffixDirective, SolarisIconButtonBadgeDirective, SolarisIconButtonDirective, SolarisIconComponent, SolarisIconRegistryService, SolarisInputDirective, SolarisLoadingTextComponent, SolarisMultiSelectComponent, SolarisOptionComponent, SolarisOptionDescriptionDirective, SolarisOptionGroupComponent, SolarisOptionLabelDirective, SolarisOptionLeadingDirective, SolarisOptionMetaDirective, SolarisOptionTrailingDirective, SolarisPasswordFieldComponent, SolarisPhoneCountryListComponent, SolarisPhoneFieldComponent, SolarisPopoverDirective, SolarisPopoverPanelComponent, SolarisPopoverTriggerDirective, SolarisProgressComponent, SolarisRadioComponent, SolarisRadioGroupComponent, SolarisSegmentedControlComponent, SolarisSegmentedItemComponent, SolarisSelectComponent, SolarisSkeletonComponent, SolarisSpinnerComponent, SolarisStepComponent, SolarisStepperActionsComponent, SolarisStepperComponent, SolarisStepperContentComponent, SolarisSwitchComponent, SolarisSwitchGroupComponent, SolarisTabComponent, SolarisTabPanelComponent, SolarisTabsComponent, SolarisTextareaDirective, SolarisThemeService, SolarisToastComponent, SolarisToastContainerComponent, SolarisToastService, SolarisTooltipDirective, SolarisTooltipPanelComponent, SolarisTranslatePipe, SolarisTranslateService, SolarisVisuallyHiddenDirective, configureSolarisTesting, nextIdFor, provideSolaris, provideSolarisAccessibilityTesting, provideSolarisTesting, provideSolarisThemeTesting, provideSolarisTranslateTesting, resolveElementId, solarisAllowedDomainsValidator, solarisBlockedDomainsValidator, solarisEmailValidator, solarisPasswordValidator, solarisPhoneValidator };
|
|
13937
14614
|
//# sourceMappingURL=educarehq-solaris-ui.mjs.map
|