@tsed/react-formio 2.3.3 → 2.3.5
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/dist/components/select/select.component.d.ts +1 -1
- package/dist/components/table/components/defaultOperationButton.component.d.ts +2 -2
- package/dist/index.js +46 -46
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +193 -193
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -3
- package/src/components/select/select.component.tsx +1 -1
- package/src/components/table/components/defaultOperationButton.component.tsx +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -4,7 +4,7 @@ export { default as Wizard } from 'formiojs/Wizard';
|
|
|
4
4
|
export { default as WizardBuilder } from 'formiojs/WizardBuilder';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
import noop from 'lodash/noop';
|
|
7
|
-
import React
|
|
7
|
+
import React, { useRef, useEffect, useState, useMemo, useCallback, useReducer } from 'react';
|
|
8
8
|
import { Templates, Form as Form$1, Components } from 'formiojs';
|
|
9
9
|
export { Components, Formio, Templates, Utils } from 'formiojs';
|
|
10
10
|
import Choices from '@formio/choices.js';
|
|
@@ -75,27 +75,27 @@ function FormControl({
|
|
|
75
75
|
label,
|
|
76
76
|
className
|
|
77
77
|
}) {
|
|
78
|
-
return /*#__PURE__*/React
|
|
78
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
79
79
|
"data-testid": name && `form-group-${name}`,
|
|
80
80
|
id: `form-group-${name || ""}`,
|
|
81
81
|
className: classnames("form-group", className)
|
|
82
|
-
}, label && /*#__PURE__*/React
|
|
82
|
+
}, label && /*#__PURE__*/React.createElement("label", {
|
|
83
83
|
htmlFor: name,
|
|
84
84
|
"data-testid": "form-control-label",
|
|
85
85
|
className: `col-form-label ${required ? " field-required" : ""}`
|
|
86
|
-
}, label), /*#__PURE__*/React
|
|
86
|
+
}, label), /*#__PURE__*/React.createElement("div", {
|
|
87
87
|
className: "input-group"
|
|
88
|
-
}, prefix && /*#__PURE__*/React
|
|
88
|
+
}, prefix && /*#__PURE__*/React.createElement("div", {
|
|
89
89
|
className: "input-group-prepend"
|
|
90
|
-
}, /*#__PURE__*/React
|
|
90
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
91
91
|
className: "input-group-text",
|
|
92
92
|
"data-testid": "form-control-prefix"
|
|
93
|
-
}, prefix)), children, suffix && /*#__PURE__*/React
|
|
93
|
+
}, prefix)), children, suffix && /*#__PURE__*/React.createElement("div", {
|
|
94
94
|
className: "input-group-append"
|
|
95
|
-
}, /*#__PURE__*/React
|
|
95
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
96
96
|
className: "input-group-text",
|
|
97
97
|
"data-testid": "form-control-suffix"
|
|
98
|
-
}, suffix))), description && /*#__PURE__*/React
|
|
98
|
+
}, suffix))), description && /*#__PURE__*/React.createElement("div", {
|
|
99
99
|
"data-testid": "form-control-description",
|
|
100
100
|
className: "form-text text-muted"
|
|
101
101
|
}, description));
|
|
@@ -136,7 +136,7 @@ function Select(_ref) {
|
|
|
136
136
|
label: placeholder,
|
|
137
137
|
value: ""
|
|
138
138
|
}, ...choices];
|
|
139
|
-
return /*#__PURE__*/React
|
|
139
|
+
return /*#__PURE__*/React.createElement(FormControl, {
|
|
140
140
|
name: name,
|
|
141
141
|
label: label,
|
|
142
142
|
required: required,
|
|
@@ -144,7 +144,7 @@ function Select(_ref) {
|
|
|
144
144
|
prefix: prefix,
|
|
145
145
|
suffix: suffix,
|
|
146
146
|
shadow: false
|
|
147
|
-
}, /*#__PURE__*/React
|
|
147
|
+
}, /*#__PURE__*/React.createElement("select", _extends({
|
|
148
148
|
ref: ref,
|
|
149
149
|
"data-testid": `select_${name}`
|
|
150
150
|
}, props, {
|
|
@@ -161,7 +161,7 @@ function Select(_ref) {
|
|
|
161
161
|
label,
|
|
162
162
|
value
|
|
163
163
|
}) => {
|
|
164
|
-
return /*#__PURE__*/React
|
|
164
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
165
165
|
key: String(value),
|
|
166
166
|
label: label,
|
|
167
167
|
value: value
|
|
@@ -173,9 +173,9 @@ function DrapNDropContainer({
|
|
|
173
173
|
enableDragNDrop,
|
|
174
174
|
children
|
|
175
175
|
}) {
|
|
176
|
-
return enableDragNDrop ? /*#__PURE__*/React
|
|
176
|
+
return enableDragNDrop ? /*#__PURE__*/React.createElement(DndProvider, {
|
|
177
177
|
backend: HTML5Backend
|
|
178
|
-
}, children) : /*#__PURE__*/React
|
|
178
|
+
}, children) : /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
const LEFT_PAGE = "LEFT";
|
|
@@ -229,7 +229,7 @@ function PaginationButton(props) {
|
|
|
229
229
|
active
|
|
230
230
|
} = props,
|
|
231
231
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded$f);
|
|
232
|
-
return /*#__PURE__*/React
|
|
232
|
+
return /*#__PURE__*/React.createElement(Component, _extends({}, otherProps, {
|
|
233
233
|
"data-testid": "pagination-button",
|
|
234
234
|
disabled: disabled,
|
|
235
235
|
className: classnames("page-link", disabled ? "disabled" : "", active ? "" : "", props.className)
|
|
@@ -261,58 +261,58 @@ function Pagination(props) {
|
|
|
261
261
|
value,
|
|
262
262
|
label: value
|
|
263
263
|
}));
|
|
264
|
-
return /*#__PURE__*/React
|
|
264
|
+
return /*#__PURE__*/React.createElement("nav", {
|
|
265
265
|
"aria-label": "Page navigation",
|
|
266
266
|
className: classnames("pagination-group -mb-3", className)
|
|
267
|
-
}, /*#__PURE__*/React
|
|
267
|
+
}, /*#__PURE__*/React.createElement("ul", {
|
|
268
268
|
className: "pagination mb-3 mr-3"
|
|
269
|
-
}, /*#__PURE__*/React
|
|
269
|
+
}, /*#__PURE__*/React.createElement("li", {
|
|
270
270
|
className: classnames("page-item", !canPreviousPage && "disabled")
|
|
271
|
-
}, /*#__PURE__*/React
|
|
271
|
+
}, /*#__PURE__*/React.createElement(PaginationButton, {
|
|
272
272
|
tabIndex: -1,
|
|
273
273
|
disabled: !canPreviousPage,
|
|
274
274
|
onClick: () => previousPage()
|
|
275
275
|
}, i18n("Previous"))), pageNumbers.map(page => {
|
|
276
276
|
if ([LEFT_PAGE, RIGHT_PAGE].includes(page)) {
|
|
277
|
-
return /*#__PURE__*/React
|
|
277
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
278
278
|
className: "page-item",
|
|
279
279
|
key: page
|
|
280
|
-
}, /*#__PURE__*/React
|
|
280
|
+
}, /*#__PURE__*/React.createElement(PaginationButton, {
|
|
281
281
|
"aria-hidden": "true"
|
|
282
282
|
}, "..."));
|
|
283
283
|
}
|
|
284
284
|
const active = page - 1 === pageIndex;
|
|
285
|
-
return /*#__PURE__*/React
|
|
285
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
286
286
|
className: classnames("page-item", active && "active"),
|
|
287
287
|
key: page
|
|
288
|
-
}, /*#__PURE__*/React
|
|
288
|
+
}, /*#__PURE__*/React.createElement(PaginationButton, {
|
|
289
289
|
tabIndex: pageIndex,
|
|
290
290
|
active: active,
|
|
291
291
|
onClick: () => gotoPage(page - 1)
|
|
292
292
|
}, page));
|
|
293
|
-
}), /*#__PURE__*/React
|
|
293
|
+
}), /*#__PURE__*/React.createElement("li", {
|
|
294
294
|
className: classnames("page-item", !canNextPage && "disabled")
|
|
295
|
-
}, /*#__PURE__*/React
|
|
295
|
+
}, /*#__PURE__*/React.createElement(PaginationButton, {
|
|
296
296
|
tabIndex: pageNumbers.length,
|
|
297
297
|
disabled: !canNextPage,
|
|
298
298
|
onClick: () => nextPage()
|
|
299
|
-
}, i18n("Next")))), /*#__PURE__*/React
|
|
299
|
+
}, i18n("Next")))), /*#__PURE__*/React.createElement("li", {
|
|
300
300
|
className: "mb-3 mr-3 flex items-center"
|
|
301
|
-
}, /*#__PURE__*/React
|
|
301
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
302
302
|
name: "page",
|
|
303
303
|
value: pageSize,
|
|
304
304
|
choices: choices,
|
|
305
305
|
onChange: (name, value) => {
|
|
306
306
|
setPageSize(+value);
|
|
307
307
|
}
|
|
308
|
-
}), /*#__PURE__*/React
|
|
308
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
309
309
|
className: "ml-3"
|
|
310
|
-
}, i18n("items per page"))), pageOptions && /*#__PURE__*/React
|
|
310
|
+
}, i18n("items per page"))), pageOptions && /*#__PURE__*/React.createElement("li", {
|
|
311
311
|
className: "mb-3 mr-3 flex items-center"
|
|
312
|
-
}, /*#__PURE__*/React
|
|
312
|
+
}, /*#__PURE__*/React.createElement("span", null, i18n("Page"), "\xA0"), /*#__PURE__*/React.createElement("strong", null, pageIndex + 1, " of ", pageOptions.length)), totalLength !== undefined && /*#__PURE__*/React.createElement("li", {
|
|
313
313
|
className: "mb-3 flex items-center",
|
|
314
314
|
"data-testid": "pagination-total-items"
|
|
315
|
-
}, i18n("Total"), ": ", /*#__PURE__*/React
|
|
315
|
+
}, i18n("Total"), ": ", /*#__PURE__*/React.createElement("strong", {
|
|
316
316
|
className: "mx-1"
|
|
317
317
|
}, new Intl.NumberFormat(undefined).format(totalLength)), " ", i18n("items")));
|
|
318
318
|
}
|
|
@@ -324,9 +324,9 @@ function DefaultArrowSort({
|
|
|
324
324
|
isSorted,
|
|
325
325
|
isSortedDesc
|
|
326
326
|
} = column;
|
|
327
|
-
return /*#__PURE__*/React
|
|
327
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
328
328
|
className: "table-arrow-sort"
|
|
329
|
-
}, isSorted ? /*#__PURE__*/React
|
|
329
|
+
}, isSorted ? /*#__PURE__*/React.createElement("i", {
|
|
330
330
|
className: iconClass(undefined, isSortedDesc ? "sort-up" : "sort-down")
|
|
331
331
|
}) : "");
|
|
332
332
|
}
|
|
@@ -334,11 +334,11 @@ function DefaultArrowSort({
|
|
|
334
334
|
function DefaultCellHeader({
|
|
335
335
|
column
|
|
336
336
|
}) {
|
|
337
|
-
return /*#__PURE__*/React
|
|
337
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
338
338
|
className: "table-cell-header"
|
|
339
|
-
}, /*#__PURE__*/React
|
|
339
|
+
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
340
340
|
className: "table-cell-header__label"
|
|
341
|
-
}, column.getSortByToggleProps()), /*#__PURE__*/React
|
|
341
|
+
}, column.getSortByToggleProps()), /*#__PURE__*/React.createElement("span", null, column.render("Header")), column.render("ArrowSort")), column.canFilter ? /*#__PURE__*/React.createElement("div", {
|
|
342
342
|
className: "table-cell-header__filter"
|
|
343
343
|
}, column.render("Filter")) : null);
|
|
344
344
|
}
|
|
@@ -425,7 +425,7 @@ function useDndRow(_ref) {
|
|
|
425
425
|
function DefaultCells({
|
|
426
426
|
row
|
|
427
427
|
}) {
|
|
428
|
-
return /*#__PURE__*/React
|
|
428
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, row.cells.map((cell, i) => {
|
|
429
429
|
const {
|
|
430
430
|
hidden,
|
|
431
431
|
colspan
|
|
@@ -433,7 +433,7 @@ function DefaultCells({
|
|
|
433
433
|
if (hidden) {
|
|
434
434
|
return null;
|
|
435
435
|
}
|
|
436
|
-
return /*#__PURE__*/React
|
|
436
|
+
return /*#__PURE__*/React.createElement("td", _extends({
|
|
437
437
|
colSpan: colspan
|
|
438
438
|
}, cell.getCellProps({
|
|
439
439
|
className: cell.column.className,
|
|
@@ -452,23 +452,23 @@ function DefaultDndRow(props) {
|
|
|
452
452
|
dropRef,
|
|
453
453
|
opacity
|
|
454
454
|
} = useDndRow(props);
|
|
455
|
-
return /*#__PURE__*/React
|
|
455
|
+
return /*#__PURE__*/React.createElement("tr", {
|
|
456
456
|
ref: dropRef,
|
|
457
457
|
style: {
|
|
458
458
|
opacity
|
|
459
459
|
}
|
|
460
|
-
}, /*#__PURE__*/React
|
|
460
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
461
461
|
ref: dragRef,
|
|
462
462
|
role: "cell",
|
|
463
463
|
style: {
|
|
464
464
|
cursor: isDragging ? "grabbing" : "grab"
|
|
465
465
|
},
|
|
466
466
|
className: "align-middle"
|
|
467
|
-
}, /*#__PURE__*/React
|
|
467
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
468
468
|
className: "flex items-center justify-center"
|
|
469
|
-
}, /*#__PURE__*/React
|
|
469
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
470
470
|
className: classnames(iconClass(undefined, "dots-vertical-rounded"))
|
|
471
|
-
}))), /*#__PURE__*/React
|
|
471
|
+
}))), /*#__PURE__*/React.createElement(DefaultCells, props));
|
|
472
472
|
}
|
|
473
473
|
function DefaultRow(_ref) {
|
|
474
474
|
let {
|
|
@@ -483,13 +483,13 @@ function DefaultRow(_ref) {
|
|
|
483
483
|
onClick: () => onClick(row.original, "row")
|
|
484
484
|
}, row.getRowProps());
|
|
485
485
|
if (enableDragNDrop) {
|
|
486
|
-
return /*#__PURE__*/React
|
|
486
|
+
return /*#__PURE__*/React.createElement(DefaultDndRow, _extends({}, opts, {
|
|
487
487
|
row: row,
|
|
488
488
|
onDrag: onDrag,
|
|
489
489
|
onDrop: onDrop
|
|
490
490
|
}));
|
|
491
491
|
}
|
|
492
|
-
return /*#__PURE__*/React
|
|
492
|
+
return /*#__PURE__*/React.createElement("tr", opts, /*#__PURE__*/React.createElement(DefaultCells, {
|
|
493
493
|
row: row
|
|
494
494
|
}));
|
|
495
495
|
}
|
|
@@ -527,7 +527,7 @@ function InputText(_ref) {
|
|
|
527
527
|
useEffect(() => {
|
|
528
528
|
setValue(value);
|
|
529
529
|
}, [value]);
|
|
530
|
-
return /*#__PURE__*/React
|
|
530
|
+
return /*#__PURE__*/React.createElement(FormControl, {
|
|
531
531
|
name: name,
|
|
532
532
|
label: label,
|
|
533
533
|
required: required,
|
|
@@ -535,7 +535,7 @@ function InputText(_ref) {
|
|
|
535
535
|
prefix: prefix,
|
|
536
536
|
suffix: suffix,
|
|
537
537
|
className: className
|
|
538
|
-
}, /*#__PURE__*/React
|
|
538
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
539
539
|
type: type || "text"
|
|
540
540
|
}, props, {
|
|
541
541
|
"data-testid": `input_${name}`,
|
|
@@ -580,7 +580,7 @@ function DefaultColumnFilter(props) {
|
|
|
580
580
|
setFilter(value || undefined);
|
|
581
581
|
}, [id, setValue, setFilterId, setFilter]);
|
|
582
582
|
/* eslint-disable jsx-a11y/no-autofocus */
|
|
583
|
-
return /*#__PURE__*/React
|
|
583
|
+
return /*#__PURE__*/React.createElement(InputText, {
|
|
584
584
|
size: "sm",
|
|
585
585
|
id: id,
|
|
586
586
|
name: id,
|
|
@@ -640,7 +640,7 @@ function DefaultCellOperations({
|
|
|
640
640
|
i18n
|
|
641
641
|
}) {
|
|
642
642
|
const data = row.original;
|
|
643
|
-
return /*#__PURE__*/React
|
|
643
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
644
644
|
className: "btn-group"
|
|
645
645
|
}, operations.filter(({
|
|
646
646
|
permissionsResolver
|
|
@@ -649,7 +649,7 @@ function DefaultCellOperations({
|
|
|
649
649
|
OperationButton = DefaultOperationButton
|
|
650
650
|
} = _ref,
|
|
651
651
|
operation = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
652
|
-
return /*#__PURE__*/React
|
|
652
|
+
return /*#__PURE__*/React.createElement(OperationButton, _extends({
|
|
653
653
|
key: operation.action
|
|
654
654
|
}, operation, {
|
|
655
655
|
"data-testid": `operation-${index}-${operation.action}`,
|
|
@@ -676,10 +676,10 @@ function useOperations({
|
|
|
676
676
|
return [...columns, {
|
|
677
677
|
id: "operations",
|
|
678
678
|
groupByBoundary: true,
|
|
679
|
-
Header: () => /*#__PURE__*/React
|
|
679
|
+
Header: () => /*#__PURE__*/React.createElement("div", {
|
|
680
680
|
className: "text-center"
|
|
681
681
|
}, i18n("Operations")),
|
|
682
|
-
Cell: props => /*#__PURE__*/React
|
|
682
|
+
Cell: props => /*#__PURE__*/React.createElement(CellOperations, _extends({}, props, {
|
|
683
683
|
operations: operations,
|
|
684
684
|
onClick: onClick,
|
|
685
685
|
ctx: ctx,
|
|
@@ -700,12 +700,12 @@ function getOperationCallback(operations, onClick) {
|
|
|
700
700
|
};
|
|
701
701
|
}
|
|
702
702
|
function DefaultLoader() {
|
|
703
|
-
return /*#__PURE__*/React
|
|
703
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
704
704
|
className: "text-center p-2 pb-4 font-bold"
|
|
705
705
|
}, "Loading in progress");
|
|
706
706
|
}
|
|
707
707
|
function DefaultEmptyData() {
|
|
708
|
-
return /*#__PURE__*/React
|
|
708
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
709
709
|
className: "text-center p-2 pb-4 font-bold"
|
|
710
710
|
}, "No data found");
|
|
711
711
|
}
|
|
@@ -743,12 +743,12 @@ function useCustomTable(props) {
|
|
|
743
743
|
} = props,
|
|
744
744
|
ctx = _objectWithoutPropertiesLoose(props, _excluded$9);
|
|
745
745
|
const _onClick = getOperationCallback(operations, onClick);
|
|
746
|
-
const defaultColumn = React
|
|
746
|
+
const defaultColumn = React.useMemo(() => ({
|
|
747
747
|
// Let's set up our default Filter UI
|
|
748
748
|
Filter: ColumnFilter,
|
|
749
749
|
ArrowSort
|
|
750
750
|
}), [ColumnFilter, ArrowSort]);
|
|
751
|
-
const [filterId, setFilterId] = React
|
|
751
|
+
const [filterId, setFilterId] = React.useState(controlledFilterId);
|
|
752
752
|
// DND
|
|
753
753
|
const [records, setRecords] = useState(data);
|
|
754
754
|
useEffect(() => {
|
|
@@ -793,7 +793,7 @@ function useCustomTable(props) {
|
|
|
793
793
|
filters
|
|
794
794
|
}
|
|
795
795
|
} = tableInstance;
|
|
796
|
-
React
|
|
796
|
+
React.useEffect(() => {
|
|
797
797
|
onChange({
|
|
798
798
|
pageIndex,
|
|
799
799
|
pageSize,
|
|
@@ -852,26 +852,26 @@ function Table(props) {
|
|
|
852
852
|
onDrop
|
|
853
853
|
} = useCustomTable(props);
|
|
854
854
|
// Render the UI for your table
|
|
855
|
-
return /*#__PURE__*/React
|
|
855
|
+
return /*#__PURE__*/React.createElement(DrapNDropContainer, {
|
|
856
856
|
enableDragNDrop: enableDragNDrop
|
|
857
|
-
}, /*#__PURE__*/React
|
|
857
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
858
858
|
className: classnames("table-group table-responsive", className)
|
|
859
|
-
}, /*#__PURE__*/React
|
|
859
|
+
}, /*#__PURE__*/React.createElement("table", _extends({
|
|
860
860
|
className: "table table-striped table-hover"
|
|
861
|
-
}, tableInstance.getTableProps()), /*#__PURE__*/React
|
|
861
|
+
}, tableInstance.getTableProps()), /*#__PURE__*/React.createElement("thead", null, tableInstance.headerGroups.map((headerGroup, i) => /*#__PURE__*/React.createElement("tr", _extends({}, headerGroup.getHeaderGroupProps(), {
|
|
862
862
|
key: `tableInstance.headerGroups${i}`
|
|
863
|
-
}), enableDragNDrop ? /*#__PURE__*/React
|
|
863
|
+
}), enableDragNDrop ? /*#__PURE__*/React.createElement("th", {
|
|
864
864
|
role: "columnheader",
|
|
865
865
|
className: "text-center"
|
|
866
|
-
}, /*#__PURE__*/React
|
|
866
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
867
867
|
className: "table-cell-header"
|
|
868
|
-
})) : null, headerGroup.headers.map(column => /*#__PURE__*/React
|
|
868
|
+
})) : null, headerGroup.headers.map(column => /*#__PURE__*/React.createElement("th", _extends({}, column.getHeaderProps(), {
|
|
869
869
|
key: `tableInstance.headers.column.${column.id}`
|
|
870
|
-
}), /*#__PURE__*/React
|
|
870
|
+
}), /*#__PURE__*/React.createElement(CellHeader, {
|
|
871
871
|
column: column
|
|
872
|
-
})))))), !isLoading ? /*#__PURE__*/React
|
|
872
|
+
})))))), !isLoading ? /*#__PURE__*/React.createElement("tbody", tableInstance.getTableBodyProps(), tableInstance.page.map((row, index) => {
|
|
873
873
|
tableInstance.prepareRow(row);
|
|
874
|
-
return /*#__PURE__*/React
|
|
874
|
+
return /*#__PURE__*/React.createElement(Row, {
|
|
875
875
|
index: index,
|
|
876
876
|
enableDragNDrop: enableDragNDrop,
|
|
877
877
|
onClick: onClick,
|
|
@@ -880,9 +880,9 @@ function Table(props) {
|
|
|
880
880
|
onDrag: onDrag,
|
|
881
881
|
onDrop: onDrop
|
|
882
882
|
});
|
|
883
|
-
})) : null), isLoading ? /*#__PURE__*/React
|
|
883
|
+
})) : null), isLoading ? /*#__PURE__*/React.createElement(Loader, null) : null, !data.length ? /*#__PURE__*/React.createElement(EmptyData, null) : null, !isLoading && data.length && !disablePagination ? /*#__PURE__*/React.createElement("div", {
|
|
884
884
|
className: "overflow-hidden"
|
|
885
|
-
}, /*#__PURE__*/React
|
|
885
|
+
}, /*#__PURE__*/React.createElement(Pagination, _extends({}, tableInstance, {
|
|
886
886
|
totalLength: totalLength,
|
|
887
887
|
className: "text-sm",
|
|
888
888
|
pageIndex: pageIndex,
|
|
@@ -911,13 +911,13 @@ function ActionsTable(_ref) {
|
|
|
911
911
|
accessor: "title",
|
|
912
912
|
id: "title"
|
|
913
913
|
}];
|
|
914
|
-
return /*#__PURE__*/React
|
|
914
|
+
return /*#__PURE__*/React.createElement(Table, _extends({}, props, {
|
|
915
915
|
disableFilters: disableFilters,
|
|
916
916
|
disablePagination: disablePagination,
|
|
917
917
|
columns: columns
|
|
918
|
-
}), /*#__PURE__*/React
|
|
918
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
919
919
|
className: "pagination-group"
|
|
920
|
-
}, /*#__PURE__*/React
|
|
920
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
921
921
|
"data-testid": "action-table-select",
|
|
922
922
|
name: "actions",
|
|
923
923
|
value: currentAction,
|
|
@@ -926,15 +926,15 @@ function ActionsTable(_ref) {
|
|
|
926
926
|
value: ""
|
|
927
927
|
}].concat(availableActions),
|
|
928
928
|
onChange: (name, action) => setAction(action)
|
|
929
|
-
}), /*#__PURE__*/React
|
|
929
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
930
930
|
className: "pl-3"
|
|
931
|
-
}, /*#__PURE__*/React
|
|
931
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
932
932
|
"data-testid": "action-table-add",
|
|
933
933
|
disabled: currentAction === "",
|
|
934
934
|
className: "btn btn-success",
|
|
935
935
|
onClick: () => currentAction && onAddAction(currentAction),
|
|
936
936
|
type: "submit"
|
|
937
|
-
}, /*#__PURE__*/React
|
|
937
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
938
938
|
className: classnames(iconClass(undefined, "plus"), "mr-1")
|
|
939
939
|
}), " ", i18n("Add action")))));
|
|
940
940
|
}
|
|
@@ -949,9 +949,9 @@ function formatError(error) {
|
|
|
949
949
|
if (Object.prototype.hasOwnProperty.call(error, "errors")) {
|
|
950
950
|
return Object.keys(error.errors).map((key, index) => {
|
|
951
951
|
const item = error.errors[key];
|
|
952
|
-
return /*#__PURE__*/React
|
|
952
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
953
953
|
key: index
|
|
954
|
-
}, /*#__PURE__*/React
|
|
954
|
+
}, /*#__PURE__*/React.createElement("strong", null, item.name, " (", item.path, ")"), " ", "- ", item.message);
|
|
955
955
|
});
|
|
956
956
|
}
|
|
957
957
|
// If this is a standard error.
|
|
@@ -961,7 +961,7 @@ function formatError(error) {
|
|
|
961
961
|
// If this is a joy validation error.
|
|
962
962
|
if (Object.prototype.hasOwnProperty.call(error, "name") && error.name === "ValidationError") {
|
|
963
963
|
return error.details.map((item, index) => {
|
|
964
|
-
return /*#__PURE__*/React
|
|
964
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
965
965
|
key: index
|
|
966
966
|
}, item.message);
|
|
967
967
|
});
|
|
@@ -979,7 +979,7 @@ function Alert({
|
|
|
979
979
|
if (!error || Array.isArray(error) && !error.length) {
|
|
980
980
|
return null;
|
|
981
981
|
}
|
|
982
|
-
return /*#__PURE__*/React
|
|
982
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
983
983
|
className: `alert alert-${type}`,
|
|
984
984
|
role: "alert"
|
|
985
985
|
}, formatError(error));
|
|
@@ -990,13 +990,13 @@ function Card({
|
|
|
990
990
|
label,
|
|
991
991
|
className
|
|
992
992
|
}) {
|
|
993
|
-
return /*#__PURE__*/React
|
|
993
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
994
994
|
className: classnames("card", className)
|
|
995
|
-
}, /*#__PURE__*/React
|
|
995
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
996
996
|
className: "card-header "
|
|
997
|
-
}, /*#__PURE__*/React
|
|
997
|
+
}, /*#__PURE__*/React.createElement("h4", {
|
|
998
998
|
className: "card-title"
|
|
999
|
-
}, label)), /*#__PURE__*/React
|
|
999
|
+
}, label)), /*#__PURE__*/React.createElement("div", {
|
|
1000
1000
|
className: "card-body",
|
|
1001
1001
|
role: "article"
|
|
1002
1002
|
}, children));
|
|
@@ -1152,7 +1152,7 @@ function Form(props) {
|
|
|
1152
1152
|
const {
|
|
1153
1153
|
element
|
|
1154
1154
|
} = useForm(props);
|
|
1155
|
-
return /*#__PURE__*/React
|
|
1155
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1156
1156
|
"data-testid": `formioContainer${props.name || ""}`,
|
|
1157
1157
|
ref: element,
|
|
1158
1158
|
className: props.className
|
|
@@ -1451,7 +1451,7 @@ function NamedFormAccess({
|
|
|
1451
1451
|
children
|
|
1452
1452
|
}) {
|
|
1453
1453
|
const [isValid, setIsValid] = useState(true);
|
|
1454
|
-
return /*#__PURE__*/React
|
|
1454
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form, {
|
|
1455
1455
|
name: name,
|
|
1456
1456
|
form: form[name],
|
|
1457
1457
|
submission: submissions[name],
|
|
@@ -1465,11 +1465,11 @@ function NamedFormAccess({
|
|
|
1465
1465
|
setIsValid(isValid);
|
|
1466
1466
|
},
|
|
1467
1467
|
options: options
|
|
1468
|
-
}), /*#__PURE__*/React
|
|
1468
|
+
}), /*#__PURE__*/React.createElement("button", {
|
|
1469
1469
|
disabled: !isValid,
|
|
1470
1470
|
className: "mt-5 btn btn-primary",
|
|
1471
1471
|
onClick: onSubmit
|
|
1472
|
-
}, "Save access"), children, /*#__PURE__*/React
|
|
1472
|
+
}, "Save access"), children, /*#__PURE__*/React.createElement("div", {
|
|
1473
1473
|
className: "alert alert-warning mt-5"
|
|
1474
1474
|
}, "Elevated permissions allow users to access and modify other user's entities. Assign with caution."));
|
|
1475
1475
|
}
|
|
@@ -1482,43 +1482,43 @@ function FormAccess(props) {
|
|
|
1482
1482
|
onChange,
|
|
1483
1483
|
onSubmit
|
|
1484
1484
|
} = useFormAccess(props);
|
|
1485
|
-
return /*#__PURE__*/React
|
|
1485
|
+
return /*#__PURE__*/React.createElement("div", null, props.children, /*#__PURE__*/React.createElement("div", {
|
|
1486
1486
|
className: "flex mb-5"
|
|
1487
|
-
}, /*#__PURE__*/React
|
|
1487
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
1488
1488
|
label: "Manage submission access",
|
|
1489
1489
|
className: "flex-1"
|
|
1490
|
-
}, /*#__PURE__*/React
|
|
1490
|
+
}, /*#__PURE__*/React.createElement(NamedFormAccess, {
|
|
1491
1491
|
name: "submissionAccess",
|
|
1492
1492
|
form: form,
|
|
1493
1493
|
submissions: submissions,
|
|
1494
1494
|
onChange: onChange,
|
|
1495
1495
|
onSubmit: onSubmit,
|
|
1496
1496
|
options: options
|
|
1497
|
-
}, props.children)), /*#__PURE__*/React
|
|
1497
|
+
}, props.children)), /*#__PURE__*/React.createElement("div", {
|
|
1498
1498
|
className: "w-1/4 pl-4"
|
|
1499
|
-
}, /*#__PURE__*/React
|
|
1499
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
1500
1500
|
label: "About Submission Data Permissions"
|
|
1501
|
-
}, /*#__PURE__*/React
|
|
1501
|
+
}, /*#__PURE__*/React.createElement("p", null, "Submission Data Permissions allow you to control who can create, view, and modify form submission data."), /*#__PURE__*/React.createElement("ul", {
|
|
1502
1502
|
className: "mt-5 pl-7 list-disc"
|
|
1503
|
-
}, /*#__PURE__*/React
|
|
1503
|
+
}, /*#__PURE__*/React.createElement("li", {
|
|
1504
1504
|
className: "pb-2"
|
|
1505
|
-
}, /*#__PURE__*/React
|
|
1505
|
+
}, /*#__PURE__*/React.createElement("strong", null, "Own Permissions"), " - These permissions apply if the user is the original creator of the submission data and is listed as the owner of the submission in submission.owner. This allows users to create and edit their own submission data without seeing other user's data."), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("strong", null, "All Permissions"), " - These permissions apply to all submission data regardless of who owns it."))))), /*#__PURE__*/React.createElement("div", {
|
|
1506
1506
|
className: "flex mb-5"
|
|
1507
|
-
}, /*#__PURE__*/React
|
|
1507
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
1508
1508
|
label: `Manage ${type} definition access`,
|
|
1509
1509
|
className: "flex-1"
|
|
1510
|
-
}, /*#__PURE__*/React
|
|
1510
|
+
}, /*#__PURE__*/React.createElement(NamedFormAccess, {
|
|
1511
1511
|
name: "access",
|
|
1512
1512
|
form: form,
|
|
1513
1513
|
submissions: submissions,
|
|
1514
1514
|
onChange: onChange,
|
|
1515
1515
|
onSubmit: onSubmit,
|
|
1516
1516
|
options: options
|
|
1517
|
-
}, props.children)), /*#__PURE__*/React
|
|
1517
|
+
}, props.children)), /*#__PURE__*/React.createElement("div", {
|
|
1518
1518
|
className: "w-1/4 pl-4"
|
|
1519
|
-
}, /*#__PURE__*/React
|
|
1519
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
1520
1520
|
label: "About Form Definition Access"
|
|
1521
|
-
}, /*#__PURE__*/React
|
|
1521
|
+
}, /*#__PURE__*/React.createElement("p", null, "These permissions allow you to give access to a single form's JSON definition so they can render the form."), /*#__PURE__*/React.createElement("p", null, "Typically you will want to allow all of your roles to be able to Read the form definition."), /*#__PURE__*/React.createElement("p", null, "Each form also has an owner at ", /*#__PURE__*/React.createElement("strong", null, "form.owner"), " which is the user who created the form. In some applications users are allowed to create their own forms. In those cases it is helpful to have Owner based permissions as well.")))));
|
|
1522
1522
|
}
|
|
1523
1523
|
|
|
1524
1524
|
const _excluded$6 = ["action"],
|
|
@@ -1566,7 +1566,7 @@ function FormAction(_ref2) {
|
|
|
1566
1566
|
}
|
|
1567
1567
|
};
|
|
1568
1568
|
})();
|
|
1569
|
-
return /*#__PURE__*/React
|
|
1569
|
+
return /*#__PURE__*/React.createElement("div", null, children, /*#__PURE__*/React.createElement(Form, {
|
|
1570
1570
|
form: form,
|
|
1571
1571
|
submission: submission,
|
|
1572
1572
|
onSubmit: onSubmit,
|
|
@@ -1604,7 +1604,7 @@ async function createBuilder(el, {
|
|
|
1604
1604
|
console.error(er);
|
|
1605
1605
|
}
|
|
1606
1606
|
}
|
|
1607
|
-
class FormBuilder extends React
|
|
1607
|
+
class FormBuilder extends React.Component {
|
|
1608
1608
|
constructor(props) {
|
|
1609
1609
|
super(props);
|
|
1610
1610
|
this.elRef = void 0;
|
|
@@ -1682,12 +1682,12 @@ class FormBuilder extends React$1.Component {
|
|
|
1682
1682
|
});
|
|
1683
1683
|
}
|
|
1684
1684
|
render() {
|
|
1685
|
-
return /*#__PURE__*/React
|
|
1685
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1686
1686
|
ref: ref => {
|
|
1687
1687
|
this.elRef = ref;
|
|
1688
1688
|
},
|
|
1689
1689
|
onClick: e => e.stopPropagation()
|
|
1690
|
-
}, /*#__PURE__*/React
|
|
1690
|
+
}, /*#__PURE__*/React.createElement("div", null));
|
|
1691
1691
|
}
|
|
1692
1692
|
}
|
|
1693
1693
|
FormBuilder.defaultProps = {
|
|
@@ -1756,37 +1756,37 @@ function FormEditCTAs({
|
|
|
1756
1756
|
placement: "top",
|
|
1757
1757
|
title: t("Reset all changes")
|
|
1758
1758
|
});
|
|
1759
|
-
return /*#__PURE__*/React
|
|
1759
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1760
1760
|
className: "form-edit__actions"
|
|
1761
|
-
}, /*#__PURE__*/React
|
|
1761
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
|
|
1762
1762
|
className: `btn btn-primary btn-save flex ${disabled ? "disabled" : ""}`,
|
|
1763
1763
|
disabled: disabled,
|
|
1764
1764
|
onClick: () => !disabled && onSubmit && onSubmit()
|
|
1765
|
-
}, /*#__PURE__*/React
|
|
1765
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
1766
1766
|
className: `mr-1 ${iconClass(options.iconset, "save")}`
|
|
1767
|
-
}), saveText), /*#__PURE__*/React
|
|
1767
|
+
}), saveText), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
|
|
1768
1768
|
className: `btn btn-light btn-undo ${hasUndo ? "" : "disabled"}`,
|
|
1769
1769
|
onClick: () => onUndo && onUndo(),
|
|
1770
1770
|
ref: undoTooltipRef
|
|
1771
|
-
}, /*#__PURE__*/React
|
|
1771
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
1772
1772
|
className: iconClass(options.iconset, "undo")
|
|
1773
|
-
})), /*#__PURE__*/React
|
|
1773
|
+
})), /*#__PURE__*/React.createElement("button", {
|
|
1774
1774
|
className: `btn btn-light btn-redo ${hasRedo ? "" : "disabled"}`,
|
|
1775
1775
|
onClick: () => onRedo && onRedo(),
|
|
1776
1776
|
ref: redoTooltipRef
|
|
1777
|
-
}, /*#__PURE__*/React
|
|
1777
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
1778
1778
|
className: iconClass(options.iconset, "redo")
|
|
1779
|
-
}))), /*#__PURE__*/React
|
|
1779
|
+
}))), /*#__PURE__*/React.createElement("div", null, onCopy && /*#__PURE__*/React.createElement("button", {
|
|
1780
1780
|
className: "btn btn-light",
|
|
1781
1781
|
onClick: () => onCopy(),
|
|
1782
1782
|
ref: copyTooltipRef
|
|
1783
|
-
}, /*#__PURE__*/React
|
|
1783
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
1784
1784
|
className: iconClass(options.iconset, "copy")
|
|
1785
|
-
})), /*#__PURE__*/React
|
|
1785
|
+
})), /*#__PURE__*/React.createElement("button", {
|
|
1786
1786
|
className: `btn btn-light btn-reset`,
|
|
1787
1787
|
onClick: () => onReset && onReset(),
|
|
1788
1788
|
ref: resetTooltipRef
|
|
1789
|
-
}, /*#__PURE__*/React
|
|
1789
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
1790
1790
|
className: iconClass(options.iconset, "reset")
|
|
1791
1791
|
})))));
|
|
1792
1792
|
}
|
|
@@ -1832,14 +1832,14 @@ function InputTags(_ref) {
|
|
|
1832
1832
|
instance.destroy();
|
|
1833
1833
|
};
|
|
1834
1834
|
}, []);
|
|
1835
|
-
return /*#__PURE__*/React
|
|
1835
|
+
return /*#__PURE__*/React.createElement(FormControl, {
|
|
1836
1836
|
name: name,
|
|
1837
1837
|
label: label,
|
|
1838
1838
|
required: required,
|
|
1839
1839
|
description: description,
|
|
1840
1840
|
prefix: prefix,
|
|
1841
1841
|
suffix: suffix
|
|
1842
|
-
}, /*#__PURE__*/React
|
|
1842
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
1843
1843
|
ref: ref,
|
|
1844
1844
|
type: "text"
|
|
1845
1845
|
}, props, {
|
|
@@ -1876,11 +1876,11 @@ function FormParameters({
|
|
|
1876
1876
|
baseUrl = window.location.origin
|
|
1877
1877
|
}) {
|
|
1878
1878
|
const hasTypeChoices = typeChoices && typeChoices.length > 1;
|
|
1879
|
-
return /*#__PURE__*/React
|
|
1879
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1880
1880
|
className: `form-edit__settings ${className}`
|
|
1881
|
-
}, /*#__PURE__*/React
|
|
1881
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1882
1882
|
className: "w-1/3"
|
|
1883
|
-
}, /*#__PURE__*/React
|
|
1883
|
+
}, /*#__PURE__*/React.createElement(InputText, {
|
|
1884
1884
|
label: "Title",
|
|
1885
1885
|
placeholder: "Enter the form title",
|
|
1886
1886
|
name: "title",
|
|
@@ -1888,9 +1888,9 @@ function FormParameters({
|
|
|
1888
1888
|
value: form.title,
|
|
1889
1889
|
disabled: !!readonly["title"],
|
|
1890
1890
|
onChange: onChange
|
|
1891
|
-
})), /*#__PURE__*/React
|
|
1891
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
1892
1892
|
className: "w-1/3"
|
|
1893
|
-
}, /*#__PURE__*/React
|
|
1893
|
+
}, /*#__PURE__*/React.createElement(InputText, {
|
|
1894
1894
|
label: "Name",
|
|
1895
1895
|
placeholder: "Enter the form machine name",
|
|
1896
1896
|
name: "name",
|
|
@@ -1898,16 +1898,16 @@ function FormParameters({
|
|
|
1898
1898
|
disabled: !!readonly["name"],
|
|
1899
1899
|
value: form.name,
|
|
1900
1900
|
onChange: onChange
|
|
1901
|
-
})), /*#__PURE__*/React
|
|
1901
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
1902
1902
|
className: "w-1/3"
|
|
1903
|
-
}, /*#__PURE__*/React
|
|
1903
|
+
}, /*#__PURE__*/React.createElement(InputText, {
|
|
1904
1904
|
label: "Path",
|
|
1905
1905
|
placeholder: "example",
|
|
1906
1906
|
name: "path",
|
|
1907
1907
|
className: "mb-0",
|
|
1908
|
-
description: /*#__PURE__*/React
|
|
1908
|
+
description: /*#__PURE__*/React.createElement("span", {
|
|
1909
1909
|
className: "text-xxs flex items-center"
|
|
1910
|
-
}, /*#__PURE__*/React
|
|
1910
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
1911
1911
|
className: "bx bx-link ml-1 mr-1"
|
|
1912
1912
|
}), `${baseUrl}/${form.path}`),
|
|
1913
1913
|
required: true,
|
|
@@ -1918,26 +1918,26 @@ function FormParameters({
|
|
|
1918
1918
|
width: "120px"
|
|
1919
1919
|
},
|
|
1920
1920
|
onChange: onChange
|
|
1921
|
-
})), /*#__PURE__*/React
|
|
1921
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
1922
1922
|
className: "w-1/3"
|
|
1923
|
-
}, /*#__PURE__*/React
|
|
1923
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
1924
1924
|
label: "Display as",
|
|
1925
1925
|
name: "display",
|
|
1926
1926
|
disabled: !!readonly["display"],
|
|
1927
1927
|
value: form.display,
|
|
1928
1928
|
choices: displayChoices,
|
|
1929
1929
|
onChange: onChange
|
|
1930
|
-
})), hasTypeChoices && /*#__PURE__*/React
|
|
1930
|
+
})), hasTypeChoices && /*#__PURE__*/React.createElement("div", {
|
|
1931
1931
|
className: "w-1/3"
|
|
1932
|
-
}, /*#__PURE__*/React
|
|
1932
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
1933
1933
|
label: "Type",
|
|
1934
1934
|
name: "type",
|
|
1935
1935
|
value: form.type,
|
|
1936
1936
|
choices: typeChoices,
|
|
1937
1937
|
onChange: onChange
|
|
1938
|
-
})), enableTags && /*#__PURE__*/React
|
|
1938
|
+
})), enableTags && /*#__PURE__*/React.createElement("div", {
|
|
1939
1939
|
className: "w-1/3"
|
|
1940
|
-
}, /*#__PURE__*/React
|
|
1940
|
+
}, /*#__PURE__*/React.createElement(InputTags, {
|
|
1941
1941
|
label: "Tags",
|
|
1942
1942
|
name: "tags",
|
|
1943
1943
|
value: form.tags,
|
|
@@ -2103,14 +2103,14 @@ function FormEdit(props) {
|
|
|
2103
2103
|
options = {},
|
|
2104
2104
|
builder
|
|
2105
2105
|
} = props;
|
|
2106
|
-
return /*#__PURE__*/React
|
|
2106
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
2107
2107
|
className: "form-edit"
|
|
2108
|
-
}, /*#__PURE__*/React
|
|
2108
|
+
}, /*#__PURE__*/React.createElement(FormParameters, _extends({}, props, {
|
|
2109
2109
|
className: "",
|
|
2110
2110
|
key: `form-settings-${form._id}`,
|
|
2111
2111
|
form: form,
|
|
2112
2112
|
onChange: setChange
|
|
2113
|
-
})), /*#__PURE__*/React
|
|
2113
|
+
})), /*#__PURE__*/React.createElement(FormEditCTAs, _extends({}, props, {
|
|
2114
2114
|
className: "",
|
|
2115
2115
|
key: `form-edit-ctas-${form._id}`,
|
|
2116
2116
|
options: options,
|
|
@@ -2122,7 +2122,7 @@ function FormEdit(props) {
|
|
|
2122
2122
|
onReset: reset,
|
|
2123
2123
|
onCopy: onCopy,
|
|
2124
2124
|
onSubmit: onSubmit
|
|
2125
|
-
}))), /*#__PURE__*/React
|
|
2125
|
+
}))), /*#__PURE__*/React.createElement(FormBuilder, {
|
|
2126
2126
|
key: `form-builder-${form._id}`,
|
|
2127
2127
|
components: form.components,
|
|
2128
2128
|
display: form.display,
|
|
@@ -2264,12 +2264,12 @@ function FormSettings(props) {
|
|
|
2264
2264
|
isValid
|
|
2265
2265
|
} = useFormSettings(props);
|
|
2266
2266
|
const i18n = options.i18n || (f => f);
|
|
2267
|
-
return /*#__PURE__*/React
|
|
2267
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form, {
|
|
2268
2268
|
form: form,
|
|
2269
2269
|
submission: submission,
|
|
2270
2270
|
onChange: onChange,
|
|
2271
2271
|
options: options
|
|
2272
|
-
}), /*#__PURE__*/React
|
|
2272
|
+
}), /*#__PURE__*/React.createElement("button", {
|
|
2273
2273
|
"data-testid": "submit",
|
|
2274
2274
|
disabled: !isValid,
|
|
2275
2275
|
className: "mt-5 btn btn-primary",
|
|
@@ -2323,7 +2323,7 @@ function SelectColumnFilter(props) {
|
|
|
2323
2323
|
choices,
|
|
2324
2324
|
onChange
|
|
2325
2325
|
} = useSelectColumnFilter(props);
|
|
2326
|
-
return /*#__PURE__*/React
|
|
2326
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
2327
2327
|
key: `filter-${props.column.id}`,
|
|
2328
2328
|
name: `filter-${props.column.id}`,
|
|
2329
2329
|
size: "sm",
|
|
@@ -6871,30 +6871,30 @@ function FormsCell(props) {
|
|
|
6871
6871
|
original: form
|
|
6872
6872
|
}
|
|
6873
6873
|
} = props;
|
|
6874
|
-
return /*#__PURE__*/React
|
|
6874
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
6875
6875
|
className: "p-1"
|
|
6876
|
-
}, /*#__PURE__*/React
|
|
6876
|
+
}, /*#__PURE__*/React.createElement("h4", {
|
|
6877
6877
|
className: "text-primary text-lg flex items-center"
|
|
6878
|
-
}, /*#__PURE__*/React
|
|
6878
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
6879
6879
|
className: classnames(iconClass(undefined, icon), "mr-1")
|
|
6880
|
-
}), form.title), /*#__PURE__*/React
|
|
6880
|
+
}), form.title), /*#__PURE__*/React.createElement("ul", {
|
|
6881
6881
|
className: "reset-list text-gray-500"
|
|
6882
|
-
}, /*#__PURE__*/React
|
|
6882
|
+
}, /*#__PURE__*/React.createElement("li", {
|
|
6883
6883
|
className: "text-sm"
|
|
6884
|
-
}, "Name: ", form.name || form.machineName), /*#__PURE__*/React
|
|
6884
|
+
}, "Name: ", form.name || form.machineName), /*#__PURE__*/React.createElement("li", {
|
|
6885
6885
|
className: "mt-5"
|
|
6886
|
-
}, /*#__PURE__*/React
|
|
6886
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
6887
6887
|
className: "badge bg-light mr-1"
|
|
6888
|
-
}, /*#__PURE__*/React
|
|
6888
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
6889
6889
|
className: classnames(iconClass(undefined, "history"), "mr-1")
|
|
6890
|
-
}), /*#__PURE__*/React
|
|
6890
|
+
}), /*#__PURE__*/React.createElement("span", null, "Updated ", moment(form.modified).fromNow())), (form.tags || []).map((tag, index) => /*#__PURE__*/React.createElement("button", {
|
|
6891
6891
|
key: index,
|
|
6892
6892
|
className: "badge badge-hover bg-secondary mr-1",
|
|
6893
6893
|
onClick: stopPropagationWrapper(() => {
|
|
6894
6894
|
props.setFilter("tags", tag);
|
|
6895
6895
|
props.gotoPage(0);
|
|
6896
6896
|
})
|
|
6897
|
-
}, /*#__PURE__*/React
|
|
6897
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
6898
6898
|
className: classnames(iconClass(undefined, "tags"), "mr-1")
|
|
6899
6899
|
}), tag)))));
|
|
6900
6900
|
}
|
|
@@ -6914,7 +6914,7 @@ function FormsTable(_ref) {
|
|
|
6914
6914
|
Header: i18n("Title"),
|
|
6915
6915
|
accessor: "title",
|
|
6916
6916
|
id: "title",
|
|
6917
|
-
Cell: props => /*#__PURE__*/React
|
|
6917
|
+
Cell: props => /*#__PURE__*/React.createElement(FormCell, _extends({}, props, {
|
|
6918
6918
|
icon: props.icon,
|
|
6919
6919
|
i18n: i18n
|
|
6920
6920
|
})),
|
|
@@ -6925,13 +6925,13 @@ function FormsTable(_ref) {
|
|
|
6925
6925
|
accessor: "tags",
|
|
6926
6926
|
id: "tags",
|
|
6927
6927
|
hidden: true,
|
|
6928
|
-
Filter: props => tags && tags.length ? /*#__PURE__*/React
|
|
6928
|
+
Filter: props => tags && tags.length ? /*#__PURE__*/React.createElement(SelectColumnFilter, _extends({}, props, {
|
|
6929
6929
|
column: _extends({}, props.columns, {
|
|
6930
6930
|
choices: tags
|
|
6931
6931
|
})
|
|
6932
|
-
})) : /*#__PURE__*/React
|
|
6932
|
+
})) : /*#__PURE__*/React.createElement(DefaultColumnFilter, props)
|
|
6933
6933
|
}];
|
|
6934
|
-
return /*#__PURE__*/React
|
|
6934
|
+
return /*#__PURE__*/React.createElement(Table, _extends({}, props, {
|
|
6935
6935
|
columns: columns
|
|
6936
6936
|
}));
|
|
6937
6937
|
}
|
|
@@ -6943,9 +6943,9 @@ function Loader({
|
|
|
6943
6943
|
className = ""
|
|
6944
6944
|
}) {
|
|
6945
6945
|
if (isActive) {
|
|
6946
|
-
return /*#__PURE__*/React
|
|
6946
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
6947
6947
|
className: classnames("opacity-85 z-20 flex items-center justify-center p-5 absolute top-0 right-0 left-0 bottom-0 bg-white", className)
|
|
6948
|
-
}, /*#__PURE__*/React
|
|
6948
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
6949
6949
|
"data-testid": `icon_${icon}`,
|
|
6950
6950
|
color: color,
|
|
6951
6951
|
className: `text-11xl ${iconClass(undefined, icon, true)}`
|
|
@@ -7005,35 +7005,35 @@ function Modal(_ref) {
|
|
|
7005
7005
|
if (!show) {
|
|
7006
7006
|
return null;
|
|
7007
7007
|
}
|
|
7008
|
-
return /*#__PURE__*/React
|
|
7008
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7009
7009
|
role: "dialog",
|
|
7010
7010
|
className: `formio-dialog formio-dialog-theme-default ${className}`
|
|
7011
|
-
}, /*#__PURE__*/React
|
|
7011
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7012
7012
|
className: "formio-dialog-overlay",
|
|
7013
7013
|
onClick: onClickClose
|
|
7014
|
-
}), /*#__PURE__*/React
|
|
7014
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
7015
7015
|
style: style,
|
|
7016
7016
|
className: "formio-dialog-content"
|
|
7017
|
-
}, /*#__PURE__*/React
|
|
7017
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7018
7018
|
className: "formio-dialog-wrapper"
|
|
7019
|
-
}, title ? /*#__PURE__*/React
|
|
7019
|
+
}, title ? /*#__PURE__*/React.createElement("div", {
|
|
7020
7020
|
className: "formio-dialog-title",
|
|
7021
7021
|
ref: titleRef,
|
|
7022
7022
|
"data-testid": "modalTitle"
|
|
7023
|
-
}, title) : null, /*#__PURE__*/React
|
|
7023
|
+
}, title) : null, /*#__PURE__*/React.createElement("div", {
|
|
7024
7024
|
className: "formio-dialog-body",
|
|
7025
7025
|
style: {
|
|
7026
7026
|
maxHeight
|
|
7027
7027
|
},
|
|
7028
7028
|
"data-testid": "modalBody"
|
|
7029
|
-
}, show && children), ModalFooter ? /*#__PURE__*/React
|
|
7029
|
+
}, show && children), ModalFooter ? /*#__PURE__*/React.createElement("div", {
|
|
7030
7030
|
className: "formio-dialog-footer",
|
|
7031
7031
|
ref: footerRef,
|
|
7032
7032
|
"data-testid": "modalFooter"
|
|
7033
|
-
}, /*#__PURE__*/React
|
|
7033
|
+
}, /*#__PURE__*/React.createElement(ModalFooter, _extends({}, props, {
|
|
7034
7034
|
closeModal: closeModal,
|
|
7035
7035
|
onClose: onClickClose
|
|
7036
|
-
}))) : null), /*#__PURE__*/React
|
|
7036
|
+
}))) : null), /*#__PURE__*/React.createElement("button", {
|
|
7037
7037
|
className: "formio-dialog-close float-right btn btn-secondary btn-sm",
|
|
7038
7038
|
"aria-label": "close",
|
|
7039
7039
|
"data-testid": "closeModal",
|
|
@@ -7049,13 +7049,13 @@ function RemoveModalFooter({
|
|
|
7049
7049
|
onClose,
|
|
7050
7050
|
i18n = f => f
|
|
7051
7051
|
}) {
|
|
7052
|
-
return /*#__PURE__*/React
|
|
7052
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7053
7053
|
className: "flex items-center justify-center bg-white p-2"
|
|
7054
|
-
}, /*#__PURE__*/React
|
|
7054
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
7055
7055
|
"data-testid": "customCloseModal",
|
|
7056
7056
|
className: "btn btn-outline-dark mx-2",
|
|
7057
7057
|
onClick: onClose
|
|
7058
|
-
}, i18n("Cancel")), /*#__PURE__*/React
|
|
7058
|
+
}, i18n("Cancel")), /*#__PURE__*/React.createElement("button", {
|
|
7059
7059
|
disabled: valueToCompare !== value,
|
|
7060
7060
|
"data-testid": "customSubmitModal",
|
|
7061
7061
|
className: "btn btn-danger mx-2",
|
|
@@ -7064,7 +7064,7 @@ function RemoveModalFooter({
|
|
|
7064
7064
|
onSubmit(e);
|
|
7065
7065
|
}
|
|
7066
7066
|
}
|
|
7067
|
-
}, /*#__PURE__*/React
|
|
7067
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
7068
7068
|
className: classnames(iconClass(undefined, "trash"), "mr-2")
|
|
7069
7069
|
}), i18n("Remove")));
|
|
7070
7070
|
}
|
|
@@ -7079,7 +7079,7 @@ function RemoveModal(_ref) {
|
|
|
7079
7079
|
i18n = f => f
|
|
7080
7080
|
} = props;
|
|
7081
7081
|
const [value, setValue] = useState();
|
|
7082
|
-
return /*#__PURE__*/React
|
|
7082
|
+
return /*#__PURE__*/React.createElement(Modal, _extends({}, props, {
|
|
7083
7083
|
className: classnames(props.className, "formio-dialog-theme-remove"),
|
|
7084
7084
|
style: {
|
|
7085
7085
|
maxWidth
|
|
@@ -7087,11 +7087,11 @@ function RemoveModal(_ref) {
|
|
|
7087
7087
|
title: `Drop ${(_props$itemType = props.itemType) == null ? void 0 : _props$itemType.toLowerCase()}`,
|
|
7088
7088
|
value: value,
|
|
7089
7089
|
footer: RemoveModalFooter
|
|
7090
|
-
}), /*#__PURE__*/React
|
|
7090
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
7091
7091
|
className: "px-4 pt-3 pb-5"
|
|
7092
|
-
}, /*#__PURE__*/React
|
|
7092
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7093
7093
|
className: "pb-1"
|
|
7094
|
-
}, children, i18n("To drop"), " ", /*#__PURE__*/React
|
|
7094
|
+
}, children, i18n("To drop"), " ", /*#__PURE__*/React.createElement("strong", null, props.valueToCompare), ",\xA0", i18n("type the"), "\xA0", /*#__PURE__*/React.createElement("strong", null, "\"", (_props$itemType2 = props.itemType) == null ? void 0 : _props$itemType2.toLowerCase(), "\""), "\xA0", i18n("name"), " ", /*#__PURE__*/React.createElement("strong", null, "\"", props.valueToCompare, "\""), "."), /*#__PURE__*/React.createElement(InputText, {
|
|
7095
7095
|
name: "remove",
|
|
7096
7096
|
value: value,
|
|
7097
7097
|
onChange: (name, value) => setValue(value)
|
|
@@ -7269,17 +7269,17 @@ function DefaultCell({
|
|
|
7269
7269
|
render = f => f
|
|
7270
7270
|
}) {
|
|
7271
7271
|
if (value === undefined) {
|
|
7272
|
-
return /*#__PURE__*/React
|
|
7272
|
+
return /*#__PURE__*/React.createElement("span", null);
|
|
7273
7273
|
}
|
|
7274
7274
|
const rendered = render(value);
|
|
7275
7275
|
if (value !== rendered) {
|
|
7276
|
-
return /*#__PURE__*/React
|
|
7276
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7277
7277
|
dangerouslySetInnerHTML: {
|
|
7278
7278
|
__html: rendered
|
|
7279
7279
|
}
|
|
7280
7280
|
});
|
|
7281
7281
|
}
|
|
7282
|
-
return /*#__PURE__*/React
|
|
7282
|
+
return /*#__PURE__*/React.createElement("span", null, String(value));
|
|
7283
7283
|
}
|
|
7284
7284
|
|
|
7285
7285
|
function mapFormToColumns(form) {
|
|
@@ -7291,7 +7291,7 @@ function mapFormToColumns(form) {
|
|
|
7291
7291
|
Header: component.label || component.title || component.key,
|
|
7292
7292
|
accessor: `data.${component.key}`,
|
|
7293
7293
|
className: "text-center",
|
|
7294
|
-
Cell: props => /*#__PURE__*/React
|
|
7294
|
+
Cell: props => /*#__PURE__*/React.createElement(DefaultCell, _extends({}, props, {
|
|
7295
7295
|
render: value => cmp.asString(value)
|
|
7296
7296
|
}))
|
|
7297
7297
|
};
|
|
@@ -7312,7 +7312,7 @@ function SubmissionsTable(_ref) {
|
|
|
7312
7312
|
} = _ref,
|
|
7313
7313
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
7314
7314
|
const columns = form && mapFormToColumns(form);
|
|
7315
|
-
return /*#__PURE__*/React
|
|
7315
|
+
return /*#__PURE__*/React.createElement(Table, _extends({}, props, {
|
|
7316
7316
|
columns: columns
|
|
7317
7317
|
}));
|
|
7318
7318
|
}
|
|
@@ -7325,7 +7325,7 @@ function SliderColumnFilter({
|
|
|
7325
7325
|
id
|
|
7326
7326
|
}
|
|
7327
7327
|
}) {
|
|
7328
|
-
const [min, max] = React
|
|
7328
|
+
const [min, max] = React.useMemo(() => {
|
|
7329
7329
|
let min = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
|
|
7330
7330
|
let max = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
|
|
7331
7331
|
preFilteredRows.forEach(row => {
|
|
@@ -7334,7 +7334,7 @@ function SliderColumnFilter({
|
|
|
7334
7334
|
});
|
|
7335
7335
|
return [min, max];
|
|
7336
7336
|
}, [id, preFilteredRows]);
|
|
7337
|
-
return /*#__PURE__*/React
|
|
7337
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", {
|
|
7338
7338
|
type: "range",
|
|
7339
7339
|
min: min,
|
|
7340
7340
|
max: max,
|
|
@@ -7342,7 +7342,7 @@ function SliderColumnFilter({
|
|
|
7342
7342
|
onChange: e => {
|
|
7343
7343
|
setFilter(parseInt(e.target.value, 10));
|
|
7344
7344
|
}
|
|
7345
|
-
}), /*#__PURE__*/React
|
|
7345
|
+
}), /*#__PURE__*/React.createElement("button", {
|
|
7346
7346
|
onClick: () => setFilter(undefined)
|
|
7347
7347
|
}, "Off"));
|
|
7348
7348
|
}
|
|
@@ -7358,18 +7358,18 @@ function ButtonTab({
|
|
|
7358
7358
|
className,
|
|
7359
7359
|
after
|
|
7360
7360
|
}) {
|
|
7361
|
-
return /*#__PURE__*/React
|
|
7361
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7362
7362
|
title: "button-wrapper",
|
|
7363
7363
|
className: classnames("tw-tabs__button-wrapper", isActive ? "-active" : "", back ? "-back" : "", className)
|
|
7364
|
-
}, /*#__PURE__*/React
|
|
7364
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
7365
7365
|
title: "button-tab",
|
|
7366
7366
|
className: classnames("tw-tabs__button", reverse ? "-reverse" : "", isActive ? "-active" : "", back ? "-back" : ""),
|
|
7367
7367
|
onClick: onClick
|
|
7368
|
-
}, icon && /*#__PURE__*/React
|
|
7368
|
+
}, icon && /*#__PURE__*/React.createElement("i", {
|
|
7369
7369
|
className: classnames(iconClass(undefined, icon), "tw-tabs__button-icon")
|
|
7370
|
-
}), /*#__PURE__*/React
|
|
7370
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
7371
7371
|
className: "tw-tabs__button-label"
|
|
7372
|
-
}, children), after), /*#__PURE__*/React
|
|
7372
|
+
}, children), after), /*#__PURE__*/React.createElement("div", {
|
|
7373
7373
|
className: classnames("tw-tabs__button-border", isActive ? "-active" : "")
|
|
7374
7374
|
}));
|
|
7375
7375
|
}
|
|
@@ -7387,18 +7387,18 @@ function Tabs(_ref) {
|
|
|
7387
7387
|
i18n = f => f
|
|
7388
7388
|
} = _ref,
|
|
7389
7389
|
additionalProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
7390
|
-
return /*#__PURE__*/React
|
|
7390
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7391
7391
|
"data-testid": "tabs-comp",
|
|
7392
7392
|
className: `tw-tabs ${className}`,
|
|
7393
7393
|
style: style
|
|
7394
|
-
}, /*#__PURE__*/React
|
|
7394
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("nav", {
|
|
7395
7395
|
className: "tw-tabs__header"
|
|
7396
|
-
}, /*#__PURE__*/React
|
|
7396
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7397
7397
|
className: "tw-tabs__header-wrapper"
|
|
7398
|
-
}, /*#__PURE__*/React
|
|
7398
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7399
7399
|
className: "tw-tabs__header-border"
|
|
7400
7400
|
}), items.filter(item => item.label || item.icon).map((item, index) => {
|
|
7401
|
-
return /*#__PURE__*/React
|
|
7401
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
7402
7402
|
key: index,
|
|
7403
7403
|
back: item.back,
|
|
7404
7404
|
isActive: (current == null ? void 0 : current.action) === item.action,
|
|
@@ -7407,11 +7407,11 @@ function Tabs(_ref) {
|
|
|
7407
7407
|
onClick && onClick(item);
|
|
7408
7408
|
}
|
|
7409
7409
|
}, additionalProps, item), i18n(item.label || ""));
|
|
7410
|
-
}), AddButton && /*#__PURE__*/React
|
|
7410
|
+
}), AddButton && /*#__PURE__*/React.createElement(AddButton, _extends({}, additionalProps, {
|
|
7411
7411
|
current: current
|
|
7412
|
-
})))), HeaderChildren && /*#__PURE__*/React
|
|
7412
|
+
})))), HeaderChildren && /*#__PURE__*/React.createElement(HeaderChildren, _extends({}, additionalProps, {
|
|
7413
7413
|
current: current
|
|
7414
|
-
}))), /*#__PURE__*/React
|
|
7414
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
7415
7415
|
title: "tab-body",
|
|
7416
7416
|
className: "tw-tabs__body"
|
|
7417
7417
|
}, children));
|