@thunderid/vue 1.0.7 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/updateMeCredentials.d.ts +8 -0
- package/dist/api/updateMeCredentials.d.ts.map +1 -0
- package/dist/cjs/index.cjs +653 -71
- package/dist/components/auth/sign-in/AuthOptionFactoryCore.d.ts.map +1 -1
- package/dist/components/auth/sign-up/BaseSignUp.d.ts.map +1 -1
- package/dist/components/presentation/change-credential/BaseChangeCredential.d.ts +22 -0
- package/dist/components/presentation/change-credential/BaseChangeCredential.d.ts.map +1 -0
- package/dist/components/presentation/change-credential/ChangeCredential.css.d.ts +7 -0
- package/dist/components/presentation/change-credential/ChangeCredential.css.d.ts.map +1 -0
- package/dist/components/presentation/change-credential/ChangeCredential.d.ts +12 -0
- package/dist/components/presentation/change-credential/ChangeCredential.d.ts.map +1 -0
- package/dist/components/presentation/user-dropdown/BaseUserDropdown.d.ts +3 -0
- package/dist/components/presentation/user-dropdown/BaseUserDropdown.d.ts.map +1 -1
- package/dist/components/presentation/user-dropdown/UserDropdown.css.d.ts +2 -1
- package/dist/components/presentation/user-dropdown/UserDropdown.css.d.ts.map +1 -1
- package/dist/components/presentation/user-dropdown/UserDropdown.d.ts.map +1 -1
- package/dist/components/presentation/user-profile/UserProfile.css.d.ts +1 -1
- package/dist/components/presentation/user-profile/UserProfile.css.d.ts.map +1 -1
- package/dist/components/primitives/KeyValueList/KeyValueList.css.d.ts +12 -0
- package/dist/components/primitives/KeyValueList/KeyValueList.css.d.ts.map +1 -0
- package/dist/components/primitives/KeyValueList/KeyValueList.d.ts +7 -0
- package/dist/components/primitives/KeyValueList/KeyValueList.d.ts.map +1 -0
- package/dist/components/primitives/KeyValueList/index.d.ts +2 -0
- package/dist/components/primitives/KeyValueList/index.d.ts.map +1 -0
- package/dist/components/primitives/PasswordField/PasswordField.d.ts.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +647 -74
- package/package.json +5 -5
package/dist/cjs/index.cjs
CHANGED
|
@@ -1446,6 +1446,161 @@ const DEFAULTS_CSS = `
|
|
|
1446
1446
|
`;
|
|
1447
1447
|
var defaults_css_default = DEFAULTS_CSS;
|
|
1448
1448
|
|
|
1449
|
+
//#endregion
|
|
1450
|
+
//#region src/components/auth/sign-in/BaseSignIn.css.ts
|
|
1451
|
+
/**
|
|
1452
|
+
* Layout styles for the BaseSignIn composition.
|
|
1453
|
+
*
|
|
1454
|
+
* BEM block: `.thunderid-signin`
|
|
1455
|
+
*
|
|
1456
|
+
* Mirrors the layout constants in the React SDK's `BaseSignIn.styles.ts`
|
|
1457
|
+
* (min-width, content gap, logo sizing) so the sign-in card renders with the
|
|
1458
|
+
* same proportions across frameworks.
|
|
1459
|
+
*/
|
|
1460
|
+
const BASE_SIGN_IN_CSS = `
|
|
1461
|
+
/* ============================================================
|
|
1462
|
+
BaseSignIn
|
|
1463
|
+
============================================================ */
|
|
1464
|
+
|
|
1465
|
+
.thunderid-signin {
|
|
1466
|
+
min-width: 420px;
|
|
1467
|
+
margin: 0 auto;
|
|
1468
|
+
font-family: var(--thunderid-typography-fontFamily, inherit);
|
|
1469
|
+
border-radius: var(--thunderid-border-radius-large);
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
.thunderid-signin__content {
|
|
1473
|
+
display: flex;
|
|
1474
|
+
flex-direction: column;
|
|
1475
|
+
gap: calc(var(--thunderid-spacing-unit) * 2);
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
.thunderid-signin__content > img,
|
|
1479
|
+
.thunderid-signin__content > span[role='img'] {
|
|
1480
|
+
/* Flex column's default 'stretch' would otherwise force width: auto to fill
|
|
1481
|
+
the container instead of shrinking to the image's intrinsic size. */
|
|
1482
|
+
align-self: center;
|
|
1483
|
+
display: block;
|
|
1484
|
+
margin: 0 0 calc(var(--thunderid-spacing-unit) * 1) 0;
|
|
1485
|
+
border-radius: var(--thunderid-border-radius-small);
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
.thunderid-signin__messages {
|
|
1489
|
+
margin-top: calc(var(--thunderid-spacing-unit) * 2);
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
.thunderid-signin__messages > * + * {
|
|
1493
|
+
margin-top: calc(var(--thunderid-spacing-unit) * 1);
|
|
1494
|
+
}
|
|
1495
|
+
`;
|
|
1496
|
+
var BaseSignIn_css_default = BASE_SIGN_IN_CSS;
|
|
1497
|
+
|
|
1498
|
+
//#endregion
|
|
1499
|
+
//#region src/components/presentation/change-credential/ChangeCredential.css.ts
|
|
1500
|
+
/**
|
|
1501
|
+
* Styles for the ChangeCredential presentation component.
|
|
1502
|
+
* Parity target: `@thunderid/react` BaseChangeCredential.styles.ts
|
|
1503
|
+
*/
|
|
1504
|
+
const CHANGE_CREDENTIAL_CSS = `
|
|
1505
|
+
/* ============================================================
|
|
1506
|
+
ChangeCredential (React Parity)
|
|
1507
|
+
============================================================ */
|
|
1508
|
+
|
|
1509
|
+
.thunderid-change-credential {
|
|
1510
|
+
display: flex;
|
|
1511
|
+
flex-direction: column;
|
|
1512
|
+
gap: calc(var(--thunderid-spacing-unit) * 2);
|
|
1513
|
+
width: 100%;
|
|
1514
|
+
box-sizing: border-box;
|
|
1515
|
+
font-family: var(--thunderid-typography-fontFamily);
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
.thunderid-change-credential--card {
|
|
1519
|
+
padding: calc(var(--thunderid-spacing-unit) * 3);
|
|
1520
|
+
border: 1px solid var(--thunderid-color-border);
|
|
1521
|
+
border-radius: var(--thunderid-border-radius-large, 8px);
|
|
1522
|
+
background: var(--thunderid-color-background-surface);
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
.thunderid-change-credential__heading {
|
|
1526
|
+
margin: 0;
|
|
1527
|
+
font-size: 1.125rem;
|
|
1528
|
+
font-weight: 600;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
.thunderid-change-credential__fields {
|
|
1532
|
+
display: flex;
|
|
1533
|
+
flex-direction: column;
|
|
1534
|
+
gap: calc(var(--thunderid-spacing-unit) * 2);
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
.thunderid-change-credential__requirements-heading {
|
|
1538
|
+
margin: 0 0 calc(var(--thunderid-spacing-unit) / 2) 0;
|
|
1539
|
+
font-size: 0.8125rem;
|
|
1540
|
+
opacity: 0.8;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
.thunderid-change-credential__requirements {
|
|
1544
|
+
display: flex;
|
|
1545
|
+
flex-direction: column;
|
|
1546
|
+
gap: calc(var(--thunderid-spacing-unit) / 2);
|
|
1547
|
+
margin: 0;
|
|
1548
|
+
padding: 0;
|
|
1549
|
+
list-style: none;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
.thunderid-change-credential__requirement {
|
|
1553
|
+
display: flex;
|
|
1554
|
+
align-items: center;
|
|
1555
|
+
gap: var(--thunderid-spacing-unit);
|
|
1556
|
+
font-size: 0.8125rem;
|
|
1557
|
+
opacity: 0.7;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
.thunderid-change-credential__requirement--passed {
|
|
1561
|
+
color: var(--thunderid-color-success-main);
|
|
1562
|
+
opacity: 1;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
.thunderid-change-credential__requirement-icon {
|
|
1566
|
+
display: inline-flex;
|
|
1567
|
+
flex-shrink: 0;
|
|
1568
|
+
width: 14px;
|
|
1569
|
+
height: 14px;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
.thunderid-change-credential__actions {
|
|
1573
|
+
display: flex;
|
|
1574
|
+
align-items: center;
|
|
1575
|
+
justify-content: flex-end;
|
|
1576
|
+
gap: var(--thunderid-spacing-unit);
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
.thunderid-change-credential__unavailable {
|
|
1580
|
+
position: relative;
|
|
1581
|
+
display: flex;
|
|
1582
|
+
width: 100%;
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
.thunderid-change-credential__unavailable-content {
|
|
1586
|
+
width: 100%;
|
|
1587
|
+
filter: blur(3px);
|
|
1588
|
+
opacity: 0.55;
|
|
1589
|
+
pointer-events: none;
|
|
1590
|
+
user-select: none;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
.thunderid-change-credential__unavailable-overlay {
|
|
1594
|
+
position: absolute;
|
|
1595
|
+
inset: 0;
|
|
1596
|
+
display: flex;
|
|
1597
|
+
align-items: center;
|
|
1598
|
+
justify-content: center;
|
|
1599
|
+
padding: calc(var(--thunderid-spacing-unit) * 2);
|
|
1600
|
+
}
|
|
1601
|
+
`;
|
|
1602
|
+
var ChangeCredential_css_default = CHANGE_CREDENTIAL_CSS;
|
|
1603
|
+
|
|
1449
1604
|
//#endregion
|
|
1450
1605
|
//#region src/components/presentation/language-switcher/LanguageSwitcher.css.ts
|
|
1451
1606
|
/**
|
|
@@ -1582,6 +1737,7 @@ var LanguageSwitcher_css_default = LANGUAGE_SWITCHER_CSS;
|
|
|
1582
1737
|
* __item--danger – destructive action (red text/hover)
|
|
1583
1738
|
*
|
|
1584
1739
|
* Elements:
|
|
1740
|
+
* __trigger-label – display name beside the trigger avatar (showTriggerLabel)
|
|
1585
1741
|
* __chevron – rotates 180° when menu is open
|
|
1586
1742
|
* __menu-header – user identity section at top of menu
|
|
1587
1743
|
* __menu-header-avatar – gradient avatar circle in header
|
|
@@ -1629,6 +1785,17 @@ const USER_DROPDOWN_CSS = `
|
|
|
1629
1785
|
box-shadow: 0 0 0 3px var(--thunderid-focus-ring-color);
|
|
1630
1786
|
}
|
|
1631
1787
|
|
|
1788
|
+
.thunderid-user-dropdown__trigger-label {
|
|
1789
|
+
color: var(--thunderid-color-text-primary);
|
|
1790
|
+
font-size: 0.875rem;
|
|
1791
|
+
font-weight: 500;
|
|
1792
|
+
max-width: 150px;
|
|
1793
|
+
overflow: hidden;
|
|
1794
|
+
text-overflow: ellipsis;
|
|
1795
|
+
white-space: nowrap;
|
|
1796
|
+
padding-right: calc(var(--thunderid-spacing-unit) * 0.5);
|
|
1797
|
+
}
|
|
1798
|
+
|
|
1632
1799
|
.thunderid-user-dropdown__trigger:focus-visible {
|
|
1633
1800
|
border-color: var(--thunderid-color-primary-main);
|
|
1634
1801
|
box-shadow: 0 0 0 var(--thunderid-focus-ring-width) var(--thunderid-focus-ring-color);
|
|
@@ -1972,9 +2139,7 @@ const USER_PROFILE_CSS = `
|
|
|
1972
2139
|
display: flex;
|
|
1973
2140
|
flex-direction: column;
|
|
1974
2141
|
padding: calc(var(--thunderid-spacing-unit) * 4);
|
|
1975
|
-
width:
|
|
1976
|
-
max-width: 600px;
|
|
1977
|
-
margin: 0 auto;
|
|
2142
|
+
min-width: 600px;
|
|
1978
2143
|
font-family: var(--thunderid-typography-fontFamily);
|
|
1979
2144
|
background: var(--thunderid-color-background-surface);
|
|
1980
2145
|
border-radius: var(--thunderid-border-radius-large, 8px);
|
|
@@ -2111,6 +2276,7 @@ img.thunderid-user-profile__avatar {
|
|
|
2111
2276
|
display: flex;
|
|
2112
2277
|
align-items: center;
|
|
2113
2278
|
gap: var(--thunderid-spacing-unit);
|
|
2279
|
+
min-width: 0;
|
|
2114
2280
|
}
|
|
2115
2281
|
|
|
2116
2282
|
.thunderid-user-profile__field-label {
|
|
@@ -2134,6 +2300,7 @@ img.thunderid-user-profile__avatar {
|
|
|
2134
2300
|
text-overflow: ellipsis;
|
|
2135
2301
|
white-space: nowrap;
|
|
2136
2302
|
max-width: 350px;
|
|
2303
|
+
min-width: 0;
|
|
2137
2304
|
text-align: start;
|
|
2138
2305
|
overflow: hidden;
|
|
2139
2306
|
}
|
|
@@ -2814,6 +2981,64 @@ const DIVIDER_CSS = `
|
|
|
2814
2981
|
`;
|
|
2815
2982
|
var Divider_css_default = DIVIDER_CSS;
|
|
2816
2983
|
|
|
2984
|
+
//#endregion
|
|
2985
|
+
//#region src/components/primitives/KeyValueList/KeyValueList.css.ts
|
|
2986
|
+
/**
|
|
2987
|
+
* Styles for the KeyValueList primitive component.
|
|
2988
|
+
*
|
|
2989
|
+
* BEM block: `.thunderid-key-value-list`, built with `withVendorCSSClassPrefix` so the selectors
|
|
2990
|
+
* always match the classes `KeyValueList` renders.
|
|
2991
|
+
*
|
|
2992
|
+
* Elements:
|
|
2993
|
+
* __label | __list | __key | __value
|
|
2994
|
+
*/
|
|
2995
|
+
const KEY_VALUE_LIST_CSS = `
|
|
2996
|
+
/* ============================================================
|
|
2997
|
+
KeyValueList
|
|
2998
|
+
============================================================ */
|
|
2999
|
+
|
|
3000
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("key-value-list")} {
|
|
3001
|
+
display: flex;
|
|
3002
|
+
flex-direction: column;
|
|
3003
|
+
gap: calc(var(--thunderid-spacing-unit) * 0.5);
|
|
3004
|
+
width: 100%;
|
|
3005
|
+
}
|
|
3006
|
+
|
|
3007
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("key-value-list__label")} {
|
|
3008
|
+
color: var(--thunderid-color-text-secondary);
|
|
3009
|
+
font-size: 0.875rem;
|
|
3010
|
+
font-weight: var(--thunderid-typography-fontWeight-medium);
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
/* Two columns rather than a row each, so every value starts at the same edge however long the
|
|
3014
|
+
labels beside them are. */
|
|
3015
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("key-value-list__list")} {
|
|
3016
|
+
background-color: var(--thunderid-color-background-surface);
|
|
3017
|
+
border: 1px solid var(--thunderid-color-border);
|
|
3018
|
+
border-radius: var(--thunderid-border-radius-small);
|
|
3019
|
+
column-gap: calc(var(--thunderid-spacing-unit) * 3);
|
|
3020
|
+
display: grid;
|
|
3021
|
+
grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
|
|
3022
|
+
margin: 0;
|
|
3023
|
+
padding: calc(var(--thunderid-spacing-unit) * 2);
|
|
3024
|
+
row-gap: calc(var(--thunderid-spacing-unit) * 1.5);
|
|
3025
|
+
}
|
|
3026
|
+
|
|
3027
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("key-value-list__key")} {
|
|
3028
|
+
color: var(--thunderid-color-text-secondary);
|
|
3029
|
+
font-size: 0.875rem;
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3032
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("key-value-list__value")} {
|
|
3033
|
+
color: var(--thunderid-color-text-primary);
|
|
3034
|
+
font-size: 0.875rem;
|
|
3035
|
+
font-weight: var(--thunderid-typography-fontWeight-medium);
|
|
3036
|
+
margin: 0;
|
|
3037
|
+
overflow-wrap: anywhere;
|
|
3038
|
+
}
|
|
3039
|
+
`;
|
|
3040
|
+
var KeyValueList_css_default = KEY_VALUE_LIST_CSS;
|
|
3041
|
+
|
|
2817
3042
|
//#endregion
|
|
2818
3043
|
//#region src/components/primitives/Logo/Logo.css.ts
|
|
2819
3044
|
/**
|
|
@@ -3397,55 +3622,6 @@ const TYPOGRAPHY_CSS = `
|
|
|
3397
3622
|
`;
|
|
3398
3623
|
var Typography_css_default = TYPOGRAPHY_CSS;
|
|
3399
3624
|
|
|
3400
|
-
//#endregion
|
|
3401
|
-
//#region src/components/auth/sign-in/BaseSignIn.css.ts
|
|
3402
|
-
/**
|
|
3403
|
-
* Layout styles for the BaseSignIn composition.
|
|
3404
|
-
*
|
|
3405
|
-
* BEM block: `.thunderid-signin`
|
|
3406
|
-
*
|
|
3407
|
-
* Mirrors the layout constants in the React SDK's `BaseSignIn.styles.ts`
|
|
3408
|
-
* (min-width, content gap, logo sizing) so the sign-in card renders with the
|
|
3409
|
-
* same proportions across frameworks.
|
|
3410
|
-
*/
|
|
3411
|
-
const BASE_SIGN_IN_CSS = `
|
|
3412
|
-
/* ============================================================
|
|
3413
|
-
BaseSignIn
|
|
3414
|
-
============================================================ */
|
|
3415
|
-
|
|
3416
|
-
.thunderid-signin {
|
|
3417
|
-
min-width: 420px;
|
|
3418
|
-
margin: 0 auto;
|
|
3419
|
-
font-family: var(--thunderid-typography-fontFamily, inherit);
|
|
3420
|
-
border-radius: var(--thunderid-border-radius-large);
|
|
3421
|
-
}
|
|
3422
|
-
|
|
3423
|
-
.thunderid-signin__content {
|
|
3424
|
-
display: flex;
|
|
3425
|
-
flex-direction: column;
|
|
3426
|
-
gap: calc(var(--thunderid-spacing-unit) * 2);
|
|
3427
|
-
}
|
|
3428
|
-
|
|
3429
|
-
.thunderid-signin__content > img,
|
|
3430
|
-
.thunderid-signin__content > span[role='img'] {
|
|
3431
|
-
/* Flex column's default 'stretch' would otherwise force width: auto to fill
|
|
3432
|
-
the container instead of shrinking to the image's intrinsic size. */
|
|
3433
|
-
align-self: center;
|
|
3434
|
-
display: block;
|
|
3435
|
-
margin: 0 0 calc(var(--thunderid-spacing-unit) * 1) 0;
|
|
3436
|
-
border-radius: var(--thunderid-border-radius-small);
|
|
3437
|
-
}
|
|
3438
|
-
|
|
3439
|
-
.thunderid-signin__messages {
|
|
3440
|
-
margin-top: calc(var(--thunderid-spacing-unit) * 2);
|
|
3441
|
-
}
|
|
3442
|
-
|
|
3443
|
-
.thunderid-signin__messages > * + * {
|
|
3444
|
-
margin-top: calc(var(--thunderid-spacing-unit) * 1);
|
|
3445
|
-
}
|
|
3446
|
-
`;
|
|
3447
|
-
var BaseSignIn_css_default = BASE_SIGN_IN_CSS;
|
|
3448
|
-
|
|
3449
3625
|
//#endregion
|
|
3450
3626
|
//#region src/styles/injectStyles.ts
|
|
3451
3627
|
/**
|
|
@@ -3469,9 +3645,11 @@ const STYLES = [
|
|
|
3469
3645
|
DatePicker_css_default,
|
|
3470
3646
|
OtpField_css_default,
|
|
3471
3647
|
Divider_css_default,
|
|
3648
|
+
KeyValueList_css_default,
|
|
3472
3649
|
Logo_css_default,
|
|
3473
3650
|
Spinner_css_default,
|
|
3474
3651
|
BaseSignIn_css_default,
|
|
3652
|
+
ChangeCredential_css_default,
|
|
3475
3653
|
LanguageSwitcher_css_default,
|
|
3476
3654
|
UserDropdown_css_default,
|
|
3477
3655
|
UserProfile_css_default
|
|
@@ -4245,6 +4423,10 @@ const PencilIcon = () => icon([(0, vue.h)("path", { d: "M17 3a2.828 2.828 0 1 1
|
|
|
4245
4423
|
const PasswordField = (0, vue.defineComponent)({
|
|
4246
4424
|
name: "PasswordField",
|
|
4247
4425
|
props: {
|
|
4426
|
+
autocomplete: {
|
|
4427
|
+
default: "current-password",
|
|
4428
|
+
type: String
|
|
4429
|
+
},
|
|
4248
4430
|
disabled: {
|
|
4249
4431
|
default: false,
|
|
4250
4432
|
type: Boolean
|
|
@@ -4292,6 +4474,7 @@ const PasswordField = (0, vue.defineComponent)({
|
|
|
4292
4474
|
for: props.name
|
|
4293
4475
|
}, [props.label, props.required ? (0, vue.h)("span", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("password-field__required") }, " *") : null]) : null,
|
|
4294
4476
|
(0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("password-field__wrapper") }, [(0, vue.h)("input", {
|
|
4477
|
+
autocomplete: props.autocomplete,
|
|
4295
4478
|
class: (0, __thunderid_browser.withVendorCSSClassPrefix)("password-field__input"),
|
|
4296
4479
|
"data-testid": attrs["data-testid"],
|
|
4297
4480
|
disabled: props.disabled,
|
|
@@ -4806,6 +4989,36 @@ const Spinner = (0, vue.defineComponent)({
|
|
|
4806
4989
|
});
|
|
4807
4990
|
var Spinner_default = Spinner;
|
|
4808
4991
|
|
|
4992
|
+
//#endregion
|
|
4993
|
+
//#region src/components/primitives/KeyValueList/KeyValueList.ts
|
|
4994
|
+
/**
|
|
4995
|
+
* Displays label and value pairs as a two-column description list, with an optional label above it.
|
|
4996
|
+
*/
|
|
4997
|
+
const KeyValueList = (0, vue.defineComponent)({
|
|
4998
|
+
name: "KeyValueList",
|
|
4999
|
+
props: {
|
|
5000
|
+
label: {
|
|
5001
|
+
default: void 0,
|
|
5002
|
+
type: String
|
|
5003
|
+
},
|
|
5004
|
+
pairs: {
|
|
5005
|
+
required: true,
|
|
5006
|
+
type: Array
|
|
5007
|
+
}
|
|
5008
|
+
},
|
|
5009
|
+
setup(props) {
|
|
5010
|
+
const labelId = (0, vue.useId)();
|
|
5011
|
+
return () => (0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("key-value-list") }, [props.label ? (0, vue.h)("span", {
|
|
5012
|
+
class: (0, __thunderid_browser.withVendorCSSClassPrefix)("key-value-list__label"),
|
|
5013
|
+
id: labelId
|
|
5014
|
+
}, props.label) : null, (0, vue.h)("dl", {
|
|
5015
|
+
"aria-labelledby": props.label ? labelId : void 0,
|
|
5016
|
+
class: (0, __thunderid_browser.withVendorCSSClassPrefix)("key-value-list__list")
|
|
5017
|
+
}, props.pairs.flatMap((pair) => [(0, vue.h)("dt", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("key-value-list__key") }, pair.label), (0, vue.h)("dd", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("key-value-list__value") }, pair.value)]))]);
|
|
5018
|
+
}
|
|
5019
|
+
});
|
|
5020
|
+
var KeyValueList_default = KeyValueList;
|
|
5021
|
+
|
|
4809
5022
|
//#endregion
|
|
4810
5023
|
//#region src/components/actions/BaseSignInButton.ts
|
|
4811
5024
|
/**
|
|
@@ -6351,6 +6564,19 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
|
|
|
6351
6564
|
key
|
|
6352
6565
|
}, timerText);
|
|
6353
6566
|
}
|
|
6567
|
+
case __thunderid_browser.EmbeddedFlowComponentType.KeyValueList: {
|
|
6568
|
+
const sourceKey = component.source;
|
|
6569
|
+
const pairs = (0, __thunderid_browser.parseKeyValuePairs)(sourceKey && options.additionalData ? options.additionalData[sourceKey] : void 0).map((pair) => ({
|
|
6570
|
+
...pair,
|
|
6571
|
+
label: resolve(pair.label)
|
|
6572
|
+
}));
|
|
6573
|
+
if (pairs.length === 0) return null;
|
|
6574
|
+
return (0, vue.h)(KeyValueList_default, {
|
|
6575
|
+
key,
|
|
6576
|
+
label: resolve(component.label) || void 0,
|
|
6577
|
+
pairs
|
|
6578
|
+
});
|
|
6579
|
+
}
|
|
6354
6580
|
default:
|
|
6355
6581
|
logger$2.warn(`Unsupported component type: ${component.type}. Skipping render.`);
|
|
6356
6582
|
return null;
|
|
@@ -7648,10 +7874,16 @@ const BaseSignUp = (0, vue.defineComponent)({
|
|
|
7648
7874
|
[name]: true
|
|
7649
7875
|
};
|
|
7650
7876
|
};
|
|
7651
|
-
|
|
7877
|
+
let cleanupActivePopup = null;
|
|
7878
|
+
(0, vue.onUnmounted)(() => cleanupActivePopup?.());
|
|
7879
|
+
const handleRedirectionIfNeeded = (response, existingPopup) => {
|
|
7652
7880
|
if (response?.type !== __thunderid_browser.EmbeddedFlowResponseType.Redirection || !response?.data?.redirectURL) return false;
|
|
7653
7881
|
const redirectUrl = response.data.redirectURL;
|
|
7654
|
-
const
|
|
7882
|
+
const expectedState = new URL(redirectUrl).searchParams.get("state");
|
|
7883
|
+
const isThisRound = (state) => !expectedState || state === expectedState;
|
|
7884
|
+
const reusablePopup = existingPopup && !existingPopup.closed ? existingPopup : null;
|
|
7885
|
+
if (reusablePopup) reusablePopup.location.href = redirectUrl;
|
|
7886
|
+
const popup = reusablePopup ?? window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
|
|
7655
7887
|
if (!popup) {
|
|
7656
7888
|
logger$1.error("Failed to open popup window");
|
|
7657
7889
|
return false;
|
|
@@ -7663,6 +7895,7 @@ const BaseSignUp = (0, vue.defineComponent)({
|
|
|
7663
7895
|
if (messageHandler) window.removeEventListener("message", messageHandler);
|
|
7664
7896
|
if (popupMonitor) clearInterval(popupMonitor);
|
|
7665
7897
|
};
|
|
7898
|
+
cleanupActivePopup = cleanup;
|
|
7666
7899
|
const processOAuthCode = async (code, state) => {
|
|
7667
7900
|
const payload = {
|
|
7668
7901
|
...currentFlow.value?.flowId && { flowId: currentFlow.value.flowId },
|
|
@@ -7675,15 +7908,24 @@ const BaseSignUp = (0, vue.defineComponent)({
|
|
|
7675
7908
|
};
|
|
7676
7909
|
try {
|
|
7677
7910
|
const continueResponse = await props.onSubmit(payload);
|
|
7911
|
+
cleanup();
|
|
7678
7912
|
props.onFlowChange?.(continueResponse);
|
|
7679
7913
|
if (continueResponse.flowStatus === __thunderid_browser.EmbeddedSignUpFlowStatus.Complete) props.onComplete?.(continueResponse);
|
|
7680
7914
|
else if (continueResponse.flowStatus === __thunderid_browser.EmbeddedSignUpFlowStatus.Incomplete) {
|
|
7915
|
+
if (continueResponse?.type === __thunderid_browser.EmbeddedFlowResponseType.Redirection) {
|
|
7916
|
+
if (!handleRedirectionIfNeeded(continueResponse, popup)) {
|
|
7917
|
+
popup.close();
|
|
7918
|
+
const popupError = new Error(t("errors.signup.popup.failure"));
|
|
7919
|
+
handleError(popupError);
|
|
7920
|
+
props.onError?.(popupError);
|
|
7921
|
+
}
|
|
7922
|
+
return;
|
|
7923
|
+
}
|
|
7681
7924
|
currentFlow.value = continueResponse;
|
|
7682
7925
|
setupFormFields(continueResponse);
|
|
7683
7926
|
if (continueResponse?.error) handleError(continueResponse);
|
|
7684
7927
|
}
|
|
7685
7928
|
popup.close();
|
|
7686
|
-
cleanup();
|
|
7687
7929
|
} catch (err) {
|
|
7688
7930
|
handleError(err);
|
|
7689
7931
|
props.onError?.(err);
|
|
@@ -7696,7 +7938,10 @@ const BaseSignUp = (0, vue.defineComponent)({
|
|
|
7696
7938
|
const expectedOrigin = props.afterSignUpUrl ? new URL(props.afterSignUpUrl).origin : window.location.origin;
|
|
7697
7939
|
if (event.origin !== expectedOrigin && event.origin !== window.location.origin) return;
|
|
7698
7940
|
const { code, state } = event.data;
|
|
7699
|
-
if (code && state
|
|
7941
|
+
if (code && state && isThisRound(state) && !hasProcessedCallback) {
|
|
7942
|
+
hasProcessedCallback = true;
|
|
7943
|
+
await processOAuthCode(code, state);
|
|
7944
|
+
}
|
|
7700
7945
|
};
|
|
7701
7946
|
window.addEventListener("message", messageHandler);
|
|
7702
7947
|
popupMonitor = setInterval(async () => {
|
|
@@ -7709,11 +7954,13 @@ const BaseSignUp = (0, vue.defineComponent)({
|
|
|
7709
7954
|
try {
|
|
7710
7955
|
const popupUrl = popup.location.href;
|
|
7711
7956
|
if (popupUrl && (popupUrl.includes("code=") || popupUrl.includes("error="))) {
|
|
7712
|
-
hasProcessedCallback = true;
|
|
7713
7957
|
const url = new URL(popupUrl);
|
|
7714
7958
|
const code = url.searchParams.get("code");
|
|
7715
7959
|
const state = url.searchParams.get("state");
|
|
7716
|
-
|
|
7960
|
+
const error = url.searchParams.get("error");
|
|
7961
|
+
if (!isThisRound(state)) return;
|
|
7962
|
+
hasProcessedCallback = true;
|
|
7963
|
+
if (error) {
|
|
7717
7964
|
logger$1.error("OAuth error");
|
|
7718
7965
|
popup.close();
|
|
7719
7966
|
cleanup();
|
|
@@ -7898,6 +8145,7 @@ const BaseSignUp = (0, vue.defineComponent)({
|
|
|
7898
8145
|
const { title, subtitle, componentsWithoutHeadings } = getAuthComponentHeadings_default(currentFlow.value.data?.components || [], void 0, void 0, t("signup.heading") || "Sign Up", t("signup.subheading") || "Create your account");
|
|
7899
8146
|
const meta = flowMetaRef.value;
|
|
7900
8147
|
const renderedComponents = componentsWithoutHeadings.length > 0 ? renderSignUpComponents(componentsWithoutHeadings, formValues.value, touchedFields.value, formErrors.value, isLoading.value, isFormValid.value, resetForm, handleInputChange, {
|
|
8148
|
+
additionalData: currentFlow.value.data?.additionalData,
|
|
7901
8149
|
buttonClassName: props.buttonClassName,
|
|
7902
8150
|
inputClassName: props.inputClassName,
|
|
7903
8151
|
meta,
|
|
@@ -8771,6 +9019,301 @@ const UserProfile = (0, vue.defineComponent)({
|
|
|
8771
9019
|
});
|
|
8772
9020
|
var UserProfile_default = UserProfile;
|
|
8773
9021
|
|
|
9022
|
+
//#endregion
|
|
9023
|
+
//#region src/components/presentation/change-credential/BaseChangeCredential.ts
|
|
9024
|
+
const ruleIcon = (passed) => passed ? CheckIcon() : XIcon();
|
|
9025
|
+
/**
|
|
9026
|
+
* Presentational change-credential form with just the two fields a first-time or
|
|
9027
|
+
* unverified credential change needs: new value and confirmation.
|
|
9028
|
+
*
|
|
9029
|
+
* Holds no context and performs no network calls: it renders the fields, evaluates the
|
|
9030
|
+
* policy for the checklist and the submit gate, and emits `submit` with the validated
|
|
9031
|
+
* values. Use `ChangeCredential` for the context-wired variant.
|
|
9032
|
+
*/
|
|
9033
|
+
const BaseChangeCredential = (0, vue.defineComponent)({
|
|
9034
|
+
name: "BaseChangeCredential",
|
|
9035
|
+
props: {
|
|
9036
|
+
cardLayout: {
|
|
9037
|
+
default: false,
|
|
9038
|
+
type: Boolean
|
|
9039
|
+
},
|
|
9040
|
+
className: {
|
|
9041
|
+
default: "",
|
|
9042
|
+
type: String
|
|
9043
|
+
},
|
|
9044
|
+
credentialDisplayName: {
|
|
9045
|
+
default: "Password",
|
|
9046
|
+
type: String
|
|
9047
|
+
},
|
|
9048
|
+
error: {
|
|
9049
|
+
default: null,
|
|
9050
|
+
type: String
|
|
9051
|
+
},
|
|
9052
|
+
fieldErrors: {
|
|
9053
|
+
default: () => ({}),
|
|
9054
|
+
type: Object
|
|
9055
|
+
},
|
|
9056
|
+
loading: {
|
|
9057
|
+
default: false,
|
|
9058
|
+
type: Boolean
|
|
9059
|
+
},
|
|
9060
|
+
policy: {
|
|
9061
|
+
default: () => ({}),
|
|
9062
|
+
type: Object
|
|
9063
|
+
},
|
|
9064
|
+
preferences: {
|
|
9065
|
+
default: void 0,
|
|
9066
|
+
type: Object
|
|
9067
|
+
},
|
|
9068
|
+
showRequirements: {
|
|
9069
|
+
default: true,
|
|
9070
|
+
type: Boolean
|
|
9071
|
+
},
|
|
9072
|
+
success: {
|
|
9073
|
+
default: false,
|
|
9074
|
+
type: Boolean
|
|
9075
|
+
},
|
|
9076
|
+
t: {
|
|
9077
|
+
default: void 0,
|
|
9078
|
+
type: Function
|
|
9079
|
+
},
|
|
9080
|
+
title: {
|
|
9081
|
+
default: void 0,
|
|
9082
|
+
type: String
|
|
9083
|
+
},
|
|
9084
|
+
unavailable: {
|
|
9085
|
+
default: false,
|
|
9086
|
+
type: Boolean
|
|
9087
|
+
}
|
|
9088
|
+
},
|
|
9089
|
+
emits: ["submit"],
|
|
9090
|
+
setup(props, { emit }) {
|
|
9091
|
+
const { t: fallbackT } = useI18n_default();
|
|
9092
|
+
const labelParams = (0, vue.computed)(() => ({
|
|
9093
|
+
credential: props.credentialDisplayName,
|
|
9094
|
+
credentialLower: props.credentialDisplayName.toLowerCase()
|
|
9095
|
+
}));
|
|
9096
|
+
const translate = (key, params) => (props.t ?? fallbackT)(key, {
|
|
9097
|
+
...labelParams.value,
|
|
9098
|
+
...params
|
|
9099
|
+
});
|
|
9100
|
+
const resolvedTitle = (0, vue.computed)(() => props.title ?? translate("user.change_password.heading"));
|
|
9101
|
+
const newPassword = (0, vue.ref)("");
|
|
9102
|
+
const confirmPassword = (0, vue.ref)("");
|
|
9103
|
+
const submitted = (0, vue.ref)(false);
|
|
9104
|
+
(0, vue.watch)(() => props.success, (succeeded) => {
|
|
9105
|
+
if (!succeeded) return;
|
|
9106
|
+
newPassword.value = "";
|
|
9107
|
+
confirmPassword.value = "";
|
|
9108
|
+
submitted.value = false;
|
|
9109
|
+
});
|
|
9110
|
+
const evaluation = (0, vue.computed)(() => (0, __thunderid_browser.evaluateChangePasswordForm)({
|
|
9111
|
+
confirmPassword: confirmPassword.value,
|
|
9112
|
+
newPassword: newPassword.value
|
|
9113
|
+
}, props.policy));
|
|
9114
|
+
const ruleResults = (0, vue.computed)(() => evaluation.value.ruleResults);
|
|
9115
|
+
const confirmMatches = (0, vue.computed)(() => evaluation.value.confirmMatches);
|
|
9116
|
+
const interactionDisabled = (0, vue.computed)(() => props.loading || props.unavailable);
|
|
9117
|
+
const canSubmit = (0, vue.computed)(() => !interactionDisabled.value && evaluation.value.isValid);
|
|
9118
|
+
function handleSubmit(event) {
|
|
9119
|
+
event.preventDefault();
|
|
9120
|
+
submitted.value = true;
|
|
9121
|
+
if (!canSubmit.value) return;
|
|
9122
|
+
emit("submit", { newPassword: newPassword.value });
|
|
9123
|
+
}
|
|
9124
|
+
return () => {
|
|
9125
|
+
const rootClass = [
|
|
9126
|
+
(0, __thunderid_browser.withVendorCSSClassPrefix)("change-credential"),
|
|
9127
|
+
props.cardLayout ? (0, __thunderid_browser.withVendorCSSClassPrefix)("change-credential--card") : "",
|
|
9128
|
+
props.className
|
|
9129
|
+
].filter(Boolean).join(" ");
|
|
9130
|
+
const confirmError = submitted.value && !confirmMatches.value ? translate("user.change_password.mismatch.error") : void 0;
|
|
9131
|
+
const newPasswordError = props.fieldErrors["newPassword"];
|
|
9132
|
+
const form = (0, vue.h)("form", {
|
|
9133
|
+
class: rootClass,
|
|
9134
|
+
novalidate: true,
|
|
9135
|
+
onSubmit: handleSubmit
|
|
9136
|
+
}, [
|
|
9137
|
+
resolvedTitle.value ? (0, vue.h)("h3", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("change-credential__heading") }, resolvedTitle.value) : null,
|
|
9138
|
+
props.error ? (0, vue.h)(Alert_default, { severity: "error" }, { default: () => [props.error] }) : null,
|
|
9139
|
+
props.success ? (0, vue.h)(Alert_default, { severity: "success" }, { default: () => [translate("user.change_password.success")] }) : null,
|
|
9140
|
+
(0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("change-credential__fields") }, [
|
|
9141
|
+
(0, vue.h)(PasswordField_default, {
|
|
9142
|
+
autocomplete: "new-password",
|
|
9143
|
+
disabled: interactionDisabled.value,
|
|
9144
|
+
error: newPasswordError,
|
|
9145
|
+
label: translate("user.change_password.new.label"),
|
|
9146
|
+
modelValue: newPassword.value,
|
|
9147
|
+
name: "newPassword",
|
|
9148
|
+
"onUpdate:modelValue": (value) => {
|
|
9149
|
+
newPassword.value = value;
|
|
9150
|
+
},
|
|
9151
|
+
placeholder: translate("user.change_password.new.placeholder"),
|
|
9152
|
+
required: true
|
|
9153
|
+
}),
|
|
9154
|
+
props.showRequirements && ruleResults.value.length > 0 ? (0, vue.h)("div", {}, [(0, vue.h)("p", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("change-credential__requirements-heading") }, translate("user.change_password.requirements.heading")), (0, vue.h)("ul", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("change-credential__requirements") }, ruleResults.value.map((rule) => (0, vue.h)("li", {
|
|
9155
|
+
class: [(0, __thunderid_browser.withVendorCSSClassPrefix)("change-credential__requirement"), rule.passed ? (0, __thunderid_browser.withVendorCSSClassPrefix)("change-credential__requirement--passed") : ""].filter(Boolean).join(" "),
|
|
9156
|
+
"data-passed": String(rule.passed),
|
|
9157
|
+
key: rule.key
|
|
9158
|
+
}, [(0, vue.h)("span", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("change-credential__requirement-icon") }, [ruleIcon(rule.passed)]), (0, vue.h)("span", {}, translate(rule.messageKey, rule.params))])))]) : null,
|
|
9159
|
+
(0, vue.h)(PasswordField_default, {
|
|
9160
|
+
autocomplete: "new-password",
|
|
9161
|
+
disabled: interactionDisabled.value,
|
|
9162
|
+
error: confirmError,
|
|
9163
|
+
label: translate("user.change_password.confirm.label"),
|
|
9164
|
+
modelValue: confirmPassword.value,
|
|
9165
|
+
name: "confirmPassword",
|
|
9166
|
+
"onUpdate:modelValue": (value) => {
|
|
9167
|
+
confirmPassword.value = value;
|
|
9168
|
+
},
|
|
9169
|
+
placeholder: translate("user.change_password.confirm.placeholder"),
|
|
9170
|
+
required: true
|
|
9171
|
+
})
|
|
9172
|
+
]),
|
|
9173
|
+
(0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("change-credential__actions") }, [(0, vue.h)(Button_default, {
|
|
9174
|
+
color: "primary",
|
|
9175
|
+
disabled: !canSubmit.value,
|
|
9176
|
+
loading: props.loading,
|
|
9177
|
+
type: "submit",
|
|
9178
|
+
variant: "solid"
|
|
9179
|
+
}, { default: () => [translate("user.change_password.submit")] })])
|
|
9180
|
+
]);
|
|
9181
|
+
if (!props.unavailable) return form;
|
|
9182
|
+
return (0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("change-credential__unavailable") }, [(0, vue.h)("div", {
|
|
9183
|
+
"aria-hidden": "true",
|
|
9184
|
+
class: (0, __thunderid_browser.withVendorCSSClassPrefix)("change-credential__unavailable-content")
|
|
9185
|
+
}, [form]), (0, vue.h)("div", {
|
|
9186
|
+
class: (0, __thunderid_browser.withVendorCSSClassPrefix)("change-credential__unavailable-overlay"),
|
|
9187
|
+
role: "status"
|
|
9188
|
+
}, [(0, vue.h)(Alert_default, { severity: "warning" }, { default: () => [(0, vue.h)("strong", translate("user.change_password.unavailable.heading")), (0, vue.h)("div", translate("user.change_password.unavailable.description"))] })])]);
|
|
9189
|
+
};
|
|
9190
|
+
}
|
|
9191
|
+
});
|
|
9192
|
+
var BaseChangeCredential_default = BaseChangeCredential;
|
|
9193
|
+
|
|
9194
|
+
//#endregion
|
|
9195
|
+
//#region src/api/updateMeCredentials.ts
|
|
9196
|
+
const updateMeCredentials = async ({ fetcher, instanceId = 0,...requestConfig }) => {
|
|
9197
|
+
return (0, __thunderid_browser.updateMeCredentials)({
|
|
9198
|
+
...requestConfig,
|
|
9199
|
+
fetcher: fetcher || (0, __thunderid_browser.createHttpClientFetcher)(instanceId)
|
|
9200
|
+
});
|
|
9201
|
+
};
|
|
9202
|
+
var updateMeCredentials_default = updateMeCredentials;
|
|
9203
|
+
|
|
9204
|
+
//#endregion
|
|
9205
|
+
//#region src/components/presentation/change-credential/ChangeCredential.ts
|
|
9206
|
+
/**
|
|
9207
|
+
* Title-cases a credential attribute name for use as a display-name fallback when the schema
|
|
9208
|
+
* declares no `displayName` for it, e.g. `pin` -> `Pin`.
|
|
9209
|
+
*/
|
|
9210
|
+
const defaultDisplayName = (attribute) => attribute.charAt(0).toUpperCase() + attribute.slice(1);
|
|
9211
|
+
/**
|
|
9212
|
+
* ChangeCredential lets the signed-in user set a new value for one of their own credentials.
|
|
9213
|
+
*
|
|
9214
|
+
* It collects only a new value and its confirmation. The self-service credential write path
|
|
9215
|
+
* does not verify the account's existing value today, so this component does not ask for one;
|
|
9216
|
+
* once server-side current-value verification ships, that field returns without a breaking
|
|
9217
|
+
* change to this component's public props.
|
|
9218
|
+
*/
|
|
9219
|
+
const ChangeCredential = (0, vue.defineComponent)({
|
|
9220
|
+
name: "ChangeCredential",
|
|
9221
|
+
props: {
|
|
9222
|
+
attribute: {
|
|
9223
|
+
default: __thunderid_browser.CredentialConstants.PASSWORD,
|
|
9224
|
+
type: String
|
|
9225
|
+
},
|
|
9226
|
+
cardLayout: {
|
|
9227
|
+
default: false,
|
|
9228
|
+
type: Boolean
|
|
9229
|
+
},
|
|
9230
|
+
className: {
|
|
9231
|
+
default: "",
|
|
9232
|
+
type: String
|
|
9233
|
+
},
|
|
9234
|
+
policy: {
|
|
9235
|
+
default: void 0,
|
|
9236
|
+
type: Object
|
|
9237
|
+
},
|
|
9238
|
+
preferences: {
|
|
9239
|
+
default: void 0,
|
|
9240
|
+
type: Object
|
|
9241
|
+
},
|
|
9242
|
+
showRequirements: {
|
|
9243
|
+
default: true,
|
|
9244
|
+
type: Boolean
|
|
9245
|
+
},
|
|
9246
|
+
title: {
|
|
9247
|
+
default: void 0,
|
|
9248
|
+
type: String
|
|
9249
|
+
}
|
|
9250
|
+
},
|
|
9251
|
+
emits: ["success"],
|
|
9252
|
+
setup(props, { emit }) {
|
|
9253
|
+
const { baseUrl, endpoints, instanceId, preferences: contextPreferences } = useThunderID_default();
|
|
9254
|
+
const { userSchema } = useUser_default();
|
|
9255
|
+
const { t } = useI18n_default();
|
|
9256
|
+
const resolvedDisplayName = (0, vue.computed)(() => userSchema?.value?.[props.attribute]?.displayName ?? defaultDisplayName(props.attribute));
|
|
9257
|
+
const resolvedPreferences = (0, vue.computed)(() => ({
|
|
9258
|
+
...contextPreferences,
|
|
9259
|
+
...props.preferences,
|
|
9260
|
+
user: {
|
|
9261
|
+
...contextPreferences?.user,
|
|
9262
|
+
...props.preferences?.user
|
|
9263
|
+
}
|
|
9264
|
+
}));
|
|
9265
|
+
const error = (0, vue.ref)(null);
|
|
9266
|
+
const fieldErrors = (0, vue.ref)({});
|
|
9267
|
+
const loading = (0, vue.ref)(false);
|
|
9268
|
+
const success = (0, vue.ref)(false);
|
|
9269
|
+
const resolvedPolicy = (0, vue.computed)(() => (0, __thunderid_browser.resolveChangeCredentialPolicy)(userSchema?.value, props.attribute, props.policy));
|
|
9270
|
+
async function handleSubmit({ newPassword }) {
|
|
9271
|
+
error.value = null;
|
|
9272
|
+
fieldErrors.value = {};
|
|
9273
|
+
success.value = false;
|
|
9274
|
+
loading.value = true;
|
|
9275
|
+
try {
|
|
9276
|
+
await updateMeCredentials_default({
|
|
9277
|
+
baseUrl,
|
|
9278
|
+
instanceId,
|
|
9279
|
+
payload: { [props.attribute]: newPassword },
|
|
9280
|
+
url: (0, __thunderid_browser.resolveResourceEndpoint)("usersMeCredentials", { endpoints })
|
|
9281
|
+
});
|
|
9282
|
+
success.value = true;
|
|
9283
|
+
emit("success");
|
|
9284
|
+
} catch (caughtError) {
|
|
9285
|
+
const { field, message, messageKey } = (0, __thunderid_browser.mapCredentialUpdateError)(caughtError);
|
|
9286
|
+
const text = message ?? t(messageKey, {
|
|
9287
|
+
credential: resolvedDisplayName.value,
|
|
9288
|
+
credentialLower: resolvedDisplayName.value.toLowerCase()
|
|
9289
|
+
});
|
|
9290
|
+
if (field) fieldErrors.value = { [field]: text };
|
|
9291
|
+
else error.value = text;
|
|
9292
|
+
} finally {
|
|
9293
|
+
loading.value = false;
|
|
9294
|
+
}
|
|
9295
|
+
}
|
|
9296
|
+
return () => (0, vue.h)(BaseChangeCredential_default, {
|
|
9297
|
+
cardLayout: props.cardLayout,
|
|
9298
|
+
class: (0, __thunderid_browser.withVendorCSSClassPrefix)("change-credential--styled"),
|
|
9299
|
+
className: props.className,
|
|
9300
|
+
credentialDisplayName: resolvedDisplayName.value,
|
|
9301
|
+
error: error.value,
|
|
9302
|
+
fieldErrors: fieldErrors.value,
|
|
9303
|
+
loading: loading.value,
|
|
9304
|
+
onSubmit: handleSubmit,
|
|
9305
|
+
policy: resolvedPolicy.value,
|
|
9306
|
+
preferences: resolvedPreferences.value,
|
|
9307
|
+
showRequirements: props.showRequirements,
|
|
9308
|
+
success: success.value,
|
|
9309
|
+
t,
|
|
9310
|
+
title: props.title,
|
|
9311
|
+
unavailable: !(0, __thunderid_browser.supportsCredential)(userSchema?.value, props.attribute)
|
|
9312
|
+
});
|
|
9313
|
+
}
|
|
9314
|
+
});
|
|
9315
|
+
var ChangeCredential_default = ChangeCredential;
|
|
9316
|
+
|
|
8774
9317
|
//#endregion
|
|
8775
9318
|
//#region src/components/presentation/user-dropdown/BaseUserDropdown.ts
|
|
8776
9319
|
const DEFAULT_ATTRIBUTE_MAPPINGS = {
|
|
@@ -8862,10 +9405,18 @@ const BaseUserDropdown = (0, vue.defineComponent)({
|
|
|
8862
9405
|
default: null,
|
|
8863
9406
|
type: Object
|
|
8864
9407
|
},
|
|
9408
|
+
profileLabel: {
|
|
9409
|
+
default: "Profile",
|
|
9410
|
+
type: String
|
|
9411
|
+
},
|
|
8865
9412
|
showChevron: {
|
|
8866
9413
|
default: false,
|
|
8867
9414
|
type: Boolean
|
|
8868
9415
|
},
|
|
9416
|
+
showTriggerLabel: {
|
|
9417
|
+
default: false,
|
|
9418
|
+
type: Boolean
|
|
9419
|
+
},
|
|
8869
9420
|
size: {
|
|
8870
9421
|
default: "md",
|
|
8871
9422
|
type: String
|
|
@@ -8953,17 +9504,21 @@ const BaseUserDropdown = (0, vue.defineComponent)({
|
|
|
8953
9504
|
isOpen.value = !isOpen.value;
|
|
8954
9505
|
},
|
|
8955
9506
|
type: "button"
|
|
8956
|
-
}, [
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
|
|
8964
|
-
|
|
8965
|
-
|
|
8966
|
-
|
|
9507
|
+
}, [
|
|
9508
|
+
picture && !avatarImageError.value ? (0, vue.h)("img", {
|
|
9509
|
+
alt: displayName,
|
|
9510
|
+
class: [px("user-dropdown__avatar"), avatarSizeClass].filter(Boolean).join(" "),
|
|
9511
|
+
onError: () => {
|
|
9512
|
+
avatarImageError.value = true;
|
|
9513
|
+
},
|
|
9514
|
+
src: picture
|
|
9515
|
+
}) : (0, vue.h)("span", {
|
|
9516
|
+
class: [px("user-dropdown__avatar"), avatarSizeClass].filter(Boolean).join(" "),
|
|
9517
|
+
style: { background: gradient }
|
|
9518
|
+
}, initials),
|
|
9519
|
+
props.showTriggerLabel ? (0, vue.h)("span", { class: px("user-dropdown__trigger-label") }, displayName) : null,
|
|
9520
|
+
props.showChevron ? (0, vue.h)("span", { class: px("user-dropdown__chevron") }, [(0, vue.h)(ChevronDownIcon, { size: 14 })]) : null
|
|
9521
|
+
]);
|
|
8967
9522
|
let menu = null;
|
|
8968
9523
|
if (isOpen.value) {
|
|
8969
9524
|
const alignClass = resolveMenuAlign() === "left" ? px("user-dropdown__menu--align-left") : "";
|
|
@@ -8990,7 +9545,7 @@ const BaseUserDropdown = (0, vue.defineComponent)({
|
|
|
8990
9545
|
props.onProfileClick();
|
|
8991
9546
|
},
|
|
8992
9547
|
type: "button"
|
|
8993
|
-
}, [(0, vue.h)(UserIcon, { size: 15 }), (0, vue.h)("span", null, "Profile")]));
|
|
9548
|
+
}, [(0, vue.h)(UserIcon, { size: 15 }), (0, vue.h)("span", null, props.profileLabel ?? "Profile")]));
|
|
8994
9549
|
if (props.menuItems && props.menuItems.length > 0) props.menuItems.forEach((item, idx) => {
|
|
8995
9550
|
if (item.separatorBefore) menuChildren.push((0, vue.h)("div", {
|
|
8996
9551
|
class: px("user-dropdown__menu-divider"),
|
|
@@ -9085,6 +9640,14 @@ const UserDropdown = (0, vue.defineComponent)({
|
|
|
9085
9640
|
default: void 0,
|
|
9086
9641
|
type: Array
|
|
9087
9642
|
},
|
|
9643
|
+
onManageProfile: {
|
|
9644
|
+
default: void 0,
|
|
9645
|
+
type: Function
|
|
9646
|
+
},
|
|
9647
|
+
profileLabel: {
|
|
9648
|
+
default: void 0,
|
|
9649
|
+
type: String
|
|
9650
|
+
},
|
|
9088
9651
|
showChevron: {
|
|
9089
9652
|
default: false,
|
|
9090
9653
|
type: Boolean
|
|
@@ -9092,6 +9655,10 @@ const UserDropdown = (0, vue.defineComponent)({
|
|
|
9092
9655
|
size: {
|
|
9093
9656
|
default: "md",
|
|
9094
9657
|
type: String
|
|
9658
|
+
},
|
|
9659
|
+
showTriggerLabel: {
|
|
9660
|
+
default: false,
|
|
9661
|
+
type: Boolean
|
|
9095
9662
|
}
|
|
9096
9663
|
},
|
|
9097
9664
|
emits: ["profileClick"],
|
|
@@ -9105,6 +9672,10 @@ const UserDropdown = (0, vue.defineComponent)({
|
|
|
9105
9672
|
menuAlign: props.menuAlign,
|
|
9106
9673
|
menuItems: props.menuItems,
|
|
9107
9674
|
onProfileClick: () => {
|
|
9675
|
+
if (props.onManageProfile) {
|
|
9676
|
+
props.onManageProfile();
|
|
9677
|
+
return;
|
|
9678
|
+
}
|
|
9108
9679
|
isProfileModalOpen.value = true;
|
|
9109
9680
|
emit("profileClick");
|
|
9110
9681
|
},
|
|
@@ -9114,12 +9685,14 @@ const UserDropdown = (0, vue.defineComponent)({
|
|
|
9114
9685
|
onSignOut: () => {
|
|
9115
9686
|
signOut();
|
|
9116
9687
|
},
|
|
9117
|
-
profileContent: isProfileModalOpen.value ? (0, vue.h)(UserProfile_default, {
|
|
9688
|
+
profileContent: !props.onManageProfile && isProfileModalOpen.value ? (0, vue.h)(UserProfile_default, {
|
|
9118
9689
|
cardLayout: false,
|
|
9119
9690
|
compact: true,
|
|
9120
9691
|
editable: true
|
|
9121
9692
|
}) : null,
|
|
9693
|
+
profileLabel: props.profileLabel,
|
|
9122
9694
|
showChevron: props.showChevron,
|
|
9695
|
+
showTriggerLabel: props.showTriggerLabel,
|
|
9123
9696
|
size: props.size,
|
|
9124
9697
|
user: user.value
|
|
9125
9698
|
}, slots);
|
|
@@ -10348,6 +10921,7 @@ exports.AcceptInvite = AcceptInvite_default;
|
|
|
10348
10921
|
exports.Alert = Alert_default;
|
|
10349
10922
|
exports.ArrowLeftRightIcon = ArrowLeftRightIcon;
|
|
10350
10923
|
exports.BaseAcceptInvite = BaseAcceptInvite_default;
|
|
10924
|
+
exports.BaseChangeCredential = BaseChangeCredential_default;
|
|
10351
10925
|
exports.BaseInviteUser = BaseInviteUser_default;
|
|
10352
10926
|
exports.BaseLanguageSwitcher = BaseLanguageSwitcher_default;
|
|
10353
10927
|
exports.BaseSignIn = BaseSignIn_default;
|
|
@@ -10361,6 +10935,7 @@ exports.BuildingIcon = BuildingIcon;
|
|
|
10361
10935
|
exports.Button = Button_default;
|
|
10362
10936
|
exports.Callback = Callback_default;
|
|
10363
10937
|
exports.Card = Card_default;
|
|
10938
|
+
exports.ChangeCredential = ChangeCredential_default;
|
|
10364
10939
|
exports.CheckIcon = CheckIcon;
|
|
10365
10940
|
exports.Checkbox = Checkbox_default;
|
|
10366
10941
|
exports.ChevronDownIcon = ChevronDownIcon;
|
|
@@ -10437,6 +11012,7 @@ exports.I18N_KEY = I18N_KEY;
|
|
|
10437
11012
|
exports.I18nProvider = I18nProvider_default;
|
|
10438
11013
|
exports.InfoIcon = InfoIcon;
|
|
10439
11014
|
exports.InviteUser = InviteUser_default;
|
|
11015
|
+
exports.KeyValueList = KeyValueList_default;
|
|
10440
11016
|
exports.LanguageSwitcher = LanguageSwitcher_default;
|
|
10441
11017
|
exports.Loading = Loading_default;
|
|
10442
11018
|
exports.LogOutIcon = LogOutIcon;
|
|
@@ -10536,6 +11112,12 @@ Object.defineProperty(exports, 'navigate', {
|
|
|
10536
11112
|
}
|
|
10537
11113
|
});
|
|
10538
11114
|
exports.normalizeFlowResponse = normalizeFlowResponse;
|
|
11115
|
+
Object.defineProperty(exports, 'parseKeyValuePairs', {
|
|
11116
|
+
enumerable: true,
|
|
11117
|
+
get: function () {
|
|
11118
|
+
return __thunderid_browser.parseKeyValuePairs;
|
|
11119
|
+
}
|
|
11120
|
+
});
|
|
10539
11121
|
exports.useFlow = useFlow_default;
|
|
10540
11122
|
exports.useFlowMeta = useFlowMeta_default;
|
|
10541
11123
|
exports.useI18n = useI18n_default;
|