@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/react-formio",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.11",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.modern.js",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"prettier": "prettier '{src,test}/**/*.{ts,tsx}' --write"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@tsed/redux-utils": "1.10.
|
|
16
|
+
"@tsed/redux-utils": "1.10.11",
|
|
17
17
|
"eventemitter2": "^6.4.3",
|
|
18
18
|
"prop-types": "^15.7.2"
|
|
19
19
|
},
|
|
@@ -28,8 +28,9 @@
|
|
|
28
28
|
"tooltip.js": "^1.3.3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@tsed/tailwind": "1.10.
|
|
32
|
-
"@tsed/tailwind-formio": "1.10.
|
|
31
|
+
"@tsed/tailwind": "1.10.11",
|
|
32
|
+
"@tsed/tailwind-formio": "1.10.11",
|
|
33
|
+
"eslint-plugin-jsx-a11y": "^6.5.1"
|
|
33
34
|
},
|
|
34
35
|
"repository": "https://github.com/TypedProject/tsed-formio",
|
|
35
36
|
"bugs": {
|
|
@@ -8,32 +8,30 @@ describe("ActionsTable", () => {
|
|
|
8
8
|
it("should render the table actions", async () => {
|
|
9
9
|
const onAddAction = jest.fn();
|
|
10
10
|
|
|
11
|
-
const {
|
|
11
|
+
const { getByRole, getAllByRole } = render(
|
|
12
12
|
<Sandbox {...Sandbox.args} onAddAction={onAddAction} />
|
|
13
13
|
);
|
|
14
14
|
|
|
15
|
-
const btn =
|
|
15
|
+
const btn = getByRole("button", { name: /add action/i });
|
|
16
16
|
const cells = getAllByRole("cell");
|
|
17
|
-
const
|
|
17
|
+
const options = getAllByRole("option");
|
|
18
18
|
|
|
19
|
-
expect(btn).
|
|
20
|
-
expect(btn).
|
|
21
|
-
expect(cells[0]).
|
|
22
|
-
expect(
|
|
23
|
-
Sandbox.args.availableActions.length + 1
|
|
24
|
-
);
|
|
19
|
+
expect(btn).toHaveProperty("disabled");
|
|
20
|
+
expect(btn.innerHTML).toMatch("Add action");
|
|
21
|
+
expect(cells[0].innerHTML).toMatch("Save Submission");
|
|
22
|
+
expect(options.length).toEqual(Sandbox.args.availableActions.length + 1);
|
|
25
23
|
|
|
26
|
-
expect(
|
|
27
|
-
expect(
|
|
24
|
+
expect(options[0].innerHTML).toMatch("Select an action");
|
|
25
|
+
expect(options[1].innerHTML).toMatch("Email");
|
|
28
26
|
});
|
|
29
27
|
it("should not call addAction when the default item is selected", async () => {
|
|
30
28
|
const onAddAction = jest.fn();
|
|
31
29
|
|
|
32
|
-
const {
|
|
30
|
+
const { getByRole } = render(
|
|
33
31
|
<Sandbox {...Sandbox.args} onAddAction={onAddAction} />
|
|
34
32
|
);
|
|
35
33
|
|
|
36
|
-
const btn =
|
|
34
|
+
const btn = getByRole("button", { name: /add action/i });
|
|
37
35
|
|
|
38
36
|
await fireEvent.click(btn);
|
|
39
37
|
expect(onAddAction).not.toHaveBeenCalled();
|
|
@@ -41,12 +39,12 @@ describe("ActionsTable", () => {
|
|
|
41
39
|
it("should call addAction with the selected action", async () => {
|
|
42
40
|
const onAddAction = jest.fn();
|
|
43
41
|
|
|
44
|
-
const {
|
|
42
|
+
const { getByRole } = render(
|
|
45
43
|
<Sandbox {...Sandbox.args} onAddAction={onAddAction} />
|
|
46
44
|
);
|
|
47
45
|
|
|
48
|
-
const btn =
|
|
49
|
-
const select =
|
|
46
|
+
const btn = getByRole("button", { name: /add action/i });
|
|
47
|
+
const select = getByRole("combobox");
|
|
50
48
|
|
|
51
49
|
await userEvent.selectOptions(
|
|
52
50
|
select,
|
|
@@ -55,7 +53,7 @@ describe("ActionsTable", () => {
|
|
|
55
53
|
|
|
56
54
|
await fireEvent.click(btn);
|
|
57
55
|
|
|
58
|
-
expect(btn).not.
|
|
56
|
+
expect(btn).not.toHaveProperty("disabled", true);
|
|
59
57
|
expect(onAddAction).toHaveBeenCalledWith("webhook");
|
|
60
58
|
});
|
|
61
59
|
});
|
|
@@ -53,6 +53,7 @@ export function ActionsTable({
|
|
|
53
53
|
disabled={currentAction === ""}
|
|
54
54
|
className={"btn btn-success"}
|
|
55
55
|
onClick={() => currentAction && onAddAction(currentAction)}
|
|
56
|
+
type={"submit"}
|
|
56
57
|
>
|
|
57
58
|
<i className={classnames(iconClass(undefined, "plus"), "mr-1")} />{" "}
|
|
58
59
|
{i18n("Add action")}
|
|
@@ -6,8 +6,8 @@ describe("Card", () => {
|
|
|
6
6
|
it("should render the card component", () => {
|
|
7
7
|
const { getByRole } = render(<Sandbox {...Sandbox.args} />);
|
|
8
8
|
|
|
9
|
-
const title = getByRole("
|
|
10
|
-
const body = getByRole("
|
|
9
|
+
const title = getByRole("heading");
|
|
10
|
+
const body = getByRole("article");
|
|
11
11
|
|
|
12
12
|
expect(title).toHaveTextContent("label");
|
|
13
13
|
expect(body).toHaveTextContent("test");
|
|
@@ -14,11 +14,9 @@ export function Card({
|
|
|
14
14
|
return (
|
|
15
15
|
<div className={classnames("card", className)}>
|
|
16
16
|
<div className={"card-header "}>
|
|
17
|
-
<h4 className={"card-title"}
|
|
18
|
-
{label}
|
|
19
|
-
</h4>
|
|
17
|
+
<h4 className={"card-title"}>{label}</h4>
|
|
20
18
|
</div>
|
|
21
|
-
<div className={"card-body"} role={"
|
|
19
|
+
<div className={"card-body"} role={"article"}>
|
|
22
20
|
{children}
|
|
23
21
|
</div>
|
|
24
22
|
</div>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
2
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
1
3
|
import { ComponentSchema } from "formiojs";
|
|
2
4
|
import AllComponents from "formiojs/components";
|
|
3
5
|
import Components from "formiojs/components/Components";
|
|
@@ -32,7 +32,7 @@ export function FormsCell(
|
|
|
32
32
|
</span>
|
|
33
33
|
|
|
34
34
|
{(form.tags || []).map((tag, index) => (
|
|
35
|
-
<
|
|
35
|
+
<button
|
|
36
36
|
key={index}
|
|
37
37
|
className='badge badge-hover bg-secondary mr-1'
|
|
38
38
|
onClick={stopPropagationWrapper(() => {
|
|
@@ -42,7 +42,7 @@ export function FormsCell(
|
|
|
42
42
|
>
|
|
43
43
|
<i className={classnames(iconClass(undefined, "tags"), "mr-1")} />
|
|
44
44
|
{tag}
|
|
45
|
-
</
|
|
45
|
+
</button>
|
|
46
46
|
))}
|
|
47
47
|
</li>
|
|
48
48
|
</ul>
|
|
@@ -6,7 +6,7 @@ describe("Loader", () => {
|
|
|
6
6
|
it("should render a component (with isActive = true)", () => {
|
|
7
7
|
const { getByTestId } = render(<Loader isActive={true} />);
|
|
8
8
|
|
|
9
|
-
const icon = getByTestId("
|
|
9
|
+
const icon = getByTestId("icon_radio-circle");
|
|
10
10
|
|
|
11
11
|
expect(icon).toBeTruthy();
|
|
12
12
|
});
|
|
@@ -14,7 +14,7 @@ describe("Loader", () => {
|
|
|
14
14
|
it("should render a component (with isActive = false)", () => {
|
|
15
15
|
const { queryByTestId } = render(<Loader isActive={false} />);
|
|
16
16
|
|
|
17
|
-
const icon = queryByTestId("
|
|
17
|
+
const icon = queryByTestId("icon_radio-circle");
|
|
18
18
|
|
|
19
19
|
expect(icon).toBeFalsy();
|
|
20
20
|
});
|
|
@@ -16,7 +16,7 @@ describe("Modal", () => {
|
|
|
16
16
|
expect(queryByTestId("modalBody")).toBeFalsy();
|
|
17
17
|
expect(queryByTestId("modalFooter")).toBeFalsy();
|
|
18
18
|
|
|
19
|
-
fireEvent.click(screen.getByRole("
|
|
19
|
+
fireEvent.click(screen.getByRole("button", { name: "Open modal" }));
|
|
20
20
|
|
|
21
21
|
await waitFor(() => getByTestId("modalTitle"));
|
|
22
22
|
|
|
@@ -45,7 +45,7 @@ describe("Modal", () => {
|
|
|
45
45
|
expect(queryByTestId("modalBody")).toBeFalsy();
|
|
46
46
|
expect(queryByTestId("modalFooter")).toBeFalsy();
|
|
47
47
|
|
|
48
|
-
fireEvent.click(getByRole("
|
|
48
|
+
fireEvent.click(getByRole("button", { name: "Open modal" }));
|
|
49
49
|
|
|
50
50
|
await waitFor(() => getByTestId("modalTitle"));
|
|
51
51
|
|
|
@@ -67,7 +67,7 @@ describe("Modal", () => {
|
|
|
67
67
|
<WithFooter {...WithFooter.args} onSubmit={onSubmit} />
|
|
68
68
|
);
|
|
69
69
|
|
|
70
|
-
fireEvent.click(getByRole("
|
|
70
|
+
fireEvent.click(getByRole("button", { name: "Open modal" }));
|
|
71
71
|
|
|
72
72
|
await waitFor(() => getByTestId("modalTitle"));
|
|
73
73
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
2
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
1
3
|
import React, { PropsWithChildren, useEffect, useRef, useState } from "react";
|
|
2
4
|
import noop from "lodash";
|
|
3
5
|
|
|
@@ -61,7 +63,10 @@ export function Modal({
|
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
return (
|
|
64
|
-
<div
|
|
66
|
+
<div
|
|
67
|
+
role={"dialog"}
|
|
68
|
+
className={`formio-dialog formio-dialog-theme-default ${className}`}
|
|
69
|
+
>
|
|
65
70
|
<div className='formio-dialog-overlay' onClick={onClickClose} />
|
|
66
71
|
<div style={style} className={"formio-dialog-content"}>
|
|
67
72
|
<div className={"formio-dialog-wrapper"}>
|
|
@@ -26,11 +26,7 @@ export const Sandbox = (args: ModalProps) => {
|
|
|
26
26
|
return (
|
|
27
27
|
<div>
|
|
28
28
|
<div>
|
|
29
|
-
<button
|
|
30
|
-
role={"openModal"}
|
|
31
|
-
className={"btn btn-primary"}
|
|
32
|
-
onClick={modal.openModal}
|
|
33
|
-
>
|
|
29
|
+
<button className={"btn btn-primary"} onClick={modal.openModal}>
|
|
34
30
|
Open modal
|
|
35
31
|
</button>
|
|
36
32
|
</div>
|
|
@@ -51,11 +47,7 @@ export const WithTitle = (args: ModalProps) => {
|
|
|
51
47
|
return (
|
|
52
48
|
<div>
|
|
53
49
|
<div>
|
|
54
|
-
<button
|
|
55
|
-
role={"openModal"}
|
|
56
|
-
className={"btn btn-primary"}
|
|
57
|
-
onClick={modal.openModal}
|
|
58
|
-
>
|
|
50
|
+
<button className={"btn btn-primary"} onClick={modal.openModal}>
|
|
59
51
|
Open modal
|
|
60
52
|
</button>
|
|
61
53
|
</div>
|
|
@@ -103,11 +95,7 @@ export const WithFooter = (args: ModalProps) => {
|
|
|
103
95
|
return (
|
|
104
96
|
<div>
|
|
105
97
|
<div>
|
|
106
|
-
<button
|
|
107
|
-
className={"btn btn-primary"}
|
|
108
|
-
role={"openModal"}
|
|
109
|
-
onClick={modal.openModal}
|
|
110
|
-
>
|
|
98
|
+
<button className={"btn btn-primary"} onClick={modal.openModal}>
|
|
111
99
|
Open modal
|
|
112
100
|
</button>
|
|
113
101
|
</div>
|
|
@@ -185,12 +173,8 @@ export const WithRemoveModal = (args: RemoveModalProps) => {
|
|
|
185
173
|
return (
|
|
186
174
|
<div>
|
|
187
175
|
<div>
|
|
188
|
-
<button
|
|
189
|
-
|
|
190
|
-
role={"openModal"}
|
|
191
|
-
onClick={modal.openModal}
|
|
192
|
-
>
|
|
193
|
-
Open
|
|
176
|
+
<button className={"btn btn-primary"} onClick={modal.openModal}>
|
|
177
|
+
Open modal
|
|
194
178
|
</button>
|
|
195
179
|
</div>
|
|
196
180
|
<RemoveModal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import classnames from "classnames";
|
|
2
2
|
import noop from "lodash/noop";
|
|
3
|
-
import React, { useState } from "react";
|
|
3
|
+
import React, { PropsWithChildren, useState } from "react";
|
|
4
4
|
import { iconClass } from "../../utils/iconClass";
|
|
5
5
|
import { InputText } from "../input-text/inputText.component";
|
|
6
6
|
import { Modal, ModalProps } from "./modal.component";
|
|
@@ -10,7 +10,7 @@ function RemoveModalFooter({
|
|
|
10
10
|
valueToCompare,
|
|
11
11
|
onSubmit,
|
|
12
12
|
onClose,
|
|
13
|
-
i18n =
|
|
13
|
+
i18n = (f: string) => f
|
|
14
14
|
}: ModalProps) {
|
|
15
15
|
return (
|
|
16
16
|
<div className={"flex items-center justify-center bg-white p-2"}>
|
|
@@ -42,22 +42,29 @@ export interface RemoveModalProps extends ModalProps {
|
|
|
42
42
|
valueToCompare: string;
|
|
43
43
|
itemType?: string;
|
|
44
44
|
i18n?: (f: string) => string;
|
|
45
|
+
maxWidth?: string;
|
|
45
46
|
}
|
|
46
47
|
|
|
47
|
-
export function RemoveModal(
|
|
48
|
+
export function RemoveModal({
|
|
49
|
+
maxWidth = "300px",
|
|
50
|
+
children,
|
|
51
|
+
...props
|
|
52
|
+
}: PropsWithChildren<RemoveModalProps>) {
|
|
48
53
|
const { i18n = noop } = props;
|
|
49
54
|
const [value, setValue] = useState();
|
|
50
55
|
|
|
51
56
|
return (
|
|
52
57
|
<Modal
|
|
53
58
|
{...props}
|
|
54
|
-
|
|
59
|
+
className={classnames(props.className, "formio-dialog-theme-remove")}
|
|
60
|
+
style={{ maxWidth }}
|
|
55
61
|
title={`Drop ${props.itemType?.toLowerCase()}`}
|
|
56
62
|
value={value}
|
|
57
63
|
footer={RemoveModalFooter}
|
|
58
64
|
>
|
|
59
65
|
<div className={"px-4 pt-3 pb-5"}>
|
|
60
66
|
<div className={"pb-1"}>
|
|
67
|
+
{children}
|
|
61
68
|
{i18n("To drop")} <strong>{props.valueToCompare}</strong>,
|
|
62
69
|
{i18n("type the")}
|
|
63
70
|
<strong>"{props.itemType?.toLowerCase()}"</strong>
|
|
@@ -106,6 +106,7 @@ export class ReactComponent<Data = any> extends Components.components.field {
|
|
|
106
106
|
*/
|
|
107
107
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
108
108
|
attachReact(element?: any) {
|
|
109
|
+
// eslint-disable-next-line react/no-render-return-value
|
|
109
110
|
return ReactDOM.render(this.renderReact(), element);
|
|
110
111
|
}
|
|
111
112
|
|
|
@@ -30,7 +30,7 @@ export function DefaultOperationButton(props: OperationButtonProps) {
|
|
|
30
30
|
} = props;
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
|
-
<
|
|
33
|
+
<button
|
|
34
34
|
className={classnames(
|
|
35
35
|
className,
|
|
36
36
|
["btn", buttonOutline && "outline", buttonType]
|
|
@@ -48,6 +48,6 @@ export function DefaultOperationButton(props: OperationButtonProps) {
|
|
|
48
48
|
{title && (
|
|
49
49
|
<span className={icon && title ? "ml-1" : ""}>{i18n(title)}</span>
|
|
50
50
|
)}
|
|
51
|
-
</
|
|
51
|
+
</button>
|
|
52
52
|
);
|
|
53
53
|
}
|
|
@@ -12,13 +12,13 @@ describe("DefaultColumnFilter", () => {
|
|
|
12
12
|
column: { id: "id", filterValue: "", setFilter: jest.fn() }
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
const {
|
|
15
|
+
const { getByRole } = render(
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
17
17
|
// @ts-ignore
|
|
18
18
|
<DefaultColumnFilter {...props} />
|
|
19
19
|
);
|
|
20
20
|
|
|
21
|
-
const input =
|
|
21
|
+
const input = getByRole("textbox");
|
|
22
22
|
|
|
23
23
|
await act(async () => {
|
|
24
24
|
fireEvent.change(input, { target: { value: "value-test" } });
|
|
@@ -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";
|
|
@@ -215,10 +215,14 @@ export function Table<Data extends object = any>(
|
|
|
215
215
|
/* style={{ marginBottom: disablePagination ? "-1px" : "0px" }} */
|
|
216
216
|
>
|
|
217
217
|
<thead>
|
|
218
|
-
{tableInstance.headerGroups.map((headerGroup) => (
|
|
219
|
-
<tr
|
|
218
|
+
{tableInstance.headerGroups.map((headerGroup, i) => (
|
|
219
|
+
<tr
|
|
220
|
+
key={`tableInstance.headerGroups${i}`}
|
|
221
|
+
{...headerGroup.getHeaderGroupProps()}
|
|
222
|
+
>
|
|
220
223
|
{headerGroup.headers.map((column) => (
|
|
221
224
|
<th
|
|
225
|
+
key={`tableInstance.headers.column.${column.id}`}
|
|
222
226
|
/* className='text-left py-2 align-top' */
|
|
223
227
|
{...column.getHeaderProps()}
|
|
224
228
|
>
|
|
@@ -230,20 +234,27 @@ export function Table<Data extends object = any>(
|
|
|
230
234
|
</thead>
|
|
231
235
|
{!isLoading ? (
|
|
232
236
|
<tbody {...tableInstance.getTableBodyProps()}>
|
|
233
|
-
{tableInstance.page.map((row
|
|
237
|
+
{tableInstance.page.map((row) => {
|
|
234
238
|
tableInstance.prepareRow(row);
|
|
235
239
|
return (
|
|
236
240
|
<tr
|
|
241
|
+
key={`tableInstance.page.${row.id}`}
|
|
237
242
|
onClick={() => _onClick(row.original, "row")}
|
|
238
243
|
{...row.getRowProps()}
|
|
239
244
|
>
|
|
240
|
-
{row.cells.map((cell) => {
|
|
245
|
+
{row.cells.map((cell, i) => {
|
|
241
246
|
const { hidden, colspan } = cell.column as any;
|
|
242
247
|
if (hidden) {
|
|
243
248
|
return null;
|
|
244
249
|
}
|
|
245
250
|
return (
|
|
246
|
-
<td
|
|
251
|
+
<td
|
|
252
|
+
key={`tableInstance.page.cells.${
|
|
253
|
+
cell.value || "value"
|
|
254
|
+
}.${i}`}
|
|
255
|
+
colSpan={colspan}
|
|
256
|
+
{...cell.getCellProps()}
|
|
257
|
+
>
|
|
247
258
|
{cell.render("Cell")}
|
|
248
259
|
</td>
|
|
249
260
|
);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { Components, ExtendedComponentSchema } from "formiojs";
|
|
2
3
|
import FormioUtils from "formiojs/utils";
|
|
3
|
-
import React from "react";
|
|
4
4
|
import { Column } from "react-table";
|
|
5
5
|
import { FormSchema } from "../../../interfaces";
|
|
6
|
-
import {
|
|
6
|
+
import { DefaultCell } from "../components/defaultCell.component";
|
|
7
7
|
import { SelectColumnFilter } from "../filters/selectColumnFilter.component";
|
|
8
8
|
|
|
9
9
|
export function mapFormToColumns(form: FormSchema): Column[] {
|
|
@@ -19,7 +19,10 @@ export function mapFormToColumns(form: FormSchema): Column[] {
|
|
|
19
19
|
Header: component.label || component.title || component.key,
|
|
20
20
|
accessor: `data.${component.key}`,
|
|
21
21
|
Cell: (props: any) => (
|
|
22
|
-
<
|
|
22
|
+
<DefaultCell
|
|
23
|
+
{...props}
|
|
24
|
+
render={(value: any) => cmp.asString(value)}
|
|
25
|
+
/>
|
|
23
26
|
)
|
|
24
27
|
};
|
|
25
28
|
|