@vidispine/vdt-materialui 26.2.0-pre.2 → 26.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),d=require("react"),p=require("@material-ui/core"),E=require("@material-ui/lab"),P=require("@vidispine/vdt-api"),u={GROUP:"group",USER:"user"},D={ALL:"ALL",WRITE:"WRITE",READ:"READ",NONE:"NONE"},H=e=>({root:{},recipientRoot:{display:"flex",width:"100%"},recipientType:{flexGrow:1},actions:{display:"flex",alignItems:"center",padding:e.spacing(2),justifyContent:"flex-end",flex:"0 0 auto","& > :not(:first-child)":{marginLeft:e.spacing(2)}},actionsSubmit:{}}),M=(e,n)=>{switch(n.type){case"CHANGE_PERMISSION":return{...e,permission:n.value};case"CHANGE_RECIPIENT":return e[u.USER]!==void 0?{...e,[u.USER]:n.value}:e[u.GROUP]!==void 0?{...e,[u.GROUP]:n.value}:e;case"CHANGE_RECIPIENTTYPE":{const{[u.USER]:r,[u.GROUP]:s,...c}=e;return{...c,[n.value]:null}}default:throw new Error(`Unhandled action type: ${n.type}`)}},k=e=>{const[n,r]=d.useReducer(M,e),s=d.useCallback(o=>r({value:o,type:"CHANGE_PERMISSION"}),[]),c=d.useCallback(o=>r({value:o,type:"CHANGE_RECIPIENT"}),[]),i=d.useCallback(o=>r({value:o,type:"CHANGE_RECIPIENTTYPE"}),[]);return{accessControlDocument:n,onChangePermission:s,onChangeRecipient:c,onChangeRecipientType:i}};async function B({searchText:e,hideDefaultGroups:n}){const{data:{group:r=[]}}=await P.group.searchGroup({groupSearchDocument:{field:[{name:"groupname",value:e}]},queryParams:{number:100,role:!n}});return n?r.map(s=>({groupName:s.groupName})).filter(s=>!s.groupName.startsWith("_")):r.map(s=>({groupName:s.groupName}))}async function F({searchText:e,displayRealName:n=!0}){const{data:{user:r=[]}}=await P.user.searchUser({userSearchDocument:{operator:{field:[{name:"username",value:e},{name:"realname",value:e}],operation:"OR"}},queryParams:{number:100,ignoreCase:!0}});return r.map(s=>({userName:s.userName,...n&&{realName:s.realName}}))}function U({onSearch:e,onChange:n,displayRealName:r=!0,label:s,hideDefaultGroups:c}){const[i,o]=d.useState([]),[v,R]=d.useState(""),[x,C]=d.useState(null),g=d.useCallback(a=>{e({searchText:a,hideDefaultGroups:c,displayRealName:r}).then(o)},[e,c,r]),N=(a,l,m)=>{R(l),m==="input"&&g(l)},j=(a,l)=>{const{groupName:m,userName:y}=l||{};C(l),n(l?y||m:null)};d.useEffect(()=>{g("")},[g]);const S=E.createFilterOptions({stringify:a=>a.groupName?a.groupName:a.realName+a.userName});return t.jsx(E.Autocomplete,{value:x,inputValue:v,options:i,filterOptions:S,onChange:j,onInputChange:N,renderInput:a=>t.jsx(p.TextField,{...a,label:s,variant:"outlined"}),getOptionLabel:({realName:a,userName:l,groupName:m})=>r&&a||l||m})}function W({value:e,label:n,onChange:r,choices:s=D,selected:c}){return t.jsxs(p.FormControl,{margin:"normal",fullWidth:!0,children:[t.jsx(p.FormLabel,{children:n}),t.jsx(p.RadioGroup,{value:e,onChange:i=>r(i.target.value),children:Object.entries(s).map(([i,o])=>t.jsx(p.FormControlLabel,{value:i,control:t.jsx(p.Radio,{}),label:o,disabled:!c},i))})]})}function Y({onChange:e,value:n,userText:r,groupText:s}){const c=(i,o)=>{o!==null&&e(o)};return t.jsxs(E.ToggleButtonGroup,{value:n,exclusive:!0,onChange:c,children:[t.jsx(E.ToggleButton,{value:u.USER,children:r}),t.jsx(E.ToggleButton,{value:u.GROUP,children:s})]})}function V({classes:e,entityType:n,entityId:r,onSuccess:s=()=>{},onError:c=()=>{},onSubmit:i=P.access.createEntityAccess,onCancel:o,initialAccessControlDocument:v={user:null},UserPickerComponent:R=U,UserPickerProps:x={},GroupPickerComponent:C=U,GroupPickerProps:g={},PermissionPickerComponent:N=W,PermissionPickerProps:j,RecipientTypePickerComponent:S=Y,RecipientTypePickerProps:a,permissionText:l="Permission",grantAccessText:m="Grant Access",userText:y="User",groupText:A="Group",searchText:b="Search",cancelText:G="Cancel",hideDefaultGroups:T=!0}){const{accessControlDocument:h,onChangePermission:_,onChangeRecipient:I,onChangeRecipientType:L}=k(v),q=()=>Promise.resolve(i({entityType:n,entityId:r,accessControlDocument:h})).then(s).catch(c),{permission:O=""}=h,f=d.useMemo(()=>{if(h[u.USER]!==void 0)return u.USER;if(h[u.GROUP]!==void 0)return u.GROUP},[h]),[w]=Object.values(h);return t.jsxs("div",{className:e.root,children:[t.jsxs("div",{className:e.recipientRoot,children:[S?t.jsx(S,{value:f,onChange:L,userText:y,groupText:A,...a}):null,t.jsxs("div",{className:e.recipientType,children:[R&&f===u.USER?t.jsx(R,{onSearch:F,onChange:I,label:b,...x}):null,C&&f===u.GROUP?t.jsx(C,{onSearch:B,onChange:I,label:b,...g,hideDefaultGroups:T}):null]})]}),N?t.jsx(N,{value:O,onChange:_,selected:w,label:l,...j}):null,t.jsxs("div",{className:e.actions,children:[o?t.jsx(p.Button,{className:e.actionsCancel,onClick:o,children:G}):null,t.jsx(p.Button,{className:e.actionsSubmit,onClick:q,disabled:!h[f]||!O,variant:"outlined",color:"primary",children:m})]})]})}const $=p.withStyles(H,{name:"VdtEntityAccessEdit"})(V);exports.default=$;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),d=require("react"),p=require("@material-ui/core"),E=require("@material-ui/lab"),b=require("@vidispine/vdt-api"),c={GROUP:"group",USER:"user"},D={ALL:"ALL",WRITE:"WRITE",READ:"READ",NONE:"NONE"},H=e=>({root:{},recipientRoot:{display:"flex",width:"100%"},recipientType:{flexGrow:1},actions:{display:"flex",alignItems:"center",padding:e.spacing(2),justifyContent:"flex-end",flex:"0 0 auto","& > :not(:first-child)":{marginLeft:e.spacing(2)}},actionsSubmit:{}}),M=(e,n)=>{switch(n.type){case"CHANGE_PERMISSION":return{...e,permission:n.value};case"CHANGE_RECIPIENT":return e[c.USER]!==void 0?{...e,[c.USER]:n.value}:e[c.GROUP]!==void 0?{...e,[c.GROUP]:n.value}:e;case"CHANGE_RECIPIENTTYPE":{const{[c.USER]:r,[c.GROUP]:o,...s}=e;return{...s,[n.value]:null}}default:throw new Error(`Unhandled action type: ${n.type}`)}},k=e=>{const[n,r]=d.useReducer(M,e),o=d.useCallback(a=>r({value:a,type:"CHANGE_PERMISSION"}),[]),s=d.useCallback(a=>r({value:a,type:"CHANGE_RECIPIENT"}),[]),i=d.useCallback(a=>r({value:a,type:"CHANGE_RECIPIENTTYPE"}),[]);return{accessControlDocument:n,onChangePermission:o,onChangeRecipient:s,onChangeRecipientType:i}};async function B({searchText:e,hideDefaultGroups:n,searchOperator:r}){const{data:{group:o=[]}}=await b.group.searchGroup({groupSearchDocument:{field:[{name:"groupname",value:e}],...r?{operator:r}:{}},queryParams:{number:100,role:!n}});return n?o.map(s=>({groupName:s.groupName})).filter(s=>!s.groupName.startsWith("_")):o.map(s=>({groupName:s.groupName}))}async function F({searchText:e,displayRealName:n=!0}){const{data:{user:r=[]}}=await b.user.searchUser({userSearchDocument:{operator:{field:[{name:"username",value:e},{name:"realname",value:e}],operation:"OR"}},queryParams:{number:100,ignoreCase:!0}});return r.map(o=>({userName:o.userName,...n&&{realName:o.realName}}))}function A({onSearch:e,onChange:n,displayRealName:r=!0,label:o,hideDefaultGroups:s,searchOperator:i}){const[a,f]=d.useState([]),[R,v]=d.useState(""),[C,x]=d.useState(null),h=d.useCallback(u=>{e({searchText:u,hideDefaultGroups:s,displayRealName:r,searchOperator:i}).then(f)},[e,s,r,i]),j=(u,l,m)=>{v(l),m==="input"&&h(l)},N=(u,l)=>{const{groupName:m,userName:P}=l||{};x(l),n(l?P||m:null)};d.useEffect(()=>{h("")},[h]);const y=E.createFilterOptions({stringify:u=>u.groupName?u.groupName:u.realName+u.userName});return t.jsx(E.Autocomplete,{value:C,inputValue:R,options:a,filterOptions:y,onChange:N,onInputChange:j,renderInput:u=>t.jsx(p.TextField,{...u,label:o,variant:"outlined"}),getOptionLabel:({realName:u,userName:l,groupName:m})=>r&&u||l||m})}function W({value:e,label:n,onChange:r,choices:o=D,selected:s}){return t.jsxs(p.FormControl,{margin:"normal",fullWidth:!0,children:[t.jsx(p.FormLabel,{children:n}),t.jsx(p.RadioGroup,{value:e,onChange:i=>r(i.target.value),children:Object.entries(o).map(([i,a])=>t.jsx(p.FormControlLabel,{value:i,control:t.jsx(p.Radio,{}),label:a,disabled:!s},i))})]})}function Y({onChange:e,value:n,userText:r,groupText:o}){const s=(i,a)=>{a!==null&&e(a)};return t.jsxs(E.ToggleButtonGroup,{value:n,exclusive:!0,onChange:s,children:[t.jsx(E.ToggleButton,{value:c.USER,children:r}),t.jsx(E.ToggleButton,{value:c.GROUP,children:o})]})}function V({classes:e,entityType:n,entityId:r,onSuccess:o=()=>{},onError:s=()=>{},onSubmit:i=b.access.createEntityAccess,onCancel:a,initialAccessControlDocument:f={user:null},UserPickerComponent:R=A,UserPickerProps:v={},GroupPickerComponent:C=A,GroupPickerProps:x={},PermissionPickerComponent:h=W,PermissionPickerProps:j,RecipientTypePickerComponent:N=Y,RecipientTypePickerProps:y,permissionText:u="Permission",grantAccessText:l="Grant Access",userText:m="User",groupText:P="Group",searchText:I="Search",cancelText:G="Cancel",hideDefaultGroups:T=!0}){const{accessControlDocument:g,onChangePermission:_,onChangeRecipient:O,onChangeRecipientType:L}=k(f),q=()=>Promise.resolve(i({entityType:n,entityId:r,accessControlDocument:g})).then(o).catch(s),{permission:U=""}=g,S=d.useMemo(()=>{if(g[c.USER]!==void 0)return c.USER;if(g[c.GROUP]!==void 0)return c.GROUP},[g]),[w]=Object.values(g);return t.jsxs("div",{className:e.root,children:[t.jsxs("div",{className:e.recipientRoot,children:[N?t.jsx(N,{value:S,onChange:L,userText:m,groupText:P,...y}):null,t.jsxs("div",{className:e.recipientType,children:[R&&S===c.USER?t.jsx(R,{onSearch:F,onChange:O,label:I,...v}):null,C&&S===c.GROUP?t.jsx(C,{onSearch:B,onChange:O,label:I,...x,hideDefaultGroups:T}):null]})]}),h?t.jsx(h,{value:U,onChange:_,selected:w,label:u,...j}):null,t.jsxs("div",{className:e.actions,children:[a?t.jsx(p.Button,{className:e.actionsCancel,onClick:a,children:G}):null,t.jsx(p.Button,{className:e.actionsSubmit,onClick:q,disabled:!g[S]||!U,variant:"outlined",color:"primary",children:l})]})]})}const $=p.withStyles(H,{name:"VdtEntityAccessEdit"})(V);exports.default=$;
@@ -1,7 +1,7 @@
1
- import { jsxs as d, jsx as i } from "react/jsx-runtime";
2
- import { useMemo as F, useReducer as M, useCallback as f, useState as I, useEffect as W } from "react";
3
- import { withStyles as $, Button as b, TextField as B, FormControl as Y, FormLabel as k, RadioGroup as q, FormControlLabel as V, Radio as z } from "@material-ui/core";
4
- import { createFilterOptions as J, Autocomplete as K, ToggleButtonGroup as Q, ToggleButton as A } from "@material-ui/lab";
1
+ import { jsxs as h, jsx as u } from "react/jsx-runtime";
2
+ import { useMemo as F, useReducer as M, useCallback as N, useState as U, useEffect as W } from "react";
3
+ import { withStyles as $, Button as A, TextField as B, FormControl as Y, FormLabel as k, RadioGroup as q, FormControlLabel as V, Radio as z } from "@material-ui/core";
4
+ import { createFilterOptions as J, Autocomplete as K, ToggleButtonGroup as Q, ToggleButton as T } from "@material-ui/lab";
5
5
  import { access as X, group as Z, user as ee } from "@vidispine/vdt-api";
6
6
  const c = {
7
7
  GROUP: "group",
@@ -11,7 +11,7 @@ const c = {
11
11
  WRITE: "WRITE",
12
12
  READ: "READ",
13
13
  NONE: "NONE"
14
- }, re = (e) => ({
14
+ }, te = (e) => ({
15
15
  root: {},
16
16
  recipientRoot: {
17
17
  display: "flex",
@@ -31,52 +31,53 @@ const c = {
31
31
  }
32
32
  },
33
33
  actionsSubmit: {}
34
- }), te = (e, n) => {
34
+ }), re = (e, n) => {
35
35
  switch (n.type) {
36
36
  case "CHANGE_PERMISSION":
37
37
  return { ...e, permission: n.value };
38
38
  case "CHANGE_RECIPIENT":
39
39
  return e[c.USER] !== void 0 ? { ...e, [c.USER]: n.value } : e[c.GROUP] !== void 0 ? { ...e, [c.GROUP]: n.value } : e;
40
40
  case "CHANGE_RECIPIENTTYPE": {
41
- const { [c.USER]: r, [c.GROUP]: t, ...u } = e;
42
- return { ...u, [n.value]: null };
41
+ const { [c.USER]: t, [c.GROUP]: o, ...r } = e;
42
+ return { ...r, [n.value]: null };
43
43
  }
44
44
  default:
45
45
  throw new Error(`Unhandled action type: ${n.type}`);
46
46
  }
47
47
  }, oe = (e) => {
48
- const [n, r] = M(te, e), t = f(
49
- (o) => r({ value: o, type: "CHANGE_PERMISSION" }),
48
+ const [n, t] = M(re, e), o = N(
49
+ (a) => t({ value: a, type: "CHANGE_PERMISSION" }),
50
50
  []
51
- ), u = f(
52
- (o) => r({ value: o, type: "CHANGE_RECIPIENT" }),
51
+ ), r = N(
52
+ (a) => t({ value: a, type: "CHANGE_RECIPIENT" }),
53
53
  []
54
- ), s = f(
55
- (o) => r({ value: o, type: "CHANGE_RECIPIENTTYPE" }),
54
+ ), s = N(
55
+ (a) => t({ value: a, type: "CHANGE_RECIPIENTTYPE" }),
56
56
  []
57
57
  );
58
58
  return {
59
59
  accessControlDocument: n,
60
- onChangePermission: t,
61
- onChangeRecipient: u,
60
+ onChangePermission: o,
61
+ onChangeRecipient: r,
62
62
  onChangeRecipientType: s
63
63
  };
64
64
  };
65
- async function ae({ searchText: e, hideDefaultGroups: n }) {
65
+ async function ae({ searchText: e, hideDefaultGroups: n, searchOperator: t }) {
66
66
  const {
67
- data: { group: r = [] }
67
+ data: { group: o = [] }
68
68
  } = await Z.searchGroup({
69
69
  groupSearchDocument: {
70
- field: [{ name: "groupname", value: e }]
70
+ field: [{ name: "groupname", value: e }],
71
+ ...t ? { operator: t } : {}
71
72
  },
72
73
  // Doesn't have ignoreCase param
73
74
  queryParams: { number: 100, role: !n }
74
75
  });
75
- return n ? r.map((t) => ({ groupName: t.groupName })).filter((t) => !t.groupName.startsWith("_")) : r.map((t) => ({ groupName: t.groupName }));
76
+ return n ? o.map((r) => ({ groupName: r.groupName })).filter((r) => !r.groupName.startsWith("_")) : o.map((r) => ({ groupName: r.groupName }));
76
77
  }
77
78
  async function ie({ searchText: e, displayRealName: n = !0 }) {
78
79
  const {
79
- data: { user: r = [] }
80
+ data: { user: t = [] }
80
81
  } = await ee.searchUser({
81
82
  userSearchDocument: {
82
83
  operator: {
@@ -95,172 +96,173 @@ async function ie({ searchText: e, displayRealName: n = !0 }) {
95
96
  },
96
97
  queryParams: { number: 100, ignoreCase: !0 }
97
98
  });
98
- return r.map((t) => ({
99
- userName: t.userName,
100
- ...n && { realName: t.realName }
99
+ return t.map((o) => ({
100
+ userName: o.userName,
101
+ ...n && { realName: o.realName }
101
102
  }));
102
103
  }
103
- function T({
104
+ function _({
104
105
  onSearch: e,
105
106
  onChange: n,
106
- displayRealName: r = !0,
107
- label: t,
108
- hideDefaultGroups: u
107
+ displayRealName: t = !0,
108
+ label: o,
109
+ hideDefaultGroups: r,
110
+ searchOperator: s
109
111
  }) {
110
- const [s, o] = I([]), [S, g] = I(""), [v, E] = I(null), h = f(
111
- (a) => {
112
- e({ searchText: a, hideDefaultGroups: u, displayRealName: r }).then(o);
112
+ const [a, f] = U([]), [g, S] = U(""), [E, v] = U(null), d = N(
113
+ (i) => {
114
+ e({ searchText: i, hideDefaultGroups: r, displayRealName: t, searchOperator: s }).then(f);
113
115
  },
114
- [e, u, r]
115
- ), R = (a, l, m) => {
116
- g(l), m === "input" && h(l);
117
- }, y = (a, l) => {
118
- const { groupName: m, userName: P } = l || {};
119
- E(l), n(l ? P || m : null);
116
+ [e, r, t, s]
117
+ ), y = (i, l, m) => {
118
+ S(l), m === "input" && d(l);
119
+ }, R = (i, l) => {
120
+ const { groupName: m, userName: I } = l || {};
121
+ v(l), n(l ? I || m : null);
120
122
  };
121
123
  W(() => {
122
- h("");
123
- }, [h]);
124
- const C = J({
125
- stringify: (a) => a.groupName ? a.groupName : a.realName + a.userName
124
+ d("");
125
+ }, [d]);
126
+ const P = J({
127
+ stringify: (i) => i.groupName ? i.groupName : i.realName + i.userName
126
128
  });
127
- return /* @__PURE__ */ i(
129
+ return /* @__PURE__ */ u(
128
130
  K,
129
131
  {
130
- value: v,
131
- inputValue: S,
132
- options: s,
133
- filterOptions: C,
134
- onChange: y,
135
- onInputChange: R,
136
- renderInput: (a) => /* @__PURE__ */ i(B, { ...a, label: t, variant: "outlined" }),
137
- getOptionLabel: ({ realName: a, userName: l, groupName: m }) => r && a || l || m
132
+ value: E,
133
+ inputValue: g,
134
+ options: a,
135
+ filterOptions: P,
136
+ onChange: R,
137
+ onInputChange: y,
138
+ renderInput: (i) => /* @__PURE__ */ u(B, { ...i, label: o, variant: "outlined" }),
139
+ getOptionLabel: ({ realName: i, userName: l, groupName: m }) => t && i || l || m
138
140
  }
139
141
  );
140
142
  }
141
- function ce({ value: e, label: n, onChange: r, choices: t = ne, selected: u }) {
142
- return /* @__PURE__ */ d(Y, { margin: "normal", fullWidth: !0, children: [
143
- /* @__PURE__ */ i(k, { children: n }),
144
- /* @__PURE__ */ i(q, { value: e, onChange: (s) => r(s.target.value), children: Object.entries(t).map(([s, o]) => /* @__PURE__ */ i(
143
+ function ue({ value: e, label: n, onChange: t, choices: o = ne, selected: r }) {
144
+ return /* @__PURE__ */ h(Y, { margin: "normal", fullWidth: !0, children: [
145
+ /* @__PURE__ */ u(k, { children: n }),
146
+ /* @__PURE__ */ u(q, { value: e, onChange: (s) => t(s.target.value), children: Object.entries(o).map(([s, a]) => /* @__PURE__ */ u(
145
147
  V,
146
148
  {
147
149
  value: s,
148
- control: /* @__PURE__ */ i(z, {}),
149
- label: o,
150
- disabled: !u
150
+ control: /* @__PURE__ */ u(z, {}),
151
+ label: a,
152
+ disabled: !r
151
153
  },
152
154
  s
153
155
  )) })
154
156
  ] });
155
157
  }
156
- function ue({ onChange: e, value: n, userText: r, groupText: t }) {
157
- return /* @__PURE__ */ d(Q, { value: n, exclusive: !0, onChange: (s, o) => {
158
- o !== null && e(o);
158
+ function ce({ onChange: e, value: n, userText: t, groupText: o }) {
159
+ return /* @__PURE__ */ h(Q, { value: n, exclusive: !0, onChange: (s, a) => {
160
+ a !== null && e(a);
159
161
  }, children: [
160
- /* @__PURE__ */ i(A, { value: c.USER, children: r }),
161
- /* @__PURE__ */ i(A, { value: c.GROUP, children: t })
162
+ /* @__PURE__ */ u(T, { value: c.USER, children: t }),
163
+ /* @__PURE__ */ u(T, { value: c.GROUP, children: o })
162
164
  ] });
163
165
  }
164
166
  function se({
165
167
  classes: e,
166
168
  entityType: n,
167
- entityId: r,
168
- onSuccess: t = () => {
169
+ entityId: t,
170
+ onSuccess: o = () => {
169
171
  },
170
- onError: u = () => {
172
+ onError: r = () => {
171
173
  },
172
174
  onSubmit: s = X.createEntityAccess,
173
- onCancel: o,
174
- initialAccessControlDocument: S = { user: null },
175
- UserPickerComponent: g = T,
176
- UserPickerProps: v = {},
177
- GroupPickerComponent: E = T,
178
- GroupPickerProps: h = {},
179
- PermissionPickerComponent: R = ce,
175
+ onCancel: a,
176
+ initialAccessControlDocument: f = { user: null },
177
+ UserPickerComponent: g = _,
178
+ UserPickerProps: S = {},
179
+ GroupPickerComponent: E = _,
180
+ GroupPickerProps: v = {},
181
+ PermissionPickerComponent: d = ue,
180
182
  PermissionPickerProps: y,
181
- RecipientTypePickerComponent: C = ue,
182
- RecipientTypePickerProps: a,
183
- permissionText: l = "Permission",
184
- grantAccessText: m = "Grant Access",
185
- userText: P = "User",
186
- groupText: _ = "Group",
187
- searchText: O = "Search",
183
+ RecipientTypePickerComponent: R = ce,
184
+ RecipientTypePickerProps: P,
185
+ permissionText: i = "Permission",
186
+ grantAccessText: l = "Grant Access",
187
+ userText: m = "User",
188
+ groupText: I = "Group",
189
+ searchText: G = "Search",
188
190
  cancelText: x = "Cancel",
189
191
  hideDefaultGroups: L = !0
190
192
  }) {
191
- const { accessControlDocument: p, onChangePermission: w, onChangeRecipient: U, onChangeRecipientType: D } = oe(S), H = () => Promise.resolve(
193
+ const { accessControlDocument: p, onChangePermission: w, onChangeRecipient: O, onChangeRecipientType: D } = oe(f), H = () => Promise.resolve(
192
194
  s({
193
195
  entityType: n,
194
- entityId: r,
196
+ entityId: t,
195
197
  accessControlDocument: p
196
198
  })
197
- ).then(t).catch(u), { permission: G = "" } = p, N = F(() => {
199
+ ).then(o).catch(r), { permission: b = "" } = p, C = F(() => {
198
200
  if (p[c.USER] !== void 0)
199
201
  return c.USER;
200
202
  if (p[c.GROUP] !== void 0)
201
203
  return c.GROUP;
202
204
  }, [p]), [j] = Object.values(p);
203
- return /* @__PURE__ */ d("div", { className: e.root, children: [
204
- /* @__PURE__ */ d("div", { className: e.recipientRoot, children: [
205
- C ? /* @__PURE__ */ i(
206
- C,
205
+ return /* @__PURE__ */ h("div", { className: e.root, children: [
206
+ /* @__PURE__ */ h("div", { className: e.recipientRoot, children: [
207
+ R ? /* @__PURE__ */ u(
208
+ R,
207
209
  {
208
- value: N,
210
+ value: C,
209
211
  onChange: D,
210
- userText: P,
211
- groupText: _,
212
- ...a
212
+ userText: m,
213
+ groupText: I,
214
+ ...P
213
215
  }
214
216
  ) : null,
215
- /* @__PURE__ */ d("div", { className: e.recipientType, children: [
216
- g && N === c.USER ? /* @__PURE__ */ i(
217
+ /* @__PURE__ */ h("div", { className: e.recipientType, children: [
218
+ g && C === c.USER ? /* @__PURE__ */ u(
217
219
  g,
218
220
  {
219
221
  onSearch: ie,
220
- onChange: U,
221
- label: O,
222
- ...v
222
+ onChange: O,
223
+ label: G,
224
+ ...S
223
225
  }
224
226
  ) : null,
225
- E && N === c.GROUP ? /* @__PURE__ */ i(
227
+ E && C === c.GROUP ? /* @__PURE__ */ u(
226
228
  E,
227
229
  {
228
230
  onSearch: ae,
229
- onChange: U,
230
- label: O,
231
- ...h,
231
+ onChange: O,
232
+ label: G,
233
+ ...v,
232
234
  hideDefaultGroups: L
233
235
  }
234
236
  ) : null
235
237
  ] })
236
238
  ] }),
237
- R ? /* @__PURE__ */ i(
238
- R,
239
+ d ? /* @__PURE__ */ u(
240
+ d,
239
241
  {
240
- value: G,
242
+ value: b,
241
243
  onChange: w,
242
244
  selected: j,
243
- label: l,
245
+ label: i,
244
246
  ...y
245
247
  }
246
248
  ) : null,
247
- /* @__PURE__ */ d("div", { className: e.actions, children: [
248
- o ? /* @__PURE__ */ i(b, { className: e.actionsCancel, onClick: o, children: x }) : null,
249
- /* @__PURE__ */ i(
250
- b,
249
+ /* @__PURE__ */ h("div", { className: e.actions, children: [
250
+ a ? /* @__PURE__ */ u(A, { className: e.actionsCancel, onClick: a, children: x }) : null,
251
+ /* @__PURE__ */ u(
252
+ A,
251
253
  {
252
254
  className: e.actionsSubmit,
253
255
  onClick: H,
254
- disabled: !p[N] || !G,
256
+ disabled: !p[C] || !b,
255
257
  variant: "outlined",
256
258
  color: "primary",
257
- children: m
259
+ children: l
258
260
  }
259
261
  )
260
262
  ] })
261
263
  ] });
262
264
  }
263
- const ge = $(re, { name: "VdtEntityAccessEdit" })(se);
265
+ const ge = $(te, { name: "VdtEntityAccessEdit" })(se);
264
266
  export {
265
267
  ge as default
266
268
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vidispine/vdt-materialui",
3
- "version": "26.2.0-pre.2",
3
+ "version": "26.2.1",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -36,11 +36,11 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@babel/runtime": "7.26.10",
39
- "@vidispine/proptypes": "26.2.0-pre.2",
40
- "@vidispine/vdt-api": "26.2.0-pre.2",
41
- "@vidispine/vdt-js": "26.2.0-pre.2",
42
- "@vidispine/vdt-react": "26.2.0-pre.2",
43
- "@vidispine/vdt-videojs-react": "26.2.0-pre.2",
39
+ "@vidispine/proptypes": "26.2.1",
40
+ "@vidispine/vdt-api": "26.2.1",
41
+ "@vidispine/vdt-js": "26.2.1",
42
+ "@vidispine/vdt-react": "26.2.1",
43
+ "@vidispine/vdt-videojs-react": "26.2.1",
44
44
  "clsx": "1.2.1",
45
45
  "filesize": "10.1.0",
46
46
  "final-form": "4.20.10",
@@ -74,11 +74,11 @@
74
74
  "@material-ui/icons": "4.11.3",
75
75
  "@material-ui/lab": "4.0.0-alpha.61",
76
76
  "@types/jest": "29.5.11",
77
- "@vidispine/eslint-config-mdx": "26.2.0-pre.2",
78
- "@vidispine/eslint-config-react": "26.2.0-pre.2",
79
- "@vidispine/eslint-config-storybook": "26.2.0-pre.2",
80
- "@vidispine/prettier-config": "26.2.0-pre.2",
81
- "@vidispine/proptypes": "26.2.0-pre.2",
77
+ "@vidispine/eslint-config-mdx": "26.2.1",
78
+ "@vidispine/eslint-config-react": "26.2.1",
79
+ "@vidispine/eslint-config-storybook": "26.2.1",
80
+ "@vidispine/prettier-config": "26.2.1",
81
+ "@vidispine/proptypes": "26.2.1",
82
82
  "@vitejs/plugin-react": "4.2.1",
83
83
  "@wojtekmaj/enzyme-adapter-react-17": "0.8.0",
84
84
  "axios": "1.13.5",