@saltcorn/builder 0.0.1-beta.1
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/.babelrc +3 -0
- package/CHANGELOG.md +8 -0
- package/dist/builder_bundle.js +80 -0
- package/package.json +47 -0
- package/src/components/Builder.js +477 -0
- package/src/components/Library.js +224 -0
- package/src/components/RenderNode.js +203 -0
- package/src/components/Toolbox.js +688 -0
- package/src/components/context.js +9 -0
- package/src/components/elements/Action.js +204 -0
- package/src/components/elements/Aggregation.js +179 -0
- package/src/components/elements/BoxModelEditor.js +398 -0
- package/src/components/elements/Card.js +152 -0
- package/src/components/elements/Column.js +63 -0
- package/src/components/elements/Columns.js +201 -0
- package/src/components/elements/Container.js +947 -0
- package/src/components/elements/DropDownFilter.js +154 -0
- package/src/components/elements/DropMenu.js +156 -0
- package/src/components/elements/Empty.js +30 -0
- package/src/components/elements/Field.js +239 -0
- package/src/components/elements/HTMLCode.js +61 -0
- package/src/components/elements/Image.js +320 -0
- package/src/components/elements/JoinField.js +206 -0
- package/src/components/elements/LineBreak.js +46 -0
- package/src/components/elements/Link.js +305 -0
- package/src/components/elements/SearchBar.js +141 -0
- package/src/components/elements/Tabs.js +347 -0
- package/src/components/elements/Text.js +330 -0
- package/src/components/elements/ToggleFilter.js +243 -0
- package/src/components/elements/View.js +189 -0
- package/src/components/elements/ViewLink.js +225 -0
- package/src/components/elements/boxmodel.html +253 -0
- package/src/components/elements/faicons.js +1643 -0
- package/src/components/elements/utils.js +1217 -0
- package/src/components/preview_context.js +9 -0
- package/src/components/storage.js +506 -0
- package/src/index.js +73 -0
- package/webpack.config.js +21 -0
|
@@ -0,0 +1,688 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category saltcorn-builder
|
|
3
|
+
* @module components/Toolbox
|
|
4
|
+
* @subcategory components
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React, { useEffect, useContext, Fragment } from "react";
|
|
8
|
+
import { Element, useEditor } from "@craftjs/core";
|
|
9
|
+
import { Text } from "./elements/Text";
|
|
10
|
+
import { HTMLCode } from "./elements/HTMLCode";
|
|
11
|
+
import { Field } from "./elements/Field";
|
|
12
|
+
import { JoinField } from "./elements/JoinField";
|
|
13
|
+
import { Aggregation } from "./elements/Aggregation";
|
|
14
|
+
import { LineBreak } from "./elements/LineBreak";
|
|
15
|
+
import { ViewLink } from "./elements/ViewLink";
|
|
16
|
+
import { Columns } from "./elements/Columns";
|
|
17
|
+
import { Action } from "./elements/Action";
|
|
18
|
+
import { DropDownFilter } from "./elements/DropDownFilter";
|
|
19
|
+
import { DropMenu } from "./elements/DropMenu";
|
|
20
|
+
import { ToggleFilter } from "./elements/ToggleFilter";
|
|
21
|
+
import { Empty } from "./elements/Empty";
|
|
22
|
+
import { Card } from "./elements/Card";
|
|
23
|
+
import { Tabs } from "./elements/Tabs";
|
|
24
|
+
import { Container } from "./elements/Container";
|
|
25
|
+
import { Image } from "./elements/Image";
|
|
26
|
+
import { View } from "./elements/View";
|
|
27
|
+
import { SearchBar } from "./elements/SearchBar";
|
|
28
|
+
import { Link } from "./elements/Link";
|
|
29
|
+
import optionsCtx from "./context";
|
|
30
|
+
import {
|
|
31
|
+
BoundingBox,
|
|
32
|
+
Diagram3Fill,
|
|
33
|
+
SegmentedNav,
|
|
34
|
+
TextareaT,
|
|
35
|
+
} from "react-bootstrap-icons";
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @param {object[]} xs
|
|
40
|
+
* @param {object} def
|
|
41
|
+
* @returns {object}
|
|
42
|
+
*/
|
|
43
|
+
const headOr = (xs, def) => (xs && xs.length > 0 ? xs[0] : def);
|
|
44
|
+
|
|
45
|
+
export /**
|
|
46
|
+
* @param {object} props
|
|
47
|
+
* @param {object} props.children
|
|
48
|
+
* @param {object} props.connectors
|
|
49
|
+
* @param {string|object} props.icon
|
|
50
|
+
* @param {object[]} props.icons
|
|
51
|
+
* @param {string} props.text
|
|
52
|
+
* @param {string|number} [props.fontSize]
|
|
53
|
+
* @param {string} props.title
|
|
54
|
+
* @param {string} props.innerClass
|
|
55
|
+
* @param {boolean} props.bold
|
|
56
|
+
* @param {string} props.label
|
|
57
|
+
* @param {boolean} props.disable
|
|
58
|
+
* @returns {div}
|
|
59
|
+
* @category saltcorn-builder
|
|
60
|
+
* @subcategory components / Toolbox
|
|
61
|
+
* @namespace
|
|
62
|
+
*/
|
|
63
|
+
const WrapElem = ({
|
|
64
|
+
children,
|
|
65
|
+
connectors,
|
|
66
|
+
icon,
|
|
67
|
+
icons,
|
|
68
|
+
text,
|
|
69
|
+
fontSize,
|
|
70
|
+
title,
|
|
71
|
+
innerClass,
|
|
72
|
+
bold,
|
|
73
|
+
label,
|
|
74
|
+
disable,
|
|
75
|
+
}) => (
|
|
76
|
+
<div
|
|
77
|
+
className={`${
|
|
78
|
+
disable ? "text-muted" : ""
|
|
79
|
+
} d-inline-flex wrap-builder-elem align-items-center justify-content-center`}
|
|
80
|
+
title={title}
|
|
81
|
+
ref={disable ? undefined : (ref) => connectors.create(ref, children)}
|
|
82
|
+
>
|
|
83
|
+
<div
|
|
84
|
+
className={`inner ${innerClass || ""}`}
|
|
85
|
+
style={fontSize ? { fontSize } : {}}
|
|
86
|
+
>
|
|
87
|
+
{(text && (bold ? <strong>{text}</strong> : text)) ||
|
|
88
|
+
(icons &&
|
|
89
|
+
icons.map((ic, ix) => <i key={ix} className={`${ic}`}></i>)) ||
|
|
90
|
+
(typeof icon === "string" ? <i className={`fa-lg ${icon}`}></i> : icon)}
|
|
91
|
+
</div>
|
|
92
|
+
<label>{label}</label>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @param {object} props
|
|
98
|
+
* @param {object} props.connectors
|
|
99
|
+
* @returns {WrapElem}
|
|
100
|
+
* @category saltcorn-builder
|
|
101
|
+
* @subcategory components / Toolbox
|
|
102
|
+
* @namespace
|
|
103
|
+
*/
|
|
104
|
+
const TextElem = ({ connectors }) => (
|
|
105
|
+
<WrapElem
|
|
106
|
+
connectors={connectors}
|
|
107
|
+
icon={<TextareaT className="mb-2" />}
|
|
108
|
+
fontSize="22px"
|
|
109
|
+
title="Text"
|
|
110
|
+
bold
|
|
111
|
+
label="Text"
|
|
112
|
+
>
|
|
113
|
+
<Text text="Hello world" block={false} textStyle={""} />
|
|
114
|
+
</WrapElem>
|
|
115
|
+
);
|
|
116
|
+
/**
|
|
117
|
+
* @param {object} props
|
|
118
|
+
* @param {object} props.connectors
|
|
119
|
+
* @returns {WrapElem}
|
|
120
|
+
* @category saltcorn-builder
|
|
121
|
+
* @subcategory components / Toolbox
|
|
122
|
+
* @namespace
|
|
123
|
+
*/
|
|
124
|
+
const ColumnsElem = ({ connectors }) => (
|
|
125
|
+
<WrapElem
|
|
126
|
+
connectors={connectors}
|
|
127
|
+
innerClass="mt-m1px"
|
|
128
|
+
icon="fas fa-columns"
|
|
129
|
+
title="Split into columns"
|
|
130
|
+
label="Columns"
|
|
131
|
+
>
|
|
132
|
+
<Columns contents={[]} />
|
|
133
|
+
</WrapElem>
|
|
134
|
+
);
|
|
135
|
+
/**
|
|
136
|
+
* @param {object} props
|
|
137
|
+
* @param {object} props.connectors
|
|
138
|
+
* @returns {WrapElem}
|
|
139
|
+
* @category saltcorn-builder
|
|
140
|
+
* @subcategory components / Toolbox
|
|
141
|
+
* @namespace
|
|
142
|
+
*/
|
|
143
|
+
const TabsElem = ({ connectors }) => (
|
|
144
|
+
<WrapElem
|
|
145
|
+
connectors={connectors}
|
|
146
|
+
icon={<SegmentedNav className="mb-2 h4" />}
|
|
147
|
+
title="Tabbed content"
|
|
148
|
+
label="Tabs"
|
|
149
|
+
>
|
|
150
|
+
<Tabs contents={[]} />
|
|
151
|
+
</WrapElem>
|
|
152
|
+
);
|
|
153
|
+
/**
|
|
154
|
+
* @param {object} props
|
|
155
|
+
* @param {object} props.connectors
|
|
156
|
+
* @returns {WrapElem}
|
|
157
|
+
* @category saltcorn-builder
|
|
158
|
+
* @subcategory components / Toolbox
|
|
159
|
+
* @namespace
|
|
160
|
+
*/
|
|
161
|
+
const LineBreakElem = ({ connectors }) => (
|
|
162
|
+
<WrapElem
|
|
163
|
+
connectors={connectors}
|
|
164
|
+
text="↵"
|
|
165
|
+
fontSize="26px"
|
|
166
|
+
title="Line break"
|
|
167
|
+
label="Break"
|
|
168
|
+
>
|
|
169
|
+
<LineBreak />
|
|
170
|
+
</WrapElem>
|
|
171
|
+
);
|
|
172
|
+
/**
|
|
173
|
+
* @param {object} props
|
|
174
|
+
* @param {object} props.connectors
|
|
175
|
+
* @returns {WrapElem}
|
|
176
|
+
* @category saltcorn-builder
|
|
177
|
+
* @subcategory components / Toolbox
|
|
178
|
+
* @namespace
|
|
179
|
+
*/
|
|
180
|
+
const HTMLElem = ({ connectors }) => (
|
|
181
|
+
<WrapElem
|
|
182
|
+
connectors={connectors}
|
|
183
|
+
icon="fas fa-code"
|
|
184
|
+
title="HTML code"
|
|
185
|
+
label="Code"
|
|
186
|
+
>
|
|
187
|
+
<HTMLCode text={""} />
|
|
188
|
+
</WrapElem>
|
|
189
|
+
);
|
|
190
|
+
/**
|
|
191
|
+
* @param {object} props
|
|
192
|
+
* @param {object} props.connectors
|
|
193
|
+
* @returns {WrapElem}
|
|
194
|
+
* @category saltcorn-builder
|
|
195
|
+
* @subcategory components / Toolbox
|
|
196
|
+
* @namespace
|
|
197
|
+
*/
|
|
198
|
+
const CardElem = ({ connectors }) => (
|
|
199
|
+
<WrapElem
|
|
200
|
+
connectors={connectors}
|
|
201
|
+
title="Card"
|
|
202
|
+
icon="far fa-square"
|
|
203
|
+
label="Card"
|
|
204
|
+
>
|
|
205
|
+
<Element canvas is={Card} isFormula={{}} url=""></Element>
|
|
206
|
+
</WrapElem>
|
|
207
|
+
);
|
|
208
|
+
/**
|
|
209
|
+
* @param {object} props
|
|
210
|
+
* @param {object} props.connectors
|
|
211
|
+
* @returns {WrapElem}
|
|
212
|
+
* @category saltcorn-builder
|
|
213
|
+
* @subcategory components / Toolbox
|
|
214
|
+
* @namespace
|
|
215
|
+
*/
|
|
216
|
+
const ImageElem = ({ connectors, images }) => (
|
|
217
|
+
<WrapElem
|
|
218
|
+
connectors={connectors}
|
|
219
|
+
icon="fas fa-image"
|
|
220
|
+
title="Image"
|
|
221
|
+
label="Image"
|
|
222
|
+
>
|
|
223
|
+
<Image fileid={images.length > 0 ? images[0].id : 0} />
|
|
224
|
+
</WrapElem>
|
|
225
|
+
);
|
|
226
|
+
/**
|
|
227
|
+
* @param {object} props
|
|
228
|
+
* @param {object} props.connectors
|
|
229
|
+
* @returns {WrapElem}
|
|
230
|
+
* @category saltcorn-builder
|
|
231
|
+
* @subcategory components / Toolbox
|
|
232
|
+
* @namespace
|
|
233
|
+
*/
|
|
234
|
+
const LinkElem = ({ connectors }) => (
|
|
235
|
+
<WrapElem
|
|
236
|
+
connectors={connectors}
|
|
237
|
+
icon="fas fa-link"
|
|
238
|
+
title="Link"
|
|
239
|
+
label="Link"
|
|
240
|
+
>
|
|
241
|
+
<Link />
|
|
242
|
+
</WrapElem>
|
|
243
|
+
);
|
|
244
|
+
/**
|
|
245
|
+
* @param {object} props
|
|
246
|
+
* @param {object} props.connectors
|
|
247
|
+
* @returns {WrapElem}
|
|
248
|
+
* @category saltcorn-builder
|
|
249
|
+
* @subcategory components / Toolbox
|
|
250
|
+
* @namespace
|
|
251
|
+
*/
|
|
252
|
+
const ViewElem = ({ connectors, views }) => (
|
|
253
|
+
<WrapElem
|
|
254
|
+
connectors={connectors}
|
|
255
|
+
icon="fas fa-eye"
|
|
256
|
+
title="Embed a view"
|
|
257
|
+
label="View"
|
|
258
|
+
disable={views.length === 0}
|
|
259
|
+
>
|
|
260
|
+
<View
|
|
261
|
+
name={"not_assigned"}
|
|
262
|
+
state={"shared"}
|
|
263
|
+
view={views.length > 0 ? views[0].name : "view"}
|
|
264
|
+
/>
|
|
265
|
+
</WrapElem>
|
|
266
|
+
);
|
|
267
|
+
/**
|
|
268
|
+
* @param {object} props
|
|
269
|
+
* @param {object} props.connectors
|
|
270
|
+
* @returns {WrapElem}
|
|
271
|
+
* @category saltcorn-builder
|
|
272
|
+
* @subcategory components / Toolbox
|
|
273
|
+
* @namespace
|
|
274
|
+
*/
|
|
275
|
+
const SearchElem = ({ connectors }) => (
|
|
276
|
+
<WrapElem
|
|
277
|
+
connectors={connectors}
|
|
278
|
+
icon="fas fa-search"
|
|
279
|
+
title="Search bar"
|
|
280
|
+
label="Search"
|
|
281
|
+
>
|
|
282
|
+
<Element canvas is={SearchBar}></Element>
|
|
283
|
+
</WrapElem>
|
|
284
|
+
);
|
|
285
|
+
/**
|
|
286
|
+
* @param {object} props
|
|
287
|
+
* @param {object} props.connectors
|
|
288
|
+
* @returns {WrapElem}
|
|
289
|
+
* @category saltcorn-builder
|
|
290
|
+
* @subcategory components / Toolbox
|
|
291
|
+
* @namespace
|
|
292
|
+
*/
|
|
293
|
+
const ContainerElem = ({ connectors }) => (
|
|
294
|
+
<WrapElem
|
|
295
|
+
connectors={connectors}
|
|
296
|
+
icon={<BoundingBox className="mb-2 h5" />}
|
|
297
|
+
title="Container"
|
|
298
|
+
label="Contain"
|
|
299
|
+
>
|
|
300
|
+
<Element canvas is={Container}></Element>
|
|
301
|
+
</WrapElem>
|
|
302
|
+
);
|
|
303
|
+
/**
|
|
304
|
+
* @param {object} props
|
|
305
|
+
* @param {object} props.connectors
|
|
306
|
+
* @returns {WrapElem}
|
|
307
|
+
* @category saltcorn-builder
|
|
308
|
+
* @subcategory components / Toolbox
|
|
309
|
+
* @namespace
|
|
310
|
+
*/
|
|
311
|
+
const FieldElem = ({ connectors, fields, field_view_options }) => (
|
|
312
|
+
<WrapElem
|
|
313
|
+
connectors={connectors}
|
|
314
|
+
icon="fas fa-asterisk"
|
|
315
|
+
title="Field"
|
|
316
|
+
label="Field"
|
|
317
|
+
>
|
|
318
|
+
<Field
|
|
319
|
+
name={fields[0].name}
|
|
320
|
+
block={false}
|
|
321
|
+
textStyle={""}
|
|
322
|
+
configuration={{}}
|
|
323
|
+
fieldview={fields[0].is_fkey ? "" : field_view_options[fields[0].name][0]}
|
|
324
|
+
/>
|
|
325
|
+
</WrapElem>
|
|
326
|
+
);
|
|
327
|
+
/**
|
|
328
|
+
* @param {object} props
|
|
329
|
+
* @param {object} props.connectors
|
|
330
|
+
* @returns {WrapElem}
|
|
331
|
+
* @category saltcorn-builder
|
|
332
|
+
* @subcategory components / Toolbox
|
|
333
|
+
* @namespace
|
|
334
|
+
*/
|
|
335
|
+
const DropDownFilterElem = ({ connectors, fields }) => (
|
|
336
|
+
<WrapElem
|
|
337
|
+
connectors={connectors}
|
|
338
|
+
icon="far fa-caret-square-down"
|
|
339
|
+
title="Dropdown filter"
|
|
340
|
+
label="Select"
|
|
341
|
+
>
|
|
342
|
+
<DropDownFilter
|
|
343
|
+
name={fields[0].name}
|
|
344
|
+
block={false}
|
|
345
|
+
neutral_label={""}
|
|
346
|
+
full_width={false}
|
|
347
|
+
/>
|
|
348
|
+
</WrapElem>
|
|
349
|
+
);
|
|
350
|
+
|
|
351
|
+
const DropMenuElem = ({ connectors }) => (
|
|
352
|
+
<WrapElem
|
|
353
|
+
connectors={connectors}
|
|
354
|
+
icon="far fa-caret-square-down"
|
|
355
|
+
title="Dropdown menu"
|
|
356
|
+
label="DropMenu"
|
|
357
|
+
>
|
|
358
|
+
<Element canvas is={DropMenu}></Element>
|
|
359
|
+
</WrapElem>
|
|
360
|
+
);
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* @param {object} props
|
|
364
|
+
* @param {object} props.connectors
|
|
365
|
+
* @returns {WrapElem}
|
|
366
|
+
* @category saltcorn-builder
|
|
367
|
+
* @subcategory components / Toolbox
|
|
368
|
+
* @namespace
|
|
369
|
+
*/
|
|
370
|
+
const ToggleFilterElem = ({ connectors, fields }) => (
|
|
371
|
+
<WrapElem
|
|
372
|
+
connectors={connectors}
|
|
373
|
+
icon="fas fa-toggle-on"
|
|
374
|
+
title="Toggle filter"
|
|
375
|
+
label="Toggle"
|
|
376
|
+
>
|
|
377
|
+
<ToggleFilter name={fields[0].name} value={""} label={""} block={false} />
|
|
378
|
+
</WrapElem>
|
|
379
|
+
);
|
|
380
|
+
/**
|
|
381
|
+
* @param {object} props
|
|
382
|
+
* @param {object} props.connectors
|
|
383
|
+
* @returns {WrapElem}
|
|
384
|
+
* @category saltcorn-builder
|
|
385
|
+
* @subcategory components / Toolbox
|
|
386
|
+
* @namespace
|
|
387
|
+
*/
|
|
388
|
+
const JoinFieldElem = ({ connectors, options }) => (
|
|
389
|
+
<WrapElem
|
|
390
|
+
connectors={connectors}
|
|
391
|
+
icon={<Diagram3Fill className="mb-2 h5" />}
|
|
392
|
+
title="Join field"
|
|
393
|
+
label="Join"
|
|
394
|
+
disable={options.parent_field_list.length === 0}
|
|
395
|
+
>
|
|
396
|
+
<JoinField
|
|
397
|
+
name={options.parent_field_list[0]}
|
|
398
|
+
configuration={{}}
|
|
399
|
+
textStyle={""}
|
|
400
|
+
block={false}
|
|
401
|
+
/>
|
|
402
|
+
</WrapElem>
|
|
403
|
+
);
|
|
404
|
+
/**
|
|
405
|
+
* @param {object} props
|
|
406
|
+
* @param {object} props.connectors
|
|
407
|
+
* @returns {WrapElem}
|
|
408
|
+
* @category saltcorn-builder
|
|
409
|
+
* @subcategory components / Toolbox
|
|
410
|
+
* @namespace
|
|
411
|
+
*/
|
|
412
|
+
const ViewLinkElem = ({ connectors, options }) => (
|
|
413
|
+
<WrapElem
|
|
414
|
+
connectors={connectors}
|
|
415
|
+
icons={["fas fa-eye", "fas fa-link"]}
|
|
416
|
+
title="Link to a view"
|
|
417
|
+
label="ViewLink"
|
|
418
|
+
disable={options.link_view_opts.length === 0}
|
|
419
|
+
>
|
|
420
|
+
<ViewLink
|
|
421
|
+
name={
|
|
422
|
+
options.link_view_opts.length > 0 ? options.link_view_opts[0].name : ""
|
|
423
|
+
}
|
|
424
|
+
block={false}
|
|
425
|
+
minRole={10}
|
|
426
|
+
label={""}
|
|
427
|
+
/>
|
|
428
|
+
</WrapElem>
|
|
429
|
+
);
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* @param {object} props
|
|
433
|
+
* @param {object} props.connectors
|
|
434
|
+
* @returns {WrapElem}
|
|
435
|
+
* @category saltcorn-builder
|
|
436
|
+
* @subcategory components / Toolbox
|
|
437
|
+
* @namespace
|
|
438
|
+
*/
|
|
439
|
+
const ActionElem = ({ connectors, options }) => (
|
|
440
|
+
<WrapElem
|
|
441
|
+
connectors={connectors}
|
|
442
|
+
label="Action"
|
|
443
|
+
icon="fas fa-running"
|
|
444
|
+
title="Action button"
|
|
445
|
+
>
|
|
446
|
+
<Action
|
|
447
|
+
name={options.actions[0]}
|
|
448
|
+
block={false}
|
|
449
|
+
minRole={10}
|
|
450
|
+
confirm={false}
|
|
451
|
+
action_label={""}
|
|
452
|
+
isFormula={{}}
|
|
453
|
+
rndid={"not_assigned"}
|
|
454
|
+
configuration={{}}
|
|
455
|
+
/>
|
|
456
|
+
</WrapElem>
|
|
457
|
+
);
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* @param {object} props
|
|
461
|
+
* @param {object} props.connectors
|
|
462
|
+
* @returns {WrapElem}
|
|
463
|
+
* @category saltcorn-builder
|
|
464
|
+
* @subcategory components / Toolbox
|
|
465
|
+
* @namespace
|
|
466
|
+
*/
|
|
467
|
+
const AggregationElem = ({ connectors, child_field_list, agg_field_opts }) => (
|
|
468
|
+
<WrapElem
|
|
469
|
+
connectors={connectors}
|
|
470
|
+
text="∑"
|
|
471
|
+
title="Aggregation"
|
|
472
|
+
label="Aggreg8"
|
|
473
|
+
bold
|
|
474
|
+
fontSize="16px"
|
|
475
|
+
disable={child_field_list.length === 0}
|
|
476
|
+
>
|
|
477
|
+
<Aggregation
|
|
478
|
+
agg_relation={child_field_list[0]}
|
|
479
|
+
agg_field={headOr(agg_field_opts[child_field_list[0]], "")}
|
|
480
|
+
stat={"Count"}
|
|
481
|
+
textStyle={""}
|
|
482
|
+
aggwhere={""}
|
|
483
|
+
block={false}
|
|
484
|
+
/>
|
|
485
|
+
</WrapElem>
|
|
486
|
+
);
|
|
487
|
+
|
|
488
|
+
export /**
|
|
489
|
+
* @returns {Fragment}
|
|
490
|
+
* @category saltcorn-builder
|
|
491
|
+
* @subcategory components / Toolbox
|
|
492
|
+
* @namespace
|
|
493
|
+
*/
|
|
494
|
+
const ToolboxShow = () => {
|
|
495
|
+
const { connectors, query } = useEditor();
|
|
496
|
+
const options = useContext(optionsCtx);
|
|
497
|
+
const {
|
|
498
|
+
fields,
|
|
499
|
+
field_view_options,
|
|
500
|
+
child_field_list,
|
|
501
|
+
agg_field_opts,
|
|
502
|
+
views,
|
|
503
|
+
images,
|
|
504
|
+
} = options;
|
|
505
|
+
return (
|
|
506
|
+
<Fragment>
|
|
507
|
+
<div className="toolbar-row">
|
|
508
|
+
<TextElem connectors={connectors} />
|
|
509
|
+
<ColumnsElem connectors={connectors} />
|
|
510
|
+
</div>
|
|
511
|
+
<div className="toolbar-row">
|
|
512
|
+
<FieldElem
|
|
513
|
+
connectors={connectors}
|
|
514
|
+
fields={fields}
|
|
515
|
+
field_view_options={field_view_options}
|
|
516
|
+
/>
|
|
517
|
+
<LineBreakElem connectors={connectors} />
|
|
518
|
+
</div>
|
|
519
|
+
<div className="toolbar-row">
|
|
520
|
+
<JoinFieldElem connectors={connectors} options={options} />
|
|
521
|
+
<ViewLinkElem connectors={connectors} options={options} />
|
|
522
|
+
</div>
|
|
523
|
+
<div className="toolbar-row">
|
|
524
|
+
<ActionElem connectors={connectors} options={options} />
|
|
525
|
+
<LinkElem connectors={connectors} />
|
|
526
|
+
</div>
|
|
527
|
+
<div className="toolbar-row">
|
|
528
|
+
<AggregationElem
|
|
529
|
+
connectors={connectors}
|
|
530
|
+
child_field_list={child_field_list}
|
|
531
|
+
agg_field_opts={agg_field_opts}
|
|
532
|
+
/>
|
|
533
|
+
<ViewElem connectors={connectors} views={views} />
|
|
534
|
+
</div>
|
|
535
|
+
<div className="toolbar-row">
|
|
536
|
+
<ContainerElem connectors={connectors} />
|
|
537
|
+
<CardElem connectors={connectors} />
|
|
538
|
+
</div>
|
|
539
|
+
<div className="toolbar-row">
|
|
540
|
+
<TabsElem connectors={connectors} />
|
|
541
|
+
<ImageElem connectors={connectors} images={images} />
|
|
542
|
+
</div>
|
|
543
|
+
<div className="toolbar-row">
|
|
544
|
+
<HTMLElem connectors={connectors} />
|
|
545
|
+
<DropMenuElem connectors={connectors} />
|
|
546
|
+
</div>
|
|
547
|
+
</Fragment>
|
|
548
|
+
);
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
export /**
|
|
552
|
+
* @returns {Fragment}
|
|
553
|
+
* @category saltcorn-builder
|
|
554
|
+
* @subcategory components / Toolbox
|
|
555
|
+
* @namespace
|
|
556
|
+
*/
|
|
557
|
+
const ToolboxFilter = () => {
|
|
558
|
+
const { connectors, query } = useEditor();
|
|
559
|
+
const options = useContext(optionsCtx);
|
|
560
|
+
const { fields, views, field_view_options } = options;
|
|
561
|
+
return (
|
|
562
|
+
<Fragment>
|
|
563
|
+
<div className="toolbar-row">
|
|
564
|
+
<TextElem connectors={connectors} />
|
|
565
|
+
<ColumnsElem connectors={connectors} />
|
|
566
|
+
</div>
|
|
567
|
+
<div className="toolbar-row">
|
|
568
|
+
<FieldElem
|
|
569
|
+
connectors={connectors}
|
|
570
|
+
fields={fields}
|
|
571
|
+
field_view_options={field_view_options}
|
|
572
|
+
/>
|
|
573
|
+
<LineBreakElem connectors={connectors} />
|
|
574
|
+
</div>
|
|
575
|
+
<div className="toolbar-row">
|
|
576
|
+
<DropDownFilterElem connectors={connectors} fields={fields} />
|
|
577
|
+
<ToggleFilterElem connectors={connectors} fields={fields} />
|
|
578
|
+
</div>
|
|
579
|
+
<div className="toolbar-row">
|
|
580
|
+
<SearchElem connectors={connectors} />
|
|
581
|
+
<ActionElem connectors={connectors} options={options} />
|
|
582
|
+
</div>
|
|
583
|
+
<div className="toolbar-row">
|
|
584
|
+
<ContainerElem connectors={connectors} />
|
|
585
|
+
|
|
586
|
+
<CardElem connectors={connectors} />
|
|
587
|
+
</div>
|
|
588
|
+
<div className="toolbar-row">
|
|
589
|
+
<TabsElem connectors={connectors} />
|
|
590
|
+
<ViewElem connectors={connectors} views={views} />
|
|
591
|
+
</div>
|
|
592
|
+
<div className="toolbar-row">
|
|
593
|
+
<HTMLElem connectors={connectors} />
|
|
594
|
+
</div>
|
|
595
|
+
</Fragment>
|
|
596
|
+
);
|
|
597
|
+
};
|
|
598
|
+
|
|
599
|
+
export /**
|
|
600
|
+
* @returns {Fragment}
|
|
601
|
+
* @category saltcorn-builder
|
|
602
|
+
* @subcategory components / Toolbox
|
|
603
|
+
* @namespace
|
|
604
|
+
*/
|
|
605
|
+
const ToolboxEdit = () => {
|
|
606
|
+
const { connectors, query } = useEditor();
|
|
607
|
+
const options = useContext(optionsCtx);
|
|
608
|
+
const { fields, field_view_options, images, views } = options;
|
|
609
|
+
return (
|
|
610
|
+
<Fragment>
|
|
611
|
+
<div className="toolbar-row">
|
|
612
|
+
<TextElem connectors={connectors} />
|
|
613
|
+
<ColumnsElem connectors={connectors} />
|
|
614
|
+
</div>
|
|
615
|
+
<div className="toolbar-row">
|
|
616
|
+
<FieldElem
|
|
617
|
+
connectors={connectors}
|
|
618
|
+
fields={fields}
|
|
619
|
+
field_view_options={field_view_options}
|
|
620
|
+
/>
|
|
621
|
+
<LineBreakElem connectors={connectors} />
|
|
622
|
+
</div>
|
|
623
|
+
<div className="toolbar-row">
|
|
624
|
+
<ActionElem connectors={connectors} options={options} />
|
|
625
|
+
<ContainerElem connectors={connectors} />
|
|
626
|
+
</div>
|
|
627
|
+
<div className="toolbar-row">
|
|
628
|
+
<CardElem connectors={connectors} />
|
|
629
|
+
<TabsElem connectors={connectors} />
|
|
630
|
+
</div>
|
|
631
|
+
<div className="toolbar-row">
|
|
632
|
+
<LinkElem connectors={connectors} />
|
|
633
|
+
<ImageElem connectors={connectors} images={images} />
|
|
634
|
+
</div>
|
|
635
|
+
<div className="toolbar-row">
|
|
636
|
+
<HTMLElem connectors={connectors} />
|
|
637
|
+
<ViewElem connectors={connectors} views={views} />
|
|
638
|
+
</div>
|
|
639
|
+
<div className="toolbar-row">
|
|
640
|
+
<JoinFieldElem connectors={connectors} options={options} />
|
|
641
|
+
<DropMenuElem connectors={connectors} />
|
|
642
|
+
</div>
|
|
643
|
+
</Fragment>
|
|
644
|
+
);
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
export /**
|
|
648
|
+
* @returns {Fragment}
|
|
649
|
+
* @category saltcorn-builder
|
|
650
|
+
* @subcategory components / Toolbox
|
|
651
|
+
* @namespace
|
|
652
|
+
*/
|
|
653
|
+
const ToolboxPage = () => {
|
|
654
|
+
const { connectors, query } = useEditor();
|
|
655
|
+
const options = useContext(optionsCtx);
|
|
656
|
+
const { views, images } = options;
|
|
657
|
+
return (
|
|
658
|
+
<Fragment>
|
|
659
|
+
<div className="toolbar-row">
|
|
660
|
+
<TextElem connectors={connectors} />
|
|
661
|
+
<ColumnsElem connectors={connectors} />
|
|
662
|
+
</div>
|
|
663
|
+
<div className="toolbar-row">
|
|
664
|
+
<LineBreakElem connectors={connectors} />
|
|
665
|
+
<HTMLElem connectors={connectors} />
|
|
666
|
+
</div>
|
|
667
|
+
<div className="toolbar-row">
|
|
668
|
+
<CardElem connectors={connectors} />
|
|
669
|
+
<ImageElem connectors={connectors} images={images} />{" "}
|
|
670
|
+
</div>
|
|
671
|
+
<div className="toolbar-row">
|
|
672
|
+
<LinkElem connectors={connectors} />
|
|
673
|
+
<ViewElem connectors={connectors} views={views} />
|
|
674
|
+
</div>
|
|
675
|
+
<div className="toolbar-row">
|
|
676
|
+
<SearchElem connectors={connectors} />
|
|
677
|
+
<ActionElem connectors={connectors} options={options} />
|
|
678
|
+
</div>
|
|
679
|
+
<div className="toolbar-row">
|
|
680
|
+
<ContainerElem connectors={connectors} />
|
|
681
|
+
<TabsElem connectors={connectors} />
|
|
682
|
+
</div>
|
|
683
|
+
<div className="toolbar-row">
|
|
684
|
+
<DropMenuElem connectors={connectors} />
|
|
685
|
+
</div>
|
|
686
|
+
</Fragment>
|
|
687
|
+
);
|
|
688
|
+
};
|