@tsed/react-formio 1.10.7 → 1.10.11
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/.eslintrc +7 -2
- package/dist/components/modal/removeModal.component.d.ts +3 -2
- package/dist/components/table/components/defaultCell.component.d.ts +2 -0
- package/dist/components/table/index.d.ts +1 -1
- package/dist/index.js +40 -23
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +36 -20
- package/dist/index.modern.js.map +1 -1
- package/package.json +5 -4
- package/src/components/actions-table/actionsTable.component.spec.tsx +15 -17
- package/src/components/actions-table/actionsTable.component.tsx +1 -0
- package/src/components/card/card.component.spec.tsx +2 -2
- package/src/components/card/card.component.tsx +2 -4
- package/src/components/form-builder/formBuilder.component.tsx +2 -0
- package/src/components/form-settings/formSettings.component.tsx +1 -0
- package/src/components/forms-table/components/formCell.component.tsx +2 -2
- package/src/components/input-text/inputText.component.tsx +1 -1
- package/src/components/loader/loader.component.spec.tsx +2 -2
- package/src/components/loader/loader.component.tsx +1 -1
- package/src/components/modal/modal.component.spec.tsx +3 -3
- package/src/components/modal/modal.component.tsx +6 -1
- package/src/components/modal/modal.stories.tsx +5 -21
- package/src/components/modal/removeModal.component.tsx +11 -4
- package/src/components/react-component/reactComponent.component.tsx +1 -0
- package/src/components/select/select.component.tsx +1 -1
- package/src/components/table/components/{cell.component.tsx → defaultCell.component.tsx} +4 -1
- package/src/components/table/components/defaultOperationButton.component.tsx +2 -2
- package/src/components/table/filters/defaultColumnFilter.component.spec.tsx +2 -2
- package/src/components/table/index.ts +1 -1
- package/src/components/table/table.component.tsx +16 -5
- package/src/components/table/utils/mapFormToColumns.tsx +6 -3
- package/src/components/tabs/tabs.component.stories.tsx +1 -1
- package/dist/components/table/components/cell.component.d.ts +0 -2
package/.eslintrc
CHANGED
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
"prettier/react",
|
|
8
8
|
"plugin:@typescript-eslint/recommended",
|
|
9
9
|
"prettier/@typescript-eslint",
|
|
10
|
-
"plugin:prettier/recommended"
|
|
10
|
+
"plugin:prettier/recommended",
|
|
11
|
+
"plugin:react/recommended",
|
|
12
|
+
"plugin:jsx-a11y/recommended"
|
|
11
13
|
],
|
|
12
14
|
"env": {
|
|
13
15
|
"node": true,
|
|
@@ -31,12 +33,15 @@
|
|
|
31
33
|
"react/prop-types": 0,
|
|
32
34
|
"react/jsx-handler-names": 0,
|
|
33
35
|
"react/jsx-fragments": 0,
|
|
36
|
+
"react/no-unescaped-entities": 0,
|
|
34
37
|
"react/no-unused-prop-types": 0,
|
|
38
|
+
"react/display-name": 1,
|
|
35
39
|
"no-unused-vars": "off",
|
|
36
40
|
"@typescript-eslint/no-explicit-any": 0,
|
|
37
41
|
"@typescript-eslint/explicit-function-return-type": 0,
|
|
38
42
|
"@typescript-eslint/camelcase": 0,
|
|
39
43
|
"@typescript-eslint/no-empty-function": 0,
|
|
40
|
-
"import/export": 0
|
|
44
|
+
"import/export": 0,
|
|
45
|
+
"jsx-a11y/no-autofocus": 1
|
|
41
46
|
}
|
|
42
47
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
2
|
import { ModalProps } from "./modal.component";
|
|
3
3
|
export interface RemoveModalProps extends ModalProps {
|
|
4
4
|
valueToCompare: string;
|
|
5
5
|
itemType?: string;
|
|
6
6
|
i18n?: (f: string) => string;
|
|
7
|
+
maxWidth?: string;
|
|
7
8
|
}
|
|
8
|
-
export declare function RemoveModal(props: RemoveModalProps): JSX.Element;
|
|
9
|
+
export declare function RemoveModal({ maxWidth, children, ...props }: PropsWithChildren<RemoveModalProps>): JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./utils/useOperations.hook";
|
|
2
|
-
export * from "./components/cell.component";
|
|
3
2
|
export * from "./components/defaultArrowSort.component";
|
|
3
|
+
export * from "./components/defaultCell.component";
|
|
4
4
|
export * from "./components/defaultCellHeader.component";
|
|
5
5
|
export * from "./components/defaultCellHeader.component";
|
|
6
6
|
export * from "./components/defaultCellOperations.component";
|
package/dist/index.js
CHANGED
|
@@ -1767,7 +1767,7 @@ function Select(_ref) {
|
|
|
1767
1767
|
}, React__default['default'].createElement("select", Object.assign({
|
|
1768
1768
|
ref: ref
|
|
1769
1769
|
}, props, {
|
|
1770
|
-
"data-testid": "
|
|
1770
|
+
"data-testid": "select_" + name,
|
|
1771
1771
|
className: classnames("form-control", size && "form-control-" + size),
|
|
1772
1772
|
name: name,
|
|
1773
1773
|
id: name,
|
|
@@ -2024,7 +2024,7 @@ function InputText(_ref) {
|
|
|
2024
2024
|
}, React__default['default'].createElement("input", Object.assign({
|
|
2025
2025
|
type: type || "text"
|
|
2026
2026
|
}, props, {
|
|
2027
|
-
"data-testid": "
|
|
2027
|
+
"data-testid": "input_" + name,
|
|
2028
2028
|
className: classnames("form-control", size && "form-control-" + size),
|
|
2029
2029
|
id: name,
|
|
2030
2030
|
required: required,
|
|
@@ -2102,7 +2102,7 @@ function DefaultOperationButton(props) {
|
|
|
2102
2102
|
i18n = _props$i18n === void 0 ? function (f) {
|
|
2103
2103
|
return f;
|
|
2104
2104
|
} : _props$i18n;
|
|
2105
|
-
return React__default['default'].createElement("
|
|
2105
|
+
return React__default['default'].createElement("button", {
|
|
2106
2106
|
className: classnames(className, ["btn", buttonOutline && "outline", buttonType].filter(Boolean).join("-"), "btn-" + buttonSize),
|
|
2107
2107
|
onClick: stopPropagationWrapper(function () {
|
|
2108
2108
|
return onClick(action);
|
|
@@ -2305,19 +2305,24 @@ function Table(props) {
|
|
|
2305
2305
|
className: classnames("table-group table-responsive", className)
|
|
2306
2306
|
}, React__default['default'].createElement("table", Object.assign({
|
|
2307
2307
|
className: "table table-striped table-hover"
|
|
2308
|
-
}, tableInstance.getTableProps()), React__default['default'].createElement("thead", null, tableInstance.headerGroups.map(function (headerGroup) {
|
|
2309
|
-
return React__default['default'].createElement("tr", Object.assign({
|
|
2310
|
-
|
|
2308
|
+
}, tableInstance.getTableProps()), React__default['default'].createElement("thead", null, tableInstance.headerGroups.map(function (headerGroup, i) {
|
|
2309
|
+
return React__default['default'].createElement("tr", Object.assign({
|
|
2310
|
+
key: "tableInstance.headerGroups" + i
|
|
2311
|
+
}, headerGroup.getHeaderGroupProps()), headerGroup.headers.map(function (column) {
|
|
2312
|
+
return React__default['default'].createElement("th", Object.assign({
|
|
2313
|
+
key: "tableInstance.headers.column." + column.id
|
|
2314
|
+
}, column.getHeaderProps()), React__default['default'].createElement(CellHeader, {
|
|
2311
2315
|
column: column
|
|
2312
2316
|
}));
|
|
2313
2317
|
}));
|
|
2314
|
-
})), !isLoading ? React__default['default'].createElement("tbody", Object.assign({}, tableInstance.getTableBodyProps()), tableInstance.page.map(function (row
|
|
2318
|
+
})), !isLoading ? React__default['default'].createElement("tbody", Object.assign({}, tableInstance.getTableBodyProps()), tableInstance.page.map(function (row) {
|
|
2315
2319
|
tableInstance.prepareRow(row);
|
|
2316
2320
|
return React__default['default'].createElement("tr", Object.assign({
|
|
2321
|
+
key: "tableInstance.page." + row.id,
|
|
2317
2322
|
onClick: function onClick() {
|
|
2318
2323
|
return _onClick(row.original, "row");
|
|
2319
2324
|
}
|
|
2320
|
-
}, row.getRowProps()), row.cells.map(function (cell) {
|
|
2325
|
+
}, row.getRowProps()), row.cells.map(function (cell, i) {
|
|
2321
2326
|
var _cell$column = cell.column,
|
|
2322
2327
|
hidden = _cell$column.hidden,
|
|
2323
2328
|
colspan = _cell$column.colspan;
|
|
@@ -2327,6 +2332,7 @@ function Table(props) {
|
|
|
2327
2332
|
}
|
|
2328
2333
|
|
|
2329
2334
|
return React__default['default'].createElement("td", Object.assign({
|
|
2335
|
+
key: "tableInstance.page.cells." + (cell.value || "value") + "." + i,
|
|
2330
2336
|
colSpan: colspan
|
|
2331
2337
|
}, cell.getCellProps()), cell.render("Cell"));
|
|
2332
2338
|
}));
|
|
@@ -2393,7 +2399,8 @@ function ActionsTable(_ref) {
|
|
|
2393
2399
|
className: "btn btn-success",
|
|
2394
2400
|
onClick: function onClick() {
|
|
2395
2401
|
return currentAction && onAddAction(currentAction);
|
|
2396
|
-
}
|
|
2402
|
+
},
|
|
2403
|
+
type: "submit"
|
|
2397
2404
|
}, React__default['default'].createElement("i", {
|
|
2398
2405
|
className: classnames(iconClass(undefined, "plus"), "mr-1")
|
|
2399
2406
|
}), " ", i18n("Add action")))));
|
|
@@ -2463,11 +2470,10 @@ function Card(_ref) {
|
|
|
2463
2470
|
}, React__default['default'].createElement("div", {
|
|
2464
2471
|
className: "card-header "
|
|
2465
2472
|
}, React__default['default'].createElement("h4", {
|
|
2466
|
-
className: "card-title"
|
|
2467
|
-
role: "card-heading"
|
|
2473
|
+
className: "card-title"
|
|
2468
2474
|
}, label)), React__default['default'].createElement("div", {
|
|
2469
2475
|
className: "card-body",
|
|
2470
|
-
role: "
|
|
2476
|
+
role: "article"
|
|
2471
2477
|
}, children));
|
|
2472
2478
|
}
|
|
2473
2479
|
|
|
@@ -3881,7 +3887,8 @@ function FormSettings(props) {
|
|
|
3881
3887
|
"data-testid": 'submit',
|
|
3882
3888
|
disabled: !isValid,
|
|
3883
3889
|
className: "mt-5 btn btn-primary",
|
|
3884
|
-
onClick: onSubmit
|
|
3890
|
+
onClick: onSubmit,
|
|
3891
|
+
type: "submit"
|
|
3885
3892
|
}, i18n("Save settings")));
|
|
3886
3893
|
}
|
|
3887
3894
|
|
|
@@ -9029,7 +9036,7 @@ function FormsCell(props) {
|
|
|
9029
9036
|
}, React__default['default'].createElement("i", {
|
|
9030
9037
|
className: classnames(iconClass(undefined, "history"), "mr-1")
|
|
9031
9038
|
}), React__default['default'].createElement("span", null, "Updated ", moment(form.modified).fromNow())), (form.tags || []).map(function (tag, index) {
|
|
9032
|
-
return React__default['default'].createElement("
|
|
9039
|
+
return React__default['default'].createElement("button", {
|
|
9033
9040
|
key: index,
|
|
9034
9041
|
className: 'badge badge-hover bg-secondary mr-1',
|
|
9035
9042
|
onClick: stopPropagationWrapper(function () {
|
|
@@ -9142,6 +9149,7 @@ function Modal(_ref) {
|
|
|
9142
9149
|
}
|
|
9143
9150
|
|
|
9144
9151
|
return React__default['default'].createElement("div", {
|
|
9152
|
+
role: "dialog",
|
|
9145
9153
|
className: "formio-dialog formio-dialog-theme-default " + className
|
|
9146
9154
|
}, React__default['default'].createElement("div", {
|
|
9147
9155
|
className: 'formio-dialog-overlay',
|
|
@@ -9182,7 +9190,9 @@ function RemoveModalFooter(_ref) {
|
|
|
9182
9190
|
onSubmit = _ref.onSubmit,
|
|
9183
9191
|
onClose = _ref.onClose,
|
|
9184
9192
|
_ref$i18n = _ref.i18n,
|
|
9185
|
-
i18n = _ref$i18n === void 0 ?
|
|
9193
|
+
i18n = _ref$i18n === void 0 ? function (f) {
|
|
9194
|
+
return f;
|
|
9195
|
+
} : _ref$i18n;
|
|
9186
9196
|
return React__default['default'].createElement("div", {
|
|
9187
9197
|
className: "flex items-center justify-center bg-white p-2"
|
|
9188
9198
|
}, React__default['default'].createElement("button", {
|
|
@@ -9203,9 +9213,14 @@ function RemoveModalFooter(_ref) {
|
|
|
9203
9213
|
}), i18n("Remove")));
|
|
9204
9214
|
}
|
|
9205
9215
|
|
|
9206
|
-
function RemoveModal(
|
|
9216
|
+
function RemoveModal(_ref2) {
|
|
9207
9217
|
var _props$itemType, _props$itemType2;
|
|
9208
9218
|
|
|
9219
|
+
var _ref2$maxWidth = _ref2.maxWidth,
|
|
9220
|
+
maxWidth = _ref2$maxWidth === void 0 ? "300px" : _ref2$maxWidth,
|
|
9221
|
+
children = _ref2.children,
|
|
9222
|
+
props = _objectWithoutPropertiesLoose(_ref2, ["maxWidth", "children"]);
|
|
9223
|
+
|
|
9209
9224
|
var _props$i18n = props.i18n,
|
|
9210
9225
|
i18n = _props$i18n === void 0 ? noop__default['default'] : _props$i18n;
|
|
9211
9226
|
|
|
@@ -9214,8 +9229,9 @@ function RemoveModal(props) {
|
|
|
9214
9229
|
setValue = _useState[1];
|
|
9215
9230
|
|
|
9216
9231
|
return React__default['default'].createElement(Modal, Object.assign({}, props, {
|
|
9232
|
+
className: classnames(props.className, "formio-dialog-theme-remove"),
|
|
9217
9233
|
style: {
|
|
9218
|
-
maxWidth:
|
|
9234
|
+
maxWidth: maxWidth
|
|
9219
9235
|
},
|
|
9220
9236
|
title: "Drop " + ((_props$itemType = props.itemType) == null ? void 0 : _props$itemType.toLowerCase()),
|
|
9221
9237
|
value: value,
|
|
@@ -9224,7 +9240,7 @@ function RemoveModal(props) {
|
|
|
9224
9240
|
className: "px-4 pt-3 pb-5"
|
|
9225
9241
|
}, React__default['default'].createElement("div", {
|
|
9226
9242
|
className: "pb-1"
|
|
9227
|
-
}, i18n("To drop"), " ", React__default['default'].createElement("strong", null, props.valueToCompare), ",\xA0", i18n("type the"), "\xA0", React__default['default'].createElement("strong", null, "\"", (_props$itemType2 = props.itemType) == null ? void 0 : _props$itemType2.toLowerCase(), "\""), "\xA0", i18n("name"), " ", React__default['default'].createElement("strong", null, "\"", props.valueToCompare, "\""), "."), React__default['default'].createElement(InputText, {
|
|
9243
|
+
}, children, i18n("To drop"), " ", React__default['default'].createElement("strong", null, props.valueToCompare), ",\xA0", i18n("type the"), "\xA0", React__default['default'].createElement("strong", null, "\"", (_props$itemType2 = props.itemType) == null ? void 0 : _props$itemType2.toLowerCase(), "\""), "\xA0", i18n("name"), " ", React__default['default'].createElement("strong", null, "\"", props.valueToCompare, "\""), "."), React__default['default'].createElement(InputText, {
|
|
9228
9244
|
name: 'remove',
|
|
9229
9245
|
value: value,
|
|
9230
9246
|
onChange: function onChange(name, value) {
|
|
@@ -22649,6 +22665,7 @@ var ReactComponent = /*#__PURE__*/function (_Components$component) {
|
|
|
22649
22665
|
;
|
|
22650
22666
|
|
|
22651
22667
|
_proto.attachReact = function attachReact(element) {
|
|
22668
|
+
// eslint-disable-next-line react/no-render-return-value
|
|
22652
22669
|
return reactDom.render(this.renderReact(), element);
|
|
22653
22670
|
}
|
|
22654
22671
|
/**
|
|
@@ -22733,7 +22750,7 @@ var ReactComponent = /*#__PURE__*/function (_Components$component) {
|
|
|
22733
22750
|
return ReactComponent;
|
|
22734
22751
|
}(formiojs.Components.components.field);
|
|
22735
22752
|
|
|
22736
|
-
function
|
|
22753
|
+
function DefaultCell(_ref) {
|
|
22737
22754
|
var value = _ref.value,
|
|
22738
22755
|
_ref$render = _ref.render,
|
|
22739
22756
|
render = _ref$render === void 0 ? function (f) {
|
|
@@ -22765,8 +22782,8 @@ function mapFormToColumns(form) {
|
|
|
22765
22782
|
var column = {
|
|
22766
22783
|
Header: component.label || component.title || component.key,
|
|
22767
22784
|
accessor: "data." + component.key,
|
|
22768
|
-
Cell: function Cell
|
|
22769
|
-
return React__default['default'].createElement(
|
|
22785
|
+
Cell: function Cell(props) {
|
|
22786
|
+
return React__default['default'].createElement(DefaultCell, Object.assign({}, props, {
|
|
22770
22787
|
render: function render(value) {
|
|
22771
22788
|
return cmp.asString(value);
|
|
22772
22789
|
}
|
|
@@ -22914,7 +22931,7 @@ function Loader(_ref) {
|
|
|
22914
22931
|
return React__default['default'].createElement("div", {
|
|
22915
22932
|
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)
|
|
22916
22933
|
}, React__default['default'].createElement("span", {
|
|
22917
|
-
"data-testid": "icon
|
|
22934
|
+
"data-testid": "icon_" + icon,
|
|
22918
22935
|
color: color,
|
|
22919
22936
|
className: "text-11xl " + iconClass(undefined, icon, true)
|
|
22920
22937
|
}));
|
|
@@ -22985,8 +23002,8 @@ exports.ActionsTable = ActionsTable;
|
|
|
22985
23002
|
exports.Alert = Alert;
|
|
22986
23003
|
exports.ButtonTab = ButtonTab;
|
|
22987
23004
|
exports.Card = Card;
|
|
22988
|
-
exports.Cell = Cell;
|
|
22989
23005
|
exports.DefaultArrowSort = DefaultArrowSort;
|
|
23006
|
+
exports.DefaultCell = DefaultCell;
|
|
22990
23007
|
exports.DefaultCellHeader = DefaultCellHeader;
|
|
22991
23008
|
exports.DefaultCellOperations = DefaultCellOperations;
|
|
22992
23009
|
exports.DefaultColumnFilter = DefaultColumnFilter;
|