@isoftdata/svelte-user-configuration 2.1.0 → 2.2.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.
@@ -26,7 +26,7 @@
26
26
  deactivateUser?: DeactivateUserFn
27
27
  success?: ((info: { heading: string; message: string }) => void | Promise<void>) | undefined
28
28
  error?: ((info: { heading: string; message: string }) => void | Promise<void>) | undefined
29
- accountInfoChanged?: (() => void | Promise<void>) | undefined
29
+ accountInfoChanged?: ((userAccount: UserAccount) => void | Promise<void>) | undefined
30
30
  sendPasswordRecoveryToken?: ComponentProps<typeof PasswordRecoveryModal>['sendPasswordRecoveryToken']
31
31
  doSendPasswordRecoveryToken?: boolean
32
32
  icon?: IconName
@@ -102,7 +102,7 @@
102
102
  await success?.({ heading: successHeading, message: successMessage })
103
103
 
104
104
  isLoading = false
105
- await accountInfoChanged?.()
105
+ await accountInfoChanged?.(userAccount)
106
106
  } catch (err) {
107
107
  console.error(err)
108
108
  await error?.({
@@ -138,7 +138,7 @@
138
138
  ) {
139
139
  userAccount.status = 'ACTIVE'
140
140
  userAccount.lockNotes = null
141
- await accountInfoChanged?.()
141
+ await accountInfoChanged?.(userAccount)
142
142
  }
143
143
  }
144
144
 
@@ -396,7 +396,7 @@
396
396
  userAccount.lockNotes = lockNotes
397
397
  try {
398
398
  await deactivateUser?.({ id: userAccount.id, lockNotes })
399
- await accountInfoChanged?.()
399
+ await accountInfoChanged?.(userAccount)
400
400
  } catch (err) {
401
401
  console.error(err)
402
402
  await error?.({
@@ -18,7 +18,7 @@ interface Props extends HTMLDivAttributes {
18
18
  heading: string;
19
19
  message: string;
20
20
  }) => void | Promise<void>) | undefined;
21
- accountInfoChanged?: (() => void | Promise<void>) | undefined;
21
+ accountInfoChanged?: ((userAccount: UserAccount) => void | Promise<void>) | undefined;
22
22
  sendPasswordRecoveryToken?: ComponentProps<typeof PasswordRecoveryModal>['sendPasswordRecoveryToken'];
23
23
  doSendPasswordRecoveryToken?: boolean;
24
24
  icon?: IconName;
@@ -67,6 +67,7 @@
67
67
  groupPermissionValueMap?: GroupPermissionValueMap
68
68
  permissionValueChange?: PermissionValueChangeFn
69
69
  userAccountInfo?: Snippet
70
+ userAccountFormFields?: Snippet
70
71
  siteAccess?: Snippet
71
72
  userGroupMembership?: Snippet
72
73
  permissionList?: Snippet
@@ -105,6 +106,7 @@
105
106
  groupPermissionValueMap = undefined,
106
107
  permissionValueChange = undefined,
107
108
  userAccountInfo,
109
+ userAccountFormFields,
108
110
  siteAccess,
109
111
  userGroupMembership,
110
112
  permissionList,
@@ -114,7 +116,15 @@
114
116
  </script>
115
117
 
116
118
  <div class="row">
117
- <div class="col-12 col-lg-4 mb-2">
119
+ <div
120
+ class={[
121
+ 'col-12 mb-2',
122
+ {
123
+ 'col-lg-4': showSiteAccess,
124
+ 'col-lg-8': !showSiteAccess,
125
+ },
126
+ ]}
127
+ >
118
128
  <UserAccountInfo
119
129
  {canToggleActive}
120
130
  {canEditAccountInfo}
@@ -132,6 +142,7 @@
132
142
  {confirmPasswordSet}
133
143
  {generateNewActivationPIN}
134
144
  {sendPasswordRecoveryToken}
145
+ formFields={userAccountFormFields}
135
146
  >
136
147
  {@render userAccountInfo?.()}
137
148
  </UserAccountInfo>
@@ -33,6 +33,7 @@ interface Props {
33
33
  groupPermissionValueMap?: GroupPermissionValueMap;
34
34
  permissionValueChange?: PermissionValueChangeFn;
35
35
  userAccountInfo?: Snippet;
36
+ userAccountFormFields?: Snippet;
36
37
  siteAccess?: Snippet;
37
38
  userGroupMembership?: Snippet;
38
39
  permissionList?: Snippet;
package/package.json CHANGED
@@ -1,6 +1,17 @@
1
1
  {
2
2
  "name": "@isoftdata/svelte-user-configuration",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
4
+ "scripts": {
5
+ "dev": "vite dev",
6
+ "build": "vite build && npm run package",
7
+ "preview": "vite preview",
8
+ "package": "svelte-kit sync && svelte-package && publint",
9
+ "prepublishOnly": "npm run package",
10
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
11
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
12
+ "lint": "prettier --check . && eslint .",
13
+ "format": "prettier --write ."
14
+ },
4
15
  "exports": {
5
16
  ".": {
6
17
  "types": "./dist/index.d.ts",
@@ -66,15 +77,5 @@
66
77
  },
67
78
  "engines": {
68
79
  "pnpm": "10.x"
69
- },
70
- "scripts": {
71
- "dev": "vite dev",
72
- "build": "vite build && npm run package",
73
- "preview": "vite preview",
74
- "package": "svelte-kit sync && svelte-package && publint",
75
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
76
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
77
- "lint": "prettier --check . && eslint .",
78
- "format": "prettier --write ."
79
80
  }
80
- }
81
+ }