@danxbot/ui 20.2.0 → 20.3.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/dist/index.js
CHANGED
|
@@ -50877,19 +50877,19 @@ function U9({
|
|
|
50877
50877
|
}) {
|
|
50878
50878
|
if (n === void 0 || e.roleId === void 0)
|
|
50879
50879
|
return /* @__PURE__ */ u(dt, { tone: "neutral", children: e.roleLabel });
|
|
50880
|
-
const r = new Set(n.ownPermissionKeys),
|
|
50881
|
-
const
|
|
50882
|
-
return { value:
|
|
50880
|
+
const r = new Set(n.ownPermissionKeys), s = (typeof n.roles == "function" ? n.roles(e) : n.roles).map((i) => {
|
|
50881
|
+
const a = NT(i, r, n.permissions);
|
|
50882
|
+
return { value: i.id, label: i.label, tone: "neutral", ...a === null ? {} : { refusal: a } };
|
|
50883
50883
|
});
|
|
50884
|
-
return
|
|
50884
|
+
return s.some((i) => i.value === e.roleId) || s.unshift({ value: e.roleId, label: e.roleLabel, tone: "neutral", refusal: "This role is not one you can assign here." }), /* @__PURE__ */ u(
|
|
50885
50885
|
zI,
|
|
50886
50886
|
{
|
|
50887
50887
|
value: e.roleId,
|
|
50888
|
-
options:
|
|
50888
|
+
options: s,
|
|
50889
50889
|
"aria-label": `Role of ${e.name}`,
|
|
50890
50890
|
disabled: t,
|
|
50891
|
-
onValueChange: (
|
|
50892
|
-
|
|
50891
|
+
onValueChange: (i) => {
|
|
50892
|
+
i !== e.roleId && n.onChange(e.id, i);
|
|
50893
50893
|
}
|
|
50894
50894
|
}
|
|
50895
50895
|
);
|