@isoftdata/svelte-user-configuration 1.3.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/dist/DeactivateUserModal.svelte +32 -20
- package/dist/DeactivateUserModal.svelte.d.ts +10 -22
- package/dist/PasswordRecoveryModal.svelte +44 -22
- package/dist/PasswordRecoveryModal.svelte.d.ts +8 -20
- package/dist/PasswordSetModal.svelte +76 -43
- package/dist/PasswordSetModal.svelte.d.ts +12 -24
- package/dist/PermissionList.svelte +229 -136
- package/dist/PermissionList.svelte.d.ts +21 -34
- package/dist/UserAccountInfo.svelte +189 -96
- 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 +38 -14
- package/dist/UserGroupMembership.svelte.d.ts +14 -30
- package/dist/UserSiteAccess.svelte +40 -13
- package/dist/UserSiteAccess.svelte.d.ts +17 -33
- package/dist/util.d.ts +23 -24
- package/package.json +74 -73
|
@@ -1,87 +1,162 @@
|
|
|
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.log(err)
|
|
108
|
+
if (err instanceof Error) {
|
|
109
|
+
await error?.({
|
|
110
|
+
heading: translate('configuration.messageHeading.failedToGenerateNewPIN', 'Failed To Generate New PIN'),
|
|
111
|
+
message: err.message,
|
|
112
|
+
})
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async function copyTextToClipboard() {
|
|
119
|
+
if (activationPINInput) {
|
|
120
|
+
navigator.clipboard.writeText(activationPINInput.value)
|
|
121
|
+
await success?.({
|
|
122
|
+
heading: translate('configuration.messageHeading.activationPINCopied', 'Activation PIN Copied!'),
|
|
123
|
+
message: translate(
|
|
124
|
+
'configuration.user.permissions.activationPINCopied',
|
|
125
|
+
'Activation PIN copied to clipboard successfully.',
|
|
126
|
+
),
|
|
127
|
+
})
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
async function reactivateUserAccount() {
|
|
132
|
+
if (
|
|
133
|
+
confirm(
|
|
134
|
+
translate(
|
|
135
|
+
'configuration.user.permissions.reactivateUserConfirmation',
|
|
136
|
+
'Are you sure you want to reactivate this user?',
|
|
137
|
+
),
|
|
138
|
+
)
|
|
139
|
+
) {
|
|
140
|
+
userAccount.status = 'ACTIVE'
|
|
141
|
+
userAccount.lockNotes = null
|
|
142
|
+
await accountInfoChanged?.()
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const emailAddressRegex =
|
|
147
|
+
/^(([^<>()[\]\\.,;:\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,}))$/
|
|
148
|
+
const emailIsValid = (emailAddress: string): boolean => emailAddressRegex.test(emailAddress)
|
|
149
|
+
|
|
150
|
+
let workEmail = $derived(userAccount.workEmail)
|
|
151
|
+
let status = $derived(userAccount.status)
|
|
152
|
+
let activationPIN = $derived(userAccount.userActivationData?.activationPIN)
|
|
153
|
+
let isCreatingNewUser = $derived(userAccount.id === null)
|
|
79
154
|
</script>
|
|
80
155
|
|
|
81
156
|
<div
|
|
82
157
|
class="card"
|
|
83
158
|
bind:offsetHeight={cardHeight}
|
|
84
|
-
{
|
|
159
|
+
{...rest}
|
|
85
160
|
>
|
|
86
161
|
<fieldset disabled={!canEditAccountInfo}>
|
|
87
162
|
<div class="card-header">
|
|
@@ -89,7 +164,7 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
89
164
|
<h5 class="mb-0">
|
|
90
165
|
<Icon
|
|
91
166
|
{icon}
|
|
92
|
-
class="mr-1"
|
|
167
|
+
class="mr-1 me-1"
|
|
93
168
|
/>
|
|
94
169
|
{isCreatingNewUser ? translate('configuration.user.creatingNewAccountInfoHeader', 'New Account') : cardTitle}
|
|
95
170
|
</h5>
|
|
@@ -99,7 +174,7 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
99
174
|
outline
|
|
100
175
|
color="danger"
|
|
101
176
|
iconClass="xmark"
|
|
102
|
-
|
|
177
|
+
onclick={() => deactivateUserModal?.open(userAccount)}
|
|
103
178
|
disabled={!canEditAccountInfo || !canToggleActive}
|
|
104
179
|
>
|
|
105
180
|
<span>{translate('common:deactivate', 'Deactivate')}</span>
|
|
@@ -110,7 +185,7 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
110
185
|
outline
|
|
111
186
|
color="success"
|
|
112
187
|
iconClass="check"
|
|
113
|
-
|
|
188
|
+
onclick={() => reactivateUserAccount()}
|
|
114
189
|
disabled={!canEditAccountInfo || !canToggleActive}
|
|
115
190
|
>
|
|
116
191
|
<span>{translate('common:activate', 'Activate')}</span>
|
|
@@ -119,12 +194,16 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
119
194
|
</div>
|
|
120
195
|
</div>
|
|
121
196
|
<div class="card-body">
|
|
122
|
-
<div class="
|
|
197
|
+
<div class="row">
|
|
123
198
|
{#if !isCreatingNewUser && status === 'PENDING_ACTIVATION'}
|
|
124
199
|
<div class="col-12">
|
|
125
200
|
{#if activationPIN && workEmail}
|
|
126
201
|
<div class="alert alert-info mb-0">
|
|
127
|
-
{translate(
|
|
202
|
+
{translate(
|
|
203
|
+
'configuration.user.accountInfo.activationPINSent',
|
|
204
|
+
'An activation PIN has been sent to {{email}}.',
|
|
205
|
+
{ email: workEmail },
|
|
206
|
+
)}
|
|
128
207
|
</div>
|
|
129
208
|
{:else}
|
|
130
209
|
<label for="activationPIN">{translate('configuration.user.activationPIN', 'Activation PIN')}</label>
|
|
@@ -145,14 +224,14 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
145
224
|
outline
|
|
146
225
|
{isLoading}
|
|
147
226
|
iconClass="refresh"
|
|
148
|
-
|
|
227
|
+
onclick={() => getNewActivationPIN()}
|
|
149
228
|
title={translate('configuration.user.generateNewActivationPIN', 'Generate New PIN')}
|
|
150
229
|
/>
|
|
151
230
|
<Button
|
|
152
231
|
size="sm"
|
|
153
232
|
outline
|
|
154
233
|
iconClass="copy"
|
|
155
|
-
|
|
234
|
+
onclick={() => copyTextToClipboard()}
|
|
156
235
|
disabled={!activationPIN}
|
|
157
236
|
title={translate('configuration.user.copyActivationPIN', 'Copy Activation PIN')}
|
|
158
237
|
/>
|
|
@@ -204,6 +283,9 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
204
283
|
<Input
|
|
205
284
|
label={translate('configuration.user.accountInfo.workEmail', 'Work Email')}
|
|
206
285
|
bind:value={userAccount.workEmail}
|
|
286
|
+
onchange={() => {
|
|
287
|
+
workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(userAccount.workEmail) : true
|
|
288
|
+
}}
|
|
207
289
|
autocomplete="email"
|
|
208
290
|
type="email"
|
|
209
291
|
inputmode="email"
|
|
@@ -217,7 +299,7 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
217
299
|
size="sm"
|
|
218
300
|
color="link"
|
|
219
301
|
class="p-0 mb-2"
|
|
220
|
-
|
|
302
|
+
onclick={() => getNewActivationPIN(true)}
|
|
221
303
|
>
|
|
222
304
|
{translate('configuration.user.sendNewActivationPIN', 'Send New Activation PIN')}...
|
|
223
305
|
</Button>
|
|
@@ -225,8 +307,15 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
225
307
|
</div>
|
|
226
308
|
<div class="col-12 col-lg-6">
|
|
227
309
|
<Input
|
|
228
|
-
label={translate(
|
|
310
|
+
label={translate(
|
|
311
|
+
'configuration.user.accountInfo.passwordRecoveryModal.passwordRecoveryEmail',
|
|
312
|
+
'Password Recovery Email',
|
|
313
|
+
)}
|
|
229
314
|
bind:value={userAccount.recoveryEmail}
|
|
315
|
+
onchange={() => {
|
|
316
|
+
recoveryEmailIsValid =
|
|
317
|
+
myAccountMode && userAccount.recoveryEmail ? emailIsValid(userAccount.recoveryEmail) : true
|
|
318
|
+
}}
|
|
230
319
|
autocomplete="email"
|
|
231
320
|
type="email"
|
|
232
321
|
inputmode="email"
|
|
@@ -247,9 +336,9 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
247
336
|
/>
|
|
248
337
|
</div>
|
|
249
338
|
{/if}
|
|
250
|
-
|
|
339
|
+
{@render formFields?.()}
|
|
251
340
|
</div>
|
|
252
|
-
|
|
341
|
+
{@render children?.()}
|
|
253
342
|
</div>
|
|
254
343
|
<div class="card-footer">
|
|
255
344
|
{#if !myAccountMode}
|
|
@@ -258,8 +347,8 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
258
347
|
outline
|
|
259
348
|
iconClass="paper-plane"
|
|
260
349
|
disabled={!canEditAccountInfo}
|
|
261
|
-
|
|
262
|
-
passwordRecoveryModal
|
|
350
|
+
onclick={() => {
|
|
351
|
+
passwordRecoveryModal?.open(userAccount.workEmail, userAccount.lastPasswordResetDate)
|
|
263
352
|
}}
|
|
264
353
|
>
|
|
265
354
|
{translate('configuration.user.sendResetToken', 'Send Reset Token')}...
|
|
@@ -271,7 +360,7 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
271
360
|
outline
|
|
272
361
|
iconClass="key"
|
|
273
362
|
disabled={!myAccountMode && !canEditAccountInfo}
|
|
274
|
-
|
|
363
|
+
onclick={() => passwordSetModal?.open(userAccount)}
|
|
275
364
|
>
|
|
276
365
|
{#if myAccountMode}
|
|
277
366
|
{translate('configuration.user.changePassword', 'Change Password')}...
|
|
@@ -283,7 +372,7 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
283
372
|
<Button
|
|
284
373
|
outline
|
|
285
374
|
color="danger"
|
|
286
|
-
|
|
375
|
+
onclick={() => {
|
|
287
376
|
userAccount.currentPassword = ''
|
|
288
377
|
userAccount.newPassword = ''
|
|
289
378
|
}}
|
|
@@ -312,7 +401,10 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
312
401
|
} catch (err) {
|
|
313
402
|
console.error(err)
|
|
314
403
|
if (err instanceof Error) {
|
|
315
|
-
await error?.({
|
|
404
|
+
await error?.({
|
|
405
|
+
heading: translate('configuration.user.messageHeading.failedToDeactivateUser', 'Failed To Deactivate User'),
|
|
406
|
+
message: err.message,
|
|
407
|
+
})
|
|
316
408
|
}
|
|
317
409
|
}
|
|
318
410
|
}}
|
|
@@ -333,7 +425,8 @@ $: workEmailIsValid = !myAccountMode && userAccount.workEmail ? emailIsValid(use
|
|
|
333
425
|
} catch (err) {
|
|
334
426
|
await error?.({
|
|
335
427
|
heading: translate('configuration.user.passwordChangeErrorHeading', 'Failed To Change Password'),
|
|
336
|
-
message:
|
|
428
|
+
message:
|
|
429
|
+
err instanceof Error ? err.message : translate('workOrder.unknownError', 'An unknown error occurred'),
|
|
337
430
|
})
|
|
338
431
|
console.error(err)
|
|
339
432
|
throw err
|
|
@@ -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;
|