@saltcorn/builder 1.5.0-beta.1 → 1.5.0-beta.11

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.
@@ -0,0 +1,96 @@
1
+ /*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */
6
+
7
+ /*!
8
+ Copyright (c) 2017 Jed Watson.
9
+ Licensed under the MIT License (MIT), see
10
+ http://jedwatson.github.io/classnames
11
+ */
12
+
13
+ /*!
14
+ * Font Awesome Free 5.15.2 by @fontawesome - https://fontawesome.com
15
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
16
+ */
17
+
18
+ /*! *****************************************************************************
19
+ Copyright (c) Microsoft Corporation.
20
+
21
+ Permission to use, copy, modify, and/or distribute this software for any
22
+ purpose with or without fee is hereby granted.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
25
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
26
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
27
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
28
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
29
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
30
+ PERFORMANCE OF THIS SOFTWARE.
31
+ ***************************************************************************** */
32
+
33
+ /*! *****************************************************************************
34
+ Copyright (c) Microsoft Corporation. All rights reserved.
35
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
36
+ this file except in compliance with the License. You may obtain a copy of the
37
+ License at http://www.apache.org/licenses/LICENSE-2.0
38
+
39
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
40
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
41
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
42
+ MERCHANTABLITY OR NON-INFRINGEMENT.
43
+
44
+ See the Apache Version 2.0 License for specific language governing permissions
45
+ and limitations under the License.
46
+ ***************************************************************************** */
47
+
48
+ /*!*
49
+ * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
50
+ * For licensing, see LICENSE.md.
51
+ */
52
+
53
+ /**
54
+ * @license
55
+ * Lodash <https://lodash.com/>
56
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
57
+ * Released under MIT license <https://lodash.com/license>
58
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
59
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
60
+ */
61
+
62
+ /** @license React v0.19.1
63
+ * scheduler.production.min.js
64
+ *
65
+ * Copyright (c) Facebook, Inc. and its affiliates.
66
+ *
67
+ * This source code is licensed under the MIT license found in the
68
+ * LICENSE file in the root directory of this source tree.
69
+ */
70
+
71
+ /** @license React v16.13.1
72
+ * react-dom.production.min.js
73
+ *
74
+ * Copyright (c) Facebook, Inc. and its affiliates.
75
+ *
76
+ * This source code is licensed under the MIT license found in the
77
+ * LICENSE file in the root directory of this source tree.
78
+ */
79
+
80
+ /** @license React v16.13.1
81
+ * react-is.production.min.js
82
+ *
83
+ * Copyright (c) Facebook, Inc. and its affiliates.
84
+ *
85
+ * This source code is licensed under the MIT license found in the
86
+ * LICENSE file in the root directory of this source tree.
87
+ */
88
+
89
+ /** @license React v16.13.1
90
+ * react.production.min.js
91
+ *
92
+ * Copyright (c) Facebook, Inc. and its affiliates.
93
+ *
94
+ * This source code is licensed under the MIT license found in the
95
+ * LICENSE file in the root directory of this source tree.
96
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/builder",
3
- "version": "1.5.0-beta.1",
3
+ "version": "1.5.0-beta.11",
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.5.0-beta.1",
23
+ "@saltcorn/common-code": "1.5.0-beta.11",
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",
@@ -467,6 +467,7 @@ const ActionElem = ({ connectors, options }) => (
467
467
  block={false}
468
468
  minRole={100}
469
469
  confirm={false}
470
+ spinner={true}
470
471
  action_label={""}
471
472
  isFormula={{}}
472
473
  rndid={rand_ident()}
@@ -233,6 +233,7 @@ const AggregationSettings = () => {
233
233
  type="text"
234
234
  className="form-control"
235
235
  value={aggwhere}
236
+ placeholder="Example: x === y"
236
237
  spellCheck={false}
237
238
  onChange={setAProp("aggwhere")}
238
239
  onInput={(e) => validate_expression_elem($(e.target))}
@@ -945,25 +945,24 @@ const ContainerSettings = () => {
945
945
  {["show", "edit", "filter", "list"].includes(options.mode) && (
946
946
  <SettingsSectionHeaderRow title="Formula - show if true" />
947
947
  )}
948
- {["show", "edit", "filter", "list"].includes(options.mode) && (
949
- <tr>
950
- <td colSpan={2}>
951
- <input
952
- type="text"
953
- className="form-control text-to-display"
954
- value={showIfFormula}
955
- spellCheck={false}
956
- onChange={setAProp("showIfFormula")}
957
- onInput={(e) => validate_expression_elem($(e.target))}
958
- />
959
- <div style={{ marginTop: "-5px" }}>
960
- <small className="text-muted font-monospace">
961
- FORMULA <FormulaTooltip />
962
- </small>
963
- </div>
964
- </td>
965
- </tr>
966
- )}
948
+ <tr>
949
+ <td colSpan={2}>
950
+ <input
951
+ type="text"
952
+ placeholder="Example: x === y"
953
+ className="form-control text-to-display"
954
+ value={showIfFormula}
955
+ spellCheck={false}
956
+ onChange={setAProp("showIfFormula")}
957
+ onInput={(e) => validate_expression_elem($(e.target))}
958
+ />
959
+ <div style={{ marginTop: "-5px" }}>
960
+ <small className="text-muted font-monospace">
961
+ FORMULA <FormulaTooltip />
962
+ </small>
963
+ </div>
964
+ </td>
965
+ </tr>
967
966
  <SettingsSectionHeaderRow title="Role" />
968
967
  {options.roles.map(({ role, id }) => (
969
968
  <tr key={id}>
@@ -181,6 +181,7 @@ const TabsSettings = () => {
181
181
  deeplink: node.data.props.deeplink,
182
182
  disable_inactive: node.data.props.disable_inactive,
183
183
  serverRendered: node.data.props.serverRendered,
184
+ lazyLoadViews: node.data.props.lazyLoadViews,
184
185
  setting_tab_n: node.data.props.setting_tab_n,
185
186
  tabId: node.data.props.tabId,
186
187
  titles: node.data.props.titles,
@@ -200,6 +201,7 @@ const TabsSettings = () => {
200
201
  ntabs,
201
202
  field,
202
203
  serverRendered,
204
+ lazyLoadViews,
203
205
  tabId,
204
206
  showif,
205
207
  setting_tab_n,
@@ -275,22 +277,40 @@ const TabsSettings = () => {
275
277
  ) : (
276
278
  <Fragment>
277
279
  {tabsStyle === "Accordion" ? (
278
- <tr>
279
- <td colSpan="2">
280
- <div className="form-check">
281
- <input
282
- className="form-check-input"
283
- name="block"
284
- type="checkbox"
285
- checked={independent}
286
- onChange={setAProp("independent", { checked: true })}
287
- />
288
- <label className="form-check-label">
289
- Open independently
290
- </label>
291
- </div>
292
- </td>
293
- </tr>
280
+ <Fragment>
281
+ <tr>
282
+ <td colSpan="2">
283
+ <div className="form-check">
284
+ <input
285
+ className="form-check-input"
286
+ name="block"
287
+ type="checkbox"
288
+ checked={independent}
289
+ onChange={setAProp("independent", { checked: true })}
290
+ />
291
+ <label className="form-check-label">
292
+ Open independently
293
+ </label>
294
+ </div>
295
+ </td>
296
+ </tr>
297
+ <tr>
298
+ <td colSpan="2">
299
+ <div className="form-check">
300
+ <input
301
+ className="form-check-input"
302
+ name="block"
303
+ type="checkbox"
304
+ checked={lazyLoadViews}
305
+ onChange={setAProp("lazyLoadViews", { checked: true })}
306
+ />
307
+ <label className="form-check-label">
308
+ Lazy load views
309
+ </label>
310
+ </div>
311
+ </td>
312
+ </tr>
313
+ </Fragment>
294
314
  ) : (
295
315
  <Fragment>
296
316
  <tr>
@@ -339,6 +359,22 @@ const TabsSettings = () => {
339
359
  </td>
340
360
  </tr>
341
361
  ) : null}
362
+ <tr>
363
+ <td colSpan="2">
364
+ <div className="form-check">
365
+ <input
366
+ className="form-check-input"
367
+ name="block"
368
+ type="checkbox"
369
+ checked={lazyLoadViews}
370
+ onChange={setAProp("lazyLoadViews", { checked: true })}
371
+ />
372
+ <label className="form-check-label">
373
+ Lazy load views
374
+ </label>
375
+ </div>
376
+ </td>
377
+ </tr>
342
378
  </Fragment>
343
379
  )}
344
380
  {tabsStyle === "Accordion" ? (
@@ -383,6 +383,7 @@ const ViewSettings = () => {
383
383
  </label>
384
384
  <input
385
385
  type="text"
386
+ placeholder="Example: {x: y}"
386
387
  className="viewlink-label form-control"
387
388
  value={extra_state_fml}
388
389
  onChange={setAProp("extra_state_fml")}
@@ -313,6 +313,7 @@ const ViewLinkSettings = () => {
313
313
  </label>
314
314
  <input
315
315
  type="text"
316
+ placeholder="Example: {x: y}"
316
317
  className="viewlink-label form-control"
317
318
  value={extra_state_fml}
318
319
  onChange={setAProp("extra_state_fml")}
@@ -362,7 +363,6 @@ const ViewLinkSettings = () => {
362
363
  <TextStyleSetting textStyle={textStyle} setProp={setProp} />
363
364
  <table>
364
365
  <tbody>
365
- <MinRoleSettingRow minRole={minRole} setProp={setProp} />
366
366
  {use_view_name ? (
367
367
  <tr>
368
368
  <td colSpan="2">
@@ -981,8 +981,7 @@ const ConfigField = ({
981
981
  ))}
982
982
  </select>
983
983
  );
984
- }
985
- else if (field.attributes?.calcOptions) {
984
+ } else if (field.attributes?.calcOptions) {
986
985
  return (
987
986
  <select
988
987
  className={`field-${field?.name} form-control form-select`}
@@ -993,18 +992,18 @@ const ConfigField = ({
993
992
  data-calc-options={encodeURIComponent(
994
993
  JSON.stringify(field.attributes.calcOptions)
995
994
  )}
996
- autocomplete= {"off"}
995
+ autocomplete={"off"}
997
996
  data-fieldname={field?.name}
998
997
  >
999
998
  <option value=""></option>
1000
999
  </select>
1001
1000
  );
1002
- }
1003
- else
1001
+ } else
1004
1002
  return (
1005
1003
  <input
1006
1004
  type="text"
1007
1005
  name={field?.name}
1006
+ placeholder={field.attributes?.placeholder || ""}
1008
1007
  className={`field-${field?.name} form-control`}
1009
1008
  value={value || ""}
1010
1009
  spellCheck={false}
@@ -301,6 +301,7 @@ const layoutToNodes = (
301
301
  acc_init_opens={segment.acc_init_opens}
302
302
  disable_inactive={segment.disable_inactive}
303
303
  serverRendered={segment.serverRendered}
304
+ lazyLoadViews={segment.lazyLoadViews}
304
305
  tabId={segment.tabId}
305
306
  field={segment.field}
306
307
  tabsStyle={segment.tabsStyle}
@@ -658,6 +659,7 @@ const craftToSaltcorn = (nodes, startFrom = "ROOT", options) => {
658
659
  deeplink: node.props.deeplink,
659
660
  disable_inactive: node.props.disable_inactive,
660
661
  serverRendered: node.props.serverRendered,
662
+ lazyLoadViews: node.props.lazyLoadViews,
661
663
  tabId: node.props.tabId,
662
664
  ntabs: node.props.ntabs,
663
665
  setting_tab_n: node.props.setting_tab_n,