@thunderid/vue 0.13.0 → 0.13.2
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/getUsersMeMeta.d.ts +22 -0
- package/dist/api/getUsersMeMeta.d.ts.map +1 -0
- package/dist/cjs/index.cjs +801 -252
- package/dist/components/adapters/GoogleButton.d.ts.map +1 -1
- package/dist/components/presentation/user-dropdown/BaseUserDropdown.d.ts.map +1 -1
- package/dist/components/presentation/user-dropdown/UserDropdown.css.d.ts +1 -1
- package/dist/components/presentation/user-dropdown/UserDropdown.css.d.ts.map +1 -1
- package/dist/components/presentation/user-profile/BaseUserProfile.d.ts +4 -1
- package/dist/components/presentation/user-profile/BaseUserProfile.d.ts.map +1 -1
- package/dist/components/presentation/user-profile/UserProfile.css.d.ts +2 -12
- package/dist/components/presentation/user-profile/UserProfile.css.d.ts.map +1 -1
- package/dist/components/presentation/user-profile/UserProfile.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +803 -255
- package/dist/models/contexts.d.ts +9 -5
- package/dist/models/contexts.d.ts.map +1 -1
- package/dist/providers/ThunderIDProvider.d.ts.map +1 -1
- package/dist/providers/UserProvider.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConsentConstants, DEFAULT_THEME, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowComponentType as EmbeddedFlowComponentType$1, EmbeddedFlowEventType, EmbeddedFlowEventType as EmbeddedFlowEventType$1, EmbeddedFlowResponseType, EmbeddedFlowTextVariant, EmbeddedFlowType, EmbeddedSignInFlowStatus, EmbeddedSignInFlowStatus as EmbeddedSignInFlowStatus$1, EmbeddedSignInFlowType, EmbeddedSignInFlowType as EmbeddedSignInFlowType$1, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowStatus as EmbeddedSignUpFlowStatus$1, EmbeddedSignUpFlowType, FetchHttpClient, FieldType, FieldType as FieldType$1, FlowMetaType, ThunderIDAPIError, ThunderIDBrowserClient, ThunderIDError, ThunderIDRuntimeError, ThunderIDRuntimeError as ThunderIDRuntimeError$1, TranslationBundleConstants, arrayBufferToBase64url, base64urlToArrayBuffer, createClassObserver, createClassObserver as createClassObserver$1, createMediaQueryListener, createMediaQueryListener as createMediaQueryListener$1, createPackageComponentLogger, createPackageLogger, createTheme, deepMerge, detectThemeMode, detectThemeMode as detectThemeMode$1, executeEmbeddedSignInFlow, executeEmbeddedSignUpFlow, extractEmojiFromUri, extractUserClaimsFromIdToken, generateFlattenedUserProfile, get, getActiveTheme, getDefaultI18nBundles, getFlowMeta, getUsersMe, getVendorPrefix, handleWebAuthnAuthentication, hasAuthParamsInUrl, hasAuthParamsInUrl as hasAuthParamsInUrl$1, hasCalledForThisInstanceInUrl, http, isEmojiUri, isEmpty, navigate, navigate as navigate$1, normalizeBorderRadius, normalizeTranslations, resolveFlowTemplateLiterals, resolveLogoUri, resolveResourceEndpoint, updateMeProfile, withVendorCSSClassPrefix } from "@thunderid/browser";
|
|
2
|
-
import { Fragment, computed, defineComponent, h, inject, nextTick, onBeforeUnmount, onMounted, onUnmounted, provide, readonly, ref, shallowReadonly, shallowRef, watch } from "vue";
|
|
1
|
+
import { ConsentConstants, DEFAULT_THEME, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowComponentType as EmbeddedFlowComponentType$1, EmbeddedFlowEventType, EmbeddedFlowEventType as EmbeddedFlowEventType$1, EmbeddedFlowResponseType, EmbeddedFlowTextVariant, EmbeddedFlowType, EmbeddedSignInFlowStatus, EmbeddedSignInFlowStatus as EmbeddedSignInFlowStatus$1, EmbeddedSignInFlowType, EmbeddedSignInFlowType as EmbeddedSignInFlowType$1, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowStatus as EmbeddedSignUpFlowStatus$1, EmbeddedSignUpFlowType, FetchHttpClient, FieldType, FieldType as FieldType$1, FlowMetaType, ThunderIDAPIError, ThunderIDBrowserClient, ThunderIDError, ThunderIDRuntimeError, ThunderIDRuntimeError as ThunderIDRuntimeError$1, TranslationBundleConstants, arrayBufferToBase64url, base64urlToArrayBuffer, createClassObserver, createClassObserver as createClassObserver$1, createMediaQueryListener, createMediaQueryListener as createMediaQueryListener$1, createPackageComponentLogger, createPackageLogger, createTheme, deepMerge, detectThemeMode, detectThemeMode as detectThemeMode$1, executeEmbeddedSignInFlow, executeEmbeddedSignUpFlow, extractEmojiFromUri, extractUserClaimsFromIdToken, generateFlattenedUserProfile, get, getActiveTheme, getDefaultI18nBundles, getFlowMeta, getUsersMe, getUsersMeMeta, getVendorPrefix, handleWebAuthnAuthentication, hasAuthParamsInUrl, hasAuthParamsInUrl as hasAuthParamsInUrl$1, hasCalledForThisInstanceInUrl, http, isEmojiUri, isEmpty, navigate, navigate as navigate$1, normalizeBorderRadius, normalizeTranslations, resolveFlowTemplateLiterals, resolveLogoUri, resolveResourceEndpoint, startCase, updateMeProfile, withVendorCSSClassPrefix } from "@thunderid/browser";
|
|
2
|
+
import { Fragment, Teleport, computed, defineComponent, h, inject, nextTick, onBeforeUnmount, onMounted, onUnmounted, provide, readonly, ref, shallowReadonly, shallowRef, watch } from "vue";
|
|
3
3
|
import DOMPurify from "dompurify";
|
|
4
4
|
|
|
5
5
|
//#region src/keys.ts
|
|
@@ -548,20 +548,23 @@ const UserProvider = defineComponent({
|
|
|
548
548
|
updateProfile: {
|
|
549
549
|
default: void 0,
|
|
550
550
|
type: Function
|
|
551
|
+
},
|
|
552
|
+
userSchema: {
|
|
553
|
+
default: null,
|
|
554
|
+
type: Object
|
|
551
555
|
}
|
|
552
556
|
},
|
|
553
557
|
setup(props, { slots }) {
|
|
554
558
|
const profileRef = computed(() => props.profile);
|
|
559
|
+
const flattenedProfileRef = computed(() => props.profile?.flattenedProfile ?? null);
|
|
560
|
+
const userSchemaRef = computed(() => props.profile?.userSchema ?? props.userSchema ?? null);
|
|
555
561
|
provide(USER_KEY, {
|
|
556
|
-
flattenedProfile:
|
|
562
|
+
flattenedProfile: flattenedProfileRef,
|
|
557
563
|
onUpdateProfile: props.onUpdateProfile ?? (() => {}),
|
|
558
564
|
profile: profileRef,
|
|
559
565
|
revalidateProfile: props.revalidateProfile,
|
|
560
|
-
updateProfile: props.updateProfile
|
|
561
|
-
|
|
562
|
-
error: "updateProfile callback not provided",
|
|
563
|
-
success: false
|
|
564
|
-
}))
|
|
566
|
+
updateProfile: props.updateProfile,
|
|
567
|
+
userSchema: userSchemaRef
|
|
565
568
|
});
|
|
566
569
|
return () => h("div", { style: "display:contents" }, slots["default"]?.());
|
|
567
570
|
}
|
|
@@ -592,6 +595,34 @@ const getUsersMe$1 = async ({ fetcher, instanceId = 0,...requestConfig }) => {
|
|
|
592
595
|
};
|
|
593
596
|
var getUsersMe_default = getUsersMe$1;
|
|
594
597
|
|
|
598
|
+
//#endregion
|
|
599
|
+
//#region src/api/getUsersMeMeta.ts
|
|
600
|
+
/**
|
|
601
|
+
* Retrieves the user schema metadata from the specified /users/me/meta endpoint.
|
|
602
|
+
* Uses ThunderID SPA client FetchHttpClient by default with multi-instance support.
|
|
603
|
+
*/
|
|
604
|
+
const getUsersMeMeta$1 = async ({ fetcher, instanceId = 0,...requestConfig }) => {
|
|
605
|
+
const defaultFetcher = async (url, config) => {
|
|
606
|
+
const response = await FetchHttpClient.getInstance(instanceId).request({
|
|
607
|
+
headers: config.headers,
|
|
608
|
+
method: config.method ?? "GET",
|
|
609
|
+
url
|
|
610
|
+
});
|
|
611
|
+
return {
|
|
612
|
+
json: () => Promise.resolve(response.data),
|
|
613
|
+
ok: response.status >= 200 && response.status < 300,
|
|
614
|
+
status: response.status,
|
|
615
|
+
statusText: response.statusText || "",
|
|
616
|
+
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
return getUsersMeMeta({
|
|
620
|
+
...requestConfig,
|
|
621
|
+
fetcher: fetcher ?? defaultFetcher
|
|
622
|
+
});
|
|
623
|
+
};
|
|
624
|
+
var getUsersMeMeta_default = getUsersMeMeta$1;
|
|
625
|
+
|
|
595
626
|
//#endregion
|
|
596
627
|
//#region src/ThunderIDVueClient.ts
|
|
597
628
|
/**
|
|
@@ -837,6 +868,10 @@ const ThunderIDProvider = defineComponent({
|
|
|
837
868
|
default: void 0,
|
|
838
869
|
type: String
|
|
839
870
|
},
|
|
871
|
+
preferences: {
|
|
872
|
+
default: void 0,
|
|
873
|
+
type: Object
|
|
874
|
+
},
|
|
840
875
|
scopes: {
|
|
841
876
|
default: void 0,
|
|
842
877
|
type: [Array, String]
|
|
@@ -874,6 +909,7 @@ const ThunderIDProvider = defineComponent({
|
|
|
874
909
|
const isLoading = ref(true);
|
|
875
910
|
const user = shallowRef(null);
|
|
876
911
|
const userProfile = shallowRef(null);
|
|
912
|
+
const userSchema = ref(null);
|
|
877
913
|
const resolvedBaseUrl = ref(props.baseUrl);
|
|
878
914
|
let isUpdatingSession = false;
|
|
879
915
|
let signInCheckInterval;
|
|
@@ -888,6 +924,7 @@ const ThunderIDProvider = defineComponent({
|
|
|
888
924
|
endpoints: props.endpoints,
|
|
889
925
|
organizationChain: props.organizationChain,
|
|
890
926
|
organizationHandle: props.organizationHandle,
|
|
927
|
+
preferences: props.preferences,
|
|
891
928
|
scopes: props.scopes,
|
|
892
929
|
signInOptions: props.signInOptions,
|
|
893
930
|
signInUrl: props.signInUrl,
|
|
@@ -907,13 +944,40 @@ const ThunderIDProvider = defineComponent({
|
|
|
907
944
|
baseUrl = `${(await client.getConfiguration()).baseUrl}/o`;
|
|
908
945
|
resolvedBaseUrl.value = baseUrl;
|
|
909
946
|
}
|
|
947
|
+
const shouldFetchProfile = props.preferences?.user?.fetchUserProfile !== false;
|
|
910
948
|
const claims = extractUserClaimsFromIdToken(decodedToken);
|
|
911
|
-
|
|
949
|
+
let profileData = claims;
|
|
950
|
+
const currentSignInStatus = await client.isSignedIn();
|
|
951
|
+
if (currentSignInStatus && shouldFetchProfile) {
|
|
952
|
+
try {
|
|
953
|
+
const fetchedProfile = await getUsersMe_default({
|
|
954
|
+
baseUrl,
|
|
955
|
+
url: resolveResourceEndpoint("usersMe", { endpoints: props.endpoints }),
|
|
956
|
+
instanceId: props.instanceId
|
|
957
|
+
});
|
|
958
|
+
profileData = {
|
|
959
|
+
...claims,
|
|
960
|
+
...fetchedProfile
|
|
961
|
+
};
|
|
962
|
+
} catch {}
|
|
963
|
+
try {
|
|
964
|
+
const metaRes = await getUsersMeMeta_default({
|
|
965
|
+
baseUrl,
|
|
966
|
+
url: resolveResourceEndpoint("usersMeMeta", { endpoints: props.endpoints }),
|
|
967
|
+
instanceId: props.instanceId
|
|
968
|
+
});
|
|
969
|
+
if (metaRes?.schema) userSchema.value = metaRes.schema;
|
|
970
|
+
else userSchema.value = null;
|
|
971
|
+
} catch {
|
|
972
|
+
userSchema.value = null;
|
|
973
|
+
}
|
|
974
|
+
} else userSchema.value = null;
|
|
975
|
+
user.value = profileData;
|
|
912
976
|
userProfile.value = {
|
|
913
|
-
flattenedProfile:
|
|
914
|
-
profile:
|
|
977
|
+
flattenedProfile: generateFlattenedUserProfile(profileData),
|
|
978
|
+
profile: profileData
|
|
915
979
|
};
|
|
916
|
-
isSignedIn.value =
|
|
980
|
+
isSignedIn.value = currentSignInStatus;
|
|
917
981
|
} catch {} finally {
|
|
918
982
|
isUpdatingSession = false;
|
|
919
983
|
isLoading.value = client.isLoading();
|
|
@@ -979,6 +1043,7 @@ const ThunderIDProvider = defineComponent({
|
|
|
979
1043
|
isLoading,
|
|
980
1044
|
isSignedIn,
|
|
981
1045
|
organizationHandle: props.organizationHandle,
|
|
1046
|
+
preferences: props.preferences,
|
|
982
1047
|
reInitialize: async (config) => {
|
|
983
1048
|
const result = await client.reInitialize(config);
|
|
984
1049
|
return typeof result === "boolean" ? result : true;
|
|
@@ -992,6 +1057,7 @@ const ThunderIDProvider = defineComponent({
|
|
|
992
1057
|
signUpUrl: props.signUpUrl,
|
|
993
1058
|
storage: props.storage,
|
|
994
1059
|
user,
|
|
1060
|
+
userSchema,
|
|
995
1061
|
vendor
|
|
996
1062
|
});
|
|
997
1063
|
onMounted(async () => {
|
|
@@ -1057,15 +1123,9 @@ const ThunderIDProvider = defineComponent({
|
|
|
1057
1123
|
},
|
|
1058
1124
|
profile: userProfile.value,
|
|
1059
1125
|
revalidateProfile: async () => {
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
userProfile.value = {
|
|
1064
|
-
flattenedProfile: claims,
|
|
1065
|
-
profile: claims
|
|
1066
|
-
};
|
|
1067
|
-
} catch {}
|
|
1068
|
-
}
|
|
1126
|
+
await updateSession();
|
|
1127
|
+
},
|
|
1128
|
+
userSchema: userSchema.value
|
|
1069
1129
|
}, { default: () => slots["default"]?.() }) }) }) }) });
|
|
1070
1130
|
}
|
|
1071
1131
|
});
|
|
@@ -1482,6 +1542,8 @@ const USER_DROPDOWN_CSS = `
|
|
|
1482
1542
|
justify-content: center;
|
|
1483
1543
|
width: 32px;
|
|
1484
1544
|
height: 32px;
|
|
1545
|
+
max-width: 32px;
|
|
1546
|
+
max-height: 32px;
|
|
1485
1547
|
border-radius: 50%;
|
|
1486
1548
|
color: #ffffff;
|
|
1487
1549
|
flex-shrink: 0;
|
|
@@ -1490,12 +1552,20 @@ const USER_DROPDOWN_CSS = `
|
|
|
1490
1552
|
line-height: 1;
|
|
1491
1553
|
user-select: none;
|
|
1492
1554
|
pointer-events: none;
|
|
1555
|
+
object-fit: cover;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
img.thunderid-user-dropdown__avatar {
|
|
1559
|
+
object-fit: cover;
|
|
1560
|
+
border-radius: 50%;
|
|
1493
1561
|
}
|
|
1494
1562
|
|
|
1495
1563
|
/* sm — 28 px */
|
|
1496
1564
|
.thunderid-user-dropdown__avatar--sm {
|
|
1497
1565
|
width: 28px;
|
|
1498
1566
|
height: 28px;
|
|
1567
|
+
max-width: 28px;
|
|
1568
|
+
max-height: 28px;
|
|
1499
1569
|
font-size: var(--thunder-typography-fontSize-xs);
|
|
1500
1570
|
}
|
|
1501
1571
|
|
|
@@ -1503,6 +1573,8 @@ const USER_DROPDOWN_CSS = `
|
|
|
1503
1573
|
.thunderid-user-dropdown__avatar--lg {
|
|
1504
1574
|
width: 38px;
|
|
1505
1575
|
height: 38px;
|
|
1576
|
+
max-width: 38px;
|
|
1577
|
+
max-height: 38px;
|
|
1506
1578
|
font-size: var(--thunder-typography-fontSize-md);
|
|
1507
1579
|
}
|
|
1508
1580
|
|
|
@@ -1622,6 +1694,12 @@ const USER_DROPDOWN_CSS = `
|
|
|
1622
1694
|
font-weight: var(--thunder-typography-fontWeight-semibold);
|
|
1623
1695
|
line-height: 1;
|
|
1624
1696
|
user-select: none;
|
|
1697
|
+
object-fit: cover;
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
img.thunderid-user-dropdown__menu-header-avatar {
|
|
1701
|
+
object-fit: cover;
|
|
1702
|
+
border-radius: 50%;
|
|
1625
1703
|
}
|
|
1626
1704
|
|
|
1627
1705
|
.thunderid-user-dropdown__menu-header-info {
|
|
@@ -1708,6 +1786,7 @@ const USER_DROPDOWN_CSS = `
|
|
|
1708
1786
|
justify-content: center;
|
|
1709
1787
|
z-index: 9999;
|
|
1710
1788
|
backdrop-filter: blur(3px);
|
|
1789
|
+
box-sizing: border-box;
|
|
1711
1790
|
animation: thunderid-overlay-enter var(--thunder-transition-fast) ease;
|
|
1712
1791
|
}
|
|
1713
1792
|
|
|
@@ -1722,11 +1801,14 @@ const USER_DROPDOWN_CSS = `
|
|
|
1722
1801
|
background: var(--thunder-color-background-surface);
|
|
1723
1802
|
border-radius: var(--thunder-border-radius-large);
|
|
1724
1803
|
box-shadow: var(--thunder-shadow-large);
|
|
1725
|
-
max-width:
|
|
1804
|
+
max-width: 640px;
|
|
1726
1805
|
width: 92%;
|
|
1727
1806
|
max-height: 90vh;
|
|
1728
1807
|
overflow-y: auto;
|
|
1729
1808
|
position: relative;
|
|
1809
|
+
margin: auto;
|
|
1810
|
+
padding: calc(var(--thunder-spacing-unit) * 3);
|
|
1811
|
+
box-sizing: border-box;
|
|
1730
1812
|
animation: thunderid-modal-enter var(--thunder-transition-normal) ease;
|
|
1731
1813
|
}
|
|
1732
1814
|
|
|
@@ -1779,51 +1861,24 @@ var UserDropdown_css_default = USER_DROPDOWN_CSS;
|
|
|
1779
1861
|
//#region src/components/presentation/user-profile/UserProfile.css.ts
|
|
1780
1862
|
/**
|
|
1781
1863
|
* Styles for the UserProfile presentation component.
|
|
1782
|
-
*
|
|
1783
|
-
* BEM block: `.thunderid-user-profile`
|
|
1784
|
-
*
|
|
1785
|
-
* Modifiers:
|
|
1786
|
-
* --compact – reduced field padding for modal / dropdown embedding
|
|
1787
|
-
*
|
|
1788
|
-
* New elements in this version:
|
|
1789
|
-
* __hero – avatar + name + subtitle banner
|
|
1790
|
-
* __avatar--sm/md/lg – avatar size variants
|
|
1791
|
-
* __hero-name – prominent display name
|
|
1792
|
-
* __hero-subtitle – secondary line (email / username)
|
|
1864
|
+
* Parity target: `@thunderid/react` BaseUserProfile.styles.ts
|
|
1793
1865
|
*/
|
|
1794
1866
|
const USER_PROFILE_CSS = `
|
|
1795
1867
|
/* ============================================================
|
|
1796
|
-
UserProfile
|
|
1868
|
+
UserProfile (React Parity)
|
|
1797
1869
|
============================================================ */
|
|
1798
1870
|
|
|
1799
1871
|
.thunderid-user-profile {
|
|
1800
1872
|
display: flex;
|
|
1801
1873
|
flex-direction: column;
|
|
1802
|
-
|
|
1803
|
-
|
|
1874
|
+
padding: calc(var(--thunder-spacing-unit) * 4);
|
|
1875
|
+
width: 100%;
|
|
1876
|
+
max-width: 600px;
|
|
1877
|
+
margin: 0 auto;
|
|
1804
1878
|
font-family: var(--thunder-typography-fontFamily);
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
.thunderid-user-profile__header {
|
|
1810
|
-
display: flex;
|
|
1811
|
-
align-items: center;
|
|
1812
|
-
justify-content: space-between;
|
|
1813
|
-
padding: calc(var(--thunder-spacing-unit) * 2) calc(var(--thunder-spacing-unit) * 2.5)
|
|
1814
|
-
calc(var(--thunder-spacing-unit) * 1.75);
|
|
1815
|
-
}
|
|
1816
|
-
|
|
1817
|
-
.thunderid-user-profile__title {
|
|
1818
|
-
margin: 0;
|
|
1819
|
-
font-size: var(--thunder-typography-fontSize-md);
|
|
1820
|
-
font-weight: var(--thunder-typography-fontWeight-semibold);
|
|
1821
|
-
color: var(--thunder-color-text-primary);
|
|
1822
|
-
letter-spacing: var(--thunder-typography-letterSpacing-tight);
|
|
1823
|
-
}
|
|
1824
|
-
|
|
1825
|
-
.thunderid-user-profile__header-divider {
|
|
1826
|
-
margin: 0;
|
|
1879
|
+
background: var(--thunder-color-background-surface);
|
|
1880
|
+
border-radius: var(--thunder-border-radius-large, 8px);
|
|
1881
|
+
box-sizing: border-box;
|
|
1827
1882
|
}
|
|
1828
1883
|
|
|
1829
1884
|
/* ── Hero (avatar + name + subtitle) ────────────────────────── */
|
|
@@ -1831,43 +1886,35 @@ const USER_PROFILE_CSS = `
|
|
|
1831
1886
|
.thunderid-user-profile__hero {
|
|
1832
1887
|
display: flex;
|
|
1833
1888
|
flex-direction: column;
|
|
1834
|
-
align-items:
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
background: linear-gradient(
|
|
1839
|
-
180deg,
|
|
1840
|
-
var(--thunder-color-primary-light) 0%,
|
|
1841
|
-
var(--thunder-color-background-surface) 100%
|
|
1842
|
-
);
|
|
1889
|
+
align-items: flex-start;
|
|
1890
|
+
gap: calc(var(--thunder-spacing-unit) * 1);
|
|
1891
|
+
padding-bottom: calc(var(--thunder-spacing-unit) * 2);
|
|
1892
|
+
margin-bottom: calc(var(--thunder-spacing-unit) * 2);
|
|
1843
1893
|
border-bottom: 1px solid var(--thunder-color-border);
|
|
1844
1894
|
}
|
|
1845
1895
|
|
|
1846
1896
|
.thunderid-user-profile__avatar-wrapper {
|
|
1847
1897
|
position: relative;
|
|
1848
1898
|
border-radius: 50%;
|
|
1849
|
-
padding: 3px;
|
|
1850
|
-
background: linear-gradient(
|
|
1851
|
-
135deg,
|
|
1852
|
-
var(--thunder-color-primary-main),
|
|
1853
|
-
var(--thunder-color-primary-dark)
|
|
1854
|
-
);
|
|
1855
|
-
box-shadow: 0 4px 14px rgba(75, 110, 245, 0.28);
|
|
1856
1899
|
}
|
|
1857
1900
|
|
|
1858
1901
|
.thunderid-user-profile__avatar {
|
|
1859
|
-
|
|
1860
|
-
|
|
1902
|
+
border-radius: 50%;
|
|
1903
|
+
object-fit: cover;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
img.thunderid-user-profile__avatar {
|
|
1907
|
+
border-radius: 50%;
|
|
1908
|
+
object-fit: cover;
|
|
1909
|
+
width: 70px;
|
|
1910
|
+
height: 70px;
|
|
1861
1911
|
border-radius: 50%;
|
|
1862
1912
|
display: flex;
|
|
1863
1913
|
align-items: center;
|
|
1864
1914
|
justify-content: center;
|
|
1865
1915
|
flex-shrink: 0;
|
|
1866
|
-
border: 2px solid var(--thunder-color-background-surface);
|
|
1867
1916
|
}
|
|
1868
1917
|
|
|
1869
|
-
/* Avatar size variants */
|
|
1870
|
-
|
|
1871
1918
|
.thunderid-user-profile__avatar--sm {
|
|
1872
1919
|
width: 48px;
|
|
1873
1920
|
height: 48px;
|
|
@@ -1887,17 +1934,17 @@ const USER_PROFILE_CSS = `
|
|
|
1887
1934
|
}
|
|
1888
1935
|
|
|
1889
1936
|
.thunderid-user-profile__avatar--lg {
|
|
1890
|
-
width:
|
|
1891
|
-
height:
|
|
1937
|
+
width: 70px;
|
|
1938
|
+
height: 70px;
|
|
1892
1939
|
}
|
|
1893
1940
|
|
|
1894
1941
|
.thunderid-user-profile__avatar--lg .thunderid-user-profile__avatar-initials {
|
|
1895
|
-
font-size: 1.
|
|
1942
|
+
font-size: 1.5rem;
|
|
1896
1943
|
}
|
|
1897
1944
|
|
|
1898
1945
|
.thunderid-user-profile__avatar-initials {
|
|
1899
1946
|
color: #ffffff;
|
|
1900
|
-
font-weight: var(--thunder-typography-fontWeight-semibold);
|
|
1947
|
+
font-weight: var(--thunder-typography-fontWeight-semibold, 600);
|
|
1901
1948
|
line-height: 1;
|
|
1902
1949
|
letter-spacing: 0.02em;
|
|
1903
1950
|
pointer-events: none;
|
|
@@ -1907,37 +1954,36 @@ const USER_PROFILE_CSS = `
|
|
|
1907
1954
|
.thunderid-user-profile__hero-info {
|
|
1908
1955
|
display: flex;
|
|
1909
1956
|
flex-direction: column;
|
|
1910
|
-
align-items:
|
|
1911
|
-
|
|
1912
|
-
text-align: center;
|
|
1957
|
+
align-items: flex-start;
|
|
1958
|
+
margin-top: calc(var(--thunder-spacing-unit) * 0.5);
|
|
1913
1959
|
}
|
|
1914
1960
|
|
|
1915
1961
|
.thunderid-user-profile__hero-name {
|
|
1916
|
-
font-size: var(--thunder-typography-fontSize-
|
|
1917
|
-
font-weight: var(--thunder-typography-fontWeight-semibold);
|
|
1962
|
+
font-size: var(--thunder-typography-fontSize-xl, 1.5rem);
|
|
1963
|
+
font-weight: var(--thunder-typography-fontWeight-semibold, 600);
|
|
1918
1964
|
color: var(--thunder-color-text-primary);
|
|
1919
|
-
|
|
1920
|
-
|
|
1965
|
+
margin: 0;
|
|
1966
|
+
line-height: var(--thunder-typography-lineHeight-tight, 1.2);
|
|
1921
1967
|
}
|
|
1922
1968
|
|
|
1923
1969
|
.thunderid-user-profile__hero-subtitle {
|
|
1924
|
-
font-size: var(--thunder-typography-fontSize-sm);
|
|
1970
|
+
font-size: var(--thunder-typography-fontSize-sm, 0.875rem);
|
|
1925
1971
|
color: var(--thunder-color-text-secondary);
|
|
1926
|
-
|
|
1972
|
+
margin-top: calc(var(--thunder-spacing-unit) * 0.5);
|
|
1973
|
+
line-height: var(--thunder-typography-lineHeight-normal, 1.4);
|
|
1927
1974
|
}
|
|
1928
1975
|
|
|
1929
1976
|
/* ── Alerts & loading ────────────────────────────────────────── */
|
|
1930
1977
|
|
|
1931
1978
|
.thunderid-user-profile__error {
|
|
1932
|
-
margin: calc(var(--thunder-spacing-unit) *
|
|
1933
|
-
calc(var(--thunder-spacing-unit) * 0.5);
|
|
1979
|
+
margin-bottom: calc(var(--thunder-spacing-unit) * 3);
|
|
1934
1980
|
}
|
|
1935
1981
|
|
|
1936
1982
|
.thunderid-user-profile__loading {
|
|
1937
1983
|
display: flex;
|
|
1938
1984
|
align-items: center;
|
|
1939
1985
|
justify-content: center;
|
|
1940
|
-
padding: calc(var(--thunder-spacing-unit) *
|
|
1986
|
+
padding: calc(var(--thunder-spacing-unit) * 4) 0;
|
|
1941
1987
|
}
|
|
1942
1988
|
|
|
1943
1989
|
/* ── Fields ──────────────────────────────────────────────────── */
|
|
@@ -1948,141 +1994,119 @@ const USER_PROFILE_CSS = `
|
|
|
1948
1994
|
}
|
|
1949
1995
|
|
|
1950
1996
|
.thunderid-user-profile__field {
|
|
1951
|
-
display:
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
padding: calc(var(--thunder-spacing-unit) * 1.5)
|
|
1955
|
-
|
|
1997
|
+
display: flex;
|
|
1998
|
+
align-items: center;
|
|
1999
|
+
justify-content: space-between;
|
|
2000
|
+
padding: calc(var(--thunder-spacing-unit) * 1.5) 0;
|
|
2001
|
+
border-bottom: 1px solid var(--thunder-color-border);
|
|
2002
|
+
min-height: 28px;
|
|
1956
2003
|
box-sizing: border-box;
|
|
1957
|
-
transition: background-color var(--thunder-transition-fast);
|
|
1958
2004
|
}
|
|
1959
2005
|
|
|
1960
|
-
.thunderid-user-profile__field:
|
|
1961
|
-
|
|
2006
|
+
.thunderid-user-profile__field:last-child {
|
|
2007
|
+
border-bottom: none;
|
|
1962
2008
|
}
|
|
1963
2009
|
|
|
1964
|
-
.thunderid-user-profile__field
|
|
1965
|
-
|
|
2010
|
+
.thunderid-user-profile__field-inner {
|
|
2011
|
+
flex: 1;
|
|
2012
|
+
display: flex;
|
|
2013
|
+
align-items: center;
|
|
2014
|
+
gap: var(--thunder-spacing-unit);
|
|
1966
2015
|
}
|
|
1967
2016
|
|
|
1968
2017
|
.thunderid-user-profile__field-label {
|
|
2018
|
+
font-size: var(--thunder-typography-fontSize-sm, 0.875rem);
|
|
2019
|
+
font-weight: var(--thunder-typography-fontWeight-medium, 500);
|
|
1969
2020
|
color: var(--thunder-color-text-secondary);
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
.thunderid-user-profile__field-display {
|
|
1976
|
-
display: flex;
|
|
1977
|
-
align-items: center;
|
|
1978
|
-
justify-content: space-between;
|
|
1979
|
-
gap: calc(var(--thunder-spacing-unit) * 0.5);
|
|
1980
|
-
min-height: 1.5rem;
|
|
2021
|
+
width: 120px;
|
|
2022
|
+
flex-shrink: 0;
|
|
2023
|
+
line-height: 28px;
|
|
2024
|
+
text-align: start;
|
|
1981
2025
|
}
|
|
1982
2026
|
|
|
1983
2027
|
.thunderid-user-profile__field-value {
|
|
1984
2028
|
color: var(--thunder-color-text-primary);
|
|
1985
|
-
word-break: break-word;
|
|
1986
2029
|
flex: 1;
|
|
1987
|
-
|
|
2030
|
+
display: inline-block;
|
|
2031
|
+
align-items: center;
|
|
2032
|
+
font-size: var(--thunder-typography-fontSize-sm, 0.875rem);
|
|
2033
|
+
line-height: 28px;
|
|
2034
|
+
word-break: break-word;
|
|
2035
|
+
text-overflow: ellipsis;
|
|
2036
|
+
white-space: nowrap;
|
|
2037
|
+
max-width: 350px;
|
|
2038
|
+
text-align: start;
|
|
2039
|
+
overflow: hidden;
|
|
1988
2040
|
}
|
|
1989
2041
|
|
|
1990
2042
|
.thunderid-user-profile__field-placeholder {
|
|
1991
|
-
|
|
1992
|
-
font-size: var(--thunder-typography-fontSize-sm);
|
|
2043
|
+
font-size: var(--thunder-typography-fontSize-sm, 0.875rem);
|
|
1993
2044
|
font-style: italic;
|
|
1994
|
-
|
|
2045
|
+
color: var(--thunder-color-text-secondary);
|
|
2046
|
+
opacity: 0.7;
|
|
1995
2047
|
cursor: pointer;
|
|
1996
2048
|
text-decoration: underline;
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
opacity: 0.8;
|
|
2000
|
-
transition: opacity var(--thunder-transition-fast);
|
|
2049
|
+
white-space: nowrap;
|
|
2050
|
+
line-height: 28px;
|
|
2001
2051
|
}
|
|
2002
2052
|
|
|
2003
2053
|
.thunderid-user-profile__field-placeholder:hover {
|
|
2004
2054
|
opacity: 1;
|
|
2005
2055
|
}
|
|
2006
2056
|
|
|
2007
|
-
|
|
2057
|
+
.thunderid-user-profile__field-actions {
|
|
2058
|
+
display: flex;
|
|
2059
|
+
gap: calc(var(--thunder-spacing-unit) * 0.5);
|
|
2060
|
+
align-items: center;
|
|
2061
|
+
margin-inline-start: calc(var(--thunder-spacing-unit) * 4);
|
|
2062
|
+
}
|
|
2008
2063
|
|
|
2009
2064
|
.thunderid-user-profile__field-edit-btn {
|
|
2010
2065
|
display: inline-flex;
|
|
2011
2066
|
align-items: center;
|
|
2012
2067
|
justify-content: center;
|
|
2013
|
-
background:
|
|
2068
|
+
background: transparent;
|
|
2014
2069
|
border: none;
|
|
2015
2070
|
cursor: pointer;
|
|
2016
2071
|
color: var(--thunder-color-text-secondary);
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
transition:
|
|
2021
|
-
color var(--thunder-transition-fast),
|
|
2022
|
-
background-color var(--thunder-transition-fast),
|
|
2023
|
-
opacity var(--thunder-transition-fast);
|
|
2024
|
-
opacity: 0;
|
|
2072
|
+
padding: 0;
|
|
2073
|
+
min-height: auto;
|
|
2074
|
+
opacity: 0.7;
|
|
2025
2075
|
line-height: 0;
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
.thunderid-user-profile__field:hover .thunderid-user-profile__field-edit-btn {
|
|
2029
|
-
opacity: 1;
|
|
2076
|
+
transition: opacity var(--thunder-transition-fast, 0.15s ease);
|
|
2030
2077
|
}
|
|
2031
2078
|
|
|
2032
2079
|
.thunderid-user-profile__field-edit-btn:hover {
|
|
2033
|
-
color: var(--thunder-color-primary-main);
|
|
2034
|
-
background-color: var(--thunder-color-primary-light);
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
|
-
.thunderid-user-profile__field-edit-btn:focus-visible {
|
|
2038
2080
|
opacity: 1;
|
|
2039
|
-
|
|
2040
|
-
box-shadow: 0 0 0 var(--thunder-focus-ring-width) var(--thunder-focus-ring-color);
|
|
2081
|
+
background: transparent;
|
|
2041
2082
|
}
|
|
2042
2083
|
|
|
2043
|
-
/* ── Edit mode ───────────────────────────────────────────────── */
|
|
2044
|
-
|
|
2045
2084
|
.thunderid-user-profile__field-edit {
|
|
2085
|
+
flex: 1;
|
|
2046
2086
|
display: flex;
|
|
2047
2087
|
flex-direction: column;
|
|
2048
|
-
gap: calc(var(--thunder-spacing-unit) * 0.
|
|
2049
|
-
padding: calc(var(--thunder-spacing-unit) * 0.25) 0;
|
|
2088
|
+
gap: calc(var(--thunder-spacing-unit) * 0.5);
|
|
2050
2089
|
}
|
|
2051
2090
|
|
|
2052
|
-
.thunderid-user-profile__field-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2091
|
+
.thunderid-user-profile__field-error {
|
|
2092
|
+
color: var(--thunder-color-error, #d32f2f);
|
|
2093
|
+
font-size: var(--thunder-typography-fontSize-xs, 0.8rem);
|
|
2094
|
+
font-weight: var(--thunder-typography-fontWeight-medium, 500);
|
|
2095
|
+
margin-top: calc(var(--thunder-spacing-unit) * 0.5);
|
|
2056
2096
|
}
|
|
2057
2097
|
|
|
2058
|
-
/* ── Footer
|
|
2098
|
+
/* ── Footer ──────────────────────────────────────────────────── */
|
|
2059
2099
|
|
|
2060
2100
|
.thunderid-user-profile__footer {
|
|
2061
|
-
padding: calc(var(--thunder-spacing-unit) *
|
|
2101
|
+
padding-top: calc(var(--thunder-spacing-unit) * 2);
|
|
2062
2102
|
border-top: 1px solid var(--thunder-color-border);
|
|
2063
2103
|
}
|
|
2064
2104
|
|
|
2065
2105
|
/* ── Compact modifier ────────────────────────────────────────── */
|
|
2066
2106
|
|
|
2067
|
-
.thunderid-user-profile--compact
|
|
2068
|
-
padding: calc(var(--thunder-spacing-unit) * 2)
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
.thunderid-user-profile--compact .thunderid-user-profile__avatar--lg {
|
|
2072
|
-
width: 56px;
|
|
2073
|
-
height: 56px;
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2076
|
-
.thunderid-user-profile--compact .thunderid-user-profile__avatar--lg .thunderid-user-profile__avatar-initials {
|
|
2077
|
-
font-size: 1.125rem;
|
|
2078
|
-
}
|
|
2079
|
-
|
|
2080
|
-
.thunderid-user-profile--compact .thunderid-user-profile__field {
|
|
2081
|
-
padding: calc(var(--thunder-spacing-unit) * 1) calc(var(--thunder-spacing-unit) * 2);
|
|
2082
|
-
}
|
|
2083
|
-
|
|
2084
|
-
.thunderid-user-profile--compact .thunderid-user-profile__hero-name {
|
|
2085
|
-
font-size: var(--thunder-typography-fontSize-md);
|
|
2107
|
+
.thunderid-user-profile--compact {
|
|
2108
|
+
padding: calc(var(--thunder-spacing-unit) * 2);
|
|
2109
|
+
width: 100%;
|
|
2086
2110
|
}
|
|
2087
2111
|
`;
|
|
2088
2112
|
var UserProfile_css_default = USER_PROFILE_CSS;
|
|
@@ -5108,31 +5132,393 @@ const GoogleButton = defineComponent({
|
|
|
5108
5132
|
const { t } = useI18n_default();
|
|
5109
5133
|
const googleIcon = () => h("svg", {
|
|
5110
5134
|
height: "18",
|
|
5111
|
-
viewBox: "0 0
|
|
5135
|
+
viewBox: "0 0 268.1522 273.8827",
|
|
5112
5136
|
width: "18",
|
|
5113
5137
|
xmlns: "http://www.w3.org/2000/svg"
|
|
5114
|
-
}, [h("
|
|
5138
|
+
}, [h("defs", {}, [
|
|
5139
|
+
h("linearGradient", { id: "google-btn-a" }, [h("stop", {
|
|
5140
|
+
offset: "0",
|
|
5141
|
+
"stop-color": "#0fbc5c"
|
|
5142
|
+
}), h("stop", {
|
|
5143
|
+
offset: "1",
|
|
5144
|
+
"stop-color": "#0cba65"
|
|
5145
|
+
})]),
|
|
5146
|
+
h("linearGradient", { id: "google-btn-g" }, [
|
|
5147
|
+
h("stop", {
|
|
5148
|
+
offset: ".2312727",
|
|
5149
|
+
"stop-color": "#0fbc5f"
|
|
5150
|
+
}),
|
|
5151
|
+
h("stop", {
|
|
5152
|
+
offset: ".3115468",
|
|
5153
|
+
"stop-color": "#0fbc5f"
|
|
5154
|
+
}),
|
|
5155
|
+
h("stop", {
|
|
5156
|
+
offset: ".3660131",
|
|
5157
|
+
"stop-color": "#0fbc5e"
|
|
5158
|
+
}),
|
|
5159
|
+
h("stop", {
|
|
5160
|
+
offset: ".4575163",
|
|
5161
|
+
"stop-color": "#0fbc5d"
|
|
5162
|
+
}),
|
|
5163
|
+
h("stop", {
|
|
5164
|
+
offset: ".540305",
|
|
5165
|
+
"stop-color": "#12bc58"
|
|
5166
|
+
}),
|
|
5167
|
+
h("stop", {
|
|
5168
|
+
offset: ".6993464",
|
|
5169
|
+
"stop-color": "#28bf3c"
|
|
5170
|
+
}),
|
|
5171
|
+
h("stop", {
|
|
5172
|
+
offset: ".7712418",
|
|
5173
|
+
"stop-color": "#38c02b"
|
|
5174
|
+
}),
|
|
5175
|
+
h("stop", {
|
|
5176
|
+
offset: ".8605665",
|
|
5177
|
+
"stop-color": "#52c218"
|
|
5178
|
+
}),
|
|
5179
|
+
h("stop", {
|
|
5180
|
+
offset: ".9150327",
|
|
5181
|
+
"stop-color": "#67c30f"
|
|
5182
|
+
}),
|
|
5183
|
+
h("stop", {
|
|
5184
|
+
offset: "1",
|
|
5185
|
+
"stop-color": "#86c504"
|
|
5186
|
+
})
|
|
5187
|
+
]),
|
|
5188
|
+
h("linearGradient", { id: "google-btn-h" }, [
|
|
5189
|
+
h("stop", {
|
|
5190
|
+
offset: ".1416122",
|
|
5191
|
+
"stop-color": "#1abd4d"
|
|
5192
|
+
}),
|
|
5193
|
+
h("stop", {
|
|
5194
|
+
offset: ".2475151",
|
|
5195
|
+
"stop-color": "#6ec30d"
|
|
5196
|
+
}),
|
|
5197
|
+
h("stop", {
|
|
5198
|
+
offset: ".3115468",
|
|
5199
|
+
"stop-color": "#8ac502"
|
|
5200
|
+
}),
|
|
5201
|
+
h("stop", {
|
|
5202
|
+
offset: ".3660131",
|
|
5203
|
+
"stop-color": "#a2c600"
|
|
5204
|
+
}),
|
|
5205
|
+
h("stop", {
|
|
5206
|
+
offset: ".4456735",
|
|
5207
|
+
"stop-color": "#c8c903"
|
|
5208
|
+
}),
|
|
5209
|
+
h("stop", {
|
|
5210
|
+
offset: ".540305",
|
|
5211
|
+
"stop-color": "#ebcb03"
|
|
5212
|
+
}),
|
|
5213
|
+
h("stop", {
|
|
5214
|
+
offset: ".6156363",
|
|
5215
|
+
"stop-color": "#f7cd07"
|
|
5216
|
+
}),
|
|
5217
|
+
h("stop", {
|
|
5218
|
+
offset: ".6993454",
|
|
5219
|
+
"stop-color": "#fdcd04"
|
|
5220
|
+
}),
|
|
5221
|
+
h("stop", {
|
|
5222
|
+
offset: ".7712418",
|
|
5223
|
+
"stop-color": "#fdce05"
|
|
5224
|
+
}),
|
|
5225
|
+
h("stop", {
|
|
5226
|
+
offset: ".8605661",
|
|
5227
|
+
"stop-color": "#ffce0a"
|
|
5228
|
+
})
|
|
5229
|
+
]),
|
|
5230
|
+
h("linearGradient", { id: "google-btn-f" }, [
|
|
5231
|
+
h("stop", {
|
|
5232
|
+
offset: ".3159041",
|
|
5233
|
+
"stop-color": "#ff4c3c"
|
|
5234
|
+
}),
|
|
5235
|
+
h("stop", {
|
|
5236
|
+
offset: ".6038179",
|
|
5237
|
+
"stop-color": "#ff692c"
|
|
5238
|
+
}),
|
|
5239
|
+
h("stop", {
|
|
5240
|
+
offset: ".7268366",
|
|
5241
|
+
"stop-color": "#ff7825"
|
|
5242
|
+
}),
|
|
5243
|
+
h("stop", {
|
|
5244
|
+
offset: ".884534",
|
|
5245
|
+
"stop-color": "#ff8d1b"
|
|
5246
|
+
}),
|
|
5247
|
+
h("stop", {
|
|
5248
|
+
offset: "1",
|
|
5249
|
+
"stop-color": "#ff9f13"
|
|
5250
|
+
})
|
|
5251
|
+
]),
|
|
5252
|
+
h("linearGradient", { id: "google-btn-b" }, [
|
|
5253
|
+
h("stop", {
|
|
5254
|
+
offset: ".2312727",
|
|
5255
|
+
"stop-color": "#ff4541"
|
|
5256
|
+
}),
|
|
5257
|
+
h("stop", {
|
|
5258
|
+
offset: ".3115468",
|
|
5259
|
+
"stop-color": "#ff4540"
|
|
5260
|
+
}),
|
|
5261
|
+
h("stop", {
|
|
5262
|
+
offset: ".4575163",
|
|
5263
|
+
"stop-color": "#ff4640"
|
|
5264
|
+
}),
|
|
5265
|
+
h("stop", {
|
|
5266
|
+
offset: ".540305",
|
|
5267
|
+
"stop-color": "#ff473f"
|
|
5268
|
+
}),
|
|
5269
|
+
h("stop", {
|
|
5270
|
+
offset: ".6993464",
|
|
5271
|
+
"stop-color": "#ff5138"
|
|
5272
|
+
}),
|
|
5273
|
+
h("stop", {
|
|
5274
|
+
offset: ".7712418",
|
|
5275
|
+
"stop-color": "#ff5b33"
|
|
5276
|
+
}),
|
|
5277
|
+
h("stop", {
|
|
5278
|
+
offset: ".8605665",
|
|
5279
|
+
"stop-color": "#ff6c29"
|
|
5280
|
+
}),
|
|
5281
|
+
h("stop", {
|
|
5282
|
+
offset: "1",
|
|
5283
|
+
"stop-color": "#ff8c18"
|
|
5284
|
+
})
|
|
5285
|
+
]),
|
|
5286
|
+
h("linearGradient", { id: "google-btn-d" }, [h("stop", {
|
|
5287
|
+
offset: ".4084578",
|
|
5288
|
+
"stop-color": "#fb4e5a"
|
|
5289
|
+
}), h("stop", {
|
|
5290
|
+
offset: "1",
|
|
5291
|
+
"stop-color": "#ff4540"
|
|
5292
|
+
})]),
|
|
5293
|
+
h("linearGradient", { id: "google-btn-c" }, [
|
|
5294
|
+
h("stop", {
|
|
5295
|
+
offset: ".1315461",
|
|
5296
|
+
"stop-color": "#0cba65"
|
|
5297
|
+
}),
|
|
5298
|
+
h("stop", {
|
|
5299
|
+
offset: ".2097843",
|
|
5300
|
+
"stop-color": "#0bb86d"
|
|
5301
|
+
}),
|
|
5302
|
+
h("stop", {
|
|
5303
|
+
offset: ".2972969",
|
|
5304
|
+
"stop-color": "#09b479"
|
|
5305
|
+
}),
|
|
5306
|
+
h("stop", {
|
|
5307
|
+
offset: ".3962575",
|
|
5308
|
+
"stop-color": "#08ad93"
|
|
5309
|
+
}),
|
|
5310
|
+
h("stop", {
|
|
5311
|
+
offset: ".4771242",
|
|
5312
|
+
"stop-color": "#0aa6a9"
|
|
5313
|
+
}),
|
|
5314
|
+
h("stop", {
|
|
5315
|
+
offset: ".5684245",
|
|
5316
|
+
"stop-color": "#0d9cc6"
|
|
5317
|
+
}),
|
|
5318
|
+
h("stop", {
|
|
5319
|
+
offset: ".667385",
|
|
5320
|
+
"stop-color": "#1893dd"
|
|
5321
|
+
}),
|
|
5322
|
+
h("stop", {
|
|
5323
|
+
offset: ".7687273",
|
|
5324
|
+
"stop-color": "#258bf1"
|
|
5325
|
+
}),
|
|
5326
|
+
h("stop", {
|
|
5327
|
+
offset: ".8585063",
|
|
5328
|
+
"stop-color": "#3086ff"
|
|
5329
|
+
})
|
|
5330
|
+
]),
|
|
5331
|
+
h("linearGradient", { id: "google-btn-e" }, [
|
|
5332
|
+
h("stop", {
|
|
5333
|
+
offset: ".3660131",
|
|
5334
|
+
"stop-color": "#ff4e3a"
|
|
5335
|
+
}),
|
|
5336
|
+
h("stop", {
|
|
5337
|
+
offset: ".4575163",
|
|
5338
|
+
"stop-color": "#ff8a1b"
|
|
5339
|
+
}),
|
|
5340
|
+
h("stop", {
|
|
5341
|
+
offset: ".540305",
|
|
5342
|
+
"stop-color": "#ffa312"
|
|
5343
|
+
}),
|
|
5344
|
+
h("stop", {
|
|
5345
|
+
offset: ".6156363",
|
|
5346
|
+
"stop-color": "#ffb60c"
|
|
5347
|
+
}),
|
|
5348
|
+
h("stop", {
|
|
5349
|
+
offset: ".7712418",
|
|
5350
|
+
"stop-color": "#ffcd0a"
|
|
5351
|
+
}),
|
|
5352
|
+
h("stop", {
|
|
5353
|
+
offset: ".8605665",
|
|
5354
|
+
"stop-color": "#fecf0a"
|
|
5355
|
+
}),
|
|
5356
|
+
h("stop", {
|
|
5357
|
+
offset: ".9150327",
|
|
5358
|
+
"stop-color": "#fecf08"
|
|
5359
|
+
}),
|
|
5360
|
+
h("stop", {
|
|
5361
|
+
offset: "1",
|
|
5362
|
+
"stop-color": "#fdcd01"
|
|
5363
|
+
})
|
|
5364
|
+
]),
|
|
5365
|
+
h("linearGradient", {
|
|
5366
|
+
href: "#google-btn-a",
|
|
5367
|
+
id: "google-btn-s",
|
|
5368
|
+
x1: "219.6997",
|
|
5369
|
+
y1: "329.5351",
|
|
5370
|
+
x2: "254.4673",
|
|
5371
|
+
y2: "329.5351",
|
|
5372
|
+
gradientUnits: "userSpaceOnUse"
|
|
5373
|
+
}),
|
|
5374
|
+
h("radialGradient", {
|
|
5375
|
+
href: "#google-btn-b",
|
|
5376
|
+
id: "google-btn-m",
|
|
5377
|
+
gradientUnits: "userSpaceOnUse",
|
|
5378
|
+
gradientTransform: "matrix(-1.936885,1.043001,1.455731,2.555422,290.5254,-400.6338)",
|
|
5379
|
+
cx: "109.6267",
|
|
5380
|
+
cy: "135.8619",
|
|
5381
|
+
fx: "109.6267",
|
|
5382
|
+
fy: "135.8619",
|
|
5383
|
+
r: "71.46001"
|
|
5384
|
+
}),
|
|
5385
|
+
h("radialGradient", {
|
|
5386
|
+
href: "#google-btn-c",
|
|
5387
|
+
id: "google-btn-n",
|
|
5388
|
+
gradientUnits: "userSpaceOnUse",
|
|
5389
|
+
gradientTransform: "matrix(-3.512595,-4.45809,-1.692547,1.260616,870.8006,191.554)",
|
|
5390
|
+
cx: "45.25866",
|
|
5391
|
+
cy: "279.2738",
|
|
5392
|
+
fx: "45.25866",
|
|
5393
|
+
fy: "279.2738",
|
|
5394
|
+
r: "71.46001"
|
|
5395
|
+
}),
|
|
5396
|
+
h("radialGradient", {
|
|
5397
|
+
href: "#google-btn-d",
|
|
5398
|
+
id: "google-btn-l",
|
|
5399
|
+
cx: "304.0166",
|
|
5400
|
+
cy: "118.0089",
|
|
5401
|
+
fx: "304.0166",
|
|
5402
|
+
fy: "118.0089",
|
|
5403
|
+
r: "47.85445",
|
|
5404
|
+
gradientTransform: "matrix(2.064353,-4.926832e-6,-2.901531e-6,2.592041,-297.6788,-151.7469)",
|
|
5405
|
+
gradientUnits: "userSpaceOnUse"
|
|
5406
|
+
}),
|
|
5407
|
+
h("radialGradient", {
|
|
5408
|
+
href: "#google-btn-e",
|
|
5409
|
+
id: "google-btn-o",
|
|
5410
|
+
gradientUnits: "userSpaceOnUse",
|
|
5411
|
+
gradientTransform: "matrix(-0.2485783,2.083138,2.962486,0.3341668,-255.1463,-331.1636)",
|
|
5412
|
+
cx: "181.001",
|
|
5413
|
+
cy: "177.2013",
|
|
5414
|
+
fx: "181.001",
|
|
5415
|
+
fy: "177.2013",
|
|
5416
|
+
r: "71.46001"
|
|
5417
|
+
}),
|
|
5418
|
+
h("radialGradient", {
|
|
5419
|
+
href: "#google-btn-f",
|
|
5420
|
+
id: "google-btn-p",
|
|
5421
|
+
cx: "207.6733",
|
|
5422
|
+
cy: "108.0972",
|
|
5423
|
+
fx: "207.6733",
|
|
5424
|
+
fy: "108.0972",
|
|
5425
|
+
r: "41.1025",
|
|
5426
|
+
gradientTransform: "matrix(-1.249206,1.343263,-3.896837,-3.425693,880.5011,194.9051)",
|
|
5427
|
+
gradientUnits: "userSpaceOnUse"
|
|
5428
|
+
}),
|
|
5429
|
+
h("radialGradient", {
|
|
5430
|
+
href: "#google-btn-g",
|
|
5431
|
+
id: "google-btn-r",
|
|
5432
|
+
gradientUnits: "userSpaceOnUse",
|
|
5433
|
+
gradientTransform: "matrix(-1.936885,-1.043001,1.455731,-2.555422,290.5254,838.6834)",
|
|
5434
|
+
cx: "109.6267",
|
|
5435
|
+
cy: "135.8619",
|
|
5436
|
+
fx: "109.6267",
|
|
5437
|
+
fy: "135.8619",
|
|
5438
|
+
r: "71.46001"
|
|
5439
|
+
}),
|
|
5440
|
+
h("radialGradient", {
|
|
5441
|
+
href: "#google-btn-h",
|
|
5442
|
+
id: "google-btn-j",
|
|
5443
|
+
gradientUnits: "userSpaceOnUse",
|
|
5444
|
+
gradientTransform: "matrix(-0.081402,-1.93722,2.926737,-0.1162508,-215.1345,632.8606)",
|
|
5445
|
+
cx: "154.8697",
|
|
5446
|
+
cy: "145.9691",
|
|
5447
|
+
fx: "154.8697",
|
|
5448
|
+
fy: "145.9691",
|
|
5449
|
+
r: "71.46001"
|
|
5450
|
+
}),
|
|
5451
|
+
h("filter", {
|
|
5452
|
+
id: "google-btn-q",
|
|
5453
|
+
x: "-.04842873",
|
|
5454
|
+
y: "-.0582241",
|
|
5455
|
+
width: "1.096857",
|
|
5456
|
+
height: "1.116448",
|
|
5457
|
+
"color-interpolation-filters": "sRGB"
|
|
5458
|
+
}, [h("feGaussianBlur", { stdDeviation: "1.700914" })]),
|
|
5459
|
+
h("filter", {
|
|
5460
|
+
id: "google-btn-k",
|
|
5461
|
+
x: "-.01670084",
|
|
5462
|
+
y: "-.01009856",
|
|
5463
|
+
width: "1.033402",
|
|
5464
|
+
height: "1.020197",
|
|
5465
|
+
"color-interpolation-filters": "sRGB"
|
|
5466
|
+
}, [h("feGaussianBlur", { stdDeviation: ".2419367" })]),
|
|
5467
|
+
h("clipPath", {
|
|
5468
|
+
clipPathUnits: "userSpaceOnUse",
|
|
5469
|
+
id: "google-btn-i"
|
|
5470
|
+
}, [h("path", {
|
|
5471
|
+
d: "M371.3784 193.2406H237.0825v53.4375h77.167c-1.2405 7.5627-4.0259 15.0024-8.1049 21.7862-4.6734 7.7723-10.4511 13.6895-16.373 18.1957-17.7389 13.4983-38.42 16.2584-52.7828 16.2584-36.2824 0-67.2833-23.2865-79.2844-54.9287-.4843-1.1482-.8059-2.3344-1.1975-3.5068-2.652-8.0533-4.101-16.5825-4.101-25.4474 0-9.226 1.5691-18.0575 4.4301-26.3985 11.2851-32.8967 42.9849-57.4674 80.1789-57.4674 7.4811 0 14.6854.8843 21.5173 2.6481 15.6135 4.0309 26.6578 11.9698 33.4252 18.2494l40.834-39.7111c-24.839-22.616-57.2194-36.3201-95.8444-36.3201-30.8782-.00066-59.3863 9.55308-82.7477 25.6992-18.9454 13.0941-34.4833 30.6254-44.9695 50.9861-9.75366 18.8785-15.09441 39.7994-15.09441 62.2934 0 22.495 5.34891 43.6334 15.10261 62.3374v.126c10.3023 19.8567 25.3678 36.9537 43.6783 49.9878 15.9962 11.3866 44.6789 26.5516 84.0307 26.5516 22.6301 0 42.6867-4.0517 60.3748-11.6447 12.76-5.4775 24.0655-12.6217 34.3012-21.8036 13.5247-12.1323 24.1168-27.1388 31.3465-44.4041 7.2297-17.2654 11.097-36.7895 11.097-57.957 0-9.858-.9971-19.8694-2.6881-28.9684Z",
|
|
5472
|
+
fill: "#000"
|
|
5473
|
+
})])
|
|
5474
|
+
]), h("g", { transform: "matrix(0.957922,0,0,0.985255,-90.17436,-78.85577)" }, [h("g", { "clip-path": "url(#google-btn-i)" }, [
|
|
5475
|
+
h("path", {
|
|
5476
|
+
d: "M92.07563 219.9585c.14844 22.14 6.5014 44.983 16.11767 63.4234v.1269c6.9482 13.3919 16.4444 23.9704 27.2604 34.4518l65.326-23.67c-12.3593-6.2344-14.2452-10.0546-23.1048-17.0253-9.0537-9.0658-15.8015-19.4735-20.0038-31.677h-.1693l.1693-.1269c-2.7646-8.0587-3.0373-16.6129-3.1393-25.5029Z",
|
|
5477
|
+
fill: "url(#google-btn-j)",
|
|
5478
|
+
filter: "url(#google-btn-k)"
|
|
5479
|
+
}),
|
|
5480
|
+
h("path", {
|
|
5481
|
+
d: "M237.0835 79.02491c-6.4568 22.52569-3.988 44.42139 0 57.16129 7.4561.0055 14.6388.8881 21.4494 2.6464 15.6135 4.0309 26.6566 11.97 33.424 18.2496l41.8794-40.7256c-24.8094-22.58904-54.6663-37.2961-96.7528-37.33169Z",
|
|
5482
|
+
fill: "url(#google-btn-l)",
|
|
5483
|
+
filter: "url(#google-btn-k)"
|
|
5484
|
+
}),
|
|
5485
|
+
h("path", {
|
|
5486
|
+
d: "M236.9434 78.84678c-31.6709-.00068-60.9107 9.79833-84.8718 26.35902-8.8968 6.149-17.0612 13.2521-24.3311 21.1509-1.9045 17.7429 14.2569 39.5507 46.2615 39.3702 15.5284-17.9373 38.4946-29.5427 64.0561-29.5427.0233 0 .046.0019.0693.002l-1.0439-57.33536c-.0472-.00003-.0929-.00406-.1401-.00406Z",
|
|
5487
|
+
fill: "url(#google-btn-m)",
|
|
5488
|
+
filter: "url(#google-btn-k)"
|
|
5489
|
+
}),
|
|
5490
|
+
h("path", {
|
|
5491
|
+
d: "m341.4751 226.3788-28.2685 19.2848c-1.2405 7.5627-4.0278 15.0023-8.1068 21.7861-4.6734 7.7723-10.4506 13.6898-16.3725 18.196-17.7022 13.4704-38.3286 16.2439-52.6877 16.2553-14.8415 25.1018-17.4435 37.6749 1.0439 57.9342 22.8762-.0167 43.157-4.1174 61.0458-11.7965 12.9312-5.551 24.3879-12.7913 34.7609-22.0964 13.7061-12.295 24.4421-27.5034 31.7688-45.0003 7.3267-17.497 11.2446-37.2822 11.2446-58.7336Z",
|
|
5492
|
+
fill: "url(#google-btn-n)",
|
|
5493
|
+
filter: "url(#google-btn-k)"
|
|
5494
|
+
}),
|
|
5115
5495
|
h("path", {
|
|
5116
|
-
d: "
|
|
5117
|
-
fill: "#
|
|
5118
|
-
|
|
5496
|
+
d: "M234.9956 191.2104v57.4981h136.0062c1.1962-7.8745 5.1523-18.0644 5.1523-26.5001 0-9.858-.9963-21.899-2.6873-30.998Z",
|
|
5497
|
+
fill: "#3086ff",
|
|
5498
|
+
filter: "url(#google-btn-k)"
|
|
5119
5499
|
}),
|
|
5120
5500
|
h("path", {
|
|
5121
|
-
d: "
|
|
5122
|
-
fill: "#
|
|
5123
|
-
|
|
5501
|
+
d: "M128.3894 124.3268c-8.393 9.1191-15.5632 19.326-21.2483 30.3646-9.75351 18.8785-15.09402 41.8295-15.09402 64.3235 0 .317.02642.6271.02855.9436 4.31953 8.2244 59.66647 6.6495 62.45617 0-.0035-.3103-.0387-.6128-.0387-.9238 0-9.226 1.5696-16.0262 4.4306-24.3672 3.5294-10.2885 9.0557-19.7628 16.1223-27.9257 1.6019-2.0309 5.8748-6.3969 7.1214-9.0157.4749-.9975-.8621-1.5574-.9369-1.9085-.0836-.3927-1.8762-.0769-2.2778-.3694-1.2751-.9288-3.8001-1.4138-5.3334-1.8449-3.2772-.9215-8.7085-2.9536-11.7252-5.0601-9.5357-6.6586-24.417-14.6122-33.5047-24.2164Z",
|
|
5502
|
+
fill: "url(#google-btn-o)",
|
|
5503
|
+
filter: "url(#google-btn-k)"
|
|
5124
5504
|
}),
|
|
5125
5505
|
h("path", {
|
|
5126
|
-
d: "
|
|
5127
|
-
fill: "#
|
|
5128
|
-
|
|
5506
|
+
d: "M162.0989 155.8569c22.1123 13.3013 28.4714-6.7139 43.173-12.9771L179.698 90.21568c-9.4075 3.92642-18.2957 8.80465-26.5426 14.50442-12.316 8.5122-23.192 18.8995-32.1763 30.7204Z",
|
|
5507
|
+
fill: "url(#google-btn-p)",
|
|
5508
|
+
filter: "url(#google-btn-q)"
|
|
5129
5509
|
}),
|
|
5130
5510
|
h("path", {
|
|
5131
|
-
d: "
|
|
5132
|
-
fill: "#
|
|
5133
|
-
|
|
5511
|
+
d: "M171.0987 290.222c-29.6829 10.6413-34.3299 11.023-37.0622 29.2903 5.2213 5.0597 10.8312 9.74 16.7926 13.9835 15.9962 11.3867 46.766 26.5517 86.1178 26.5517.0462 0 .0904-.004.1366-.004v-59.1574c-.0298.0001-.064.002-.0938.002-14.7359 0-26.5113-3.8435-38.5848-10.5273-2.9768-1.6479-8.3775 2.7772-11.1229.799-3.7865-2.7284-12.8991 2.3508-16.1833-.9378Z",
|
|
5512
|
+
fill: "url(#google-btn-r)",
|
|
5513
|
+
filter: "url(#google-btn-k)"
|
|
5514
|
+
}),
|
|
5515
|
+
h("path", {
|
|
5516
|
+
d: "M219.6997 299.0227v59.9959c5.506.6402 11.2361 1.0289 17.2472 1.0289 6.0259 0 11.8556-.3073 17.5204-.8723v-59.7481c-6.3482 1.0777-12.3272 1.461-17.4776 1.461-5.9318 0-11.7005-.6858-17.29-1.8654Z",
|
|
5517
|
+
opacity: ".5",
|
|
5518
|
+
fill: "url(#google-btn-s)",
|
|
5519
|
+
filter: "url(#google-btn-k)"
|
|
5134
5520
|
})
|
|
5135
|
-
])]);
|
|
5521
|
+
])])]);
|
|
5136
5522
|
return () => h(Button_default, {
|
|
5137
5523
|
...attrs,
|
|
5138
5524
|
color: "secondary",
|
|
@@ -7524,22 +7910,31 @@ const FIELDS_TO_SKIP = [
|
|
|
7524
7910
|
"verifiedEmailAddresses",
|
|
7525
7911
|
"phoneNumbers.mobile",
|
|
7526
7912
|
"emailAddresses",
|
|
7527
|
-
"preferredMFAOption"
|
|
7913
|
+
"preferredMFAOption",
|
|
7914
|
+
"attributes",
|
|
7915
|
+
"isReadOnly",
|
|
7916
|
+
"isReadonly"
|
|
7528
7917
|
];
|
|
7529
7918
|
const READONLY_FIELDS = [
|
|
7530
7919
|
"username",
|
|
7531
7920
|
"userName",
|
|
7532
|
-
"user_name"
|
|
7921
|
+
"user_name",
|
|
7922
|
+
"sub",
|
|
7923
|
+
"id",
|
|
7924
|
+
"ouId",
|
|
7925
|
+
"attributes",
|
|
7926
|
+
"isReadOnly",
|
|
7927
|
+
"isReadonly"
|
|
7533
7928
|
];
|
|
7534
7929
|
const DEFAULT_ATTRIBUTE_MAPPINGS$1 = {
|
|
7535
7930
|
email: ["emails", "email"],
|
|
7536
7931
|
firstName: ["name.givenName", "given_name"],
|
|
7537
7932
|
lastName: ["name.familyName", "family_name"],
|
|
7538
7933
|
picture: [
|
|
7539
|
-
"profile",
|
|
7540
|
-
"profileUrl",
|
|
7541
7934
|
"picture",
|
|
7542
|
-
"
|
|
7935
|
+
"avatar",
|
|
7936
|
+
"pictureUrl",
|
|
7937
|
+
"attributes.picture"
|
|
7543
7938
|
],
|
|
7544
7939
|
username: [
|
|
7545
7940
|
"userName",
|
|
@@ -7626,6 +8021,10 @@ const BaseUserProfile = defineComponent({
|
|
|
7626
8021
|
default: void 0,
|
|
7627
8022
|
type: Function
|
|
7628
8023
|
},
|
|
8024
|
+
preferences: {
|
|
8025
|
+
default: void 0,
|
|
8026
|
+
type: Object
|
|
8027
|
+
},
|
|
7629
8028
|
profile: {
|
|
7630
8029
|
default: null,
|
|
7631
8030
|
type: Object
|
|
@@ -7642,21 +8041,38 @@ const BaseUserProfile = defineComponent({
|
|
|
7642
8041
|
default: () => [],
|
|
7643
8042
|
type: Array
|
|
7644
8043
|
},
|
|
8044
|
+
t: {
|
|
8045
|
+
default: void 0,
|
|
8046
|
+
type: Function
|
|
8047
|
+
},
|
|
7645
8048
|
title: {
|
|
7646
8049
|
default: "Profile",
|
|
7647
8050
|
type: String
|
|
8051
|
+
},
|
|
8052
|
+
userSchema: {
|
|
8053
|
+
default: null,
|
|
8054
|
+
type: Object
|
|
7648
8055
|
}
|
|
7649
8056
|
},
|
|
7650
8057
|
setup(props, { slots }) {
|
|
7651
8058
|
const editingFields = ref({});
|
|
7652
8059
|
const editedValues = ref({});
|
|
7653
8060
|
const px = withVendorCSSClassPrefix;
|
|
7654
|
-
|
|
7655
|
-
|
|
8061
|
+
const regexCache = /* @__PURE__ */ new Map();
|
|
8062
|
+
const t = (key, fallback) => {
|
|
8063
|
+
if (props.t) {
|
|
8064
|
+
const res = props.t(key);
|
|
8065
|
+
if (res && res !== key) return res;
|
|
8066
|
+
}
|
|
8067
|
+
return fallback ?? key;
|
|
8068
|
+
};
|
|
8069
|
+
function shouldShowField(fieldName, isSchemaBased = false) {
|
|
8070
|
+
if (!isSchemaBased && FIELDS_TO_SKIP.includes(fieldName)) return false;
|
|
7656
8071
|
if (props.hideFields && props.hideFields.length > 0 && props.hideFields.includes(fieldName)) return false;
|
|
7657
8072
|
if (props.showFields && props.showFields.length > 0) return props.showFields.includes(fieldName);
|
|
7658
8073
|
return true;
|
|
7659
8074
|
}
|
|
8075
|
+
const fieldErrors = ref({});
|
|
7660
8076
|
function startEditing(fieldName, currentValue) {
|
|
7661
8077
|
editedValues.value = {
|
|
7662
8078
|
...editedValues.value,
|
|
@@ -7666,9 +8082,14 @@ const BaseUserProfile = defineComponent({
|
|
|
7666
8082
|
...editingFields.value,
|
|
7667
8083
|
[fieldName]: true
|
|
7668
8084
|
};
|
|
8085
|
+
fieldErrors.value = {
|
|
8086
|
+
...fieldErrors.value,
|
|
8087
|
+
[fieldName]: ""
|
|
8088
|
+
};
|
|
7669
8089
|
}
|
|
7670
8090
|
function cancelEditing(fieldName) {
|
|
7671
|
-
const
|
|
8091
|
+
const data = props.flattenedProfile ?? props.profile ?? null;
|
|
8092
|
+
const originalValue = data?.[fieldName] ?? data?.attributes?.[fieldName] ?? "";
|
|
7672
8093
|
editedValues.value = {
|
|
7673
8094
|
...editedValues.value,
|
|
7674
8095
|
[fieldName]: originalValue
|
|
@@ -7677,16 +8098,54 @@ const BaseUserProfile = defineComponent({
|
|
|
7677
8098
|
...editingFields.value,
|
|
7678
8099
|
[fieldName]: false
|
|
7679
8100
|
};
|
|
8101
|
+
fieldErrors.value = {
|
|
8102
|
+
...fieldErrors.value,
|
|
8103
|
+
[fieldName]: ""
|
|
8104
|
+
};
|
|
7680
8105
|
}
|
|
7681
|
-
function saveField(schema) {
|
|
8106
|
+
async function saveField(schema) {
|
|
7682
8107
|
if (!props.onUpdate || !schema.name) return;
|
|
7683
|
-
const
|
|
7684
|
-
const
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
8108
|
+
const fieldName = schema.name;
|
|
8109
|
+
const value = editedValues.value[fieldName] ?? "";
|
|
8110
|
+
const strVal = String(value ?? "").trim();
|
|
8111
|
+
const fieldLabel = schema.displayName || formatLabel(fieldName);
|
|
8112
|
+
if (schema.required && !strVal) {
|
|
8113
|
+
fieldErrors.value = {
|
|
8114
|
+
...fieldErrors.value,
|
|
8115
|
+
[fieldName]: t("userProfile.field.required", `${fieldLabel} is required.`)
|
|
8116
|
+
};
|
|
8117
|
+
return;
|
|
8118
|
+
}
|
|
8119
|
+
if (schema.regex && strVal) if (schema.regex.length > 250) console.warn(`Regex pattern for field "${fieldName}" exceeds maximum length limit (250 chars).`);
|
|
8120
|
+
else {
|
|
8121
|
+
let reg = regexCache.get(schema.regex);
|
|
8122
|
+
if (reg === void 0) try {
|
|
8123
|
+
reg = new RegExp(schema.regex);
|
|
8124
|
+
regexCache.set(schema.regex, reg);
|
|
8125
|
+
} catch (err) {
|
|
8126
|
+
regexCache.set(schema.regex, null);
|
|
8127
|
+
console.warn(`Invalid regular expression syntax in user schema for field "${fieldName}":`, err);
|
|
8128
|
+
}
|
|
8129
|
+
if (reg && !reg.test(strVal)) {
|
|
8130
|
+
fieldErrors.value = {
|
|
8131
|
+
...fieldErrors.value,
|
|
8132
|
+
[fieldName]: t("userProfile.field.invalidFormat", `${fieldLabel} has an invalid format.`)
|
|
8133
|
+
};
|
|
8134
|
+
return;
|
|
8135
|
+
}
|
|
8136
|
+
}
|
|
8137
|
+
fieldErrors.value = {
|
|
8138
|
+
...fieldErrors.value,
|
|
8139
|
+
[fieldName]: ""
|
|
7689
8140
|
};
|
|
8141
|
+
const payload = buildPatchValue(fieldName, typeof value === "string" ? strVal : value, schema.schemaId, schema.multiValued);
|
|
8142
|
+
try {
|
|
8143
|
+
await props.onUpdate(payload);
|
|
8144
|
+
editingFields.value = {
|
|
8145
|
+
...editingFields.value,
|
|
8146
|
+
[fieldName]: false
|
|
8147
|
+
};
|
|
8148
|
+
} catch {}
|
|
7690
8149
|
}
|
|
7691
8150
|
function renderInput(schema) {
|
|
7692
8151
|
const fieldName = schema.name ?? "";
|
|
@@ -7739,30 +8198,29 @@ const BaseUserProfile = defineComponent({
|
|
|
7739
8198
|
class: px("user-profile__field-placeholder"),
|
|
7740
8199
|
onClick: () => startEditing(name, value)
|
|
7741
8200
|
}, `Enter your ${label.toLowerCase()}`) : null;
|
|
7742
|
-
const displayValueNode = hasValue ? h(
|
|
7743
|
-
class: px("user-profile__field-value"),
|
|
7744
|
-
variant: "body1"
|
|
7745
|
-
}, () => String(value)) : editablePlaceholder;
|
|
8201
|
+
const displayValueNode = hasValue ? h("span", { class: px("user-profile__field-value") }, String(value)) : editablePlaceholder;
|
|
7746
8202
|
return h("div", {
|
|
7747
8203
|
class: px("user-profile__field"),
|
|
7748
8204
|
key: name
|
|
7749
|
-
}, [h("div", { class: px("user-profile__field-label-
|
|
7750
|
-
|
|
7751
|
-
variant: "body2"
|
|
7752
|
-
}, () => label)]), h("div", { class: px("user-profile__field-value-col") }, [isEditing ? h("div", { class: px("user-profile__field-edit") }, [renderInput(schema), h("div", { class: px("user-profile__field-edit-actions") }, [h(Button_default, {
|
|
8205
|
+
}, [h("div", { class: px("user-profile__field-inner") }, [h("span", { class: px("user-profile__field-label") }, label), isEditing ? h("div", { class: px("user-profile__field-edit") }, [renderInput(schema), fieldErrors.value[name] ? h("div", { class: px("user-profile__field-error") }, fieldErrors.value[name]) : null]) : displayValueNode]), isEditable && !isReadonly ? h("div", { class: px("user-profile__field-actions") }, [isEditing ? [h(Button_default, {
|
|
8206
|
+
color: "primary",
|
|
7753
8207
|
onClick: () => saveField(schema),
|
|
7754
8208
|
size: "small",
|
|
7755
8209
|
variant: "solid"
|
|
7756
|
-
}, () => "Save"), h(Button_default, {
|
|
8210
|
+
}, () => t("userProfile.actions.save", "Save")), h(Button_default, {
|
|
8211
|
+
color: "secondary",
|
|
7757
8212
|
onClick: () => cancelEditing(name),
|
|
7758
8213
|
size: "small",
|
|
7759
|
-
variant: "
|
|
7760
|
-
}, () =>
|
|
7761
|
-
"aria-label": `Edit ${label}`,
|
|
8214
|
+
variant: "solid"
|
|
8215
|
+
}, () => t("userProfile.actions.cancel", "Cancel"))] : hasValue ? h(Button_default, {
|
|
7762
8216
|
class: px("user-profile__field-edit-btn"),
|
|
8217
|
+
color: "secondary",
|
|
7763
8218
|
onClick: () => startEditing(name, value),
|
|
7764
|
-
|
|
7765
|
-
|
|
8219
|
+
size: "small",
|
|
8220
|
+
startIcon: h(PencilIcon),
|
|
8221
|
+
title: t("userProfile.actions.edit", "Edit"),
|
|
8222
|
+
variant: "ghost"
|
|
8223
|
+
}) : null]) : null]);
|
|
7766
8224
|
}
|
|
7767
8225
|
function renderProfileWithoutSchemas() {
|
|
7768
8226
|
const data = props.flattenedProfile || props.profile;
|
|
@@ -7773,21 +8231,20 @@ const BaseUserProfile = defineComponent({
|
|
|
7773
8231
|
}).sort(([a], [b]) => a.localeCompare(b)).map(([key, value]) => h("div", {
|
|
7774
8232
|
class: px("user-profile__field"),
|
|
7775
8233
|
key
|
|
7776
|
-
}, [h("div", { class: px("user-profile__field-
|
|
7777
|
-
class: px("user-profile__field-label"),
|
|
7778
|
-
variant: "body2"
|
|
7779
|
-
}, () => formatLabel(key))]), h("div", { class: px("user-profile__field-value-col") }, [h(Typography_default, {
|
|
7780
|
-
class: px("user-profile__field-value"),
|
|
7781
|
-
variant: "body1"
|
|
7782
|
-
}, () => typeof value === "object" ? JSON.stringify(value) : String(value))])]));
|
|
8234
|
+
}, [h("div", { class: px("user-profile__field-inner") }, [h("span", { class: px("user-profile__field-label") }, formatLabel(key)), h("span", { class: px("user-profile__field-value") }, typeof value === "object" ? JSON.stringify(value) : String(value))])]));
|
|
7783
8235
|
}
|
|
7784
8236
|
function renderHero(currentUser) {
|
|
7785
8237
|
const displayName = getDisplayName_default(DEFAULT_ATTRIBUTE_MAPPINGS$1, currentUser);
|
|
7786
8238
|
const email = getMappedUserProfileValue_default("email", DEFAULT_ATTRIBUTE_MAPPINGS$1, currentUser) || getMappedUserProfileValue_default("username", DEFAULT_ATTRIBUTE_MAPPINGS$1, currentUser);
|
|
8239
|
+
const picture = getMappedUserProfileValue_default("picture", DEFAULT_ATTRIBUTE_MAPPINGS$1, currentUser) || null;
|
|
7787
8240
|
const avatarGradient = getAvatarGradient$1(String(currentUser["username"] || currentUser["userName"] || currentUser["email"] || currentUser["sub"] || displayName));
|
|
7788
8241
|
const initials = displayName.split(" ").map((w) => w.charAt(0)).slice(0, 2).join("").toUpperCase() || "?";
|
|
7789
8242
|
const avatarSizeClass = px(`user-profile__avatar--${props.avatarSize ?? "lg"}`);
|
|
7790
|
-
return h("div", { class: px("user-profile__hero") }, [h("div", { class: px("user-profile__avatar-wrapper") }, [h("
|
|
8243
|
+
return h("div", { class: px("user-profile__hero") }, [h("div", { class: px("user-profile__avatar-wrapper") }, [picture ? h("img", {
|
|
8244
|
+
alt: displayName,
|
|
8245
|
+
class: [px("user-profile__avatar"), avatarSizeClass].join(" "),
|
|
8246
|
+
src: picture
|
|
8247
|
+
}) : h("div", {
|
|
7791
8248
|
class: [px("user-profile__avatar"), avatarSizeClass].join(" "),
|
|
7792
8249
|
style: { background: avatarGradient }
|
|
7793
8250
|
}, [h("span", { class: px("user-profile__avatar-initials") }, initials)])]), h("div", { class: px("user-profile__hero-info") }, [h("span", { class: px("user-profile__hero-name") }, displayName), email ? h("span", { class: px("user-profile__hero-subtitle") }, String(email)) : null])]);
|
|
@@ -7813,15 +8270,31 @@ const BaseUserProfile = defineComponent({
|
|
|
7813
8270
|
props.className ?? ""
|
|
7814
8271
|
].filter(Boolean).join(" ");
|
|
7815
8272
|
const children = [];
|
|
7816
|
-
children.push(h("div", { class: px("user-profile__header") }, [h("span", { class: px("user-profile__title") }, props.title ?? "Profile")]));
|
|
7817
|
-
children.push(h(Divider_default, { class: px("user-profile__header-divider") }));
|
|
7818
8273
|
if (props.showAvatar !== false && currentUser) children.push(renderHero(currentUser));
|
|
7819
8274
|
if (props.error) children.push(h(Alert_default, {
|
|
7820
8275
|
class: px("user-profile__error"),
|
|
7821
8276
|
severity: "error"
|
|
7822
8277
|
}, () => props.error));
|
|
7823
8278
|
if (props.isLoading) children.push(h("div", { class: px("user-profile__loading") }, [h(Spinner_default)]));
|
|
7824
|
-
else if (
|
|
8279
|
+
else if (props.userSchema && typeof props.userSchema === "object" && Object.keys(props.userSchema).length > 0) {
|
|
8280
|
+
const fieldRows = Object.entries(props.userSchema).filter(([key, metaAttr]) => {
|
|
8281
|
+
if (metaAttr?.credential) return false;
|
|
8282
|
+
return shouldShowField(key, true);
|
|
8283
|
+
}).map(([key, metaAttr]) => {
|
|
8284
|
+
const val = editedValues.value?.[key] ?? currentUser?.attributes?.[key] ?? currentUser?.[key] ?? "";
|
|
8285
|
+
const isReadonly = metaAttr.readOnly === true || metaAttr.mutability === "READ_ONLY" || READONLY_FIELDS.includes(key);
|
|
8286
|
+
return {
|
|
8287
|
+
displayName: metaAttr.displayName ?? (key ? startCase(key) : ""),
|
|
8288
|
+
mutability: isReadonly ? "READ_ONLY" : "READ_WRITE",
|
|
8289
|
+
name: key,
|
|
8290
|
+
regex: metaAttr.regex,
|
|
8291
|
+
required: !!metaAttr.required,
|
|
8292
|
+
type: (metaAttr.type ?? "STRING").toUpperCase(),
|
|
8293
|
+
value: val
|
|
8294
|
+
};
|
|
8295
|
+
}).map((schema) => renderSchemaFieldRow(schema)).filter((node) => node !== null);
|
|
8296
|
+
children.push(h("div", { class: px("user-profile__fields") }, fieldRows));
|
|
8297
|
+
} else if (hasSchemas) {
|
|
7825
8298
|
const fieldRows = schemas.filter((s) => s.name && shouldShowField(s.name)).sort((a, b) => {
|
|
7826
8299
|
return (a.displayOrder ? parseInt(a.displayOrder, 10) : 999) - (b.displayOrder ? parseInt(b.displayOrder, 10) : 999);
|
|
7827
8300
|
}).map((schema) => {
|
|
@@ -7851,7 +8324,7 @@ const updateMeProfile$1 = async ({ fetcher, instanceId = 0,...requestConfig }) =
|
|
|
7851
8324
|
const response = await FetchHttpClient.getInstance(instanceId).request({
|
|
7852
8325
|
data: config.body ? JSON.parse(config.body) : void 0,
|
|
7853
8326
|
headers: config.headers,
|
|
7854
|
-
method: config.method || "
|
|
8327
|
+
method: config.method || "PUT",
|
|
7855
8328
|
url
|
|
7856
8329
|
});
|
|
7857
8330
|
return {
|
|
@@ -7902,6 +8375,10 @@ const UserProfile = defineComponent({
|
|
|
7902
8375
|
default: () => [],
|
|
7903
8376
|
type: Array
|
|
7904
8377
|
},
|
|
8378
|
+
preferences: {
|
|
8379
|
+
default: void 0,
|
|
8380
|
+
type: Object
|
|
8381
|
+
},
|
|
7905
8382
|
showAvatar: {
|
|
7906
8383
|
default: true,
|
|
7907
8384
|
type: Boolean
|
|
@@ -7916,19 +8393,37 @@ const UserProfile = defineComponent({
|
|
|
7916
8393
|
}
|
|
7917
8394
|
},
|
|
7918
8395
|
setup(props, { slots }) {
|
|
7919
|
-
const { baseUrl, endpoints, instanceId } = useThunderID_default();
|
|
7920
|
-
const { flattenedProfile, profile, onUpdateProfile } = useUser_default();
|
|
8396
|
+
const { baseUrl, endpoints, instanceId, preferences: contextPreferences } = useThunderID_default();
|
|
8397
|
+
const { flattenedProfile, profile, onUpdateProfile, updateProfile, userSchema } = useUser_default();
|
|
7921
8398
|
const { t } = useI18n_default();
|
|
8399
|
+
const resolvedPreferences = computed(() => ({
|
|
8400
|
+
...contextPreferences,
|
|
8401
|
+
...props.preferences,
|
|
8402
|
+
user: {
|
|
8403
|
+
...contextPreferences?.user,
|
|
8404
|
+
...props.preferences?.user
|
|
8405
|
+
}
|
|
8406
|
+
}));
|
|
8407
|
+
const isEditableProfile = computed(() => resolvedPreferences.value?.user?.fetchUserProfile === false ? false : props.editable);
|
|
7922
8408
|
const error = ref(null);
|
|
7923
8409
|
async function handleProfileUpdate(payload) {
|
|
7924
|
-
if (!baseUrl) return;
|
|
7925
8410
|
error.value = null;
|
|
7926
8411
|
try {
|
|
8412
|
+
const updatedAttributes = deepMerge((profile?.value?.profile ?? profile?.value)?.["attributes"] ?? {}, payload);
|
|
8413
|
+
Object.keys(updatedAttributes).forEach((key) => {
|
|
8414
|
+
if (updatedAttributes[key] === void 0 || updatedAttributes[key] === null) delete updatedAttributes[key];
|
|
8415
|
+
});
|
|
8416
|
+
if (updateProfile) {
|
|
8417
|
+
const res = await updateProfile({ payload: updatedAttributes });
|
|
8418
|
+
if (res && !res.success && res.error) error.value = res.error;
|
|
8419
|
+
return;
|
|
8420
|
+
}
|
|
8421
|
+
if (!baseUrl) return;
|
|
7927
8422
|
onUpdateProfile(await updateMeProfile_default({
|
|
7928
8423
|
baseUrl,
|
|
7929
8424
|
url: resolveResourceEndpoint("usersMe", { endpoints }),
|
|
7930
8425
|
instanceId,
|
|
7931
|
-
payload
|
|
8426
|
+
payload: updatedAttributes
|
|
7932
8427
|
}));
|
|
7933
8428
|
} catch (caughtError) {
|
|
7934
8429
|
let message = t("user.profile.update.generic.error") || "Failed to update profile. Please try again.";
|
|
@@ -7943,15 +8438,18 @@ const UserProfile = defineComponent({
|
|
|
7943
8438
|
class: withVendorCSSClassPrefix("user-profile--styled"),
|
|
7944
8439
|
className: props.className,
|
|
7945
8440
|
compact: props.compact,
|
|
7946
|
-
editable:
|
|
8441
|
+
editable: isEditableProfile.value,
|
|
7947
8442
|
error: error.value,
|
|
7948
8443
|
flattenedProfile: flattenedProfile?.value,
|
|
7949
8444
|
hideFields: props.hideFields,
|
|
7950
|
-
onUpdate: handleProfileUpdate,
|
|
8445
|
+
onUpdate: isEditableProfile.value ? handleProfileUpdate : void 0,
|
|
8446
|
+
preferences: resolvedPreferences.value,
|
|
7951
8447
|
profile: profile?.value?.profile ?? flattenedProfile?.value,
|
|
7952
8448
|
showAvatar: props.showAvatar,
|
|
7953
8449
|
showFields: props.showFields,
|
|
7954
|
-
|
|
8450
|
+
t,
|
|
8451
|
+
title: props.title,
|
|
8452
|
+
userSchema: userSchema?.value
|
|
7955
8453
|
}, slots);
|
|
7956
8454
|
}
|
|
7957
8455
|
});
|
|
@@ -7963,18 +8461,18 @@ const DEFAULT_ATTRIBUTE_MAPPINGS = {
|
|
|
7963
8461
|
email: ["emails", "email"],
|
|
7964
8462
|
firstName: ["name.givenName", "given_name"],
|
|
7965
8463
|
lastName: ["name.familyName", "family_name"],
|
|
8464
|
+
picture: [
|
|
8465
|
+
"picture",
|
|
8466
|
+
"avatar",
|
|
8467
|
+
"pictureUrl",
|
|
8468
|
+
"attributes.picture"
|
|
8469
|
+
],
|
|
7966
8470
|
username: [
|
|
7967
8471
|
"userName",
|
|
7968
8472
|
"username",
|
|
7969
8473
|
"user_name"
|
|
7970
8474
|
]
|
|
7971
8475
|
};
|
|
7972
|
-
/** Approximate min-width for each size, used for auto-alignment decisions. */
|
|
7973
|
-
const MENU_MIN_WIDTHS = {
|
|
7974
|
-
lg: 280,
|
|
7975
|
-
md: 220,
|
|
7976
|
-
sm: 180
|
|
7977
|
-
};
|
|
7978
8476
|
const AVATAR_GRADIENTS = [
|
|
7979
8477
|
"linear-gradient(135deg, #4b6ef5 0%, #7c3aed 100%)",
|
|
7980
8478
|
"linear-gradient(135deg, #0ea5e9 0%, #4b6ef5 100%)",
|
|
@@ -7996,16 +8494,19 @@ function resolveUserInfo(user) {
|
|
|
7996
8494
|
displayName: "User",
|
|
7997
8495
|
gradient: AVATAR_GRADIENTS[0],
|
|
7998
8496
|
initials: "?",
|
|
8497
|
+
picture: null,
|
|
7999
8498
|
subtitle: ""
|
|
8000
8499
|
};
|
|
8001
8500
|
const displayName = getDisplayName_default(DEFAULT_ATTRIBUTE_MAPPINGS, user) || "User";
|
|
8002
8501
|
const initials = displayName.split(" ").map((w) => w.charAt(0)).slice(0, 2).join("").toUpperCase() || "?";
|
|
8502
|
+
const picture = getMappedUserProfileValue_default("picture", DEFAULT_ATTRIBUTE_MAPPINGS, user) || null;
|
|
8003
8503
|
const seed = String(getMappedUserProfileValue_default("username", DEFAULT_ATTRIBUTE_MAPPINGS, user) || getMappedUserProfileValue_default("email", DEFAULT_ATTRIBUTE_MAPPINGS, user) || displayName);
|
|
8004
8504
|
const subtitle = String(getMappedUserProfileValue_default("email", DEFAULT_ATTRIBUTE_MAPPINGS, user) || getMappedUserProfileValue_default("username", DEFAULT_ATTRIBUTE_MAPPINGS, user) || "");
|
|
8005
8505
|
return {
|
|
8006
8506
|
displayName,
|
|
8007
8507
|
gradient: getAvatarGradient(seed),
|
|
8008
8508
|
initials,
|
|
8509
|
+
picture,
|
|
8009
8510
|
subtitle
|
|
8010
8511
|
};
|
|
8011
8512
|
}
|
|
@@ -8061,13 +8562,46 @@ const BaseUserDropdown = defineComponent({
|
|
|
8061
8562
|
setup(props, { slots }) {
|
|
8062
8563
|
const isOpen = ref(false);
|
|
8063
8564
|
const containerRef = ref(null);
|
|
8565
|
+
const modalOverlayRef = ref(null);
|
|
8566
|
+
const avatarImageError = ref(false);
|
|
8064
8567
|
const px = withVendorCSSClassPrefix;
|
|
8568
|
+
watch(() => resolveUserInfo(props.user ?? null).picture, () => {
|
|
8569
|
+
avatarImageError.value = false;
|
|
8570
|
+
});
|
|
8065
8571
|
function handleClickOutside(event) {
|
|
8066
8572
|
if (containerRef.value && !containerRef.value.contains(event.target)) isOpen.value = false;
|
|
8067
8573
|
}
|
|
8574
|
+
function handleModalClose() {
|
|
8575
|
+
props.onProfileModalClose?.();
|
|
8576
|
+
(containerRef.value?.querySelector(`.${px("user-dropdown__trigger")}`))?.focus();
|
|
8577
|
+
}
|
|
8068
8578
|
function handleKeyDown(event) {
|
|
8069
|
-
if (
|
|
8579
|
+
if (props.isProfileModalOpen) {
|
|
8580
|
+
if (event.key === "Escape") handleModalClose();
|
|
8581
|
+
else if (event.key === "Tab") {
|
|
8582
|
+
const overlay = modalOverlayRef.value;
|
|
8583
|
+
if (overlay) {
|
|
8584
|
+
const focusables = overlay.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])");
|
|
8585
|
+
if (focusables.length > 0) {
|
|
8586
|
+
const first = focusables[0];
|
|
8587
|
+
const last = focusables[focusables.length - 1];
|
|
8588
|
+
if (event.shiftKey && document.activeElement === first) {
|
|
8589
|
+
event.preventDefault();
|
|
8590
|
+
last.focus();
|
|
8591
|
+
} else if (!event.shiftKey && document.activeElement === last) {
|
|
8592
|
+
event.preventDefault();
|
|
8593
|
+
first.focus();
|
|
8594
|
+
}
|
|
8595
|
+
}
|
|
8596
|
+
}
|
|
8597
|
+
}
|
|
8598
|
+
} else if (event.key === "Escape") isOpen.value = false;
|
|
8070
8599
|
}
|
|
8600
|
+
watch(() => props.isProfileModalOpen, (open) => {
|
|
8601
|
+
if (open) nextTick(() => {
|
|
8602
|
+
(modalOverlayRef.value?.querySelector(`.${px("user-dropdown__modal-close")}`))?.focus();
|
|
8603
|
+
});
|
|
8604
|
+
});
|
|
8071
8605
|
onMounted(() => {
|
|
8072
8606
|
document.addEventListener("click", handleClickOutside);
|
|
8073
8607
|
document.addEventListener("keydown", handleKeyDown);
|
|
@@ -8080,8 +8614,7 @@ const BaseUserDropdown = defineComponent({
|
|
|
8080
8614
|
if (props.menuAlign !== "auto") return props.menuAlign ?? "right";
|
|
8081
8615
|
if (!containerRef.value) return "right";
|
|
8082
8616
|
const rect = containerRef.value.getBoundingClientRect();
|
|
8083
|
-
|
|
8084
|
-
return window.innerWidth - rect.right >= menuWidth ? "right" : "left";
|
|
8617
|
+
return window.innerWidth - rect.left >= rect.right ? "left" : "right";
|
|
8085
8618
|
}
|
|
8086
8619
|
return () => {
|
|
8087
8620
|
if (slots.default) return slots.default({
|
|
@@ -8091,7 +8624,7 @@ const BaseUserDropdown = defineComponent({
|
|
|
8091
8624
|
},
|
|
8092
8625
|
user: props.user
|
|
8093
8626
|
});
|
|
8094
|
-
const { displayName, initials, gradient, subtitle } = resolveUserInfo(props.user ?? null);
|
|
8627
|
+
const { displayName, initials, gradient, picture, subtitle } = resolveUserInfo(props.user ?? null);
|
|
8095
8628
|
const size = props.size ?? "md";
|
|
8096
8629
|
const avatarSizeClass = size !== "md" ? px(`user-dropdown__avatar--${size}`) : "";
|
|
8097
8630
|
const triggerClass = [px("user-dropdown__trigger"), isOpen.value ? px("user-dropdown__trigger--open") : ""].filter(Boolean).join(" ");
|
|
@@ -8104,7 +8637,14 @@ const BaseUserDropdown = defineComponent({
|
|
|
8104
8637
|
isOpen.value = !isOpen.value;
|
|
8105
8638
|
},
|
|
8106
8639
|
type: "button"
|
|
8107
|
-
}, [h("
|
|
8640
|
+
}, [picture && !avatarImageError.value ? h("img", {
|
|
8641
|
+
alt: displayName,
|
|
8642
|
+
class: [px("user-dropdown__avatar"), avatarSizeClass].filter(Boolean).join(" "),
|
|
8643
|
+
onError: () => {
|
|
8644
|
+
avatarImageError.value = true;
|
|
8645
|
+
},
|
|
8646
|
+
src: picture
|
|
8647
|
+
}) : h("span", {
|
|
8108
8648
|
class: [px("user-dropdown__avatar"), avatarSizeClass].filter(Boolean).join(" "),
|
|
8109
8649
|
style: { background: gradient }
|
|
8110
8650
|
}, initials), props.showChevron ? h("span", { class: px("user-dropdown__chevron") }, [h(ChevronDownIcon, { size: 14 })]) : null]);
|
|
@@ -8118,7 +8658,11 @@ const BaseUserDropdown = defineComponent({
|
|
|
8118
8658
|
sizeClass
|
|
8119
8659
|
].filter(Boolean).join(" ");
|
|
8120
8660
|
const menuChildren = [];
|
|
8121
|
-
menuChildren.push(h("div", { class: px("user-dropdown__menu-header") }, [h("
|
|
8661
|
+
menuChildren.push(h("div", { class: px("user-dropdown__menu-header") }, [picture ? h("img", {
|
|
8662
|
+
alt: displayName,
|
|
8663
|
+
class: px("user-dropdown__menu-header-avatar"),
|
|
8664
|
+
src: picture
|
|
8665
|
+
}) : h("div", {
|
|
8122
8666
|
class: px("user-dropdown__menu-header-avatar"),
|
|
8123
8667
|
style: { background: gradient }
|
|
8124
8668
|
}, initials), h("div", { class: px("user-dropdown__menu-header-info") }, [h("span", { class: px("user-dropdown__menu-header-name") }, displayName), subtitle ? h("span", { class: px("user-dropdown__menu-header-subtitle") }, subtitle) : null])]));
|
|
@@ -8164,17 +8708,21 @@ const BaseUserDropdown = defineComponent({
|
|
|
8164
8708
|
class: [px("user-dropdown"), props.className].filter(Boolean).join(" "),
|
|
8165
8709
|
ref: containerRef
|
|
8166
8710
|
}, [trigger, menu]);
|
|
8167
|
-
if (props.isProfileModalOpen) return h("div", [container, h("div", {
|
|
8711
|
+
if (props.isProfileModalOpen) return h("div", [container, h(Teleport, { to: "body" }, [h("div", {
|
|
8712
|
+
"aria-label": "User profile",
|
|
8713
|
+
"aria-modal": "true",
|
|
8168
8714
|
class: px("user-dropdown__modal-overlay"),
|
|
8715
|
+
ref: modalOverlayRef,
|
|
8716
|
+
role: "dialog",
|
|
8169
8717
|
onClick: (e) => {
|
|
8170
|
-
if (e.target.classList.contains(px("user-dropdown__modal-overlay")))
|
|
8718
|
+
if (e.target.classList.contains(px("user-dropdown__modal-overlay"))) handleModalClose();
|
|
8171
8719
|
}
|
|
8172
8720
|
}, [h("div", { class: px("user-dropdown__modal-content") }, [h("button", {
|
|
8173
8721
|
"aria-label": "Close profile",
|
|
8174
8722
|
class: px("user-dropdown__modal-close"),
|
|
8175
|
-
onClick:
|
|
8723
|
+
onClick: handleModalClose,
|
|
8176
8724
|
type: "button"
|
|
8177
|
-
}, [h(XIcon, { size: 18 })]), props.profileContent])])]);
|
|
8725
|
+
}, [h(XIcon, { size: 18 })]), props.profileContent])])])]);
|
|
8178
8726
|
return container;
|
|
8179
8727
|
};
|
|
8180
8728
|
}
|
|
@@ -9516,4 +10064,4 @@ const createCallbackRoute = (options = {}) => {
|
|
|
9516
10064
|
};
|
|
9517
10065
|
|
|
9518
10066
|
//#endregion
|
|
9519
|
-
export { AcceptInvite_default as AcceptInvite, Alert_default as Alert, ArrowLeftRightIcon, BaseAcceptInvite_default as BaseAcceptInvite, BaseInviteUser_default as BaseInviteUser, BaseLanguageSwitcher_default as BaseLanguageSwitcher, BaseSignIn_default as BaseSignIn, BaseSignInButton_default as BaseSignInButton, BaseSignOutButton_default as BaseSignOutButton, BaseSignUp_default as BaseSignUp, BaseSignUpButton_default as BaseSignUpButton, BaseUserDropdown_default as BaseUserDropdown, BaseUserProfile_default as BaseUserProfile, BuildingIcon, Button_default as Button, Callback_default as Callback, Card_default as Card, CheckIcon, Checkbox_default as Checkbox, ChevronDownIcon, CircleAlertIcon, CircleCheckIcon, DatePicker_default as DatePicker, Divider_default as Divider, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowEventType, EmbeddedFlowTextVariant, EmbeddedSignInFlowStatus, EmbeddedSignInFlowType, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowType, EyeIcon, EyeOffIcon, FLOW_KEY, FLOW_META_KEY, FacebookButton_default as FacebookButton, FieldFactory_default as FieldFactory, FieldType, FlowMetaProvider_default as FlowMetaProvider, FlowProvider_default as FlowProvider, GitHubButton_default as GitHubButton, GlobeIcon, GoogleButton_default as GoogleButton, I18N_KEY, I18nProvider_default as I18nProvider, InfoIcon, InviteUser_default as InviteUser, LanguageSwitcher_default as LanguageSwitcher, Loading_default as Loading, LogOutIcon, Logo_default as Logo, MicrosoftButton_default as MicrosoftButton, OtpField_default as OtpField, PasswordField_default as PasswordField, PencilIcon, PlusIcon, Select_default as Select, SignIn_default as SignIn, SignInButton_default as SignInButton, SignOutButton_default as SignOutButton, SignUp_default as SignUp, SignUpButton_default as SignUpButton, SignedIn_default as SignedIn, SignedOut_default as SignedOut, Spinner_default as Spinner, THEME_KEY, THUNDERID_KEY, TextField_default as TextField, ThemeProvider_default as ThemeProvider, ThunderIDPlugin_default as ThunderIDPlugin, ThunderIDProvider_default as ThunderIDProvider, ThunderIDRuntimeError, ThunderIDVueClient_default as ThunderIDVueClient, TriangleAlertIcon, Typography_default as Typography, USER_KEY, User_default as User, UserDropdown_default as UserDropdown, UserIcon, UserProfile_default as UserProfile, UserProvider_default as UserProvider, XIcon, buildThemeConfigFromFlowMeta_default as buildThemeConfigFromFlowMeta, createCallbackRoute, createClassObserver, createField, createMediaQueryListener, createThunderIDGuard, detectThemeMode, getActiveTheme, getAuthComponentHeadings_default as getAuthComponentHeadings, handleWebAuthnAuthentication, hasAuthParamsInUrl, http, initiateOAuthRedirect, navigate, useFlow_default as useFlow, useFlowMeta_default as useFlowMeta, useI18n_default as useI18n, useOAuthCallback, useTheme_default as useTheme, useThunderID_default as useThunderID, useUser_default as useUser, validateFieldValue };
|
|
10067
|
+
export { AcceptInvite_default as AcceptInvite, Alert_default as Alert, ArrowLeftRightIcon, BaseAcceptInvite_default as BaseAcceptInvite, BaseInviteUser_default as BaseInviteUser, BaseLanguageSwitcher_default as BaseLanguageSwitcher, BaseSignIn_default as BaseSignIn, BaseSignInButton_default as BaseSignInButton, BaseSignOutButton_default as BaseSignOutButton, BaseSignUp_default as BaseSignUp, BaseSignUpButton_default as BaseSignUpButton, BaseUserDropdown_default as BaseUserDropdown, BaseUserProfile_default as BaseUserProfile, BuildingIcon, Button_default as Button, Callback_default as Callback, Card_default as Card, CheckIcon, Checkbox_default as Checkbox, ChevronDownIcon, CircleAlertIcon, CircleCheckIcon, DatePicker_default as DatePicker, Divider_default as Divider, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowEventType, EmbeddedFlowTextVariant, EmbeddedSignInFlowStatus, EmbeddedSignInFlowType, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowType, EyeIcon, EyeOffIcon, FLOW_KEY, FLOW_META_KEY, FacebookButton_default as FacebookButton, FieldFactory_default as FieldFactory, FieldType, FlowMetaProvider_default as FlowMetaProvider, FlowProvider_default as FlowProvider, GitHubButton_default as GitHubButton, GlobeIcon, GoogleButton_default as GoogleButton, I18N_KEY, I18nProvider_default as I18nProvider, InfoIcon, InviteUser_default as InviteUser, LanguageSwitcher_default as LanguageSwitcher, Loading_default as Loading, LogOutIcon, Logo_default as Logo, MicrosoftButton_default as MicrosoftButton, OtpField_default as OtpField, PasswordField_default as PasswordField, PencilIcon, PlusIcon, Select_default as Select, SignIn_default as SignIn, SignInButton_default as SignInButton, SignOutButton_default as SignOutButton, SignUp_default as SignUp, SignUpButton_default as SignUpButton, SignedIn_default as SignedIn, SignedOut_default as SignedOut, Spinner_default as Spinner, THEME_KEY, THUNDERID_KEY, TextField_default as TextField, ThemeProvider_default as ThemeProvider, ThunderIDPlugin_default as ThunderIDPlugin, ThunderIDProvider_default as ThunderIDProvider, ThunderIDRuntimeError, ThunderIDVueClient_default as ThunderIDVueClient, TriangleAlertIcon, Typography_default as Typography, USER_KEY, User_default as User, UserDropdown_default as UserDropdown, UserIcon, UserProfile_default as UserProfile, UserProvider_default as UserProvider, XIcon, buildThemeConfigFromFlowMeta_default as buildThemeConfigFromFlowMeta, createCallbackRoute, createClassObserver, createField, createMediaQueryListener, createThunderIDGuard, detectThemeMode, getActiveTheme, getAuthComponentHeadings_default as getAuthComponentHeadings, getUsersMeMeta_default as getUsersMeMeta, handleWebAuthnAuthentication, hasAuthParamsInUrl, http, initiateOAuthRedirect, navigate, useFlow_default as useFlow, useFlowMeta_default as useFlowMeta, useI18n_default as useI18n, useOAuthCallback, useTheme_default as useTheme, useThunderID_default as useThunderID, useUser_default as useUser, validateFieldValue };
|