@tsed/react-formio 1.13.6 → 1.14.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/components/form-edit/formParameters.component.d.ts +3 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +8 -2
- package/dist/index.modern.js.map +1 -1
- package/package.json +4 -4
- package/src/components/form-edit/formParameters.component.tsx +17 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/react-formio",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "Provide a react formio wrapper. Written in TypeScript.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.modern.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"watch": "microbundle watch --no-compress --format modern,cjs --jsx React.createElement --jsxFragment React.Fragment --globals react/jsx-runtime=jsx"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@tsed/redux-utils": "1.
|
|
17
|
+
"@tsed/redux-utils": "1.14.0",
|
|
18
18
|
"eventemitter2": "^6.4.3",
|
|
19
19
|
"prop-types": "^15.7.2"
|
|
20
20
|
},
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"tooltip.js": ">=1.3.3"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@tsed/tailwind": "1.
|
|
33
|
-
"@tsed/tailwind-formio": "1.
|
|
32
|
+
"@tsed/tailwind": "1.14.0",
|
|
33
|
+
"@tsed/tailwind-formio": "1.14.0"
|
|
34
34
|
},
|
|
35
35
|
"repository": "https://github.com/TypedProject/tsed-formio",
|
|
36
36
|
"bugs": {
|
|
@@ -19,6 +19,8 @@ export interface FormParametersProps {
|
|
|
19
19
|
displayChoices?: { label: string; value: any }[];
|
|
20
20
|
enableTags?: boolean;
|
|
21
21
|
className?: string;
|
|
22
|
+
baseUrl?: string;
|
|
23
|
+
readonly?: Record<string, boolean>;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export function FormParameters({
|
|
@@ -27,7 +29,9 @@ export function FormParameters({
|
|
|
27
29
|
enableTags = true,
|
|
28
30
|
typeChoices = [],
|
|
29
31
|
displayChoices = defaultDisplayChoices,
|
|
30
|
-
className = ""
|
|
32
|
+
className = "",
|
|
33
|
+
readonly = {},
|
|
34
|
+
baseUrl = window.location.origin
|
|
31
35
|
}: FormParametersProps): ReactElement {
|
|
32
36
|
const hasTypeChoices = typeChoices && typeChoices.length > 1;
|
|
33
37
|
|
|
@@ -40,6 +44,7 @@ export function FormParameters({
|
|
|
40
44
|
name={"title"}
|
|
41
45
|
required={true}
|
|
42
46
|
value={form.title}
|
|
47
|
+
disabled={!!readonly["title"]}
|
|
43
48
|
onChange={onChange}
|
|
44
49
|
/>
|
|
45
50
|
</div>
|
|
@@ -49,6 +54,7 @@ export function FormParameters({
|
|
|
49
54
|
placeholder='Enter the form machine name'
|
|
50
55
|
name={"name"}
|
|
51
56
|
required={true}
|
|
57
|
+
disabled={!!readonly["name"]}
|
|
52
58
|
value={form.name}
|
|
53
59
|
onChange={onChange}
|
|
54
60
|
/>
|
|
@@ -62,17 +68,25 @@ export function FormParameters({
|
|
|
62
68
|
description={
|
|
63
69
|
<span className={"text-xxs flex items-center"}>
|
|
64
70
|
<i className={"bx bx-link ml-1 mr-1"} />
|
|
65
|
-
{
|
|
71
|
+
{`${baseUrl}/${form.path}`}
|
|
66
72
|
</span>
|
|
67
73
|
}
|
|
68
74
|
required={true}
|
|
69
75
|
value={form.path}
|
|
76
|
+
disabled={!!readonly["path"]}
|
|
70
77
|
style={{ textTransform: "lowercase", width: "120px" }}
|
|
71
78
|
onChange={onChange}
|
|
72
79
|
/>
|
|
73
80
|
</div>
|
|
74
81
|
<div className={"w-1/3"}>
|
|
75
|
-
<Select
|
|
82
|
+
<Select
|
|
83
|
+
label={"Display as"}
|
|
84
|
+
name={"display"}
|
|
85
|
+
disabled={!!readonly["display"]}
|
|
86
|
+
value={form.display}
|
|
87
|
+
choices={displayChoices}
|
|
88
|
+
onChange={onChange}
|
|
89
|
+
/>
|
|
76
90
|
</div>
|
|
77
91
|
{hasTypeChoices && (
|
|
78
92
|
<div className={"w-1/3"}>
|