@saltcorn/builder 0.9.5-beta.7 → 0.9.5-beta.9

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": "0.9.5-beta.7",
3
+ "version": "0.9.5-beta.9",
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.9.4",
21
21
  "@craftjs/core": "0.1.0-beta.20",
22
22
  "@craftjs/utils": "0.1.0-beta.20",
23
- "@saltcorn/common-code": "0.9.5-beta.7",
23
+ "@saltcorn/common-code": "0.9.5-beta.9",
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",
@@ -103,6 +103,7 @@ const ActionSettings = () => {
103
103
  action_style: node.data.props.action_style,
104
104
  action_size: node.data.props.action_size,
105
105
  action_icon: node.data.props.action_icon,
106
+ action_title: node.data.props.action_title,
106
107
  action_bgcol: node.data.props.action_bgcol,
107
108
  action_bordercol: node.data.props.action_bordercol,
108
109
  action_textcol: node.data.props.action_textcol,
@@ -123,6 +124,7 @@ const ActionSettings = () => {
123
124
  confirm,
124
125
  configuration,
125
126
  action_label,
127
+ action_title,
126
128
  action_style,
127
129
  nsteps,
128
130
  setting_action_n,
@@ -56,6 +56,7 @@ const DropDownFilterSettings = () => {
56
56
  label_formula,
57
57
  full_width,
58
58
  where,
59
+ all_options,
59
60
  } = useNode((node) => ({
60
61
  name: node.data.props.name,
61
62
  block: node.data.props.block,
@@ -63,10 +64,14 @@ const DropDownFilterSettings = () => {
63
64
  full_width: node.data.props.full_width,
64
65
  label_formula: node.data.props.label_formula,
65
66
  where: node.data.props.where,
67
+ all_options: node.data.props.all_options,
66
68
  }));
67
69
  const options = useContext(optionsCtx);
68
70
  const setAProp = setAPropGen(setProp);
69
-
71
+ let select_all_options;
72
+ const field = options.fields.find((f) => f.name === name);
73
+ if (field?.type === "String" && field.attributes?.options)
74
+ select_all_options = true;
70
75
  return (
71
76
  <table className="w-100">
72
77
  <tbody>
@@ -153,6 +158,23 @@ const DropDownFilterSettings = () => {
153
158
  </div>
154
159
  </td>
155
160
  </tr>
161
+ {select_all_options ? (
162
+ <tr>
163
+ <td></td>
164
+ <td>
165
+ <div className="form-check">
166
+ <input
167
+ className="form-check-input"
168
+ name="block"
169
+ type="checkbox"
170
+ checked={all_options}
171
+ onChange={setAProp("all_options", { checked: true })}
172
+ />
173
+ <label className="form-check-label">All options</label>
174
+ </div>
175
+ </td>
176
+ </tr>
177
+ ) : null}
156
178
  </tbody>
157
179
  </table>
158
180
  );
@@ -173,6 +195,7 @@ DropDownFilter.craft = {
173
195
  "neutral_label",
174
196
  "label_formula",
175
197
  "where",
198
+ "all_options",
176
199
  "block",
177
200
  ],
178
201
  },
@@ -97,6 +97,7 @@ const DropMenuSettings = () => {
97
97
  block: node.data.props.block,
98
98
  action_style: node.data.props.action_style,
99
99
  action_size: node.data.props.action_size,
100
+ action_title: node.data.props.action_title,
100
101
  action_icon: node.data.props.action_icon,
101
102
  action_bgcol: node.data.props.action_bgcol,
102
103
  action_bordercol: node.data.props.action_bordercol,
@@ -177,6 +178,7 @@ DropMenu.craft = {
177
178
  "action_size",
178
179
  "action_icon",
179
180
  "action_bgcol",
181
+ "action_title",
180
182
  "action_bordercol",
181
183
  "action_textcol",
182
184
  "menu_direction",
@@ -107,6 +107,7 @@ const LinkSettings = () => {
107
107
  target_blank: node.data.props.target_blank,
108
108
  link_style: node.data.props.link_style,
109
109
  link_size: node.data.props.link_size,
110
+ link_title: node.data.props.link_title,
110
111
  link_icon: node.data.props.link_icon,
111
112
  link_bgcol: node.data.props.link_bgcol,
112
113
  link_bordercol: node.data.props.link_bordercol,
@@ -389,6 +390,7 @@ Link.craft = {
389
390
  "link_size",
390
391
  "link_icon",
391
392
  "link_style",
393
+ "link_title",
392
394
  "link_bgcol",
393
395
  "link_bordercol",
394
396
  "link_textcol",
@@ -113,6 +113,7 @@ const ViewLinkSettings = () => {
113
113
  link_style: node.data.props.link_style,
114
114
  link_size: node.data.props.link_size,
115
115
  link_icon: node.data.props.link_icon,
116
+ link_title: node.data.props.link_title,
116
117
  textStyle: node.data.props.textStyle,
117
118
  link_bgcol: node.data.props.link_bgcol,
118
119
  link_bordercol: node.data.props.link_bordercol,
@@ -400,6 +401,7 @@ ViewLink.craft = {
400
401
  "link_style",
401
402
  "link_icon",
402
403
  "link_size",
404
+ "link_title",
403
405
  "link_target_blank",
404
406
  "link_bgcol",
405
407
  "link_bordercol",
@@ -909,6 +909,8 @@ const ConfigField = ({
909
909
  const seloptions = field.options.map((o, ix) =>
910
910
  o.name && o.label
911
911
  ? { value: o.name, label: o.label }
912
+ : o.value && o.label
913
+ ? { value: o.value, label: o.label }
912
914
  : { value: o, label: o }
913
915
  );
914
916
  return (
@@ -942,6 +944,10 @@ const ConfigField = ({
942
944
  <option key={ix} value={o.name}>
943
945
  {o.label}
944
946
  </option>
947
+ ) : o.value && o.label ? (
948
+ <option key={ix} value={o.value}>
949
+ {o.label}
950
+ </option>
945
951
  ) : (
946
952
  <option key={ix}>{o}</option>
947
953
  )
@@ -1211,11 +1217,7 @@ export class ErrorBoundary extends React.Component {
1211
1217
  componentDidCatch(error, errorInfo) {
1212
1218
  // You can also log the error to an error reporting service
1213
1219
  //logErrorToMyService(error, errorInfo);
1214
- console.log(
1215
- "ErrorBoundary reporting: ",
1216
- JSON.stringify(error),
1217
- JSON.stringify(errorInfo)
1218
- );
1220
+ console.error(error);
1219
1221
 
1220
1222
  if (!this.state.reported) {
1221
1223
  const data = {
@@ -1294,6 +1296,9 @@ const ButtonOrLinkSettingsRows = ({
1294
1296
  <option value={addBtnClass("btn-outline-secondary")}>
1295
1297
  Secondary outline button
1296
1298
  </option>
1299
+ <option value={addBtnClass("btn-outline-success")}>
1300
+ Success outline button
1301
+ </option>
1297
1302
  <option value={addBtnClass("btn-outline-danger")}>
1298
1303
  Danger outline button
1299
1304
  </option>
@@ -1396,6 +1401,20 @@ const ButtonOrLinkSettingsRows = ({
1396
1401
  </tr>,
1397
1402
  ]
1398
1403
  : []),
1404
+ values[keyPrefix + "style"] !== "on_page_load" ? (
1405
+ <tr key="btntitle">
1406
+ <td>
1407
+ <label>Hover title</label>
1408
+ </td>
1409
+ <td>
1410
+ <input
1411
+ className="form-control"
1412
+ value={values[keyPrefix + "title"]}
1413
+ onChange={setAProp(keyPrefix + "title")}
1414
+ />
1415
+ </td>
1416
+ </tr>
1417
+ ) : null,
1399
1418
  ];
1400
1419
  };
1401
1420
 
@@ -173,6 +173,7 @@ const layoutToNodes = (layout, query, actions, parent = "ROOT", options) => {
173
173
  action_style={segment.action_style || "btn-primary"}
174
174
  action_size={segment.action_size || ""}
175
175
  action_icon={segment.action_icon || ""}
176
+ action_title={segment.action_title || ""}
176
177
  action_bgcol={segment.action_bgcol || ""}
177
178
  action_bordercol={segment.action_bordercol || ""}
178
179
  action_textcol={segment.action_textcol || ""}
@@ -628,6 +629,7 @@ const craftToSaltcorn = (nodes, startFrom = "ROOT", options) => {
628
629
  action_style: node.props.action_style,
629
630
  action_size: node.props.action_size,
630
631
  action_icon: node.props.action_icon,
632
+ action_title: node.props.action_title,
631
633
  action_bgcol: node.props.action_bgcol,
632
634
  action_bordercol: node.props.action_bordercol,
633
635
  action_textcol: node.props.action_textcol,
@@ -658,6 +660,7 @@ const craftToSaltcorn = (nodes, startFrom = "ROOT", options) => {
658
660
  action_style: node.props.action_style,
659
661
  action_size: node.props.action_size,
660
662
  action_icon: node.props.action_icon,
663
+ action_title: node.props.action_title,
661
664
  action_bgcol: node.props.action_bgcol,
662
665
  action_bordercol: node.props.action_bordercol,
663
666
  action_textcol: node.props.action_textcol,