@vidispine/vdt-materialui 26.1.0 → 26.2.0-pre.2
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
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),u=require("react"),r=require("@material-ui/core"),p=e=>({root:{paddingTop:e.spacing(1),paddingBottom:e.spacing(1)},TextField:{},Button:{borderRadius:0}});function g({classes:e,itemSearchDocument:l,onSaveSearch:d,onSuccess:m=()=>{},onError:n=()=>{},nameText:S="New Saved Search",saveText:h="Save"}){const[t,v]=u.useState(""),[c,i]=u.useState(!1),f=s=>{if(s.preventDefault(),!t){n("No Name specified");return}i(!0),d({metadata:{title:t.trim()},itemSearchDocument:l}).then(o=>{i(!1),m(o)}).catch(o=>{i(!1),n(o)})};return a.jsxs("form",{className:e.root,onSubmit:f,children:[a.jsx(r.InputBase,{className:e.TextField,onChange:s=>v(s.target.value),fullWidth:!0,placeholder:S}),a.jsx(r.Button,{className:e.Button,disabled:!t||t.trim()===""||c,fullWidth:!0,color:"primary",variant:"contained",disableElevation:!0,type:"submit",children:c?a.jsx(r.CircularProgress,{size:24,color:"inherit"}):h})]})}const N=r.withStyles(p,{name:"VdtSaveSearchForm"})(g);exports.default=N;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { withStyles as
|
|
4
|
-
const
|
|
1
|
+
import { jsxs as f, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l } from "react";
|
|
3
|
+
import { withStyles as v, InputBase as g, Button as N, CircularProgress as b } from "@material-ui/core";
|
|
4
|
+
const x = (e) => ({
|
|
5
5
|
root: {
|
|
6
6
|
paddingTop: e.spacing(1),
|
|
7
7
|
paddingBottom: e.spacing(1)
|
|
@@ -11,53 +11,57 @@ const v = (e) => ({
|
|
|
11
11
|
borderRadius: 0
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
function
|
|
14
|
+
function B({
|
|
15
15
|
classes: e,
|
|
16
|
-
itemSearchDocument:
|
|
17
|
-
onSaveSearch:
|
|
16
|
+
itemSearchDocument: c,
|
|
17
|
+
onSaveSearch: d,
|
|
18
18
|
onSuccess: m = () => {
|
|
19
19
|
},
|
|
20
|
-
onError:
|
|
20
|
+
onError: s = () => {
|
|
21
21
|
},
|
|
22
|
-
nameText:
|
|
23
|
-
saveText:
|
|
22
|
+
nameText: u = "New Saved Search",
|
|
23
|
+
saveText: h = "Save"
|
|
24
24
|
}) {
|
|
25
|
-
const [t,
|
|
26
|
-
if (
|
|
27
|
-
|
|
25
|
+
const [t, p] = l(""), [n, a] = l(!1), S = (r) => {
|
|
26
|
+
if (r.preventDefault(), !t) {
|
|
27
|
+
s("No Name specified");
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
a(!0), d({
|
|
31
31
|
metadata: { title: t.trim() },
|
|
32
|
-
itemSearchDocument:
|
|
33
|
-
}).then(
|
|
32
|
+
itemSearchDocument: c
|
|
33
|
+
}).then((o) => {
|
|
34
|
+
a(!1), m(o);
|
|
35
|
+
}).catch((o) => {
|
|
36
|
+
a(!1), s(o);
|
|
37
|
+
});
|
|
34
38
|
};
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
39
|
+
return /* @__PURE__ */ f("form", { className: e.root, onSubmit: S, children: [
|
|
40
|
+
/* @__PURE__ */ i(
|
|
41
|
+
g,
|
|
38
42
|
{
|
|
39
43
|
className: e.TextField,
|
|
40
|
-
onChange: (
|
|
44
|
+
onChange: (r) => p(r.target.value),
|
|
41
45
|
fullWidth: !0,
|
|
42
|
-
placeholder:
|
|
46
|
+
placeholder: u
|
|
43
47
|
}
|
|
44
48
|
),
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
49
|
+
/* @__PURE__ */ i(
|
|
50
|
+
N,
|
|
47
51
|
{
|
|
48
52
|
className: e.Button,
|
|
49
|
-
disabled: !t || t.trim() === "",
|
|
53
|
+
disabled: !t || t.trim() === "" || n,
|
|
50
54
|
fullWidth: !0,
|
|
51
55
|
color: "primary",
|
|
52
56
|
variant: "contained",
|
|
53
57
|
disableElevation: !0,
|
|
54
58
|
type: "submit",
|
|
55
|
-
children:
|
|
59
|
+
children: n ? /* @__PURE__ */ i(b, { size: 24, color: "inherit" }) : h
|
|
56
60
|
}
|
|
57
61
|
)
|
|
58
62
|
] });
|
|
59
63
|
}
|
|
60
|
-
const
|
|
64
|
+
const j = v(x, { name: "VdtSaveSearchForm" })(B);
|
|
61
65
|
export {
|
|
62
|
-
|
|
66
|
+
j as default
|
|
63
67
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vidispine/vdt-materialui",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.2.0-pre.2",
|
|
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.
|
|
40
|
-
"@vidispine/vdt-api": "26.
|
|
41
|
-
"@vidispine/vdt-js": "26.
|
|
42
|
-
"@vidispine/vdt-react": "26.
|
|
43
|
-
"@vidispine/vdt-videojs-react": "26.
|
|
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",
|
|
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.
|
|
78
|
-
"@vidispine/eslint-config-react": "26.
|
|
79
|
-
"@vidispine/eslint-config-storybook": "26.
|
|
80
|
-
"@vidispine/prettier-config": "26.
|
|
81
|
-
"@vidispine/proptypes": "26.
|
|
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",
|
|
82
82
|
"@vitejs/plugin-react": "4.2.1",
|
|
83
83
|
"@wojtekmaj/enzyme-adapter-react-17": "0.8.0",
|
|
84
84
|
"axios": "1.13.5",
|