@saltcorn/builder 1.4.0-beta.6 → 1.4.0-beta.8

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.6",
3
+ "version": "1.4.0-beta.8",
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.6",
23
+ "@saltcorn/common-code": "1.4.0-beta.8",
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);
@@ -349,6 +351,16 @@ const ActionSettings = () => {
349
351
  />
350
352
  <label className="form-check-label">Spinner on click</label>
351
353
  </div>
354
+ <div className="form-check">
355
+ <input
356
+ className="form-check-input"
357
+ name="block"
358
+ type="checkbox"
359
+ checked={run_async}
360
+ onChange={setAProp("run_async", { checked: true })}
361
+ />
362
+ <label className="form-check-label">Run async</label>
363
+ </div>
352
364
  {action_style !== "on_page_load" ? (
353
365
  <BlockSetting block={block} setProp={setProp} />
354
366
  ) : 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
- <input
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
  ? {