@tsed/react-formio 2.1.0 → 2.1.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/dist/index.js +46 -46
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +191 -191
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -3
- package/src/components/table/components/defaultCells.component.tsx +1 -0
- package/src/components/table/components/dragNDropContainer.tsx +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -3,7 +3,7 @@ export { default as WebformBuilder } from 'formiojs/WebformBuilder';
|
|
|
3
3
|
export { default as Wizard } from 'formiojs/Wizard';
|
|
4
4
|
export { default as WizardBuilder } from 'formiojs/WizardBuilder';
|
|
5
5
|
import noop from 'lodash/noop';
|
|
6
|
-
import React
|
|
6
|
+
import React, { useRef, useEffect, useState, useMemo, useCallback, useReducer } from 'react';
|
|
7
7
|
import { Templates, Form as Form$1, Components } from 'formiojs';
|
|
8
8
|
export { Components, Formio, Templates, Utils } from 'formiojs';
|
|
9
9
|
import Choices from '@formio/choices.js';
|
|
@@ -128,27 +128,27 @@ function FormControl({
|
|
|
128
128
|
label,
|
|
129
129
|
className
|
|
130
130
|
}) {
|
|
131
|
-
return /*#__PURE__*/React
|
|
131
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
132
132
|
"data-testid": name && `form-group-${name}`,
|
|
133
133
|
id: `form-group-${name || ""}`,
|
|
134
134
|
className: classnames("form-group", className)
|
|
135
|
-
}, label && /*#__PURE__*/React
|
|
135
|
+
}, label && /*#__PURE__*/React.createElement("label", {
|
|
136
136
|
htmlFor: name,
|
|
137
137
|
"data-testid": "form-control-label",
|
|
138
138
|
className: `col-form-label ${required ? " field-required" : ""}`
|
|
139
|
-
}, label), /*#__PURE__*/React
|
|
139
|
+
}, label), /*#__PURE__*/React.createElement("div", {
|
|
140
140
|
className: "input-group"
|
|
141
|
-
}, prefix && /*#__PURE__*/React
|
|
141
|
+
}, prefix && /*#__PURE__*/React.createElement("div", {
|
|
142
142
|
className: "input-group-prepend"
|
|
143
|
-
}, /*#__PURE__*/React
|
|
143
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
144
144
|
className: "input-group-text",
|
|
145
145
|
"data-testid": "form-control-prefix"
|
|
146
|
-
}, prefix)), children, suffix && /*#__PURE__*/React
|
|
146
|
+
}, prefix)), children, suffix && /*#__PURE__*/React.createElement("div", {
|
|
147
147
|
className: "input-group-append"
|
|
148
|
-
}, /*#__PURE__*/React
|
|
148
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
149
149
|
className: "input-group-text",
|
|
150
150
|
"data-testid": "form-control-suffix"
|
|
151
|
-
}, suffix))), description && /*#__PURE__*/React
|
|
151
|
+
}, suffix))), description && /*#__PURE__*/React.createElement("div", {
|
|
152
152
|
"data-testid": "form-control-description",
|
|
153
153
|
className: "form-text text-muted"
|
|
154
154
|
}, description));
|
|
@@ -196,7 +196,7 @@ function Select(_ref) {
|
|
|
196
196
|
label: placeholder,
|
|
197
197
|
value: ""
|
|
198
198
|
}, ...choices];
|
|
199
|
-
return /*#__PURE__*/React
|
|
199
|
+
return /*#__PURE__*/React.createElement(FormControl, {
|
|
200
200
|
name: name,
|
|
201
201
|
label: label,
|
|
202
202
|
required: required,
|
|
@@ -204,7 +204,7 @@ function Select(_ref) {
|
|
|
204
204
|
prefix: prefix,
|
|
205
205
|
suffix: suffix,
|
|
206
206
|
shadow: false
|
|
207
|
-
}, /*#__PURE__*/React
|
|
207
|
+
}, /*#__PURE__*/React.createElement("select", _extends({
|
|
208
208
|
ref: ref
|
|
209
209
|
}, props, {
|
|
210
210
|
"data-testid": `select_${name}`,
|
|
@@ -221,7 +221,7 @@ function Select(_ref) {
|
|
|
221
221
|
label,
|
|
222
222
|
value
|
|
223
223
|
}) => {
|
|
224
|
-
return /*#__PURE__*/React
|
|
224
|
+
return /*#__PURE__*/React.createElement("option", {
|
|
225
225
|
key: String(value),
|
|
226
226
|
label: label,
|
|
227
227
|
value: value
|
|
@@ -297,7 +297,7 @@ function PaginationButton(props) {
|
|
|
297
297
|
active
|
|
298
298
|
} = props,
|
|
299
299
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded$1);
|
|
300
|
-
return /*#__PURE__*/React
|
|
300
|
+
return /*#__PURE__*/React.createElement(Component, _extends({}, otherProps, {
|
|
301
301
|
"data-testid": "pagination-button",
|
|
302
302
|
disabled: disabled,
|
|
303
303
|
className: classnames("page-link", disabled ? "disabled" : "", active ? "" : "", props.className)
|
|
@@ -328,55 +328,55 @@ function Pagination(props) {
|
|
|
328
328
|
value,
|
|
329
329
|
label: value
|
|
330
330
|
}));
|
|
331
|
-
return /*#__PURE__*/React
|
|
331
|
+
return /*#__PURE__*/React.createElement("nav", {
|
|
332
332
|
"aria-label": "Page navigation",
|
|
333
333
|
className: classnames("pagination-group -mb-3", className)
|
|
334
|
-
}, /*#__PURE__*/React
|
|
334
|
+
}, /*#__PURE__*/React.createElement("ul", {
|
|
335
335
|
className: "pagination mb-3 mr-3"
|
|
336
|
-
}, /*#__PURE__*/React
|
|
336
|
+
}, /*#__PURE__*/React.createElement("li", {
|
|
337
337
|
className: classnames("page-item", !canPreviousPage && "disabled")
|
|
338
|
-
}, /*#__PURE__*/React
|
|
338
|
+
}, /*#__PURE__*/React.createElement(PaginationButton, {
|
|
339
339
|
tabIndex: -1,
|
|
340
340
|
disabled: !canPreviousPage,
|
|
341
341
|
onClick: () => previousPage()
|
|
342
342
|
}, i18n("Previous"))), pageNumbers.map(page => {
|
|
343
343
|
if ([LEFT_PAGE, RIGHT_PAGE].includes(page)) {
|
|
344
|
-
return /*#__PURE__*/React
|
|
344
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
345
345
|
className: "page-item",
|
|
346
346
|
key: page
|
|
347
|
-
}, /*#__PURE__*/React
|
|
347
|
+
}, /*#__PURE__*/React.createElement(PaginationButton, {
|
|
348
348
|
"aria-hidden": "true"
|
|
349
349
|
}, "..."));
|
|
350
350
|
}
|
|
351
351
|
const active = page - 1 === pageIndex;
|
|
352
|
-
return /*#__PURE__*/React
|
|
352
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
353
353
|
className: classnames("page-item", active && "active"),
|
|
354
354
|
key: page
|
|
355
|
-
}, /*#__PURE__*/React
|
|
355
|
+
}, /*#__PURE__*/React.createElement(PaginationButton, {
|
|
356
356
|
tabIndex: pageIndex,
|
|
357
357
|
active: active,
|
|
358
358
|
onClick: () => gotoPage(page - 1)
|
|
359
359
|
}, page));
|
|
360
|
-
}), /*#__PURE__*/React
|
|
360
|
+
}), /*#__PURE__*/React.createElement("li", {
|
|
361
361
|
className: classnames("page-item", !canNextPage && "disabled")
|
|
362
|
-
}, /*#__PURE__*/React
|
|
362
|
+
}, /*#__PURE__*/React.createElement(PaginationButton, {
|
|
363
363
|
tabIndex: pageNumbers.length,
|
|
364
364
|
disabled: !canNextPage,
|
|
365
365
|
onClick: () => nextPage()
|
|
366
|
-
}, i18n("Next")))), /*#__PURE__*/React
|
|
366
|
+
}, i18n("Next")))), /*#__PURE__*/React.createElement("li", {
|
|
367
367
|
className: "mb-3 mr-3 flex items-center"
|
|
368
|
-
}, /*#__PURE__*/React
|
|
368
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
369
369
|
name: "page",
|
|
370
370
|
value: pageSize,
|
|
371
371
|
choices: choices,
|
|
372
372
|
onChange: (name, value) => {
|
|
373
373
|
setPageSize(+value);
|
|
374
374
|
}
|
|
375
|
-
}), /*#__PURE__*/React
|
|
375
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
376
376
|
className: "ml-3"
|
|
377
|
-
}, i18n("items per page"))), pageOptions && /*#__PURE__*/React
|
|
377
|
+
}, i18n("items per page"))), pageOptions && /*#__PURE__*/React.createElement("li", {
|
|
378
378
|
className: "mb-3 flex items-center"
|
|
379
|
-
}, /*#__PURE__*/React
|
|
379
|
+
}, /*#__PURE__*/React.createElement("span", null, i18n("Page"), "\xA0"), /*#__PURE__*/React.createElement("strong", null, pageIndex + 1, " of ", pageOptions.length)));
|
|
380
380
|
}
|
|
381
381
|
|
|
382
382
|
function DefaultArrowSort({
|
|
@@ -386,9 +386,9 @@ function DefaultArrowSort({
|
|
|
386
386
|
isSorted,
|
|
387
387
|
isSortedDesc
|
|
388
388
|
} = column;
|
|
389
|
-
return /*#__PURE__*/React
|
|
389
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
390
390
|
className: "table-arrow-sort"
|
|
391
|
-
}, isSorted ? /*#__PURE__*/React
|
|
391
|
+
}, isSorted ? /*#__PURE__*/React.createElement("i", {
|
|
392
392
|
className: iconClass(undefined, isSortedDesc ? "sort-up" : "sort-down")
|
|
393
393
|
}) : "");
|
|
394
394
|
}
|
|
@@ -396,11 +396,11 @@ function DefaultArrowSort({
|
|
|
396
396
|
function DefaultCellHeader({
|
|
397
397
|
column
|
|
398
398
|
}) {
|
|
399
|
-
return /*#__PURE__*/React
|
|
399
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
400
400
|
className: "table-cell-header"
|
|
401
|
-
}, /*#__PURE__*/React
|
|
401
|
+
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
402
402
|
className: "table-cell-header__label"
|
|
403
|
-
}, column.getSortByToggleProps()), /*#__PURE__*/React
|
|
403
|
+
}, column.getSortByToggleProps()), /*#__PURE__*/React.createElement("span", null, column.render("Header")), column.render("ArrowSort")), column.canFilter ? /*#__PURE__*/React.createElement("div", {
|
|
404
404
|
className: "table-cell-header__filter"
|
|
405
405
|
}, column.render("Filter")) : null);
|
|
406
406
|
}
|
|
@@ -511,23 +511,23 @@ function DefaultDndRow(props) {
|
|
|
511
511
|
dropRef,
|
|
512
512
|
opacity
|
|
513
513
|
} = useDndRow(props);
|
|
514
|
-
return /*#__PURE__*/React
|
|
514
|
+
return /*#__PURE__*/React.createElement("tr", {
|
|
515
515
|
ref: dropRef,
|
|
516
516
|
style: {
|
|
517
517
|
opacity
|
|
518
518
|
}
|
|
519
|
-
}, /*#__PURE__*/React
|
|
519
|
+
}, /*#__PURE__*/React.createElement("td", {
|
|
520
520
|
ref: dragRef,
|
|
521
521
|
role: "cell",
|
|
522
522
|
style: {
|
|
523
523
|
cursor: isDragging ? "grabbing" : "grab"
|
|
524
524
|
},
|
|
525
525
|
className: "align-middle"
|
|
526
|
-
}, /*#__PURE__*/React
|
|
526
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
527
527
|
className: "flex items-center justify-center"
|
|
528
|
-
}, /*#__PURE__*/React
|
|
528
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
529
529
|
className: classnames(iconClass(undefined, "dots-vertical-rounded"))
|
|
530
|
-
}))), /*#__PURE__*/React
|
|
530
|
+
}))), /*#__PURE__*/React.createElement(DefaultCells, props));
|
|
531
531
|
}
|
|
532
532
|
function DefaultRow(_ref) {
|
|
533
533
|
let {
|
|
@@ -542,13 +542,13 @@ function DefaultRow(_ref) {
|
|
|
542
542
|
onClick: () => onClick(row.original, "row")
|
|
543
543
|
}, row.getRowProps());
|
|
544
544
|
if (enableDragNDrop) {
|
|
545
|
-
return /*#__PURE__*/React
|
|
545
|
+
return /*#__PURE__*/React.createElement(DefaultDndRow, _extends({}, opts, {
|
|
546
546
|
row: row,
|
|
547
547
|
onDrag: onDrag,
|
|
548
548
|
onDrop: onDrop
|
|
549
549
|
}));
|
|
550
550
|
}
|
|
551
|
-
return /*#__PURE__*/React
|
|
551
|
+
return /*#__PURE__*/React.createElement("tr", opts, /*#__PURE__*/React.createElement(DefaultCells, {
|
|
552
552
|
row: row
|
|
553
553
|
}));
|
|
554
554
|
}
|
|
@@ -586,7 +586,7 @@ function InputText(_ref) {
|
|
|
586
586
|
useEffect(() => {
|
|
587
587
|
setValue(value);
|
|
588
588
|
}, [value]);
|
|
589
|
-
return /*#__PURE__*/React
|
|
589
|
+
return /*#__PURE__*/React.createElement(FormControl, {
|
|
590
590
|
name: name,
|
|
591
591
|
label: label,
|
|
592
592
|
required: required,
|
|
@@ -594,7 +594,7 @@ function InputText(_ref) {
|
|
|
594
594
|
prefix: prefix,
|
|
595
595
|
suffix: suffix,
|
|
596
596
|
className: className
|
|
597
|
-
}, /*#__PURE__*/React
|
|
597
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
598
598
|
type: type || "text"
|
|
599
599
|
}, props, {
|
|
600
600
|
"data-testid": `input_${name}`,
|
|
@@ -638,7 +638,7 @@ function DefaultColumnFilter(props) {
|
|
|
638
638
|
setFilterId(id);
|
|
639
639
|
setFilter(value || undefined);
|
|
640
640
|
}, [id, setValue, setFilterId, setFilter]);
|
|
641
|
-
return /*#__PURE__*/React
|
|
641
|
+
return /*#__PURE__*/React.createElement(InputText, {
|
|
642
642
|
size: "sm",
|
|
643
643
|
id: id,
|
|
644
644
|
name: id,
|
|
@@ -673,12 +673,12 @@ function DefaultOperationButton(props) {
|
|
|
673
673
|
title = "",
|
|
674
674
|
i18n = f => f
|
|
675
675
|
} = props;
|
|
676
|
-
return /*#__PURE__*/React
|
|
676
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
677
677
|
className: classnames(className, ["btn", buttonOutline && "outline", buttonType].filter(Boolean).join("-"), `btn-${buttonSize}`),
|
|
678
678
|
onClick: stopPropagationWrapper(() => onClick(action))
|
|
679
|
-
}, icon ? /*#__PURE__*/React
|
|
679
|
+
}, icon ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("i", {
|
|
680
680
|
className: iconClass(undefined, icon)
|
|
681
|
-
}), " ", title && " ") : null, title && /*#__PURE__*/React
|
|
681
|
+
}), " ", title && " ") : null, title && /*#__PURE__*/React.createElement("span", {
|
|
682
682
|
className: icon && title ? "ml-1" : ""
|
|
683
683
|
}, i18n(title)));
|
|
684
684
|
}
|
|
@@ -692,7 +692,7 @@ function DefaultCellOperations({
|
|
|
692
692
|
i18n
|
|
693
693
|
}) {
|
|
694
694
|
const data = row.original;
|
|
695
|
-
return /*#__PURE__*/React
|
|
695
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
696
696
|
className: "btn-group"
|
|
697
697
|
}, operations.filter(({
|
|
698
698
|
permissionsResolver
|
|
@@ -701,7 +701,7 @@ function DefaultCellOperations({
|
|
|
701
701
|
OperationButton = DefaultOperationButton
|
|
702
702
|
} = _ref,
|
|
703
703
|
operation = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
704
|
-
return /*#__PURE__*/React
|
|
704
|
+
return /*#__PURE__*/React.createElement(OperationButton, _extends({
|
|
705
705
|
key: operation.action
|
|
706
706
|
}, operation, {
|
|
707
707
|
onClick: action => onClick(data, action),
|
|
@@ -727,10 +727,10 @@ function useOperations({
|
|
|
727
727
|
return [...columns, {
|
|
728
728
|
id: "operations",
|
|
729
729
|
groupByBoundary: true,
|
|
730
|
-
Header: () => /*#__PURE__*/React
|
|
730
|
+
Header: () => /*#__PURE__*/React.createElement("div", {
|
|
731
731
|
className: "text-center"
|
|
732
732
|
}, i18n("Operations")),
|
|
733
|
-
Cell: props => /*#__PURE__*/React
|
|
733
|
+
Cell: props => /*#__PURE__*/React.createElement(CellOperations, _extends({}, props, {
|
|
734
734
|
operations: operations,
|
|
735
735
|
onClick: onClick,
|
|
736
736
|
ctx: ctx,
|
|
@@ -751,12 +751,12 @@ function getOperationCallback(operations, onClick) {
|
|
|
751
751
|
};
|
|
752
752
|
}
|
|
753
753
|
function DefaultLoader() {
|
|
754
|
-
return /*#__PURE__*/React
|
|
754
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
755
755
|
className: "text-center p-2 pb-4 font-bold"
|
|
756
756
|
}, "Loading in progress");
|
|
757
757
|
}
|
|
758
758
|
function DefaultEmptyData() {
|
|
759
|
-
return /*#__PURE__*/React
|
|
759
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
760
760
|
className: "text-center p-2 pb-4 font-bold"
|
|
761
761
|
}, "No data found");
|
|
762
762
|
}
|
|
@@ -793,12 +793,12 @@ function useCustomTable(props) {
|
|
|
793
793
|
} = props,
|
|
794
794
|
ctx = _objectWithoutPropertiesLoose(props, _excluded$6);
|
|
795
795
|
const _onClick = getOperationCallback(operations, onClick);
|
|
796
|
-
const defaultColumn = React
|
|
796
|
+
const defaultColumn = React.useMemo(() => ({
|
|
797
797
|
// Let's set up our default Filter UI
|
|
798
798
|
Filter: ColumnFilter,
|
|
799
799
|
ArrowSort
|
|
800
800
|
}), [ColumnFilter, ArrowSort]);
|
|
801
|
-
const [filterId, setFilterId] = React
|
|
801
|
+
const [filterId, setFilterId] = React.useState(controlledFilterId);
|
|
802
802
|
// DND
|
|
803
803
|
const [records, setRecords] = useState(data);
|
|
804
804
|
const _onDrag = (dragIndex, hoverIndex) => {
|
|
@@ -840,7 +840,7 @@ function useCustomTable(props) {
|
|
|
840
840
|
filters
|
|
841
841
|
}
|
|
842
842
|
} = tableInstance;
|
|
843
|
-
React
|
|
843
|
+
React.useEffect(() => {
|
|
844
844
|
onChange({
|
|
845
845
|
pageIndex,
|
|
846
846
|
pageSize,
|
|
@@ -896,26 +896,26 @@ function Table(props) {
|
|
|
896
896
|
onDrop
|
|
897
897
|
} = useCustomTable(props);
|
|
898
898
|
// Render the UI for your table
|
|
899
|
-
return /*#__PURE__*/React
|
|
899
|
+
return /*#__PURE__*/React.createElement(DrapNDropContainer, {
|
|
900
900
|
enableDragNDrop: enableDragNDrop
|
|
901
|
-
}, /*#__PURE__*/React
|
|
901
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
902
902
|
className: classnames("table-group table-responsive", className)
|
|
903
|
-
}, /*#__PURE__*/React
|
|
903
|
+
}, /*#__PURE__*/React.createElement("table", _extends({
|
|
904
904
|
className: "table table-striped table-hover"
|
|
905
|
-
}, tableInstance.getTableProps()), /*#__PURE__*/React
|
|
905
|
+
}, tableInstance.getTableProps()), /*#__PURE__*/React.createElement("thead", null, tableInstance.headerGroups.map((headerGroup, i) => /*#__PURE__*/React.createElement("tr", _extends({}, headerGroup.getHeaderGroupProps(), {
|
|
906
906
|
key: `tableInstance.headerGroups${i}`
|
|
907
|
-
}), enableDragNDrop ? /*#__PURE__*/React
|
|
907
|
+
}), enableDragNDrop ? /*#__PURE__*/React.createElement("th", {
|
|
908
908
|
role: "columnheader",
|
|
909
909
|
className: "text-center"
|
|
910
|
-
}, /*#__PURE__*/React
|
|
910
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
911
911
|
className: "table-cell-header"
|
|
912
|
-
})) : null, headerGroup.headers.map(column => /*#__PURE__*/React
|
|
912
|
+
})) : null, headerGroup.headers.map(column => /*#__PURE__*/React.createElement("th", _extends({}, column.getHeaderProps(), {
|
|
913
913
|
key: `tableInstance.headers.column.${column.id}`
|
|
914
|
-
}), /*#__PURE__*/React
|
|
914
|
+
}), /*#__PURE__*/React.createElement(CellHeader, {
|
|
915
915
|
column: column
|
|
916
|
-
})))))), !isLoading ? /*#__PURE__*/React
|
|
916
|
+
})))))), !isLoading ? /*#__PURE__*/React.createElement("tbody", tableInstance.getTableBodyProps(), tableInstance.page.map((row, index) => {
|
|
917
917
|
tableInstance.prepareRow(row);
|
|
918
|
-
return /*#__PURE__*/React
|
|
918
|
+
return /*#__PURE__*/React.createElement(Row, {
|
|
919
919
|
index: index,
|
|
920
920
|
enableDragNDrop: enableDragNDrop,
|
|
921
921
|
onClick: onClick,
|
|
@@ -924,9 +924,9 @@ function Table(props) {
|
|
|
924
924
|
onDrag: onDrag,
|
|
925
925
|
onDrop: onDrop
|
|
926
926
|
});
|
|
927
|
-
})) : null), isLoading ? /*#__PURE__*/React
|
|
927
|
+
})) : null), isLoading ? /*#__PURE__*/React.createElement(Loader, null) : null, !data.length ? /*#__PURE__*/React.createElement(EmptyData, null) : null, !isLoading && data.length && !disablePagination ? /*#__PURE__*/React.createElement("div", {
|
|
928
928
|
className: "overflow-hidden"
|
|
929
|
-
}, /*#__PURE__*/React
|
|
929
|
+
}, /*#__PURE__*/React.createElement(Pagination, _extends({}, tableInstance, {
|
|
930
930
|
className: "text-sm",
|
|
931
931
|
pageIndex: pageIndex,
|
|
932
932
|
pageSize: pageSize,
|
|
@@ -954,13 +954,13 @@ function ActionsTable(_ref) {
|
|
|
954
954
|
accessor: "title",
|
|
955
955
|
id: "title"
|
|
956
956
|
}];
|
|
957
|
-
return /*#__PURE__*/React
|
|
957
|
+
return /*#__PURE__*/React.createElement(Table, _extends({}, props, {
|
|
958
958
|
disableFilters: disableFilters,
|
|
959
959
|
disablePagination: disablePagination,
|
|
960
960
|
columns: columns
|
|
961
|
-
}), /*#__PURE__*/React
|
|
961
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
962
962
|
className: "pagination-group"
|
|
963
|
-
}, /*#__PURE__*/React
|
|
963
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
964
964
|
name: "actions",
|
|
965
965
|
value: currentAction,
|
|
966
966
|
choices: [{
|
|
@@ -968,15 +968,15 @@ function ActionsTable(_ref) {
|
|
|
968
968
|
value: ""
|
|
969
969
|
}].concat(availableActions),
|
|
970
970
|
onChange: (name, action) => setAction(action)
|
|
971
|
-
}), /*#__PURE__*/React
|
|
971
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
972
972
|
className: "pl-3"
|
|
973
|
-
}, /*#__PURE__*/React
|
|
973
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
974
974
|
"data-testid": "submit",
|
|
975
975
|
disabled: currentAction === "",
|
|
976
976
|
className: "btn btn-success",
|
|
977
977
|
onClick: () => currentAction && onAddAction(currentAction),
|
|
978
978
|
type: "submit"
|
|
979
|
-
}, /*#__PURE__*/React
|
|
979
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
980
980
|
className: classnames(iconClass(undefined, "plus"), "mr-1")
|
|
981
981
|
}), " ", i18n("Add action")))));
|
|
982
982
|
}
|
|
@@ -991,9 +991,9 @@ function formatError(error) {
|
|
|
991
991
|
if (Object.prototype.hasOwnProperty.call(error, "errors")) {
|
|
992
992
|
return Object.keys(error.errors).map((key, index) => {
|
|
993
993
|
const item = error.errors[key];
|
|
994
|
-
return /*#__PURE__*/React
|
|
994
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
995
995
|
key: index
|
|
996
|
-
}, /*#__PURE__*/React
|
|
996
|
+
}, /*#__PURE__*/React.createElement("strong", null, item.name, " (", item.path, ")"), " ", "- ", item.message);
|
|
997
997
|
});
|
|
998
998
|
}
|
|
999
999
|
// If this is a standard error.
|
|
@@ -1003,7 +1003,7 @@ function formatError(error) {
|
|
|
1003
1003
|
// If this is a joy validation error.
|
|
1004
1004
|
if (Object.prototype.hasOwnProperty.call(error, "name") && error.name === "ValidationError") {
|
|
1005
1005
|
return error.details.map((item, index) => {
|
|
1006
|
-
return /*#__PURE__*/React
|
|
1006
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1007
1007
|
key: index
|
|
1008
1008
|
}, item.message);
|
|
1009
1009
|
});
|
|
@@ -1021,7 +1021,7 @@ function Alert({
|
|
|
1021
1021
|
if (!error || Array.isArray(error) && !error.length) {
|
|
1022
1022
|
return null;
|
|
1023
1023
|
}
|
|
1024
|
-
return /*#__PURE__*/React
|
|
1024
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1025
1025
|
className: `alert alert-${type}`,
|
|
1026
1026
|
role: "alert"
|
|
1027
1027
|
}, formatError(error));
|
|
@@ -1032,13 +1032,13 @@ function Card({
|
|
|
1032
1032
|
label,
|
|
1033
1033
|
className
|
|
1034
1034
|
}) {
|
|
1035
|
-
return /*#__PURE__*/React
|
|
1035
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1036
1036
|
className: classnames("card", className)
|
|
1037
|
-
}, /*#__PURE__*/React
|
|
1037
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1038
1038
|
className: "card-header "
|
|
1039
|
-
}, /*#__PURE__*/React
|
|
1039
|
+
}, /*#__PURE__*/React.createElement("h4", {
|
|
1040
1040
|
className: "card-title"
|
|
1041
|
-
}, label)), /*#__PURE__*/React
|
|
1041
|
+
}, label)), /*#__PURE__*/React.createElement("div", {
|
|
1042
1042
|
className: "card-body",
|
|
1043
1043
|
role: "article"
|
|
1044
1044
|
}, children));
|
|
@@ -1194,7 +1194,7 @@ function Form(props) {
|
|
|
1194
1194
|
const {
|
|
1195
1195
|
element
|
|
1196
1196
|
} = useForm(props);
|
|
1197
|
-
return /*#__PURE__*/React
|
|
1197
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1198
1198
|
"data-testid": `formioContainer${props.name || ""}`,
|
|
1199
1199
|
ref: element,
|
|
1200
1200
|
className: props.className
|
|
@@ -1494,7 +1494,7 @@ function NamedFormAccess({
|
|
|
1494
1494
|
children
|
|
1495
1495
|
}) {
|
|
1496
1496
|
const [isValid, setIsValid] = useState(true);
|
|
1497
|
-
return /*#__PURE__*/React
|
|
1497
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form, {
|
|
1498
1498
|
name: name,
|
|
1499
1499
|
form: form[name],
|
|
1500
1500
|
submission: submissions[name],
|
|
@@ -1508,11 +1508,11 @@ function NamedFormAccess({
|
|
|
1508
1508
|
setIsValid(isValid);
|
|
1509
1509
|
},
|
|
1510
1510
|
options: options
|
|
1511
|
-
}), /*#__PURE__*/React
|
|
1511
|
+
}), /*#__PURE__*/React.createElement("button", {
|
|
1512
1512
|
disabled: !isValid,
|
|
1513
1513
|
className: "mt-5 btn btn-primary",
|
|
1514
1514
|
onClick: onSubmit
|
|
1515
|
-
}, "Save access"), children, /*#__PURE__*/React
|
|
1515
|
+
}, "Save access"), children, /*#__PURE__*/React.createElement("div", {
|
|
1516
1516
|
className: "alert alert-warning mt-5"
|
|
1517
1517
|
}, "Elevated permissions allow users to access and modify other user's entities. Assign with caution."));
|
|
1518
1518
|
}
|
|
@@ -1525,43 +1525,43 @@ function FormAccess(props) {
|
|
|
1525
1525
|
onChange,
|
|
1526
1526
|
onSubmit
|
|
1527
1527
|
} = useFormAccess(props);
|
|
1528
|
-
return /*#__PURE__*/React
|
|
1528
|
+
return /*#__PURE__*/React.createElement("div", null, props.children, /*#__PURE__*/React.createElement("div", {
|
|
1529
1529
|
className: "flex mb-5"
|
|
1530
|
-
}, /*#__PURE__*/React
|
|
1530
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
1531
1531
|
label: "Manage submission access",
|
|
1532
1532
|
className: "flex-1"
|
|
1533
|
-
}, /*#__PURE__*/React
|
|
1533
|
+
}, /*#__PURE__*/React.createElement(NamedFormAccess, {
|
|
1534
1534
|
name: "submissionAccess",
|
|
1535
1535
|
form: form,
|
|
1536
1536
|
submissions: submissions,
|
|
1537
1537
|
onChange: onChange,
|
|
1538
1538
|
onSubmit: onSubmit,
|
|
1539
1539
|
options: options
|
|
1540
|
-
}, props.children)), /*#__PURE__*/React
|
|
1540
|
+
}, props.children)), /*#__PURE__*/React.createElement("div", {
|
|
1541
1541
|
className: "w-1/4 pl-4"
|
|
1542
|
-
}, /*#__PURE__*/React
|
|
1542
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
1543
1543
|
label: "About Submission Data Permissions"
|
|
1544
|
-
}, /*#__PURE__*/React
|
|
1544
|
+
}, /*#__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", {
|
|
1545
1545
|
className: "mt-5 pl-7 list-disc"
|
|
1546
|
-
}, /*#__PURE__*/React
|
|
1546
|
+
}, /*#__PURE__*/React.createElement("li", {
|
|
1547
1547
|
className: "pb-2"
|
|
1548
|
-
}, /*#__PURE__*/React
|
|
1548
|
+
}, /*#__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", {
|
|
1549
1549
|
className: "flex mb-5"
|
|
1550
|
-
}, /*#__PURE__*/React
|
|
1550
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
1551
1551
|
label: `Manage ${type} definition access`,
|
|
1552
1552
|
className: "flex-1"
|
|
1553
|
-
}, /*#__PURE__*/React
|
|
1553
|
+
}, /*#__PURE__*/React.createElement(NamedFormAccess, {
|
|
1554
1554
|
name: "access",
|
|
1555
1555
|
form: form,
|
|
1556
1556
|
submissions: submissions,
|
|
1557
1557
|
onChange: onChange,
|
|
1558
1558
|
onSubmit: onSubmit,
|
|
1559
1559
|
options: options
|
|
1560
|
-
}, props.children)), /*#__PURE__*/React
|
|
1560
|
+
}, props.children)), /*#__PURE__*/React.createElement("div", {
|
|
1561
1561
|
className: "w-1/4 pl-4"
|
|
1562
|
-
}, /*#__PURE__*/React
|
|
1562
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
1563
1563
|
label: "About Form Definition Access"
|
|
1564
|
-
}, /*#__PURE__*/React
|
|
1564
|
+
}, /*#__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.")))));
|
|
1565
1565
|
}
|
|
1566
1566
|
FormAccess.propTypes = {
|
|
1567
1567
|
type: PropTypes.string.isRequired,
|
|
@@ -1616,7 +1616,7 @@ function FormAction(_ref2) {
|
|
|
1616
1616
|
}
|
|
1617
1617
|
};
|
|
1618
1618
|
})();
|
|
1619
|
-
return /*#__PURE__*/React
|
|
1619
|
+
return /*#__PURE__*/React.createElement("div", null, children, /*#__PURE__*/React.createElement(Form, {
|
|
1620
1620
|
form: form,
|
|
1621
1621
|
submission: submission,
|
|
1622
1622
|
onSubmit: onSubmit,
|
|
@@ -1654,7 +1654,7 @@ async function createBuilder(el, {
|
|
|
1654
1654
|
console.error(er);
|
|
1655
1655
|
}
|
|
1656
1656
|
}
|
|
1657
|
-
class FormBuilder extends React
|
|
1657
|
+
class FormBuilder extends React.Component {
|
|
1658
1658
|
constructor(props) {
|
|
1659
1659
|
super(props);
|
|
1660
1660
|
this.elRef = void 0;
|
|
@@ -1732,12 +1732,12 @@ class FormBuilder extends React$1.Component {
|
|
|
1732
1732
|
});
|
|
1733
1733
|
}
|
|
1734
1734
|
render() {
|
|
1735
|
-
return /*#__PURE__*/React
|
|
1735
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1736
1736
|
ref: ref => {
|
|
1737
1737
|
this.elRef = ref;
|
|
1738
1738
|
},
|
|
1739
1739
|
onClick: e => e.stopPropagation()
|
|
1740
|
-
}, /*#__PURE__*/React
|
|
1740
|
+
}, /*#__PURE__*/React.createElement("div", null));
|
|
1741
1741
|
}
|
|
1742
1742
|
}
|
|
1743
1743
|
FormBuilder.defaultProps = {
|
|
@@ -1806,37 +1806,37 @@ function FormEditCTAs({
|
|
|
1806
1806
|
placement: "top",
|
|
1807
1807
|
title: t("Reset all changes")
|
|
1808
1808
|
});
|
|
1809
|
-
return /*#__PURE__*/React
|
|
1809
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1810
1810
|
className: "form-edit__actions"
|
|
1811
|
-
}, /*#__PURE__*/React
|
|
1811
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
|
|
1812
1812
|
className: `btn btn-primary btn-save flex ${disabled ? "disabled" : ""}`,
|
|
1813
1813
|
disabled: disabled,
|
|
1814
1814
|
onClick: () => !disabled && onSubmit && onSubmit()
|
|
1815
|
-
}, /*#__PURE__*/React
|
|
1815
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
1816
1816
|
className: `mr-1 ${iconClass(options.iconset, "save")}`
|
|
1817
|
-
}), saveText), /*#__PURE__*/React
|
|
1817
|
+
}), saveText), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
|
|
1818
1818
|
className: `btn btn-light btn-undo ${hasUndo ? "" : "disabled"}`,
|
|
1819
1819
|
onClick: () => onUndo && onUndo(),
|
|
1820
1820
|
ref: undoTooltipRef
|
|
1821
|
-
}, /*#__PURE__*/React
|
|
1821
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
1822
1822
|
className: iconClass(options.iconset, "undo")
|
|
1823
|
-
})), /*#__PURE__*/React
|
|
1823
|
+
})), /*#__PURE__*/React.createElement("button", {
|
|
1824
1824
|
className: `btn btn-light btn-redo ${hasRedo ? "" : "disabled"}`,
|
|
1825
1825
|
onClick: () => onRedo && onRedo(),
|
|
1826
1826
|
ref: redoTooltipRef
|
|
1827
|
-
}, /*#__PURE__*/React
|
|
1827
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
1828
1828
|
className: iconClass(options.iconset, "redo")
|
|
1829
|
-
}))), /*#__PURE__*/React
|
|
1829
|
+
}))), /*#__PURE__*/React.createElement("div", null, onCopy && /*#__PURE__*/React.createElement("button", {
|
|
1830
1830
|
className: "btn btn-light",
|
|
1831
1831
|
onClick: () => onCopy(),
|
|
1832
1832
|
ref: copyTooltipRef
|
|
1833
|
-
}, /*#__PURE__*/React
|
|
1833
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
1834
1834
|
className: iconClass(options.iconset, "copy")
|
|
1835
|
-
})), /*#__PURE__*/React
|
|
1835
|
+
})), /*#__PURE__*/React.createElement("button", {
|
|
1836
1836
|
className: `btn btn-light btn-reset`,
|
|
1837
1837
|
onClick: () => onReset && onReset(),
|
|
1838
1838
|
ref: resetTooltipRef
|
|
1839
|
-
}, /*#__PURE__*/React
|
|
1839
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
1840
1840
|
className: iconClass(options.iconset, "reset")
|
|
1841
1841
|
})))));
|
|
1842
1842
|
}
|
|
@@ -1882,14 +1882,14 @@ function InputTags(_ref) {
|
|
|
1882
1882
|
instance.destroy();
|
|
1883
1883
|
};
|
|
1884
1884
|
}, []);
|
|
1885
|
-
return /*#__PURE__*/React
|
|
1885
|
+
return /*#__PURE__*/React.createElement(FormControl, {
|
|
1886
1886
|
name: name,
|
|
1887
1887
|
label: label,
|
|
1888
1888
|
required: required,
|
|
1889
1889
|
description: description,
|
|
1890
1890
|
prefix: prefix,
|
|
1891
1891
|
suffix: suffix
|
|
1892
|
-
}, /*#__PURE__*/React
|
|
1892
|
+
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
1893
1893
|
ref: ref,
|
|
1894
1894
|
type: "text"
|
|
1895
1895
|
}, props, {
|
|
@@ -1926,11 +1926,11 @@ function FormParameters({
|
|
|
1926
1926
|
baseUrl = window.location.origin
|
|
1927
1927
|
}) {
|
|
1928
1928
|
const hasTypeChoices = typeChoices && typeChoices.length > 1;
|
|
1929
|
-
return /*#__PURE__*/React
|
|
1929
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1930
1930
|
className: `form-edit__settings ${className}`
|
|
1931
|
-
}, /*#__PURE__*/React
|
|
1931
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
1932
1932
|
className: "w-1/3"
|
|
1933
|
-
}, /*#__PURE__*/React
|
|
1933
|
+
}, /*#__PURE__*/React.createElement(InputText, {
|
|
1934
1934
|
label: "Title",
|
|
1935
1935
|
placeholder: "Enter the form title",
|
|
1936
1936
|
name: "title",
|
|
@@ -1938,9 +1938,9 @@ function FormParameters({
|
|
|
1938
1938
|
value: form.title,
|
|
1939
1939
|
disabled: !!readonly["title"],
|
|
1940
1940
|
onChange: onChange
|
|
1941
|
-
})), /*#__PURE__*/React
|
|
1941
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
1942
1942
|
className: "w-1/3"
|
|
1943
|
-
}, /*#__PURE__*/React
|
|
1943
|
+
}, /*#__PURE__*/React.createElement(InputText, {
|
|
1944
1944
|
label: "Name",
|
|
1945
1945
|
placeholder: "Enter the form machine name",
|
|
1946
1946
|
name: "name",
|
|
@@ -1948,16 +1948,16 @@ function FormParameters({
|
|
|
1948
1948
|
disabled: !!readonly["name"],
|
|
1949
1949
|
value: form.name,
|
|
1950
1950
|
onChange: onChange
|
|
1951
|
-
})), /*#__PURE__*/React
|
|
1951
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
1952
1952
|
className: "w-1/3"
|
|
1953
|
-
}, /*#__PURE__*/React
|
|
1953
|
+
}, /*#__PURE__*/React.createElement(InputText, {
|
|
1954
1954
|
label: "Path",
|
|
1955
1955
|
placeholder: "example",
|
|
1956
1956
|
name: "path",
|
|
1957
1957
|
className: "mb-0",
|
|
1958
|
-
description: /*#__PURE__*/React
|
|
1958
|
+
description: /*#__PURE__*/React.createElement("span", {
|
|
1959
1959
|
className: "text-xxs flex items-center"
|
|
1960
|
-
}, /*#__PURE__*/React
|
|
1960
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
1961
1961
|
className: "bx bx-link ml-1 mr-1"
|
|
1962
1962
|
}), `${baseUrl}/${form.path}`),
|
|
1963
1963
|
required: true,
|
|
@@ -1968,26 +1968,26 @@ function FormParameters({
|
|
|
1968
1968
|
width: "120px"
|
|
1969
1969
|
},
|
|
1970
1970
|
onChange: onChange
|
|
1971
|
-
})), /*#__PURE__*/React
|
|
1971
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
1972
1972
|
className: "w-1/3"
|
|
1973
|
-
}, /*#__PURE__*/React
|
|
1973
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
1974
1974
|
label: "Display as",
|
|
1975
1975
|
name: "display",
|
|
1976
1976
|
disabled: !!readonly["display"],
|
|
1977
1977
|
value: form.display,
|
|
1978
1978
|
choices: displayChoices,
|
|
1979
1979
|
onChange: onChange
|
|
1980
|
-
})), hasTypeChoices && /*#__PURE__*/React
|
|
1980
|
+
})), hasTypeChoices && /*#__PURE__*/React.createElement("div", {
|
|
1981
1981
|
className: "w-1/3"
|
|
1982
|
-
}, /*#__PURE__*/React
|
|
1982
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
1983
1983
|
label: "Type",
|
|
1984
1984
|
name: "type",
|
|
1985
1985
|
value: form.type,
|
|
1986
1986
|
choices: typeChoices,
|
|
1987
1987
|
onChange: onChange
|
|
1988
|
-
})), enableTags && /*#__PURE__*/React
|
|
1988
|
+
})), enableTags && /*#__PURE__*/React.createElement("div", {
|
|
1989
1989
|
className: "w-1/3"
|
|
1990
|
-
}, /*#__PURE__*/React
|
|
1990
|
+
}, /*#__PURE__*/React.createElement(InputTags, {
|
|
1991
1991
|
label: "Tags",
|
|
1992
1992
|
name: "tags",
|
|
1993
1993
|
value: form.tags,
|
|
@@ -2154,14 +2154,14 @@ function FormEdit(props) {
|
|
|
2154
2154
|
options = {},
|
|
2155
2155
|
builder
|
|
2156
2156
|
} = props;
|
|
2157
|
-
return /*#__PURE__*/React
|
|
2157
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
2158
2158
|
className: "form-edit"
|
|
2159
|
-
}, /*#__PURE__*/React
|
|
2159
|
+
}, /*#__PURE__*/React.createElement(FormParameters, _extends({}, props, {
|
|
2160
2160
|
className: "",
|
|
2161
2161
|
key: `form-settings-${form._id}`,
|
|
2162
2162
|
form: form,
|
|
2163
2163
|
onChange: setChange
|
|
2164
|
-
})), /*#__PURE__*/React
|
|
2164
|
+
})), /*#__PURE__*/React.createElement(FormEditCTAs, _extends({}, props, {
|
|
2165
2165
|
className: "",
|
|
2166
2166
|
key: `form-edit-ctas-${form._id}`,
|
|
2167
2167
|
options: options,
|
|
@@ -2173,7 +2173,7 @@ function FormEdit(props) {
|
|
|
2173
2173
|
onReset: reset,
|
|
2174
2174
|
onCopy: onCopy,
|
|
2175
2175
|
onSubmit: onSubmit
|
|
2176
|
-
}))), /*#__PURE__*/React
|
|
2176
|
+
}))), /*#__PURE__*/React.createElement(FormBuilder, {
|
|
2177
2177
|
key: `form-builder-${form._id}`,
|
|
2178
2178
|
components: form.components,
|
|
2179
2179
|
display: form.display,
|
|
@@ -2315,12 +2315,12 @@ function FormSettings(props) {
|
|
|
2315
2315
|
isValid
|
|
2316
2316
|
} = useFormSettings(props);
|
|
2317
2317
|
const i18n = options.i18n || (f => f);
|
|
2318
|
-
return /*#__PURE__*/React
|
|
2318
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form, {
|
|
2319
2319
|
form: form,
|
|
2320
2320
|
submission: submission,
|
|
2321
2321
|
onChange: onChange,
|
|
2322
2322
|
options: options
|
|
2323
|
-
}), /*#__PURE__*/React
|
|
2323
|
+
}), /*#__PURE__*/React.createElement("button", {
|
|
2324
2324
|
"data-testid": "submit",
|
|
2325
2325
|
disabled: !isValid,
|
|
2326
2326
|
className: "mt-5 btn btn-primary",
|
|
@@ -2345,7 +2345,7 @@ function SelectColumnFilter({
|
|
|
2345
2345
|
label: value,
|
|
2346
2346
|
value
|
|
2347
2347
|
}));
|
|
2348
|
-
return /*#__PURE__*/React
|
|
2348
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
2349
2349
|
key: `filter-${column.id}`,
|
|
2350
2350
|
name: `filter-${column.id}`,
|
|
2351
2351
|
size: "sm",
|
|
@@ -6887,30 +6887,30 @@ function FormsCell(props) {
|
|
|
6887
6887
|
original: form
|
|
6888
6888
|
}
|
|
6889
6889
|
} = props;
|
|
6890
|
-
return /*#__PURE__*/React
|
|
6890
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
6891
6891
|
className: "p-1"
|
|
6892
|
-
}, /*#__PURE__*/React
|
|
6892
|
+
}, /*#__PURE__*/React.createElement("h4", {
|
|
6893
6893
|
className: "text-primary text-lg flex items-center"
|
|
6894
|
-
}, /*#__PURE__*/React
|
|
6894
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
6895
6895
|
className: classnames(iconClass(undefined, icon), "mr-1")
|
|
6896
|
-
}), form.title), /*#__PURE__*/React
|
|
6896
|
+
}), form.title), /*#__PURE__*/React.createElement("ul", {
|
|
6897
6897
|
className: "reset-list text-gray-500"
|
|
6898
|
-
}, /*#__PURE__*/React
|
|
6898
|
+
}, /*#__PURE__*/React.createElement("li", {
|
|
6899
6899
|
className: "text-sm"
|
|
6900
|
-
}, "Name: ", form.name || form.machineName), /*#__PURE__*/React
|
|
6900
|
+
}, "Name: ", form.name || form.machineName), /*#__PURE__*/React.createElement("li", {
|
|
6901
6901
|
className: "mt-5"
|
|
6902
|
-
}, /*#__PURE__*/React
|
|
6902
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
6903
6903
|
className: "badge bg-light mr-1"
|
|
6904
|
-
}, /*#__PURE__*/React
|
|
6904
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
6905
6905
|
className: classnames(iconClass(undefined, "history"), "mr-1")
|
|
6906
|
-
}), /*#__PURE__*/React
|
|
6906
|
+
}), /*#__PURE__*/React.createElement("span", null, "Updated ", moment(form.modified).fromNow())), (form.tags || []).map((tag, index) => /*#__PURE__*/React.createElement("button", {
|
|
6907
6907
|
key: index,
|
|
6908
6908
|
className: "badge badge-hover bg-secondary mr-1",
|
|
6909
6909
|
onClick: stopPropagationWrapper(() => {
|
|
6910
6910
|
props.setFilter("tags", tag);
|
|
6911
6911
|
props.gotoPage(0);
|
|
6912
6912
|
})
|
|
6913
|
-
}, /*#__PURE__*/React
|
|
6913
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
6914
6914
|
className: classnames(iconClass(undefined, "tags"), "mr-1")
|
|
6915
6915
|
}), tag)))));
|
|
6916
6916
|
}
|
|
@@ -6930,7 +6930,7 @@ function FormsTable(_ref) {
|
|
|
6930
6930
|
Header: i18n("Title"),
|
|
6931
6931
|
accessor: "title",
|
|
6932
6932
|
id: "title",
|
|
6933
|
-
Cell: props => /*#__PURE__*/React
|
|
6933
|
+
Cell: props => /*#__PURE__*/React.createElement(FormCell, _extends({}, props, {
|
|
6934
6934
|
icon: props.icon,
|
|
6935
6935
|
i18n: i18n
|
|
6936
6936
|
})),
|
|
@@ -6941,13 +6941,13 @@ function FormsTable(_ref) {
|
|
|
6941
6941
|
accessor: "tags",
|
|
6942
6942
|
id: "tags",
|
|
6943
6943
|
hidden: true,
|
|
6944
|
-
Filter: props => tags && tags.length ? /*#__PURE__*/React
|
|
6944
|
+
Filter: props => tags && tags.length ? /*#__PURE__*/React.createElement(SelectColumnFilter, _extends({}, props, {
|
|
6945
6945
|
column: _extends({}, props.columns, {
|
|
6946
6946
|
choices: tags
|
|
6947
6947
|
})
|
|
6948
|
-
})) : /*#__PURE__*/React
|
|
6948
|
+
})) : /*#__PURE__*/React.createElement(DefaultColumnFilter, props)
|
|
6949
6949
|
}];
|
|
6950
|
-
return /*#__PURE__*/React
|
|
6950
|
+
return /*#__PURE__*/React.createElement(Table, _extends({}, props, {
|
|
6951
6951
|
columns: columns
|
|
6952
6952
|
}));
|
|
6953
6953
|
}
|
|
@@ -6959,9 +6959,9 @@ function Loader({
|
|
|
6959
6959
|
className = ""
|
|
6960
6960
|
}) {
|
|
6961
6961
|
if (isActive) {
|
|
6962
|
-
return /*#__PURE__*/React
|
|
6962
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
6963
6963
|
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)
|
|
6964
|
-
}, /*#__PURE__*/React
|
|
6964
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
6965
6965
|
"data-testid": `icon_${icon}`,
|
|
6966
6966
|
color: color,
|
|
6967
6967
|
className: `text-11xl ${iconClass(undefined, icon, true)}`
|
|
@@ -7021,35 +7021,35 @@ function Modal(_ref) {
|
|
|
7021
7021
|
if (!show) {
|
|
7022
7022
|
return null;
|
|
7023
7023
|
}
|
|
7024
|
-
return /*#__PURE__*/React
|
|
7024
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7025
7025
|
role: "dialog",
|
|
7026
7026
|
className: `formio-dialog formio-dialog-theme-default ${className}`
|
|
7027
|
-
}, /*#__PURE__*/React
|
|
7027
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7028
7028
|
className: "formio-dialog-overlay",
|
|
7029
7029
|
onClick: onClickClose
|
|
7030
|
-
}), /*#__PURE__*/React
|
|
7030
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
7031
7031
|
style: style,
|
|
7032
7032
|
className: "formio-dialog-content"
|
|
7033
|
-
}, /*#__PURE__*/React
|
|
7033
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7034
7034
|
className: "formio-dialog-wrapper"
|
|
7035
|
-
}, title ? /*#__PURE__*/React
|
|
7035
|
+
}, title ? /*#__PURE__*/React.createElement("div", {
|
|
7036
7036
|
className: "formio-dialog-title",
|
|
7037
7037
|
ref: titleRef,
|
|
7038
7038
|
"data-testid": "modalTitle"
|
|
7039
|
-
}, title) : null, /*#__PURE__*/React
|
|
7039
|
+
}, title) : null, /*#__PURE__*/React.createElement("div", {
|
|
7040
7040
|
className: "formio-dialog-body",
|
|
7041
7041
|
style: {
|
|
7042
7042
|
maxHeight
|
|
7043
7043
|
},
|
|
7044
7044
|
"data-testid": "modalBody"
|
|
7045
|
-
}, show && children), ModalFooter ? /*#__PURE__*/React
|
|
7045
|
+
}, show && children), ModalFooter ? /*#__PURE__*/React.createElement("div", {
|
|
7046
7046
|
className: "formio-dialog-footer",
|
|
7047
7047
|
ref: footerRef,
|
|
7048
7048
|
"data-testid": "modalFooter"
|
|
7049
|
-
}, /*#__PURE__*/React
|
|
7049
|
+
}, /*#__PURE__*/React.createElement(ModalFooter, _extends({}, props, {
|
|
7050
7050
|
closeModal: closeModal,
|
|
7051
7051
|
onClose: onClickClose
|
|
7052
|
-
}))) : null), /*#__PURE__*/React
|
|
7052
|
+
}))) : null), /*#__PURE__*/React.createElement("button", {
|
|
7053
7053
|
className: "formio-dialog-close float-right btn btn-secondary btn-sm",
|
|
7054
7054
|
"aria-label": "close",
|
|
7055
7055
|
"data-testid": "closeModal",
|
|
@@ -7065,13 +7065,13 @@ function RemoveModalFooter({
|
|
|
7065
7065
|
onClose,
|
|
7066
7066
|
i18n = f => f
|
|
7067
7067
|
}) {
|
|
7068
|
-
return /*#__PURE__*/React
|
|
7068
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7069
7069
|
className: "flex items-center justify-center bg-white p-2"
|
|
7070
|
-
}, /*#__PURE__*/React
|
|
7070
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
7071
7071
|
"data-testid": "customCloseModal",
|
|
7072
7072
|
className: "btn btn-outline-dark mx-2",
|
|
7073
7073
|
onClick: onClose
|
|
7074
|
-
}, i18n("Cancel")), /*#__PURE__*/React
|
|
7074
|
+
}, i18n("Cancel")), /*#__PURE__*/React.createElement("button", {
|
|
7075
7075
|
disabled: valueToCompare !== value,
|
|
7076
7076
|
"data-testid": "customSubmitModal",
|
|
7077
7077
|
className: "btn btn-danger mx-2",
|
|
@@ -7080,7 +7080,7 @@ function RemoveModalFooter({
|
|
|
7080
7080
|
onSubmit(e);
|
|
7081
7081
|
}
|
|
7082
7082
|
}
|
|
7083
|
-
}, /*#__PURE__*/React
|
|
7083
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
7084
7084
|
className: classnames(iconClass(undefined, "trash"), "mr-2")
|
|
7085
7085
|
}), i18n("Remove")));
|
|
7086
7086
|
}
|
|
@@ -7095,7 +7095,7 @@ function RemoveModal(_ref) {
|
|
|
7095
7095
|
i18n = noop
|
|
7096
7096
|
} = props;
|
|
7097
7097
|
const [value, setValue] = useState();
|
|
7098
|
-
return /*#__PURE__*/React
|
|
7098
|
+
return /*#__PURE__*/React.createElement(Modal, _extends({}, props, {
|
|
7099
7099
|
className: classnames(props.className, "formio-dialog-theme-remove"),
|
|
7100
7100
|
style: {
|
|
7101
7101
|
maxWidth
|
|
@@ -7103,11 +7103,11 @@ function RemoveModal(_ref) {
|
|
|
7103
7103
|
title: `Drop ${(_props$itemType = props.itemType) == null ? void 0 : _props$itemType.toLowerCase()}`,
|
|
7104
7104
|
value: value,
|
|
7105
7105
|
footer: RemoveModalFooter
|
|
7106
|
-
}), /*#__PURE__*/React
|
|
7106
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
7107
7107
|
className: "px-4 pt-3 pb-5"
|
|
7108
|
-
}, /*#__PURE__*/React
|
|
7108
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7109
7109
|
className: "pb-1"
|
|
7110
|
-
}, children, i18n("To drop"), " ", /*#__PURE__*/React
|
|
7110
|
+
}, 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, {
|
|
7111
7111
|
name: "remove",
|
|
7112
7112
|
value: value,
|
|
7113
7113
|
onChange: (name, value) => setValue(value)
|
|
@@ -7288,17 +7288,17 @@ function DefaultCell({
|
|
|
7288
7288
|
render = f => f
|
|
7289
7289
|
}) {
|
|
7290
7290
|
if (value === undefined) {
|
|
7291
|
-
return /*#__PURE__*/React
|
|
7291
|
+
return /*#__PURE__*/React.createElement("span", null);
|
|
7292
7292
|
}
|
|
7293
7293
|
const rendered = render(value);
|
|
7294
7294
|
if (value !== rendered) {
|
|
7295
|
-
return /*#__PURE__*/React
|
|
7295
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7296
7296
|
dangerouslySetInnerHTML: {
|
|
7297
7297
|
__html: rendered
|
|
7298
7298
|
}
|
|
7299
7299
|
});
|
|
7300
7300
|
}
|
|
7301
|
-
return /*#__PURE__*/React
|
|
7301
|
+
return /*#__PURE__*/React.createElement("span", null, String(value));
|
|
7302
7302
|
}
|
|
7303
7303
|
|
|
7304
7304
|
function mapFormToColumns(form) {
|
|
@@ -7309,7 +7309,7 @@ function mapFormToColumns(form) {
|
|
|
7309
7309
|
const column = {
|
|
7310
7310
|
Header: component.label || component.title || component.key,
|
|
7311
7311
|
accessor: `data.${component.key}`,
|
|
7312
|
-
Cell: props => /*#__PURE__*/React
|
|
7312
|
+
Cell: props => /*#__PURE__*/React.createElement(DefaultCell, _extends({}, props, {
|
|
7313
7313
|
render: value => cmp.asString(value)
|
|
7314
7314
|
}))
|
|
7315
7315
|
};
|
|
@@ -7330,7 +7330,7 @@ function SubmissionsTable(_ref) {
|
|
|
7330
7330
|
} = _ref,
|
|
7331
7331
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
7332
7332
|
const columns = form && mapFormToColumns(form);
|
|
7333
|
-
return /*#__PURE__*/React
|
|
7333
|
+
return /*#__PURE__*/React.createElement(Table, _extends({}, props, {
|
|
7334
7334
|
columns: columns
|
|
7335
7335
|
}));
|
|
7336
7336
|
}
|
|
@@ -7343,7 +7343,7 @@ function SliderColumnFilter({
|
|
|
7343
7343
|
id
|
|
7344
7344
|
}
|
|
7345
7345
|
}) {
|
|
7346
|
-
const [min, max] = React
|
|
7346
|
+
const [min, max] = React.useMemo(() => {
|
|
7347
7347
|
let min = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
|
|
7348
7348
|
let max = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
|
|
7349
7349
|
preFilteredRows.forEach(row => {
|
|
@@ -7352,7 +7352,7 @@ function SliderColumnFilter({
|
|
|
7352
7352
|
});
|
|
7353
7353
|
return [min, max];
|
|
7354
7354
|
}, [id, preFilteredRows]);
|
|
7355
|
-
return /*#__PURE__*/React
|
|
7355
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", {
|
|
7356
7356
|
type: "range",
|
|
7357
7357
|
min: min,
|
|
7358
7358
|
max: max,
|
|
@@ -7360,7 +7360,7 @@ function SliderColumnFilter({
|
|
|
7360
7360
|
onChange: e => {
|
|
7361
7361
|
setFilter(parseInt(e.target.value, 10));
|
|
7362
7362
|
}
|
|
7363
|
-
}), /*#__PURE__*/React
|
|
7363
|
+
}), /*#__PURE__*/React.createElement("button", {
|
|
7364
7364
|
onClick: () => setFilter(undefined)
|
|
7365
7365
|
}, "Off"));
|
|
7366
7366
|
}
|
|
@@ -7376,18 +7376,18 @@ function ButtonTab({
|
|
|
7376
7376
|
className,
|
|
7377
7377
|
after
|
|
7378
7378
|
}) {
|
|
7379
|
-
return /*#__PURE__*/React
|
|
7379
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7380
7380
|
title: "button-wrapper",
|
|
7381
7381
|
className: classnames("tw-tabs__button-wrapper", isActive ? "-active" : "", back ? "-back" : "", className)
|
|
7382
|
-
}, /*#__PURE__*/React
|
|
7382
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
7383
7383
|
title: "button-tab",
|
|
7384
7384
|
className: classnames("tw-tabs__button", reverse ? "-reverse" : "", isActive ? "-active" : "", back ? "-back" : ""),
|
|
7385
7385
|
onClick: onClick
|
|
7386
|
-
}, icon && /*#__PURE__*/React
|
|
7386
|
+
}, icon && /*#__PURE__*/React.createElement("i", {
|
|
7387
7387
|
className: classnames(iconClass(undefined, icon), "tw-tabs__button-icon")
|
|
7388
|
-
}), /*#__PURE__*/React
|
|
7388
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
7389
7389
|
className: "tw-tabs__button-label"
|
|
7390
|
-
}, children), after), /*#__PURE__*/React
|
|
7390
|
+
}, children), after), /*#__PURE__*/React.createElement("div", {
|
|
7391
7391
|
className: classnames("tw-tabs__button-border", isActive ? "-active" : "")
|
|
7392
7392
|
}));
|
|
7393
7393
|
}
|
|
@@ -7405,18 +7405,18 @@ function Tabs(_ref) {
|
|
|
7405
7405
|
i18n = f => f
|
|
7406
7406
|
} = _ref,
|
|
7407
7407
|
additionalProps = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
|
7408
|
-
return /*#__PURE__*/React
|
|
7408
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7409
7409
|
"data-testid": "tabs-comp",
|
|
7410
7410
|
className: `tw-tabs ${className}`,
|
|
7411
7411
|
style: style
|
|
7412
|
-
}, /*#__PURE__*/React
|
|
7412
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("nav", {
|
|
7413
7413
|
className: "tw-tabs__header"
|
|
7414
|
-
}, /*#__PURE__*/React
|
|
7414
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7415
7415
|
className: "tw-tabs__header-wrapper"
|
|
7416
|
-
}, /*#__PURE__*/React
|
|
7416
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
7417
7417
|
className: "tw-tabs__header-border"
|
|
7418
7418
|
}), items.filter(item => item.label || item.icon).map((item, index) => {
|
|
7419
|
-
return /*#__PURE__*/React
|
|
7419
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
7420
7420
|
key: index,
|
|
7421
7421
|
back: item.back,
|
|
7422
7422
|
isActive: (current == null ? void 0 : current.action) === item.action,
|
|
@@ -7425,11 +7425,11 @@ function Tabs(_ref) {
|
|
|
7425
7425
|
onClick && onClick(item);
|
|
7426
7426
|
}
|
|
7427
7427
|
}, additionalProps, item), i18n(item.label || ""));
|
|
7428
|
-
}), AddButton && /*#__PURE__*/React
|
|
7428
|
+
}), AddButton && /*#__PURE__*/React.createElement(AddButton, _extends({}, additionalProps, {
|
|
7429
7429
|
current: current
|
|
7430
|
-
})))), HeaderChildren && /*#__PURE__*/React
|
|
7430
|
+
})))), HeaderChildren && /*#__PURE__*/React.createElement(HeaderChildren, _extends({}, additionalProps, {
|
|
7431
7431
|
current: current
|
|
7432
|
-
}))), /*#__PURE__*/React
|
|
7432
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
7433
7433
|
title: "tab-body",
|
|
7434
7434
|
className: "tw-tabs__body"
|
|
7435
7435
|
}, children));
|