@tsed/react-formio 1.13.1 → 1.13.4
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/.eslintignore +13 -0
- package/.eslintrc.js +7 -0
- package/coverage.json +6 -0
- package/dist/components/actions-table/actionsTable.component.d.ts +0 -1
- package/dist/components/actions-table/actionsTable.stories.d.ts +0 -1
- package/dist/components/alert/alert.component.d.ts +1 -2
- package/dist/components/alert/alert.stories.d.ts +0 -1
- package/dist/components/card/card.stories.d.ts +0 -1
- package/dist/components/form/form.component.d.ts +1 -2
- package/dist/components/form/form.component.spec.d.ts +1 -0
- package/dist/components/form/form.stories.d.ts +3754 -156
- package/dist/components/form/useForm.hook.d.ts +6 -3
- package/dist/components/form-access/formAccess.stories.d.ts +1 -2
- package/dist/components/form-action/formAction.stories.d.ts +0 -1
- package/dist/components/form-builder/formBuilder.stories.d.ts +518 -153
- package/dist/components/form-control/formControl.component.d.ts +2 -2
- package/dist/components/form-control/formControl.component.spec.d.ts +1 -0
- package/dist/components/form-control/formControl.stories.d.ts +57 -0
- package/dist/components/form-edit/formEdit.component.d.ts +0 -1
- package/dist/components/form-edit/formEdit.stories.d.ts +18 -19
- package/dist/components/form-settings/formSettings.component.d.ts +0 -1
- package/dist/components/form-settings/formSettings.stories.d.ts +1 -2
- package/dist/components/forms-table/components/formCell.component.d.ts +0 -1
- package/dist/components/forms-table/formsTable.component.d.ts +0 -1
- package/dist/components/forms-table/formsTable.stories.d.ts +0 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/input-tags/inputTags.component.d.ts +0 -1
- package/dist/components/input-tags/inputTags.stories.d.ts +2 -3
- package/dist/components/input-text/inputText.component.d.ts +0 -1
- package/dist/components/input-text/inputText.stories.d.ts +0 -1
- package/dist/components/loader/loader.component.d.ts +1 -1
- package/dist/components/loader/loader.stories.d.ts +0 -1
- package/dist/components/modal/modal.component.d.ts +1 -1
- package/dist/components/modal/modal.stories.d.ts +0 -1
- package/dist/components/pagination/pagination.component.d.ts +0 -1
- package/dist/components/pagination/pagination.stories.d.ts +0 -1
- package/dist/components/react-component/reactComponent.component.d.ts +3 -3
- package/dist/components/select/select.stories.d.ts +2 -3
- package/dist/components/submissions-table/submissionsTable.component.d.ts +0 -1
- package/dist/components/submissions-table/submissionsTable.stories.d.ts +13 -14
- package/dist/components/table/components/defaultArrowSort.component.d.ts +0 -1
- package/dist/components/table/components/defaultCell.component.d.ts +0 -1
- package/dist/components/table/components/defaultCellHeader.component.d.ts +1 -2
- package/dist/components/table/components/defaultCellOperations.component.d.ts +0 -1
- package/dist/components/table/components/defaultOperationButton.component.d.ts +0 -1
- package/dist/components/table/filters/defaultColumnFilter.component.d.ts +0 -1
- package/dist/components/table/filters/selectColumnFilter.component.d.ts +0 -1
- package/dist/components/table/filters/sliderColumnFilter.component.d.ts +0 -1
- package/dist/components/table/index.d.ts +1 -1
- package/dist/components/table/table.stories.d.ts +4 -5
- package/dist/components/tabs/tabs.component.stories.d.ts +0 -1
- package/dist/hooks/useTooltip.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8014 -7967
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +7392 -7340
- package/dist/index.modern.js.map +1 -1
- package/dist/stores/actions/index.d.ts +1 -1
- package/dist/stores/auth/auth.selectors.d.ts +1 -1
- package/dist/stores/auth/index.d.ts +4 -4
- package/dist/stores/index.d.ts +2 -2
- package/jest.config.js +6 -1
- package/package.json +8 -5
- package/src/components/__fixtures__/form.fixture.json +23 -0
- package/src/components/actions-table/actionsTable.component.spec.tsx +11 -11
- package/src/components/actions-table/actionsTable.component.tsx +8 -9
- package/src/components/actions-table/actionsTable.stories.tsx +1 -0
- package/src/components/alert/alert.component.spec.tsx +21 -19
- package/src/components/alert/alert.stories.tsx +1 -0
- package/src/components/card/card.component.spec.tsx +5 -4
- package/src/components/card/card.stories.tsx +1 -0
- package/src/components/form/form.component.spec.tsx +57 -0
- package/src/components/form/form.component.tsx +4 -3
- package/src/components/form/form.stories.tsx +206 -57
- package/src/components/form/useForm.hook.ts +68 -37
- package/src/components/form-access/formAccess.component.tsx +3 -2
- package/src/components/form-access/formAccess.schema.ts +1 -0
- package/src/components/form-access/formAccess.stories.tsx +1 -0
- package/src/components/form-access/formAccess.utils.ts +6 -5
- package/src/components/form-action/formAction.component.tsx +5 -4
- package/src/components/form-action/formAction.stories.tsx +225 -227
- package/src/components/form-builder/formBuilder.component.tsx +2 -1
- package/src/components/form-builder/formBuilder.stories.tsx +1 -0
- package/src/components/form-control/formControl.component.spec.tsx +76 -0
- package/src/components/form-control/formControl.component.tsx +15 -7
- package/src/components/form-control/formControl.stories.tsx +65 -0
- package/src/components/form-edit/formCtas.component.tsx +10 -9
- package/src/components/form-edit/formEdit.component.tsx +2 -1
- package/src/components/form-edit/formEdit.reducer.ts +1 -0
- package/src/components/form-edit/formEdit.stories.tsx +1 -0
- package/src/components/form-edit/formParameters.component.tsx +1 -0
- package/src/components/form-edit/useFormEdit.hook.ts +1 -0
- package/src/components/form-settings/formSettings.component.spec.tsx +7 -6
- package/src/components/form-settings/formSettings.component.tsx +12 -14
- package/src/components/form-settings/formSettings.stories.tsx +1 -0
- package/src/components/form-settings/formSettings.utils.ts +4 -3
- package/src/components/forms-table/components/formCell.component.tsx +1 -0
- package/src/components/forms-table/formsTable.component.tsx +23 -25
- package/src/components/forms-table/formsTable.stories.tsx +1 -0
- package/src/components/index.ts +2 -2
- package/src/components/input-tags/inputTags.component.tsx +7 -6
- package/src/components/input-tags/inputTags.stories.tsx +1 -0
- package/src/components/input-text/inputText.component.spec.tsx +12 -11
- package/src/components/input-text/inputText.component.tsx +3 -2
- package/src/components/input-text/inputText.stories.tsx +1 -0
- package/src/components/loader/loader.component.spec.tsx +6 -5
- package/src/components/loader/loader.component.tsx +1 -0
- package/src/components/loader/loader.stories.tsx +1 -0
- package/src/components/modal/modal.component.spec.tsx +36 -33
- package/src/components/modal/modal.component.tsx +3 -3
- package/src/components/modal/modal.stories.tsx +1 -0
- package/src/components/modal/removeModal.component.tsx +1 -0
- package/src/components/pagination/pagination.component.spec.tsx +24 -21
- package/src/components/pagination/pagination.component.tsx +1 -0
- package/src/components/pagination/pagination.stories.tsx +1 -0
- package/src/components/react-component/reactComponent.component.tsx +11 -7
- package/src/components/select/select.component.spec.tsx +17 -18
- package/src/components/select/select.component.tsx +3 -2
- package/src/components/select/select.stories.tsx +1 -0
- package/src/components/submissions-table/submissionsTable.component.tsx +3 -2
- package/src/components/submissions-table/submissionsTable.stories.tsx +1 -0
- package/src/components/table/components/defaultArrowSort.component.tsx +1 -0
- package/src/components/table/components/defaultCellHeader.component.tsx +1 -1
- package/src/components/table/components/defaultCellOperations.component.tsx +1 -0
- package/src/components/table/components/defaultOperationButton.component.tsx +1 -0
- package/src/components/table/filters/defaultColumnFilter.component.spec.tsx +5 -3
- package/src/components/table/filters/defaultColumnFilter.component.tsx +1 -0
- package/src/components/table/filters/selectColumnFilter.component.spec.tsx +9 -7
- package/src/components/table/filters/selectColumnFilter.component.tsx +1 -0
- package/src/components/table/index.ts +1 -1
- package/src/components/table/table.component.tsx +5 -4
- package/src/components/table/table.stories.tsx +2 -1
- package/src/components/table/utils/mapFormToColumns.tsx +3 -2
- package/src/components/table/utils/useOperations.hook.tsx +1 -0
- package/src/components/tabs/tabs.component.spec.tsx +6 -5
- package/src/components/tabs/tabs.component.stories.tsx +1 -0
- package/src/components/tabs/tabs.component.tsx +11 -5
- package/src/hooks/useTooltip.ts +1 -1
- package/src/index.ts +3 -4
- package/src/interfaces/Operation.ts +1 -0
- package/src/stores/action/action.actions.spec.ts +1 -0
- package/src/stores/action/action.actions.ts +1 -0
- package/src/stores/action/action.reducers.ts +1 -1
- package/src/stores/action-info/action-info.actions.spec.ts +1 -0
- package/src/stores/action-info/action-info.actions.ts +2 -1
- package/src/stores/action-info/action-info.reducers.ts +2 -1
- package/src/stores/action-info/action-info.selectors.ts +2 -1
- package/src/stores/actions/actions.actions.spec.ts +1 -0
- package/src/stores/actions/actions.actions.ts +1 -0
- package/src/stores/actions/actions.reducers.ts +1 -0
- package/src/stores/actions/index.ts +1 -1
- package/src/stores/auth/auth.actions.ts +1 -0
- package/src/stores/auth/auth.reducers.ts +1 -0
- package/src/stores/auth/auth.selectors.ts +1 -0
- package/src/stores/auth/auth.utils.tsx +3 -2
- package/src/stores/auth/getAccess.action.spec.ts +1 -0
- package/src/stores/auth/getAccess.action.ts +3 -2
- package/src/stores/auth/getProjectAccess.action.ts +1 -0
- package/src/stores/auth/index.ts +4 -4
- package/src/stores/auth/initAuth.action.spec.ts +1 -0
- package/src/stores/auth/initAuth.action.ts +1 -0
- package/src/stores/auth/logout.action.spec.ts +2 -0
- package/src/stores/auth/logout.action.ts +1 -0
- package/src/stores/auth/setUser.action.spec.ts +1 -0
- package/src/stores/auth/setUser.action.ts +1 -0
- package/src/stores/form/form.actions.spec.ts +1 -0
- package/src/stores/form/form.actions.ts +1 -0
- package/src/stores/form/form.reducers.ts +1 -0
- package/src/stores/form/form.selectors.ts +1 -1
- package/src/stores/forms/forms.actions.spec.ts +1 -0
- package/src/stores/forms/forms.actions.ts +1 -0
- package/src/stores/forms/forms.reducers.ts +1 -0
- package/src/stores/index.ts +3 -2
- package/src/stores/root/root.selectors.ts +3 -3
- package/src/stores/submission/submission.actions.spec.ts +1 -0
- package/src/stores/submission/submission.actions.ts +1 -0
- package/src/stores/submission/submission.reducers.ts +1 -0
- package/src/stores/submissions/submissions.actions.spec.ts +1 -0
- package/src/stores/submissions/submissions.actions.ts +1 -0
- package/src/stores/submissions/submissions.reducers.ts +1 -0
- package/tsconfig.json +10 -27
- package/tsconfig.node.json +8 -0
- package/craco.config.js +0 -11
- package/tsconfig.test.json +0 -6
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
|
|
2
3
|
import { FormAction } from "./formAction.component";
|
|
3
4
|
|
|
4
5
|
export default {
|
|
@@ -38,296 +39,293 @@ export const Sandbox = (args: any) => {
|
|
|
38
39
|
|
|
39
40
|
Sandbox.args = {
|
|
40
41
|
actionInfo: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
"update"
|
|
52
|
-
],
|
|
53
|
-
"priority": 10,
|
|
54
|
-
"name": "save",
|
|
55
|
-
"title": "Save Submission"
|
|
42
|
+
name: "save",
|
|
43
|
+
title: "Save Submission",
|
|
44
|
+
description: "Saves the submission into the database.",
|
|
45
|
+
priority: 10,
|
|
46
|
+
defaults: {
|
|
47
|
+
handler: ["before"],
|
|
48
|
+
method: ["create", "update"],
|
|
49
|
+
priority: 10,
|
|
50
|
+
name: "save",
|
|
51
|
+
title: "Save Submission"
|
|
56
52
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
access: {
|
|
54
|
+
handler: false,
|
|
55
|
+
method: false
|
|
60
56
|
},
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
settingsForm: {
|
|
58
|
+
components: [
|
|
63
59
|
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
type: "hidden",
|
|
61
|
+
input: true,
|
|
62
|
+
key: "priority"
|
|
67
63
|
},
|
|
68
64
|
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
type: "hidden",
|
|
66
|
+
input: true,
|
|
67
|
+
key: "name"
|
|
72
68
|
},
|
|
73
69
|
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
type: "textfield",
|
|
71
|
+
input: true,
|
|
72
|
+
label: "Title",
|
|
73
|
+
key: "title"
|
|
78
74
|
},
|
|
79
75
|
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
type: "fieldset",
|
|
77
|
+
input: false,
|
|
78
|
+
tree: true,
|
|
79
|
+
legend: "Action Settings",
|
|
80
|
+
components: [
|
|
85
81
|
{
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
input: false,
|
|
83
|
+
type: "container",
|
|
84
|
+
key: "settings",
|
|
85
|
+
components: [
|
|
90
86
|
{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
87
|
+
type: "resourcefields",
|
|
88
|
+
key: "resource",
|
|
89
|
+
title: "Save submission to",
|
|
90
|
+
placeholder: "This form",
|
|
91
|
+
basePath: "/project/5d0797bc872fc7d140559857/form",
|
|
92
|
+
form: "62b18b10fbbba513555c6c5e",
|
|
93
|
+
required: false
|
|
98
94
|
}
|
|
99
95
|
]
|
|
100
96
|
}
|
|
101
97
|
]
|
|
102
98
|
},
|
|
103
99
|
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
100
|
+
type: "fieldset",
|
|
101
|
+
input: false,
|
|
102
|
+
tree: false,
|
|
103
|
+
key: "conditions",
|
|
104
|
+
legend: "Action Execution",
|
|
105
|
+
components: [
|
|
110
106
|
{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
107
|
+
type: "select",
|
|
108
|
+
input: true,
|
|
109
|
+
key: "handler",
|
|
110
|
+
label: "Handler",
|
|
111
|
+
placeholder: "Select which handler(s) you would like to trigger",
|
|
112
|
+
dataSrc: "json",
|
|
113
|
+
data: {
|
|
114
|
+
json: '[{"name":"before","title":"Before"},{"name":"after","title":"After"}]'
|
|
119
115
|
},
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
template: "<span>{{ item.title }}</span>",
|
|
117
|
+
valueProperty: "name",
|
|
118
|
+
multiple: true
|
|
123
119
|
},
|
|
124
120
|
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
121
|
+
type: "select",
|
|
122
|
+
input: true,
|
|
123
|
+
label: "Methods",
|
|
124
|
+
key: "method",
|
|
125
|
+
placeholder: "Trigger action on method(s)",
|
|
126
|
+
dataSrc: "json",
|
|
127
|
+
data: {
|
|
128
|
+
json: '[{"name":"create","title":"Create"},{"name":"update","title":"Update"},{"name":"read","title":"Read"},{"name":"delete","title":"Delete"},{"name":"index","title":"Index"}]'
|
|
133
129
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
template: "<span>{{ item.title }}</span>",
|
|
131
|
+
valueProperty: "name",
|
|
132
|
+
multiple: true
|
|
137
133
|
}
|
|
138
134
|
]
|
|
139
135
|
},
|
|
140
136
|
{
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
137
|
+
key: "fieldset",
|
|
138
|
+
type: "fieldset",
|
|
139
|
+
input: false,
|
|
140
|
+
tree: false,
|
|
141
|
+
legend: "Action Conditions (optional)",
|
|
142
|
+
components: [
|
|
147
143
|
{
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
144
|
+
type: "container",
|
|
145
|
+
key: "condition",
|
|
146
|
+
input: false,
|
|
147
|
+
tree: true,
|
|
148
|
+
components: [
|
|
153
149
|
{
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
150
|
+
key: "columns",
|
|
151
|
+
type: "columns",
|
|
152
|
+
input: false,
|
|
153
|
+
columns: [
|
|
158
154
|
{
|
|
159
|
-
|
|
155
|
+
components: [
|
|
160
156
|
{
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
157
|
+
type: "select",
|
|
158
|
+
input: true,
|
|
159
|
+
label: "Trigger this action only if field",
|
|
160
|
+
key: "field",
|
|
161
|
+
placeholder: "Select the conditional field",
|
|
162
|
+
template: "<span>{{ item.label || item.key }}</span>",
|
|
163
|
+
dataSrc: "json",
|
|
164
|
+
data: {
|
|
165
|
+
json: '[{"key":""},{"label":"Rules","reorder":false,"addAnotherPosition":"bottom","layoutFixed":false,"enableRowGroups":false,"initEmpty":false,"tableView":false,"defaultValue":[{"path":{},"operator":""}],"key":"rules","type":"datagrid","input":true,"components":[{"label":"Path","widget":"choicesjs","tableView":true,"dataSrc":"url","data":{"url":"/test","headers":[{"key":"","value":""}]},"key":"path","type":"select","input":true,"disableLimit":false},{"label":"Operator","widget":"choicesjs","tableView":true,"data":{"values":[{"label":"default","value":"default"},{"label":"Contains","value":"CONTAINS"}]},"key":"operator","type":"select","input":true},{"customClass":"mt-0 mb-0","key":"fieldset","type":"fieldset","label":"Field Set","input":false,"tableView":false,"components":[{"label":"Value","tableView":true,"key":"value1","customConditional":"show = row.operator === \'CONTAINS\'","type":"textfield","input":true}]},{"label":"Hello","tableView":true,"key":"textField","customConditional":"show = row.operator === \'CONTAINS\'","type":"textfield","input":true}]},{"label":"Path","widget":"choicesjs","tableView":true,"dataSrc":"url","data":{"url":"/test","headers":[{"key":"","value":""}]},"key":"path","type":"select","input":true,"disableLimit":false},{"label":"Operator","widget":"choicesjs","tableView":true,"data":{"values":[{"label":"default","value":"default"},{"label":"Contains","value":"CONTAINS"}]},"key":"operator","type":"select","input":true},{"label":"Value","tableView":true,"key":"value1","customConditional":"show = row.operator === \'CONTAINS\'","type":"textfield","input":true},{"label":"Hello","tableView":true,"key":"textField","customConditional":"show = row.operator === \'CONTAINS\'","type":"textfield","input":true},{"type":"button","label":"Submit","key":"submit","disableOnInvalid":true,"input":true,"tableView":false}]'
|
|
170
166
|
},
|
|
171
|
-
|
|
172
|
-
|
|
167
|
+
valueProperty: "key",
|
|
168
|
+
multiple: false
|
|
173
169
|
},
|
|
174
170
|
{
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
171
|
+
type: "select",
|
|
172
|
+
input: true,
|
|
173
|
+
label: "",
|
|
174
|
+
key: "eq",
|
|
175
|
+
placeholder: "Select comparison",
|
|
176
|
+
template: "<span>{{ item.label }}</span>",
|
|
177
|
+
dataSrc: "values",
|
|
178
|
+
data: {
|
|
179
|
+
values: [
|
|
184
180
|
{
|
|
185
|
-
|
|
186
|
-
|
|
181
|
+
value: "",
|
|
182
|
+
label: ""
|
|
187
183
|
},
|
|
188
184
|
{
|
|
189
|
-
|
|
190
|
-
|
|
185
|
+
value: "equals",
|
|
186
|
+
label: "Equals"
|
|
191
187
|
},
|
|
192
188
|
{
|
|
193
|
-
|
|
194
|
-
|
|
189
|
+
value: "notEqual",
|
|
190
|
+
label: "Does Not Equal"
|
|
195
191
|
}
|
|
196
192
|
],
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
193
|
+
json: "",
|
|
194
|
+
url: "",
|
|
195
|
+
resource: ""
|
|
200
196
|
},
|
|
201
|
-
|
|
202
|
-
|
|
197
|
+
valueProperty: "value",
|
|
198
|
+
multiple: false
|
|
203
199
|
},
|
|
204
200
|
{
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
201
|
+
input: true,
|
|
202
|
+
type: "textfield",
|
|
203
|
+
inputType: "text",
|
|
204
|
+
label: "",
|
|
205
|
+
key: "value",
|
|
206
|
+
placeholder: "Enter value",
|
|
207
|
+
multiple: false
|
|
212
208
|
}
|
|
213
209
|
]
|
|
214
210
|
},
|
|
215
211
|
{
|
|
216
|
-
|
|
212
|
+
components: [
|
|
217
213
|
{
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
214
|
+
key: "well2",
|
|
215
|
+
type: "well",
|
|
216
|
+
input: false,
|
|
217
|
+
components: [
|
|
222
218
|
{
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
219
|
+
key: "html",
|
|
220
|
+
type: "htmlelement",
|
|
221
|
+
tag: "h4",
|
|
222
|
+
input: false,
|
|
223
|
+
content:
|
|
224
|
+
'Or you can provide your own custom JavaScript or <a href="http://jsonlogic.com" target="_blank">JSON</a> condition logic here',
|
|
225
|
+
className: ""
|
|
229
226
|
},
|
|
230
227
|
{
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
228
|
+
label: "",
|
|
229
|
+
type: "textarea",
|
|
230
|
+
input: true,
|
|
231
|
+
key: "custom",
|
|
232
|
+
editorComponents: [
|
|
236
233
|
{
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
234
|
+
label: "Rules",
|
|
235
|
+
reorder: false,
|
|
236
|
+
addAnotherPosition: "bottom",
|
|
237
|
+
layoutFixed: false,
|
|
238
|
+
enableRowGroups: false,
|
|
239
|
+
initEmpty: false,
|
|
240
|
+
tableView: false,
|
|
241
|
+
defaultValue: [
|
|
245
242
|
{
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
path: {},
|
|
244
|
+
operator: ""
|
|
248
245
|
}
|
|
249
246
|
],
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
247
|
+
key: "rules",
|
|
248
|
+
type: "datagrid",
|
|
249
|
+
input: true,
|
|
250
|
+
components: [
|
|
254
251
|
{
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
252
|
+
label: "Path",
|
|
253
|
+
widget: "choicesjs",
|
|
254
|
+
tableView: true,
|
|
255
|
+
dataSrc: "url",
|
|
256
|
+
data: {
|
|
257
|
+
url: "/test",
|
|
258
|
+
headers: [
|
|
262
259
|
{
|
|
263
|
-
|
|
264
|
-
|
|
260
|
+
key: "",
|
|
261
|
+
value: ""
|
|
265
262
|
}
|
|
266
263
|
]
|
|
267
264
|
},
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
265
|
+
key: "path",
|
|
266
|
+
type: "select",
|
|
267
|
+
input: true,
|
|
268
|
+
disableLimit: false
|
|
272
269
|
},
|
|
273
270
|
{
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
271
|
+
label: "Operator",
|
|
272
|
+
widget: "choicesjs",
|
|
273
|
+
tableView: true,
|
|
274
|
+
data: {
|
|
275
|
+
values: [
|
|
279
276
|
{
|
|
280
|
-
|
|
281
|
-
|
|
277
|
+
label: "default",
|
|
278
|
+
value: "default"
|
|
282
279
|
},
|
|
283
280
|
{
|
|
284
|
-
|
|
285
|
-
|
|
281
|
+
label: "Contains",
|
|
282
|
+
value: "CONTAINS"
|
|
286
283
|
}
|
|
287
284
|
]
|
|
288
285
|
},
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
286
|
+
key: "operator",
|
|
287
|
+
type: "select",
|
|
288
|
+
input: true
|
|
292
289
|
},
|
|
293
290
|
{
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
291
|
+
customClass: "mt-0 mb-0",
|
|
292
|
+
key: "fieldset",
|
|
293
|
+
type: "fieldset",
|
|
294
|
+
label: "Field Set",
|
|
295
|
+
input: false,
|
|
296
|
+
tableView: false,
|
|
297
|
+
components: [
|
|
301
298
|
{
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
299
|
+
label: "Value",
|
|
300
|
+
tableView: true,
|
|
301
|
+
key: "value1",
|
|
302
|
+
customConditional: "show = row.operator === 'CONTAINS'",
|
|
303
|
+
type: "textfield",
|
|
304
|
+
input: true
|
|
308
305
|
}
|
|
309
306
|
]
|
|
310
307
|
},
|
|
311
308
|
{
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
309
|
+
label: "Hello",
|
|
310
|
+
tableView: true,
|
|
311
|
+
key: "textField",
|
|
312
|
+
customConditional: "show = row.operator === 'CONTAINS'",
|
|
313
|
+
type: "textfield",
|
|
314
|
+
input: true
|
|
318
315
|
}
|
|
319
316
|
]
|
|
320
317
|
},
|
|
321
318
|
{
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
319
|
+
type: "button",
|
|
320
|
+
label: "Submit",
|
|
321
|
+
key: "submit",
|
|
322
|
+
disableOnInvalid: true,
|
|
323
|
+
input: true,
|
|
324
|
+
tableView: false
|
|
328
325
|
}
|
|
329
326
|
],
|
|
330
|
-
|
|
327
|
+
placeholder:
|
|
328
|
+
'// Example: Only execute if submitted roles has \'authenticated\'.\nJavaScript: execute = (data.roles.indexOf(\'authenticated\') !== -1);\nJSON: { "in": [ "authenticated", { "var": "data.roles" } ] }'
|
|
331
329
|
}
|
|
332
330
|
]
|
|
333
331
|
}
|
|
@@ -340,28 +338,28 @@ Sandbox.args = {
|
|
|
340
338
|
]
|
|
341
339
|
},
|
|
342
340
|
{
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
341
|
+
key: "html2",
|
|
342
|
+
type: "htmlelement",
|
|
343
|
+
tag: "hr",
|
|
344
|
+
input: false,
|
|
345
|
+
content: "",
|
|
346
|
+
className: ""
|
|
349
347
|
},
|
|
350
348
|
{
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
349
|
+
type: "button",
|
|
350
|
+
input: true,
|
|
351
|
+
label: "Save Action",
|
|
352
|
+
key: "submit",
|
|
353
|
+
size: "md",
|
|
354
|
+
leftIcon: "",
|
|
355
|
+
rightIcon: "",
|
|
356
|
+
block: false,
|
|
357
|
+
action: "submit",
|
|
358
|
+
disableOnInvalid: true,
|
|
359
|
+
theme: "primary"
|
|
362
360
|
}
|
|
363
361
|
],
|
|
364
|
-
|
|
362
|
+
action: "/project/5d0797bc872fc7d140559857/form/62b18b10fbbba513555c6c5e/action"
|
|
365
363
|
}
|
|
366
364
|
},
|
|
367
365
|
options: { template: "tailwind", iconset: "bx" }
|
|
@@ -8,6 +8,7 @@ import cloneDeep from "lodash/cloneDeep";
|
|
|
8
8
|
import noop from "lodash/noop";
|
|
9
9
|
import PropTypes from "prop-types";
|
|
10
10
|
import React from "react";
|
|
11
|
+
|
|
11
12
|
import { callLast } from "../../utils/callLast";
|
|
12
13
|
|
|
13
14
|
Components.setComponents(AllComponents);
|
|
@@ -175,7 +176,7 @@ export class FormBuilder extends React.Component<FormBuilderProps, any> {
|
|
|
175
176
|
|
|
176
177
|
whenComponentsChange(components: ComponentSchema[]) {
|
|
177
178
|
this.setState({ components }, () => {
|
|
178
|
-
this.props?.onChange(components);
|
|
179
|
+
this.props?.onChange && this.props.onChange(components);
|
|
179
180
|
});
|
|
180
181
|
}
|
|
181
182
|
|