@isoftdata/svelte-user-configuration 2.3.1 → 2.3.3

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.
@@ -46,6 +46,7 @@
46
46
  permissionValueMap: PermissionValueMap
47
47
  groupPermissionValueMap?: PermissionValueMap | undefined
48
48
  children?: Snippet
49
+ permissionTranslationNamespace?: string
49
50
  }
50
51
 
51
52
  let {
@@ -58,6 +59,7 @@
58
59
  permissionValueMap = $bindable(new SvelteMap()),
59
60
  groupPermissionValueMap = undefined,
60
61
  children,
62
+ permissionTranslationNamespace = 'permissions',
61
63
  ...rest
62
64
  }: Props = $props()
63
65
 
@@ -139,8 +141,14 @@
139
141
 
140
142
  return {
141
143
  ...permission,
142
- displayName: translate(`permissions:${camelCase(permission.codeName)}.displayName`, permission.displayName),
143
- category: translate(`permissions:categories.${camelCase(permission.category)}`, permission.category),
144
+ displayName: translate(
145
+ `${permissionTranslationNamespace}:${camelCase(permission.codeName)}.displayName`,
146
+ permission.displayName,
147
+ ),
148
+ category: translate(
149
+ `${permissionTranslationNamespace}:categories.${camelCase(permission.category)}`,
150
+ permission.category,
151
+ ),
144
152
  value,
145
153
  groupValue,
146
154
  computedValue:
@@ -18,6 +18,7 @@ declare const PermissionList: import("svelte").Component<HTMLDivAttributes & {
18
18
  permissionValueMap: Map<number, "NONE" | "SITE" | "GLOBAL">;
19
19
  groupPermissionValueMap?: Map<number, "NONE" | "SITE" | "GLOBAL"> | undefined;
20
20
  children?: Snippet;
21
+ permissionTranslationNamespace?: string;
21
22
  }, {}, "permissionValueMap">;
22
23
  type PermissionList = ReturnType<typeof PermissionList>;
23
24
  export default PermissionList;
@@ -346,7 +346,7 @@
346
346
  {@render children?.()}
347
347
  </div>
348
348
  <div class="card-footer">
349
- {#if !myAccountMode}
349
+ {#if !myAccountMode && sendPasswordRecoveryToken}
350
350
  <Button
351
351
  size="sm"
352
352
  outline
@@ -64,6 +64,7 @@
64
64
  groupMembershipChange?: GroupMembershipChangeFn
65
65
  permissions: Permissions
66
66
  permissionValueMap?: PermissionValueMap
67
+ permissionTranslationNamespace?: string
67
68
  groupPermissionValueMap?: GroupPermissionValueMap
68
69
  permissionValueChange?: PermissionValueChangeFn
69
70
  userAccountInfo?: Snippet
@@ -80,6 +81,7 @@
80
81
  permissionListIcon = 'user-lock',
81
82
  userSiteAccessIcon = 'industry-windows',
82
83
  permissionListCardHeaderTitle = 'Permissions',
84
+ permissionTranslationNamespace,
83
85
  usernameInput = $bindable(undefined),
84
86
  userAccount = $bindable(),
85
87
  canToggleActive = true,
@@ -178,6 +180,7 @@
178
180
  <PermissionList
179
181
  {siteLabel}
180
182
  {permissions}
183
+ {permissionTranslationNamespace}
181
184
  enableSiteScope={showSiteAccess}
182
185
  {permissionValueMap}
183
186
  {groupPermissionValueMap}
@@ -30,6 +30,7 @@ interface Props {
30
30
  groupMembershipChange?: GroupMembershipChangeFn;
31
31
  permissions: Permissions;
32
32
  permissionValueMap?: PermissionValueMap;
33
+ permissionTranslationNamespace?: string;
33
34
  groupPermissionValueMap?: GroupPermissionValueMap;
34
35
  permissionValueChange?: PermissionValueChangeFn;
35
36
  userAccountInfo?: Snippet;
package/dist/util.d.ts CHANGED
@@ -52,7 +52,7 @@ export type PermissionValueMap = ComponentProps<typeof PermissionList>['permissi
52
52
  export type GroupPermissionValueMap = ComponentProps<typeof PermissionList>['groupPermissionValueMap'];
53
53
  export type PermissionValueChangeFn = ComponentProps<typeof PermissionList>['permissionValueChange'];
54
54
  export type PermissionListCardHeaderTitle = ComponentProps<typeof PermissionList>['cardHeaderTitle'];
55
- /** Returns a Map where the key is the `permissioniId` and the value is the highest permission level for the given group membership
55
+ /** Returns a Map where the key is the `permissionId` and the value is the highest permission level for the given group membership
56
56
  *
57
57
  * You'll probably want to call this in your code when the group membership changes, and pass the result to the `groupPermissionValueMap` prop of the `PermissionList` component.
58
58
  */
package/dist/util.js CHANGED
@@ -9,7 +9,7 @@ export const valueRank = {
9
9
  SITE: 1,
10
10
  GLOBAL: 2,
11
11
  };
12
- /** Returns a Map where the key is the `permissioniId` and the value is the highest permission level for the given group membership
12
+ /** Returns a Map where the key is the `permissionId` and the value is the highest permission level for the given group membership
13
13
  *
14
14
  * You'll probably want to call this in your code when the group membership changes, and pass the result to the `groupPermissionValueMap` prop of the `PermissionList` component.
15
15
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isoftdata/svelte-user-configuration",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/index.d.ts",