@tsed/react-formio 2.3.0 → 2.3.2
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/coverage.json +4 -4
- package/dist/components/actions-table/actionsTable.stories.d.ts +8 -53
- package/dist/components/form-access/formAccess.component.d.ts +2 -13
- package/dist/components/form-access/formAccess.stories.d.ts +3 -44
- package/dist/components/form-control/formControl.component.d.ts +3 -11
- package/dist/components/select/select.component.d.ts +5 -18
- package/dist/components/table/components/defaultCellOperations.component.d.ts +12 -1
- package/dist/components/table/components/defaultOperationButton.component.d.ts +4 -4
- package/dist/components/table/hooks/useOperations.hook.d.ts +2 -2
- package/dist/index.js +1113 -1265
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +226 -244
- package/dist/index.modern.js.map +1 -1
- package/package.json +13 -6
- package/src/components/__fixtures__/form-actions.json +240 -0
- package/src/components/actions-table/__fixtures__/data.json +12 -0
- package/src/components/actions-table/actionsTable.component.spec.tsx +42 -11
- package/src/components/actions-table/actionsTable.component.tsx +2 -1
- package/src/components/actions-table/actionsTable.stories.tsx +71 -289
- package/src/components/form-access/formAccess.component.tsx +2 -12
- package/src/components/form-access/formAccess.stories.tsx +55 -49
- package/src/components/form-control/formControl.component.tsx +4 -11
- package/src/components/select/select.component.tsx +9 -22
- package/src/components/table/components/defaultCellOperations.component.tsx +17 -4
- package/src/components/table/components/defaultOperationButton.component.tsx +9 -4
- package/src/components/table/hooks/useOperations.hook.tsx +3 -3
package/dist/index.modern.js
CHANGED
|
@@ -4,14 +4,14 @@ 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, { useRef, useEffect, useState, useMemo, useCallback, useReducer } from 'react';
|
|
7
|
+
import React$1, { 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';
|
|
11
|
-
import PropTypes from 'prop-types';
|
|
12
11
|
import { DndProvider, useDrop, useDrag } from 'react-dnd';
|
|
13
12
|
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
14
13
|
import { useTable, useFilters, useGroupBy, useSortBy, usePagination } from 'react-table';
|
|
14
|
+
import PropTypes from 'prop-types';
|
|
15
15
|
import AllComponents from 'formiojs/components';
|
|
16
16
|
import cloneDeep from 'lodash/cloneDeep';
|
|
17
17
|
import isEqual from 'lodash/isEqual';
|
|
@@ -75,40 +75,33 @@ function FormControl({
|
|
|
75
75
|
label,
|
|
76
76
|
className
|
|
77
77
|
}) {
|
|
78
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
return /*#__PURE__*/React$1.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.createElement("label", {
|
|
82
|
+
}, label && /*#__PURE__*/React$1.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.createElement("div", {
|
|
86
|
+
}, label), /*#__PURE__*/React$1.createElement("div", {
|
|
87
87
|
className: "input-group"
|
|
88
|
-
}, prefix && /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
}, prefix && /*#__PURE__*/React$1.createElement("div", {
|
|
89
89
|
className: "input-group-prepend"
|
|
90
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
90
|
+
}, /*#__PURE__*/React$1.createElement("span", {
|
|
91
91
|
className: "input-group-text",
|
|
92
92
|
"data-testid": "form-control-prefix"
|
|
93
|
-
}, prefix)), children, suffix && /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
}, prefix)), children, suffix && /*#__PURE__*/React$1.createElement("div", {
|
|
94
94
|
className: "input-group-append"
|
|
95
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
95
|
+
}, /*#__PURE__*/React$1.createElement("span", {
|
|
96
96
|
className: "input-group-text",
|
|
97
97
|
"data-testid": "form-control-suffix"
|
|
98
|
-
}, suffix))), description && /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
}, suffix))), description && /*#__PURE__*/React$1.createElement("div", {
|
|
99
99
|
"data-testid": "form-control-description",
|
|
100
100
|
className: "form-text text-muted"
|
|
101
101
|
}, description));
|
|
102
102
|
}
|
|
103
|
-
FormControl.propTypes = {
|
|
104
|
-
label: PropTypes.string,
|
|
105
|
-
name: PropTypes.string.isRequired,
|
|
106
|
-
children: PropTypes.any,
|
|
107
|
-
required: PropTypes.bool,
|
|
108
|
-
description: PropTypes.any
|
|
109
|
-
};
|
|
110
103
|
|
|
111
|
-
const _excluded$
|
|
104
|
+
const _excluded$g = ["name", "label", "size", "onChange", "required", "value", "choices", "description", "placeholder", "prefix", "suffix", "multiple", "layout"];
|
|
112
105
|
function Select(_ref) {
|
|
113
106
|
let {
|
|
114
107
|
name,
|
|
@@ -125,8 +118,8 @@ function Select(_ref) {
|
|
|
125
118
|
multiple,
|
|
126
119
|
layout
|
|
127
120
|
} = _ref,
|
|
128
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
129
|
-
const ref = useRef();
|
|
121
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
122
|
+
const ref = useRef(null);
|
|
130
123
|
useEffect(() => {
|
|
131
124
|
let instance;
|
|
132
125
|
if (layout === "choicesjs") {
|
|
@@ -143,7 +136,7 @@ function Select(_ref) {
|
|
|
143
136
|
label: placeholder,
|
|
144
137
|
value: ""
|
|
145
138
|
}, ...choices];
|
|
146
|
-
return /*#__PURE__*/React.createElement(FormControl, {
|
|
139
|
+
return /*#__PURE__*/React$1.createElement(FormControl, {
|
|
147
140
|
name: name,
|
|
148
141
|
label: label,
|
|
149
142
|
required: required,
|
|
@@ -151,10 +144,10 @@ function Select(_ref) {
|
|
|
151
144
|
prefix: prefix,
|
|
152
145
|
suffix: suffix,
|
|
153
146
|
shadow: false
|
|
154
|
-
}, /*#__PURE__*/React.createElement("select", _extends({
|
|
155
|
-
ref: ref
|
|
147
|
+
}, /*#__PURE__*/React$1.createElement("select", _extends({
|
|
148
|
+
ref: ref,
|
|
149
|
+
"data-testid": `select_${name}`
|
|
156
150
|
}, props, {
|
|
157
|
-
"data-testid": `select_${name}`,
|
|
158
151
|
className: classnames("form-control", size && `form-control-${size}`),
|
|
159
152
|
name: name,
|
|
160
153
|
id: name,
|
|
@@ -168,29 +161,21 @@ function Select(_ref) {
|
|
|
168
161
|
label,
|
|
169
162
|
value
|
|
170
163
|
}) => {
|
|
171
|
-
return /*#__PURE__*/React.createElement("option", {
|
|
164
|
+
return /*#__PURE__*/React$1.createElement("option", {
|
|
172
165
|
key: String(value),
|
|
173
166
|
label: label,
|
|
174
167
|
value: value
|
|
175
168
|
}, label);
|
|
176
169
|
})));
|
|
177
170
|
}
|
|
178
|
-
Select.propTypes = {
|
|
179
|
-
label: PropTypes.string,
|
|
180
|
-
name: PropTypes.string.isRequired,
|
|
181
|
-
value: PropTypes.any,
|
|
182
|
-
required: PropTypes.bool,
|
|
183
|
-
onChange: PropTypes.func,
|
|
184
|
-
choices: PropTypes.array.isRequired
|
|
185
|
-
};
|
|
186
171
|
|
|
187
172
|
function DrapNDropContainer({
|
|
188
173
|
enableDragNDrop,
|
|
189
174
|
children
|
|
190
175
|
}) {
|
|
191
|
-
return enableDragNDrop ? /*#__PURE__*/React.createElement(DndProvider, {
|
|
176
|
+
return enableDragNDrop ? /*#__PURE__*/React$1.createElement(DndProvider, {
|
|
192
177
|
backend: HTML5Backend
|
|
193
|
-
}, children) : /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
178
|
+
}, children) : /*#__PURE__*/React$1.createElement(React$1.Fragment, null, children);
|
|
194
179
|
}
|
|
195
180
|
|
|
196
181
|
const LEFT_PAGE = "LEFT";
|
|
@@ -235,7 +220,7 @@ function getPageNumbers({
|
|
|
235
220
|
return range(1, totalPages);
|
|
236
221
|
}
|
|
237
222
|
|
|
238
|
-
const _excluded$
|
|
223
|
+
const _excluded$f = ["component", "children", "disabled", "active"];
|
|
239
224
|
function PaginationButton(props) {
|
|
240
225
|
const {
|
|
241
226
|
component: Component = "button",
|
|
@@ -243,8 +228,8 @@ function PaginationButton(props) {
|
|
|
243
228
|
disabled,
|
|
244
229
|
active
|
|
245
230
|
} = props,
|
|
246
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded$
|
|
247
|
-
return /*#__PURE__*/React.createElement(Component, _extends({}, otherProps, {
|
|
231
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$f);
|
|
232
|
+
return /*#__PURE__*/React$1.createElement(Component, _extends({}, otherProps, {
|
|
248
233
|
"data-testid": "pagination-button",
|
|
249
234
|
disabled: disabled,
|
|
250
235
|
className: classnames("page-link", disabled ? "disabled" : "", active ? "" : "", props.className)
|
|
@@ -276,58 +261,58 @@ function Pagination(props) {
|
|
|
276
261
|
value,
|
|
277
262
|
label: value
|
|
278
263
|
}));
|
|
279
|
-
return /*#__PURE__*/React.createElement("nav", {
|
|
264
|
+
return /*#__PURE__*/React$1.createElement("nav", {
|
|
280
265
|
"aria-label": "Page navigation",
|
|
281
266
|
className: classnames("pagination-group -mb-3", className)
|
|
282
|
-
}, /*#__PURE__*/React.createElement("ul", {
|
|
267
|
+
}, /*#__PURE__*/React$1.createElement("ul", {
|
|
283
268
|
className: "pagination mb-3 mr-3"
|
|
284
|
-
}, /*#__PURE__*/React.createElement("li", {
|
|
269
|
+
}, /*#__PURE__*/React$1.createElement("li", {
|
|
285
270
|
className: classnames("page-item", !canPreviousPage && "disabled")
|
|
286
|
-
}, /*#__PURE__*/React.createElement(PaginationButton, {
|
|
271
|
+
}, /*#__PURE__*/React$1.createElement(PaginationButton, {
|
|
287
272
|
tabIndex: -1,
|
|
288
273
|
disabled: !canPreviousPage,
|
|
289
274
|
onClick: () => previousPage()
|
|
290
275
|
}, i18n("Previous"))), pageNumbers.map(page => {
|
|
291
276
|
if ([LEFT_PAGE, RIGHT_PAGE].includes(page)) {
|
|
292
|
-
return /*#__PURE__*/React.createElement("li", {
|
|
277
|
+
return /*#__PURE__*/React$1.createElement("li", {
|
|
293
278
|
className: "page-item",
|
|
294
279
|
key: page
|
|
295
|
-
}, /*#__PURE__*/React.createElement(PaginationButton, {
|
|
280
|
+
}, /*#__PURE__*/React$1.createElement(PaginationButton, {
|
|
296
281
|
"aria-hidden": "true"
|
|
297
282
|
}, "..."));
|
|
298
283
|
}
|
|
299
284
|
const active = page - 1 === pageIndex;
|
|
300
|
-
return /*#__PURE__*/React.createElement("li", {
|
|
285
|
+
return /*#__PURE__*/React$1.createElement("li", {
|
|
301
286
|
className: classnames("page-item", active && "active"),
|
|
302
287
|
key: page
|
|
303
|
-
}, /*#__PURE__*/React.createElement(PaginationButton, {
|
|
288
|
+
}, /*#__PURE__*/React$1.createElement(PaginationButton, {
|
|
304
289
|
tabIndex: pageIndex,
|
|
305
290
|
active: active,
|
|
306
291
|
onClick: () => gotoPage(page - 1)
|
|
307
292
|
}, page));
|
|
308
|
-
}), /*#__PURE__*/React.createElement("li", {
|
|
293
|
+
}), /*#__PURE__*/React$1.createElement("li", {
|
|
309
294
|
className: classnames("page-item", !canNextPage && "disabled")
|
|
310
|
-
}, /*#__PURE__*/React.createElement(PaginationButton, {
|
|
295
|
+
}, /*#__PURE__*/React$1.createElement(PaginationButton, {
|
|
311
296
|
tabIndex: pageNumbers.length,
|
|
312
297
|
disabled: !canNextPage,
|
|
313
298
|
onClick: () => nextPage()
|
|
314
|
-
}, i18n("Next")))), /*#__PURE__*/React.createElement("li", {
|
|
299
|
+
}, i18n("Next")))), /*#__PURE__*/React$1.createElement("li", {
|
|
315
300
|
className: "mb-3 mr-3 flex items-center"
|
|
316
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
301
|
+
}, /*#__PURE__*/React$1.createElement(Select, {
|
|
317
302
|
name: "page",
|
|
318
303
|
value: pageSize,
|
|
319
304
|
choices: choices,
|
|
320
305
|
onChange: (name, value) => {
|
|
321
306
|
setPageSize(+value);
|
|
322
307
|
}
|
|
323
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
308
|
+
}), /*#__PURE__*/React$1.createElement("span", {
|
|
324
309
|
className: "ml-3"
|
|
325
|
-
}, i18n("items per page"))), pageOptions && /*#__PURE__*/React.createElement("li", {
|
|
310
|
+
}, i18n("items per page"))), pageOptions && /*#__PURE__*/React$1.createElement("li", {
|
|
326
311
|
className: "mb-3 mr-3 flex items-center"
|
|
327
|
-
}, /*#__PURE__*/React.createElement("span", null, i18n("Page"), "\xA0"), /*#__PURE__*/React.createElement("strong", null, pageIndex + 1, " of ", pageOptions.length)), totalLength !== undefined && /*#__PURE__*/React.createElement("li", {
|
|
312
|
+
}, /*#__PURE__*/React$1.createElement("span", null, i18n("Page"), "\xA0"), /*#__PURE__*/React$1.createElement("strong", null, pageIndex + 1, " of ", pageOptions.length)), totalLength !== undefined && /*#__PURE__*/React$1.createElement("li", {
|
|
328
313
|
className: "mb-3 flex items-center",
|
|
329
314
|
"data-testid": "pagination-total-items"
|
|
330
|
-
}, i18n("Total"), ": ", /*#__PURE__*/React.createElement("strong", {
|
|
315
|
+
}, i18n("Total"), ": ", /*#__PURE__*/React$1.createElement("strong", {
|
|
331
316
|
className: "mx-1"
|
|
332
317
|
}, new Intl.NumberFormat(undefined).format(totalLength)), " ", i18n("items")));
|
|
333
318
|
}
|
|
@@ -339,9 +324,9 @@ function DefaultArrowSort({
|
|
|
339
324
|
isSorted,
|
|
340
325
|
isSortedDesc
|
|
341
326
|
} = column;
|
|
342
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
327
|
+
return /*#__PURE__*/React$1.createElement("span", {
|
|
343
328
|
className: "table-arrow-sort"
|
|
344
|
-
}, isSorted ? /*#__PURE__*/React.createElement("i", {
|
|
329
|
+
}, isSorted ? /*#__PURE__*/React$1.createElement("i", {
|
|
345
330
|
className: iconClass(undefined, isSortedDesc ? "sort-up" : "sort-down")
|
|
346
331
|
}) : "");
|
|
347
332
|
}
|
|
@@ -349,16 +334,16 @@ function DefaultArrowSort({
|
|
|
349
334
|
function DefaultCellHeader({
|
|
350
335
|
column
|
|
351
336
|
}) {
|
|
352
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
337
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
353
338
|
className: "table-cell-header"
|
|
354
|
-
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
339
|
+
}, /*#__PURE__*/React$1.createElement("div", _extends({
|
|
355
340
|
className: "table-cell-header__label"
|
|
356
|
-
}, column.getSortByToggleProps()), /*#__PURE__*/React.createElement("span", null, column.render("Header")), column.render("ArrowSort")), column.canFilter ? /*#__PURE__*/React.createElement("div", {
|
|
341
|
+
}, column.getSortByToggleProps()), /*#__PURE__*/React$1.createElement("span", null, column.render("Header")), column.render("ArrowSort")), column.canFilter ? /*#__PURE__*/React$1.createElement("div", {
|
|
357
342
|
className: "table-cell-header__filter"
|
|
358
343
|
}, column.render("Filter")) : null);
|
|
359
344
|
}
|
|
360
345
|
|
|
361
|
-
const _excluded$
|
|
346
|
+
const _excluded$e = ["onDrag", "onDrop", "index"];
|
|
362
347
|
const DND_ITEM_TYPE = "row";
|
|
363
348
|
function useDndRow(_ref) {
|
|
364
349
|
let {
|
|
@@ -366,7 +351,7 @@ function useDndRow(_ref) {
|
|
|
366
351
|
onDrop,
|
|
367
352
|
index
|
|
368
353
|
} = _ref,
|
|
369
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
354
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
370
355
|
const dropRef = useRef(null);
|
|
371
356
|
const dragRef = useRef(null);
|
|
372
357
|
const [, drop] = useDrop({
|
|
@@ -440,7 +425,7 @@ function useDndRow(_ref) {
|
|
|
440
425
|
function DefaultCells({
|
|
441
426
|
row
|
|
442
427
|
}) {
|
|
443
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, row.cells.map((cell, i) => {
|
|
428
|
+
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, row.cells.map((cell, i) => {
|
|
444
429
|
const {
|
|
445
430
|
hidden,
|
|
446
431
|
colspan
|
|
@@ -448,7 +433,7 @@ function DefaultCells({
|
|
|
448
433
|
if (hidden) {
|
|
449
434
|
return null;
|
|
450
435
|
}
|
|
451
|
-
return /*#__PURE__*/React.createElement("td", _extends({
|
|
436
|
+
return /*#__PURE__*/React$1.createElement("td", _extends({
|
|
452
437
|
colSpan: colspan
|
|
453
438
|
}, cell.getCellProps({
|
|
454
439
|
className: cell.column.className,
|
|
@@ -459,7 +444,7 @@ function DefaultCells({
|
|
|
459
444
|
}));
|
|
460
445
|
}
|
|
461
446
|
|
|
462
|
-
const _excluded$
|
|
447
|
+
const _excluded$d = ["onClick", "row", "enableDragNDrop", "onDrop", "onDrag"];
|
|
463
448
|
function DefaultDndRow(props) {
|
|
464
449
|
const {
|
|
465
450
|
isDragging,
|
|
@@ -467,23 +452,23 @@ function DefaultDndRow(props) {
|
|
|
467
452
|
dropRef,
|
|
468
453
|
opacity
|
|
469
454
|
} = useDndRow(props);
|
|
470
|
-
return /*#__PURE__*/React.createElement("tr", {
|
|
455
|
+
return /*#__PURE__*/React$1.createElement("tr", {
|
|
471
456
|
ref: dropRef,
|
|
472
457
|
style: {
|
|
473
458
|
opacity
|
|
474
459
|
}
|
|
475
|
-
}, /*#__PURE__*/React.createElement("td", {
|
|
460
|
+
}, /*#__PURE__*/React$1.createElement("td", {
|
|
476
461
|
ref: dragRef,
|
|
477
462
|
role: "cell",
|
|
478
463
|
style: {
|
|
479
464
|
cursor: isDragging ? "grabbing" : "grab"
|
|
480
465
|
},
|
|
481
466
|
className: "align-middle"
|
|
482
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
467
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
483
468
|
className: "flex items-center justify-center"
|
|
484
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
469
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
485
470
|
className: classnames(iconClass(undefined, "dots-vertical-rounded"))
|
|
486
|
-
}))), /*#__PURE__*/React.createElement(DefaultCells, props));
|
|
471
|
+
}))), /*#__PURE__*/React$1.createElement(DefaultCells, props));
|
|
487
472
|
}
|
|
488
473
|
function DefaultRow(_ref) {
|
|
489
474
|
let {
|
|
@@ -493,18 +478,18 @@ function DefaultRow(_ref) {
|
|
|
493
478
|
onDrop,
|
|
494
479
|
onDrag
|
|
495
480
|
} = _ref,
|
|
496
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
481
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
497
482
|
const opts = _extends({}, props, {
|
|
498
483
|
onClick: () => onClick(row.original, "row")
|
|
499
484
|
}, row.getRowProps());
|
|
500
485
|
if (enableDragNDrop) {
|
|
501
|
-
return /*#__PURE__*/React.createElement(DefaultDndRow, _extends({}, opts, {
|
|
486
|
+
return /*#__PURE__*/React$1.createElement(DefaultDndRow, _extends({}, opts, {
|
|
502
487
|
row: row,
|
|
503
488
|
onDrag: onDrag,
|
|
504
489
|
onDrop: onDrop
|
|
505
490
|
}));
|
|
506
491
|
}
|
|
507
|
-
return /*#__PURE__*/React.createElement("tr", opts, /*#__PURE__*/React.createElement(DefaultCells, {
|
|
492
|
+
return /*#__PURE__*/React$1.createElement("tr", opts, /*#__PURE__*/React$1.createElement(DefaultCells, {
|
|
508
493
|
row: row
|
|
509
494
|
}));
|
|
510
495
|
}
|
|
@@ -520,7 +505,7 @@ function callLast(fn, time) {
|
|
|
520
505
|
};
|
|
521
506
|
}
|
|
522
507
|
|
|
523
|
-
const _excluded$
|
|
508
|
+
const _excluded$c = ["name", "value", "label", "onChange", "required", "size", "type", "prefix", "suffix", "description", "className", "placeholder"];
|
|
524
509
|
function InputText(_ref) {
|
|
525
510
|
let {
|
|
526
511
|
name,
|
|
@@ -536,13 +521,13 @@ function InputText(_ref) {
|
|
|
536
521
|
className,
|
|
537
522
|
placeholder
|
|
538
523
|
} = _ref,
|
|
539
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
524
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
540
525
|
const [localValue, setValue] = useState(value);
|
|
541
526
|
const change = useMemo(() => onChange && callLast(onChange, 300), [onChange]);
|
|
542
527
|
useEffect(() => {
|
|
543
528
|
setValue(value);
|
|
544
529
|
}, [value]);
|
|
545
|
-
return /*#__PURE__*/React.createElement(FormControl, {
|
|
530
|
+
return /*#__PURE__*/React$1.createElement(FormControl, {
|
|
546
531
|
name: name,
|
|
547
532
|
label: label,
|
|
548
533
|
required: required,
|
|
@@ -550,7 +535,7 @@ function InputText(_ref) {
|
|
|
550
535
|
prefix: prefix,
|
|
551
536
|
suffix: suffix,
|
|
552
537
|
className: className
|
|
553
|
-
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
538
|
+
}, /*#__PURE__*/React$1.createElement("input", _extends({
|
|
554
539
|
type: type || "text"
|
|
555
540
|
}, props, {
|
|
556
541
|
"data-testid": `input_${name}`,
|
|
@@ -594,7 +579,7 @@ function DefaultColumnFilter(props) {
|
|
|
594
579
|
setFilterId(id);
|
|
595
580
|
setFilter(value || undefined);
|
|
596
581
|
}, [id, setValue, setFilterId, setFilter]);
|
|
597
|
-
return /*#__PURE__*/React.createElement(InputText, {
|
|
582
|
+
return /*#__PURE__*/React$1.createElement(InputText, {
|
|
598
583
|
size: "sm",
|
|
599
584
|
id: id,
|
|
600
585
|
name: id,
|
|
@@ -617,22 +602,25 @@ const stopPropagationWrapper = fn => event => {
|
|
|
617
602
|
fn();
|
|
618
603
|
};
|
|
619
604
|
|
|
605
|
+
const _excluded$b = ["className", "buttonSize", "buttonType", "buttonOutline", "onClick", "action", "icon", "title", "i18n", "data", "ctx"];
|
|
620
606
|
function DefaultOperationButton(props) {
|
|
621
607
|
const {
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
608
|
+
className = "btn",
|
|
609
|
+
buttonSize = "xs",
|
|
610
|
+
buttonType = "primary",
|
|
611
|
+
buttonOutline,
|
|
612
|
+
onClick,
|
|
613
|
+
action,
|
|
614
|
+
icon = "",
|
|
615
|
+
title = "",
|
|
616
|
+
i18n = f => f
|
|
617
|
+
} = props,
|
|
618
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$b);
|
|
619
|
+
return /*#__PURE__*/React.createElement("button", _extends({}, otherProps, {
|
|
620
|
+
"aria-label": "Operation button: " + (title || action),
|
|
633
621
|
className: classnames(className, ["btn", buttonOutline && "outline", buttonType].filter(Boolean).join("-"), `btn-${buttonSize}`),
|
|
634
622
|
onClick: stopPropagationWrapper(() => onClick(action))
|
|
635
|
-
}, icon ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("i", {
|
|
623
|
+
}), icon ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("i", {
|
|
636
624
|
className: iconClass(undefined, icon)
|
|
637
625
|
}), " ", title && " ") : null, title && /*#__PURE__*/React.createElement("span", {
|
|
638
626
|
className: icon && title ? "ml-1" : ""
|
|
@@ -648,18 +636,19 @@ function DefaultCellOperations({
|
|
|
648
636
|
i18n
|
|
649
637
|
}) {
|
|
650
638
|
const data = row.original;
|
|
651
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
639
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
652
640
|
className: "btn-group"
|
|
653
641
|
}, operations.filter(({
|
|
654
642
|
permissionsResolver
|
|
655
|
-
}) => !permissionsResolver || permissionsResolver(data, ctx)).map(_ref => {
|
|
643
|
+
}) => !permissionsResolver || permissionsResolver(data, ctx)).map((_ref, index) => {
|
|
656
644
|
let {
|
|
657
645
|
OperationButton = DefaultOperationButton
|
|
658
646
|
} = _ref,
|
|
659
647
|
operation = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
660
|
-
return /*#__PURE__*/React.createElement(OperationButton, _extends({
|
|
648
|
+
return /*#__PURE__*/React$1.createElement(OperationButton, _extends({
|
|
661
649
|
key: operation.action
|
|
662
650
|
}, operation, {
|
|
651
|
+
"data-testid": `operation-${index}-${operation.action}`,
|
|
663
652
|
onClick: action => onClick(data, action),
|
|
664
653
|
data: data,
|
|
665
654
|
i18n: i18n,
|
|
@@ -683,10 +672,10 @@ function useOperations({
|
|
|
683
672
|
return [...columns, {
|
|
684
673
|
id: "operations",
|
|
685
674
|
groupByBoundary: true,
|
|
686
|
-
Header: () => /*#__PURE__*/React.createElement("div", {
|
|
675
|
+
Header: () => /*#__PURE__*/React$1.createElement("div", {
|
|
687
676
|
className: "text-center"
|
|
688
677
|
}, i18n("Operations")),
|
|
689
|
-
Cell: props => /*#__PURE__*/React.createElement(CellOperations, _extends({}, props, {
|
|
678
|
+
Cell: props => /*#__PURE__*/React$1.createElement(CellOperations, _extends({}, props, {
|
|
690
679
|
operations: operations,
|
|
691
680
|
onClick: onClick,
|
|
692
681
|
ctx: ctx,
|
|
@@ -707,12 +696,12 @@ function getOperationCallback(operations, onClick) {
|
|
|
707
696
|
};
|
|
708
697
|
}
|
|
709
698
|
function DefaultLoader() {
|
|
710
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
699
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
711
700
|
className: "text-center p-2 pb-4 font-bold"
|
|
712
701
|
}, "Loading in progress");
|
|
713
702
|
}
|
|
714
703
|
function DefaultEmptyData() {
|
|
715
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
704
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
716
705
|
className: "text-center p-2 pb-4 font-bold"
|
|
717
706
|
}, "No data found");
|
|
718
707
|
}
|
|
@@ -750,12 +739,12 @@ function useCustomTable(props) {
|
|
|
750
739
|
} = props,
|
|
751
740
|
ctx = _objectWithoutPropertiesLoose(props, _excluded$9);
|
|
752
741
|
const _onClick = getOperationCallback(operations, onClick);
|
|
753
|
-
const defaultColumn = React.useMemo(() => ({
|
|
742
|
+
const defaultColumn = React$1.useMemo(() => ({
|
|
754
743
|
// Let's set up our default Filter UI
|
|
755
744
|
Filter: ColumnFilter,
|
|
756
745
|
ArrowSort
|
|
757
746
|
}), [ColumnFilter, ArrowSort]);
|
|
758
|
-
const [filterId, setFilterId] = React.useState(controlledFilterId);
|
|
747
|
+
const [filterId, setFilterId] = React$1.useState(controlledFilterId);
|
|
759
748
|
// DND
|
|
760
749
|
const [records, setRecords] = useState(data);
|
|
761
750
|
useEffect(() => {
|
|
@@ -800,7 +789,7 @@ function useCustomTable(props) {
|
|
|
800
789
|
filters
|
|
801
790
|
}
|
|
802
791
|
} = tableInstance;
|
|
803
|
-
React.useEffect(() => {
|
|
792
|
+
React$1.useEffect(() => {
|
|
804
793
|
onChange({
|
|
805
794
|
pageIndex,
|
|
806
795
|
pageSize,
|
|
@@ -859,26 +848,26 @@ function Table(props) {
|
|
|
859
848
|
onDrop
|
|
860
849
|
} = useCustomTable(props);
|
|
861
850
|
// Render the UI for your table
|
|
862
|
-
return /*#__PURE__*/React.createElement(DrapNDropContainer, {
|
|
851
|
+
return /*#__PURE__*/React$1.createElement(DrapNDropContainer, {
|
|
863
852
|
enableDragNDrop: enableDragNDrop
|
|
864
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
853
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
865
854
|
className: classnames("table-group table-responsive", className)
|
|
866
|
-
}, /*#__PURE__*/React.createElement("table", _extends({
|
|
855
|
+
}, /*#__PURE__*/React$1.createElement("table", _extends({
|
|
867
856
|
className: "table table-striped table-hover"
|
|
868
|
-
}, tableInstance.getTableProps()), /*#__PURE__*/React.createElement("thead", null, tableInstance.headerGroups.map((headerGroup, i) => /*#__PURE__*/React.createElement("tr", _extends({}, headerGroup.getHeaderGroupProps(), {
|
|
857
|
+
}, tableInstance.getTableProps()), /*#__PURE__*/React$1.createElement("thead", null, tableInstance.headerGroups.map((headerGroup, i) => /*#__PURE__*/React$1.createElement("tr", _extends({}, headerGroup.getHeaderGroupProps(), {
|
|
869
858
|
key: `tableInstance.headerGroups${i}`
|
|
870
|
-
}), enableDragNDrop ? /*#__PURE__*/React.createElement("th", {
|
|
859
|
+
}), enableDragNDrop ? /*#__PURE__*/React$1.createElement("th", {
|
|
871
860
|
role: "columnheader",
|
|
872
861
|
className: "text-center"
|
|
873
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
862
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
874
863
|
className: "table-cell-header"
|
|
875
|
-
})) : null, headerGroup.headers.map(column => /*#__PURE__*/React.createElement("th", _extends({}, column.getHeaderProps(), {
|
|
864
|
+
})) : null, headerGroup.headers.map(column => /*#__PURE__*/React$1.createElement("th", _extends({}, column.getHeaderProps(), {
|
|
876
865
|
key: `tableInstance.headers.column.${column.id}`
|
|
877
|
-
}), /*#__PURE__*/React.createElement(CellHeader, {
|
|
866
|
+
}), /*#__PURE__*/React$1.createElement(CellHeader, {
|
|
878
867
|
column: column
|
|
879
|
-
})))))), !isLoading ? /*#__PURE__*/React.createElement("tbody", tableInstance.getTableBodyProps(), tableInstance.page.map((row, index) => {
|
|
868
|
+
})))))), !isLoading ? /*#__PURE__*/React$1.createElement("tbody", tableInstance.getTableBodyProps(), tableInstance.page.map((row, index) => {
|
|
880
869
|
tableInstance.prepareRow(row);
|
|
881
|
-
return /*#__PURE__*/React.createElement(Row, {
|
|
870
|
+
return /*#__PURE__*/React$1.createElement(Row, {
|
|
882
871
|
index: index,
|
|
883
872
|
enableDragNDrop: enableDragNDrop,
|
|
884
873
|
onClick: onClick,
|
|
@@ -887,9 +876,9 @@ function Table(props) {
|
|
|
887
876
|
onDrag: onDrag,
|
|
888
877
|
onDrop: onDrop
|
|
889
878
|
});
|
|
890
|
-
})) : null), isLoading ? /*#__PURE__*/React.createElement(Loader, null) : null, !data.length ? /*#__PURE__*/React.createElement(EmptyData, null) : null, !isLoading && data.length && !disablePagination ? /*#__PURE__*/React.createElement("div", {
|
|
879
|
+
})) : null), isLoading ? /*#__PURE__*/React$1.createElement(Loader, null) : null, !data.length ? /*#__PURE__*/React$1.createElement(EmptyData, null) : null, !isLoading && data.length && !disablePagination ? /*#__PURE__*/React$1.createElement("div", {
|
|
891
880
|
className: "overflow-hidden"
|
|
892
|
-
}, /*#__PURE__*/React.createElement(Pagination, _extends({}, tableInstance, {
|
|
881
|
+
}, /*#__PURE__*/React$1.createElement(Pagination, _extends({}, tableInstance, {
|
|
893
882
|
totalLength: totalLength,
|
|
894
883
|
className: "text-sm",
|
|
895
884
|
pageIndex: pageIndex,
|
|
@@ -918,13 +907,14 @@ function ActionsTable(_ref) {
|
|
|
918
907
|
accessor: "title",
|
|
919
908
|
id: "title"
|
|
920
909
|
}];
|
|
921
|
-
return /*#__PURE__*/React.createElement(Table, _extends({}, props, {
|
|
910
|
+
return /*#__PURE__*/React$1.createElement(Table, _extends({}, props, {
|
|
922
911
|
disableFilters: disableFilters,
|
|
923
912
|
disablePagination: disablePagination,
|
|
924
913
|
columns: columns
|
|
925
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
914
|
+
}), /*#__PURE__*/React$1.createElement("div", {
|
|
926
915
|
className: "pagination-group"
|
|
927
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
916
|
+
}, /*#__PURE__*/React$1.createElement(Select, {
|
|
917
|
+
"data-testid": "action-table-select",
|
|
928
918
|
name: "actions",
|
|
929
919
|
value: currentAction,
|
|
930
920
|
choices: [{
|
|
@@ -932,15 +922,15 @@ function ActionsTable(_ref) {
|
|
|
932
922
|
value: ""
|
|
933
923
|
}].concat(availableActions),
|
|
934
924
|
onChange: (name, action) => setAction(action)
|
|
935
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
925
|
+
}), /*#__PURE__*/React$1.createElement("div", {
|
|
936
926
|
className: "pl-3"
|
|
937
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
938
|
-
"data-testid": "
|
|
927
|
+
}, /*#__PURE__*/React$1.createElement("button", {
|
|
928
|
+
"data-testid": "action-table-add",
|
|
939
929
|
disabled: currentAction === "",
|
|
940
930
|
className: "btn btn-success",
|
|
941
931
|
onClick: () => currentAction && onAddAction(currentAction),
|
|
942
932
|
type: "submit"
|
|
943
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
933
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
944
934
|
className: classnames(iconClass(undefined, "plus"), "mr-1")
|
|
945
935
|
}), " ", i18n("Add action")))));
|
|
946
936
|
}
|
|
@@ -955,9 +945,9 @@ function formatError(error) {
|
|
|
955
945
|
if (Object.prototype.hasOwnProperty.call(error, "errors")) {
|
|
956
946
|
return Object.keys(error.errors).map((key, index) => {
|
|
957
947
|
const item = error.errors[key];
|
|
958
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
948
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
959
949
|
key: index
|
|
960
|
-
}, /*#__PURE__*/React.createElement("strong", null, item.name, " (", item.path, ")"), " ", "- ", item.message);
|
|
950
|
+
}, /*#__PURE__*/React$1.createElement("strong", null, item.name, " (", item.path, ")"), " ", "- ", item.message);
|
|
961
951
|
});
|
|
962
952
|
}
|
|
963
953
|
// If this is a standard error.
|
|
@@ -967,7 +957,7 @@ function formatError(error) {
|
|
|
967
957
|
// If this is a joy validation error.
|
|
968
958
|
if (Object.prototype.hasOwnProperty.call(error, "name") && error.name === "ValidationError") {
|
|
969
959
|
return error.details.map((item, index) => {
|
|
970
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
960
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
971
961
|
key: index
|
|
972
962
|
}, item.message);
|
|
973
963
|
});
|
|
@@ -985,7 +975,7 @@ function Alert({
|
|
|
985
975
|
if (!error || Array.isArray(error) && !error.length) {
|
|
986
976
|
return null;
|
|
987
977
|
}
|
|
988
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
978
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
989
979
|
className: `alert alert-${type}`,
|
|
990
980
|
role: "alert"
|
|
991
981
|
}, formatError(error));
|
|
@@ -996,13 +986,13 @@ function Card({
|
|
|
996
986
|
label,
|
|
997
987
|
className
|
|
998
988
|
}) {
|
|
999
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
989
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
1000
990
|
className: classnames("card", className)
|
|
1001
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
991
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
1002
992
|
className: "card-header "
|
|
1003
|
-
}, /*#__PURE__*/React.createElement("h4", {
|
|
993
|
+
}, /*#__PURE__*/React$1.createElement("h4", {
|
|
1004
994
|
className: "card-title"
|
|
1005
|
-
}, label)), /*#__PURE__*/React.createElement("div", {
|
|
995
|
+
}, label)), /*#__PURE__*/React$1.createElement("div", {
|
|
1006
996
|
className: "card-body",
|
|
1007
997
|
role: "article"
|
|
1008
998
|
}, children));
|
|
@@ -1158,7 +1148,7 @@ function Form(props) {
|
|
|
1158
1148
|
const {
|
|
1159
1149
|
element
|
|
1160
1150
|
} = useForm(props);
|
|
1161
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1151
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
1162
1152
|
"data-testid": `formioContainer${props.name || ""}`,
|
|
1163
1153
|
ref: element,
|
|
1164
1154
|
className: props.className
|
|
@@ -1458,7 +1448,7 @@ function NamedFormAccess({
|
|
|
1458
1448
|
children
|
|
1459
1449
|
}) {
|
|
1460
1450
|
const [isValid, setIsValid] = useState(true);
|
|
1461
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form, {
|
|
1451
|
+
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(Form, {
|
|
1462
1452
|
name: name,
|
|
1463
1453
|
form: form[name],
|
|
1464
1454
|
submission: submissions[name],
|
|
@@ -1472,11 +1462,11 @@ function NamedFormAccess({
|
|
|
1472
1462
|
setIsValid(isValid);
|
|
1473
1463
|
},
|
|
1474
1464
|
options: options
|
|
1475
|
-
}), /*#__PURE__*/React.createElement("button", {
|
|
1465
|
+
}), /*#__PURE__*/React$1.createElement("button", {
|
|
1476
1466
|
disabled: !isValid,
|
|
1477
1467
|
className: "mt-5 btn btn-primary",
|
|
1478
1468
|
onClick: onSubmit
|
|
1479
|
-
}, "Save access"), children, /*#__PURE__*/React.createElement("div", {
|
|
1469
|
+
}, "Save access"), children, /*#__PURE__*/React$1.createElement("div", {
|
|
1480
1470
|
className: "alert alert-warning mt-5"
|
|
1481
1471
|
}, "Elevated permissions allow users to access and modify other user's entities. Assign with caution."));
|
|
1482
1472
|
}
|
|
@@ -1489,52 +1479,44 @@ function FormAccess(props) {
|
|
|
1489
1479
|
onChange,
|
|
1490
1480
|
onSubmit
|
|
1491
1481
|
} = useFormAccess(props);
|
|
1492
|
-
return /*#__PURE__*/React.createElement("div", null, props.children, /*#__PURE__*/React.createElement("div", {
|
|
1482
|
+
return /*#__PURE__*/React$1.createElement("div", null, props.children, /*#__PURE__*/React$1.createElement("div", {
|
|
1493
1483
|
className: "flex mb-5"
|
|
1494
|
-
}, /*#__PURE__*/React.createElement(Card, {
|
|
1484
|
+
}, /*#__PURE__*/React$1.createElement(Card, {
|
|
1495
1485
|
label: "Manage submission access",
|
|
1496
1486
|
className: "flex-1"
|
|
1497
|
-
}, /*#__PURE__*/React.createElement(NamedFormAccess, {
|
|
1487
|
+
}, /*#__PURE__*/React$1.createElement(NamedFormAccess, {
|
|
1498
1488
|
name: "submissionAccess",
|
|
1499
1489
|
form: form,
|
|
1500
1490
|
submissions: submissions,
|
|
1501
1491
|
onChange: onChange,
|
|
1502
1492
|
onSubmit: onSubmit,
|
|
1503
1493
|
options: options
|
|
1504
|
-
}, props.children)), /*#__PURE__*/React.createElement("div", {
|
|
1494
|
+
}, props.children)), /*#__PURE__*/React$1.createElement("div", {
|
|
1505
1495
|
className: "w-1/4 pl-4"
|
|
1506
|
-
}, /*#__PURE__*/React.createElement(Card, {
|
|
1496
|
+
}, /*#__PURE__*/React$1.createElement(Card, {
|
|
1507
1497
|
label: "About Submission Data Permissions"
|
|
1508
|
-
}, /*#__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", {
|
|
1498
|
+
}, /*#__PURE__*/React$1.createElement("p", null, "Submission Data Permissions allow you to control who can create, view, and modify form submission data."), /*#__PURE__*/React$1.createElement("ul", {
|
|
1509
1499
|
className: "mt-5 pl-7 list-disc"
|
|
1510
|
-
}, /*#__PURE__*/React.createElement("li", {
|
|
1500
|
+
}, /*#__PURE__*/React$1.createElement("li", {
|
|
1511
1501
|
className: "pb-2"
|
|
1512
|
-
}, /*#__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", {
|
|
1502
|
+
}, /*#__PURE__*/React$1.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$1.createElement("li", null, /*#__PURE__*/React$1.createElement("strong", null, "All Permissions"), " - These permissions apply to all submission data regardless of who owns it."))))), /*#__PURE__*/React$1.createElement("div", {
|
|
1513
1503
|
className: "flex mb-5"
|
|
1514
|
-
}, /*#__PURE__*/React.createElement(Card, {
|
|
1504
|
+
}, /*#__PURE__*/React$1.createElement(Card, {
|
|
1515
1505
|
label: `Manage ${type} definition access`,
|
|
1516
1506
|
className: "flex-1"
|
|
1517
|
-
}, /*#__PURE__*/React.createElement(NamedFormAccess, {
|
|
1507
|
+
}, /*#__PURE__*/React$1.createElement(NamedFormAccess, {
|
|
1518
1508
|
name: "access",
|
|
1519
1509
|
form: form,
|
|
1520
1510
|
submissions: submissions,
|
|
1521
1511
|
onChange: onChange,
|
|
1522
1512
|
onSubmit: onSubmit,
|
|
1523
1513
|
options: options
|
|
1524
|
-
}, props.children)), /*#__PURE__*/React.createElement("div", {
|
|
1514
|
+
}, props.children)), /*#__PURE__*/React$1.createElement("div", {
|
|
1525
1515
|
className: "w-1/4 pl-4"
|
|
1526
|
-
}, /*#__PURE__*/React.createElement(Card, {
|
|
1516
|
+
}, /*#__PURE__*/React$1.createElement(Card, {
|
|
1527
1517
|
label: "About Form Definition Access"
|
|
1528
|
-
}, /*#__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.")))));
|
|
1518
|
+
}, /*#__PURE__*/React$1.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$1.createElement("p", null, "Typically you will want to allow all of your roles to be able to Read the form definition."), /*#__PURE__*/React$1.createElement("p", null, "Each form also has an owner at ", /*#__PURE__*/React$1.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.")))));
|
|
1529
1519
|
}
|
|
1530
|
-
FormAccess.propTypes = {
|
|
1531
|
-
type: PropTypes.string.isRequired,
|
|
1532
|
-
form: PropTypes.object,
|
|
1533
|
-
roles: PropTypes.any,
|
|
1534
|
-
children: PropTypes.any,
|
|
1535
|
-
options: PropTypes.any,
|
|
1536
|
-
onSubmit: PropTypes.func
|
|
1537
|
-
};
|
|
1538
1520
|
|
|
1539
1521
|
const _excluded$6 = ["action"],
|
|
1540
1522
|
_excluded2 = ["actionInfo", "children", "onSubmit", "options"];
|
|
@@ -1580,7 +1562,7 @@ function FormAction(_ref2) {
|
|
|
1580
1562
|
}
|
|
1581
1563
|
};
|
|
1582
1564
|
})();
|
|
1583
|
-
return /*#__PURE__*/React.createElement("div", null, children, /*#__PURE__*/React.createElement(Form, {
|
|
1565
|
+
return /*#__PURE__*/React$1.createElement("div", null, children, /*#__PURE__*/React$1.createElement(Form, {
|
|
1584
1566
|
form: form,
|
|
1585
1567
|
submission: submission,
|
|
1586
1568
|
onSubmit: onSubmit,
|
|
@@ -1618,7 +1600,7 @@ async function createBuilder(el, {
|
|
|
1618
1600
|
console.error(er);
|
|
1619
1601
|
}
|
|
1620
1602
|
}
|
|
1621
|
-
class FormBuilder extends React.Component {
|
|
1603
|
+
class FormBuilder extends React$1.Component {
|
|
1622
1604
|
constructor(props) {
|
|
1623
1605
|
super(props);
|
|
1624
1606
|
this.elRef = void 0;
|
|
@@ -1696,12 +1678,12 @@ class FormBuilder extends React.Component {
|
|
|
1696
1678
|
});
|
|
1697
1679
|
}
|
|
1698
1680
|
render() {
|
|
1699
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1681
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
1700
1682
|
ref: ref => {
|
|
1701
1683
|
this.elRef = ref;
|
|
1702
1684
|
},
|
|
1703
1685
|
onClick: e => e.stopPropagation()
|
|
1704
|
-
}, /*#__PURE__*/React.createElement("div", null));
|
|
1686
|
+
}, /*#__PURE__*/React$1.createElement("div", null));
|
|
1705
1687
|
}
|
|
1706
1688
|
}
|
|
1707
1689
|
FormBuilder.defaultProps = {
|
|
@@ -1770,37 +1752,37 @@ function FormEditCTAs({
|
|
|
1770
1752
|
placement: "top",
|
|
1771
1753
|
title: t("Reset all changes")
|
|
1772
1754
|
});
|
|
1773
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1755
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
1774
1756
|
className: "form-edit__actions"
|
|
1775
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
|
|
1757
|
+
}, /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement("button", {
|
|
1776
1758
|
className: `btn btn-primary btn-save flex ${disabled ? "disabled" : ""}`,
|
|
1777
1759
|
disabled: disabled,
|
|
1778
1760
|
onClick: () => !disabled && onSubmit && onSubmit()
|
|
1779
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
1761
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
1780
1762
|
className: `mr-1 ${iconClass(options.iconset, "save")}`
|
|
1781
|
-
}), saveText), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
|
|
1763
|
+
}), saveText), /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement("button", {
|
|
1782
1764
|
className: `btn btn-light btn-undo ${hasUndo ? "" : "disabled"}`,
|
|
1783
1765
|
onClick: () => onUndo && onUndo(),
|
|
1784
1766
|
ref: undoTooltipRef
|
|
1785
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
1767
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
1786
1768
|
className: iconClass(options.iconset, "undo")
|
|
1787
|
-
})), /*#__PURE__*/React.createElement("button", {
|
|
1769
|
+
})), /*#__PURE__*/React$1.createElement("button", {
|
|
1788
1770
|
className: `btn btn-light btn-redo ${hasRedo ? "" : "disabled"}`,
|
|
1789
1771
|
onClick: () => onRedo && onRedo(),
|
|
1790
1772
|
ref: redoTooltipRef
|
|
1791
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
1773
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
1792
1774
|
className: iconClass(options.iconset, "redo")
|
|
1793
|
-
}))), /*#__PURE__*/React.createElement("div", null, onCopy && /*#__PURE__*/React.createElement("button", {
|
|
1775
|
+
}))), /*#__PURE__*/React$1.createElement("div", null, onCopy && /*#__PURE__*/React$1.createElement("button", {
|
|
1794
1776
|
className: "btn btn-light",
|
|
1795
1777
|
onClick: () => onCopy(),
|
|
1796
1778
|
ref: copyTooltipRef
|
|
1797
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
1779
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
1798
1780
|
className: iconClass(options.iconset, "copy")
|
|
1799
|
-
})), /*#__PURE__*/React.createElement("button", {
|
|
1781
|
+
})), /*#__PURE__*/React$1.createElement("button", {
|
|
1800
1782
|
className: `btn btn-light btn-reset`,
|
|
1801
1783
|
onClick: () => onReset && onReset(),
|
|
1802
1784
|
ref: resetTooltipRef
|
|
1803
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
1785
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
1804
1786
|
className: iconClass(options.iconset, "reset")
|
|
1805
1787
|
})))));
|
|
1806
1788
|
}
|
|
@@ -1846,14 +1828,14 @@ function InputTags(_ref) {
|
|
|
1846
1828
|
instance.destroy();
|
|
1847
1829
|
};
|
|
1848
1830
|
}, []);
|
|
1849
|
-
return /*#__PURE__*/React.createElement(FormControl, {
|
|
1831
|
+
return /*#__PURE__*/React$1.createElement(FormControl, {
|
|
1850
1832
|
name: name,
|
|
1851
1833
|
label: label,
|
|
1852
1834
|
required: required,
|
|
1853
1835
|
description: description,
|
|
1854
1836
|
prefix: prefix,
|
|
1855
1837
|
suffix: suffix
|
|
1856
|
-
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
1838
|
+
}, /*#__PURE__*/React$1.createElement("input", _extends({
|
|
1857
1839
|
ref: ref,
|
|
1858
1840
|
type: "text"
|
|
1859
1841
|
}, props, {
|
|
@@ -1890,11 +1872,11 @@ function FormParameters({
|
|
|
1890
1872
|
baseUrl = window.location.origin
|
|
1891
1873
|
}) {
|
|
1892
1874
|
const hasTypeChoices = typeChoices && typeChoices.length > 1;
|
|
1893
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1875
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
1894
1876
|
className: `form-edit__settings ${className}`
|
|
1895
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1877
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
1896
1878
|
className: "w-1/3"
|
|
1897
|
-
}, /*#__PURE__*/React.createElement(InputText, {
|
|
1879
|
+
}, /*#__PURE__*/React$1.createElement(InputText, {
|
|
1898
1880
|
label: "Title",
|
|
1899
1881
|
placeholder: "Enter the form title",
|
|
1900
1882
|
name: "title",
|
|
@@ -1902,9 +1884,9 @@ function FormParameters({
|
|
|
1902
1884
|
value: form.title,
|
|
1903
1885
|
disabled: !!readonly["title"],
|
|
1904
1886
|
onChange: onChange
|
|
1905
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
1887
|
+
})), /*#__PURE__*/React$1.createElement("div", {
|
|
1906
1888
|
className: "w-1/3"
|
|
1907
|
-
}, /*#__PURE__*/React.createElement(InputText, {
|
|
1889
|
+
}, /*#__PURE__*/React$1.createElement(InputText, {
|
|
1908
1890
|
label: "Name",
|
|
1909
1891
|
placeholder: "Enter the form machine name",
|
|
1910
1892
|
name: "name",
|
|
@@ -1912,16 +1894,16 @@ function FormParameters({
|
|
|
1912
1894
|
disabled: !!readonly["name"],
|
|
1913
1895
|
value: form.name,
|
|
1914
1896
|
onChange: onChange
|
|
1915
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
1897
|
+
})), /*#__PURE__*/React$1.createElement("div", {
|
|
1916
1898
|
className: "w-1/3"
|
|
1917
|
-
}, /*#__PURE__*/React.createElement(InputText, {
|
|
1899
|
+
}, /*#__PURE__*/React$1.createElement(InputText, {
|
|
1918
1900
|
label: "Path",
|
|
1919
1901
|
placeholder: "example",
|
|
1920
1902
|
name: "path",
|
|
1921
1903
|
className: "mb-0",
|
|
1922
|
-
description: /*#__PURE__*/React.createElement("span", {
|
|
1904
|
+
description: /*#__PURE__*/React$1.createElement("span", {
|
|
1923
1905
|
className: "text-xxs flex items-center"
|
|
1924
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
1906
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
1925
1907
|
className: "bx bx-link ml-1 mr-1"
|
|
1926
1908
|
}), `${baseUrl}/${form.path}`),
|
|
1927
1909
|
required: true,
|
|
@@ -1932,26 +1914,26 @@ function FormParameters({
|
|
|
1932
1914
|
width: "120px"
|
|
1933
1915
|
},
|
|
1934
1916
|
onChange: onChange
|
|
1935
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
1917
|
+
})), /*#__PURE__*/React$1.createElement("div", {
|
|
1936
1918
|
className: "w-1/3"
|
|
1937
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
1919
|
+
}, /*#__PURE__*/React$1.createElement(Select, {
|
|
1938
1920
|
label: "Display as",
|
|
1939
1921
|
name: "display",
|
|
1940
1922
|
disabled: !!readonly["display"],
|
|
1941
1923
|
value: form.display,
|
|
1942
1924
|
choices: displayChoices,
|
|
1943
1925
|
onChange: onChange
|
|
1944
|
-
})), hasTypeChoices && /*#__PURE__*/React.createElement("div", {
|
|
1926
|
+
})), hasTypeChoices && /*#__PURE__*/React$1.createElement("div", {
|
|
1945
1927
|
className: "w-1/3"
|
|
1946
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
1928
|
+
}, /*#__PURE__*/React$1.createElement(Select, {
|
|
1947
1929
|
label: "Type",
|
|
1948
1930
|
name: "type",
|
|
1949
1931
|
value: form.type,
|
|
1950
1932
|
choices: typeChoices,
|
|
1951
1933
|
onChange: onChange
|
|
1952
|
-
})), enableTags && /*#__PURE__*/React.createElement("div", {
|
|
1934
|
+
})), enableTags && /*#__PURE__*/React$1.createElement("div", {
|
|
1953
1935
|
className: "w-1/3"
|
|
1954
|
-
}, /*#__PURE__*/React.createElement(InputTags, {
|
|
1936
|
+
}, /*#__PURE__*/React$1.createElement(InputTags, {
|
|
1955
1937
|
label: "Tags",
|
|
1956
1938
|
name: "tags",
|
|
1957
1939
|
value: form.tags,
|
|
@@ -2118,14 +2100,14 @@ function FormEdit(props) {
|
|
|
2118
2100
|
options = {},
|
|
2119
2101
|
builder
|
|
2120
2102
|
} = props;
|
|
2121
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
2103
|
+
return /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement("div", {
|
|
2122
2104
|
className: "form-edit"
|
|
2123
|
-
}, /*#__PURE__*/React.createElement(FormParameters, _extends({}, props, {
|
|
2105
|
+
}, /*#__PURE__*/React$1.createElement(FormParameters, _extends({}, props, {
|
|
2124
2106
|
className: "",
|
|
2125
2107
|
key: `form-settings-${form._id}`,
|
|
2126
2108
|
form: form,
|
|
2127
2109
|
onChange: setChange
|
|
2128
|
-
})), /*#__PURE__*/React.createElement(FormEditCTAs, _extends({}, props, {
|
|
2110
|
+
})), /*#__PURE__*/React$1.createElement(FormEditCTAs, _extends({}, props, {
|
|
2129
2111
|
className: "",
|
|
2130
2112
|
key: `form-edit-ctas-${form._id}`,
|
|
2131
2113
|
options: options,
|
|
@@ -2137,7 +2119,7 @@ function FormEdit(props) {
|
|
|
2137
2119
|
onReset: reset,
|
|
2138
2120
|
onCopy: onCopy,
|
|
2139
2121
|
onSubmit: onSubmit
|
|
2140
|
-
}))), /*#__PURE__*/React.createElement(FormBuilder, {
|
|
2122
|
+
}))), /*#__PURE__*/React$1.createElement(FormBuilder, {
|
|
2141
2123
|
key: `form-builder-${form._id}`,
|
|
2142
2124
|
components: form.components,
|
|
2143
2125
|
display: form.display,
|
|
@@ -2279,12 +2261,12 @@ function FormSettings(props) {
|
|
|
2279
2261
|
isValid
|
|
2280
2262
|
} = useFormSettings(props);
|
|
2281
2263
|
const i18n = options.i18n || (f => f);
|
|
2282
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form, {
|
|
2264
|
+
return /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement(Form, {
|
|
2283
2265
|
form: form,
|
|
2284
2266
|
submission: submission,
|
|
2285
2267
|
onChange: onChange,
|
|
2286
2268
|
options: options
|
|
2287
|
-
}), /*#__PURE__*/React.createElement("button", {
|
|
2269
|
+
}), /*#__PURE__*/React$1.createElement("button", {
|
|
2288
2270
|
"data-testid": "submit",
|
|
2289
2271
|
disabled: !isValid,
|
|
2290
2272
|
className: "mt-5 btn btn-primary",
|
|
@@ -2338,7 +2320,7 @@ function SelectColumnFilter(props) {
|
|
|
2338
2320
|
choices,
|
|
2339
2321
|
onChange
|
|
2340
2322
|
} = useSelectColumnFilter(props);
|
|
2341
|
-
return /*#__PURE__*/React.createElement(Select, {
|
|
2323
|
+
return /*#__PURE__*/React$1.createElement(Select, {
|
|
2342
2324
|
key: `filter-${props.column.id}`,
|
|
2343
2325
|
name: `filter-${props.column.id}`,
|
|
2344
2326
|
size: "sm",
|
|
@@ -6886,30 +6868,30 @@ function FormsCell(props) {
|
|
|
6886
6868
|
original: form
|
|
6887
6869
|
}
|
|
6888
6870
|
} = props;
|
|
6889
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
6871
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
6890
6872
|
className: "p-1"
|
|
6891
|
-
}, /*#__PURE__*/React.createElement("h4", {
|
|
6873
|
+
}, /*#__PURE__*/React$1.createElement("h4", {
|
|
6892
6874
|
className: "text-primary text-lg flex items-center"
|
|
6893
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
6875
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
6894
6876
|
className: classnames(iconClass(undefined, icon), "mr-1")
|
|
6895
|
-
}), form.title), /*#__PURE__*/React.createElement("ul", {
|
|
6877
|
+
}), form.title), /*#__PURE__*/React$1.createElement("ul", {
|
|
6896
6878
|
className: "reset-list text-gray-500"
|
|
6897
|
-
}, /*#__PURE__*/React.createElement("li", {
|
|
6879
|
+
}, /*#__PURE__*/React$1.createElement("li", {
|
|
6898
6880
|
className: "text-sm"
|
|
6899
|
-
}, "Name: ", form.name || form.machineName), /*#__PURE__*/React.createElement("li", {
|
|
6881
|
+
}, "Name: ", form.name || form.machineName), /*#__PURE__*/React$1.createElement("li", {
|
|
6900
6882
|
className: "mt-5"
|
|
6901
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
6883
|
+
}, /*#__PURE__*/React$1.createElement("span", {
|
|
6902
6884
|
className: "badge bg-light mr-1"
|
|
6903
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
6885
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
6904
6886
|
className: classnames(iconClass(undefined, "history"), "mr-1")
|
|
6905
|
-
}), /*#__PURE__*/React.createElement("span", null, "Updated ", moment(form.modified).fromNow())), (form.tags || []).map((tag, index) => /*#__PURE__*/React.createElement("button", {
|
|
6887
|
+
}), /*#__PURE__*/React$1.createElement("span", null, "Updated ", moment(form.modified).fromNow())), (form.tags || []).map((tag, index) => /*#__PURE__*/React$1.createElement("button", {
|
|
6906
6888
|
key: index,
|
|
6907
6889
|
className: "badge badge-hover bg-secondary mr-1",
|
|
6908
6890
|
onClick: stopPropagationWrapper(() => {
|
|
6909
6891
|
props.setFilter("tags", tag);
|
|
6910
6892
|
props.gotoPage(0);
|
|
6911
6893
|
})
|
|
6912
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
6894
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
6913
6895
|
className: classnames(iconClass(undefined, "tags"), "mr-1")
|
|
6914
6896
|
}), tag)))));
|
|
6915
6897
|
}
|
|
@@ -6929,7 +6911,7 @@ function FormsTable(_ref) {
|
|
|
6929
6911
|
Header: i18n("Title"),
|
|
6930
6912
|
accessor: "title",
|
|
6931
6913
|
id: "title",
|
|
6932
|
-
Cell: props => /*#__PURE__*/React.createElement(FormCell, _extends({}, props, {
|
|
6914
|
+
Cell: props => /*#__PURE__*/React$1.createElement(FormCell, _extends({}, props, {
|
|
6933
6915
|
icon: props.icon,
|
|
6934
6916
|
i18n: i18n
|
|
6935
6917
|
})),
|
|
@@ -6940,13 +6922,13 @@ function FormsTable(_ref) {
|
|
|
6940
6922
|
accessor: "tags",
|
|
6941
6923
|
id: "tags",
|
|
6942
6924
|
hidden: true,
|
|
6943
|
-
Filter: props => tags && tags.length ? /*#__PURE__*/React.createElement(SelectColumnFilter, _extends({}, props, {
|
|
6925
|
+
Filter: props => tags && tags.length ? /*#__PURE__*/React$1.createElement(SelectColumnFilter, _extends({}, props, {
|
|
6944
6926
|
column: _extends({}, props.columns, {
|
|
6945
6927
|
choices: tags
|
|
6946
6928
|
})
|
|
6947
|
-
})) : /*#__PURE__*/React.createElement(DefaultColumnFilter, props)
|
|
6929
|
+
})) : /*#__PURE__*/React$1.createElement(DefaultColumnFilter, props)
|
|
6948
6930
|
}];
|
|
6949
|
-
return /*#__PURE__*/React.createElement(Table, _extends({}, props, {
|
|
6931
|
+
return /*#__PURE__*/React$1.createElement(Table, _extends({}, props, {
|
|
6950
6932
|
columns: columns
|
|
6951
6933
|
}));
|
|
6952
6934
|
}
|
|
@@ -6958,9 +6940,9 @@ function Loader({
|
|
|
6958
6940
|
className = ""
|
|
6959
6941
|
}) {
|
|
6960
6942
|
if (isActive) {
|
|
6961
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
6943
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
6962
6944
|
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)
|
|
6963
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
6945
|
+
}, /*#__PURE__*/React$1.createElement("span", {
|
|
6964
6946
|
"data-testid": `icon_${icon}`,
|
|
6965
6947
|
color: color,
|
|
6966
6948
|
className: `text-11xl ${iconClass(undefined, icon, true)}`
|
|
@@ -7020,35 +7002,35 @@ function Modal(_ref) {
|
|
|
7020
7002
|
if (!show) {
|
|
7021
7003
|
return null;
|
|
7022
7004
|
}
|
|
7023
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7005
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
7024
7006
|
role: "dialog",
|
|
7025
7007
|
className: `formio-dialog formio-dialog-theme-default ${className}`
|
|
7026
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
7008
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
7027
7009
|
className: "formio-dialog-overlay",
|
|
7028
7010
|
onClick: onClickClose
|
|
7029
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
7011
|
+
}), /*#__PURE__*/React$1.createElement("div", {
|
|
7030
7012
|
style: style,
|
|
7031
7013
|
className: "formio-dialog-content"
|
|
7032
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
7014
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
7033
7015
|
className: "formio-dialog-wrapper"
|
|
7034
|
-
}, title ? /*#__PURE__*/React.createElement("div", {
|
|
7016
|
+
}, title ? /*#__PURE__*/React$1.createElement("div", {
|
|
7035
7017
|
className: "formio-dialog-title",
|
|
7036
7018
|
ref: titleRef,
|
|
7037
7019
|
"data-testid": "modalTitle"
|
|
7038
|
-
}, title) : null, /*#__PURE__*/React.createElement("div", {
|
|
7020
|
+
}, title) : null, /*#__PURE__*/React$1.createElement("div", {
|
|
7039
7021
|
className: "formio-dialog-body",
|
|
7040
7022
|
style: {
|
|
7041
7023
|
maxHeight
|
|
7042
7024
|
},
|
|
7043
7025
|
"data-testid": "modalBody"
|
|
7044
|
-
}, show && children), ModalFooter ? /*#__PURE__*/React.createElement("div", {
|
|
7026
|
+
}, show && children), ModalFooter ? /*#__PURE__*/React$1.createElement("div", {
|
|
7045
7027
|
className: "formio-dialog-footer",
|
|
7046
7028
|
ref: footerRef,
|
|
7047
7029
|
"data-testid": "modalFooter"
|
|
7048
|
-
}, /*#__PURE__*/React.createElement(ModalFooter, _extends({}, props, {
|
|
7030
|
+
}, /*#__PURE__*/React$1.createElement(ModalFooter, _extends({}, props, {
|
|
7049
7031
|
closeModal: closeModal,
|
|
7050
7032
|
onClose: onClickClose
|
|
7051
|
-
}))) : null), /*#__PURE__*/React.createElement("button", {
|
|
7033
|
+
}))) : null), /*#__PURE__*/React$1.createElement("button", {
|
|
7052
7034
|
className: "formio-dialog-close float-right btn btn-secondary btn-sm",
|
|
7053
7035
|
"aria-label": "close",
|
|
7054
7036
|
"data-testid": "closeModal",
|
|
@@ -7064,13 +7046,13 @@ function RemoveModalFooter({
|
|
|
7064
7046
|
onClose,
|
|
7065
7047
|
i18n = f => f
|
|
7066
7048
|
}) {
|
|
7067
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7049
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
7068
7050
|
className: "flex items-center justify-center bg-white p-2"
|
|
7069
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
7051
|
+
}, /*#__PURE__*/React$1.createElement("button", {
|
|
7070
7052
|
"data-testid": "customCloseModal",
|
|
7071
7053
|
className: "btn btn-outline-dark mx-2",
|
|
7072
7054
|
onClick: onClose
|
|
7073
|
-
}, i18n("Cancel")), /*#__PURE__*/React.createElement("button", {
|
|
7055
|
+
}, i18n("Cancel")), /*#__PURE__*/React$1.createElement("button", {
|
|
7074
7056
|
disabled: valueToCompare !== value,
|
|
7075
7057
|
"data-testid": "customSubmitModal",
|
|
7076
7058
|
className: "btn btn-danger mx-2",
|
|
@@ -7079,7 +7061,7 @@ function RemoveModalFooter({
|
|
|
7079
7061
|
onSubmit(e);
|
|
7080
7062
|
}
|
|
7081
7063
|
}
|
|
7082
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
7064
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
7083
7065
|
className: classnames(iconClass(undefined, "trash"), "mr-2")
|
|
7084
7066
|
}), i18n("Remove")));
|
|
7085
7067
|
}
|
|
@@ -7094,7 +7076,7 @@ function RemoveModal(_ref) {
|
|
|
7094
7076
|
i18n = f => f
|
|
7095
7077
|
} = props;
|
|
7096
7078
|
const [value, setValue] = useState();
|
|
7097
|
-
return /*#__PURE__*/React.createElement(Modal, _extends({}, props, {
|
|
7079
|
+
return /*#__PURE__*/React$1.createElement(Modal, _extends({}, props, {
|
|
7098
7080
|
className: classnames(props.className, "formio-dialog-theme-remove"),
|
|
7099
7081
|
style: {
|
|
7100
7082
|
maxWidth
|
|
@@ -7102,11 +7084,11 @@ function RemoveModal(_ref) {
|
|
|
7102
7084
|
title: `Drop ${(_props$itemType = props.itemType) == null ? void 0 : _props$itemType.toLowerCase()}`,
|
|
7103
7085
|
value: value,
|
|
7104
7086
|
footer: RemoveModalFooter
|
|
7105
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
7087
|
+
}), /*#__PURE__*/React$1.createElement("div", {
|
|
7106
7088
|
className: "px-4 pt-3 pb-5"
|
|
7107
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
7089
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
7108
7090
|
className: "pb-1"
|
|
7109
|
-
}, 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, {
|
|
7091
|
+
}, children, i18n("To drop"), " ", /*#__PURE__*/React$1.createElement("strong", null, props.valueToCompare), ",\xA0", i18n("type the"), "\xA0", /*#__PURE__*/React$1.createElement("strong", null, "\"", (_props$itemType2 = props.itemType) == null ? void 0 : _props$itemType2.toLowerCase(), "\""), "\xA0", i18n("name"), " ", /*#__PURE__*/React$1.createElement("strong", null, "\"", props.valueToCompare, "\""), "."), /*#__PURE__*/React$1.createElement(InputText, {
|
|
7110
7092
|
name: "remove",
|
|
7111
7093
|
value: value,
|
|
7112
7094
|
onChange: (name, value) => setValue(value)
|
|
@@ -7285,17 +7267,17 @@ function DefaultCell({
|
|
|
7285
7267
|
render = f => f
|
|
7286
7268
|
}) {
|
|
7287
7269
|
if (value === undefined) {
|
|
7288
|
-
return /*#__PURE__*/React.createElement("span", null);
|
|
7270
|
+
return /*#__PURE__*/React$1.createElement("span", null);
|
|
7289
7271
|
}
|
|
7290
7272
|
const rendered = render(value);
|
|
7291
7273
|
if (value !== rendered) {
|
|
7292
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7274
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
7293
7275
|
dangerouslySetInnerHTML: {
|
|
7294
7276
|
__html: rendered
|
|
7295
7277
|
}
|
|
7296
7278
|
});
|
|
7297
7279
|
}
|
|
7298
|
-
return /*#__PURE__*/React.createElement("span", null, String(value));
|
|
7280
|
+
return /*#__PURE__*/React$1.createElement("span", null, String(value));
|
|
7299
7281
|
}
|
|
7300
7282
|
|
|
7301
7283
|
function mapFormToColumns(form) {
|
|
@@ -7307,7 +7289,7 @@ function mapFormToColumns(form) {
|
|
|
7307
7289
|
Header: component.label || component.title || component.key,
|
|
7308
7290
|
accessor: `data.${component.key}`,
|
|
7309
7291
|
className: "text-center",
|
|
7310
|
-
Cell: props => /*#__PURE__*/React.createElement(DefaultCell, _extends({}, props, {
|
|
7292
|
+
Cell: props => /*#__PURE__*/React$1.createElement(DefaultCell, _extends({}, props, {
|
|
7311
7293
|
render: value => cmp.asString(value)
|
|
7312
7294
|
}))
|
|
7313
7295
|
};
|
|
@@ -7328,7 +7310,7 @@ function SubmissionsTable(_ref) {
|
|
|
7328
7310
|
} = _ref,
|
|
7329
7311
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
7330
7312
|
const columns = form && mapFormToColumns(form);
|
|
7331
|
-
return /*#__PURE__*/React.createElement(Table, _extends({}, props, {
|
|
7313
|
+
return /*#__PURE__*/React$1.createElement(Table, _extends({}, props, {
|
|
7332
7314
|
columns: columns
|
|
7333
7315
|
}));
|
|
7334
7316
|
}
|
|
@@ -7341,7 +7323,7 @@ function SliderColumnFilter({
|
|
|
7341
7323
|
id
|
|
7342
7324
|
}
|
|
7343
7325
|
}) {
|
|
7344
|
-
const [min, max] = React.useMemo(() => {
|
|
7326
|
+
const [min, max] = React$1.useMemo(() => {
|
|
7345
7327
|
let min = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
|
|
7346
7328
|
let max = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
|
|
7347
7329
|
preFilteredRows.forEach(row => {
|
|
@@ -7350,7 +7332,7 @@ function SliderColumnFilter({
|
|
|
7350
7332
|
});
|
|
7351
7333
|
return [min, max];
|
|
7352
7334
|
}, [id, preFilteredRows]);
|
|
7353
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", {
|
|
7335
|
+
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("input", {
|
|
7354
7336
|
type: "range",
|
|
7355
7337
|
min: min,
|
|
7356
7338
|
max: max,
|
|
@@ -7358,7 +7340,7 @@ function SliderColumnFilter({
|
|
|
7358
7340
|
onChange: e => {
|
|
7359
7341
|
setFilter(parseInt(e.target.value, 10));
|
|
7360
7342
|
}
|
|
7361
|
-
}), /*#__PURE__*/React.createElement("button", {
|
|
7343
|
+
}), /*#__PURE__*/React$1.createElement("button", {
|
|
7362
7344
|
onClick: () => setFilter(undefined)
|
|
7363
7345
|
}, "Off"));
|
|
7364
7346
|
}
|
|
@@ -7374,18 +7356,18 @@ function ButtonTab({
|
|
|
7374
7356
|
className,
|
|
7375
7357
|
after
|
|
7376
7358
|
}) {
|
|
7377
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7359
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
7378
7360
|
title: "button-wrapper",
|
|
7379
7361
|
className: classnames("tw-tabs__button-wrapper", isActive ? "-active" : "", back ? "-back" : "", className)
|
|
7380
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
7362
|
+
}, /*#__PURE__*/React$1.createElement("button", {
|
|
7381
7363
|
title: "button-tab",
|
|
7382
7364
|
className: classnames("tw-tabs__button", reverse ? "-reverse" : "", isActive ? "-active" : "", back ? "-back" : ""),
|
|
7383
7365
|
onClick: onClick
|
|
7384
|
-
}, icon && /*#__PURE__*/React.createElement("i", {
|
|
7366
|
+
}, icon && /*#__PURE__*/React$1.createElement("i", {
|
|
7385
7367
|
className: classnames(iconClass(undefined, icon), "tw-tabs__button-icon")
|
|
7386
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
7368
|
+
}), /*#__PURE__*/React$1.createElement("span", {
|
|
7387
7369
|
className: "tw-tabs__button-label"
|
|
7388
|
-
}, children), after), /*#__PURE__*/React.createElement("div", {
|
|
7370
|
+
}, children), after), /*#__PURE__*/React$1.createElement("div", {
|
|
7389
7371
|
className: classnames("tw-tabs__button-border", isActive ? "-active" : "")
|
|
7390
7372
|
}));
|
|
7391
7373
|
}
|
|
@@ -7403,18 +7385,18 @@ function Tabs(_ref) {
|
|
|
7403
7385
|
i18n = f => f
|
|
7404
7386
|
} = _ref,
|
|
7405
7387
|
additionalProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
7406
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7388
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
7407
7389
|
"data-testid": "tabs-comp",
|
|
7408
7390
|
className: `tw-tabs ${className}`,
|
|
7409
7391
|
style: style
|
|
7410
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("nav", {
|
|
7392
|
+
}, /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement("nav", {
|
|
7411
7393
|
className: "tw-tabs__header"
|
|
7412
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
7394
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
7413
7395
|
className: "tw-tabs__header-wrapper"
|
|
7414
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
7396
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
7415
7397
|
className: "tw-tabs__header-border"
|
|
7416
7398
|
}), items.filter(item => item.label || item.icon).map((item, index) => {
|
|
7417
|
-
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
7399
|
+
return /*#__PURE__*/React$1.createElement(Button, _extends({
|
|
7418
7400
|
key: index,
|
|
7419
7401
|
back: item.back,
|
|
7420
7402
|
isActive: (current == null ? void 0 : current.action) === item.action,
|
|
@@ -7423,11 +7405,11 @@ function Tabs(_ref) {
|
|
|
7423
7405
|
onClick && onClick(item);
|
|
7424
7406
|
}
|
|
7425
7407
|
}, additionalProps, item), i18n(item.label || ""));
|
|
7426
|
-
}), AddButton && /*#__PURE__*/React.createElement(AddButton, _extends({}, additionalProps, {
|
|
7408
|
+
}), AddButton && /*#__PURE__*/React$1.createElement(AddButton, _extends({}, additionalProps, {
|
|
7427
7409
|
current: current
|
|
7428
|
-
})))), HeaderChildren && /*#__PURE__*/React.createElement(HeaderChildren, _extends({}, additionalProps, {
|
|
7410
|
+
})))), HeaderChildren && /*#__PURE__*/React$1.createElement(HeaderChildren, _extends({}, additionalProps, {
|
|
7429
7411
|
current: current
|
|
7430
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
7412
|
+
}))), /*#__PURE__*/React$1.createElement("div", {
|
|
7431
7413
|
title: "tab-body",
|
|
7432
7414
|
className: "tw-tabs__body"
|
|
7433
7415
|
}, children));
|