@edifice.io/react 2.5.16-develop-pedago.20260413164323 → 2.5.16-develop-pedago.20260414153809
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.
|
@@ -21,7 +21,7 @@ const UserRightsBookmarkRow = ({
|
|
|
21
21
|
return /* @__PURE__ */ jsxs("tr", { "data-testid": "user-rights-list-bookmark-row", children: [
|
|
22
22
|
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(SvgIconBookmark, {}) }),
|
|
23
23
|
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Button, { color: "tertiary", variant: "ghost", className: "fw-normal ps-0", "aria-expanded": bookmark.isExpanded, rightIcon: /* @__PURE__ */ jsx(SvgIconRafterDown, { title: bookmark.isExpanded ? t("hide") : t("show"), className: "w-16 min-w-0", style: getRotateTransitionStyle(bookmark.isExpanded) }), onClick: () => onToggleExpand(bookmark.id), children: bookmark.name }) }),
|
|
24
|
-
Object.entries(resourceRights).map(([rightName]) => /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Checkbox, { checked: bookmark.permission.includes(rightName), onChange: () => onToggleRight(bookmark.id, rightName), disabled: isReadOnly, "aria-label": `${bookmark.name} - ${rightName}`, "data-testid": `user-rights-list-bookmark-${rightName}-checkbox` }) }, rightName)),
|
|
24
|
+
Object.entries(resourceRights).map(([rightName, rightDef]) => /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Checkbox, { checked: bookmark.permission.includes(rightName), onChange: () => onToggleRight(bookmark.id, rightName), disabled: isReadOnly || rightDef.isReadOnlyCheckbox, "aria-label": `${bookmark.name} - ${rightName}`, "data-testid": `user-rights-list-bookmark-${rightName}-checkbox` }) }, rightName)),
|
|
25
25
|
/* @__PURE__ */ jsx("td", { children: !isReadOnly && /* @__PURE__ */ jsx(IconButton, { "data-testid": "user-rights-list-bookmark-close-button", color: "tertiary", onClick: () => onDelete(bookmark.id), icon: /* @__PURE__ */ jsx(SvgIconClose, {}), title: `${t("close")} ${bookmark.name}`, variant: "ghost" }) })
|
|
26
26
|
] });
|
|
27
27
|
};
|
|
@@ -27,7 +27,7 @@ const UserRightsItem = ({
|
|
|
27
27
|
return /* @__PURE__ */ jsxs("tr", { "data-testid": "user-rights-list-item-row", className: rowClassName, "aria-label": bookmarkName ? `${item.displayName} - ${bookmarkName}` : void 0, children: [
|
|
28
28
|
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsx(Avatar, { src: getAvatarURL(item.recipientId, item.recipientType), size: "xs", alt: item.displayName, variant: "circle" }) }),
|
|
29
29
|
/* @__PURE__ */ jsx("td", { children: item.displayName }),
|
|
30
|
-
Object.entries(resourceRights).map(([rightName]) => /* @__PURE__ */ jsx("td", { "data-testid": `user-rights-list-item-${rightName}-checkbox`, children: /* @__PURE__ */ jsx(Checkbox, { checked: item.permission.includes(rightName), onChange: () => handleChange(rightName), disabled: isReadOnly, "aria-label": `${item.displayName} - ${rightName}` }) }, rightName)),
|
|
30
|
+
Object.entries(resourceRights).map(([rightName, rightDef]) => /* @__PURE__ */ jsx("td", { "data-testid": `user-rights-list-item-${rightName}-checkbox`, children: /* @__PURE__ */ jsx(Checkbox, { checked: item.permission.includes(rightName), onChange: isReadOnly || rightDef.isReadOnlyCheckbox ? void 0 : () => handleChange(rightName), disabled: isReadOnly || rightDef.isReadOnlyCheckbox, "aria-label": `${item.displayName} - ${rightName}` }) }, rightName)),
|
|
31
31
|
/* @__PURE__ */ jsx("td", { children: !isReadOnly && isDeletable && /* @__PURE__ */ jsx(IconButton, { "data-testid": "user-rights-list-close-button", color: "tertiary", onClick: () => handleDeleteItem(), icon: /* @__PURE__ */ jsx(SvgIconClose, {}), title: `${t("close")} ${item.displayName}`, variant: "ghost", type: "button" }) })
|
|
32
32
|
] });
|
|
33
33
|
};
|
|
@@ -68,7 +68,7 @@ const UserRightsList = /* @__PURE__ */ forwardRef(({
|
|
|
68
68
|
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
69
69
|
/* @__PURE__ */ jsx("th", { scope: "col", className: "w-32", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("explorer.modal.share.avatar.shared.alt") }) }),
|
|
70
70
|
/* @__PURE__ */ jsx("th", { scope: "col", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("explorer.modal.share.search.placeholder") }) }),
|
|
71
|
-
Object.entries(resourceRights).map(([rightName]) => /* @__PURE__ */ jsx("th", { children: rightName }, rightName)),
|
|
71
|
+
Object.entries(resourceRights).map(([rightName, rightDef]) => /* @__PURE__ */ jsx("th", { children: rightDef.displayName ?? rightName }, rightName)),
|
|
72
72
|
!isReadOnly && /* @__PURE__ */ jsx("th", { scope: "col", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("close") }) })
|
|
73
73
|
] }) }),
|
|
74
74
|
/* @__PURE__ */ jsxs("tbody", { children: [
|
|
@@ -6,8 +6,13 @@ export type ResourceRightDefinition = {
|
|
|
6
6
|
default: boolean;
|
|
7
7
|
requires: ResourceRightName[];
|
|
8
8
|
excludes: ResourceRightName[];
|
|
9
|
+
displayName?: string;
|
|
10
|
+
isReadOnlyCheckbox?: boolean;
|
|
9
11
|
};
|
|
10
|
-
|
|
12
|
+
type AtLeastOne<T extends object> = Partial<T> & {
|
|
13
|
+
[K in keyof T]: Pick<T, K>;
|
|
14
|
+
}[keyof T];
|
|
15
|
+
export type ResourceRights = AtLeastOne<Record<ResourceRightName, ResourceRightDefinition>>;
|
|
11
16
|
export interface BookmarkUser {
|
|
12
17
|
id: string;
|
|
13
18
|
displayName: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.5.16-develop-pedago.
|
|
3
|
+
"version": "2.5.16-develop-pedago.20260414153809",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -135,9 +135,9 @@
|
|
|
135
135
|
"swiper": "^10.1.0",
|
|
136
136
|
"ua-parser-js": "^1.0.36",
|
|
137
137
|
"react-pdf": "10.2.0",
|
|
138
|
-
"@edifice.io/bootstrap": "2.5.16-develop-pedago.
|
|
139
|
-
"@edifice.io/tiptap-extensions": "2.5.16-develop-pedago.
|
|
140
|
-
"@edifice.io/utilities": "2.5.16-develop-pedago.
|
|
138
|
+
"@edifice.io/bootstrap": "2.5.16-develop-pedago.20260414153809",
|
|
139
|
+
"@edifice.io/tiptap-extensions": "2.5.16-develop-pedago.20260414153809",
|
|
140
|
+
"@edifice.io/utilities": "2.5.16-develop-pedago.20260414153809"
|
|
141
141
|
},
|
|
142
142
|
"devDependencies": {
|
|
143
143
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -168,8 +168,8 @@
|
|
|
168
168
|
"vite": "^5.4.11",
|
|
169
169
|
"vite-plugin-dts": "^4.1.0",
|
|
170
170
|
"vite-tsconfig-paths": "^5.0.1",
|
|
171
|
-
"@edifice.io/
|
|
172
|
-
"@edifice.io/
|
|
171
|
+
"@edifice.io/client": "2.5.16-develop-pedago.20260414153809",
|
|
172
|
+
"@edifice.io/config": "2.5.16-develop-pedago.20260414153809"
|
|
173
173
|
},
|
|
174
174
|
"peerDependencies": {
|
|
175
175
|
"@react-spring/web": "^9.7.5",
|