@tsed/react-formio 2.3.1 → 2.3.3
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/react-component/reactComponent.component.d.ts +1 -1
- 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 +1184 -1334
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +300 -316
- package/dist/index.modern.js.map +1 -1
- package/package.json +13 -9
- 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 +44 -13
- package/src/components/actions-table/actionsTable.component.tsx +2 -1
- package/src/components/actions-table/actionsTable.stories.tsx +71 -289
- package/src/components/form/form.stories.tsx +1 -2
- package/src/components/form-access/formAccess.component.tsx +2 -13
- package/src/components/form-access/formAccess.stories.tsx +55 -49
- package/src/components/form-action/formAction.component.tsx +1 -0
- package/src/components/form-control/formControl.component.tsx +3 -10
- package/src/components/form-edit/formEdit.reducer.ts +0 -1
- package/src/components/form-settings/formSettings.component.spec.tsx +4 -4
- package/src/components/pagination/pagination.component.spec.tsx +0 -2
- package/src/components/react-component/reactComponent.component.tsx +5 -5
- package/src/components/select/select.component.tsx +10 -23
- package/src/components/table/components/defaultCellOperations.component.tsx +17 -4
- package/src/components/table/components/defaultOperationButton.component.tsx +11 -4
- package/src/components/table/components/defaultRow.component.tsx +1 -0
- package/src/components/table/filters/defaultColumnFilter.component.tsx +1 -0
- package/src/components/table/hooks/useOperations.hook.tsx +3 -3
- package/src/react-table.d.ts +2 -0
- package/dist/package.json +0 -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,8 @@ function DefaultColumnFilter(props) {
|
|
|
594
579
|
setFilterId(id);
|
|
595
580
|
setFilter(value || undefined);
|
|
596
581
|
}, [id, setValue, setFilterId, setFilter]);
|
|
597
|
-
|
|
582
|
+
/* eslint-disable jsx-a11y/no-autofocus */
|
|
583
|
+
return /*#__PURE__*/React$1.createElement(InputText, {
|
|
598
584
|
size: "sm",
|
|
599
585
|
id: id,
|
|
600
586
|
name: id,
|
|
@@ -617,22 +603,28 @@ const stopPropagationWrapper = fn => event => {
|
|
|
617
603
|
fn();
|
|
618
604
|
};
|
|
619
605
|
|
|
606
|
+
const _excluded$b = ["className", "buttonSize", "buttonType", "buttonOutline", "onClick", "action", "icon", "title", "i18n", "data", "ctx"];
|
|
620
607
|
function DefaultOperationButton(props) {
|
|
621
608
|
const {
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
609
|
+
className = "btn",
|
|
610
|
+
buttonSize = "xs",
|
|
611
|
+
buttonType = "primary",
|
|
612
|
+
buttonOutline,
|
|
613
|
+
onClick,
|
|
614
|
+
action,
|
|
615
|
+
icon = "",
|
|
616
|
+
title = "",
|
|
617
|
+
i18n = f => f
|
|
618
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
619
|
+
|
|
620
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
621
|
+
} = props,
|
|
622
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded$b);
|
|
623
|
+
return /*#__PURE__*/React.createElement("button", _extends({}, otherProps, {
|
|
624
|
+
"aria-label": "Operation button: " + (title || action),
|
|
633
625
|
className: classnames(className, ["btn", buttonOutline && "outline", buttonType].filter(Boolean).join("-"), `btn-${buttonSize}`),
|
|
634
626
|
onClick: stopPropagationWrapper(() => onClick(action))
|
|
635
|
-
}, icon ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("i", {
|
|
627
|
+
}), icon ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("i", {
|
|
636
628
|
className: iconClass(undefined, icon)
|
|
637
629
|
}), " ", title && " ") : null, title && /*#__PURE__*/React.createElement("span", {
|
|
638
630
|
className: icon && title ? "ml-1" : ""
|
|
@@ -648,18 +640,19 @@ function DefaultCellOperations({
|
|
|
648
640
|
i18n
|
|
649
641
|
}) {
|
|
650
642
|
const data = row.original;
|
|
651
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
643
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
652
644
|
className: "btn-group"
|
|
653
645
|
}, operations.filter(({
|
|
654
646
|
permissionsResolver
|
|
655
|
-
}) => !permissionsResolver || permissionsResolver(data, ctx)).map(_ref => {
|
|
647
|
+
}) => !permissionsResolver || permissionsResolver(data, ctx)).map((_ref, index) => {
|
|
656
648
|
let {
|
|
657
649
|
OperationButton = DefaultOperationButton
|
|
658
650
|
} = _ref,
|
|
659
651
|
operation = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
660
|
-
return /*#__PURE__*/React.createElement(OperationButton, _extends({
|
|
652
|
+
return /*#__PURE__*/React$1.createElement(OperationButton, _extends({
|
|
661
653
|
key: operation.action
|
|
662
654
|
}, operation, {
|
|
655
|
+
"data-testid": `operation-${index}-${operation.action}`,
|
|
663
656
|
onClick: action => onClick(data, action),
|
|
664
657
|
data: data,
|
|
665
658
|
i18n: i18n,
|
|
@@ -683,10 +676,10 @@ function useOperations({
|
|
|
683
676
|
return [...columns, {
|
|
684
677
|
id: "operations",
|
|
685
678
|
groupByBoundary: true,
|
|
686
|
-
Header: () => /*#__PURE__*/React.createElement("div", {
|
|
679
|
+
Header: () => /*#__PURE__*/React$1.createElement("div", {
|
|
687
680
|
className: "text-center"
|
|
688
681
|
}, i18n("Operations")),
|
|
689
|
-
Cell: props => /*#__PURE__*/React.createElement(CellOperations, _extends({}, props, {
|
|
682
|
+
Cell: props => /*#__PURE__*/React$1.createElement(CellOperations, _extends({}, props, {
|
|
690
683
|
operations: operations,
|
|
691
684
|
onClick: onClick,
|
|
692
685
|
ctx: ctx,
|
|
@@ -707,12 +700,12 @@ function getOperationCallback(operations, onClick) {
|
|
|
707
700
|
};
|
|
708
701
|
}
|
|
709
702
|
function DefaultLoader() {
|
|
710
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
703
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
711
704
|
className: "text-center p-2 pb-4 font-bold"
|
|
712
705
|
}, "Loading in progress");
|
|
713
706
|
}
|
|
714
707
|
function DefaultEmptyData() {
|
|
715
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
708
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
716
709
|
className: "text-center p-2 pb-4 font-bold"
|
|
717
710
|
}, "No data found");
|
|
718
711
|
}
|
|
@@ -750,12 +743,12 @@ function useCustomTable(props) {
|
|
|
750
743
|
} = props,
|
|
751
744
|
ctx = _objectWithoutPropertiesLoose(props, _excluded$9);
|
|
752
745
|
const _onClick = getOperationCallback(operations, onClick);
|
|
753
|
-
const defaultColumn = React.useMemo(() => ({
|
|
746
|
+
const defaultColumn = React$1.useMemo(() => ({
|
|
754
747
|
// Let's set up our default Filter UI
|
|
755
748
|
Filter: ColumnFilter,
|
|
756
749
|
ArrowSort
|
|
757
750
|
}), [ColumnFilter, ArrowSort]);
|
|
758
|
-
const [filterId, setFilterId] = React.useState(controlledFilterId);
|
|
751
|
+
const [filterId, setFilterId] = React$1.useState(controlledFilterId);
|
|
759
752
|
// DND
|
|
760
753
|
const [records, setRecords] = useState(data);
|
|
761
754
|
useEffect(() => {
|
|
@@ -800,7 +793,7 @@ function useCustomTable(props) {
|
|
|
800
793
|
filters
|
|
801
794
|
}
|
|
802
795
|
} = tableInstance;
|
|
803
|
-
React.useEffect(() => {
|
|
796
|
+
React$1.useEffect(() => {
|
|
804
797
|
onChange({
|
|
805
798
|
pageIndex,
|
|
806
799
|
pageSize,
|
|
@@ -859,26 +852,26 @@ function Table(props) {
|
|
|
859
852
|
onDrop
|
|
860
853
|
} = useCustomTable(props);
|
|
861
854
|
// Render the UI for your table
|
|
862
|
-
return /*#__PURE__*/React.createElement(DrapNDropContainer, {
|
|
855
|
+
return /*#__PURE__*/React$1.createElement(DrapNDropContainer, {
|
|
863
856
|
enableDragNDrop: enableDragNDrop
|
|
864
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
857
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
865
858
|
className: classnames("table-group table-responsive", className)
|
|
866
|
-
}, /*#__PURE__*/React.createElement("table", _extends({
|
|
859
|
+
}, /*#__PURE__*/React$1.createElement("table", _extends({
|
|
867
860
|
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(), {
|
|
861
|
+
}, tableInstance.getTableProps()), /*#__PURE__*/React$1.createElement("thead", null, tableInstance.headerGroups.map((headerGroup, i) => /*#__PURE__*/React$1.createElement("tr", _extends({}, headerGroup.getHeaderGroupProps(), {
|
|
869
862
|
key: `tableInstance.headerGroups${i}`
|
|
870
|
-
}), enableDragNDrop ? /*#__PURE__*/React.createElement("th", {
|
|
863
|
+
}), enableDragNDrop ? /*#__PURE__*/React$1.createElement("th", {
|
|
871
864
|
role: "columnheader",
|
|
872
865
|
className: "text-center"
|
|
873
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
866
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
874
867
|
className: "table-cell-header"
|
|
875
|
-
})) : null, headerGroup.headers.map(column => /*#__PURE__*/React.createElement("th", _extends({}, column.getHeaderProps(), {
|
|
868
|
+
})) : null, headerGroup.headers.map(column => /*#__PURE__*/React$1.createElement("th", _extends({}, column.getHeaderProps(), {
|
|
876
869
|
key: `tableInstance.headers.column.${column.id}`
|
|
877
|
-
}), /*#__PURE__*/React.createElement(CellHeader, {
|
|
870
|
+
}), /*#__PURE__*/React$1.createElement(CellHeader, {
|
|
878
871
|
column: column
|
|
879
|
-
})))))), !isLoading ? /*#__PURE__*/React.createElement("tbody", tableInstance.getTableBodyProps(), tableInstance.page.map((row, index) => {
|
|
872
|
+
})))))), !isLoading ? /*#__PURE__*/React$1.createElement("tbody", tableInstance.getTableBodyProps(), tableInstance.page.map((row, index) => {
|
|
880
873
|
tableInstance.prepareRow(row);
|
|
881
|
-
return /*#__PURE__*/React.createElement(Row, {
|
|
874
|
+
return /*#__PURE__*/React$1.createElement(Row, {
|
|
882
875
|
index: index,
|
|
883
876
|
enableDragNDrop: enableDragNDrop,
|
|
884
877
|
onClick: onClick,
|
|
@@ -887,9 +880,9 @@ function Table(props) {
|
|
|
887
880
|
onDrag: onDrag,
|
|
888
881
|
onDrop: onDrop
|
|
889
882
|
});
|
|
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", {
|
|
883
|
+
})) : 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
884
|
className: "overflow-hidden"
|
|
892
|
-
}, /*#__PURE__*/React.createElement(Pagination, _extends({}, tableInstance, {
|
|
885
|
+
}, /*#__PURE__*/React$1.createElement(Pagination, _extends({}, tableInstance, {
|
|
893
886
|
totalLength: totalLength,
|
|
894
887
|
className: "text-sm",
|
|
895
888
|
pageIndex: pageIndex,
|
|
@@ -918,13 +911,14 @@ function ActionsTable(_ref) {
|
|
|
918
911
|
accessor: "title",
|
|
919
912
|
id: "title"
|
|
920
913
|
}];
|
|
921
|
-
return /*#__PURE__*/React.createElement(Table, _extends({}, props, {
|
|
914
|
+
return /*#__PURE__*/React$1.createElement(Table, _extends({}, props, {
|
|
922
915
|
disableFilters: disableFilters,
|
|
923
916
|
disablePagination: disablePagination,
|
|
924
917
|
columns: columns
|
|
925
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
918
|
+
}), /*#__PURE__*/React$1.createElement("div", {
|
|
926
919
|
className: "pagination-group"
|
|
927
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
920
|
+
}, /*#__PURE__*/React$1.createElement(Select, {
|
|
921
|
+
"data-testid": "action-table-select",
|
|
928
922
|
name: "actions",
|
|
929
923
|
value: currentAction,
|
|
930
924
|
choices: [{
|
|
@@ -932,15 +926,15 @@ function ActionsTable(_ref) {
|
|
|
932
926
|
value: ""
|
|
933
927
|
}].concat(availableActions),
|
|
934
928
|
onChange: (name, action) => setAction(action)
|
|
935
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
929
|
+
}), /*#__PURE__*/React$1.createElement("div", {
|
|
936
930
|
className: "pl-3"
|
|
937
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
938
|
-
"data-testid": "
|
|
931
|
+
}, /*#__PURE__*/React$1.createElement("button", {
|
|
932
|
+
"data-testid": "action-table-add",
|
|
939
933
|
disabled: currentAction === "",
|
|
940
934
|
className: "btn btn-success",
|
|
941
935
|
onClick: () => currentAction && onAddAction(currentAction),
|
|
942
936
|
type: "submit"
|
|
943
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
937
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
944
938
|
className: classnames(iconClass(undefined, "plus"), "mr-1")
|
|
945
939
|
}), " ", i18n("Add action")))));
|
|
946
940
|
}
|
|
@@ -955,9 +949,9 @@ function formatError(error) {
|
|
|
955
949
|
if (Object.prototype.hasOwnProperty.call(error, "errors")) {
|
|
956
950
|
return Object.keys(error.errors).map((key, index) => {
|
|
957
951
|
const item = error.errors[key];
|
|
958
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
952
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
959
953
|
key: index
|
|
960
|
-
}, /*#__PURE__*/React.createElement("strong", null, item.name, " (", item.path, ")"), " ", "- ", item.message);
|
|
954
|
+
}, /*#__PURE__*/React$1.createElement("strong", null, item.name, " (", item.path, ")"), " ", "- ", item.message);
|
|
961
955
|
});
|
|
962
956
|
}
|
|
963
957
|
// If this is a standard error.
|
|
@@ -967,7 +961,7 @@ function formatError(error) {
|
|
|
967
961
|
// If this is a joy validation error.
|
|
968
962
|
if (Object.prototype.hasOwnProperty.call(error, "name") && error.name === "ValidationError") {
|
|
969
963
|
return error.details.map((item, index) => {
|
|
970
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
964
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
971
965
|
key: index
|
|
972
966
|
}, item.message);
|
|
973
967
|
});
|
|
@@ -985,7 +979,7 @@ function Alert({
|
|
|
985
979
|
if (!error || Array.isArray(error) && !error.length) {
|
|
986
980
|
return null;
|
|
987
981
|
}
|
|
988
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
982
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
989
983
|
className: `alert alert-${type}`,
|
|
990
984
|
role: "alert"
|
|
991
985
|
}, formatError(error));
|
|
@@ -996,13 +990,13 @@ function Card({
|
|
|
996
990
|
label,
|
|
997
991
|
className
|
|
998
992
|
}) {
|
|
999
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
993
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
1000
994
|
className: classnames("card", className)
|
|
1001
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
995
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
1002
996
|
className: "card-header "
|
|
1003
|
-
}, /*#__PURE__*/React.createElement("h4", {
|
|
997
|
+
}, /*#__PURE__*/React$1.createElement("h4", {
|
|
1004
998
|
className: "card-title"
|
|
1005
|
-
}, label)), /*#__PURE__*/React.createElement("div", {
|
|
999
|
+
}, label)), /*#__PURE__*/React$1.createElement("div", {
|
|
1006
1000
|
className: "card-body",
|
|
1007
1001
|
role: "article"
|
|
1008
1002
|
}, children));
|
|
@@ -1158,7 +1152,7 @@ function Form(props) {
|
|
|
1158
1152
|
const {
|
|
1159
1153
|
element
|
|
1160
1154
|
} = useForm(props);
|
|
1161
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1155
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
1162
1156
|
"data-testid": `formioContainer${props.name || ""}`,
|
|
1163
1157
|
ref: element,
|
|
1164
1158
|
className: props.className
|
|
@@ -1167,24 +1161,24 @@ function Form(props) {
|
|
|
1167
1161
|
Form.propTypes = {
|
|
1168
1162
|
name: PropTypes.string,
|
|
1169
1163
|
className: PropTypes.string,
|
|
1170
|
-
/**
|
|
1171
|
-
*
|
|
1164
|
+
/**
|
|
1165
|
+
*
|
|
1172
1166
|
*/
|
|
1173
1167
|
src: PropTypes.string,
|
|
1174
|
-
/**
|
|
1175
|
-
* url to fetch form
|
|
1168
|
+
/**
|
|
1169
|
+
* url to fetch form
|
|
1176
1170
|
*/
|
|
1177
1171
|
url: PropTypes.string,
|
|
1178
|
-
/**
|
|
1179
|
-
* Raw form object
|
|
1172
|
+
/**
|
|
1173
|
+
* Raw form object
|
|
1180
1174
|
*/
|
|
1181
1175
|
form: PropTypes.object,
|
|
1182
|
-
/**
|
|
1183
|
-
* Data submission
|
|
1176
|
+
/**
|
|
1177
|
+
* Data submission
|
|
1184
1178
|
*/
|
|
1185
1179
|
submission: PropTypes.object,
|
|
1186
|
-
/**
|
|
1187
|
-
* Configuration option
|
|
1180
|
+
/**
|
|
1181
|
+
* Configuration option
|
|
1188
1182
|
*/
|
|
1189
1183
|
options: PropTypes.shape({
|
|
1190
1184
|
readOnly: PropTypes.bool,
|
|
@@ -1423,7 +1417,6 @@ function useFormAccess({
|
|
|
1423
1417
|
onSubmit,
|
|
1424
1418
|
options
|
|
1425
1419
|
}) {
|
|
1426
|
-
// eslint-disable-next-line no-undef
|
|
1427
1420
|
const form = useMemo(() => getFormAccess(roles), [roles]);
|
|
1428
1421
|
const [submissions, setSubmissions] = useState(() => dataAccessToSubmissions(formDefinition, form));
|
|
1429
1422
|
const onChange = useCallback((type, submission) => {
|
|
@@ -1458,7 +1451,7 @@ function NamedFormAccess({
|
|
|
1458
1451
|
children
|
|
1459
1452
|
}) {
|
|
1460
1453
|
const [isValid, setIsValid] = useState(true);
|
|
1461
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form, {
|
|
1454
|
+
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(Form, {
|
|
1462
1455
|
name: name,
|
|
1463
1456
|
form: form[name],
|
|
1464
1457
|
submission: submissions[name],
|
|
@@ -1472,11 +1465,11 @@ function NamedFormAccess({
|
|
|
1472
1465
|
setIsValid(isValid);
|
|
1473
1466
|
},
|
|
1474
1467
|
options: options
|
|
1475
|
-
}), /*#__PURE__*/React.createElement("button", {
|
|
1468
|
+
}), /*#__PURE__*/React$1.createElement("button", {
|
|
1476
1469
|
disabled: !isValid,
|
|
1477
1470
|
className: "mt-5 btn btn-primary",
|
|
1478
1471
|
onClick: onSubmit
|
|
1479
|
-
}, "Save access"), children, /*#__PURE__*/React.createElement("div", {
|
|
1472
|
+
}, "Save access"), children, /*#__PURE__*/React$1.createElement("div", {
|
|
1480
1473
|
className: "alert alert-warning mt-5"
|
|
1481
1474
|
}, "Elevated permissions allow users to access and modify other user's entities. Assign with caution."));
|
|
1482
1475
|
}
|
|
@@ -1489,58 +1482,51 @@ function FormAccess(props) {
|
|
|
1489
1482
|
onChange,
|
|
1490
1483
|
onSubmit
|
|
1491
1484
|
} = useFormAccess(props);
|
|
1492
|
-
return /*#__PURE__*/React.createElement("div", null, props.children, /*#__PURE__*/React.createElement("div", {
|
|
1485
|
+
return /*#__PURE__*/React$1.createElement("div", null, props.children, /*#__PURE__*/React$1.createElement("div", {
|
|
1493
1486
|
className: "flex mb-5"
|
|
1494
|
-
}, /*#__PURE__*/React.createElement(Card, {
|
|
1487
|
+
}, /*#__PURE__*/React$1.createElement(Card, {
|
|
1495
1488
|
label: "Manage submission access",
|
|
1496
1489
|
className: "flex-1"
|
|
1497
|
-
}, /*#__PURE__*/React.createElement(NamedFormAccess, {
|
|
1490
|
+
}, /*#__PURE__*/React$1.createElement(NamedFormAccess, {
|
|
1498
1491
|
name: "submissionAccess",
|
|
1499
1492
|
form: form,
|
|
1500
1493
|
submissions: submissions,
|
|
1501
1494
|
onChange: onChange,
|
|
1502
1495
|
onSubmit: onSubmit,
|
|
1503
1496
|
options: options
|
|
1504
|
-
}, props.children)), /*#__PURE__*/React.createElement("div", {
|
|
1497
|
+
}, props.children)), /*#__PURE__*/React$1.createElement("div", {
|
|
1505
1498
|
className: "w-1/4 pl-4"
|
|
1506
|
-
}, /*#__PURE__*/React.createElement(Card, {
|
|
1499
|
+
}, /*#__PURE__*/React$1.createElement(Card, {
|
|
1507
1500
|
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", {
|
|
1501
|
+
}, /*#__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
1502
|
className: "mt-5 pl-7 list-disc"
|
|
1510
|
-
}, /*#__PURE__*/React.createElement("li", {
|
|
1503
|
+
}, /*#__PURE__*/React$1.createElement("li", {
|
|
1511
1504
|
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", {
|
|
1505
|
+
}, /*#__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
1506
|
className: "flex mb-5"
|
|
1514
|
-
}, /*#__PURE__*/React.createElement(Card, {
|
|
1507
|
+
}, /*#__PURE__*/React$1.createElement(Card, {
|
|
1515
1508
|
label: `Manage ${type} definition access`,
|
|
1516
1509
|
className: "flex-1"
|
|
1517
|
-
}, /*#__PURE__*/React.createElement(NamedFormAccess, {
|
|
1510
|
+
}, /*#__PURE__*/React$1.createElement(NamedFormAccess, {
|
|
1518
1511
|
name: "access",
|
|
1519
1512
|
form: form,
|
|
1520
1513
|
submissions: submissions,
|
|
1521
1514
|
onChange: onChange,
|
|
1522
1515
|
onSubmit: onSubmit,
|
|
1523
1516
|
options: options
|
|
1524
|
-
}, props.children)), /*#__PURE__*/React.createElement("div", {
|
|
1517
|
+
}, props.children)), /*#__PURE__*/React$1.createElement("div", {
|
|
1525
1518
|
className: "w-1/4 pl-4"
|
|
1526
|
-
}, /*#__PURE__*/React.createElement(Card, {
|
|
1519
|
+
}, /*#__PURE__*/React$1.createElement(Card, {
|
|
1527
1520
|
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.")))));
|
|
1521
|
+
}, /*#__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
1522
|
}
|
|
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
1523
|
|
|
1539
1524
|
const _excluded$6 = ["action"],
|
|
1540
1525
|
_excluded2 = ["actionInfo", "children", "onSubmit", "options"];
|
|
1541
1526
|
function mapData(options, defaults) {
|
|
1542
1527
|
return _extends({}, defaults, options);
|
|
1543
1528
|
}
|
|
1529
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1544
1530
|
function mapSettingsForm(_ref) {
|
|
1545
1531
|
let settingsForm = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
1546
1532
|
FormioUtils.eachComponent(settingsForm.components, component => {
|
|
@@ -1580,7 +1566,7 @@ function FormAction(_ref2) {
|
|
|
1580
1566
|
}
|
|
1581
1567
|
};
|
|
1582
1568
|
})();
|
|
1583
|
-
return /*#__PURE__*/React.createElement("div", null, children, /*#__PURE__*/React.createElement(Form, {
|
|
1569
|
+
return /*#__PURE__*/React$1.createElement("div", null, children, /*#__PURE__*/React$1.createElement(Form, {
|
|
1584
1570
|
form: form,
|
|
1585
1571
|
submission: submission,
|
|
1586
1572
|
onSubmit: onSubmit,
|
|
@@ -1618,7 +1604,7 @@ async function createBuilder(el, {
|
|
|
1618
1604
|
console.error(er);
|
|
1619
1605
|
}
|
|
1620
1606
|
}
|
|
1621
|
-
class FormBuilder extends React.Component {
|
|
1607
|
+
class FormBuilder extends React$1.Component {
|
|
1622
1608
|
constructor(props) {
|
|
1623
1609
|
super(props);
|
|
1624
1610
|
this.elRef = void 0;
|
|
@@ -1696,12 +1682,12 @@ class FormBuilder extends React.Component {
|
|
|
1696
1682
|
});
|
|
1697
1683
|
}
|
|
1698
1684
|
render() {
|
|
1699
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1685
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
1700
1686
|
ref: ref => {
|
|
1701
1687
|
this.elRef = ref;
|
|
1702
1688
|
},
|
|
1703
1689
|
onClick: e => e.stopPropagation()
|
|
1704
|
-
}, /*#__PURE__*/React.createElement("div", null));
|
|
1690
|
+
}, /*#__PURE__*/React$1.createElement("div", null));
|
|
1705
1691
|
}
|
|
1706
1692
|
}
|
|
1707
1693
|
FormBuilder.defaultProps = {
|
|
@@ -1770,37 +1756,37 @@ function FormEditCTAs({
|
|
|
1770
1756
|
placement: "top",
|
|
1771
1757
|
title: t("Reset all changes")
|
|
1772
1758
|
});
|
|
1773
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1759
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
1774
1760
|
className: "form-edit__actions"
|
|
1775
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
|
|
1761
|
+
}, /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement("button", {
|
|
1776
1762
|
className: `btn btn-primary btn-save flex ${disabled ? "disabled" : ""}`,
|
|
1777
1763
|
disabled: disabled,
|
|
1778
1764
|
onClick: () => !disabled && onSubmit && onSubmit()
|
|
1779
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
1765
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
1780
1766
|
className: `mr-1 ${iconClass(options.iconset, "save")}`
|
|
1781
|
-
}), saveText), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
|
|
1767
|
+
}), saveText), /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement("button", {
|
|
1782
1768
|
className: `btn btn-light btn-undo ${hasUndo ? "" : "disabled"}`,
|
|
1783
1769
|
onClick: () => onUndo && onUndo(),
|
|
1784
1770
|
ref: undoTooltipRef
|
|
1785
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
1771
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
1786
1772
|
className: iconClass(options.iconset, "undo")
|
|
1787
|
-
})), /*#__PURE__*/React.createElement("button", {
|
|
1773
|
+
})), /*#__PURE__*/React$1.createElement("button", {
|
|
1788
1774
|
className: `btn btn-light btn-redo ${hasRedo ? "" : "disabled"}`,
|
|
1789
1775
|
onClick: () => onRedo && onRedo(),
|
|
1790
1776
|
ref: redoTooltipRef
|
|
1791
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
1777
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
1792
1778
|
className: iconClass(options.iconset, "redo")
|
|
1793
|
-
}))), /*#__PURE__*/React.createElement("div", null, onCopy && /*#__PURE__*/React.createElement("button", {
|
|
1779
|
+
}))), /*#__PURE__*/React$1.createElement("div", null, onCopy && /*#__PURE__*/React$1.createElement("button", {
|
|
1794
1780
|
className: "btn btn-light",
|
|
1795
1781
|
onClick: () => onCopy(),
|
|
1796
1782
|
ref: copyTooltipRef
|
|
1797
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
1783
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
1798
1784
|
className: iconClass(options.iconset, "copy")
|
|
1799
|
-
})), /*#__PURE__*/React.createElement("button", {
|
|
1785
|
+
})), /*#__PURE__*/React$1.createElement("button", {
|
|
1800
1786
|
className: `btn btn-light btn-reset`,
|
|
1801
1787
|
onClick: () => onReset && onReset(),
|
|
1802
1788
|
ref: resetTooltipRef
|
|
1803
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
1789
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
1804
1790
|
className: iconClass(options.iconset, "reset")
|
|
1805
1791
|
})))));
|
|
1806
1792
|
}
|
|
@@ -1846,14 +1832,14 @@ function InputTags(_ref) {
|
|
|
1846
1832
|
instance.destroy();
|
|
1847
1833
|
};
|
|
1848
1834
|
}, []);
|
|
1849
|
-
return /*#__PURE__*/React.createElement(FormControl, {
|
|
1835
|
+
return /*#__PURE__*/React$1.createElement(FormControl, {
|
|
1850
1836
|
name: name,
|
|
1851
1837
|
label: label,
|
|
1852
1838
|
required: required,
|
|
1853
1839
|
description: description,
|
|
1854
1840
|
prefix: prefix,
|
|
1855
1841
|
suffix: suffix
|
|
1856
|
-
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
1842
|
+
}, /*#__PURE__*/React$1.createElement("input", _extends({
|
|
1857
1843
|
ref: ref,
|
|
1858
1844
|
type: "text"
|
|
1859
1845
|
}, props, {
|
|
@@ -1890,11 +1876,11 @@ function FormParameters({
|
|
|
1890
1876
|
baseUrl = window.location.origin
|
|
1891
1877
|
}) {
|
|
1892
1878
|
const hasTypeChoices = typeChoices && typeChoices.length > 1;
|
|
1893
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1879
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
1894
1880
|
className: `form-edit__settings ${className}`
|
|
1895
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1881
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
1896
1882
|
className: "w-1/3"
|
|
1897
|
-
}, /*#__PURE__*/React.createElement(InputText, {
|
|
1883
|
+
}, /*#__PURE__*/React$1.createElement(InputText, {
|
|
1898
1884
|
label: "Title",
|
|
1899
1885
|
placeholder: "Enter the form title",
|
|
1900
1886
|
name: "title",
|
|
@@ -1902,9 +1888,9 @@ function FormParameters({
|
|
|
1902
1888
|
value: form.title,
|
|
1903
1889
|
disabled: !!readonly["title"],
|
|
1904
1890
|
onChange: onChange
|
|
1905
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
1891
|
+
})), /*#__PURE__*/React$1.createElement("div", {
|
|
1906
1892
|
className: "w-1/3"
|
|
1907
|
-
}, /*#__PURE__*/React.createElement(InputText, {
|
|
1893
|
+
}, /*#__PURE__*/React$1.createElement(InputText, {
|
|
1908
1894
|
label: "Name",
|
|
1909
1895
|
placeholder: "Enter the form machine name",
|
|
1910
1896
|
name: "name",
|
|
@@ -1912,16 +1898,16 @@ function FormParameters({
|
|
|
1912
1898
|
disabled: !!readonly["name"],
|
|
1913
1899
|
value: form.name,
|
|
1914
1900
|
onChange: onChange
|
|
1915
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
1901
|
+
})), /*#__PURE__*/React$1.createElement("div", {
|
|
1916
1902
|
className: "w-1/3"
|
|
1917
|
-
}, /*#__PURE__*/React.createElement(InputText, {
|
|
1903
|
+
}, /*#__PURE__*/React$1.createElement(InputText, {
|
|
1918
1904
|
label: "Path",
|
|
1919
1905
|
placeholder: "example",
|
|
1920
1906
|
name: "path",
|
|
1921
1907
|
className: "mb-0",
|
|
1922
|
-
description: /*#__PURE__*/React.createElement("span", {
|
|
1908
|
+
description: /*#__PURE__*/React$1.createElement("span", {
|
|
1923
1909
|
className: "text-xxs flex items-center"
|
|
1924
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
1910
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
1925
1911
|
className: "bx bx-link ml-1 mr-1"
|
|
1926
1912
|
}), `${baseUrl}/${form.path}`),
|
|
1927
1913
|
required: true,
|
|
@@ -1932,26 +1918,26 @@ function FormParameters({
|
|
|
1932
1918
|
width: "120px"
|
|
1933
1919
|
},
|
|
1934
1920
|
onChange: onChange
|
|
1935
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
1921
|
+
})), /*#__PURE__*/React$1.createElement("div", {
|
|
1936
1922
|
className: "w-1/3"
|
|
1937
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
1923
|
+
}, /*#__PURE__*/React$1.createElement(Select, {
|
|
1938
1924
|
label: "Display as",
|
|
1939
1925
|
name: "display",
|
|
1940
1926
|
disabled: !!readonly["display"],
|
|
1941
1927
|
value: form.display,
|
|
1942
1928
|
choices: displayChoices,
|
|
1943
1929
|
onChange: onChange
|
|
1944
|
-
})), hasTypeChoices && /*#__PURE__*/React.createElement("div", {
|
|
1930
|
+
})), hasTypeChoices && /*#__PURE__*/React$1.createElement("div", {
|
|
1945
1931
|
className: "w-1/3"
|
|
1946
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
1932
|
+
}, /*#__PURE__*/React$1.createElement(Select, {
|
|
1947
1933
|
label: "Type",
|
|
1948
1934
|
name: "type",
|
|
1949
1935
|
value: form.type,
|
|
1950
1936
|
choices: typeChoices,
|
|
1951
1937
|
onChange: onChange
|
|
1952
|
-
})), enableTags && /*#__PURE__*/React.createElement("div", {
|
|
1938
|
+
})), enableTags && /*#__PURE__*/React$1.createElement("div", {
|
|
1953
1939
|
className: "w-1/3"
|
|
1954
|
-
}, /*#__PURE__*/React.createElement(InputTags, {
|
|
1940
|
+
}, /*#__PURE__*/React$1.createElement(InputTags, {
|
|
1955
1941
|
label: "Tags",
|
|
1956
1942
|
name: "tags",
|
|
1957
1943
|
value: form.tags,
|
|
@@ -2021,7 +2007,6 @@ const reducer = (state, {
|
|
|
2021
2007
|
case "reset":
|
|
2022
2008
|
return update(cloneDeep(state.original));
|
|
2023
2009
|
case "formChange":
|
|
2024
|
-
// eslint-disable-next-line no-case-declarations
|
|
2025
2010
|
const newValue = _extends({}, state.current, value);
|
|
2026
2011
|
if (hasChanged(state.current, newValue)) {
|
|
2027
2012
|
return update(newValue);
|
|
@@ -2118,14 +2103,14 @@ function FormEdit(props) {
|
|
|
2118
2103
|
options = {},
|
|
2119
2104
|
builder
|
|
2120
2105
|
} = props;
|
|
2121
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
2106
|
+
return /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement("div", {
|
|
2122
2107
|
className: "form-edit"
|
|
2123
|
-
}, /*#__PURE__*/React.createElement(FormParameters, _extends({}, props, {
|
|
2108
|
+
}, /*#__PURE__*/React$1.createElement(FormParameters, _extends({}, props, {
|
|
2124
2109
|
className: "",
|
|
2125
2110
|
key: `form-settings-${form._id}`,
|
|
2126
2111
|
form: form,
|
|
2127
2112
|
onChange: setChange
|
|
2128
|
-
})), /*#__PURE__*/React.createElement(FormEditCTAs, _extends({}, props, {
|
|
2113
|
+
})), /*#__PURE__*/React$1.createElement(FormEditCTAs, _extends({}, props, {
|
|
2129
2114
|
className: "",
|
|
2130
2115
|
key: `form-edit-ctas-${form._id}`,
|
|
2131
2116
|
options: options,
|
|
@@ -2137,7 +2122,7 @@ function FormEdit(props) {
|
|
|
2137
2122
|
onReset: reset,
|
|
2138
2123
|
onCopy: onCopy,
|
|
2139
2124
|
onSubmit: onSubmit
|
|
2140
|
-
}))), /*#__PURE__*/React.createElement(FormBuilder, {
|
|
2125
|
+
}))), /*#__PURE__*/React$1.createElement(FormBuilder, {
|
|
2141
2126
|
key: `form-builder-${form._id}`,
|
|
2142
2127
|
components: form.components,
|
|
2143
2128
|
display: form.display,
|
|
@@ -2279,12 +2264,12 @@ function FormSettings(props) {
|
|
|
2279
2264
|
isValid
|
|
2280
2265
|
} = useFormSettings(props);
|
|
2281
2266
|
const i18n = options.i18n || (f => f);
|
|
2282
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form, {
|
|
2267
|
+
return /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement(Form, {
|
|
2283
2268
|
form: form,
|
|
2284
2269
|
submission: submission,
|
|
2285
2270
|
onChange: onChange,
|
|
2286
2271
|
options: options
|
|
2287
|
-
}), /*#__PURE__*/React.createElement("button", {
|
|
2272
|
+
}), /*#__PURE__*/React$1.createElement("button", {
|
|
2288
2273
|
"data-testid": "submit",
|
|
2289
2274
|
disabled: !isValid,
|
|
2290
2275
|
className: "mt-5 btn btn-primary",
|
|
@@ -2338,7 +2323,7 @@ function SelectColumnFilter(props) {
|
|
|
2338
2323
|
choices,
|
|
2339
2324
|
onChange
|
|
2340
2325
|
} = useSelectColumnFilter(props);
|
|
2341
|
-
return /*#__PURE__*/React.createElement(Select, {
|
|
2326
|
+
return /*#__PURE__*/React$1.createElement(Select, {
|
|
2342
2327
|
key: `filter-${props.column.id}`,
|
|
2343
2328
|
name: `filter-${props.column.id}`,
|
|
2344
2329
|
size: "sm",
|
|
@@ -6886,30 +6871,30 @@ function FormsCell(props) {
|
|
|
6886
6871
|
original: form
|
|
6887
6872
|
}
|
|
6888
6873
|
} = props;
|
|
6889
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
6874
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
6890
6875
|
className: "p-1"
|
|
6891
|
-
}, /*#__PURE__*/React.createElement("h4", {
|
|
6876
|
+
}, /*#__PURE__*/React$1.createElement("h4", {
|
|
6892
6877
|
className: "text-primary text-lg flex items-center"
|
|
6893
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
6878
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
6894
6879
|
className: classnames(iconClass(undefined, icon), "mr-1")
|
|
6895
|
-
}), form.title), /*#__PURE__*/React.createElement("ul", {
|
|
6880
|
+
}), form.title), /*#__PURE__*/React$1.createElement("ul", {
|
|
6896
6881
|
className: "reset-list text-gray-500"
|
|
6897
|
-
}, /*#__PURE__*/React.createElement("li", {
|
|
6882
|
+
}, /*#__PURE__*/React$1.createElement("li", {
|
|
6898
6883
|
className: "text-sm"
|
|
6899
|
-
}, "Name: ", form.name || form.machineName), /*#__PURE__*/React.createElement("li", {
|
|
6884
|
+
}, "Name: ", form.name || form.machineName), /*#__PURE__*/React$1.createElement("li", {
|
|
6900
6885
|
className: "mt-5"
|
|
6901
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
6886
|
+
}, /*#__PURE__*/React$1.createElement("span", {
|
|
6902
6887
|
className: "badge bg-light mr-1"
|
|
6903
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
6888
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
6904
6889
|
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", {
|
|
6890
|
+
}), /*#__PURE__*/React$1.createElement("span", null, "Updated ", moment(form.modified).fromNow())), (form.tags || []).map((tag, index) => /*#__PURE__*/React$1.createElement("button", {
|
|
6906
6891
|
key: index,
|
|
6907
6892
|
className: "badge badge-hover bg-secondary mr-1",
|
|
6908
6893
|
onClick: stopPropagationWrapper(() => {
|
|
6909
6894
|
props.setFilter("tags", tag);
|
|
6910
6895
|
props.gotoPage(0);
|
|
6911
6896
|
})
|
|
6912
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
6897
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
6913
6898
|
className: classnames(iconClass(undefined, "tags"), "mr-1")
|
|
6914
6899
|
}), tag)))));
|
|
6915
6900
|
}
|
|
@@ -6929,7 +6914,7 @@ function FormsTable(_ref) {
|
|
|
6929
6914
|
Header: i18n("Title"),
|
|
6930
6915
|
accessor: "title",
|
|
6931
6916
|
id: "title",
|
|
6932
|
-
Cell: props => /*#__PURE__*/React.createElement(FormCell, _extends({}, props, {
|
|
6917
|
+
Cell: props => /*#__PURE__*/React$1.createElement(FormCell, _extends({}, props, {
|
|
6933
6918
|
icon: props.icon,
|
|
6934
6919
|
i18n: i18n
|
|
6935
6920
|
})),
|
|
@@ -6940,13 +6925,13 @@ function FormsTable(_ref) {
|
|
|
6940
6925
|
accessor: "tags",
|
|
6941
6926
|
id: "tags",
|
|
6942
6927
|
hidden: true,
|
|
6943
|
-
Filter: props => tags && tags.length ? /*#__PURE__*/React.createElement(SelectColumnFilter, _extends({}, props, {
|
|
6928
|
+
Filter: props => tags && tags.length ? /*#__PURE__*/React$1.createElement(SelectColumnFilter, _extends({}, props, {
|
|
6944
6929
|
column: _extends({}, props.columns, {
|
|
6945
6930
|
choices: tags
|
|
6946
6931
|
})
|
|
6947
|
-
})) : /*#__PURE__*/React.createElement(DefaultColumnFilter, props)
|
|
6932
|
+
})) : /*#__PURE__*/React$1.createElement(DefaultColumnFilter, props)
|
|
6948
6933
|
}];
|
|
6949
|
-
return /*#__PURE__*/React.createElement(Table, _extends({}, props, {
|
|
6934
|
+
return /*#__PURE__*/React$1.createElement(Table, _extends({}, props, {
|
|
6950
6935
|
columns: columns
|
|
6951
6936
|
}));
|
|
6952
6937
|
}
|
|
@@ -6958,9 +6943,9 @@ function Loader({
|
|
|
6958
6943
|
className = ""
|
|
6959
6944
|
}) {
|
|
6960
6945
|
if (isActive) {
|
|
6961
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
6946
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
6962
6947
|
className: classnames("opacity-85 z-20 flex items-center justify-center p-5 absolute top-0 right-0 left-0 bottom-0 bg-white", className)
|
|
6963
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
6948
|
+
}, /*#__PURE__*/React$1.createElement("span", {
|
|
6964
6949
|
"data-testid": `icon_${icon}`,
|
|
6965
6950
|
color: color,
|
|
6966
6951
|
className: `text-11xl ${iconClass(undefined, icon, true)}`
|
|
@@ -7020,35 +7005,35 @@ function Modal(_ref) {
|
|
|
7020
7005
|
if (!show) {
|
|
7021
7006
|
return null;
|
|
7022
7007
|
}
|
|
7023
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7008
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
7024
7009
|
role: "dialog",
|
|
7025
7010
|
className: `formio-dialog formio-dialog-theme-default ${className}`
|
|
7026
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
7011
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
7027
7012
|
className: "formio-dialog-overlay",
|
|
7028
7013
|
onClick: onClickClose
|
|
7029
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
7014
|
+
}), /*#__PURE__*/React$1.createElement("div", {
|
|
7030
7015
|
style: style,
|
|
7031
7016
|
className: "formio-dialog-content"
|
|
7032
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
7017
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
7033
7018
|
className: "formio-dialog-wrapper"
|
|
7034
|
-
}, title ? /*#__PURE__*/React.createElement("div", {
|
|
7019
|
+
}, title ? /*#__PURE__*/React$1.createElement("div", {
|
|
7035
7020
|
className: "formio-dialog-title",
|
|
7036
7021
|
ref: titleRef,
|
|
7037
7022
|
"data-testid": "modalTitle"
|
|
7038
|
-
}, title) : null, /*#__PURE__*/React.createElement("div", {
|
|
7023
|
+
}, title) : null, /*#__PURE__*/React$1.createElement("div", {
|
|
7039
7024
|
className: "formio-dialog-body",
|
|
7040
7025
|
style: {
|
|
7041
7026
|
maxHeight
|
|
7042
7027
|
},
|
|
7043
7028
|
"data-testid": "modalBody"
|
|
7044
|
-
}, show && children), ModalFooter ? /*#__PURE__*/React.createElement("div", {
|
|
7029
|
+
}, show && children), ModalFooter ? /*#__PURE__*/React$1.createElement("div", {
|
|
7045
7030
|
className: "formio-dialog-footer",
|
|
7046
7031
|
ref: footerRef,
|
|
7047
7032
|
"data-testid": "modalFooter"
|
|
7048
|
-
}, /*#__PURE__*/React.createElement(ModalFooter, _extends({}, props, {
|
|
7033
|
+
}, /*#__PURE__*/React$1.createElement(ModalFooter, _extends({}, props, {
|
|
7049
7034
|
closeModal: closeModal,
|
|
7050
7035
|
onClose: onClickClose
|
|
7051
|
-
}))) : null), /*#__PURE__*/React.createElement("button", {
|
|
7036
|
+
}))) : null), /*#__PURE__*/React$1.createElement("button", {
|
|
7052
7037
|
className: "formio-dialog-close float-right btn btn-secondary btn-sm",
|
|
7053
7038
|
"aria-label": "close",
|
|
7054
7039
|
"data-testid": "closeModal",
|
|
@@ -7064,13 +7049,13 @@ function RemoveModalFooter({
|
|
|
7064
7049
|
onClose,
|
|
7065
7050
|
i18n = f => f
|
|
7066
7051
|
}) {
|
|
7067
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7052
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
7068
7053
|
className: "flex items-center justify-center bg-white p-2"
|
|
7069
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
7054
|
+
}, /*#__PURE__*/React$1.createElement("button", {
|
|
7070
7055
|
"data-testid": "customCloseModal",
|
|
7071
7056
|
className: "btn btn-outline-dark mx-2",
|
|
7072
7057
|
onClick: onClose
|
|
7073
|
-
}, i18n("Cancel")), /*#__PURE__*/React.createElement("button", {
|
|
7058
|
+
}, i18n("Cancel")), /*#__PURE__*/React$1.createElement("button", {
|
|
7074
7059
|
disabled: valueToCompare !== value,
|
|
7075
7060
|
"data-testid": "customSubmitModal",
|
|
7076
7061
|
className: "btn btn-danger mx-2",
|
|
@@ -7079,7 +7064,7 @@ function RemoveModalFooter({
|
|
|
7079
7064
|
onSubmit(e);
|
|
7080
7065
|
}
|
|
7081
7066
|
}
|
|
7082
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
7067
|
+
}, /*#__PURE__*/React$1.createElement("i", {
|
|
7083
7068
|
className: classnames(iconClass(undefined, "trash"), "mr-2")
|
|
7084
7069
|
}), i18n("Remove")));
|
|
7085
7070
|
}
|
|
@@ -7094,7 +7079,7 @@ function RemoveModal(_ref) {
|
|
|
7094
7079
|
i18n = f => f
|
|
7095
7080
|
} = props;
|
|
7096
7081
|
const [value, setValue] = useState();
|
|
7097
|
-
return /*#__PURE__*/React.createElement(Modal, _extends({}, props, {
|
|
7082
|
+
return /*#__PURE__*/React$1.createElement(Modal, _extends({}, props, {
|
|
7098
7083
|
className: classnames(props.className, "formio-dialog-theme-remove"),
|
|
7099
7084
|
style: {
|
|
7100
7085
|
maxWidth
|
|
@@ -7102,11 +7087,11 @@ function RemoveModal(_ref) {
|
|
|
7102
7087
|
title: `Drop ${(_props$itemType = props.itemType) == null ? void 0 : _props$itemType.toLowerCase()}`,
|
|
7103
7088
|
value: value,
|
|
7104
7089
|
footer: RemoveModalFooter
|
|
7105
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
7090
|
+
}), /*#__PURE__*/React$1.createElement("div", {
|
|
7106
7091
|
className: "px-4 pt-3 pb-5"
|
|
7107
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
7092
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
7108
7093
|
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, {
|
|
7094
|
+
}, 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
7095
|
name: "remove",
|
|
7111
7096
|
value: value,
|
|
7112
7097
|
onChange: (name, value) => setValue(value)
|
|
@@ -7114,23 +7099,23 @@ function RemoveModal(_ref) {
|
|
|
7114
7099
|
}
|
|
7115
7100
|
|
|
7116
7101
|
class ReactComponent extends Components.components.field {
|
|
7117
|
-
/**
|
|
7118
|
-
* This is the first phase of component building where the component is instantiated.
|
|
7119
|
-
*
|
|
7120
|
-
* @param component - The component definition created from the settings form.
|
|
7121
|
-
* @param options - Any options passed into the renderer.
|
|
7122
|
-
* @param data - The submission data where this component's data exists.
|
|
7123
|
-
*/
|
|
7102
|
+
/**
|
|
7103
|
+
* This is the first phase of component building where the component is instantiated.
|
|
7104
|
+
*
|
|
7105
|
+
* @param component - The component definition created from the settings form.
|
|
7106
|
+
* @param options - Any options passed into the renderer.
|
|
7107
|
+
* @param data - The submission data where this component's data exists.
|
|
7108
|
+
*/
|
|
7124
7109
|
constructor(component, options, data) {
|
|
7125
7110
|
super(component, options, data);
|
|
7126
7111
|
this.reactInstance = void 0;
|
|
7127
7112
|
this.shouldSetValue = void 0;
|
|
7128
7113
|
this.dataForSetting = void 0;
|
|
7129
|
-
/**
|
|
7130
|
-
* The user has changed the value in the component and the value needs to be updated on the main submission object and other components notified of a change event.
|
|
7131
|
-
*
|
|
7132
|
-
* @param value
|
|
7133
|
-
* @param flags
|
|
7114
|
+
/**
|
|
7115
|
+
* The user has changed the value in the component and the value needs to be updated on the main submission object and other components notified of a change event.
|
|
7116
|
+
*
|
|
7117
|
+
* @param value
|
|
7118
|
+
* @param flags
|
|
7134
7119
|
*/
|
|
7135
7120
|
this.updateValue = (value, flags) => {
|
|
7136
7121
|
flags = flags || {};
|
|
@@ -7144,37 +7129,37 @@ class ReactComponent extends Components.components.field {
|
|
|
7144
7129
|
get $reactNode() {
|
|
7145
7130
|
return this.refs[`react-${this.id}`];
|
|
7146
7131
|
}
|
|
7147
|
-
/**
|
|
7148
|
-
* This method is called any time the component needs to be rebuilt. It is most frequently used to listen to other
|
|
7149
|
-
* components using the this.on() function.
|
|
7132
|
+
/**
|
|
7133
|
+
* This method is called any time the component needs to be rebuilt. It is most frequently used to listen to other
|
|
7134
|
+
* components using the this.on() function.
|
|
7150
7135
|
*/
|
|
7151
7136
|
init() {
|
|
7152
7137
|
return super.init();
|
|
7153
7138
|
}
|
|
7154
|
-
/**
|
|
7155
|
-
* This method is called before the component is going to be destroyed, which is when the component instance is
|
|
7156
|
-
* destroyed. This is different from detach which is when the component instance still exists but the dom instance is
|
|
7157
|
-
* removed.
|
|
7139
|
+
/**
|
|
7140
|
+
* This method is called before the component is going to be destroyed, which is when the component instance is
|
|
7141
|
+
* destroyed. This is different from detach which is when the component instance still exists but the dom instance is
|
|
7142
|
+
* removed.
|
|
7158
7143
|
*/
|
|
7159
7144
|
destroy() {
|
|
7160
7145
|
return super.destroy();
|
|
7161
7146
|
}
|
|
7162
|
-
/**
|
|
7163
|
-
* The second phase of component building where the component is rendered as an HTML string.
|
|
7164
|
-
*
|
|
7165
|
-
* @returns {string} - The return is the full string of the component
|
|
7147
|
+
/**
|
|
7148
|
+
* The second phase of component building where the component is rendered as an HTML string.
|
|
7149
|
+
*
|
|
7150
|
+
* @returns {string} - The return is the full string of the component
|
|
7166
7151
|
*/
|
|
7167
7152
|
render() {
|
|
7168
7153
|
// For react components, we simply render as a div which will become the react instance.
|
|
7169
7154
|
// By calling super.render(string) it will wrap the component with the needed wrappers to make it a full component.
|
|
7170
7155
|
return super.render(`<div ref="react-${this.id}"></div>`);
|
|
7171
7156
|
}
|
|
7172
|
-
/**
|
|
7173
|
-
* The third phase of component building where the component has been attached to the DOM as 'element' and is ready
|
|
7174
|
-
* to have its javascript events attached.
|
|
7175
|
-
*
|
|
7176
|
-
* @param element
|
|
7177
|
-
* @returns {Promise<void>} - Return a promise that resolves when the attach is complete.
|
|
7157
|
+
/**
|
|
7158
|
+
* The third phase of component building where the component has been attached to the DOM as 'element' and is ready
|
|
7159
|
+
* to have its javascript events attached.
|
|
7160
|
+
*
|
|
7161
|
+
* @param element
|
|
7162
|
+
* @returns {Promise<void>} - Return a promise that resolves when the attach is complete.
|
|
7178
7163
|
*/
|
|
7179
7164
|
async attach(element) {
|
|
7180
7165
|
super.attach(element);
|
|
@@ -7193,9 +7178,9 @@ class ReactComponent extends Components.components.field {
|
|
|
7193
7178
|
}
|
|
7194
7179
|
}
|
|
7195
7180
|
}
|
|
7196
|
-
/**
|
|
7197
|
-
* The fourth phase of component building where the component is being removed from the page. This could be a redraw
|
|
7198
|
-
* or it is being removed from the form.
|
|
7181
|
+
/**
|
|
7182
|
+
* The fourth phase of component building where the component is being removed from the page. This could be a redraw
|
|
7183
|
+
* or it is being removed from the form.
|
|
7199
7184
|
*/
|
|
7200
7185
|
detach() {
|
|
7201
7186
|
// @ts-ignore
|
|
@@ -7205,38 +7190,37 @@ class ReactComponent extends Components.components.field {
|
|
|
7205
7190
|
}
|
|
7206
7191
|
super.detach();
|
|
7207
7192
|
}
|
|
7208
|
-
/**
|
|
7209
|
-
* Override this function to render a react component.
|
|
7193
|
+
/**
|
|
7194
|
+
* Override this function to render a react component.
|
|
7210
7195
|
*/
|
|
7211
7196
|
renderReact() {
|
|
7212
7197
|
return null;
|
|
7213
7198
|
}
|
|
7214
|
-
/**
|
|
7215
|
-
* Override this function to insert your custom component.
|
|
7216
|
-
*
|
|
7217
|
-
* @param element
|
|
7199
|
+
/**
|
|
7200
|
+
* Override this function to insert your custom component.
|
|
7201
|
+
*
|
|
7202
|
+
* @param element
|
|
7218
7203
|
*/
|
|
7219
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
7220
7204
|
attachReact(element) {
|
|
7221
|
-
// eslint-disable-next-line react/no-render-return-value
|
|
7205
|
+
// eslint-disable-next-line react/no-render-return-value,react/no-deprecated
|
|
7222
7206
|
return ReactDOM.render(this.renderReact(), element);
|
|
7223
7207
|
}
|
|
7224
|
-
/**
|
|
7225
|
-
* Override this function.
|
|
7208
|
+
/**
|
|
7209
|
+
* Override this function.
|
|
7226
7210
|
*/
|
|
7227
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
7228
7211
|
detachReact(element) {
|
|
7229
7212
|
if (element) {
|
|
7213
|
+
// eslint-disable-next-line react/no-deprecated
|
|
7230
7214
|
ReactDOM.unmountComponentAtNode(element);
|
|
7231
7215
|
}
|
|
7232
7216
|
}
|
|
7233
|
-
/**
|
|
7234
|
-
* Something external has set a value and our component needs to be updated to reflect that. For example, loading a submission.
|
|
7235
|
-
*
|
|
7236
|
-
* @param value
|
|
7237
|
-
* @param flags
|
|
7217
|
+
/**
|
|
7218
|
+
* Something external has set a value and our component needs to be updated to reflect that. For example, loading a submission.
|
|
7219
|
+
*
|
|
7220
|
+
* @param value
|
|
7221
|
+
* @param flags
|
|
7238
7222
|
*/
|
|
7239
|
-
setValue(value
|
|
7223
|
+
setValue(value) {
|
|
7240
7224
|
if (this.reactInstance) {
|
|
7241
7225
|
this.reactInstance.setState({
|
|
7242
7226
|
value: value
|
|
@@ -7248,10 +7232,10 @@ class ReactComponent extends Components.components.field {
|
|
|
7248
7232
|
}
|
|
7249
7233
|
return false;
|
|
7250
7234
|
}
|
|
7251
|
-
/**
|
|
7252
|
-
* Get the current value of the component. Should return the value set in the react component.
|
|
7253
|
-
*
|
|
7254
|
-
* @returns {*}
|
|
7235
|
+
/**
|
|
7236
|
+
* Get the current value of the component. Should return the value set in the react component.
|
|
7237
|
+
*
|
|
7238
|
+
* @returns {*}
|
|
7255
7239
|
*/
|
|
7256
7240
|
getValue() {
|
|
7257
7241
|
if (this.reactInstance) {
|
|
@@ -7259,13 +7243,13 @@ class ReactComponent extends Components.components.field {
|
|
|
7259
7243
|
}
|
|
7260
7244
|
return this.defaultValue;
|
|
7261
7245
|
}
|
|
7262
|
-
/**
|
|
7263
|
-
* Override normal validation check to insert custom validation in react component.
|
|
7264
|
-
*
|
|
7265
|
-
* @param data
|
|
7266
|
-
* @param dirty
|
|
7267
|
-
* @param rowData
|
|
7268
|
-
* @returns {boolean}
|
|
7246
|
+
/**
|
|
7247
|
+
* Override normal validation check to insert custom validation in react component.
|
|
7248
|
+
*
|
|
7249
|
+
* @param data
|
|
7250
|
+
* @param dirty
|
|
7251
|
+
* @param rowData
|
|
7252
|
+
* @returns {boolean}
|
|
7269
7253
|
*/
|
|
7270
7254
|
checkValidity(data, dirty, rowData) {
|
|
7271
7255
|
const valid = super.checkValidity(data, dirty, rowData);
|
|
@@ -7285,17 +7269,17 @@ function DefaultCell({
|
|
|
7285
7269
|
render = f => f
|
|
7286
7270
|
}) {
|
|
7287
7271
|
if (value === undefined) {
|
|
7288
|
-
return /*#__PURE__*/React.createElement("span", null);
|
|
7272
|
+
return /*#__PURE__*/React$1.createElement("span", null);
|
|
7289
7273
|
}
|
|
7290
7274
|
const rendered = render(value);
|
|
7291
7275
|
if (value !== rendered) {
|
|
7292
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7276
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
7293
7277
|
dangerouslySetInnerHTML: {
|
|
7294
7278
|
__html: rendered
|
|
7295
7279
|
}
|
|
7296
7280
|
});
|
|
7297
7281
|
}
|
|
7298
|
-
return /*#__PURE__*/React.createElement("span", null, String(value));
|
|
7282
|
+
return /*#__PURE__*/React$1.createElement("span", null, String(value));
|
|
7299
7283
|
}
|
|
7300
7284
|
|
|
7301
7285
|
function mapFormToColumns(form) {
|
|
@@ -7307,7 +7291,7 @@ function mapFormToColumns(form) {
|
|
|
7307
7291
|
Header: component.label || component.title || component.key,
|
|
7308
7292
|
accessor: `data.${component.key}`,
|
|
7309
7293
|
className: "text-center",
|
|
7310
|
-
Cell: props => /*#__PURE__*/React.createElement(DefaultCell, _extends({}, props, {
|
|
7294
|
+
Cell: props => /*#__PURE__*/React$1.createElement(DefaultCell, _extends({}, props, {
|
|
7311
7295
|
render: value => cmp.asString(value)
|
|
7312
7296
|
}))
|
|
7313
7297
|
};
|
|
@@ -7328,7 +7312,7 @@ function SubmissionsTable(_ref) {
|
|
|
7328
7312
|
} = _ref,
|
|
7329
7313
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
7330
7314
|
const columns = form && mapFormToColumns(form);
|
|
7331
|
-
return /*#__PURE__*/React.createElement(Table, _extends({}, props, {
|
|
7315
|
+
return /*#__PURE__*/React$1.createElement(Table, _extends({}, props, {
|
|
7332
7316
|
columns: columns
|
|
7333
7317
|
}));
|
|
7334
7318
|
}
|
|
@@ -7341,7 +7325,7 @@ function SliderColumnFilter({
|
|
|
7341
7325
|
id
|
|
7342
7326
|
}
|
|
7343
7327
|
}) {
|
|
7344
|
-
const [min, max] = React.useMemo(() => {
|
|
7328
|
+
const [min, max] = React$1.useMemo(() => {
|
|
7345
7329
|
let min = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
|
|
7346
7330
|
let max = preFilteredRows.length ? preFilteredRows[0].values[id] : 0;
|
|
7347
7331
|
preFilteredRows.forEach(row => {
|
|
@@ -7350,7 +7334,7 @@ function SliderColumnFilter({
|
|
|
7350
7334
|
});
|
|
7351
7335
|
return [min, max];
|
|
7352
7336
|
}, [id, preFilteredRows]);
|
|
7353
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", {
|
|
7337
|
+
return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement("input", {
|
|
7354
7338
|
type: "range",
|
|
7355
7339
|
min: min,
|
|
7356
7340
|
max: max,
|
|
@@ -7358,7 +7342,7 @@ function SliderColumnFilter({
|
|
|
7358
7342
|
onChange: e => {
|
|
7359
7343
|
setFilter(parseInt(e.target.value, 10));
|
|
7360
7344
|
}
|
|
7361
|
-
}), /*#__PURE__*/React.createElement("button", {
|
|
7345
|
+
}), /*#__PURE__*/React$1.createElement("button", {
|
|
7362
7346
|
onClick: () => setFilter(undefined)
|
|
7363
7347
|
}, "Off"));
|
|
7364
7348
|
}
|
|
@@ -7374,18 +7358,18 @@ function ButtonTab({
|
|
|
7374
7358
|
className,
|
|
7375
7359
|
after
|
|
7376
7360
|
}) {
|
|
7377
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7361
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
7378
7362
|
title: "button-wrapper",
|
|
7379
7363
|
className: classnames("tw-tabs__button-wrapper", isActive ? "-active" : "", back ? "-back" : "", className)
|
|
7380
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
7364
|
+
}, /*#__PURE__*/React$1.createElement("button", {
|
|
7381
7365
|
title: "button-tab",
|
|
7382
7366
|
className: classnames("tw-tabs__button", reverse ? "-reverse" : "", isActive ? "-active" : "", back ? "-back" : ""),
|
|
7383
7367
|
onClick: onClick
|
|
7384
|
-
}, icon && /*#__PURE__*/React.createElement("i", {
|
|
7368
|
+
}, icon && /*#__PURE__*/React$1.createElement("i", {
|
|
7385
7369
|
className: classnames(iconClass(undefined, icon), "tw-tabs__button-icon")
|
|
7386
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
7370
|
+
}), /*#__PURE__*/React$1.createElement("span", {
|
|
7387
7371
|
className: "tw-tabs__button-label"
|
|
7388
|
-
}, children), after), /*#__PURE__*/React.createElement("div", {
|
|
7372
|
+
}, children), after), /*#__PURE__*/React$1.createElement("div", {
|
|
7389
7373
|
className: classnames("tw-tabs__button-border", isActive ? "-active" : "")
|
|
7390
7374
|
}));
|
|
7391
7375
|
}
|
|
@@ -7403,18 +7387,18 @@ function Tabs(_ref) {
|
|
|
7403
7387
|
i18n = f => f
|
|
7404
7388
|
} = _ref,
|
|
7405
7389
|
additionalProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
7406
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7390
|
+
return /*#__PURE__*/React$1.createElement("div", {
|
|
7407
7391
|
"data-testid": "tabs-comp",
|
|
7408
7392
|
className: `tw-tabs ${className}`,
|
|
7409
7393
|
style: style
|
|
7410
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("nav", {
|
|
7394
|
+
}, /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement("nav", {
|
|
7411
7395
|
className: "tw-tabs__header"
|
|
7412
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
7396
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
7413
7397
|
className: "tw-tabs__header-wrapper"
|
|
7414
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
7398
|
+
}, /*#__PURE__*/React$1.createElement("div", {
|
|
7415
7399
|
className: "tw-tabs__header-border"
|
|
7416
7400
|
}), items.filter(item => item.label || item.icon).map((item, index) => {
|
|
7417
|
-
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
7401
|
+
return /*#__PURE__*/React$1.createElement(Button, _extends({
|
|
7418
7402
|
key: index,
|
|
7419
7403
|
back: item.back,
|
|
7420
7404
|
isActive: (current == null ? void 0 : current.action) === item.action,
|
|
@@ -7423,11 +7407,11 @@ function Tabs(_ref) {
|
|
|
7423
7407
|
onClick && onClick(item);
|
|
7424
7408
|
}
|
|
7425
7409
|
}, additionalProps, item), i18n(item.label || ""));
|
|
7426
|
-
}), AddButton && /*#__PURE__*/React.createElement(AddButton, _extends({}, additionalProps, {
|
|
7410
|
+
}), AddButton && /*#__PURE__*/React$1.createElement(AddButton, _extends({}, additionalProps, {
|
|
7427
7411
|
current: current
|
|
7428
|
-
})))), HeaderChildren && /*#__PURE__*/React.createElement(HeaderChildren, _extends({}, additionalProps, {
|
|
7412
|
+
})))), HeaderChildren && /*#__PURE__*/React$1.createElement(HeaderChildren, _extends({}, additionalProps, {
|
|
7429
7413
|
current: current
|
|
7430
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
7414
|
+
}))), /*#__PURE__*/React$1.createElement("div", {
|
|
7431
7415
|
title: "tab-body",
|
|
7432
7416
|
className: "tw-tabs__body"
|
|
7433
7417
|
}, children));
|