@vidispine/vdt-materialui 26.2.1 → 26.2.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.
- package/dist/cjs/collection/CollectionSearchPicker/CollectionSearchPicker.js +1 -1
- package/dist/cjs/search/SavedSearch/SavedSearch.js +1 -1
- package/dist/cjs/search/SavedSearch/SavedSearchList.js +1 -1
- package/dist/cjs/search/SavedSearchFolder/FolderRow.js +1 -1
- package/dist/es/collection/CollectionSearchPicker/CollectionSearchPicker.js +74 -67
- package/dist/es/search/SavedSearch/SavedSearch.js +51 -43
- package/dist/es/search/SavedSearch/SavedSearchList.js +40 -35
- package/dist/es/search/SavedSearchFolder/FolderRow.js +62 -58
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),d=require("react"),$=require("clsx"),e=require("prop-types"),h=require("@vidispine/vdt-react"),D=require("../../search/Pagination.js"),E=require("../../search/SearchInput/index.js"),V=require("../CollectionTable/index.js");function z({PaginationComponent:n=D.default,...a}){const{collectionListType:{hits:s=0}}=a;return o.jsx(n,{count:s,...a})}function A(n){const{isLoading:a}=n;return o.jsx(E.default,{submitting:a,...n})}const B=()=>({root:{}});function l({className:n,classes:a,onChange:s,onCheck:P,CollectionTableComponent:p,CollectionTableProps:b,searchProps:f,idLabelText:g,titleLabelText:x,ownerLabelText:C,searchPlaceholder:S,SearchInputProps:m,PaginationProps:T,SearchCollectionProps:j,enableSearch2:i}){const y=h.useSearch({queryParams:{field:["collectionId","title","__user"],content:"metadata"}},i),{state:q,setSearchText:v,onChangeRowsPerPage:k,onChangePage:L}=f||y,{matrixParams:O,queryParams:w,itemSearchDocument:R,page:_,rowsPerPage:I}=q,[c,u]=d.useState([]),N=t=>{c.includes(t)?u(r=>r.filter(W=>W!==t)):u(r=>[...r,t])};d.useEffect(()=>s&&s(c),[c]);const M=({id:t})=>N(t);return o.jsx("div",{className:$(a.root,"VdtCollectionSearchPicker",n),children:o.jsxs(h.SearchCollection,{itemSearchDocument:R,matrixParams:O,queryParams:w,enableSearch2:i,...j,children:[o.jsx(A,{onSubmit:t=>v(`*${t}*`),searchPlaceholder:S,...m}),o.jsx(p,{onRowClick:M,onCheck:P,selected:c,options:[{label:x,value:"title"},{label:g,value:"collectionId"},{label:C,value:"__user"}],...b}),o.jsx(z,{onChangePage:L,onChangeRowsPerPage:k,page:_,rowsPerPage:I,...T})]})})}l.propTypes={classes:e.objectOf(e.string),className:e.string,onChange:e.func,onCheck:e.func,CollectionTableComponent:e.elementType,CollectionTableProps:e.objectOf(e.any),searchProps:e.objectOf(e.any),idLabelText:e.string,titleLabelText:e.string,ownerLabelText:e.string,searchPlaceholder:e.string,SearchInputProps:e.objectOf(e.any),PaginationProps:e.objectOf(e.any),SearchCollectionProps:e.objectOf(e.any),enableSearch2:e.bool};l.defaultProps={className:void 0,classes:{},onChange:void 0,onCheck:()=>{},CollectionTableComponent:V.default,CollectionTableProps:{},searchProps:void 0,idLabelText:"Id",titleLabelText:"Title",ownerLabelText:"Owner",searchPlaceholder:"Search collections",SearchInputProps:{},PaginationProps:{},SearchCollectionProps:{},enableSearch2:!1};exports.default=l;exports.styles=B;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),D=require("clsx"),R=require("@material-ui/core"),V=require("@vidispine/vdt-react"),_=require("./SavedSearchList.js"),b=require("./SaveSearchForm.js"),E=e=>({root:{padding:e.spacing(2)}});function G({classes:e,className:o,markerField:n,markerValue:S,itemSearchDocument:d,onSelect:i,onSaveSuccess:u=()=>{},onSaveError:l=()=>{},SearchListComponent:a=_.default,SearchListProps:h={},SearchFormComponent:r=b.default,SearchFormProps:v={},accessTranslate:f,extraMenuItems:g,isLoading:q=!1,onDeleteError:j=()=>{},enableSearch2:s=!1}){const{onDeleteSearch:x,onUpdateSearchMetadata:P,onGetSavedSearchSettings:p,onSaveSearch:y,searchProps:M}=V.useSavedSearch({markerField:n,markerValue:S,initialSearchState:{rowsPerPage:5}},s),m=({collectionId:c})=>p({collectionId:c}).then(w=>i(w,c));return t.jsxs("div",{className:D(e.root,"VdtSavedSearch-root",o),children:[r&&t.jsx(r,{itemSearchDocument:d,onSuccess:u,onError:l,onSaveSearch:y,...v}),a&&t.jsx(a,{onSelect:m,onDelete:x,onUpdateSearchMetadata:P,searchProps:M,accessTranslate:f,extraMenuItems:g,isLoading:q,onDeleteError:j,enableSearch2:s,...h})]})}const L=R.withStyles(E,{name:"VdtSavedSearchList"})(G);exports.default=L;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),o=require("@material-ui/core"),x=require("../../collection/CollectionSearchPicker/index.js"),f=require("./SavedSearchRow.js"),g={};function q({searchProps:i,searchPlaceholderText:n="Find searches",onSelect:d,onDelete:c,onUpdateSearchMetadata:l,RowComponent:u=f.default,RowProps:S={},accessTranslate:h,extraMenuItems:v,isLoading:P,onDeleteError:m,...j}){return a.jsx(x.default,{searchProps:i,searchPlaceholder:n,CollectionTableComponent:({collectionListType:t,onRefresh:s})=>a.jsx(o.List,{children:t&&t.collection&&t.collection.map(e=>a.jsx(u,{collectionType:e,onSelect:()=>d({collectionId:e.id}),onDelete:()=>Promise.resolve(c({collectionId:e.id}).catch(r=>{m(r)}).then(s)),onUpdateSearchMetadata:r=>Promise.resolve(l({collectionId:e.id,metadataDocument:r}).then(s)),accessTranslate:h,extraMenuItems:v,isLoading:P,...S},e.id))}),PaginationProps:{rowsPerPageOptions:[5,10]},...j})}const b=o.withStyles(g,{name:"VdtSavedSearchList"})(q);exports.default=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),b=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),b=require("react"),Z=require("clsx"),k=require("@material-ui/core"),P=require("@vidispine/vdt-js"),g=require("@vidispine/vdt-react"),C=require("../SavedSearch/SavedSearchRow.js"),ee=require("./AddFolderRow.js"),$={markerValue:"savedSearch",markerField:"eidr_referentType"},te={indentationWidth:20,indentationDepthStart:1,defaultRowIndentationOffset:15,defalutNewRowIndentation:10},ne=()=>({root:{display:"flex",width:"100%",flexWrap:"wrap"},indentationContainer:{display:"flex",width:"100%"}}),ae=a=>({root:{display:"flex",width:"100%"},indentation:{height:25,borderLeft:`1px solid ${a.palette.primary.main}`,borderBottom:`1px solid ${a.palette.primary.main}`,marginRight:5}});function de({className:a,classes:t,children:c,indentationWidth:u,hideWrapper:x,folderDepth:o,indentationDepthStart:h,isAddRow:d,rowIndentation:l,addNewRowIndentation:I}){const w=d?!0:o>=h,i=d?I:l;return x?null:n.jsxs("div",{className:Z(a,t.root),children:[w&&n.jsx("div",{className:t.indentation,style:{marginLeft:i,minWidth:u}}),c]})}const ie=g.compose(k.withStyles(ae,{name:"VdtFolderRowContentWrapper"}))(de);function z({classes:a,id:t,queryParams:c,markerProps:u=$,childFolders:x=[],metadata:o={},itemSearchDocument:h={},folderDepth:d=0,type:l="folder",hideSubFolderSharing:I,onSelect:w,onRemoveItem:i,indentationValues:q={},indentationProps:s=te,FolderRowContentComponent:y=C.default,FolderRowContentProps:R={},AddRowComponent:F=ee.default,AddRowProps:M={},FolderRowContentWrapperComponent:S=ie,FolderRowContentWrapperProps:f={},isLoading:v,onDeleteError:_,...A}){const[j,V]=b.useState(),[p,N]=b.useState({id:null,type:null}),{createFolder:G,saveSearch:B,deleteFolder:D,removeItem:E,subFolders:m=[]}=g.useGetSavedSearchFolders({childFolders:x,expand:j,queryParams:c,markerProps:u}),{onDeleteSearch:J,onUpdateSearchMetadata:T,onGetSavedSearchSettings:W}=g.useSavedSearch({...$}),O=({collectionId:e})=>W({collectionId:e}).then(Y=>w(Y,e)),U=P.parseMetadataType(o,{joinValue:"_",flat:!0}),H=b.useMemo(()=>{const{__child_collection_size:e=0}=U;return m.length>0||!j&&e>0},[m.length,j,U]),{defalutNewRowIndentation:K,defaultRowIndentationOffset:L,indentationWidth:Q}=s,r={rowIndentation:q.rowIndentation||0,addNewRowIndentation:q.addNewRowIndentation||K},X={rowIndentation:r.addNewRowIndentation,addNewRowIndentation:r.addNewRowIndentation+Q+L};return n.jsxs("div",{className:a.root,children:[{folder:n.jsx(S,{folderDepth:d,...r,...s,...f,children:n.jsx(y,{isFolderRow:!0,hideSubFolderSharing:I,type:l,collectionType:{id:t,metadata:o},disableDeletion:H,onDelete:()=>Promise.resolve(D(t)).then(()=>{i&&i(t)}),onUpdateSearchMetadata:e=>T({collectionId:t,metadataDocument:e}),onExpand:()=>V(e=>!e),onAddRow:N,isLoading:v,...R})}),query:n.jsx(S,{folderDepth:d,...r,...s,...f,children:n.jsx(y,{isFolderRow:!0,type:l,collectionType:{id:t,metadata:o},onSelect:()=>O({collectionId:t}),onDelete:()=>Promise.resolve(J({collectionId:t})).then(()=>{i&&i(t)}).catch(e=>{_(e)}),onUpdateSearchMetadata:e=>T({collectionId:t,metadataDocument:e}),onAddRow:N,isLoading:v,...R})})}[l],n.jsx(S,{isAddRow:!0,folderDepth:d,...r,...s,hideWrapper:!p.id,...f,children:n.jsx(F,{id:t,setExpand:V,saveSearch:B,onAddRow:N,createFolder:G,itemSearchDocument:h,newField:p,...M})}),m.map(e=>n.jsx(z,{classes:a,id:e.id,queryParams:c,markerProps:u,childFolders:e.subFolders,metadata:e.metadata,itemSearchDocument:h,folderDepth:d+1,type:e.type,hideSubFolderSharing:!0,handleSelect:O,onSelect:w,onRemoveItem:()=>E(e.id),indentationProps:s,FolderRowContentComponent:y,FolderRowContentProps:R,AddRowComponent:F,AddRowProps:M,FolderRowContentWrapperComponent:S,FolderRowContentWrapperProps:f,indentationValues:X,isLoading:v,onDeleteError:_,props:A},e.id))]})}const oe=k.withStyles(ne,{name:"VdtFolderRow"})(z);exports.default=oe;
|
|
@@ -1,95 +1,100 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as n, jsxs as W } from "react/jsx-runtime";
|
|
2
|
+
import { useState as $, useEffect as D } from "react";
|
|
3
|
+
import E from "clsx";
|
|
4
4
|
import e from "prop-types";
|
|
5
|
-
import { useSearch as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
function
|
|
5
|
+
import { useSearch as V, SearchCollection as z } from "@vidispine/vdt-react";
|
|
6
|
+
import A from "../../search/Pagination.js";
|
|
7
|
+
import B from "../../search/SearchInput/index.js";
|
|
8
|
+
import F from "../CollectionTable/index.js";
|
|
9
|
+
function G({ PaginationComponent: t = A, ...a }) {
|
|
10
10
|
const {
|
|
11
|
-
collectionListType: { hits:
|
|
12
|
-
} =
|
|
13
|
-
return /* @__PURE__ */
|
|
11
|
+
collectionListType: { hits: r = 0 }
|
|
12
|
+
} = a;
|
|
13
|
+
return /* @__PURE__ */ n(t, { count: r, ...a });
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const { isLoading:
|
|
17
|
-
return /* @__PURE__ */
|
|
15
|
+
function H(t) {
|
|
16
|
+
const { isLoading: a } = t;
|
|
17
|
+
return /* @__PURE__ */ n(B, { submitting: a, ...t });
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const ee = () => ({
|
|
20
20
|
root: {}
|
|
21
21
|
});
|
|
22
|
-
function
|
|
22
|
+
function p({
|
|
23
23
|
className: t,
|
|
24
|
-
classes:
|
|
25
|
-
onChange:
|
|
26
|
-
onCheck:
|
|
24
|
+
classes: a,
|
|
25
|
+
onChange: r,
|
|
26
|
+
onCheck: h,
|
|
27
27
|
CollectionTableComponent: m,
|
|
28
|
-
CollectionTableProps:
|
|
29
|
-
searchProps:
|
|
30
|
-
idLabelText:
|
|
31
|
-
titleLabelText:
|
|
28
|
+
CollectionTableProps: u,
|
|
29
|
+
searchProps: P,
|
|
30
|
+
idLabelText: f,
|
|
31
|
+
titleLabelText: b,
|
|
32
32
|
ownerLabelText: d,
|
|
33
|
-
searchPlaceholder:
|
|
34
|
-
SearchInputProps:
|
|
35
|
-
PaginationProps:
|
|
36
|
-
SearchCollectionProps:
|
|
33
|
+
searchPlaceholder: C,
|
|
34
|
+
SearchInputProps: g,
|
|
35
|
+
PaginationProps: S,
|
|
36
|
+
SearchCollectionProps: T,
|
|
37
|
+
enableSearch2: s
|
|
37
38
|
}) {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
const x = V(
|
|
40
|
+
{
|
|
41
|
+
queryParams: {
|
|
42
|
+
field: ["collectionId", "title", "__user"],
|
|
43
|
+
content: "metadata"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
s
|
|
47
|
+
), { state: y, setSearchText: k, onChangeRowsPerPage: j, onChangePage: L } = P || x, { matrixParams: v, queryParams: w, itemSearchDocument: O, page: I, rowsPerPage: _ } = y, [c, i] = $([]), N = (o) => {
|
|
48
|
+
c.includes(o) ? i((l) => l.filter((q) => q !== o)) : i((l) => [...l, o]);
|
|
45
49
|
};
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
-
|
|
50
|
+
D(() => r && r(c), [c]);
|
|
51
|
+
const R = ({ id: o }) => N(o);
|
|
52
|
+
return /* @__PURE__ */ n("div", { className: E(a.root, "VdtCollectionSearchPicker", t), children: /* @__PURE__ */ W(
|
|
53
|
+
z,
|
|
50
54
|
{
|
|
51
|
-
itemSearchDocument:
|
|
52
|
-
matrixParams:
|
|
53
|
-
queryParams:
|
|
54
|
-
|
|
55
|
+
itemSearchDocument: O,
|
|
56
|
+
matrixParams: v,
|
|
57
|
+
queryParams: w,
|
|
58
|
+
enableSearch2: s,
|
|
59
|
+
...T,
|
|
55
60
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
|
|
61
|
+
/* @__PURE__ */ n(
|
|
62
|
+
H,
|
|
58
63
|
{
|
|
59
|
-
onSubmit: (o) =>
|
|
60
|
-
searchPlaceholder:
|
|
61
|
-
...
|
|
64
|
+
onSubmit: (o) => k(`*${o}*`),
|
|
65
|
+
searchPlaceholder: C,
|
|
66
|
+
...g
|
|
62
67
|
}
|
|
63
68
|
),
|
|
64
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ n(
|
|
65
70
|
m,
|
|
66
71
|
{
|
|
67
|
-
onRowClick:
|
|
68
|
-
onCheck:
|
|
72
|
+
onRowClick: R,
|
|
73
|
+
onCheck: h,
|
|
69
74
|
selected: c,
|
|
70
75
|
options: [
|
|
71
|
-
{ label:
|
|
72
|
-
{ label:
|
|
76
|
+
{ label: b, value: "title" },
|
|
77
|
+
{ label: f, value: "collectionId" },
|
|
73
78
|
{ label: d, value: "__user" }
|
|
74
79
|
],
|
|
75
|
-
...
|
|
80
|
+
...u
|
|
76
81
|
}
|
|
77
82
|
),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
83
|
+
/* @__PURE__ */ n(
|
|
84
|
+
G,
|
|
80
85
|
{
|
|
81
|
-
onChangePage:
|
|
82
|
-
onChangeRowsPerPage:
|
|
83
|
-
page:
|
|
84
|
-
rowsPerPage:
|
|
85
|
-
...
|
|
86
|
+
onChangePage: L,
|
|
87
|
+
onChangeRowsPerPage: j,
|
|
88
|
+
page: I,
|
|
89
|
+
rowsPerPage: _,
|
|
90
|
+
...S
|
|
86
91
|
}
|
|
87
92
|
)
|
|
88
93
|
]
|
|
89
94
|
}
|
|
90
95
|
) });
|
|
91
96
|
}
|
|
92
|
-
|
|
97
|
+
p.propTypes = {
|
|
93
98
|
/**
|
|
94
99
|
* Override or extend the styles applied to the component.
|
|
95
100
|
*/
|
|
@@ -109,15 +114,16 @@ i.propTypes = {
|
|
|
109
114
|
searchPlaceholder: e.string,
|
|
110
115
|
SearchInputProps: e.objectOf(e.any),
|
|
111
116
|
PaginationProps: e.objectOf(e.any),
|
|
112
|
-
SearchCollectionProps: e.objectOf(e.any)
|
|
117
|
+
SearchCollectionProps: e.objectOf(e.any),
|
|
118
|
+
enableSearch2: e.bool
|
|
113
119
|
};
|
|
114
|
-
|
|
120
|
+
p.defaultProps = {
|
|
115
121
|
className: void 0,
|
|
116
122
|
classes: {},
|
|
117
123
|
onChange: void 0,
|
|
118
124
|
onCheck: () => {
|
|
119
125
|
},
|
|
120
|
-
CollectionTableComponent:
|
|
126
|
+
CollectionTableComponent: F,
|
|
121
127
|
CollectionTableProps: {},
|
|
122
128
|
searchProps: void 0,
|
|
123
129
|
idLabelText: "Id",
|
|
@@ -126,9 +132,10 @@ i.defaultProps = {
|
|
|
126
132
|
searchPlaceholder: "Search collections",
|
|
127
133
|
SearchInputProps: {},
|
|
128
134
|
PaginationProps: {},
|
|
129
|
-
SearchCollectionProps: {}
|
|
135
|
+
SearchCollectionProps: {},
|
|
136
|
+
enableSearch2: !1
|
|
130
137
|
};
|
|
131
138
|
export {
|
|
132
|
-
|
|
133
|
-
|
|
139
|
+
p as default,
|
|
140
|
+
ee as styles
|
|
134
141
|
};
|
|
@@ -1,67 +1,75 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { withStyles as
|
|
4
|
-
import { useSavedSearch as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
1
|
+
import { jsxs as E, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import G from "clsx";
|
|
3
|
+
import { withStyles as L } from "@material-ui/core";
|
|
4
|
+
import { useSavedSearch as M } from "@vidispine/vdt-react";
|
|
5
|
+
import N from "./SavedSearchList.js";
|
|
6
|
+
import U from "./SaveSearchForm.js";
|
|
7
|
+
const $ = (e) => ({
|
|
8
8
|
root: {
|
|
9
9
|
padding: e.spacing(2)
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
function
|
|
12
|
+
function k({
|
|
13
13
|
classes: e,
|
|
14
14
|
className: S,
|
|
15
|
-
markerField:
|
|
16
|
-
markerValue:
|
|
17
|
-
itemSearchDocument:
|
|
18
|
-
onSelect:
|
|
19
|
-
onSaveSuccess:
|
|
15
|
+
markerField: c,
|
|
16
|
+
markerValue: n,
|
|
17
|
+
itemSearchDocument: d,
|
|
18
|
+
onSelect: i,
|
|
19
|
+
onSaveSuccess: h = () => {
|
|
20
20
|
},
|
|
21
|
-
onSaveError:
|
|
21
|
+
onSaveError: m = () => {
|
|
22
22
|
},
|
|
23
|
-
SearchListComponent: a =
|
|
24
|
-
SearchListProps:
|
|
25
|
-
SearchFormComponent: r =
|
|
26
|
-
SearchFormProps:
|
|
23
|
+
SearchListComponent: a = N,
|
|
24
|
+
SearchListProps: l = {},
|
|
25
|
+
SearchFormComponent: r = U,
|
|
26
|
+
SearchFormProps: f = {},
|
|
27
27
|
accessTranslate: v,
|
|
28
|
-
extraMenuItems:
|
|
29
|
-
isLoading:
|
|
28
|
+
extraMenuItems: p,
|
|
29
|
+
isLoading: u = !1,
|
|
30
|
+
onDeleteError: g = () => {
|
|
31
|
+
},
|
|
32
|
+
enableSearch2: t = !1
|
|
30
33
|
}) {
|
|
31
34
|
const {
|
|
32
|
-
onDeleteSearch:
|
|
33
|
-
onUpdateSearchMetadata:
|
|
34
|
-
onGetSavedSearchSettings:
|
|
35
|
-
onSaveSearch:
|
|
36
|
-
searchProps:
|
|
37
|
-
} =
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
onDeleteSearch: x,
|
|
36
|
+
onUpdateSearchMetadata: P,
|
|
37
|
+
onGetSavedSearchSettings: j,
|
|
38
|
+
onSaveSearch: w,
|
|
39
|
+
searchProps: y
|
|
40
|
+
} = M(
|
|
41
|
+
{ markerField: c, markerValue: n, initialSearchState: { rowsPerPage: 5 } },
|
|
42
|
+
t
|
|
43
|
+
), D = ({ collectionId: o }) => j({ collectionId: o }).then((V) => i(V, o));
|
|
44
|
+
return /* @__PURE__ */ E("div", { className: G(e.root, "VdtSavedSearch-root", S), children: [
|
|
45
|
+
r && /* @__PURE__ */ s(
|
|
40
46
|
r,
|
|
41
47
|
{
|
|
42
|
-
itemSearchDocument:
|
|
43
|
-
onSuccess:
|
|
44
|
-
onError:
|
|
45
|
-
onSaveSearch:
|
|
46
|
-
...
|
|
48
|
+
itemSearchDocument: d,
|
|
49
|
+
onSuccess: h,
|
|
50
|
+
onError: m,
|
|
51
|
+
onSaveSearch: w,
|
|
52
|
+
...f
|
|
47
53
|
}
|
|
48
54
|
),
|
|
49
|
-
a && /* @__PURE__ */
|
|
55
|
+
a && /* @__PURE__ */ s(
|
|
50
56
|
a,
|
|
51
57
|
{
|
|
52
|
-
onSelect:
|
|
53
|
-
onDelete:
|
|
54
|
-
onUpdateSearchMetadata:
|
|
55
|
-
searchProps:
|
|
58
|
+
onSelect: D,
|
|
59
|
+
onDelete: x,
|
|
60
|
+
onUpdateSearchMetadata: P,
|
|
61
|
+
searchProps: y,
|
|
56
62
|
accessTranslate: v,
|
|
57
|
-
extraMenuItems:
|
|
58
|
-
isLoading:
|
|
59
|
-
|
|
63
|
+
extraMenuItems: p,
|
|
64
|
+
isLoading: u,
|
|
65
|
+
onDeleteError: g,
|
|
66
|
+
enableSearch2: t,
|
|
67
|
+
...l
|
|
60
68
|
}
|
|
61
69
|
)
|
|
62
70
|
] });
|
|
63
71
|
}
|
|
64
|
-
const
|
|
72
|
+
const J = L($, { name: "VdtSavedSearchList" })(k);
|
|
65
73
|
export {
|
|
66
|
-
|
|
74
|
+
J as default
|
|
67
75
|
};
|
|
@@ -1,51 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { withStyles as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
searchProps:
|
|
8
|
-
searchPlaceholderText:
|
|
9
|
-
onSelect:
|
|
10
|
-
onDelete:
|
|
11
|
-
onUpdateSearchMetadata:
|
|
12
|
-
RowComponent: m =
|
|
13
|
-
RowProps:
|
|
14
|
-
accessTranslate:
|
|
15
|
-
extraMenuItems:
|
|
16
|
-
isLoading:
|
|
17
|
-
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { withStyles as p, List as u } from "@material-ui/core";
|
|
3
|
+
import w from "../../collection/CollectionSearchPicker/index.js";
|
|
4
|
+
import C from "./SavedSearchRow.js";
|
|
5
|
+
const I = {};
|
|
6
|
+
function g({
|
|
7
|
+
searchProps: i,
|
|
8
|
+
searchPlaceholderText: n = "Find searches",
|
|
9
|
+
onSelect: d,
|
|
10
|
+
onDelete: s,
|
|
11
|
+
onUpdateSearchMetadata: c,
|
|
12
|
+
RowComponent: m = C,
|
|
13
|
+
RowProps: h = {},
|
|
14
|
+
accessTranslate: l,
|
|
15
|
+
extraMenuItems: S,
|
|
16
|
+
isLoading: P,
|
|
17
|
+
onDeleteError: v,
|
|
18
|
+
...f
|
|
18
19
|
}) {
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
|
|
20
|
+
return /* @__PURE__ */ r(
|
|
21
|
+
w,
|
|
21
22
|
{
|
|
22
|
-
searchProps:
|
|
23
|
-
searchPlaceholder:
|
|
24
|
-
CollectionTableComponent: ({ collectionListType: o, onRefresh:
|
|
23
|
+
searchProps: i,
|
|
24
|
+
searchPlaceholder: n,
|
|
25
|
+
CollectionTableComponent: ({ collectionListType: o, onRefresh: a }) => /* @__PURE__ */ r(u, { children: o && o.collection && o.collection.map((e) => /* @__PURE__ */ r(
|
|
25
26
|
m,
|
|
26
27
|
{
|
|
27
28
|
collectionType: e,
|
|
28
|
-
onSelect: () =>
|
|
29
|
-
onDelete: () => Promise.resolve(
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
onSelect: () => d({ collectionId: e.id }),
|
|
30
|
+
onDelete: () => Promise.resolve(
|
|
31
|
+
s({ collectionId: e.id }).catch((t) => {
|
|
32
|
+
v(t);
|
|
33
|
+
}).then(a)
|
|
34
|
+
),
|
|
35
|
+
onUpdateSearchMetadata: (t) => Promise.resolve(
|
|
36
|
+
c({
|
|
32
37
|
collectionId: e.id,
|
|
33
|
-
metadataDocument:
|
|
34
|
-
}).then(
|
|
38
|
+
metadataDocument: t
|
|
39
|
+
}).then(a)
|
|
35
40
|
),
|
|
36
|
-
accessTranslate:
|
|
37
|
-
extraMenuItems:
|
|
38
|
-
isLoading:
|
|
39
|
-
...
|
|
41
|
+
accessTranslate: l,
|
|
42
|
+
extraMenuItems: S,
|
|
43
|
+
isLoading: P,
|
|
44
|
+
...h
|
|
40
45
|
},
|
|
41
46
|
e.id
|
|
42
47
|
)) }),
|
|
43
48
|
PaginationProps: { rowsPerPageOptions: [5, 10] },
|
|
44
|
-
...
|
|
49
|
+
...f
|
|
45
50
|
}
|
|
46
51
|
);
|
|
47
52
|
}
|
|
48
|
-
const
|
|
53
|
+
const D = p(I, { name: "VdtSavedSearchList" })(g);
|
|
49
54
|
export {
|
|
50
|
-
|
|
55
|
+
D as default
|
|
51
56
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { withStyles as
|
|
5
|
-
import { parseMetadataType as
|
|
6
|
-
import { compose as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
1
|
+
import { jsxs as z, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as $, useMemo as Z } from "react";
|
|
3
|
+
import P from "clsx";
|
|
4
|
+
import { withStyles as A } from "@material-ui/core";
|
|
5
|
+
import { parseMetadataType as C } from "@vidispine/vdt-js";
|
|
6
|
+
import { compose as ee, useGetSavedSearchFolders as te, useSavedSearch as ne } from "@vidispine/vdt-react";
|
|
7
|
+
import ae from "../SavedSearch/SavedSearchRow.js";
|
|
8
|
+
import de from "./AddFolderRow.js";
|
|
9
|
+
const k = {
|
|
10
10
|
markerValue: "savedSearch",
|
|
11
11
|
markerField: "eidr_referentType"
|
|
12
|
-
},
|
|
12
|
+
}, oe = {
|
|
13
13
|
indentationWidth: 20,
|
|
14
14
|
indentationDepthStart: 1,
|
|
15
15
|
defaultRowIndentationOffset: 15,
|
|
16
16
|
defalutNewRowIndentation: 10
|
|
17
|
-
},
|
|
17
|
+
}, ie = () => ({
|
|
18
18
|
root: {
|
|
19
19
|
display: "flex",
|
|
20
20
|
width: "100%",
|
|
@@ -24,7 +24,7 @@ const $ = {
|
|
|
24
24
|
display: "flex",
|
|
25
25
|
width: "100%"
|
|
26
26
|
}
|
|
27
|
-
}),
|
|
27
|
+
}), le = (a) => ({
|
|
28
28
|
root: {
|
|
29
29
|
display: "flex",
|
|
30
30
|
width: "100%"
|
|
@@ -36,7 +36,7 @@ const $ = {
|
|
|
36
36
|
marginRight: 5
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
function
|
|
39
|
+
function re({
|
|
40
40
|
className: a,
|
|
41
41
|
classes: t,
|
|
42
42
|
children: s,
|
|
@@ -49,7 +49,7 @@ function le({
|
|
|
49
49
|
addNewRowIndentation: I
|
|
50
50
|
}) {
|
|
51
51
|
const w = d ? !0 : i >= u, o = d ? I : l;
|
|
52
|
-
return S ? null : /* @__PURE__ */
|
|
52
|
+
return S ? null : /* @__PURE__ */ z("div", { className: P(a, t.root), children: [
|
|
53
53
|
w && /* @__PURE__ */ n(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
@@ -63,14 +63,14 @@ function le({
|
|
|
63
63
|
s
|
|
64
64
|
] });
|
|
65
65
|
}
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
)(
|
|
69
|
-
function
|
|
66
|
+
const ce = ee(
|
|
67
|
+
A(le, { name: "VdtFolderRowContentWrapper" })
|
|
68
|
+
)(re);
|
|
69
|
+
function G({
|
|
70
70
|
classes: a,
|
|
71
71
|
id: t,
|
|
72
72
|
queryParams: s,
|
|
73
|
-
markerProps: h =
|
|
73
|
+
markerProps: h = k,
|
|
74
74
|
childFolders: S = [],
|
|
75
75
|
metadata: i = {},
|
|
76
76
|
itemSearchDocument: u = {},
|
|
@@ -80,40 +80,41 @@ function A({
|
|
|
80
80
|
onSelect: w,
|
|
81
81
|
onRemoveItem: o,
|
|
82
82
|
indentationValues: F = {},
|
|
83
|
-
indentationProps: r =
|
|
84
|
-
FolderRowContentComponent: y =
|
|
83
|
+
indentationProps: r = oe,
|
|
84
|
+
FolderRowContentComponent: y = ae,
|
|
85
85
|
FolderRowContentProps: p = {},
|
|
86
|
-
AddRowComponent: b =
|
|
86
|
+
AddRowComponent: b = de,
|
|
87
87
|
AddRowProps: g = {},
|
|
88
|
-
FolderRowContentWrapperComponent: f =
|
|
88
|
+
FolderRowContentWrapperComponent: f = ce,
|
|
89
89
|
FolderRowContentWrapperProps: m = {},
|
|
90
90
|
isLoading: x,
|
|
91
|
-
|
|
91
|
+
onDeleteError: M,
|
|
92
|
+
...O
|
|
92
93
|
}) {
|
|
93
|
-
const [R,
|
|
94
|
-
createFolder:
|
|
95
|
-
saveSearch:
|
|
96
|
-
deleteFolder:
|
|
97
|
-
removeItem:
|
|
94
|
+
const [R, V] = $(), [_, N] = $({ id: null, type: null }), {
|
|
95
|
+
createFolder: B,
|
|
96
|
+
saveSearch: D,
|
|
97
|
+
deleteFolder: E,
|
|
98
|
+
removeItem: W,
|
|
98
99
|
subFolders: v = []
|
|
99
|
-
} =
|
|
100
|
+
} = te({
|
|
100
101
|
childFolders: S,
|
|
101
102
|
expand: R,
|
|
102
103
|
queryParams: s,
|
|
103
104
|
markerProps: h
|
|
104
|
-
}), { onDeleteSearch:
|
|
105
|
-
|
|
106
|
-
}),
|
|
107
|
-
const { __child_collection_size: e = 0 } =
|
|
105
|
+
}), { onDeleteSearch: q, onUpdateSearchMetadata: T, onGetSavedSearchSettings: H } = ne({
|
|
106
|
+
...k
|
|
107
|
+
}), j = ({ collectionId: e }) => H({ collectionId: e }).then((Y) => w(Y, e)), U = C(i, { joinValue: "_", flat: !0 }), J = Z(() => {
|
|
108
|
+
const { __child_collection_size: e = 0 } = U;
|
|
108
109
|
return v.length > 0 || !R && e > 0;
|
|
109
|
-
}, [v.length, R,
|
|
110
|
+
}, [v.length, R, U]), { defalutNewRowIndentation: K, defaultRowIndentationOffset: L, indentationWidth: Q } = r, c = {
|
|
110
111
|
rowIndentation: F.rowIndentation || 0,
|
|
111
|
-
addNewRowIndentation: F.addNewRowIndentation ||
|
|
112
|
-
},
|
|
112
|
+
addNewRowIndentation: F.addNewRowIndentation || K
|
|
113
|
+
}, X = {
|
|
113
114
|
rowIndentation: c.addNewRowIndentation,
|
|
114
|
-
addNewRowIndentation: c.addNewRowIndentation +
|
|
115
|
+
addNewRowIndentation: c.addNewRowIndentation + Q + L
|
|
115
116
|
};
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ z("div", { className: a.root, children: [
|
|
117
118
|
{
|
|
118
119
|
folder: /* @__PURE__ */ n(
|
|
119
120
|
f,
|
|
@@ -129,15 +130,15 @@ function A({
|
|
|
129
130
|
hideSubFolderSharing: I,
|
|
130
131
|
type: l,
|
|
131
132
|
collectionType: { id: t, metadata: i },
|
|
132
|
-
disableDeletion:
|
|
133
|
-
onDelete: () => Promise.resolve(
|
|
133
|
+
disableDeletion: J,
|
|
134
|
+
onDelete: () => Promise.resolve(E(t)).then(() => {
|
|
134
135
|
o && o(t);
|
|
135
136
|
}),
|
|
136
|
-
onUpdateSearchMetadata: (e) =>
|
|
137
|
+
onUpdateSearchMetadata: (e) => T({
|
|
137
138
|
collectionId: t,
|
|
138
139
|
metadataDocument: e
|
|
139
140
|
}),
|
|
140
|
-
onExpand: () =>
|
|
141
|
+
onExpand: () => V((e) => !e),
|
|
141
142
|
onAddRow: N,
|
|
142
143
|
isLoading: x,
|
|
143
144
|
...p
|
|
@@ -158,11 +159,13 @@ function A({
|
|
|
158
159
|
isFolderRow: !0,
|
|
159
160
|
type: l,
|
|
160
161
|
collectionType: { id: t, metadata: i },
|
|
161
|
-
onSelect: () =>
|
|
162
|
-
onDelete: () => Promise.resolve(
|
|
162
|
+
onSelect: () => j({ collectionId: t }),
|
|
163
|
+
onDelete: () => Promise.resolve(q({ collectionId: t })).then(() => {
|
|
163
164
|
o && o(t);
|
|
165
|
+
}).catch((e) => {
|
|
166
|
+
M(e);
|
|
164
167
|
}),
|
|
165
|
-
onUpdateSearchMetadata: (e) =>
|
|
168
|
+
onUpdateSearchMetadata: (e) => T({
|
|
166
169
|
collectionId: t,
|
|
167
170
|
metadataDocument: e
|
|
168
171
|
}),
|
|
@@ -181,25 +184,25 @@ function A({
|
|
|
181
184
|
folderDepth: d,
|
|
182
185
|
...c,
|
|
183
186
|
...r,
|
|
184
|
-
hideWrapper: !
|
|
187
|
+
hideWrapper: !_.id,
|
|
185
188
|
...m,
|
|
186
189
|
children: /* @__PURE__ */ n(
|
|
187
190
|
b,
|
|
188
191
|
{
|
|
189
192
|
id: t,
|
|
190
|
-
setExpand:
|
|
191
|
-
saveSearch:
|
|
193
|
+
setExpand: V,
|
|
194
|
+
saveSearch: D,
|
|
192
195
|
onAddRow: N,
|
|
193
|
-
createFolder:
|
|
196
|
+
createFolder: B,
|
|
194
197
|
itemSearchDocument: u,
|
|
195
|
-
newField:
|
|
198
|
+
newField: _,
|
|
196
199
|
...g
|
|
197
200
|
}
|
|
198
201
|
)
|
|
199
202
|
}
|
|
200
203
|
),
|
|
201
204
|
v.map((e) => /* @__PURE__ */ n(
|
|
202
|
-
|
|
205
|
+
G,
|
|
203
206
|
{
|
|
204
207
|
classes: a,
|
|
205
208
|
id: e.id,
|
|
@@ -211,9 +214,9 @@ function A({
|
|
|
211
214
|
folderDepth: d + 1,
|
|
212
215
|
type: e.type,
|
|
213
216
|
hideSubFolderSharing: !0,
|
|
214
|
-
handleSelect:
|
|
217
|
+
handleSelect: j,
|
|
215
218
|
onSelect: w,
|
|
216
|
-
onRemoveItem: () =>
|
|
219
|
+
onRemoveItem: () => W(e.id),
|
|
217
220
|
indentationProps: r,
|
|
218
221
|
FolderRowContentComponent: y,
|
|
219
222
|
FolderRowContentProps: p,
|
|
@@ -221,15 +224,16 @@ function A({
|
|
|
221
224
|
AddRowProps: g,
|
|
222
225
|
FolderRowContentWrapperComponent: f,
|
|
223
226
|
FolderRowContentWrapperProps: m,
|
|
224
|
-
indentationValues:
|
|
227
|
+
indentationValues: X,
|
|
225
228
|
isLoading: x,
|
|
226
|
-
|
|
229
|
+
onDeleteError: M,
|
|
230
|
+
props: O
|
|
227
231
|
},
|
|
228
232
|
e.id
|
|
229
233
|
))
|
|
230
234
|
] });
|
|
231
235
|
}
|
|
232
|
-
const
|
|
236
|
+
const ye = A(ie, { name: "VdtFolderRow" })(G);
|
|
233
237
|
export {
|
|
234
|
-
|
|
238
|
+
ye as default
|
|
235
239
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vidispine/vdt-materialui",
|
|
3
|
-
"version": "26.2.
|
|
3
|
+
"version": "26.2.3",
|
|
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.
|
|
40
|
-
"@vidispine/vdt-api": "26.2.
|
|
41
|
-
"@vidispine/vdt-js": "26.2.
|
|
42
|
-
"@vidispine/vdt-react": "26.2.
|
|
43
|
-
"@vidispine/vdt-videojs-react": "26.2.
|
|
39
|
+
"@vidispine/proptypes": "26.2.3",
|
|
40
|
+
"@vidispine/vdt-api": "26.2.3",
|
|
41
|
+
"@vidispine/vdt-js": "26.2.3",
|
|
42
|
+
"@vidispine/vdt-react": "26.2.3",
|
|
43
|
+
"@vidispine/vdt-videojs-react": "26.2.3",
|
|
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.
|
|
78
|
-
"@vidispine/eslint-config-react": "26.2.
|
|
79
|
-
"@vidispine/eslint-config-storybook": "26.2.
|
|
80
|
-
"@vidispine/prettier-config": "26.2.
|
|
81
|
-
"@vidispine/proptypes": "26.2.
|
|
77
|
+
"@vidispine/eslint-config-mdx": "26.2.3",
|
|
78
|
+
"@vidispine/eslint-config-react": "26.2.3",
|
|
79
|
+
"@vidispine/eslint-config-storybook": "26.2.3",
|
|
80
|
+
"@vidispine/prettier-config": "26.2.3",
|
|
81
|
+
"@vidispine/proptypes": "26.2.3",
|
|
82
82
|
"@vitejs/plugin-react": "4.2.1",
|
|
83
83
|
"@wojtekmaj/enzyme-adapter-react-17": "0.8.0",
|
|
84
84
|
"axios": "1.13.5",
|