@saltcorn/builder 1.4.0-beta.5 → 1.4.0-beta.7
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saltcorn/builder",
|
|
3
|
-
"version": "1.4.0-beta.
|
|
3
|
+
"version": "1.4.0-beta.7",
|
|
4
4
|
"description": "Drag and drop view builder for Saltcorn, open-source no-code platform",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"homepage": "https://saltcorn.com",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@babel/preset-react": "7.24.7",
|
|
21
21
|
"@craftjs/core": "0.1.0-beta.20",
|
|
22
22
|
"@craftjs/utils": "0.1.0-beta.20",
|
|
23
|
-
"@saltcorn/common-code": "1.4.0-beta.
|
|
23
|
+
"@saltcorn/common-code": "1.4.0-beta.7",
|
|
24
24
|
"saltcorn-craft-layers-noeye": "0.1.0-beta.22",
|
|
25
25
|
"@fonticonpicker/react-fonticonpicker": "1.2.0",
|
|
26
26
|
"@fortawesome/fontawesome-svg-core": "1.2.34",
|
|
@@ -114,6 +114,7 @@ const ActionSettings = () => {
|
|
|
114
114
|
step_action_names: node.data.props.step_action_names,
|
|
115
115
|
setting_action_n: node.data.props.setting_action_n,
|
|
116
116
|
spinner: node.data.props.spinner,
|
|
117
|
+
run_async: node.data.props.run_async,
|
|
117
118
|
is_submit_action: node.data.props.is_submit_action,
|
|
118
119
|
}));
|
|
119
120
|
const {
|
|
@@ -134,6 +135,7 @@ const ActionSettings = () => {
|
|
|
134
135
|
step_only_ifs,
|
|
135
136
|
step_action_names,
|
|
136
137
|
spinner,
|
|
138
|
+
run_async,
|
|
137
139
|
is_submit_action,
|
|
138
140
|
} = node;
|
|
139
141
|
const options = useContext(optionsCtx);
|
|
@@ -228,6 +230,8 @@ const ActionSettings = () => {
|
|
|
228
230
|
JSON.stringify(configuration?.steps?.[use_setting_action_n]),
|
|
229
231
|
]);
|
|
230
232
|
|
|
233
|
+
const actionFlags = (options.actionAttributes || {})[name] || {};
|
|
234
|
+
|
|
231
235
|
return (
|
|
232
236
|
<div>
|
|
233
237
|
<table className="w-100">
|
|
@@ -349,6 +353,18 @@ const ActionSettings = () => {
|
|
|
349
353
|
/>
|
|
350
354
|
<label className="form-check-label">Spinner on click</label>
|
|
351
355
|
</div>
|
|
356
|
+
{actionFlags.supportsAsync ? (
|
|
357
|
+
<div className="form-check">
|
|
358
|
+
<input
|
|
359
|
+
className="form-check-input"
|
|
360
|
+
name="block"
|
|
361
|
+
type="checkbox"
|
|
362
|
+
checked={run_async}
|
|
363
|
+
onChange={setAProp("run_async", { checked: true })}
|
|
364
|
+
/>
|
|
365
|
+
<label className="form-check-label">Run async</label>
|
|
366
|
+
</div>
|
|
367
|
+
) : null}
|
|
352
368
|
{action_style !== "on_page_load" ? (
|
|
353
369
|
<BlockSetting block={block} setProp={setProp} />
|
|
354
370
|
) : null}
|
|
@@ -946,6 +946,19 @@ const ConfigField = ({
|
|
|
946
946
|
}, []);
|
|
947
947
|
}
|
|
948
948
|
|
|
949
|
+
const intDispFn = () => (
|
|
950
|
+
<input
|
|
951
|
+
type="number"
|
|
952
|
+
className={`field-${field?.name} form-control`}
|
|
953
|
+
step={field.step || 1}
|
|
954
|
+
min={field.min}
|
|
955
|
+
max={field.max}
|
|
956
|
+
name={field?.name}
|
|
957
|
+
value={value || ""}
|
|
958
|
+
onChange={(e) => e.target && myOnChange(e.target.value)}
|
|
959
|
+
/>
|
|
960
|
+
);
|
|
961
|
+
|
|
949
962
|
const dispatch = {
|
|
950
963
|
String() {
|
|
951
964
|
if (field.attributes?.options) {
|
|
@@ -1017,18 +1030,8 @@ const ConfigField = ({
|
|
|
1017
1030
|
))}
|
|
1018
1031
|
</select>
|
|
1019
1032
|
),
|
|
1020
|
-
Integer:
|
|
1021
|
-
|
|
1022
|
-
type="number"
|
|
1023
|
-
className={`field-${field?.name} form-control`}
|
|
1024
|
-
step={field.step || 1}
|
|
1025
|
-
min={field.min}
|
|
1026
|
-
max={field.max}
|
|
1027
|
-
name={field?.name}
|
|
1028
|
-
value={value || ""}
|
|
1029
|
-
onChange={(e) => e.target && myOnChange(e.target.value)}
|
|
1030
|
-
/>
|
|
1031
|
-
),
|
|
1033
|
+
Integer: intDispFn,
|
|
1034
|
+
number: intDispFn,
|
|
1032
1035
|
Float: () => (
|
|
1033
1036
|
<input
|
|
1034
1037
|
type="number"
|
|
@@ -204,6 +204,7 @@ const layoutToNodes = (
|
|
|
204
204
|
step_action_names={segment.step_action_names || ""}
|
|
205
205
|
confirm={segment.confirm}
|
|
206
206
|
spinner={segment.spinner}
|
|
207
|
+
run_async={segment.run_async || false}
|
|
207
208
|
is_submit_action={segment.is_submit_action}
|
|
208
209
|
configuration={segment.configuration || {}}
|
|
209
210
|
block={segment.block || false}
|
|
@@ -702,6 +703,7 @@ const craftToSaltcorn = (nodes, startFrom = "ROOT", options) => {
|
|
|
702
703
|
confirm: node.props.confirm,
|
|
703
704
|
spinner: node.props.spinner,
|
|
704
705
|
is_submit_action: node.props.is_submit_action,
|
|
706
|
+
run_async: node.props.run_async,
|
|
705
707
|
nsteps: node.props.nsteps,
|
|
706
708
|
step_only_ifs: node.props.step_only_ifs,
|
|
707
709
|
step_action_names: node.props.step_action_names,
|
|
@@ -715,6 +717,7 @@ const craftToSaltcorn = (nodes, startFrom = "ROOT", options) => {
|
|
|
715
717
|
configuration: node.props.configuration,
|
|
716
718
|
confirm: node.props.confirm,
|
|
717
719
|
is_submit_action: node.props.is_submit_action,
|
|
720
|
+
run_async: node.props.run_async,
|
|
718
721
|
action_name: node.props.name,
|
|
719
722
|
...(node.props.name !== "Clear" && node.props.action_row_variable
|
|
720
723
|
? {
|