@thunderid/vue 1.3.2 → 1.4.1
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/__tests__/helpers/selectControl.d.ts +12 -0
- package/dist/__tests__/helpers/selectControl.d.ts.map +1 -0
- package/dist/api/getUsers.d.ts +33 -0
- package/dist/api/getUsers.d.ts.map +1 -0
- package/dist/cjs/index.cjs +931 -47
- package/dist/components/auth/sign-in/AuthOptionFactoryCore.d.ts +9 -0
- package/dist/components/auth/sign-in/AuthOptionFactoryCore.d.ts.map +1 -1
- package/dist/components/auth/sign-in/BaseSignIn.d.ts +1 -0
- package/dist/components/auth/sign-in/BaseSignIn.d.ts.map +1 -1
- package/dist/components/auth/sign-up/BaseSignUp.d.ts +1 -0
- package/dist/components/auth/sign-up/BaseSignUp.d.ts.map +1 -1
- package/dist/components/presentation/accept-invite/BaseAcceptInvite.d.ts.map +1 -1
- package/dist/components/presentation/invite-user/BaseInviteUser.d.ts.map +1 -1
- package/dist/components/presentation/invite-user/InviteUser.d.ts.map +1 -1
- package/dist/components/primitives/AuthFlowSelect/AuthFlowSelect.d.ts +12 -0
- package/dist/components/primitives/AuthFlowSelect/AuthFlowSelect.d.ts.map +1 -0
- package/dist/components/primitives/AuthFlowSelect/BaseAuthFlowSelect.d.ts +15 -0
- package/dist/components/primitives/AuthFlowSelect/BaseAuthFlowSelect.d.ts.map +1 -0
- package/dist/components/primitives/CopyableText/CopyableText.css.d.ts +11 -0
- package/dist/components/primitives/CopyableText/CopyableText.css.d.ts.map +1 -0
- package/dist/components/primitives/CopyableText/CopyableText.d.ts +12 -0
- package/dist/components/primitives/CopyableText/CopyableText.d.ts.map +1 -0
- package/dist/components/primitives/CopyableText/index.d.ts +2 -0
- package/dist/components/primitives/CopyableText/index.d.ts.map +1 -0
- package/dist/components/primitives/Icons.d.ts +1 -0
- package/dist/components/primitives/Icons.d.ts.map +1 -1
- package/dist/components/primitives/PasswordField/PasswordField.d.ts +4 -0
- package/dist/components/primitives/PasswordField/PasswordField.d.ts.map +1 -1
- package/dist/components/primitives/Select/ResourceSelect.d.ts +91 -0
- package/dist/components/primitives/Select/ResourceSelect.d.ts.map +1 -0
- package/dist/components/primitives/Select/Select.css.d.ts +2 -2
- package/dist/components/primitives/Select/Select.css.d.ts.map +1 -1
- package/dist/components/primitives/Select/Select.d.ts +2 -5
- package/dist/components/primitives/Select/Select.d.ts.map +1 -1
- package/dist/components/primitives/Select/useSelectMessages.d.ts +9 -0
- package/dist/components/primitives/Select/useSelectMessages.d.ts.map +1 -0
- package/dist/components/primitives/UserSelect/BaseUserSelect.d.ts +16 -0
- package/dist/components/primitives/UserSelect/BaseUserSelect.d.ts.map +1 -0
- package/dist/components/primitives/UserSelect/UserSelect.d.ts +15 -0
- package/dist/components/primitives/UserSelect/UserSelect.d.ts.map +1 -0
- package/dist/components/primitives/UserTypeSelect/BaseUserTypeSelect.d.ts +15 -0
- package/dist/components/primitives/UserTypeSelect/BaseUserTypeSelect.d.ts.map +1 -0
- package/dist/components/primitives/UserTypeSelect/UserTypeSelect.d.ts +12 -0
- package/dist/components/primitives/UserTypeSelect/UserTypeSelect.d.ts.map +1 -0
- package/dist/composables/useFetchAuthFlows.d.ts +8 -0
- package/dist/composables/useFetchAuthFlows.d.ts.map +1 -0
- package/dist/composables/useFetchUserTypes.d.ts +5 -0
- package/dist/composables/useFetchUserTypes.d.ts.map +1 -0
- package/dist/composables/useFetchUsers.d.ts +5 -0
- package/dist/composables/useFetchUsers.d.ts.map +1 -0
- package/dist/composables/useInfiniteOptions.d.ts +32 -0
- package/dist/composables/useInfiniteOptions.d.ts.map +1 -0
- package/dist/index.d.ts +19 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +923 -50
- package/dist/providers/ThemeProvider.d.ts.map +1 -1
- package/dist/providers/ThunderIDProvider.d.ts.map +1 -1
- package/dist/styles/injectStyles.d.ts.map +1 -1
- package/dist/theme/themeDetection.d.ts +1 -1
- package/dist/theme/themeDetection.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConsentConstants, CredentialConstants, 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, SPAUtils, ThunderIDAPIError, ThunderIDBrowserClient, ThunderIDError, ThunderIDRuntimeError, ThunderIDRuntimeError as ThunderIDRuntimeError$1, TranslationBundleConstants, arrayBufferToBase64url, base64urlToArrayBuffer, createClassObserver, createClassObserver as createClassObserver$1, createHttpClientFetcher, createMediaQueryListener, createMediaQueryListener as createMediaQueryListener$1, createPackageComponentLogger, createPackageLogger, createTheme, deepMerge, detectThemeMode, detectThemeMode as detectThemeMode$1, evaluateChangePasswordForm, executeEmbeddedSignInFlow, executeEmbeddedSignUpFlow, extractEmojiFromUri, extractUserClaimsFromIdToken, generateFlattenedUserProfile, get, getActiveTheme, getDefaultI18nBundles, getFlowMeta, getUsersMe, getUsersMeMeta, getVendorPrefix, handleWebAuthnAuthentication, hasAuthParamsInUrl, hasAuthParamsInUrl as hasAuthParamsInUrl$1, hasCalledForThisInstanceInUrl, hasUnresolvedTranslationParams, http, isEmojiUri, isEmpty, mapCredentialUpdateError, navigate, navigate as navigate$1, normalizeBorderRadius, normalizeTranslations, parseKeyValuePairs, parseKeyValuePairs as parseKeyValuePairs$1, resolveChangeCredentialPolicy, resolveFlowTemplateLiterals, resolveLogoUri, resolveResourceEndpoint, startCase, substituteTranslationParams, supportsCredential, updateMeCredentials, updateMeProfile, withVendorCSSClassPrefix } from "@thunderid/browser";
|
|
2
|
-
import { Fragment, Teleport, computed, defineComponent, h, inject, nextTick, onBeforeUnmount, onMounted, onUnmounted, provide, readonly, ref, shallowReadonly, shallowRef, useId, watch } from "vue";
|
|
1
|
+
import { AuthFlowSelectConstants, ConsentConstants, CredentialConstants, 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, SPAUtils, SelectConstants, ThunderIDAPIError, ThunderIDBrowserClient, ThunderIDError, ThunderIDRuntimeError, ThunderIDRuntimeError as ThunderIDRuntimeError$1, TranslationBundleConstants, UserSelectConstants, UserTypeSelectConstants, arrayBufferToBase64url, base64urlToArrayBuffer, bem, copyTextToClipboard, createClassObserver, createClassObserver as createClassObserver$1, createHttpClientFetcher, createMediaQueryListener, createMediaQueryListener as createMediaQueryListener$1, createPackageComponentLogger, createPackageLogger, createResourceOptionsLoader, createTheme, deepMerge, detectThemeMode, detectThemeMode as detectThemeMode$1, evaluateChangePasswordForm, executeEmbeddedSignInFlow, executeEmbeddedSignUpFlow, extractEmojiFromUri, extractUserClaimsFromIdToken, generateFlattenedUserProfile, get, getActiveTheme, getDefaultI18nBundles, getFlowMeta, getFlows, getSelectMessages, getUserTypes, getUsers, getUsersMe, getUsersMeMeta, getVendorPrefix, handleWebAuthnAuthentication, hasAuthParamsInUrl, hasAuthParamsInUrl as hasAuthParamsInUrl$1, hasCalledForThisInstanceInUrl, hasUnresolvedTranslationParams, http, isEmojiUri, isEmpty, loadUntilOptionsGrow, mapCredentialUpdateError, mergeOptionsBatch, navigate, navigate as navigate$1, normalizeBorderRadius, normalizeSelectOptions, normalizeTranslations, parseKeyValuePairs, parseKeyValuePairs as parseKeyValuePairs$1, resolveChangeCredentialPolicy, resolveFlowTemplateLiterals, resolveLogoUri, resolvePageSize, resolveResourceEndpoint, startCase, substituteTranslationParams, supportsCredential, toAuthFlowSelectPage, toError, toUserSelectPage, toUserTypeSelectPage, updateMeCredentials, updateMeProfile, withVendorCSSClassPrefix } from "@thunderid/browser";
|
|
2
|
+
import { Fragment, Teleport, computed, defineComponent, getCurrentInstance, h, inject, nextTick, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, provide, readonly, ref, shallowReadonly, shallowRef, useId, watch } from "vue";
|
|
3
3
|
import DOMPurify from "dompurify";
|
|
4
4
|
|
|
5
5
|
//#region src/keys.ts
|
|
@@ -280,7 +280,7 @@ const PACKAGE_NAME = "@thunderid/vue";
|
|
|
280
280
|
* Package-level logger for `@thunderid/vue`.
|
|
281
281
|
* Use this when logging is not tied to a specific component.
|
|
282
282
|
*/
|
|
283
|
-
const logger$
|
|
283
|
+
const logger$7 = createPackageLogger(PACKAGE_NAME);
|
|
284
284
|
/**
|
|
285
285
|
* Creates a component-scoped logger prefixed with `@thunderid/vue - <component>`.
|
|
286
286
|
*
|
|
@@ -290,7 +290,7 @@ const createVueLogger = (component) => createPackageComponentLogger(PACKAGE_NAME
|
|
|
290
290
|
|
|
291
291
|
//#endregion
|
|
292
292
|
//#region src/providers/I18nProvider.ts
|
|
293
|
-
const logger$
|
|
293
|
+
const logger$6 = createVueLogger("I18nProvider");
|
|
294
294
|
const DEFAULT_URL_PARAM = "lang";
|
|
295
295
|
const deriveRootDomain = (hostname) => {
|
|
296
296
|
const parts = hostname.split(".");
|
|
@@ -330,7 +330,7 @@ const createStorageAdapter = (strategy, key, cookieDomain) => {
|
|
|
330
330
|
try {
|
|
331
331
|
window.localStorage.setItem(key, language);
|
|
332
332
|
} catch {
|
|
333
|
-
logger$
|
|
333
|
+
logger$6.warn("Failed to persist language preference to localStorage.");
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
336
|
};
|
|
@@ -457,7 +457,7 @@ const I18nProvider = defineComponent({
|
|
|
457
457
|
};
|
|
458
458
|
const setLanguage = (language) => {
|
|
459
459
|
if (mergedBundlesComputed.value[language]) currentLanguage.value = language;
|
|
460
|
-
else logger$
|
|
460
|
+
else logger$6.warn(`Language '${language}' is not available. Available languages: ${Object.keys(mergedBundlesComputed.value).join(", ")}`);
|
|
461
461
|
};
|
|
462
462
|
provide(I18N_KEY, {
|
|
463
463
|
bundles: readonly(mergedBundlesComputed),
|
|
@@ -589,7 +589,7 @@ const ThemeProvider = defineComponent({
|
|
|
589
589
|
});
|
|
590
590
|
onBeforeUnmount(() => {
|
|
591
591
|
if (classObserver) classObserver.disconnect();
|
|
592
|
-
|
|
592
|
+
mediaQuery?.disconnect();
|
|
593
593
|
});
|
|
594
594
|
provide(THEME_KEY, {
|
|
595
595
|
colorScheme: readonly(colorScheme),
|
|
@@ -882,6 +882,7 @@ var ThunderIDVueClient_default = ThunderIDVueClient;
|
|
|
882
882
|
|
|
883
883
|
//#endregion
|
|
884
884
|
//#region src/providers/ThunderIDProvider.ts
|
|
885
|
+
const logger$5 = createVueLogger("ThunderIDProvider");
|
|
885
886
|
/**
|
|
886
887
|
* Checks if the current URL contains authentication parameters.
|
|
887
888
|
*/
|
|
@@ -1093,7 +1094,7 @@ const ThunderIDProvider = defineComponent({
|
|
|
1093
1094
|
isLoading.value = client.isLoading();
|
|
1094
1095
|
}
|
|
1095
1096
|
}
|
|
1096
|
-
|
|
1097
|
+
const context = {
|
|
1097
1098
|
afterSignInUrl: props.afterSignInUrl,
|
|
1098
1099
|
applicationId: props.applicationId,
|
|
1099
1100
|
baseUrl: props.baseUrl,
|
|
@@ -1133,11 +1134,19 @@ const ThunderIDProvider = defineComponent({
|
|
|
1133
1134
|
user,
|
|
1134
1135
|
userSchema,
|
|
1135
1136
|
vendor
|
|
1136
|
-
}
|
|
1137
|
+
};
|
|
1138
|
+
provide(THUNDERID_KEY, context);
|
|
1139
|
+
const appContext = getCurrentInstance()?.appContext;
|
|
1140
|
+
const providesAtAppLevel = !!appContext && !(THUNDERID_KEY in appContext.provides);
|
|
1141
|
+
if (appContext && providesAtAppLevel) appContext.app.provide(THUNDERID_KEY, context);
|
|
1137
1142
|
onMounted(async () => {
|
|
1138
1143
|
const config = buildConfig();
|
|
1139
1144
|
await client.initialize(config);
|
|
1140
|
-
|
|
1145
|
+
try {
|
|
1146
|
+
await client.getDiscoveryResponse();
|
|
1147
|
+
} catch (error) {
|
|
1148
|
+
logger$5.warn("Could not load the OIDC discovery metadata on mount.", error);
|
|
1149
|
+
}
|
|
1141
1150
|
const initializedConfig = await client.getConfiguration();
|
|
1142
1151
|
if (initializedConfig?.baseUrl) sessionStorage.setItem(`${vendor}_base_url`, initializedConfig.baseUrl);
|
|
1143
1152
|
try {
|
|
@@ -1184,6 +1193,7 @@ const ThunderIDProvider = defineComponent({
|
|
|
1184
1193
|
}, 100);
|
|
1185
1194
|
});
|
|
1186
1195
|
onUnmounted(() => {
|
|
1196
|
+
if (appContext && providesAtAppLevel && appContext.provides[THUNDERID_KEY] === context) delete appContext.provides[THUNDERID_KEY];
|
|
1187
1197
|
if (signInCheckInterval) clearInterval(signInCheckInterval);
|
|
1188
1198
|
if (loadingCheckInterval) clearInterval(loadingCheckInterval);
|
|
1189
1199
|
});
|
|
@@ -2805,6 +2815,68 @@ const CHECKBOX_CSS = `
|
|
|
2805
2815
|
`;
|
|
2806
2816
|
var Checkbox_css_default = CHECKBOX_CSS;
|
|
2807
2817
|
|
|
2818
|
+
//#endregion
|
|
2819
|
+
//#region src/components/primitives/CopyableText/CopyableText.css.ts
|
|
2820
|
+
/**
|
|
2821
|
+
* Styles for the CopyableText primitive component.
|
|
2822
|
+
*
|
|
2823
|
+
* BEM block: `.thunderid-copyable-text`
|
|
2824
|
+
*
|
|
2825
|
+
* Elements:
|
|
2826
|
+
* __label | __box | __value | __copy
|
|
2827
|
+
*/
|
|
2828
|
+
const COPYABLE_TEXT_CSS = `
|
|
2829
|
+
/* ============================================================
|
|
2830
|
+
CopyableText
|
|
2831
|
+
============================================================ */
|
|
2832
|
+
|
|
2833
|
+
.thunderid-copyable-text {
|
|
2834
|
+
display: flex;
|
|
2835
|
+
flex-direction: column;
|
|
2836
|
+
gap: calc(var(--thunderid-spacing-unit) * 0.5);
|
|
2837
|
+
width: 100%;
|
|
2838
|
+
}
|
|
2839
|
+
|
|
2840
|
+
.thunderid-copyable-text__label {
|
|
2841
|
+
color: var(--thunderid-color-text-secondary);
|
|
2842
|
+
font-size: 0.875rem;
|
|
2843
|
+
font-weight: 500;
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
.thunderid-copyable-text__box {
|
|
2847
|
+
display: flex;
|
|
2848
|
+
align-items: center;
|
|
2849
|
+
gap: calc(var(--thunderid-spacing-unit) * 1);
|
|
2850
|
+
padding: calc(var(--thunderid-spacing-unit) * 0.75) calc(var(--thunderid-spacing-unit) * 1);
|
|
2851
|
+
background-color: var(--thunderid-color-background-surface);
|
|
2852
|
+
border: 1px solid var(--thunderid-input-borderColor);
|
|
2853
|
+
border-radius: var(--thunderid-border-radius-small);
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2856
|
+
.thunderid-copyable-text__value {
|
|
2857
|
+
flex: 1;
|
|
2858
|
+
min-width: 0;
|
|
2859
|
+
overflow: hidden;
|
|
2860
|
+
text-overflow: ellipsis;
|
|
2861
|
+
white-space: nowrap;
|
|
2862
|
+
word-break: break-all;
|
|
2863
|
+
font-family: monospace;
|
|
2864
|
+
font-size: 0.85rem;
|
|
2865
|
+
color: var(--thunderid-color-text-primary);
|
|
2866
|
+
}
|
|
2867
|
+
|
|
2868
|
+
.thunderid-copyable-text .thunderid-copyable-text__copy {
|
|
2869
|
+
flex-shrink: 0;
|
|
2870
|
+
padding: 0;
|
|
2871
|
+
width: var(--thunderid-button-sm-height);
|
|
2872
|
+
color: var(--thunderid-color-text-secondary);
|
|
2873
|
+
}
|
|
2874
|
+
.thunderid-copyable-text .thunderid-copyable-text__copy:hover {
|
|
2875
|
+
color: var(--thunderid-color-text-primary);
|
|
2876
|
+
}
|
|
2877
|
+
`;
|
|
2878
|
+
var CopyableText_css_default = COPYABLE_TEXT_CSS;
|
|
2879
|
+
|
|
2808
2880
|
//#endregion
|
|
2809
2881
|
//#region src/components/primitives/DatePicker/DatePicker.css.ts
|
|
2810
2882
|
/**
|
|
@@ -3262,7 +3334,7 @@ var PasswordField_css_default = PASSWORD_FIELD_CSS;
|
|
|
3262
3334
|
* --error – shows validation error state
|
|
3263
3335
|
*
|
|
3264
3336
|
* Elements:
|
|
3265
|
-
* __label | __required | __input | __error | __helper
|
|
3337
|
+
* __label | __required | __input | __error | __helper | __status | __load-more
|
|
3266
3338
|
*/
|
|
3267
3339
|
const SELECT_CSS = `
|
|
3268
3340
|
/* ============================================================
|
|
@@ -3342,6 +3414,20 @@ const SELECT_CSS = `
|
|
|
3342
3414
|
color: var(--thunderid-color-text-secondary);
|
|
3343
3415
|
line-height: var(--thunderid-typography-lineHeight-normal);
|
|
3344
3416
|
}
|
|
3417
|
+
|
|
3418
|
+
.thunderid-select__status {
|
|
3419
|
+
font-size: var(--thunderid-typography-fontSize-xs);
|
|
3420
|
+
color: var(--thunderid-color-text-secondary);
|
|
3421
|
+
line-height: var(--thunderid-typography-lineHeight-normal);
|
|
3422
|
+
}
|
|
3423
|
+
.thunderid-select__status:empty {
|
|
3424
|
+
display: none;
|
|
3425
|
+
}
|
|
3426
|
+
|
|
3427
|
+
.thunderid-select__load-more {
|
|
3428
|
+
color: var(--thunderid-color-primary-main);
|
|
3429
|
+
font-weight: var(--thunderid-typography-fontWeight-medium);
|
|
3430
|
+
}
|
|
3345
3431
|
`;
|
|
3346
3432
|
var Select_css_default = SELECT_CSS;
|
|
3347
3433
|
|
|
@@ -3621,6 +3707,7 @@ const STYLES = [
|
|
|
3621
3707
|
Divider_css_default,
|
|
3622
3708
|
KeyValueList_css_default,
|
|
3623
3709
|
Logo_css_default,
|
|
3710
|
+
CopyableText_css_default,
|
|
3624
3711
|
Spinner_css_default,
|
|
3625
3712
|
BaseSignIn_css_default,
|
|
3626
3713
|
ChangeCredential_css_default,
|
|
@@ -3971,6 +4058,189 @@ function useOAuthCallback({ currentFlowId, flowIdStorageKey = "thunderid_flow_id
|
|
|
3971
4058
|
}, { immediate: true });
|
|
3972
4059
|
}
|
|
3973
4060
|
|
|
4061
|
+
//#endregion
|
|
4062
|
+
//#region src/composables/useInfiniteOptions.ts
|
|
4063
|
+
const logger$4 = createPackageComponentLogger("@thunderid/vue", "useInfiniteOptions");
|
|
4064
|
+
/**
|
|
4065
|
+
* Keeps the option list of a `Select` that loads more options when the user asks for them. It owns the cursor,
|
|
4066
|
+
* appends each batch without duplicates, and stops at the end of the data. Vue counterpart of the React
|
|
4067
|
+
* `useInfiniteOptions`.
|
|
4068
|
+
*
|
|
4069
|
+
* `args` is read live, so a changing `load` or `onError` is picked up without passing refs.
|
|
4070
|
+
*/
|
|
4071
|
+
const useInfiniteOptions = (args) => {
|
|
4072
|
+
const options = shallowRef(normalizeSelectOptions(args.initialOptions));
|
|
4073
|
+
const loading = ref(false);
|
|
4074
|
+
const error = shallowRef(null);
|
|
4075
|
+
const hasMore = ref(true);
|
|
4076
|
+
let cursor;
|
|
4077
|
+
let finished = false;
|
|
4078
|
+
let inFlight = false;
|
|
4079
|
+
let requested = false;
|
|
4080
|
+
let generation = 0;
|
|
4081
|
+
let controller = null;
|
|
4082
|
+
let nonListLogged = false;
|
|
4083
|
+
const applyBatch = (batch) => {
|
|
4084
|
+
const merged = mergeOptionsBatch({
|
|
4085
|
+
cursor,
|
|
4086
|
+
options: options.value
|
|
4087
|
+
}, batch);
|
|
4088
|
+
if (merged.issue === "cursor-stuck") logger$4.warn("A load returned no new options and the same cursor; the list was treated as finished.");
|
|
4089
|
+
else if (merged.issue === "not-a-list" && !nonListLogged) {
|
|
4090
|
+
nonListLogged = true;
|
|
4091
|
+
logger$4.warn("A load returned something other than a list of options; it was treated as an empty batch.");
|
|
4092
|
+
}
|
|
4093
|
+
const addedNothing = merged.options.length === options.value.length;
|
|
4094
|
+
cursor = merged.cursor;
|
|
4095
|
+
finished = merged.finished;
|
|
4096
|
+
options.value = merged.options;
|
|
4097
|
+
hasMore.value = !merged.finished;
|
|
4098
|
+
error.value = null;
|
|
4099
|
+
return addedNothing && !merged.finished;
|
|
4100
|
+
};
|
|
4101
|
+
const startLoad = async () => {
|
|
4102
|
+
const startedGeneration = generation;
|
|
4103
|
+
const startedController = new AbortController();
|
|
4104
|
+
controller = startedController;
|
|
4105
|
+
inFlight = true;
|
|
4106
|
+
loading.value = true;
|
|
4107
|
+
try {
|
|
4108
|
+
await loadUntilOptionsGrow(() => args.load({
|
|
4109
|
+
cursor,
|
|
4110
|
+
options: options.value,
|
|
4111
|
+
signal: startedController.signal
|
|
4112
|
+
}), applyBatch, () => startedGeneration === generation);
|
|
4113
|
+
} catch (failure) {
|
|
4114
|
+
if (startedGeneration === generation && !startedController.signal.aborted) {
|
|
4115
|
+
const failureError = toError(failure);
|
|
4116
|
+
error.value = failureError;
|
|
4117
|
+
try {
|
|
4118
|
+
args.onError?.(failureError);
|
|
4119
|
+
} catch (callbackFailure) {
|
|
4120
|
+
logger$4.error("The onError callback threw.", callbackFailure);
|
|
4121
|
+
}
|
|
4122
|
+
}
|
|
4123
|
+
} finally {
|
|
4124
|
+
if (startedGeneration === generation) {
|
|
4125
|
+
controller = null;
|
|
4126
|
+
inFlight = false;
|
|
4127
|
+
loading.value = false;
|
|
4128
|
+
}
|
|
4129
|
+
}
|
|
4130
|
+
};
|
|
4131
|
+
const onLoadMore = () => {
|
|
4132
|
+
if (inFlight || finished) return;
|
|
4133
|
+
requested = true;
|
|
4134
|
+
startLoad();
|
|
4135
|
+
};
|
|
4136
|
+
const reset = () => {
|
|
4137
|
+
const shouldReload = requested;
|
|
4138
|
+
generation += 1;
|
|
4139
|
+
controller?.abort();
|
|
4140
|
+
controller = null;
|
|
4141
|
+
cursor = void 0;
|
|
4142
|
+
finished = false;
|
|
4143
|
+
inFlight = false;
|
|
4144
|
+
options.value = normalizeSelectOptions(args.initialOptions);
|
|
4145
|
+
hasMore.value = true;
|
|
4146
|
+
error.value = null;
|
|
4147
|
+
loading.value = false;
|
|
4148
|
+
if (shouldReload) startLoad();
|
|
4149
|
+
};
|
|
4150
|
+
onScopeDispose(() => {
|
|
4151
|
+
generation += 1;
|
|
4152
|
+
controller?.abort();
|
|
4153
|
+
});
|
|
4154
|
+
return {
|
|
4155
|
+
error,
|
|
4156
|
+
hasMore,
|
|
4157
|
+
loading,
|
|
4158
|
+
onLoadMore,
|
|
4159
|
+
options,
|
|
4160
|
+
reset
|
|
4161
|
+
};
|
|
4162
|
+
};
|
|
4163
|
+
var useInfiniteOptions_default = useInfiniteOptions;
|
|
4164
|
+
|
|
4165
|
+
//#endregion
|
|
4166
|
+
//#region src/api/getUsers.ts
|
|
4167
|
+
/**
|
|
4168
|
+
* Retrieves one page of the user directory. Uses the ThunderID SPA client's httpClient by default,
|
|
4169
|
+
* which attaches the access token, but allows a custom fetcher.
|
|
4170
|
+
*
|
|
4171
|
+
* @param config - Configuration object with URL, paging options and optional request config.
|
|
4172
|
+
* @returns A promise that resolves with one page of the user directory.
|
|
4173
|
+
* @example
|
|
4174
|
+
* ```typescript
|
|
4175
|
+
* const page = await getUsers({
|
|
4176
|
+
* baseUrl: "https://localhost:8090",
|
|
4177
|
+
* limit: 30,
|
|
4178
|
+
* offset: 0,
|
|
4179
|
+
* });
|
|
4180
|
+
* ```
|
|
4181
|
+
*/
|
|
4182
|
+
const getUsers$1 = async ({ fetcher, instanceId = 0,...requestConfig }) => getUsers({
|
|
4183
|
+
...requestConfig,
|
|
4184
|
+
fetcher: fetcher ?? createHttpClientFetcher(instanceId)
|
|
4185
|
+
});
|
|
4186
|
+
var getUsers_default = getUsers$1;
|
|
4187
|
+
|
|
4188
|
+
//#endregion
|
|
4189
|
+
//#region src/composables/useFetchUsers.ts
|
|
4190
|
+
/** A `FetchUsers` backed by the user directory, authenticated with the signed-in user's access token. */
|
|
4191
|
+
const useFetchUsers = () => {
|
|
4192
|
+
const { baseUrl, endpoints, instanceId } = useThunderID_default();
|
|
4193
|
+
const usersUrl = resolveResourceEndpoint("users", { endpoints });
|
|
4194
|
+
return async ({ filter, limit, offset, signal }) => toUserSelectPage(await getUsers_default({
|
|
4195
|
+
baseUrl,
|
|
4196
|
+
filter,
|
|
4197
|
+
instanceId,
|
|
4198
|
+
limit,
|
|
4199
|
+
offset,
|
|
4200
|
+
signal,
|
|
4201
|
+
url: usersUrl
|
|
4202
|
+
}), offset);
|
|
4203
|
+
};
|
|
4204
|
+
var useFetchUsers_default = useFetchUsers;
|
|
4205
|
+
|
|
4206
|
+
//#endregion
|
|
4207
|
+
//#region src/composables/useFetchAuthFlows.ts
|
|
4208
|
+
/**
|
|
4209
|
+
* A `FetchAuthFlows` backed by the flow list, restricted to authentication flows and authenticated with
|
|
4210
|
+
* the signed-in user's access token.
|
|
4211
|
+
*/
|
|
4212
|
+
const useFetchAuthFlows = () => {
|
|
4213
|
+
const { baseUrl, endpoints, instanceId } = useThunderID_default();
|
|
4214
|
+
const flowsUrl = resolveResourceEndpoint("flows", { endpoints });
|
|
4215
|
+
return async ({ limit, offset, signal }) => toAuthFlowSelectPage(await getFlows({
|
|
4216
|
+
baseUrl,
|
|
4217
|
+
fetcher: createHttpClientFetcher(instanceId),
|
|
4218
|
+
flowType: AuthFlowSelectConstants.FLOW_TYPE,
|
|
4219
|
+
limit: Math.min(limit, SelectConstants.MAX_PAGE_SIZE),
|
|
4220
|
+
offset,
|
|
4221
|
+
signal,
|
|
4222
|
+
url: flowsUrl
|
|
4223
|
+
}), offset);
|
|
4224
|
+
};
|
|
4225
|
+
var useFetchAuthFlows_default = useFetchAuthFlows;
|
|
4226
|
+
|
|
4227
|
+
//#endregion
|
|
4228
|
+
//#region src/composables/useFetchUserTypes.ts
|
|
4229
|
+
/** A `FetchUserTypes` backed by the user type list, authenticated with the signed-in user's access token. */
|
|
4230
|
+
const useFetchUserTypes = () => {
|
|
4231
|
+
const { baseUrl, endpoints, instanceId } = useThunderID_default();
|
|
4232
|
+
const userTypesUrl = resolveResourceEndpoint("userTypes", { endpoints });
|
|
4233
|
+
return async ({ limit, offset, signal }) => toUserTypeSelectPage(await getUserTypes({
|
|
4234
|
+
baseUrl,
|
|
4235
|
+
fetcher: createHttpClientFetcher(instanceId),
|
|
4236
|
+
limit: Math.min(limit, SelectConstants.MAX_PAGE_SIZE),
|
|
4237
|
+
offset,
|
|
4238
|
+
signal,
|
|
4239
|
+
url: userTypesUrl
|
|
4240
|
+
}), offset);
|
|
4241
|
+
};
|
|
4242
|
+
var useFetchUserTypes_default = useFetchUserTypes;
|
|
4243
|
+
|
|
3974
4244
|
//#endregion
|
|
3975
4245
|
//#region src/components/primitives/Button/Button.ts
|
|
3976
4246
|
const Button = defineComponent({
|
|
@@ -4207,6 +4477,14 @@ const defaultProps = {
|
|
|
4207
4477
|
};
|
|
4208
4478
|
const icon = (paths) => h("svg", { ...defaultProps }, paths);
|
|
4209
4479
|
const CheckIcon = () => icon([h("polyline", { points: "20 6 9 17 4 12" })]);
|
|
4480
|
+
const CopyIcon = () => icon([h("rect", {
|
|
4481
|
+
height: "14",
|
|
4482
|
+
rx: "2",
|
|
4483
|
+
ry: "2",
|
|
4484
|
+
width: "14",
|
|
4485
|
+
x: "8",
|
|
4486
|
+
y: "8"
|
|
4487
|
+
}), h("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })]);
|
|
4210
4488
|
const XIcon = () => icon([h("line", {
|
|
4211
4489
|
x1: "18",
|
|
4212
4490
|
x2: "6",
|
|
@@ -4394,9 +4672,17 @@ const PencilIcon = () => icon([h("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 2
|
|
|
4394
4672
|
|
|
4395
4673
|
//#endregion
|
|
4396
4674
|
//#region src/components/primitives/PasswordField/PasswordField.ts
|
|
4675
|
+
/**
|
|
4676
|
+
* A password input with a show and hide button. The `append` slot holds extra content inside the field, after the
|
|
4677
|
+
* button, such as an action button.
|
|
4678
|
+
*/
|
|
4397
4679
|
const PasswordField = defineComponent({
|
|
4398
4680
|
name: "PasswordField",
|
|
4399
4681
|
props: {
|
|
4682
|
+
ariaLabel: {
|
|
4683
|
+
default: void 0,
|
|
4684
|
+
type: String
|
|
4685
|
+
},
|
|
4400
4686
|
autocomplete: {
|
|
4401
4687
|
default: "current-password",
|
|
4402
4688
|
type: String
|
|
@@ -4409,6 +4695,10 @@ const PasswordField = defineComponent({
|
|
|
4409
4695
|
default: void 0,
|
|
4410
4696
|
type: String
|
|
4411
4697
|
},
|
|
4698
|
+
hideLabel: {
|
|
4699
|
+
default: "Hide password",
|
|
4700
|
+
type: String
|
|
4701
|
+
},
|
|
4412
4702
|
label: {
|
|
4413
4703
|
default: void 0,
|
|
4414
4704
|
type: String
|
|
@@ -4425,13 +4715,21 @@ const PasswordField = defineComponent({
|
|
|
4425
4715
|
default: void 0,
|
|
4426
4716
|
type: String
|
|
4427
4717
|
},
|
|
4718
|
+
readonly: {
|
|
4719
|
+
default: false,
|
|
4720
|
+
type: Boolean
|
|
4721
|
+
},
|
|
4428
4722
|
required: {
|
|
4429
4723
|
default: false,
|
|
4430
4724
|
type: Boolean
|
|
4725
|
+
},
|
|
4726
|
+
showLabel: {
|
|
4727
|
+
default: "Show password",
|
|
4728
|
+
type: String
|
|
4431
4729
|
}
|
|
4432
4730
|
},
|
|
4433
4731
|
emits: ["update:modelValue", "blur"],
|
|
4434
|
-
setup(props, { emit, attrs }) {
|
|
4732
|
+
setup(props, { emit, attrs, slots }) {
|
|
4435
4733
|
const visible = ref(false);
|
|
4436
4734
|
return () => {
|
|
4437
4735
|
const hasError = !!props.error;
|
|
@@ -4447,28 +4745,34 @@ const PasswordField = defineComponent({
|
|
|
4447
4745
|
class: withVendorCSSClassPrefix("password-field__label"),
|
|
4448
4746
|
for: props.name
|
|
4449
4747
|
}, [props.label, props.required ? h("span", { class: withVendorCSSClassPrefix("password-field__required") }, " *") : null]) : null,
|
|
4450
|
-
h("div", { class: withVendorCSSClassPrefix("password-field__wrapper") }, [
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4748
|
+
h("div", { class: withVendorCSSClassPrefix("password-field__wrapper") }, [
|
|
4749
|
+
h("input", {
|
|
4750
|
+
"aria-label": props.ariaLabel,
|
|
4751
|
+
autocomplete: props.autocomplete,
|
|
4752
|
+
class: withVendorCSSClassPrefix("password-field__input"),
|
|
4753
|
+
"data-testid": attrs["data-testid"],
|
|
4754
|
+
disabled: props.disabled,
|
|
4755
|
+
id: props.name,
|
|
4756
|
+
name: props.name,
|
|
4757
|
+
onBlur: () => emit("blur"),
|
|
4758
|
+
onInput: (e) => emit("update:modelValue", e.target.value),
|
|
4759
|
+
placeholder: props.placeholder,
|
|
4760
|
+
readonly: props.readonly,
|
|
4761
|
+
required: props.required,
|
|
4762
|
+
type: visible.value ? "text" : "password",
|
|
4763
|
+
value: props.modelValue
|
|
4764
|
+
}),
|
|
4765
|
+
h("button", {
|
|
4766
|
+
"aria-label": visible.value ? props.hideLabel : props.showLabel,
|
|
4767
|
+
class: withVendorCSSClassPrefix("password-field__toggle"),
|
|
4768
|
+
onClick: () => {
|
|
4769
|
+
visible.value = !visible.value;
|
|
4770
|
+
},
|
|
4771
|
+
tabindex: props.readonly ? 0 : -1,
|
|
4772
|
+
type: "button"
|
|
4773
|
+
}, visible.value ? EyeOffIcon() : EyeIcon()),
|
|
4774
|
+
slots["append"]?.()
|
|
4775
|
+
]),
|
|
4472
4776
|
hasError ? h("span", { class: withVendorCSSClassPrefix("password-field__error") }, props.error) : null
|
|
4473
4777
|
]);
|
|
4474
4778
|
};
|
|
@@ -4476,15 +4780,35 @@ const PasswordField = defineComponent({
|
|
|
4476
4780
|
});
|
|
4477
4781
|
var PasswordField_default = PasswordField;
|
|
4478
4782
|
|
|
4783
|
+
//#endregion
|
|
4784
|
+
//#region src/components/primitives/Select/useSelectMessages.ts
|
|
4785
|
+
/**
|
|
4786
|
+
* The wording of `Select`: the active translations when there is an I18n provider, English otherwise, so `Select`
|
|
4787
|
+
* works without a provider. Call the result in a render function so a change of language is picked up.
|
|
4788
|
+
*/
|
|
4789
|
+
const useSelectMessages = () => {
|
|
4790
|
+
const i18n = inject(I18N_KEY, null);
|
|
4791
|
+
return () => getSelectMessages(i18n ? (key) => i18n.t(key) : void 0);
|
|
4792
|
+
};
|
|
4793
|
+
var useSelectMessages_default = useSelectMessages;
|
|
4794
|
+
|
|
4479
4795
|
//#endregion
|
|
4480
4796
|
//#region src/components/primitives/Select/Select.ts
|
|
4481
4797
|
const Select = defineComponent({
|
|
4482
4798
|
name: "Select",
|
|
4483
4799
|
props: {
|
|
4800
|
+
ariaLabel: {
|
|
4801
|
+
default: void 0,
|
|
4802
|
+
type: String
|
|
4803
|
+
},
|
|
4484
4804
|
disabled: {
|
|
4485
4805
|
default: false,
|
|
4486
4806
|
type: Boolean
|
|
4487
4807
|
},
|
|
4808
|
+
emptyText: {
|
|
4809
|
+
default: void 0,
|
|
4810
|
+
type: String
|
|
4811
|
+
},
|
|
4488
4812
|
error: {
|
|
4489
4813
|
default: void 0,
|
|
4490
4814
|
type: String
|
|
@@ -4497,6 +4821,10 @@ const Select = defineComponent({
|
|
|
4497
4821
|
default: void 0,
|
|
4498
4822
|
type: String
|
|
4499
4823
|
},
|
|
4824
|
+
loading: {
|
|
4825
|
+
default: false,
|
|
4826
|
+
type: Boolean
|
|
4827
|
+
},
|
|
4500
4828
|
modelValue: {
|
|
4501
4829
|
default: "",
|
|
4502
4830
|
type: String
|
|
@@ -4505,6 +4833,10 @@ const Select = defineComponent({
|
|
|
4505
4833
|
default: void 0,
|
|
4506
4834
|
type: String
|
|
4507
4835
|
},
|
|
4836
|
+
onLoadMore: {
|
|
4837
|
+
default: void 0,
|
|
4838
|
+
type: Function
|
|
4839
|
+
},
|
|
4508
4840
|
options: {
|
|
4509
4841
|
default: () => [],
|
|
4510
4842
|
type: Array
|
|
@@ -4516,12 +4848,19 @@ const Select = defineComponent({
|
|
|
4516
4848
|
required: {
|
|
4517
4849
|
default: false,
|
|
4518
4850
|
type: Boolean
|
|
4851
|
+
},
|
|
4852
|
+
selectedOption: {
|
|
4853
|
+
default: void 0,
|
|
4854
|
+
type: Object
|
|
4519
4855
|
}
|
|
4520
4856
|
},
|
|
4521
|
-
emits: ["update:modelValue"],
|
|
4857
|
+
emits: ["blur", "update:modelValue"],
|
|
4522
4858
|
setup(props, { emit, attrs }) {
|
|
4859
|
+
const messages = useSelectMessages_default();
|
|
4523
4860
|
return () => {
|
|
4524
4861
|
const hasError = !!props.error;
|
|
4862
|
+
const items = normalizeSelectOptions(props.options);
|
|
4863
|
+
const text = messages();
|
|
4525
4864
|
const wrapperClass = [
|
|
4526
4865
|
withVendorCSSClassPrefix("select"),
|
|
4527
4866
|
hasError ? withVendorCSSClassPrefix("select--error") : "",
|
|
@@ -4531,6 +4870,13 @@ const Select = defineComponent({
|
|
|
4531
4870
|
if (hasError) helperContent = h("span", { class: withVendorCSSClassPrefix("select__error") }, props.error);
|
|
4532
4871
|
else if (props.helperText) helperContent = h("span", { class: withVendorCSSClassPrefix("select__helper") }, props.helperText);
|
|
4533
4872
|
else helperContent = null;
|
|
4873
|
+
const { selectedOption } = props;
|
|
4874
|
+
const showsSelectedOption = selectedOption?.value === props.modelValue && !items.some((item) => item.value === props.modelValue);
|
|
4875
|
+
let statusText;
|
|
4876
|
+
if (props.loading) statusText = items.length === 0 ? text.loading : text.loadingMore;
|
|
4877
|
+
else if (items.length === 0 && !props.onLoadMore) statusText = props.emptyText;
|
|
4878
|
+
const hasStatus = props.onLoadMore !== void 0 || props.emptyText !== void 0 || props.loading;
|
|
4879
|
+
const showsLoadMore = props.onLoadMore !== void 0 && (items.length > 0 || !props.loading);
|
|
4534
4880
|
return h("div", {
|
|
4535
4881
|
class: wrapperClass,
|
|
4536
4882
|
style: attrs.style
|
|
@@ -4540,21 +4886,46 @@ const Select = defineComponent({
|
|
|
4540
4886
|
for: props.name
|
|
4541
4887
|
}, [props.label, props.required ? h("span", { class: withVendorCSSClassPrefix("select__required") }, " *") : null]) : null,
|
|
4542
4888
|
h("select", {
|
|
4889
|
+
"aria-busy": props.loading || void 0,
|
|
4890
|
+
"aria-label": props.ariaLabel,
|
|
4543
4891
|
class: withVendorCSSClassPrefix("select__input"),
|
|
4544
4892
|
"data-testid": attrs["data-testid"],
|
|
4545
4893
|
disabled: props.disabled,
|
|
4546
4894
|
id: props.name,
|
|
4547
4895
|
name: props.name,
|
|
4548
|
-
|
|
4896
|
+
onBlur: () => emit("blur"),
|
|
4897
|
+
onChange: (e) => {
|
|
4898
|
+
const control = e.target;
|
|
4899
|
+
if (control.value !== SelectConstants.LOAD_MORE_OPTION_VALUE) {
|
|
4900
|
+
emit("update:modelValue", control.value);
|
|
4901
|
+
return;
|
|
4902
|
+
}
|
|
4903
|
+
control.value = props.modelValue;
|
|
4904
|
+
props.onLoadMore?.();
|
|
4905
|
+
},
|
|
4549
4906
|
required: props.required,
|
|
4550
4907
|
value: props.modelValue
|
|
4551
|
-
}, [
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
value:
|
|
4557
|
-
|
|
4908
|
+
}, [
|
|
4909
|
+
props.placeholder ? h("option", {
|
|
4910
|
+
disabled: props.required,
|
|
4911
|
+
value: ""
|
|
4912
|
+
}, props.placeholder) : null,
|
|
4913
|
+
showsSelectedOption && selectedOption ? h("option", { value: selectedOption.value }, selectedOption.label) : null,
|
|
4914
|
+
...items.map((opt) => h("option", {
|
|
4915
|
+
disabled: opt.disabled,
|
|
4916
|
+
key: opt.value,
|
|
4917
|
+
value: opt.value
|
|
4918
|
+
}, opt.label)),
|
|
4919
|
+
showsLoadMore ? h("option", {
|
|
4920
|
+
class: withVendorCSSClassPrefix("select__load-more"),
|
|
4921
|
+
disabled: props.loading,
|
|
4922
|
+
value: SelectConstants.LOAD_MORE_OPTION_VALUE
|
|
4923
|
+
}, props.loading ? text.loadingMore : text.loadMore) : null
|
|
4924
|
+
]),
|
|
4925
|
+
hasStatus ? h("span", {
|
|
4926
|
+
class: withVendorCSSClassPrefix("select__status"),
|
|
4927
|
+
role: "status"
|
|
4928
|
+
}, statusText) : null,
|
|
4558
4929
|
helperContent
|
|
4559
4930
|
]);
|
|
4560
4931
|
};
|
|
@@ -4562,6 +4933,374 @@ const Select = defineComponent({
|
|
|
4562
4933
|
});
|
|
4563
4934
|
var Select_default = Select;
|
|
4564
4935
|
|
|
4936
|
+
//#endregion
|
|
4937
|
+
//#region src/components/primitives/Select/ResourceSelect.ts
|
|
4938
|
+
const NO_PAGES = () => Promise.resolve({
|
|
4939
|
+
nextOffset: null,
|
|
4940
|
+
options: []
|
|
4941
|
+
});
|
|
4942
|
+
/** The props every resource picker (users, authentication flows, user types) passes straight through. */
|
|
4943
|
+
const commonSelectProps = {
|
|
4944
|
+
component: {
|
|
4945
|
+
default: void 0,
|
|
4946
|
+
type: Object
|
|
4947
|
+
},
|
|
4948
|
+
disabled: {
|
|
4949
|
+
default: false,
|
|
4950
|
+
type: Boolean
|
|
4951
|
+
},
|
|
4952
|
+
emptyText: {
|
|
4953
|
+
default: void 0,
|
|
4954
|
+
type: String
|
|
4955
|
+
},
|
|
4956
|
+
error: {
|
|
4957
|
+
default: void 0,
|
|
4958
|
+
type: String
|
|
4959
|
+
},
|
|
4960
|
+
filter: {
|
|
4961
|
+
default: void 0,
|
|
4962
|
+
type: String
|
|
4963
|
+
},
|
|
4964
|
+
helperText: {
|
|
4965
|
+
default: void 0,
|
|
4966
|
+
type: String
|
|
4967
|
+
},
|
|
4968
|
+
id: {
|
|
4969
|
+
default: void 0,
|
|
4970
|
+
type: String
|
|
4971
|
+
},
|
|
4972
|
+
label: {
|
|
4973
|
+
default: void 0,
|
|
4974
|
+
type: String
|
|
4975
|
+
},
|
|
4976
|
+
modelValue: {
|
|
4977
|
+
default: "",
|
|
4978
|
+
type: String
|
|
4979
|
+
},
|
|
4980
|
+
name: {
|
|
4981
|
+
default: void 0,
|
|
4982
|
+
type: String
|
|
4983
|
+
},
|
|
4984
|
+
onError: {
|
|
4985
|
+
default: void 0,
|
|
4986
|
+
type: Function
|
|
4987
|
+
},
|
|
4988
|
+
pageSize: {
|
|
4989
|
+
default: void 0,
|
|
4990
|
+
type: Number
|
|
4991
|
+
},
|
|
4992
|
+
placeholder: {
|
|
4993
|
+
default: void 0,
|
|
4994
|
+
type: String
|
|
4995
|
+
},
|
|
4996
|
+
required: {
|
|
4997
|
+
default: false,
|
|
4998
|
+
type: Boolean
|
|
4999
|
+
},
|
|
5000
|
+
selectedOption: {
|
|
5001
|
+
default: void 0,
|
|
5002
|
+
type: Object
|
|
5003
|
+
}
|
|
5004
|
+
};
|
|
5005
|
+
/**
|
|
5006
|
+
* The part the `USER_SELECT`, `AUTH_FLOW_SELECT` and `USER_TYPE_SELECT` pickers share: a {@link Select} that loads
|
|
5007
|
+
* one resource page by page. The list restarts when the page function, filter or page size changes.
|
|
5008
|
+
*/
|
|
5009
|
+
const ResourceSelect = defineComponent({
|
|
5010
|
+
name: "ResourceSelect",
|
|
5011
|
+
props: {
|
|
5012
|
+
...commonSelectProps,
|
|
5013
|
+
bemBlock: {
|
|
5014
|
+
required: true,
|
|
5015
|
+
type: String
|
|
5016
|
+
},
|
|
5017
|
+
defaults: {
|
|
5018
|
+
default: void 0,
|
|
5019
|
+
type: Object
|
|
5020
|
+
},
|
|
5021
|
+
fallbackMessages: {
|
|
5022
|
+
required: true,
|
|
5023
|
+
type: Object
|
|
5024
|
+
},
|
|
5025
|
+
fetchPage: {
|
|
5026
|
+
default: void 0,
|
|
5027
|
+
type: Function
|
|
5028
|
+
},
|
|
5029
|
+
mapping: {
|
|
5030
|
+
default: void 0,
|
|
5031
|
+
type: Object
|
|
5032
|
+
},
|
|
5033
|
+
messageKey: {
|
|
5034
|
+
required: true,
|
|
5035
|
+
type: String
|
|
5036
|
+
},
|
|
5037
|
+
resource: {
|
|
5038
|
+
required: true,
|
|
5039
|
+
type: String
|
|
5040
|
+
},
|
|
5041
|
+
type: {
|
|
5042
|
+
required: true,
|
|
5043
|
+
type: String
|
|
5044
|
+
}
|
|
5045
|
+
},
|
|
5046
|
+
emits: ["blur", "update:modelValue"],
|
|
5047
|
+
setup(props, { emit }) {
|
|
5048
|
+
const { t } = useI18n_default();
|
|
5049
|
+
const loader = computed(() => createResourceOptionsLoader({
|
|
5050
|
+
get component() {
|
|
5051
|
+
return props.component ?? {
|
|
5052
|
+
id: props.id ?? props.name ?? props.bemBlock,
|
|
5053
|
+
type: props.type
|
|
5054
|
+
};
|
|
5055
|
+
},
|
|
5056
|
+
get defaults() {
|
|
5057
|
+
return props.defaults;
|
|
5058
|
+
},
|
|
5059
|
+
fetchPage: props.fetchPage ?? NO_PAGES,
|
|
5060
|
+
filter: props.filter,
|
|
5061
|
+
get mapping() {
|
|
5062
|
+
return props.mapping;
|
|
5063
|
+
},
|
|
5064
|
+
pageSize: resolvePageSize(props.pageSize),
|
|
5065
|
+
resource: props.resource
|
|
5066
|
+
}));
|
|
5067
|
+
const { hasMore, loading, onLoadMore, options, reset } = useInfiniteOptions_default({
|
|
5068
|
+
load: (context) => loader.value(context),
|
|
5069
|
+
onError: (error) => props.onError?.(error)
|
|
5070
|
+
});
|
|
5071
|
+
onMounted(() => {
|
|
5072
|
+
if (props.fetchPage) onLoadMore();
|
|
5073
|
+
});
|
|
5074
|
+
watch(loader, () => {
|
|
5075
|
+
reset();
|
|
5076
|
+
if (props.fetchPage) onLoadMore();
|
|
5077
|
+
});
|
|
5078
|
+
return () => {
|
|
5079
|
+
return h(Select_default, {
|
|
5080
|
+
"aria-label": [
|
|
5081
|
+
props.label,
|
|
5082
|
+
props.placeholder,
|
|
5083
|
+
t(`elements.fields.${props.messageKey}.aria_label`)
|
|
5084
|
+
].find((text) => Boolean(text)) ?? props.fallbackMessages.ariaLabel,
|
|
5085
|
+
class: withVendorCSSClassPrefix(bem(props.bemBlock)),
|
|
5086
|
+
disabled: props.disabled,
|
|
5087
|
+
emptyText: props.emptyText ?? (t(`elements.fields.${props.messageKey}.empty`) || props.fallbackMessages.empty),
|
|
5088
|
+
error: props.error,
|
|
5089
|
+
helperText: props.helperText,
|
|
5090
|
+
id: props.id,
|
|
5091
|
+
label: props.label,
|
|
5092
|
+
loading: loading.value,
|
|
5093
|
+
modelValue: props.modelValue,
|
|
5094
|
+
name: props.name,
|
|
5095
|
+
onBlur: () => emit("blur"),
|
|
5096
|
+
onLoadMore: props.fetchPage && hasMore.value ? onLoadMore : void 0,
|
|
5097
|
+
options: options.value,
|
|
5098
|
+
placeholder: props.placeholder,
|
|
5099
|
+
required: props.required,
|
|
5100
|
+
selectedOption: props.selectedOption,
|
|
5101
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", value)
|
|
5102
|
+
});
|
|
5103
|
+
};
|
|
5104
|
+
}
|
|
5105
|
+
});
|
|
5106
|
+
var ResourceSelect_default = ResourceSelect;
|
|
5107
|
+
|
|
5108
|
+
//#endregion
|
|
5109
|
+
//#region src/components/primitives/UserSelect/BaseUserSelect.ts
|
|
5110
|
+
const USER_DEFAULTS = { labelAttributes: UserSelectConstants.LABEL_ATTRIBUTES };
|
|
5111
|
+
/**
|
|
5112
|
+
* Single-user picker: a `Select` that loads from the given `fetchUsers` and submits the user's ID.
|
|
5113
|
+
* Labels come from `display`, `username`, or `email` unless `mapping` says otherwise.
|
|
5114
|
+
* Building block for `UserSelect`; for a custom data source use `Select` with `useInfiniteOptions`.
|
|
5115
|
+
*/
|
|
5116
|
+
const BaseUserSelect = defineComponent({
|
|
5117
|
+
name: "BaseUserSelect",
|
|
5118
|
+
props: {
|
|
5119
|
+
...commonSelectProps,
|
|
5120
|
+
fetchUsers: {
|
|
5121
|
+
default: void 0,
|
|
5122
|
+
type: Function
|
|
5123
|
+
},
|
|
5124
|
+
mapping: {
|
|
5125
|
+
default: void 0,
|
|
5126
|
+
type: Object
|
|
5127
|
+
}
|
|
5128
|
+
},
|
|
5129
|
+
emits: ["update:modelValue"],
|
|
5130
|
+
setup(props, { emit }) {
|
|
5131
|
+
return () => {
|
|
5132
|
+
const { fetchUsers, mapping,...common } = props;
|
|
5133
|
+
return h(ResourceSelect_default, {
|
|
5134
|
+
...common,
|
|
5135
|
+
bemBlock: "user-select",
|
|
5136
|
+
defaults: USER_DEFAULTS,
|
|
5137
|
+
fallbackMessages: {
|
|
5138
|
+
ariaLabel: "Select a user",
|
|
5139
|
+
empty: "No users found."
|
|
5140
|
+
},
|
|
5141
|
+
fetchPage: fetchUsers,
|
|
5142
|
+
mapping,
|
|
5143
|
+
messageKey: "user_select",
|
|
5144
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", value),
|
|
5145
|
+
resource: "users",
|
|
5146
|
+
type: EmbeddedFlowComponentType$1.UserSelect
|
|
5147
|
+
});
|
|
5148
|
+
};
|
|
5149
|
+
}
|
|
5150
|
+
});
|
|
5151
|
+
var BaseUserSelect_default = BaseUserSelect;
|
|
5152
|
+
|
|
5153
|
+
//#endregion
|
|
5154
|
+
//#region src/components/primitives/UserSelect/UserSelect.ts
|
|
5155
|
+
/**
|
|
5156
|
+
* Single-user picker for signed-in screens. It loads the user directory itself with the signed-in
|
|
5157
|
+
* user's access token and submits the chosen user's ID, so it takes no data source. For any other
|
|
5158
|
+
* data source use {@link Select} with {@link useInfiniteOptions}.
|
|
5159
|
+
*/
|
|
5160
|
+
const UserSelect = defineComponent({
|
|
5161
|
+
name: "UserSelect",
|
|
5162
|
+
props: {
|
|
5163
|
+
...commonSelectProps,
|
|
5164
|
+
mapping: {
|
|
5165
|
+
default: void 0,
|
|
5166
|
+
type: Object
|
|
5167
|
+
}
|
|
5168
|
+
},
|
|
5169
|
+
emits: ["update:modelValue"],
|
|
5170
|
+
setup(props, { emit }) {
|
|
5171
|
+
const fetchUsers = useFetchUsers_default();
|
|
5172
|
+
return () => h(BaseUserSelect_default, {
|
|
5173
|
+
...props,
|
|
5174
|
+
fetchUsers,
|
|
5175
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", value)
|
|
5176
|
+
});
|
|
5177
|
+
}
|
|
5178
|
+
});
|
|
5179
|
+
var UserSelect_default = UserSelect;
|
|
5180
|
+
|
|
5181
|
+
//#endregion
|
|
5182
|
+
//#region src/components/primitives/AuthFlowSelect/BaseAuthFlowSelect.ts
|
|
5183
|
+
const AUTH_FLOW_DEFAULTS = { labelAttributes: AuthFlowSelectConstants.LABEL_ATTRIBUTES };
|
|
5184
|
+
/**
|
|
5185
|
+
* Authentication-flow picker: a `Select` that loads from the given `fetchAuthFlows`, showing each flow by
|
|
5186
|
+
* its name and submitting its ID. Building block for `AuthFlowSelect`; for a custom data source use
|
|
5187
|
+
* `Select` with `useInfiniteOptions`.
|
|
5188
|
+
*/
|
|
5189
|
+
const BaseAuthFlowSelect = defineComponent({
|
|
5190
|
+
name: "BaseAuthFlowSelect",
|
|
5191
|
+
props: {
|
|
5192
|
+
...commonSelectProps,
|
|
5193
|
+
fetchAuthFlows: {
|
|
5194
|
+
default: void 0,
|
|
5195
|
+
type: Function
|
|
5196
|
+
}
|
|
5197
|
+
},
|
|
5198
|
+
emits: ["update:modelValue"],
|
|
5199
|
+
setup(props, { emit }) {
|
|
5200
|
+
return () => {
|
|
5201
|
+
const { fetchAuthFlows,...common } = props;
|
|
5202
|
+
return h(ResourceSelect_default, {
|
|
5203
|
+
...common,
|
|
5204
|
+
bemBlock: "auth-flow-select",
|
|
5205
|
+
defaults: AUTH_FLOW_DEFAULTS,
|
|
5206
|
+
fallbackMessages: {
|
|
5207
|
+
ariaLabel: "Select a login flow",
|
|
5208
|
+
empty: "No login flows found."
|
|
5209
|
+
},
|
|
5210
|
+
fetchPage: fetchAuthFlows,
|
|
5211
|
+
messageKey: "auth_flow_select",
|
|
5212
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", value),
|
|
5213
|
+
resource: "auth flows",
|
|
5214
|
+
type: EmbeddedFlowComponentType$1.AuthFlowSelect
|
|
5215
|
+
});
|
|
5216
|
+
};
|
|
5217
|
+
}
|
|
5218
|
+
});
|
|
5219
|
+
var BaseAuthFlowSelect_default = BaseAuthFlowSelect;
|
|
5220
|
+
|
|
5221
|
+
//#endregion
|
|
5222
|
+
//#region src/components/primitives/AuthFlowSelect/AuthFlowSelect.ts
|
|
5223
|
+
/**
|
|
5224
|
+
* Authentication-flow picker for signed-in screens. It loads the authentication flows itself with the
|
|
5225
|
+
* signed-in user's access token and submits the chosen flow's ID, so it takes no data source. For any
|
|
5226
|
+
* other data source use `Select` with `useInfiniteOptions`.
|
|
5227
|
+
*/
|
|
5228
|
+
const AuthFlowSelect = defineComponent({
|
|
5229
|
+
name: "AuthFlowSelect",
|
|
5230
|
+
props: { ...commonSelectProps },
|
|
5231
|
+
emits: ["update:modelValue"],
|
|
5232
|
+
setup(props, { emit }) {
|
|
5233
|
+
const fetchAuthFlows = useFetchAuthFlows_default();
|
|
5234
|
+
return () => h(BaseAuthFlowSelect_default, {
|
|
5235
|
+
...props,
|
|
5236
|
+
fetchAuthFlows,
|
|
5237
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", value)
|
|
5238
|
+
});
|
|
5239
|
+
}
|
|
5240
|
+
});
|
|
5241
|
+
var AuthFlowSelect_default = AuthFlowSelect;
|
|
5242
|
+
|
|
5243
|
+
//#endregion
|
|
5244
|
+
//#region src/components/primitives/UserTypeSelect/BaseUserTypeSelect.ts
|
|
5245
|
+
/**
|
|
5246
|
+
* User-type picker: a `Select` that loads from the given `fetchUserTypes`, showing and submitting each
|
|
5247
|
+
* user type's handle. Building block for `UserTypeSelect`; for a custom data source use `Select` with
|
|
5248
|
+
* `useInfiniteOptions`.
|
|
5249
|
+
*/
|
|
5250
|
+
const BaseUserTypeSelect = defineComponent({
|
|
5251
|
+
name: "BaseUserTypeSelect",
|
|
5252
|
+
props: {
|
|
5253
|
+
...commonSelectProps,
|
|
5254
|
+
fetchUserTypes: {
|
|
5255
|
+
default: void 0,
|
|
5256
|
+
type: Function
|
|
5257
|
+
}
|
|
5258
|
+
},
|
|
5259
|
+
emits: ["update:modelValue"],
|
|
5260
|
+
setup(props, { emit }) {
|
|
5261
|
+
return () => {
|
|
5262
|
+
const { fetchUserTypes,...common } = props;
|
|
5263
|
+
return h(ResourceSelect_default, {
|
|
5264
|
+
...common,
|
|
5265
|
+
bemBlock: "user-type-select",
|
|
5266
|
+
fallbackMessages: {
|
|
5267
|
+
ariaLabel: "Select a user type",
|
|
5268
|
+
empty: "No user types found."
|
|
5269
|
+
},
|
|
5270
|
+
fetchPage: fetchUserTypes,
|
|
5271
|
+
mapping: UserTypeSelectConstants.MAPPING,
|
|
5272
|
+
messageKey: "user_type_select",
|
|
5273
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", value),
|
|
5274
|
+
resource: "user types",
|
|
5275
|
+
type: EmbeddedFlowComponentType$1.UserTypeSelect
|
|
5276
|
+
});
|
|
5277
|
+
};
|
|
5278
|
+
}
|
|
5279
|
+
});
|
|
5280
|
+
var BaseUserTypeSelect_default = BaseUserTypeSelect;
|
|
5281
|
+
|
|
5282
|
+
//#endregion
|
|
5283
|
+
//#region src/components/primitives/UserTypeSelect/UserTypeSelect.ts
|
|
5284
|
+
/**
|
|
5285
|
+
* User-type picker for signed-in screens. It loads the user types itself with the signed-in user's
|
|
5286
|
+
* access token and submits the chosen type's handle, so it takes no data source. For any other data
|
|
5287
|
+
* source use `Select` with `useInfiniteOptions`.
|
|
5288
|
+
*/
|
|
5289
|
+
const UserTypeSelect = defineComponent({
|
|
5290
|
+
name: "UserTypeSelect",
|
|
5291
|
+
props: { ...commonSelectProps },
|
|
5292
|
+
emits: ["update:modelValue"],
|
|
5293
|
+
setup(props, { emit }) {
|
|
5294
|
+
const fetchUserTypes = useFetchUserTypes_default();
|
|
5295
|
+
return () => h(BaseUserTypeSelect_default, {
|
|
5296
|
+
...props,
|
|
5297
|
+
fetchUserTypes,
|
|
5298
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", value)
|
|
5299
|
+
});
|
|
5300
|
+
}
|
|
5301
|
+
});
|
|
5302
|
+
var UserTypeSelect_default = UserTypeSelect;
|
|
5303
|
+
|
|
4565
5304
|
//#endregion
|
|
4566
5305
|
//#region src/components/primitives/Checkbox/Checkbox.ts
|
|
4567
5306
|
const Checkbox = defineComponent({
|
|
@@ -4870,6 +5609,71 @@ const Divider = defineComponent({
|
|
|
4870
5609
|
});
|
|
4871
5610
|
var Divider_default = Divider;
|
|
4872
5611
|
|
|
5612
|
+
//#endregion
|
|
5613
|
+
//#region src/components/primitives/CopyableText/CopyableText.ts
|
|
5614
|
+
/**
|
|
5615
|
+
* Shows a text value with an optional label and a button that copies it to the clipboard. It uses the Clipboard
|
|
5616
|
+
* API and falls back to a textarea when that is not available, then shows "Copied!" for 3 seconds. With `masked`
|
|
5617
|
+
* the value sits in a read-only password field with the same show and hide control as `PasswordField`, and copying
|
|
5618
|
+
* always copies the real value. The copy control is an icon button inside the box in both layouts. A browser does
|
|
5619
|
+
* not copy out of a password field, which is why copying is a button of its own. Vue counterpart of the React
|
|
5620
|
+
* `CopyableText`.
|
|
5621
|
+
*/
|
|
5622
|
+
const CopyableText = defineComponent({
|
|
5623
|
+
name: "CopyableText",
|
|
5624
|
+
props: {
|
|
5625
|
+
label: {
|
|
5626
|
+
default: "",
|
|
5627
|
+
type: String
|
|
5628
|
+
},
|
|
5629
|
+
masked: {
|
|
5630
|
+
default: false,
|
|
5631
|
+
type: Boolean
|
|
5632
|
+
},
|
|
5633
|
+
value: {
|
|
5634
|
+
required: true,
|
|
5635
|
+
type: String
|
|
5636
|
+
}
|
|
5637
|
+
},
|
|
5638
|
+
setup(props, { attrs }) {
|
|
5639
|
+
const { t } = useI18n_default();
|
|
5640
|
+
const copied = ref(false);
|
|
5641
|
+
const handleCopy = async () => {
|
|
5642
|
+
await copyTextToClipboard(props.value);
|
|
5643
|
+
copied.value = true;
|
|
5644
|
+
setTimeout(() => {
|
|
5645
|
+
copied.value = false;
|
|
5646
|
+
}, 3e3);
|
|
5647
|
+
};
|
|
5648
|
+
return () => {
|
|
5649
|
+
const rootClass = [withVendorCSSClassPrefix("copyable-text"), attrs.class || ""].filter(Boolean).join(" ");
|
|
5650
|
+
const copyLabel = copied.value ? t("elements.display.copyable_text.copied") : t("elements.display.copyable_text.copy");
|
|
5651
|
+
const copyButton = h(Button_default, {
|
|
5652
|
+
"aria-label": copyLabel,
|
|
5653
|
+
class: withVendorCSSClassPrefix("copyable-text__copy"),
|
|
5654
|
+
onClick: () => {
|
|
5655
|
+
handleCopy().catch(() => void 0);
|
|
5656
|
+
},
|
|
5657
|
+
size: "small",
|
|
5658
|
+
title: copyLabel,
|
|
5659
|
+
variant: "ghost"
|
|
5660
|
+
}, () => copied.value ? CheckIcon() : CopyIcon());
|
|
5661
|
+
return h("div", {
|
|
5662
|
+
class: rootClass,
|
|
5663
|
+
style: attrs.style
|
|
5664
|
+
}, [props.label ? h("span", { class: withVendorCSSClassPrefix("copyable-text__label") }, props.label) : null, props.masked ? h(PasswordField_default, {
|
|
5665
|
+
ariaLabel: props.label || void 0,
|
|
5666
|
+
autocomplete: "off",
|
|
5667
|
+
hideLabel: t("elements.display.copyable_text.hide"),
|
|
5668
|
+
modelValue: props.value,
|
|
5669
|
+
readonly: true,
|
|
5670
|
+
showLabel: t("elements.display.copyable_text.show")
|
|
5671
|
+
}, { append: () => copyButton }) : h("div", { class: withVendorCSSClassPrefix("copyable-text__box") }, [h("span", { class: withVendorCSSClassPrefix("copyable-text__value") }, props.value), copyButton])]);
|
|
5672
|
+
};
|
|
5673
|
+
}
|
|
5674
|
+
});
|
|
5675
|
+
var CopyableText_default = CopyableText;
|
|
5676
|
+
|
|
4873
5677
|
//#endregion
|
|
4874
5678
|
//#region src/components/primitives/Logo/Logo.ts
|
|
4875
5679
|
const Logo = defineComponent({
|
|
@@ -6264,6 +7068,28 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
|
|
|
6264
7068
|
t: options.t || ((k) => k)
|
|
6265
7069
|
});
|
|
6266
7070
|
};
|
|
7071
|
+
const resourceSelectProps = () => {
|
|
7072
|
+
const identifier = component.ref ?? "";
|
|
7073
|
+
const isTouched = touchedFields[identifier] || false;
|
|
7074
|
+
return {
|
|
7075
|
+
class: options.inputClassName,
|
|
7076
|
+
component,
|
|
7077
|
+
error: isTouched ? formErrors[identifier] : void 0,
|
|
7078
|
+
key,
|
|
7079
|
+
label: resolve(component.label) || "",
|
|
7080
|
+
modelValue: formValues[identifier] || "",
|
|
7081
|
+
name: identifier,
|
|
7082
|
+
onBlur: () => options.onInputBlur?.(identifier),
|
|
7083
|
+
onError: options.onPickerError,
|
|
7084
|
+
"onUpdate:modelValue": (val) => onInputChange(identifier, val),
|
|
7085
|
+
placeholder: resolve(component.placeholder),
|
|
7086
|
+
required: component.required
|
|
7087
|
+
};
|
|
7088
|
+
};
|
|
7089
|
+
const skipUnsupported = (typeName) => {
|
|
7090
|
+
logger$2.warn(`Unsupported component type: ${typeName}. Skipping render.`);
|
|
7091
|
+
return null;
|
|
7092
|
+
};
|
|
6267
7093
|
switch (component.type) {
|
|
6268
7094
|
case EmbeddedFlowComponentType$1.TextInput:
|
|
6269
7095
|
case EmbeddedFlowComponentType$1.PasswordInput:
|
|
@@ -6445,6 +7271,18 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
|
|
|
6445
7271
|
required: component.required
|
|
6446
7272
|
});
|
|
6447
7273
|
}
|
|
7274
|
+
case EmbeddedFlowComponentType$1.UserSelect: return options.fetchUsers ? h(BaseUserSelect_default, {
|
|
7275
|
+
...resourceSelectProps(),
|
|
7276
|
+
fetchUsers: options.fetchUsers
|
|
7277
|
+
}) : skipUnsupported("USER_SELECT");
|
|
7278
|
+
case EmbeddedFlowComponentType$1.AuthFlowSelect: return options.fetchAuthFlows ? h(BaseAuthFlowSelect_default, {
|
|
7279
|
+
...resourceSelectProps(),
|
|
7280
|
+
fetchAuthFlows: options.fetchAuthFlows
|
|
7281
|
+
}) : skipUnsupported("AUTH_FLOW_SELECT");
|
|
7282
|
+
case EmbeddedFlowComponentType$1.UserTypeSelect: return options.fetchUserTypes ? h(BaseUserTypeSelect_default, {
|
|
7283
|
+
...resourceSelectProps(),
|
|
7284
|
+
fetchUserTypes: options.fetchUserTypes
|
|
7285
|
+
}) : skipUnsupported("USER_TYPE_SELECT");
|
|
6448
7286
|
case EmbeddedFlowComponentType$1.Block:
|
|
6449
7287
|
if (component.components && component.components.length > 0) {
|
|
6450
7288
|
const blockChildren = component.components.map((childComponent, index) => createAuthComponentFromFlow(childComponent, formValues, touchedFields, formErrors, isLoading, isFormValid, resetForm, onInputChange, {
|
|
@@ -6551,6 +7389,16 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
|
|
|
6551
7389
|
pairs
|
|
6552
7390
|
});
|
|
6553
7391
|
}
|
|
7392
|
+
case EmbeddedFlowComponentType$1.CopyableText: {
|
|
7393
|
+
const sourceKey = component.source;
|
|
7394
|
+
const value = sourceKey && options.additionalData ? String(options.additionalData[sourceKey] ?? "") : "";
|
|
7395
|
+
return h(CopyableText_default, {
|
|
7396
|
+
key,
|
|
7397
|
+
label: resolve(component.label),
|
|
7398
|
+
masked: Boolean(component.masked),
|
|
7399
|
+
value
|
|
7400
|
+
});
|
|
7401
|
+
}
|
|
6554
7402
|
default:
|
|
6555
7403
|
logger$2.warn(`Unsupported component type: ${component.type}. Skipping render.`);
|
|
6556
7404
|
return null;
|
|
@@ -6964,6 +7812,7 @@ const BaseSignIn = defineComponent({
|
|
|
6964
7812
|
].filter(Boolean).join(" ");
|
|
6965
7813
|
if (slots["default"]) {
|
|
6966
7814
|
const renderProps = {
|
|
7815
|
+
additionalData: props.additionalData,
|
|
6967
7816
|
components: props.components || [],
|
|
6968
7817
|
error: apiError.value,
|
|
6969
7818
|
fieldErrors: formErrors.value,
|
|
@@ -7255,9 +8104,8 @@ const SignIn = defineComponent({
|
|
|
7255
8104
|
}
|
|
7256
8105
|
const effectiveApplicationId = applicationId || urlParams.applicationId;
|
|
7257
8106
|
if (!urlParams.executionId && !effectiveApplicationId) {
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
throw err;
|
|
8107
|
+
setError(new ThunderIDRuntimeError$1("Either executionId or applicationId is required for authentication", "SIGN_IN_ERROR", "vue"));
|
|
8108
|
+
return;
|
|
7261
8109
|
}
|
|
7262
8110
|
try {
|
|
7263
8111
|
flowError.value = null;
|
|
@@ -8086,6 +8934,7 @@ const BaseSignUp = defineComponent({
|
|
|
8086
8934
|
].filter(Boolean).join(" ");
|
|
8087
8935
|
if (slots["default"]) {
|
|
8088
8936
|
const renderProps = {
|
|
8937
|
+
additionalData: currentFlow.value?.data?.additionalData ?? {},
|
|
8089
8938
|
components: currentFlow.value?.data?.components || [],
|
|
8090
8939
|
error: apiError.value,
|
|
8091
8940
|
fieldErrors: formErrors.value,
|
|
@@ -9823,7 +10672,7 @@ const BaseAcceptInvite = defineComponent({
|
|
|
9823
10672
|
const errors = {};
|
|
9824
10673
|
const validateComponents = (comps) => {
|
|
9825
10674
|
comps.forEach((comp) => {
|
|
9826
|
-
if ((comp.type === "PASSWORD_INPUT" || comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT") && comp.required && comp.ref) {
|
|
10675
|
+
if ((comp.type === "PASSWORD_INPUT" || comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "SELECT") && comp.required && comp.ref) {
|
|
9827
10676
|
const value = formValues.value[comp.ref] || "";
|
|
9828
10677
|
if (!value || value.trim() === "") errors[comp.ref] = `${comp.label || comp.ref} is required`;
|
|
9829
10678
|
}
|
|
@@ -10022,6 +10871,7 @@ const BaseAcceptInvite = defineComponent({
|
|
|
10022
10871
|
}, () => "Sign In")]) : null
|
|
10023
10872
|
])]);
|
|
10024
10873
|
const renderedComponents = componentsWithoutHeadings.length > 0 ? renderInviteUserComponents(componentsWithoutHeadings, formValues.value, touchedFields.value, formErrors.value, isLoading.value, isFormValid.value, resetForm, handleInputChange, {
|
|
10874
|
+
additionalData: currentFlow.value?.data?.additionalData ?? {},
|
|
10025
10875
|
meta,
|
|
10026
10876
|
onInputBlur: handleInputBlur,
|
|
10027
10877
|
onSubmit: handleSubmit,
|
|
@@ -10179,6 +11029,18 @@ const BaseInviteUser = defineComponent({
|
|
|
10179
11029
|
default: "",
|
|
10180
11030
|
type: String
|
|
10181
11031
|
},
|
|
11032
|
+
fetchAuthFlows: {
|
|
11033
|
+
default: void 0,
|
|
11034
|
+
type: Function
|
|
11035
|
+
},
|
|
11036
|
+
fetchUsers: {
|
|
11037
|
+
default: void 0,
|
|
11038
|
+
type: Function
|
|
11039
|
+
},
|
|
11040
|
+
fetchUserTypes: {
|
|
11041
|
+
default: void 0,
|
|
11042
|
+
type: Function
|
|
11043
|
+
},
|
|
10182
11044
|
isInitialized: {
|
|
10183
11045
|
default: true,
|
|
10184
11046
|
type: Boolean
|
|
@@ -10277,7 +11139,7 @@ const BaseInviteUser = defineComponent({
|
|
|
10277
11139
|
const errors = {};
|
|
10278
11140
|
const validateComponents = (comps) => {
|
|
10279
11141
|
comps.forEach((comp) => {
|
|
10280
|
-
if ((comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "SELECT") && comp.required && comp.ref) {
|
|
11142
|
+
if ((comp.type === "TEXT_INPUT" || comp.type === "EMAIL_INPUT" || comp.type === "SELECT" || comp.type === "USER_SELECT" || comp.type === "AUTH_FLOW_SELECT" || comp.type === "USER_TYPE_SELECT") && comp.required && comp.ref) {
|
|
10281
11143
|
const value = formValues.value[comp.ref] || "";
|
|
10282
11144
|
if (!value || value.trim() === "") errors[comp.ref] = `${comp.label || comp.ref} is required`;
|
|
10283
11145
|
if (comp.type === "EMAIL_INPUT" && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) errors[comp.ref] = "Please enter a valid email address";
|
|
@@ -10505,8 +11367,13 @@ const BaseInviteUser = defineComponent({
|
|
|
10505
11367
|
}, () => "Invite Another User")])
|
|
10506
11368
|
])]);
|
|
10507
11369
|
const renderedComponents = componentsWithoutHeadings.length > 0 ? renderInviteUserComponents(componentsWithoutHeadings, formValues.value, touchedFields.value, formErrors.value, isLoading.value, isFormValid.value, resetForm, handleInputChange, {
|
|
11370
|
+
additionalData: currentFlow.value?.data?.additionalData,
|
|
11371
|
+
fetchAuthFlows: props.fetchAuthFlows,
|
|
11372
|
+
fetchUsers: props.fetchUsers,
|
|
11373
|
+
fetchUserTypes: props.fetchUserTypes,
|
|
10508
11374
|
meta,
|
|
10509
11375
|
onInputBlur: handleInputBlur,
|
|
11376
|
+
onPickerError: props.onError,
|
|
10510
11377
|
onSubmit: handleSubmit,
|
|
10511
11378
|
size: props.size,
|
|
10512
11379
|
t,
|
|
@@ -10577,6 +11444,9 @@ const InviteUser = defineComponent({
|
|
|
10577
11444
|
},
|
|
10578
11445
|
setup(props, { slots }) {
|
|
10579
11446
|
const { http: http$1, baseUrl, isInitialized } = useThunderID_default();
|
|
11447
|
+
const fetchAuthFlows = useFetchAuthFlows_default();
|
|
11448
|
+
const fetchUsers = useFetchUsers_default();
|
|
11449
|
+
const fetchUserTypes = useFetchUserTypes_default();
|
|
10580
11450
|
const handleInitialize = async (payload) => {
|
|
10581
11451
|
return (await http$1.request({
|
|
10582
11452
|
data: {
|
|
@@ -10608,6 +11478,9 @@ const InviteUser = defineComponent({
|
|
|
10608
11478
|
};
|
|
10609
11479
|
return () => h(BaseInviteUser_default, {
|
|
10610
11480
|
className: props.className,
|
|
11481
|
+
fetchAuthFlows,
|
|
11482
|
+
fetchUsers,
|
|
11483
|
+
fetchUserTypes,
|
|
10611
11484
|
isInitialized: isInitialized?.value ?? false,
|
|
10612
11485
|
onError: props.onError,
|
|
10613
11486
|
onFlowChange: props.onFlowChange,
|
|
@@ -10797,7 +11670,7 @@ const createThunderIDGuard = (options = {}) => {
|
|
|
10797
11670
|
return async (_to, _from, next) => {
|
|
10798
11671
|
const ctx = inject(THUNDERID_KEY);
|
|
10799
11672
|
if (!ctx) {
|
|
10800
|
-
logger.error("createThunderIDGuard: ThunderID context not found. Ensure the
|
|
11673
|
+
logger.error("createThunderIDGuard: ThunderID context not found. Ensure <ThunderIDProvider> is mounted (or the context is provided at app level) before using the router guard.");
|
|
10801
11674
|
next({ path: redirectTo });
|
|
10802
11675
|
return;
|
|
10803
11676
|
}
|
|
@@ -10891,4 +11764,4 @@ const createCallbackRoute = (options = {}) => {
|
|
|
10891
11764
|
};
|
|
10892
11765
|
|
|
10893
11766
|
//#endregion
|
|
10894
|
-
export { AcceptInvite_default as AcceptInvite, Alert_default as Alert, ArrowLeftRightIcon, BaseAcceptInvite_default as BaseAcceptInvite, BaseChangeCredential_default as BaseChangeCredential, 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, ChangeCredential_default as ChangeCredential, 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, KeyValueList_default as KeyValueList, 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, extractErrorMessage, getActiveTheme, getAuthComponentHeadings_default as getAuthComponentHeadings, getUsersMeMeta_default as getUsersMeMeta, handlePasskeyAuthentication, handlePasskeyRegistration, handleWebAuthnAuthentication, hasAuthParamsInUrl, http, initiateOAuthRedirect, navigate, normalizeFlowResponse, parseKeyValuePairs, 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 };
|
|
11767
|
+
export { AcceptInvite_default as AcceptInvite, Alert_default as Alert, ArrowLeftRightIcon, AuthFlowSelect_default as AuthFlowSelect, BaseAcceptInvite_default as BaseAcceptInvite, BaseAuthFlowSelect_default as BaseAuthFlowSelect, BaseChangeCredential_default as BaseChangeCredential, 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, BaseUserSelect_default as BaseUserSelect, BaseUserTypeSelect_default as BaseUserTypeSelect, BuildingIcon, Button_default as Button, Callback_default as Callback, Card_default as Card, ChangeCredential_default as ChangeCredential, CheckIcon, Checkbox_default as Checkbox, ChevronDownIcon, CircleAlertIcon, CircleCheckIcon, CopyableText_default as CopyableText, 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, KeyValueList_default as KeyValueList, 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, UserSelect_default as UserSelect, UserTypeSelect_default as UserTypeSelect, XIcon, buildThemeConfigFromFlowMeta_default as buildThemeConfigFromFlowMeta, createCallbackRoute, createClassObserver, createField, createMediaQueryListener, createThunderIDGuard, detectThemeMode, extractErrorMessage, getActiveTheme, getAuthComponentHeadings_default as getAuthComponentHeadings, getUsersMeMeta_default as getUsersMeMeta, handlePasskeyAuthentication, handlePasskeyRegistration, handleWebAuthnAuthentication, hasAuthParamsInUrl, http, initiateOAuthRedirect, navigate, normalizeFlowResponse, parseKeyValuePairs, useFetchAuthFlows_default as useFetchAuthFlows, useFetchUserTypes_default as useFetchUserTypes, useFetchUsers_default as useFetchUsers, useFlow_default as useFlow, useFlowMeta_default as useFlowMeta, useI18n_default as useI18n, useInfiniteOptions_default as useInfiniteOptions, useOAuthCallback, useTheme_default as useTheme, useThunderID_default as useThunderID, useUser_default as useUser, validateFieldValue };
|