@educarehq/solaris-ui 0.13.0 → 0.15.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, PLATFORM_ID, Injectable, Pipe, Directive, signal, DestroyRef, DOCUMENT, input, computed, ChangeDetectionStrategy, Component, output, ElementRef, EnvironmentInjector, effect, createComponent, HostListener, contentChild, contentChildren, NgZone, TemplateRef, ViewContainerRef, Injector, viewChild, isDevMode, forwardRef, ChangeDetectorRef, booleanAttribute, numberAttribute, afterNextRender, ApplicationRef, model
|
|
2
|
+
import { InjectionToken, inject, PLATFORM_ID, Injectable, Pipe, Directive, signal, DestroyRef, DOCUMENT, input, computed, ChangeDetectionStrategy, Component, output, ElementRef, EnvironmentInjector, effect, createComponent, HostListener, contentChild, contentChildren, NgZone, TemplateRef, ViewContainerRef, Injector, viewChild, isDevMode, forwardRef, ChangeDetectorRef, booleanAttribute, numberAttribute, afterNextRender, viewChildren, ApplicationRef, model } from '@angular/core';
|
|
3
3
|
import { isPlatformBrowser, NgTemplateOutlet, DOCUMENT as DOCUMENT$1 } from '@angular/common';
|
|
4
4
|
import { FormControlDirective, FormControlName, NgModel, NG_VALUE_ACCESSOR, NgControl, FormsModule } from '@angular/forms';
|
|
5
5
|
import { Overlay, OverlayConfig } from '@angular/cdk/overlay';
|
|
@@ -125,6 +125,9 @@ const SOLARIS_TRANSLATE_DEFAULT_CONFIG = {
|
|
|
125
125
|
'solaris.phone-field.empty': 'No countries available',
|
|
126
126
|
'solaris.phone-field.noResults': 'No results found',
|
|
127
127
|
'solaris.phone-field.country': 'Select country code',
|
|
128
|
+
'solaris.otp-input.required': 'Code is required.',
|
|
129
|
+
'solaris.otp-input.invalid': 'Enter a valid code.',
|
|
130
|
+
'solaris.otp-input.box': 'Digit {{current}} of {{total}}',
|
|
128
131
|
},
|
|
129
132
|
'pt-BR': {
|
|
130
133
|
'solaris.button.loading': 'Carregando...',
|
|
@@ -201,6 +204,9 @@ const SOLARIS_TRANSLATE_DEFAULT_CONFIG = {
|
|
|
201
204
|
'solaris.phone-field.empty': 'Nenhum país disponível',
|
|
202
205
|
'solaris.phone-field.noResults': 'Nenhum resultado encontrado',
|
|
203
206
|
'solaris.phone-field.country': 'Selecionar código do país',
|
|
207
|
+
'solaris.otp-input.required': 'O código é obrigatório.',
|
|
208
|
+
'solaris.otp-input.invalid': 'Insira um código válido.',
|
|
209
|
+
'solaris.otp-input.box': 'Dígito {{current}} de {{total}}',
|
|
204
210
|
},
|
|
205
211
|
},
|
|
206
212
|
useBrowserLocale: true,
|
|
@@ -923,6 +929,21 @@ const NAVIGATION_ICONS = [
|
|
|
923
929
|
{ type: 'path', d: 'm14.5 4-5 16' },
|
|
924
930
|
],
|
|
925
931
|
},
|
|
932
|
+
{
|
|
933
|
+
name: 'plane',
|
|
934
|
+
viewBox: '0 0 24 24',
|
|
935
|
+
fill: 'none',
|
|
936
|
+
stroke: 'currentColor',
|
|
937
|
+
strokeWidth: 2,
|
|
938
|
+
strokeLinecap: 'round',
|
|
939
|
+
strokeLinejoin: 'round',
|
|
940
|
+
elements: [
|
|
941
|
+
{
|
|
942
|
+
type: 'path',
|
|
943
|
+
d: 'M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z',
|
|
944
|
+
},
|
|
945
|
+
],
|
|
946
|
+
},
|
|
926
947
|
];
|
|
927
948
|
|
|
928
949
|
const ACTIONS_ICONS = [
|
|
@@ -1265,6 +1286,92 @@ const ACTIONS_ICONS = [
|
|
|
1265
1286
|
{ type: 'path', d: 'M7 11V7a5 5 0 0110 0v4' },
|
|
1266
1287
|
],
|
|
1267
1288
|
},
|
|
1289
|
+
{
|
|
1290
|
+
name: 'key',
|
|
1291
|
+
viewBox: '0 0 24 24',
|
|
1292
|
+
fill: 'none',
|
|
1293
|
+
stroke: 'currentColor',
|
|
1294
|
+
strokeWidth: 2,
|
|
1295
|
+
strokeLinecap: 'round',
|
|
1296
|
+
strokeLinejoin: 'round',
|
|
1297
|
+
elements: [
|
|
1298
|
+
{
|
|
1299
|
+
type: 'path',
|
|
1300
|
+
d: 'M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z',
|
|
1301
|
+
},
|
|
1302
|
+
{ type: 'circle', cx: 16.5, cy: 7.5, r: 0.5, fill: 'currentColor' },
|
|
1303
|
+
],
|
|
1304
|
+
},
|
|
1305
|
+
{
|
|
1306
|
+
name: 'rocket',
|
|
1307
|
+
viewBox: '0 0 24 24',
|
|
1308
|
+
fill: 'none',
|
|
1309
|
+
stroke: 'currentColor',
|
|
1310
|
+
strokeWidth: 2,
|
|
1311
|
+
strokeLinecap: 'round',
|
|
1312
|
+
strokeLinejoin: 'round',
|
|
1313
|
+
elements: [
|
|
1314
|
+
{ type: 'path', d: 'M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5' },
|
|
1315
|
+
{
|
|
1316
|
+
type: 'path',
|
|
1317
|
+
d: 'M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09',
|
|
1318
|
+
},
|
|
1319
|
+
{
|
|
1320
|
+
type: 'path',
|
|
1321
|
+
d: 'M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z',
|
|
1322
|
+
},
|
|
1323
|
+
{ type: 'path', d: 'M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05' },
|
|
1324
|
+
],
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
name: 'save',
|
|
1328
|
+
viewBox: '0 0 24 24',
|
|
1329
|
+
fill: 'none',
|
|
1330
|
+
stroke: 'currentColor',
|
|
1331
|
+
strokeWidth: 2,
|
|
1332
|
+
strokeLinecap: 'round',
|
|
1333
|
+
strokeLinejoin: 'round',
|
|
1334
|
+
elements: [
|
|
1335
|
+
{
|
|
1336
|
+
type: 'path',
|
|
1337
|
+
d: 'M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z',
|
|
1338
|
+
},
|
|
1339
|
+
{ type: 'path', d: 'M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7' },
|
|
1340
|
+
{ type: 'path', d: 'M7 3v4a1 1 0 0 0 1 1h7' },
|
|
1341
|
+
],
|
|
1342
|
+
},
|
|
1343
|
+
{
|
|
1344
|
+
name: 'star',
|
|
1345
|
+
viewBox: '0 0 24 24',
|
|
1346
|
+
fill: 'none',
|
|
1347
|
+
stroke: 'currentColor',
|
|
1348
|
+
strokeWidth: 2,
|
|
1349
|
+
strokeLinecap: 'round',
|
|
1350
|
+
strokeLinejoin: 'round',
|
|
1351
|
+
elements: [
|
|
1352
|
+
{
|
|
1353
|
+
type: 'path',
|
|
1354
|
+
d: 'M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z',
|
|
1355
|
+
},
|
|
1356
|
+
],
|
|
1357
|
+
},
|
|
1358
|
+
{
|
|
1359
|
+
name: 'star-plus',
|
|
1360
|
+
viewBox: '0 0 24 24',
|
|
1361
|
+
fill: 'none',
|
|
1362
|
+
stroke: 'currentColor',
|
|
1363
|
+
strokeWidth: 2,
|
|
1364
|
+
strokeLinecap: 'round',
|
|
1365
|
+
strokeLinejoin: 'round',
|
|
1366
|
+
elements: [
|
|
1367
|
+
{
|
|
1368
|
+
type: 'path',
|
|
1369
|
+
d: 'M11.013 18.582 6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.12 2.12 0 0 0 1.597-1.16l2.309-4.679a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904L20 11.5',
|
|
1370
|
+
},
|
|
1371
|
+
{ type: 'path', d: 'M15 18h6' },
|
|
1372
|
+
{ type: 'path', d: 'M18 15v6' },
|
|
1373
|
+
],
|
|
1374
|
+
},
|
|
1268
1375
|
];
|
|
1269
1376
|
|
|
1270
1377
|
const STATUS_ICONS = [
|
|
@@ -1748,6 +1855,74 @@ const DATA_ICONS = [
|
|
|
1748
1855
|
{ type: 'line', x1: 6, x2: 6.01, y1: 18, y2: 18 },
|
|
1749
1856
|
],
|
|
1750
1857
|
},
|
|
1858
|
+
{
|
|
1859
|
+
name: 'package',
|
|
1860
|
+
viewBox: '0 0 24 24',
|
|
1861
|
+
fill: 'none',
|
|
1862
|
+
stroke: 'currentColor',
|
|
1863
|
+
strokeWidth: 2,
|
|
1864
|
+
strokeLinecap: 'round',
|
|
1865
|
+
strokeLinejoin: 'round',
|
|
1866
|
+
elements: [
|
|
1867
|
+
{
|
|
1868
|
+
type: 'path',
|
|
1869
|
+
d: 'M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z',
|
|
1870
|
+
},
|
|
1871
|
+
{ type: 'path', d: 'M12 22V12' },
|
|
1872
|
+
{ type: 'polyline', points: '3.29 7 12 12 20.71 7' },
|
|
1873
|
+
{ type: 'path', d: 'm7.5 4.27 9 5.15' },
|
|
1874
|
+
],
|
|
1875
|
+
},
|
|
1876
|
+
{
|
|
1877
|
+
name: 'squared-text',
|
|
1878
|
+
viewBox: '0 0 24 24',
|
|
1879
|
+
fill: 'none',
|
|
1880
|
+
stroke: 'currentColor',
|
|
1881
|
+
strokeWidth: 2,
|
|
1882
|
+
strokeLinecap: 'round',
|
|
1883
|
+
strokeLinejoin: 'round',
|
|
1884
|
+
elements: [
|
|
1885
|
+
{ type: 'rect', x: 3, y: 3, width: 18, height: 18, rx: 2 },
|
|
1886
|
+
{ type: 'path', d: 'M7 8h8' },
|
|
1887
|
+
{ type: 'path', d: 'M7 12h10' },
|
|
1888
|
+
{ type: 'path', d: 'M7 16h6' },
|
|
1889
|
+
],
|
|
1890
|
+
},
|
|
1891
|
+
{
|
|
1892
|
+
name: 'notepad',
|
|
1893
|
+
viewBox: '0 0 24 24',
|
|
1894
|
+
fill: 'none',
|
|
1895
|
+
stroke: 'currentColor',
|
|
1896
|
+
strokeWidth: 2,
|
|
1897
|
+
strokeLinecap: 'round',
|
|
1898
|
+
strokeLinejoin: 'round',
|
|
1899
|
+
elements: [
|
|
1900
|
+
{ type: 'path', d: 'M8 2v4' },
|
|
1901
|
+
{ type: 'path', d: 'M12 2v4' },
|
|
1902
|
+
{ type: 'path', d: 'M16 2v4' },
|
|
1903
|
+
{ type: 'rect', x: 4, y: 4, width: 16, height: 18, rx: 2 },
|
|
1904
|
+
{ type: 'path', d: 'M8 10h6' },
|
|
1905
|
+
{ type: 'path', d: 'M8 14h8' },
|
|
1906
|
+
{ type: 'path', d: 'M8 18h5' },
|
|
1907
|
+
],
|
|
1908
|
+
},
|
|
1909
|
+
{
|
|
1910
|
+
name: 'podium',
|
|
1911
|
+
viewBox: '0 0 24 24',
|
|
1912
|
+
fill: 'none',
|
|
1913
|
+
stroke: 'currentColor',
|
|
1914
|
+
strokeWidth: 2,
|
|
1915
|
+
strokeLinecap: 'round',
|
|
1916
|
+
strokeLinejoin: 'round',
|
|
1917
|
+
elements: [
|
|
1918
|
+
{ type: 'path', d: 'M12 6V2h-1' },
|
|
1919
|
+
{
|
|
1920
|
+
type: 'path',
|
|
1921
|
+
d: 'M9 15a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1',
|
|
1922
|
+
},
|
|
1923
|
+
{ type: 'path', d: 'M9 21V11a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v10' },
|
|
1924
|
+
],
|
|
1925
|
+
},
|
|
1751
1926
|
];
|
|
1752
1927
|
|
|
1753
1928
|
const COMMUNICATION_ICONS = [
|
|
@@ -1931,6 +2106,22 @@ const COMMUNICATION_ICONS = [
|
|
|
1931
2106
|
},
|
|
1932
2107
|
],
|
|
1933
2108
|
},
|
|
2109
|
+
{
|
|
2110
|
+
name: 'send',
|
|
2111
|
+
viewBox: '0 0 24 24',
|
|
2112
|
+
fill: 'none',
|
|
2113
|
+
stroke: 'currentColor',
|
|
2114
|
+
strokeWidth: 2,
|
|
2115
|
+
strokeLinecap: 'round',
|
|
2116
|
+
strokeLinejoin: 'round',
|
|
2117
|
+
elements: [
|
|
2118
|
+
{
|
|
2119
|
+
type: 'path',
|
|
2120
|
+
d: 'M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z',
|
|
2121
|
+
},
|
|
2122
|
+
{ type: 'path', d: 'm21.854 2.147-10.94 10.939' },
|
|
2123
|
+
],
|
|
2124
|
+
},
|
|
1934
2125
|
];
|
|
1935
2126
|
|
|
1936
2127
|
const MEDIA_ICONS = [
|
|
@@ -1997,6 +2188,22 @@ const MEDIA_ICONS = [
|
|
|
1997
2188
|
{ type: 'path', d: 'M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12' },
|
|
1998
2189
|
],
|
|
1999
2190
|
},
|
|
2191
|
+
{
|
|
2192
|
+
name: 'eject',
|
|
2193
|
+
viewBox: '0 0 24 24',
|
|
2194
|
+
fill: 'none',
|
|
2195
|
+
stroke: 'currentColor',
|
|
2196
|
+
strokeWidth: 2,
|
|
2197
|
+
strokeLinecap: 'round',
|
|
2198
|
+
strokeLinejoin: 'round',
|
|
2199
|
+
elements: [
|
|
2200
|
+
{
|
|
2201
|
+
type: 'path',
|
|
2202
|
+
d: 'M4 13a1 1 0 0 1-.72-1.695l7.257-7.668a2 2 0 0 1 2.926 0l7.256 7.668A1 1 0 0 1 20 13z',
|
|
2203
|
+
},
|
|
2204
|
+
{ type: 'rect', x: 3, y: 17, width: 18, height: 4, rx: 1 },
|
|
2205
|
+
],
|
|
2206
|
+
},
|
|
2000
2207
|
];
|
|
2001
2208
|
|
|
2002
2209
|
const BRAND_ICONS = [
|
|
@@ -9715,6 +9922,7 @@ function getExampleNumberFor(country) {
|
|
|
9715
9922
|
class SolarisPhoneFieldComponent {
|
|
9716
9923
|
translateService = inject(SolarisTranslateService);
|
|
9717
9924
|
countryListFactory = inject(SOLARIS_PHONE_COUNTRY_LIST);
|
|
9925
|
+
themeService = inject(SolarisThemeService);
|
|
9718
9926
|
inputElementRef = viewChild('inputElement', ...(ngDevMode ? [{ debugName: "inputElementRef" }] : /* istanbul ignore next */ []));
|
|
9719
9927
|
popoverTrigger = viewChild(SolarisPopoverTriggerDirective, ...(ngDevMode ? [{ debugName: "popoverTrigger" }] : /* istanbul ignore next */ []));
|
|
9720
9928
|
projectedPrefix = contentChild(SolarisFormPrefixDirective, ...(ngDevMode ? [{ debugName: "projectedPrefix" }] : /* istanbul ignore next */ []));
|
|
@@ -9818,6 +10026,9 @@ class SolarisPhoneFieldComponent {
|
|
|
9818
10026
|
isEffectivelyDisabled = computed(() => {
|
|
9819
10027
|
return this.disabled() || this.internalDisabled();
|
|
9820
10028
|
}, ...(ngDevMode ? [{ debugName: "isEffectivelyDisabled" }] : /* istanbul ignore next */ []));
|
|
10029
|
+
effectiveDensity = computed(() => {
|
|
10030
|
+
return this.density() ?? this.themeService.density;
|
|
10031
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveDensity" }] : /* istanbul ignore next */ []));
|
|
9821
10032
|
isEffectivelyReadonly = computed(() => {
|
|
9822
10033
|
return this.readonly();
|
|
9823
10034
|
}, ...(ngDevMode ? [{ debugName: "isEffectivelyReadonly" }] : /* istanbul ignore next */ []));
|
|
@@ -10075,13 +10286,13 @@ class SolarisPhoneFieldComponent {
|
|
|
10075
10286
|
this.translateWithDefault(fallbackKey, fallbackDefault));
|
|
10076
10287
|
}
|
|
10077
10288
|
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: [
|
|
10289
|
+
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", "attr.data-density": "effectiveDensity()" }, classAttribute: "solaris-phone-field" }, providers: [
|
|
10079
10290
|
{
|
|
10080
10291
|
provide: NG_VALUE_ACCESSOR,
|
|
10081
10292
|
useExisting: forwardRef(() => SolarisPhoneFieldComponent),
|
|
10082
10293
|
multi: true,
|
|
10083
10294
|
},
|
|
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
|
|
10295
|
+
], 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);--solaris-phone-field-country-font-size: var(--solaris-font-size-sm);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-phone-field-country-font-size);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-phone-field-flag-size);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-phone-field-country-font-size);line-height:var(--solaris-line-height-md);margin-inline-end:var(--solaris-spacing-1)}:host([data-density=compact]){--solaris-phone-field-country-font-size: var(--solaris-density-font-size);--solaris-phone-field-country-padding-inline: var( --solaris-density-padding-sm );--solaris-phone-field-flag-size: var(--solaris-font-size-xs);--solaris-phone-field-chevron-size: 10px}:host([data-density=normal]){--solaris-phone-field-country-font-size: var(--solaris-density-font-size);--solaris-phone-field-country-padding-inline: var( --solaris-density-padding-md );--solaris-phone-field-flag-size: var(--solaris-font-size-sm);--solaris-phone-field-chevron-size: var(--solaris-font-size-xs)}:host([data-density=comfortable]){--solaris-phone-field-country-font-size: var(--solaris-density-font-size);--solaris-phone-field-country-padding-inline: var( --solaris-density-padding-lg );--solaris-phone-field-flag-size: var(--solaris-font-size-md);--solaris-phone-field-chevron-size: var(--solaris-font-size-sm)}@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
10296
|
}
|
|
10086
10297
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisPhoneFieldComponent, decorators: [{
|
|
10087
10298
|
type: Component,
|
|
@@ -10105,7 +10316,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
10105
10316
|
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
10106
10317
|
class: 'solaris-phone-field',
|
|
10107
10318
|
'[attr.data-open]': 'panelOpen() ? "" : null',
|
|
10108
|
-
|
|
10319
|
+
'[attr.data-density]': 'effectiveDensity()',
|
|
10320
|
+
}, 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);--solaris-phone-field-country-font-size: var(--solaris-font-size-sm);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-phone-field-country-font-size);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-phone-field-flag-size);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-phone-field-country-font-size);line-height:var(--solaris-line-height-md);margin-inline-end:var(--solaris-spacing-1)}:host([data-density=compact]){--solaris-phone-field-country-font-size: var(--solaris-density-font-size);--solaris-phone-field-country-padding-inline: var( --solaris-density-padding-sm );--solaris-phone-field-flag-size: var(--solaris-font-size-xs);--solaris-phone-field-chevron-size: 10px}:host([data-density=normal]){--solaris-phone-field-country-font-size: var(--solaris-density-font-size);--solaris-phone-field-country-padding-inline: var( --solaris-density-padding-md );--solaris-phone-field-flag-size: var(--solaris-font-size-sm);--solaris-phone-field-chevron-size: var(--solaris-font-size-xs)}:host([data-density=comfortable]){--solaris-phone-field-country-font-size: var(--solaris-density-font-size);--solaris-phone-field-country-padding-inline: var( --solaris-density-padding-lg );--solaris-phone-field-flag-size: var(--solaris-font-size-md);--solaris-phone-field-chevron-size: var(--solaris-font-size-sm)}@media(prefers-reduced-motion:reduce){.solaris-phone-field__chevron{transition:none}}\n"] }]
|
|
10109
10321
|
}], 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
10322
|
|
|
10111
10323
|
function solarisPhoneValidator(country) {
|
|
@@ -10122,6 +10334,405 @@ function solarisPhoneValidator(country) {
|
|
|
10122
10334
|
};
|
|
10123
10335
|
}
|
|
10124
10336
|
|
|
10337
|
+
// SECURITY_EXCEPTION_FILE: nativeElement.focus() required to move focus between OTP boxes on typing/navigation.
|
|
10338
|
+
// Standard DOM method used by Angular CDK. ElementRef SSR-safe.
|
|
10339
|
+
// SECURITY_EXCEPTION_FILE: nativeElement.value read in onBoxInput to obtain the raw box value.
|
|
10340
|
+
const MASK_CHAR = '•';
|
|
10341
|
+
class SolarisOtpInputComponent extends SolarisFormControl {
|
|
10342
|
+
elementRef = inject(ElementRef);
|
|
10343
|
+
translateService = inject(SolarisTranslateService);
|
|
10344
|
+
themeService = inject(SolarisThemeService);
|
|
10345
|
+
boxRefs = viewChildren('box', ...(ngDevMode ? [{ debugName: "boxRefs" }] : /* istanbul ignore next */ []));
|
|
10346
|
+
hintKey = input(...(ngDevMode ? [undefined, { debugName: "hintKey" }] : /* istanbul ignore next */ []));
|
|
10347
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
10348
|
+
labelKey = input(...(ngDevMode ? [undefined, { debugName: "labelKey" }] : /* istanbul ignore next */ []));
|
|
10349
|
+
errorKey = input(...(ngDevMode ? [undefined, { debugName: "errorKey" }] : /* istanbul ignore next */ []));
|
|
10350
|
+
value = input('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
10351
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
10352
|
+
error = input('', ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
10353
|
+
requiredError = input(...(ngDevMode ? [undefined, { debugName: "requiredError" }] : /* istanbul ignore next */ []));
|
|
10354
|
+
invalidError = input(...(ngDevMode ? [undefined, { debugName: "invalidError" }] : /* istanbul ignore next */ []));
|
|
10355
|
+
requiredErrorKey = input(...(ngDevMode ? [undefined, { debugName: "requiredErrorKey" }] : /* istanbul ignore next */ []));
|
|
10356
|
+
invalidErrorKey = input(...(ngDevMode ? [undefined, { debugName: "invalidErrorKey" }] : /* istanbul ignore next */ []));
|
|
10357
|
+
requiredInput = input(false, { ...(ngDevMode ? { debugName: "requiredInput" } : /* istanbul ignore next */ {}), alias: 'required' });
|
|
10358
|
+
optional = input(false, ...(ngDevMode ? [{ debugName: "optional" }] : /* istanbul ignore next */ []));
|
|
10359
|
+
disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {}), alias: 'disabled' });
|
|
10360
|
+
readonlyInput = input(false, { ...(ngDevMode ? { debugName: "readonlyInput" } : /* istanbul ignore next */ {}), alias: 'readonly' });
|
|
10361
|
+
manualInvalid = input(undefined, { ...(ngDevMode ? { debugName: "manualInvalid" } : /* istanbul ignore next */ {}), alias: 'invalid' });
|
|
10362
|
+
maxLength = input(12, ...(ngDevMode ? [{ debugName: "maxLength" }] : /* istanbul ignore next */ []));
|
|
10363
|
+
minLength = input(1, ...(ngDevMode ? [{ debugName: "minLength" }] : /* istanbul ignore next */ []));
|
|
10364
|
+
charType = input('numeric', ...(ngDevMode ? [{ debugName: "charType" }] : /* istanbul ignore next */ []));
|
|
10365
|
+
masked = input(false, ...(ngDevMode ? [{ debugName: "masked" }] : /* istanbul ignore next */ []));
|
|
10366
|
+
separatorEvery = input(0, ...(ngDevMode ? [{ debugName: "separatorEvery" }] : /* istanbul ignore next */ []));
|
|
10367
|
+
autoFocus = input(false, ...(ngDevMode ? [{ debugName: "autoFocus" }] : /* istanbul ignore next */ []));
|
|
10368
|
+
appearance = input('outline', ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
10369
|
+
density = input(...(ngDevMode ? [undefined, { debugName: "density" }] : /* istanbul ignore next */ []));
|
|
10370
|
+
radius = input('md', ...(ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []));
|
|
10371
|
+
valueChange = output();
|
|
10372
|
+
completed = output();
|
|
10373
|
+
boxChars = signal([], ...(ngDevMode ? [{ debugName: "boxChars" }] : /* istanbul ignore next */ []));
|
|
10374
|
+
internalDisabled = signal(false, ...(ngDevMode ? [{ debugName: "internalDisabled" }] : /* istanbul ignore next */ []));
|
|
10375
|
+
internalFocused = signal(false, ...(ngDevMode ? [{ debugName: "internalFocused" }] : /* istanbul ignore next */ []));
|
|
10376
|
+
touched = signal(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
10377
|
+
dirty = signal(false, ...(ngDevMode ? [{ debugName: "dirty" }] : /* istanbul ignore next */ []));
|
|
10378
|
+
focusedIndex = signal(-1, ...(ngDevMode ? [{ debugName: "focusedIndex" }] : /* istanbul ignore next */ []));
|
|
10379
|
+
_describedByIds = signal([], ...(ngDevMode ? [{ debugName: "_describedByIds" }] : /* istanbul ignore next */ []));
|
|
10380
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
10381
|
+
onChange = () => { };
|
|
10382
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
10383
|
+
onTouched = () => { };
|
|
10384
|
+
elementId = computed(() => {
|
|
10385
|
+
return resolveElementId(this.elementRef, 'solaris-otp-input');
|
|
10386
|
+
}, ...(ngDevMode ? [{ debugName: "elementId" }] : /* istanbul ignore next */ []));
|
|
10387
|
+
effectiveDensity = computed(() => {
|
|
10388
|
+
return this.density() ?? this.themeService.density;
|
|
10389
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveDensity" }] : /* istanbul ignore next */ []));
|
|
10390
|
+
isEffectivelyDisabled = computed(() => {
|
|
10391
|
+
return this.disabledInput() || this.internalDisabled();
|
|
10392
|
+
}, ...(ngDevMode ? [{ debugName: "isEffectivelyDisabled" }] : /* istanbul ignore next */ []));
|
|
10393
|
+
isEffectivelyReadonly = computed(() => {
|
|
10394
|
+
return this.readonlyInput();
|
|
10395
|
+
}, ...(ngDevMode ? [{ debugName: "isEffectivelyReadonly" }] : /* istanbul ignore next */ []));
|
|
10396
|
+
inputmode = computed(() => {
|
|
10397
|
+
return this.charType() === 'numeric' ? 'numeric' : 'text';
|
|
10398
|
+
}, ...(ngDevMode ? [{ debugName: "inputmode" }] : /* istanbul ignore next */ []));
|
|
10399
|
+
boxes = computed(() => {
|
|
10400
|
+
const masked = this.masked();
|
|
10401
|
+
return this.boxChars().map((char) => (masked && char ? MASK_CHAR : char));
|
|
10402
|
+
}, ...(ngDevMode ? [{ debugName: "boxes" }] : /* istanbul ignore next */ []));
|
|
10403
|
+
valueString = computed(() => {
|
|
10404
|
+
return this.boxChars().join('');
|
|
10405
|
+
}, ...(ngDevMode ? [{ debugName: "valueString" }] : /* istanbul ignore next */ []));
|
|
10406
|
+
groupAriaLabel = computed(() => {
|
|
10407
|
+
const key = this.labelKey();
|
|
10408
|
+
if (key) {
|
|
10409
|
+
return this.translateService.translate(key) || this.label() || '';
|
|
10410
|
+
}
|
|
10411
|
+
return this.label() ?? '';
|
|
10412
|
+
}, ...(ngDevMode ? [{ debugName: "groupAriaLabel" }] : /* istanbul ignore next */ []));
|
|
10413
|
+
ariaDescribedBy = computed(() => {
|
|
10414
|
+
const ids = this._describedByIds();
|
|
10415
|
+
return ids.length > 0 ? ids.join(' ') : null;
|
|
10416
|
+
}, ...(ngDevMode ? [{ debugName: "ariaDescribedBy" }] : /* istanbul ignore next */ []));
|
|
10417
|
+
computedError = computed(() => {
|
|
10418
|
+
const manualError = this.error() || this.translateKey(this.errorKey());
|
|
10419
|
+
if (manualError)
|
|
10420
|
+
return manualError;
|
|
10421
|
+
const isTouchedOrDirty = this.touched() || this.dirty();
|
|
10422
|
+
if (!isTouchedOrDirty || this.internalFocused())
|
|
10423
|
+
return '';
|
|
10424
|
+
const value = this.valueString();
|
|
10425
|
+
if (!value) {
|
|
10426
|
+
if (this.requiredInput()) {
|
|
10427
|
+
return this.buildError(this.requiredError(), this.requiredErrorKey(), 'solaris.otp-input.required', 'Code is required.');
|
|
10428
|
+
}
|
|
10429
|
+
return '';
|
|
10430
|
+
}
|
|
10431
|
+
if (value.length < this.minLength()) {
|
|
10432
|
+
return this.buildError(this.invalidError(), this.invalidErrorKey(), 'solaris.otp-input.invalid', 'Enter a valid code.');
|
|
10433
|
+
}
|
|
10434
|
+
return '';
|
|
10435
|
+
}, ...(ngDevMode ? [{ debugName: "computedError" }] : /* istanbul ignore next */ []));
|
|
10436
|
+
isFieldInvalid = computed(() => {
|
|
10437
|
+
const manual = this.manualInvalid();
|
|
10438
|
+
if (manual !== undefined) {
|
|
10439
|
+
return manual;
|
|
10440
|
+
}
|
|
10441
|
+
if (this.internalFocused()) {
|
|
10442
|
+
return false;
|
|
10443
|
+
}
|
|
10444
|
+
const isTouchedOrDirty = this.touched() || this.dirty();
|
|
10445
|
+
if (!isTouchedOrDirty) {
|
|
10446
|
+
return false;
|
|
10447
|
+
}
|
|
10448
|
+
return !!this.computedError();
|
|
10449
|
+
}, ...(ngDevMode ? [{ debugName: "isFieldInvalid" }] : /* istanbul ignore next */ []));
|
|
10450
|
+
constructor() {
|
|
10451
|
+
super();
|
|
10452
|
+
this.boxChars.set(this.emptyChars());
|
|
10453
|
+
effect(() => {
|
|
10454
|
+
const length = this.maxLength();
|
|
10455
|
+
const current = this.boxChars();
|
|
10456
|
+
if (current.length !== length) {
|
|
10457
|
+
const resized = Array.from({ length }, (_, index) => current[index] ?? '');
|
|
10458
|
+
this.boxChars.set(resized);
|
|
10459
|
+
}
|
|
10460
|
+
});
|
|
10461
|
+
effect(() => {
|
|
10462
|
+
const value = this.value();
|
|
10463
|
+
if (value !== this.lastAppliedValue) {
|
|
10464
|
+
this.lastAppliedValue = value;
|
|
10465
|
+
this.boxChars.set(this.distributeValue(value));
|
|
10466
|
+
}
|
|
10467
|
+
});
|
|
10468
|
+
}
|
|
10469
|
+
lastAppliedValue = '';
|
|
10470
|
+
get id() {
|
|
10471
|
+
return this.elementId();
|
|
10472
|
+
}
|
|
10473
|
+
get focused() {
|
|
10474
|
+
return this.internalFocused();
|
|
10475
|
+
}
|
|
10476
|
+
get disabled() {
|
|
10477
|
+
return this.isEffectivelyDisabled();
|
|
10478
|
+
}
|
|
10479
|
+
get readonly() {
|
|
10480
|
+
return this.isEffectivelyReadonly();
|
|
10481
|
+
}
|
|
10482
|
+
get invalid() {
|
|
10483
|
+
return this.isFieldInvalid();
|
|
10484
|
+
}
|
|
10485
|
+
get required() {
|
|
10486
|
+
return this.requiredInput();
|
|
10487
|
+
}
|
|
10488
|
+
get describedByIds() {
|
|
10489
|
+
return this._describedByIds();
|
|
10490
|
+
}
|
|
10491
|
+
setDescribedByIds(ids) {
|
|
10492
|
+
this._describedByIds.set([...ids]);
|
|
10493
|
+
}
|
|
10494
|
+
focus() {
|
|
10495
|
+
const index = this.boxChars().findIndex((char) => !char);
|
|
10496
|
+
this.focusBox(index >= 0 ? index : 0);
|
|
10497
|
+
}
|
|
10498
|
+
ngAfterViewInit() {
|
|
10499
|
+
if (this.autoFocus()) {
|
|
10500
|
+
this.focusBox(0);
|
|
10501
|
+
}
|
|
10502
|
+
}
|
|
10503
|
+
writeValue(value) {
|
|
10504
|
+
this.boxChars.set(this.distributeValue(value));
|
|
10505
|
+
}
|
|
10506
|
+
registerOnChange(fn) {
|
|
10507
|
+
this.onChange = fn;
|
|
10508
|
+
}
|
|
10509
|
+
registerOnTouched(fn) {
|
|
10510
|
+
this.onTouched = fn;
|
|
10511
|
+
}
|
|
10512
|
+
setDisabledState(isDisabled) {
|
|
10513
|
+
this.internalDisabled.set(isDisabled);
|
|
10514
|
+
}
|
|
10515
|
+
onBoxInput(event, index) {
|
|
10516
|
+
const target = event.target;
|
|
10517
|
+
const raw = target.value;
|
|
10518
|
+
if (!this.dirty()) {
|
|
10519
|
+
this.dirty.set(true);
|
|
10520
|
+
}
|
|
10521
|
+
const filtered = this.filterChars(raw);
|
|
10522
|
+
const chars = this.currentChars();
|
|
10523
|
+
let cursor = index;
|
|
10524
|
+
for (const char of filtered) {
|
|
10525
|
+
if (cursor >= this.maxLength())
|
|
10526
|
+
break;
|
|
10527
|
+
chars[cursor] = char;
|
|
10528
|
+
cursor++;
|
|
10529
|
+
}
|
|
10530
|
+
this.commitValue(chars);
|
|
10531
|
+
target.value = chars[index] ?? '';
|
|
10532
|
+
const next = cursor < this.maxLength() ? cursor : this.maxLength() - 1;
|
|
10533
|
+
this.focusBox(next);
|
|
10534
|
+
}
|
|
10535
|
+
onBoxKeydown(event, index) {
|
|
10536
|
+
switch (event.key) {
|
|
10537
|
+
case 'Backspace':
|
|
10538
|
+
event.preventDefault();
|
|
10539
|
+
this.handleBackspace(index);
|
|
10540
|
+
break;
|
|
10541
|
+
case 'Delete':
|
|
10542
|
+
event.preventDefault();
|
|
10543
|
+
this.handleDelete(index);
|
|
10544
|
+
break;
|
|
10545
|
+
case 'ArrowLeft':
|
|
10546
|
+
event.preventDefault();
|
|
10547
|
+
this.focusBox(index - 1);
|
|
10548
|
+
break;
|
|
10549
|
+
case 'ArrowRight':
|
|
10550
|
+
event.preventDefault();
|
|
10551
|
+
this.focusBox(index + 1);
|
|
10552
|
+
break;
|
|
10553
|
+
case 'Home':
|
|
10554
|
+
event.preventDefault();
|
|
10555
|
+
this.focusBox(0);
|
|
10556
|
+
break;
|
|
10557
|
+
case 'End':
|
|
10558
|
+
event.preventDefault();
|
|
10559
|
+
this.focusBox(this.maxLength() - 1);
|
|
10560
|
+
break;
|
|
10561
|
+
case 'Enter':
|
|
10562
|
+
event.preventDefault();
|
|
10563
|
+
break;
|
|
10564
|
+
}
|
|
10565
|
+
}
|
|
10566
|
+
onBoxPaste(event, index) {
|
|
10567
|
+
event.preventDefault();
|
|
10568
|
+
const text = event.clipboardData?.getData('text') ?? '';
|
|
10569
|
+
if (!text)
|
|
10570
|
+
return;
|
|
10571
|
+
const filtered = this.filterChars(text);
|
|
10572
|
+
const chars = this.currentChars();
|
|
10573
|
+
let cursor = index;
|
|
10574
|
+
for (const char of filtered) {
|
|
10575
|
+
if (cursor >= this.maxLength())
|
|
10576
|
+
break;
|
|
10577
|
+
chars[cursor] = char;
|
|
10578
|
+
cursor++;
|
|
10579
|
+
}
|
|
10580
|
+
this.commitValue(chars);
|
|
10581
|
+
this.focusBox(cursor < this.maxLength() ? cursor : this.maxLength() - 1);
|
|
10582
|
+
}
|
|
10583
|
+
onBoxFocus(index) {
|
|
10584
|
+
this.internalFocused.set(true);
|
|
10585
|
+
this.focusedIndex.set(index);
|
|
10586
|
+
}
|
|
10587
|
+
onBoxBlur() {
|
|
10588
|
+
this.internalFocused.set(false);
|
|
10589
|
+
this.focusedIndex.set(-1);
|
|
10590
|
+
this.markAsTouched();
|
|
10591
|
+
}
|
|
10592
|
+
boxAriaLabel(index) {
|
|
10593
|
+
return this.translateWithDefault('solaris.otp-input.box', `Digit ${index + 1} of ${this.maxLength()}`, { current: index + 1, total: this.maxLength() });
|
|
10594
|
+
}
|
|
10595
|
+
showSeparatorAfter(index) {
|
|
10596
|
+
const every = this.separatorEvery();
|
|
10597
|
+
return (every > 0 && (index + 1) % every === 0 && index < this.maxLength() - 1);
|
|
10598
|
+
}
|
|
10599
|
+
currentChars() {
|
|
10600
|
+
return [...this.boxChars()];
|
|
10601
|
+
}
|
|
10602
|
+
commitValue(chars) {
|
|
10603
|
+
this.boxChars.set([...chars]);
|
|
10604
|
+
const newValue = chars.join('');
|
|
10605
|
+
this.onChange(newValue);
|
|
10606
|
+
this.valueChange.emit(newValue);
|
|
10607
|
+
if (newValue.length === this.maxLength()) {
|
|
10608
|
+
this.completed.emit();
|
|
10609
|
+
}
|
|
10610
|
+
}
|
|
10611
|
+
handleBackspace(index) {
|
|
10612
|
+
const chars = this.currentChars();
|
|
10613
|
+
if (chars[index]) {
|
|
10614
|
+
chars[index] = '';
|
|
10615
|
+
this.commitValue(chars);
|
|
10616
|
+
}
|
|
10617
|
+
else if (index > 0) {
|
|
10618
|
+
chars[index - 1] = '';
|
|
10619
|
+
this.commitValue(chars);
|
|
10620
|
+
this.focusBox(index - 1);
|
|
10621
|
+
}
|
|
10622
|
+
}
|
|
10623
|
+
handleDelete(index) {
|
|
10624
|
+
const chars = this.currentChars();
|
|
10625
|
+
if (chars[index]) {
|
|
10626
|
+
chars[index] = '';
|
|
10627
|
+
this.commitValue(chars);
|
|
10628
|
+
}
|
|
10629
|
+
}
|
|
10630
|
+
filterChars(value) {
|
|
10631
|
+
if (this.charType() === 'numeric') {
|
|
10632
|
+
return value.replace(/\D+/g, '');
|
|
10633
|
+
}
|
|
10634
|
+
return value.toUpperCase().replace(/[^A-Z0-9]/g, '');
|
|
10635
|
+
}
|
|
10636
|
+
emptyChars() {
|
|
10637
|
+
return Array.from({ length: this.maxLength() }, () => '');
|
|
10638
|
+
}
|
|
10639
|
+
distributeValue(value) {
|
|
10640
|
+
const chars = this.emptyChars();
|
|
10641
|
+
const source = String(value ?? '');
|
|
10642
|
+
for (let i = 0; i < source.length && i < this.maxLength(); i++) {
|
|
10643
|
+
chars[i] = source[i];
|
|
10644
|
+
}
|
|
10645
|
+
return chars;
|
|
10646
|
+
}
|
|
10647
|
+
focusBox(index) {
|
|
10648
|
+
if (index < 0 || index >= this.maxLength()) {
|
|
10649
|
+
return;
|
|
10650
|
+
}
|
|
10651
|
+
const ref = this.boxRefs()[index];
|
|
10652
|
+
ref?.nativeElement.focus();
|
|
10653
|
+
}
|
|
10654
|
+
markAsTouched() {
|
|
10655
|
+
if (!this.touched()) {
|
|
10656
|
+
this.touched.set(true);
|
|
10657
|
+
this.onTouched();
|
|
10658
|
+
}
|
|
10659
|
+
}
|
|
10660
|
+
translateWithDefault(key, defaultText, params) {
|
|
10661
|
+
const result = this.translateService.translate(key, params);
|
|
10662
|
+
return result !== key ? result : defaultText;
|
|
10663
|
+
}
|
|
10664
|
+
translateKey(key) {
|
|
10665
|
+
if (key) {
|
|
10666
|
+
const translated = this.translateService.translate(key);
|
|
10667
|
+
return translated !== key ? translated : undefined;
|
|
10668
|
+
}
|
|
10669
|
+
return undefined;
|
|
10670
|
+
}
|
|
10671
|
+
buildError(direct, key, fallbackKey, fallbackDefault) {
|
|
10672
|
+
return (direct ??
|
|
10673
|
+
this.translateKey(key) ??
|
|
10674
|
+
this.translateWithDefault(fallbackKey, fallbackDefault));
|
|
10675
|
+
}
|
|
10676
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisOtpInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10677
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SolarisOtpInputComponent, isStandalone: true, selector: "solaris-otp-input", inputs: { 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 }, requiredError: { classPropertyName: "requiredError", publicName: "requiredError", isSignal: true, isRequired: false, transformFunction: null }, invalidError: { classPropertyName: "invalidError", publicName: "invalidError", isSignal: true, isRequired: false, transformFunction: null }, requiredErrorKey: { classPropertyName: "requiredErrorKey", publicName: "requiredErrorKey", isSignal: true, isRequired: false, transformFunction: null }, invalidErrorKey: { classPropertyName: "invalidErrorKey", publicName: "invalidErrorKey", isSignal: true, isRequired: false, transformFunction: null }, requiredInput: { classPropertyName: "requiredInput", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonlyInput: { classPropertyName: "readonlyInput", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, manualInvalid: { classPropertyName: "manualInvalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, charType: { classPropertyName: "charType", publicName: "charType", isSignal: true, isRequired: false, transformFunction: null }, masked: { classPropertyName: "masked", publicName: "masked", isSignal: true, isRequired: false, transformFunction: null }, separatorEvery: { classPropertyName: "separatorEvery", publicName: "separatorEvery", isSignal: true, isRequired: false, transformFunction: null }, autoFocus: { classPropertyName: "autoFocus", publicName: "autoFocus", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", 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 } }, outputs: { valueChange: "valueChange", completed: "completed" }, host: { properties: { "attr.id": "elementId()", "attr.data-density": "effectiveDensity()", "attr.data-appearance": "appearance()", "attr.data-length": "maxLength()", "attr.data-masked": "masked() ? \"\" : null", "attr.data-char-type": "charType()", "attr.data-invalid": "isFieldInvalid() ? \"\" : null" }, classAttribute: "solaris-otp-input" }, providers: [
|
|
10678
|
+
{
|
|
10679
|
+
provide: NG_VALUE_ACCESSOR,
|
|
10680
|
+
useExisting: forwardRef(() => SolarisOtpInputComponent),
|
|
10681
|
+
multi: true,
|
|
10682
|
+
},
|
|
10683
|
+
{
|
|
10684
|
+
provide: SolarisFormControl,
|
|
10685
|
+
useExisting: forwardRef(() => SolarisOtpInputComponent),
|
|
10686
|
+
},
|
|
10687
|
+
], viewQueries: [{ propertyName: "boxRefs", predicate: ["box"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<solaris-form-field\n [label]=\"label()\"\n [hint]=\"hint()\"\n [error]=\"error() || computedError()\"\n [labelKey]=\"labelKey()\"\n [hintKey]=\"hintKey()\"\n [errorKey]=\"errorKey()\"\n [required]=\"requiredInput()\"\n [optional]=\"optional()\"\n [appearance]=\"appearance()\"\n [density]=\"density()\"\n [radius]=\"radius()\"\n [invalid]=\"isFieldInvalid()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"isEffectivelyReadonly()\"\n [control]=\"this\"\n>\n <div\n class=\"solaris-otp-input__boxes\"\n solaris-form-field-trigger\n role=\"group\"\n [attr.aria-label]=\"groupAriaLabel() || null\"\n >\n @for (box of boxes(); track $index; let index = $index) {\n <input\n #box\n type=\"text\"\n class=\"solaris-otp-input__box\"\n [attr.inputmode]=\"inputmode()\"\n maxlength=\"1\"\n autocomplete=\"one-time-code\"\n [attr.aria-label]=\"boxAriaLabel(index)\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.data-active]=\"focusedIndex() === index ? '' : null\"\n [value]=\"box\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"isEffectivelyReadonly()\"\n (input)=\"onBoxInput($event, index)\"\n (keydown)=\"onBoxKeydown($event, index)\"\n (paste)=\"onBoxPaste($event, index)\"\n (focus)=\"onBoxFocus(index)\"\n (blur)=\"onBoxBlur()\"\n />\n @if (showSeparatorAfter(index)) {\n <span class=\"solaris-otp-input__separator\" aria-hidden=\"true\">-</span>\n }\n }\n </div>\n <ng-content\n select=\"[solaris-form-label-action]\"\n ngProjectAs=\"[solaris-form-label-action]\"\n />\n</solaris-form-field>\n", styles: [":host{--solaris-otp-input-gap: var(--solaris-spacing-2);--solaris-otp-input-box-radius: var(--solaris-radius-sm);--solaris-otp-input-box-border-color: var(--solaris-border-subtle);--solaris-otp-input-box-border-width: var(--solaris-border-width-sm);--solaris-otp-input-box-background: transparent;--solaris-otp-input-box-color: var(--solaris-text-default);--solaris-otp-input-box-focus-border-color: var(--solaris-primary-base);--solaris-otp-input-box-error-border-color: var(--solaris-danger-base);--solaris-otp-input-box-width: calc(var(--solaris-density-min-height) * .9);--solaris-otp-input-box-height: calc( var(--solaris-density-min-height) * 1.15 );--solaris-otp-input-separator-color: var(--solaris-text-muted);display:block;box-sizing:border-box}:host solaris-form-field ::ng-deep .solaris-form-field__control-wrapper{background:transparent;border:0;border-color:transparent}.solaris-otp-input__boxes{display:flex;box-sizing:border-box;align-items:center;gap:var(--solaris-otp-input-gap);padding-block:var(--solaris-spacing-2)}.solaris-otp-input__box{box-sizing:border-box;width:var(--solaris-otp-input-box-width);height:var(--solaris-otp-input-box-height);margin:0;padding:0;text-align:center;color:var(--solaris-otp-input-box-color);font-size:var(--solaris-density-font-size);line-height:var(--solaris-line-height-none);background:var(--solaris-otp-input-box-background);border-radius:var(--solaris-otp-input-box-radius);border:var(--solaris-otp-input-box-border-width) solid var(--solaris-otp-input-box-border-color);transition:border-color var(--solaris-motion-duration-fast) var(--solaris-motion-easing-standard),box-shadow var(--solaris-motion-duration-fast) var(--solaris-motion-easing-standard)}.solaris-otp-input__box:focus{outline:none;border-color:var(--solaris-otp-input-box-focus-border-color);box-shadow:0 0 0 2px var(--solaris-otp-input-box-focus-border-color)}.solaris-otp-input__box[data-active]{border-color:var(--solaris-otp-input-box-focus-border-color)}.solaris-otp-input__box[disabled]{cursor:not-allowed;opacity:.5}:host([data-appearance=surface]){--solaris-otp-input-box-background: var(--solaris-surface-subtle);--solaris-otp-input-box-border-width: 0}:host([data-appearance=filled]){--solaris-otp-input-box-background: var(--solaris-surface-subtle);--solaris-otp-input-box-border-width: var(--solaris-border-width-sm)}:host([data-invalid]) .solaris-otp-input__box{border-color:var(--solaris-otp-input-box-error-border-color)}.solaris-otp-input__separator{flex:0 0 auto;-webkit-user-select:none;user-select:none;color:var(--solaris-otp-input-separator-color);font-size:var(--solaris-density-font-size);line-height:var(--solaris-line-height-none)}@media(prefers-reduced-motion:reduce){.solaris-otp-input__box{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: SolarisFormFieldTriggerDirective, selector: "[solaris-form-field-trigger]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10688
|
+
}
|
|
10689
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisOtpInputComponent, decorators: [{
|
|
10690
|
+
type: Component,
|
|
10691
|
+
args: [{ selector: 'solaris-otp-input', standalone: true, imports: [
|
|
10692
|
+
FormsModule,
|
|
10693
|
+
SolarisFormFieldComponent,
|
|
10694
|
+
SolarisFormFieldTriggerDirective,
|
|
10695
|
+
], providers: [
|
|
10696
|
+
{
|
|
10697
|
+
provide: NG_VALUE_ACCESSOR,
|
|
10698
|
+
useExisting: forwardRef(() => SolarisOtpInputComponent),
|
|
10699
|
+
multi: true,
|
|
10700
|
+
},
|
|
10701
|
+
{
|
|
10702
|
+
provide: SolarisFormControl,
|
|
10703
|
+
useExisting: forwardRef(() => SolarisOtpInputComponent),
|
|
10704
|
+
},
|
|
10705
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
10706
|
+
class: 'solaris-otp-input',
|
|
10707
|
+
'[attr.id]': 'elementId()',
|
|
10708
|
+
'[attr.data-density]': 'effectiveDensity()',
|
|
10709
|
+
'[attr.data-appearance]': 'appearance()',
|
|
10710
|
+
'[attr.data-length]': 'maxLength()',
|
|
10711
|
+
'[attr.data-masked]': 'masked() ? "" : null',
|
|
10712
|
+
'[attr.data-char-type]': 'charType()',
|
|
10713
|
+
'[attr.data-invalid]': 'isFieldInvalid() ? "" : null',
|
|
10714
|
+
}, template: "<solaris-form-field\n [label]=\"label()\"\n [hint]=\"hint()\"\n [error]=\"error() || computedError()\"\n [labelKey]=\"labelKey()\"\n [hintKey]=\"hintKey()\"\n [errorKey]=\"errorKey()\"\n [required]=\"requiredInput()\"\n [optional]=\"optional()\"\n [appearance]=\"appearance()\"\n [density]=\"density()\"\n [radius]=\"radius()\"\n [invalid]=\"isFieldInvalid()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"isEffectivelyReadonly()\"\n [control]=\"this\"\n>\n <div\n class=\"solaris-otp-input__boxes\"\n solaris-form-field-trigger\n role=\"group\"\n [attr.aria-label]=\"groupAriaLabel() || null\"\n >\n @for (box of boxes(); track $index; let index = $index) {\n <input\n #box\n type=\"text\"\n class=\"solaris-otp-input__box\"\n [attr.inputmode]=\"inputmode()\"\n maxlength=\"1\"\n autocomplete=\"one-time-code\"\n [attr.aria-label]=\"boxAriaLabel(index)\"\n [attr.aria-describedby]=\"ariaDescribedBy()\"\n [attr.data-active]=\"focusedIndex() === index ? '' : null\"\n [value]=\"box\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"isEffectivelyReadonly()\"\n (input)=\"onBoxInput($event, index)\"\n (keydown)=\"onBoxKeydown($event, index)\"\n (paste)=\"onBoxPaste($event, index)\"\n (focus)=\"onBoxFocus(index)\"\n (blur)=\"onBoxBlur()\"\n />\n @if (showSeparatorAfter(index)) {\n <span class=\"solaris-otp-input__separator\" aria-hidden=\"true\">-</span>\n }\n }\n </div>\n <ng-content\n select=\"[solaris-form-label-action]\"\n ngProjectAs=\"[solaris-form-label-action]\"\n />\n</solaris-form-field>\n", styles: [":host{--solaris-otp-input-gap: var(--solaris-spacing-2);--solaris-otp-input-box-radius: var(--solaris-radius-sm);--solaris-otp-input-box-border-color: var(--solaris-border-subtle);--solaris-otp-input-box-border-width: var(--solaris-border-width-sm);--solaris-otp-input-box-background: transparent;--solaris-otp-input-box-color: var(--solaris-text-default);--solaris-otp-input-box-focus-border-color: var(--solaris-primary-base);--solaris-otp-input-box-error-border-color: var(--solaris-danger-base);--solaris-otp-input-box-width: calc(var(--solaris-density-min-height) * .9);--solaris-otp-input-box-height: calc( var(--solaris-density-min-height) * 1.15 );--solaris-otp-input-separator-color: var(--solaris-text-muted);display:block;box-sizing:border-box}:host solaris-form-field ::ng-deep .solaris-form-field__control-wrapper{background:transparent;border:0;border-color:transparent}.solaris-otp-input__boxes{display:flex;box-sizing:border-box;align-items:center;gap:var(--solaris-otp-input-gap);padding-block:var(--solaris-spacing-2)}.solaris-otp-input__box{box-sizing:border-box;width:var(--solaris-otp-input-box-width);height:var(--solaris-otp-input-box-height);margin:0;padding:0;text-align:center;color:var(--solaris-otp-input-box-color);font-size:var(--solaris-density-font-size);line-height:var(--solaris-line-height-none);background:var(--solaris-otp-input-box-background);border-radius:var(--solaris-otp-input-box-radius);border:var(--solaris-otp-input-box-border-width) solid var(--solaris-otp-input-box-border-color);transition:border-color var(--solaris-motion-duration-fast) var(--solaris-motion-easing-standard),box-shadow var(--solaris-motion-duration-fast) var(--solaris-motion-easing-standard)}.solaris-otp-input__box:focus{outline:none;border-color:var(--solaris-otp-input-box-focus-border-color);box-shadow:0 0 0 2px var(--solaris-otp-input-box-focus-border-color)}.solaris-otp-input__box[data-active]{border-color:var(--solaris-otp-input-box-focus-border-color)}.solaris-otp-input__box[disabled]{cursor:not-allowed;opacity:.5}:host([data-appearance=surface]){--solaris-otp-input-box-background: var(--solaris-surface-subtle);--solaris-otp-input-box-border-width: 0}:host([data-appearance=filled]){--solaris-otp-input-box-background: var(--solaris-surface-subtle);--solaris-otp-input-box-border-width: var(--solaris-border-width-sm)}:host([data-invalid]) .solaris-otp-input__box{border-color:var(--solaris-otp-input-box-error-border-color)}.solaris-otp-input__separator{flex:0 0 auto;-webkit-user-select:none;user-select:none;color:var(--solaris-otp-input-separator-color);font-size:var(--solaris-density-font-size);line-height:var(--solaris-line-height-none)}@media(prefers-reduced-motion:reduce){.solaris-otp-input__box{transition:none}}\n"] }]
|
|
10715
|
+
}], ctorParameters: () => [], propDecorators: { boxRefs: [{ type: i0.ViewChildren, args: ['box', { isSignal: true }] }], 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 }] }], requiredError: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredError", required: false }] }], invalidError: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidError", required: false }] }], requiredErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredErrorKey", required: false }] }], invalidErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidErrorKey", required: false }] }], requiredInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonlyInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], manualInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], minLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "minLength", required: false }] }], charType: [{ type: i0.Input, args: [{ isSignal: true, alias: "charType", required: false }] }], masked: [{ type: i0.Input, args: [{ isSignal: true, alias: "masked", required: false }] }], separatorEvery: [{ type: i0.Input, args: [{ isSignal: true, alias: "separatorEvery", required: false }] }], autoFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoFocus", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], completed: [{ type: i0.Output, args: ["completed"] }] } });
|
|
10716
|
+
|
|
10717
|
+
function solarisOtpValidator(minLength, maxLength) {
|
|
10718
|
+
return (control) => {
|
|
10719
|
+
const value = control.value;
|
|
10720
|
+
if (value == null || value === '') {
|
|
10721
|
+
return null;
|
|
10722
|
+
}
|
|
10723
|
+
const length = String(value).length;
|
|
10724
|
+
if (length < minLength || length > maxLength) {
|
|
10725
|
+
return {
|
|
10726
|
+
solarisOtpLength: {
|
|
10727
|
+
requiredLength: maxLength,
|
|
10728
|
+
actualLength: length,
|
|
10729
|
+
},
|
|
10730
|
+
};
|
|
10731
|
+
}
|
|
10732
|
+
return null;
|
|
10733
|
+
};
|
|
10734
|
+
}
|
|
10735
|
+
|
|
10125
10736
|
class SolarisSkeletonComponent {
|
|
10126
10737
|
variant = input('text', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
10127
10738
|
animation = input('pulse', ...(ngDevMode ? [{ debugName: "animation" }] : /* istanbul ignore next */ []));
|
|
@@ -14610,5 +15221,5 @@ function provideSolaris(config) {
|
|
|
14610
15221
|
* Generated bundle index. Do not edit.
|
|
14611
15222
|
*/
|
|
14612
15223
|
|
|
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 };
|
|
15224
|
+
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, SolarisOtpInputComponent, 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, solarisOtpValidator, solarisPasswordValidator, solarisPhoneValidator };
|
|
14614
15225
|
//# sourceMappingURL=educarehq-solaris-ui.mjs.map
|