@isoftdata/svelte-user-configuration 1.3.3 → 2.0.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/README.md +161 -151
- package/dist/DeactivateUserModal.svelte +59 -47
- package/dist/DeactivateUserModal.svelte.d.ts +10 -22
- package/dist/PasswordRecoveryModal.svelte +83 -61
- package/dist/PasswordRecoveryModal.svelte.d.ts +8 -20
- package/dist/PasswordSetModal.svelte +127 -94
- package/dist/PasswordSetModal.svelte.d.ts +12 -24
- package/dist/PermissionList.svelte +289 -196
- package/dist/PermissionList.svelte.d.ts +21 -34
- package/dist/UserAccountInfo.svelte +189 -99
- package/dist/UserAccountInfo.svelte.d.ts +35 -47
- package/dist/UserConfiguration.svelte +116 -41
- package/dist/UserConfiguration.svelte.d.ts +38 -51
- package/dist/UserGroupMembership.svelte +64 -40
- package/dist/UserGroupMembership.svelte.d.ts +14 -30
- package/dist/UserSiteAccess.svelte +65 -38
- package/dist/UserSiteAccess.svelte.d.ts +17 -33
- package/dist/util.d.ts +22 -22
- package/package.json +77 -73
|
@@ -1,87 +1,161 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { i18n } from 'i18next'
|
|
3
|
+
import type { HTMLDivAttributes } from './'
|
|
4
|
+
import type { ComponentProps, Snippet } from 'svelte'
|
|
5
|
+
import type { UserAccount, ConfirmPasswordSetFn, DeactivateUserFn, IconName, PasswordValidationRules } from './'
|
|
6
|
+
|
|
7
|
+
import { getContext } from 'svelte'
|
|
8
|
+
import Icon from '@isoftdata/svelte-icon'
|
|
9
|
+
import Input from '@isoftdata/svelte-input'
|
|
10
|
+
import Button from '@isoftdata/svelte-button'
|
|
11
|
+
import TextArea from '@isoftdata/svelte-textarea'
|
|
12
|
+
import PasswordSetModal from './PasswordSetModal.svelte'
|
|
13
|
+
import DeactivateUserModal from './DeactivateUserModal.svelte'
|
|
14
|
+
import PasswordRecoveryModal from './PasswordRecoveryModal.svelte'
|
|
15
|
+
import { translate as defaultTranslate } from '@isoftdata/utility-string'
|
|
16
|
+
|
|
17
|
+
const { t: translate } = getContext<i18n>('i18next') || { t: defaultTranslate }
|
|
18
|
+
|
|
19
|
+
interface Props extends HTMLDivAttributes {
|
|
20
|
+
userAccount: UserAccount
|
|
21
|
+
canEditAccountInfo?: boolean
|
|
22
|
+
canToggleActive?: boolean
|
|
23
|
+
hasPermissionToChangePassword?: boolean
|
|
24
|
+
generateNewActivationPIN?: (userName: string, hasWorkEmail: boolean) => Promise<void>
|
|
25
|
+
confirmPasswordSet?: ConfirmPasswordSetFn
|
|
26
|
+
deactivateUser?: DeactivateUserFn
|
|
27
|
+
success?: ((info: { heading: string; message: string }) => void | Promise<void>) | undefined
|
|
28
|
+
error?: ((info: { heading: string; message: string }) => void | Promise<void>) | undefined
|
|
29
|
+
accountInfoChanged?: (() => void | Promise<void>) | undefined
|
|
30
|
+
sendPasswordRecoveryToken?: ComponentProps<typeof PasswordRecoveryModal>['sendPasswordRecoveryToken']
|
|
31
|
+
doSendPasswordRecoveryToken?: boolean
|
|
32
|
+
icon?: IconName
|
|
33
|
+
usernameInput?: HTMLInputElement | undefined
|
|
34
|
+
cardHeight?: number
|
|
35
|
+
myAccountMode?: boolean
|
|
36
|
+
passwordValidationRules?: PasswordValidationRules | undefined
|
|
37
|
+
cardTitle?: string
|
|
38
|
+
recoveryEmailIsValid?: boolean
|
|
39
|
+
workEmailIsValid?: boolean
|
|
40
|
+
formFields?: Snippet
|
|
41
|
+
children?: Snippet
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let {
|
|
45
|
+
userAccount = $bindable(),
|
|
46
|
+
canEditAccountInfo = true,
|
|
47
|
+
canToggleActive = true,
|
|
48
|
+
hasPermissionToChangePassword = false,
|
|
49
|
+
generateNewActivationPIN = () => Promise.resolve(),
|
|
50
|
+
confirmPasswordSet = undefined,
|
|
51
|
+
deactivateUser = undefined,
|
|
52
|
+
success = undefined,
|
|
53
|
+
error = undefined,
|
|
54
|
+
accountInfoChanged = undefined,
|
|
55
|
+
sendPasswordRecoveryToken = undefined,
|
|
56
|
+
doSendPasswordRecoveryToken = $bindable(false),
|
|
57
|
+
icon = 'user',
|
|
58
|
+
usernameInput = $bindable(undefined),
|
|
59
|
+
cardHeight = $bindable(),
|
|
60
|
+
myAccountMode = false,
|
|
61
|
+
passwordValidationRules = undefined,
|
|
62
|
+
cardTitle = translate('configuration.user.accountInfoHeader', 'Account'),
|
|
63
|
+
recoveryEmailIsValid = $bindable(true),
|
|
64
|
+
workEmailIsValid = $bindable(true),
|
|
65
|
+
formFields,
|
|
66
|
+
children,
|
|
67
|
+
...rest
|
|
68
|
+
}: Props = $props()
|
|
69
|
+
|
|
70
|
+
let isLoading = $state(false)
|
|
71
|
+
let passwordSetModal: PasswordSetModal | undefined = $state()
|
|
72
|
+
let passwordRecoveryModal: PasswordRecoveryModal | undefined = $state()
|
|
73
|
+
let deactivateUserModal: DeactivateUserModal | undefined = $state()
|
|
74
|
+
let activationPINInput: HTMLInputElement | undefined = $state()
|
|
75
|
+
|
|
76
|
+
async function getNewActivationPIN(sendEmail: boolean = false) {
|
|
77
|
+
let confirmationMessage: string = sendEmail
|
|
78
|
+
? translate(
|
|
79
|
+
'configuration.user.permissions.sendNewActivationPINMessage',
|
|
80
|
+
'Are you sure you want to send a new activation PIN? The user will receive an email with the new activation PIN.',
|
|
81
|
+
)
|
|
82
|
+
: translate(
|
|
83
|
+
'configuration.user.permissions.generateNewActivationPINMessage',
|
|
84
|
+
'Are you sure you want to generate a new activation PIN?',
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
if (confirm(confirmationMessage)) {
|
|
88
|
+
try {
|
|
89
|
+
isLoading = true
|
|
90
|
+
await generateNewActivationPIN(userAccount.name, !!userAccount.workEmail)
|
|
91
|
+
|
|
92
|
+
let successMessage: string = sendEmail
|
|
93
|
+
? translate(
|
|
94
|
+
'configuration.user.permissions.activationPINSent',
|
|
95
|
+
'Email with new activation PIN has been sent successfully.',
|
|
96
|
+
)
|
|
97
|
+
: translate('configuration.user.permissions.activationPINGenerated', 'Activation PIN generated successfully.')
|
|
98
|
+
let successHeading: string = sendEmail
|
|
99
|
+
? translate('configuration.messageHeading.activationPINSent', 'New Activation PIN Sent!')
|
|
100
|
+
: translate('configuration.messageHeading.activationPINGenerated', 'New Activation PIN Generated!')
|
|
101
|
+
|
|
102
|
+
await success?.({ heading: successHeading, message: successMessage })
|
|
103
|
+
|
|
104
|
+
isLoading = false
|
|
105
|
+
await accountInfoChanged?.()
|
|
106
|
+
} catch (err) {
|
|
107
|
+
console.error(err)
|
|
108
|
+
await error?.({
|
|
109
|
+
heading: translate('configuration.messageHeading.failedToGenerateNewPIN', 'Failed To Generate New PIN'),
|
|
110
|
+
message:
|
|
111
|
+
err instanceof Error ? err.message : translate('workOrder.unknownError', 'An unknown error occurred'),
|
|
112
|
+
})
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
async function copyTextToClipboard() {
|
|
118
|
+
if (activationPINInput) {
|
|
119
|
+
navigator.clipboard.writeText(activationPINInput.value)
|
|
120
|
+
await success?.({
|
|
121
|
+
heading: translate('configuration.messageHeading.activationPINCopied', 'Activation PIN Copied!'),
|
|
122
|
+
message: translate(
|
|
123
|
+
'configuration.user.permissions.activationPINCopied',
|
|
124
|
+
'Activation PIN copied to clipboard successfully.',
|
|
125
|
+
),
|
|
126
|
+
})
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
async function reactivateUserAccount() {
|
|
131
|
+
if (
|
|
132
|
+
confirm(
|
|
133
|
+
translate(
|
|
134
|
+
'configuration.user.permissions.reactivateUserConfirmation',
|
|
135
|
+
'Are you sure you want to reactivate this user?',
|
|
136
|
+
),
|
|
137
|
+
)
|
|
138
|
+
) {
|
|
139
|
+
userAccount.status = 'ACTIVE'
|
|
140
|
+
userAccount.lockNotes = null
|
|
141
|
+
await accountInfoChanged?.()
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const emailAddressRegex =
|
|
146
|
+
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
|
147
|
+
const emailIsValid = (emailAddress: string): boolean => emailAddressRegex.test(emailAddress)
|
|
148
|
+
|
|
149
|
+
let workEmail = $derived(userAccount.workEmail)
|
|
150
|
+
let status = $derived(userAccount.status)
|
|
151
|
+
let activationPIN = $derived(userAccount.userActivationData?.activationPIN)
|
|
152
|
+
let isCreatingNewUser = $derived(userAccount.id === null)
|
|
79
153
|
</script>
|
|
80
154
|
|
|
81
155
|
<div
|
|
82
156
|
class="card"
|
|
83
157
|
bind:offsetHeight={cardHeight}
|
|
84
|
-
{
|
|
158
|
+
{...rest}
|
|
85
159
|
>
|
|
86
160
|
<fieldset disabled={!canEditAccountInfo}>
|
|
87
161
|
<div class="card-header">
|
|
@@ -89,7 +163,7 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
89
163
|
<h5 class="mb-0">
|
|
90
164
|
<Icon
|
|
91
165
|
{icon}
|
|
92
|
-
class="mr-1"
|
|
166
|
+
class="mr-1 me-1"
|
|
93
167
|
/>
|
|
94
168
|
{isCreatingNewUser ? translate('configuration.user.creatingNewAccountInfoHeader', 'New Account') : cardTitle}
|
|
95
169
|
</h5>
|
|
@@ -99,7 +173,7 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
99
173
|
outline
|
|
100
174
|
color="danger"
|
|
101
175
|
iconClass="xmark"
|
|
102
|
-
|
|
176
|
+
onclick={() => deactivateUserModal?.open(userAccount)}
|
|
103
177
|
disabled={!canEditAccountInfo || !canToggleActive}
|
|
104
178
|
>
|
|
105
179
|
<span>{translate('common:deactivate', 'Deactivate')}</span>
|
|
@@ -110,7 +184,7 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
110
184
|
outline
|
|
111
185
|
color="success"
|
|
112
186
|
iconClass="check"
|
|
113
|
-
|
|
187
|
+
onclick={() => reactivateUserAccount()}
|
|
114
188
|
disabled={!canEditAccountInfo || !canToggleActive}
|
|
115
189
|
>
|
|
116
190
|
<span>{translate('common:activate', 'Activate')}</span>
|
|
@@ -119,12 +193,16 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
119
193
|
</div>
|
|
120
194
|
</div>
|
|
121
195
|
<div class="card-body">
|
|
122
|
-
<div class="
|
|
196
|
+
<div class="row">
|
|
123
197
|
{#if !isCreatingNewUser && status === 'PENDING_ACTIVATION'}
|
|
124
198
|
<div class="col-12">
|
|
125
199
|
{#if activationPIN && workEmail}
|
|
126
200
|
<div class="alert alert-info mb-0">
|
|
127
|
-
{translate(
|
|
201
|
+
{translate(
|
|
202
|
+
'configuration.user.accountInfo.activationPINSent',
|
|
203
|
+
'An activation PIN has been sent to {{email}}.',
|
|
204
|
+
{ email: workEmail },
|
|
205
|
+
)}
|
|
128
206
|
</div>
|
|
129
207
|
{:else}
|
|
130
208
|
<label for="activationPIN">{translate('configuration.user.activationPIN', 'Activation PIN')}</label>
|
|
@@ -145,14 +223,14 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
145
223
|
outline
|
|
146
224
|
{isLoading}
|
|
147
225
|
iconClass="refresh"
|
|
148
|
-
|
|
226
|
+
onclick={() => getNewActivationPIN()}
|
|
149
227
|
title={translate('configuration.user.generateNewActivationPIN', 'Generate New PIN')}
|
|
150
228
|
/>
|
|
151
229
|
<Button
|
|
152
230
|
size="sm"
|
|
153
231
|
outline
|
|
154
232
|
iconClass="copy"
|
|
155
|
-
|
|
233
|
+
onclick={() => copyTextToClipboard()}
|
|
156
234
|
disabled={!activationPIN}
|
|
157
235
|
title={translate('configuration.user.copyActivationPIN', 'Copy Activation PIN')}
|
|
158
236
|
/>
|
|
@@ -204,6 +282,9 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
204
282
|
<Input
|
|
205
283
|
label={translate('configuration.user.accountInfo.workEmail', 'Work Email')}
|
|
206
284
|
bind:value={userAccount.workEmail}
|
|
285
|
+
onchange={() => {
|
|
286
|
+
workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(userAccount.workEmail) : true
|
|
287
|
+
}}
|
|
207
288
|
autocomplete="email"
|
|
208
289
|
type="email"
|
|
209
290
|
inputmode="email"
|
|
@@ -217,7 +298,7 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
217
298
|
size="sm"
|
|
218
299
|
color="link"
|
|
219
300
|
class="p-0 mb-2"
|
|
220
|
-
|
|
301
|
+
onclick={() => getNewActivationPIN(true)}
|
|
221
302
|
>
|
|
222
303
|
{translate('configuration.user.sendNewActivationPIN', 'Send New Activation PIN')}...
|
|
223
304
|
</Button>
|
|
@@ -225,8 +306,15 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
225
306
|
</div>
|
|
226
307
|
<div class="col-12 col-lg-6">
|
|
227
308
|
<Input
|
|
228
|
-
label={translate(
|
|
309
|
+
label={translate(
|
|
310
|
+
'configuration.user.accountInfo.passwordRecoveryModal.passwordRecoveryEmail',
|
|
311
|
+
'Password Recovery Email',
|
|
312
|
+
)}
|
|
229
313
|
bind:value={userAccount.recoveryEmail}
|
|
314
|
+
onchange={() => {
|
|
315
|
+
recoveryEmailIsValid =
|
|
316
|
+
myAccountMode && userAccount.recoveryEmail ? emailIsValid(userAccount.recoveryEmail) : true
|
|
317
|
+
}}
|
|
230
318
|
autocomplete="email"
|
|
231
319
|
type="email"
|
|
232
320
|
inputmode="email"
|
|
@@ -247,9 +335,9 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
247
335
|
/>
|
|
248
336
|
</div>
|
|
249
337
|
{/if}
|
|
250
|
-
|
|
338
|
+
{@render formFields?.()}
|
|
251
339
|
</div>
|
|
252
|
-
|
|
340
|
+
{@render children?.()}
|
|
253
341
|
</div>
|
|
254
342
|
<div class="card-footer">
|
|
255
343
|
{#if !myAccountMode}
|
|
@@ -258,8 +346,8 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
258
346
|
outline
|
|
259
347
|
iconClass="paper-plane"
|
|
260
348
|
disabled={!canEditAccountInfo}
|
|
261
|
-
|
|
262
|
-
passwordRecoveryModal
|
|
349
|
+
onclick={() => {
|
|
350
|
+
passwordRecoveryModal?.open(userAccount.workEmail, userAccount.lastPasswordResetDate)
|
|
263
351
|
}}
|
|
264
352
|
>
|
|
265
353
|
{translate('configuration.user.sendResetToken', 'Send Reset Token')}...
|
|
@@ -271,7 +359,7 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
271
359
|
outline
|
|
272
360
|
iconClass="key"
|
|
273
361
|
disabled={!myAccountMode && !canEditAccountInfo}
|
|
274
|
-
|
|
362
|
+
onclick={() => passwordSetModal?.open(userAccount)}
|
|
275
363
|
>
|
|
276
364
|
{#if myAccountMode}
|
|
277
365
|
{translate('configuration.user.changePassword', 'Change Password')}...
|
|
@@ -283,7 +371,7 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
283
371
|
<Button
|
|
284
372
|
outline
|
|
285
373
|
color="danger"
|
|
286
|
-
|
|
374
|
+
onclick={() => {
|
|
287
375
|
userAccount.currentPassword = ''
|
|
288
376
|
userAccount.newPassword = ''
|
|
289
377
|
}}
|
|
@@ -311,9 +399,10 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
311
399
|
await accountInfoChanged?.()
|
|
312
400
|
} catch (err) {
|
|
313
401
|
console.error(err)
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
402
|
+
await error?.({
|
|
403
|
+
heading: translate('configuration.user.messageHeading.failedToDeactivateUser', 'Failed To Deactivate User'),
|
|
404
|
+
message: err instanceof Error ? err.message : translate('workOrder.unknownError', 'An unknown error occurred'),
|
|
405
|
+
})
|
|
317
406
|
}
|
|
318
407
|
}}
|
|
319
408
|
/>
|
|
@@ -331,11 +420,12 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
331
420
|
message: translate('configuration.user.passwordChangeSuccessMessage', 'Password changed successfully'),
|
|
332
421
|
})
|
|
333
422
|
} catch (err) {
|
|
423
|
+
console.error(err)
|
|
334
424
|
await error?.({
|
|
335
425
|
heading: translate('configuration.user.passwordChangeErrorHeading', 'Failed To Change Password'),
|
|
336
|
-
message:
|
|
426
|
+
message:
|
|
427
|
+
err instanceof Error ? err.message : translate('workOrder.unknownError', 'An unknown error occurred'),
|
|
337
428
|
})
|
|
338
|
-
console.error(err)
|
|
339
429
|
throw err
|
|
340
430
|
}
|
|
341
431
|
} else {
|
|
@@ -1,49 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ComponentProps } from 'svelte';
|
|
3
|
-
import type { UserAccount, ConfirmPasswordSetFn, DeactivateUserFn,
|
|
1
|
+
import type { HTMLDivAttributes } from './';
|
|
2
|
+
import type { ComponentProps, Snippet } from 'svelte';
|
|
3
|
+
import type { UserAccount, ConfirmPasswordSetFn, DeactivateUserFn, IconName, PasswordValidationRules } from './';
|
|
4
4
|
import PasswordRecoveryModal from './PasswordRecoveryModal.svelte';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
events: {
|
|
35
|
-
[evt: string]: CustomEvent<any>;
|
|
36
|
-
};
|
|
37
|
-
slots: {
|
|
38
|
-
formFields: {};
|
|
39
|
-
default: {};
|
|
40
|
-
};
|
|
41
|
-
exports?: {} | undefined;
|
|
42
|
-
bindings?: string | undefined;
|
|
43
|
-
};
|
|
44
|
-
export type UserAccountInfoProps = typeof __propDef.props;
|
|
45
|
-
export type UserAccountInfoEvents = typeof __propDef.events;
|
|
46
|
-
export type UserAccountInfoSlots = typeof __propDef.slots;
|
|
47
|
-
export default class UserAccountInfo extends SvelteComponent<UserAccountInfoProps, UserAccountInfoEvents, UserAccountInfoSlots> {
|
|
5
|
+
interface Props extends HTMLDivAttributes {
|
|
6
|
+
userAccount: UserAccount;
|
|
7
|
+
canEditAccountInfo?: boolean;
|
|
8
|
+
canToggleActive?: boolean;
|
|
9
|
+
hasPermissionToChangePassword?: boolean;
|
|
10
|
+
generateNewActivationPIN?: (userName: string, hasWorkEmail: boolean) => Promise<void>;
|
|
11
|
+
confirmPasswordSet?: ConfirmPasswordSetFn;
|
|
12
|
+
deactivateUser?: DeactivateUserFn;
|
|
13
|
+
success?: ((info: {
|
|
14
|
+
heading: string;
|
|
15
|
+
message: string;
|
|
16
|
+
}) => void | Promise<void>) | undefined;
|
|
17
|
+
error?: ((info: {
|
|
18
|
+
heading: string;
|
|
19
|
+
message: string;
|
|
20
|
+
}) => void | Promise<void>) | undefined;
|
|
21
|
+
accountInfoChanged?: (() => void | Promise<void>) | undefined;
|
|
22
|
+
sendPasswordRecoveryToken?: ComponentProps<typeof PasswordRecoveryModal>['sendPasswordRecoveryToken'];
|
|
23
|
+
doSendPasswordRecoveryToken?: boolean;
|
|
24
|
+
icon?: IconName;
|
|
25
|
+
usernameInput?: HTMLInputElement | undefined;
|
|
26
|
+
cardHeight?: number;
|
|
27
|
+
myAccountMode?: boolean;
|
|
28
|
+
passwordValidationRules?: PasswordValidationRules | undefined;
|
|
29
|
+
cardTitle?: string;
|
|
30
|
+
recoveryEmailIsValid?: boolean;
|
|
31
|
+
workEmailIsValid?: boolean;
|
|
32
|
+
formFields?: Snippet;
|
|
33
|
+
children?: Snippet;
|
|
48
34
|
}
|
|
49
|
-
|
|
35
|
+
declare const UserAccountInfo: import("svelte").Component<Props, {}, "doSendPasswordRecoveryToken" | "userAccount" | "usernameInput" | "cardHeight" | "recoveryEmailIsValid" | "workEmailIsValid">;
|
|
36
|
+
type UserAccountInfo = ReturnType<typeof UserAccountInfo>;
|
|
37
|
+
export default UserAccountInfo;
|