@isoftdata/svelte-user-configuration 1.0.18 → 1.0.20
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/PasswordRecoveryModal.svelte +3 -1
- package/dist/PasswordRecoveryModal.svelte.d.ts +4 -3
- package/dist/UserAccountInfo.svelte +3 -1
- package/dist/UserAccountInfo.svelte.d.ts +4 -1
- package/dist/UserConfiguration.svelte +2 -0
- package/dist/UserConfiguration.svelte.d.ts +2 -1
- package/dist/util.d.ts +3 -1
- package/dist/util.js +1 -0
- package/package.json +1 -1
|
@@ -3,8 +3,9 @@ import Modal from "@isoftdata/svelte-modal";
|
|
|
3
3
|
import Input from "@isoftdata/svelte-input";
|
|
4
4
|
const { t: translate } = getContext("i18next") || { t: (_key, fallback) => fallback };
|
|
5
5
|
export let sendPasswordRecoveryToken = void 0;
|
|
6
|
+
export let doSendPasswordRecoveryToken;
|
|
6
7
|
let resetDate = void 0;
|
|
7
|
-
let email =
|
|
8
|
+
let email = null;
|
|
8
9
|
let show = false;
|
|
9
10
|
export function open(passwordRecoveryEmail, lastResetDate) {
|
|
10
11
|
email = passwordRecoveryEmail;
|
|
@@ -28,6 +29,7 @@ export function open(passwordRecoveryEmail, lastResetDate) {
|
|
|
28
29
|
on:submit={async event => {
|
|
29
30
|
event.preventDefault()
|
|
30
31
|
try {
|
|
32
|
+
doSendPasswordRecoveryToken = true
|
|
31
33
|
await sendPasswordRecoveryToken?.(email)
|
|
32
34
|
show = false
|
|
33
35
|
} catch (err) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
sendPasswordRecoveryToken?: ((email: string |
|
|
5
|
-
|
|
4
|
+
sendPasswordRecoveryToken?: ((email: string | null) => void | Promise<void>) | undefined;
|
|
5
|
+
doSendPasswordRecoveryToken: boolean;
|
|
6
|
+
open?: (passwordRecoveryEmail: string | null, lastResetDate: Date | undefined) => void;
|
|
6
7
|
};
|
|
7
8
|
events: {
|
|
8
9
|
[evt: string]: CustomEvent<any>;
|
|
@@ -15,6 +16,6 @@ export type PasswordRecoveryModalProps = typeof __propDef.props;
|
|
|
15
16
|
export type PasswordRecoveryModalEvents = typeof __propDef.events;
|
|
16
17
|
export type PasswordRecoveryModalSlots = typeof __propDef.slots;
|
|
17
18
|
export default class PasswordRecoveryModal extends SvelteComponent<PasswordRecoveryModalProps, PasswordRecoveryModalEvents, PasswordRecoveryModalSlots> {
|
|
18
|
-
get open(): (passwordRecoveryEmail: string |
|
|
19
|
+
get open(): (passwordRecoveryEmail: string | null, lastResetDate: Date | undefined) => void;
|
|
19
20
|
}
|
|
20
21
|
export {};
|
|
@@ -18,6 +18,7 @@ export let accountInfoChanged = void 0;
|
|
|
18
18
|
export let error = void 0;
|
|
19
19
|
export let success = void 0;
|
|
20
20
|
export let sendPasswordRecoveryToken = void 0;
|
|
21
|
+
export let doSendPasswordRecoveryToken = false;
|
|
21
22
|
export let generateNewActivationPIN = () => Promise.resolve();
|
|
22
23
|
export let usernameInput = void 0;
|
|
23
24
|
let isLoading = false;
|
|
@@ -164,7 +165,7 @@ $: isCreatingNewUser = userAccount.id === null;
|
|
|
164
165
|
iconClass="paper-plane"
|
|
165
166
|
on:click={() => {
|
|
166
167
|
if (userAccount.recoveryEmail) {
|
|
167
|
-
passwordRecoveryModal.open(userAccount.
|
|
168
|
+
passwordRecoveryModal.open(userAccount.workEmail, userAccount.lastPasswordResetDate)
|
|
168
169
|
}
|
|
169
170
|
}}
|
|
170
171
|
>
|
|
@@ -258,6 +259,7 @@ $: isCreatingNewUser = userAccount.id === null;
|
|
|
258
259
|
|
|
259
260
|
<PasswordRecoveryModal
|
|
260
261
|
bind:this={passwordRecoveryModal}
|
|
262
|
+
bind:doSendPasswordRecoveryToken
|
|
261
263
|
{sendPasswordRecoveryToken}
|
|
262
264
|
/>
|
|
263
265
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
2
3
|
import type { UserAccount, ConfirmPasswordSetFn, DeactivateUserFn, HTMLDivAttributes, IconName } from './';
|
|
4
|
+
import PasswordRecoveryModal from './PasswordRecoveryModal.svelte';
|
|
3
5
|
declare const __propDef: {
|
|
4
6
|
props: HTMLDivAttributes & {
|
|
5
7
|
userAccount: UserAccount;
|
|
@@ -18,7 +20,8 @@ declare const __propDef: {
|
|
|
18
20
|
message: string;
|
|
19
21
|
}) => void | Promise<void>) | undefined;
|
|
20
22
|
accountInfoChanged?: (() => void | Promise<void>) | undefined;
|
|
21
|
-
sendPasswordRecoveryToken?:
|
|
23
|
+
sendPasswordRecoveryToken?: ComponentProps<PasswordRecoveryModal>["sendPasswordRecoveryToken"];
|
|
24
|
+
doSendPasswordRecoveryToken: boolean;
|
|
22
25
|
icon?: IconName;
|
|
23
26
|
usernameInput?: HTMLInputElement | undefined;
|
|
24
27
|
};
|
|
@@ -13,6 +13,7 @@ export let usernameInput = void 0;
|
|
|
13
13
|
export let userAccount;
|
|
14
14
|
export let canToggleActive = true;
|
|
15
15
|
export let canEditAccountInfo = true;
|
|
16
|
+
export let doSendPasswordRecoveryToken = false;
|
|
16
17
|
export let hasPermissionToChangePassword = false;
|
|
17
18
|
export let error = void 0;
|
|
18
19
|
export let success = void 0;
|
|
@@ -38,6 +39,7 @@ export let permissionValueChange = void 0;
|
|
|
38
39
|
<UserAccountInfo
|
|
39
40
|
bind:userAccount
|
|
40
41
|
bind:usernameInput
|
|
42
|
+
bind:doSendPasswordRecoveryToken
|
|
41
43
|
{canToggleActive}
|
|
42
44
|
{canEditAccountInfo}
|
|
43
45
|
{hasPermissionToChangePassword}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { ErrorFn, IconName, UserSites, SuccessFn, SiteLabel, UserAccount, Permissions, GroupMembership, CanToggleActive, DeactivateUserFn, CanEditSiteAccess, SiteAccessChangeFn, PermissionValueMap, CanEditAccountInfo, ConfirmPasswordSetFn, AccountInfoChangedFn, CanEditGroupMembership, GroupMembershipChangeFn, PermissionValueChangeFn, GroupPermissionValueMap, GenerateNewActivationPINFn, SendPasswordRecoveryTokenFn, HasPermissionToChangePassword, PermissionListCardHeaderTitle } from './util';
|
|
2
|
+
import type { ErrorFn, IconName, UserSites, SuccessFn, SiteLabel, UserAccount, Permissions, GroupMembership, CanToggleActive, DeactivateUserFn, CanEditSiteAccess, SiteAccessChangeFn, PermissionValueMap, CanEditAccountInfo, ConfirmPasswordSetFn, AccountInfoChangedFn, CanEditGroupMembership, GroupMembershipChangeFn, PermissionValueChangeFn, GroupPermissionValueMap, GenerateNewActivationPINFn, DoSendPasswordRecoveryToken, SendPasswordRecoveryTokenFn, HasPermissionToChangePassword, PermissionListCardHeaderTitle } from './util';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
siteLabel?: SiteLabel;
|
|
@@ -13,6 +13,7 @@ declare const __propDef: {
|
|
|
13
13
|
userAccount: UserAccount;
|
|
14
14
|
canToggleActive?: CanToggleActive;
|
|
15
15
|
canEditAccountInfo?: CanEditAccountInfo;
|
|
16
|
+
doSendPasswordRecoveryToken?: DoSendPasswordRecoveryToken;
|
|
16
17
|
hasPermissionToChangePassword?: HasPermissionToChangePassword;
|
|
17
18
|
error?: ErrorFn;
|
|
18
19
|
success?: SuccessFn;
|
package/dist/util.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { ComponentProps } from 'svelte';
|
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
3
|
import DeactivateUserModal from './DeactivateUserModal.svelte';
|
|
4
4
|
import PasswordSetModal from './PasswordSetModal.svelte';
|
|
5
|
+
import PasswordRecoveryModal from './PasswordRecoveryModal.svelte';
|
|
5
6
|
import UserAccountInfo from './UserAccountInfo.svelte';
|
|
6
7
|
import UserSiteAccess from './UserSiteAccess.svelte';
|
|
7
8
|
import UserGroupMembership from './UserGroupMembership.svelte';
|
|
@@ -32,12 +33,13 @@ export type GenerateNewActivationPINFn = ComponentProps<UserAccountInfo>['genera
|
|
|
32
33
|
export type SuccessFn = ComponentProps<UserAccountInfo>['success'];
|
|
33
34
|
export type ErrorFn = ComponentProps<UserAccountInfo>['error'];
|
|
34
35
|
export type AccountInfoChangedFn = ComponentProps<UserAccountInfo>['accountInfoChanged'];
|
|
35
|
-
export type SendPasswordRecoveryTokenFn = ComponentProps<UserAccountInfo>['sendPasswordRecoveryToken'];
|
|
36
36
|
export type CanEditAccountInfo = ComponentProps<UserAccountInfo>['canEditAccountInfo'];
|
|
37
37
|
export type CanToggleActive = ComponentProps<UserAccountInfo>['canToggleActive'];
|
|
38
38
|
export type HasPermissionToChangePassword = ComponentProps<UserAccountInfo>['hasPermissionToChangePassword'];
|
|
39
39
|
export type ConfirmPasswordSetFn = ComponentProps<PasswordSetModal>['confirmPasswordSet'];
|
|
40
40
|
export type DeactivateUserFn = ComponentProps<DeactivateUserModal>['deactivateUser'];
|
|
41
|
+
export type DoSendPasswordRecoveryToken = ComponentProps<PasswordRecoveryModal>['doSendPasswordRecoveryToken'];
|
|
42
|
+
export type SendPasswordRecoveryTokenFn = ComponentProps<PasswordRecoveryModal>['sendPasswordRecoveryToken'];
|
|
41
43
|
export type UserSites = ComponentProps<UserSiteAccess>['userSites'];
|
|
42
44
|
export type CanEditSiteAccess = ComponentProps<UserSiteAccess>['canEditSiteAccess'];
|
|
43
45
|
export type SiteAccessChangeFn = ComponentProps<UserSiteAccess>['siteAccessChange'];
|
package/dist/util.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import DeactivateUserModal from './DeactivateUserModal.svelte';
|
|
2
2
|
import PasswordSetModal from './PasswordSetModal.svelte';
|
|
3
|
+
import PasswordRecoveryModal from './PasswordRecoveryModal.svelte';
|
|
3
4
|
import UserAccountInfo from './UserAccountInfo.svelte';
|
|
4
5
|
import UserSiteAccess from './UserSiteAccess.svelte';
|
|
5
6
|
import UserGroupMembership from './UserGroupMembership.svelte';
|