@conduction/components 1.0.2 → 1.0.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/lib/components/card/downloadCard/DownloadCard.d.ts +1 -0
- package/lib/components/card/downloadCard/DownloadCard.js +2 -4
- package/lib/components/editableTableRow/EditableTableRow.d.ts +3 -0
- package/lib/components/editableTableRow/EditableTableRow.js +6 -9
- package/lib/index.d.ts +1 -4
- package/lib/index.js +1 -4
- package/package.json +2 -17
- package/src/components/card/downloadCard/DownloadCard.tsx +4 -6
- package/src/components/editableTableRow/EditableTableRow.tsx +21 -13
- package/src/components/formFields/checkbox.tsx +6 -1
- package/src/components/formFields/input.tsx +7 -1
- package/src/components/formFields/textarea.tsx +7 -1
- package/src/components/formFields/types.ts +0 -17
- package/src/custom.d.ts +0 -1
- package/src/index.ts +0 -6
- package/lib/components/casesTable/CasesTable.d.ts +0 -6
- package/lib/components/casesTable/CasesTable.js +0 -11
- package/lib/components/casesTable/CasesTable.module.css +0 -4
- package/lib/components/messageForm/MessageForm.d.ts +0 -2
- package/lib/components/messageForm/MessageForm.js +0 -12
- package/lib/components/messagesTable/MessagesTable.d.ts +0 -11
- package/lib/components/messagesTable/MessagesTable.js +0 -11
- package/lib/components/messagesTable/MessagesTable.module.css +0 -4
- package/src/components/casesTable/CasesTable.js +0 -11
- package/src/components/casesTable/CasesTable.module.css +0 -4
- package/src/components/casesTable/CasesTable.tsx +0 -41
- package/src/components/messageForm/MessageForm.js +0 -12
- package/src/components/messageForm/MessageForm.tsx +0 -32
- package/src/components/messagesTable/MessagesTable.js +0 -11
- package/src/components/messagesTable/MessagesTable.module.css +0 -4
- package/src/components/messagesTable/MessagesTable.tsx +0 -45
|
@@ -3,8 +3,6 @@ import * as styles from "./DownloadCard.module.css";
|
|
|
3
3
|
import { DownloadIcon } from "@gemeente-denhaag/icons";
|
|
4
4
|
import { Link } from "@gemeente-denhaag/components-react";
|
|
5
5
|
import clsx from "clsx";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const { t } = useTranslation();
|
|
9
|
-
return (_jsxs("div", { className: clsx(styles.container, [layoutClassName && layoutClassName]), children: [_jsxs("div", { className: styles.content, children: [_jsx("div", { className: styles.icon, children: icon }), _jsxs("div", { children: [label, " (", sizeKb, "kb)"] })] }), _jsx(Link, { icon: _jsx(DownloadIcon, {}), iconAlign: "start", children: t("Download") })] }));
|
|
6
|
+
export const DownloadCard = ({ icon, label, sizeKb, layoutClassName, downloadLabel }) => {
|
|
7
|
+
return (_jsxs("div", { className: clsx(styles.container, [layoutClassName && layoutClassName]), children: [_jsxs("div", { className: styles.content, children: [_jsx("div", { className: styles.icon, children: icon }), _jsxs("div", { children: [label, " (", sizeKb, "kb)"] })] }), _jsx(Link, { icon: _jsx(DownloadIcon, {}), iconAlign: "start", children: downloadLabel })] }));
|
|
10
8
|
};
|
|
@@ -5,6 +5,9 @@ interface InputTypes {
|
|
|
5
5
|
interface EditableTableRowProps {
|
|
6
6
|
thead: string;
|
|
7
7
|
value: string;
|
|
8
|
+
saveLabel: string;
|
|
9
|
+
cancelLabel: string;
|
|
10
|
+
editLabel: string;
|
|
8
11
|
handleSave: (value: any) => void;
|
|
9
12
|
}
|
|
10
13
|
export declare const EditableTableRow: React.FC<EditableTableRowProps & InputTypes>;
|
|
@@ -2,27 +2,24 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { TableCell, TableHeader, TableRow } from "@gemeente-denhaag/table";
|
|
3
3
|
import * as styles from "./EditableTableRow.module.css";
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
5
|
import { Link } from "@gemeente-denhaag/components-react";
|
|
7
6
|
import { CheckedIcon, CloseIcon, EditIcon } from "@gemeente-denhaag/icons";
|
|
8
7
|
import { useForm } from "react-hook-form";
|
|
9
8
|
import { InputEmail, InputText } from "../formFields";
|
|
10
|
-
export const EditableTableRow = ({ thead, value, inputType, handleSave, }) => {
|
|
9
|
+
export const EditableTableRow = ({ thead, value, inputType, editLabel, cancelLabel, saveLabel, handleSave, }) => {
|
|
11
10
|
const [editing, setEditing] = React.useState(false);
|
|
12
|
-
return (_jsxs(TableRow, { children: [_jsx(TableHeader, { className: styles.th, children: thead }), editing && _jsx(EditingTableRow, { ...{ value, inputType, handleSave, setEditing } }), !editing && _jsx(RegularTableRow, { ...{ value, setEditing } })] }));
|
|
11
|
+
return (_jsxs(TableRow, { children: [_jsx(TableHeader, { className: styles.th, children: thead }), editing && _jsx(EditingTableRow, { ...{ value, inputType, handleSave, setEditing, saveLabel, cancelLabel } }), !editing && _jsx(RegularTableRow, { ...{ value, setEditing, editLabel } })] }));
|
|
13
12
|
};
|
|
14
|
-
const RegularTableRow = ({ value, setEditing }) => {
|
|
15
|
-
|
|
16
|
-
return (_jsxs(_Fragment, { children: [_jsx(TableCell, { children: value }), _jsx(TableCell, { children: _jsx("div", { className: styles.editButton, onClick: () => setEditing(true), children: _jsx(Link, { icon: _jsx(EditIcon, {}), iconAlign: "start", children: t("Edit") }) }) })] }));
|
|
13
|
+
const RegularTableRow = ({ value, editLabel, setEditing }) => {
|
|
14
|
+
return (_jsxs(_Fragment, { children: [_jsx(TableCell, { children: value }), _jsx(TableCell, { children: _jsx("div", { className: styles.editButton, onClick: () => setEditing(true), children: _jsx(Link, { icon: _jsx(EditIcon, {}), iconAlign: "start", children: editLabel }) }) })] }));
|
|
17
15
|
};
|
|
18
|
-
const EditingTableRow = ({ value, setEditing, handleSave, inputType, }) => {
|
|
19
|
-
const { t } = useTranslation();
|
|
16
|
+
const EditingTableRow = ({ value, setEditing, handleSave, inputType, saveLabel, cancelLabel, }) => {
|
|
20
17
|
const { register, handleSubmit, formState: { errors }, } = useForm();
|
|
21
18
|
const onSubmit = (data) => {
|
|
22
19
|
handleSave(data.value);
|
|
23
20
|
setEditing(false);
|
|
24
21
|
};
|
|
25
|
-
return (_jsxs(_Fragment, { children: [_jsx(TableCell, { children: _jsxs("form", { onSubmit: handleSubmit(onSubmit), children: [_jsx(FormField, { ...{ inputType, value, register, errors } }), _jsxs("div", { className: styles.editButtonsContainer, children: [_jsx("button", { type: "submit", className: styles.submit, children: _jsx(Link, { icon: _jsx(CheckedIcon, {}), iconAlign: "start", children:
|
|
22
|
+
return (_jsxs(_Fragment, { children: [_jsx(TableCell, { children: _jsxs("form", { onSubmit: handleSubmit(onSubmit), children: [_jsx(FormField, { ...{ inputType, value, register, errors } }), _jsxs("div", { className: styles.editButtonsContainer, children: [_jsx("button", { type: "submit", className: styles.submit, children: _jsx(Link, { icon: _jsx(CheckedIcon, {}), iconAlign: "start", children: saveLabel }) }), _jsx("div", { onClick: () => setEditing(false), children: _jsx(Link, { icon: _jsx(CloseIcon, {}), iconAlign: "start", className: styles.cancel, children: cancelLabel }) })] })] }) }), _jsx(TableCell, {})] }));
|
|
26
23
|
};
|
|
27
24
|
const FormField = ({ inputType, value, register, errors }) => {
|
|
28
25
|
switch (inputType) {
|
package/lib/index.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard } from "./components/card";
|
|
2
|
-
import { CasesTable } from "./components/casesTable/CasesTable";
|
|
3
2
|
import { Container } from "./components/container/Container";
|
|
4
3
|
import { Breadcrumbs } from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
|
|
5
4
|
import { EditableTableRow } from "./components/editableTableRow/EditableTableRow";
|
|
6
5
|
import { InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox } from "./components/formFields";
|
|
7
6
|
import { ImageDivider } from "./components/imageDivider/ImageDivider";
|
|
8
7
|
import { AuthenticatedLogo, UnauthenticatedLogo } from "./components/logo/Logo";
|
|
9
|
-
import { MessageForm } from "./components/messageForm/MessageForm";
|
|
10
|
-
import { MessagesTable } from "./components/messagesTable/MessagesTable";
|
|
11
8
|
import { MetaIcon } from "./components/metaIcon/MetaIcon";
|
|
12
9
|
import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
|
|
13
10
|
import { StatusSteps } from "./components/statusSteps/StatusSteps";
|
|
14
11
|
import { PrimaryTopNav, SecondaryTopNav } from "./components/topNav/TopNav";
|
|
15
|
-
export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard,
|
|
12
|
+
export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, };
|
package/lib/index.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard } from "./components/card";
|
|
2
|
-
import { CasesTable } from "./components/casesTable/CasesTable";
|
|
3
2
|
import { Container } from "./components/container/Container";
|
|
4
3
|
import { Breadcrumbs } from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
|
|
5
4
|
import { EditableTableRow } from "./components/editableTableRow/EditableTableRow";
|
|
6
5
|
import { InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, } from "./components/formFields";
|
|
7
6
|
import { ImageDivider } from "./components/imageDivider/ImageDivider";
|
|
8
7
|
import { AuthenticatedLogo, UnauthenticatedLogo } from "./components/logo/Logo";
|
|
9
|
-
import { MessageForm } from "./components/messageForm/MessageForm";
|
|
10
|
-
import { MessagesTable } from "./components/messagesTable/MessagesTable";
|
|
11
8
|
import { MetaIcon } from "./components/metaIcon/MetaIcon";
|
|
12
9
|
import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
|
|
13
10
|
import { StatusSteps } from "./components/statusSteps/StatusSteps";
|
|
14
11
|
import { PrimaryTopNav, SecondaryTopNav } from "./components/topNav/TopNav";
|
|
15
|
-
export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard,
|
|
12
|
+
export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard, Container, Breadcrumbs, EditableTableRow, InputText, InputPassword, InputEmail, InputDate, InputNumber, Textarea, InputCheckbox, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, StatusSteps, PrimaryTopNav, SecondaryTopNav, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conduction/components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,9 +19,6 @@
|
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://github.com/ConductionNL/conduction-components#readme",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fortawesome/fontawesome-svg-core": "^6.1.1",
|
|
23
|
-
"@fortawesome/free-solid-svg-icons": "^6.1.1",
|
|
24
|
-
"@fortawesome/react-fontawesome": "^0.1.18",
|
|
25
22
|
"@gemeente-denhaag/components-react": "^0.1.1-alpha.143",
|
|
26
23
|
"@gemeente-denhaag/design-tokens-components": "^0.2.3-alpha.178",
|
|
27
24
|
"@gemeente-denhaag/form-field": "^0.1.1-alpha.67",
|
|
@@ -29,24 +26,12 @@
|
|
|
29
26
|
"@gemeente-denhaag/sidenav": "^0.1.0-alpha.1",
|
|
30
27
|
"@gemeente-denhaag/table": "^0.1.1-alpha.87",
|
|
31
28
|
"@gemeente-denhaag/textarea": "^0.1.1-alpha.65",
|
|
32
|
-
"axios": "^0.25.0",
|
|
33
29
|
"clsx": "^1.1.1",
|
|
34
|
-
"dateformat": "^5.0.3",
|
|
35
30
|
"gatsby": "^4.11.1",
|
|
36
|
-
"gatsby-plugin-breadcrumb": "^12.3.1",
|
|
37
|
-
"gatsby-plugin-layout": "^3.11.0",
|
|
38
|
-
"i18next": "^21.6.16",
|
|
39
|
-
"jwt-decode": "^3.1.2",
|
|
40
|
-
"lodash": "^4.17.21",
|
|
41
31
|
"react": "^17.0.1",
|
|
42
|
-
"react-
|
|
43
|
-
"react-hook-form": "^7.29.0",
|
|
44
|
-
"react-i18next": "^11.16.6",
|
|
45
|
-
"react-loading-skeleton": "^3.1.0",
|
|
46
|
-
"react-query": "^3.34.19"
|
|
32
|
+
"react-hook-form": "^7.29.0"
|
|
47
33
|
},
|
|
48
34
|
"devDependencies": {
|
|
49
|
-
"@types/dateformat": "^5.0.0",
|
|
50
35
|
"@types/node": "^17.0.23",
|
|
51
36
|
"@types/react": "^17.0.43",
|
|
52
37
|
"@types/react-dom": "^17.0.14",
|
|
@@ -3,30 +3,28 @@ import * as styles from "./DownloadCard.module.css";
|
|
|
3
3
|
import { DownloadIcon } from "@gemeente-denhaag/icons";
|
|
4
4
|
import { Link } from "@gemeente-denhaag/components-react";
|
|
5
5
|
import clsx from "clsx";
|
|
6
|
-
import { useTranslation } from "react-i18next";
|
|
7
6
|
|
|
8
7
|
interface DownloadCardProps {
|
|
9
8
|
icon: JSX.Element;
|
|
10
9
|
label: string;
|
|
11
10
|
sizeKb: string;
|
|
11
|
+
downloadLabel: string;
|
|
12
12
|
layoutClassName?: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export const DownloadCard: React.FC<DownloadCardProps> = ({ icon, label, sizeKb, layoutClassName }) => {
|
|
16
|
-
const { t } = useTranslation();
|
|
17
|
-
|
|
15
|
+
export const DownloadCard: React.FC<DownloadCardProps> = ({ icon, label, sizeKb, layoutClassName, downloadLabel }) => {
|
|
18
16
|
return (
|
|
19
17
|
<div className={clsx(styles.container, [layoutClassName && layoutClassName])}>
|
|
20
18
|
<div className={styles.content}>
|
|
21
19
|
<div className={styles.icon}>{icon}</div>
|
|
22
|
-
|
|
20
|
+
|
|
23
21
|
<div>
|
|
24
22
|
{label} ({sizeKb}kb)
|
|
25
23
|
</div>
|
|
26
24
|
</div>
|
|
27
25
|
|
|
28
26
|
<Link icon={<DownloadIcon />} iconAlign="start">
|
|
29
|
-
{
|
|
27
|
+
{downloadLabel}
|
|
30
28
|
</Link>
|
|
31
29
|
</div>
|
|
32
30
|
);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TableCell, TableHeader, TableRow } from "@gemeente-denhaag/table";
|
|
2
2
|
import * as styles from "./EditableTableRow.module.css";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
4
|
import { Link } from "@gemeente-denhaag/components-react";
|
|
6
5
|
import { CheckedIcon, CloseIcon, EditIcon } from "@gemeente-denhaag/icons";
|
|
7
6
|
import { FieldValues, useForm, UseFormRegister } from "react-hook-form";
|
|
@@ -14,6 +13,9 @@ interface InputTypes {
|
|
|
14
13
|
interface EditableTableRowProps {
|
|
15
14
|
thead: string;
|
|
16
15
|
value: string;
|
|
16
|
+
saveLabel: string;
|
|
17
|
+
cancelLabel: string;
|
|
18
|
+
editLabel: string;
|
|
17
19
|
handleSave: (value: any) => void;
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -21,6 +23,9 @@ export const EditableTableRow: React.FC<EditableTableRowProps & InputTypes> = ({
|
|
|
21
23
|
thead,
|
|
22
24
|
value,
|
|
23
25
|
inputType,
|
|
26
|
+
editLabel,
|
|
27
|
+
cancelLabel,
|
|
28
|
+
saveLabel,
|
|
24
29
|
handleSave,
|
|
25
30
|
}) => {
|
|
26
31
|
const [editing, setEditing] = React.useState<boolean>(false);
|
|
@@ -29,8 +34,8 @@ export const EditableTableRow: React.FC<EditableTableRowProps & InputTypes> = ({
|
|
|
29
34
|
<TableRow>
|
|
30
35
|
<TableHeader className={styles.th}>{thead}</TableHeader>
|
|
31
36
|
|
|
32
|
-
{editing && <EditingTableRow {...{ value, inputType, handleSave, setEditing }} />}
|
|
33
|
-
{!editing && <RegularTableRow {...{ value, setEditing }} />}
|
|
37
|
+
{editing && <EditingTableRow {...{ value, inputType, handleSave, setEditing, saveLabel, cancelLabel }} />}
|
|
38
|
+
{!editing && <RegularTableRow {...{ value, setEditing, editLabel }} />}
|
|
34
39
|
</TableRow>
|
|
35
40
|
);
|
|
36
41
|
};
|
|
@@ -39,14 +44,13 @@ export const EditableTableRow: React.FC<EditableTableRowProps & InputTypes> = ({
|
|
|
39
44
|
* Specific rows based on editing (Regular: not editing & Editing: editing)
|
|
40
45
|
*/
|
|
41
46
|
|
|
42
|
-
interface
|
|
47
|
+
interface RegularTableRowProps {
|
|
43
48
|
value: string;
|
|
49
|
+
editLabel: string;
|
|
44
50
|
setEditing: React.Dispatch<React.SetStateAction<boolean>>;
|
|
45
51
|
}
|
|
46
52
|
|
|
47
|
-
const RegularTableRow: React.FC<
|
|
48
|
-
const { t } = useTranslation();
|
|
49
|
-
|
|
53
|
+
const RegularTableRow: React.FC<RegularTableRowProps> = ({ value, editLabel, setEditing }) => {
|
|
50
54
|
return (
|
|
51
55
|
<>
|
|
52
56
|
<TableCell>{value}</TableCell>
|
|
@@ -54,7 +58,7 @@ const RegularTableRow: React.FC<SpecificRowsProps> = ({ value, setEditing }) =>
|
|
|
54
58
|
<TableCell>
|
|
55
59
|
<div className={styles.editButton} onClick={() => setEditing(true)}>
|
|
56
60
|
<Link icon={<EditIcon />} iconAlign="start">
|
|
57
|
-
{
|
|
61
|
+
{editLabel}
|
|
58
62
|
</Link>
|
|
59
63
|
</div>
|
|
60
64
|
</TableCell>
|
|
@@ -63,17 +67,21 @@ const RegularTableRow: React.FC<SpecificRowsProps> = ({ value, setEditing }) =>
|
|
|
63
67
|
};
|
|
64
68
|
|
|
65
69
|
interface EditingTableRowProps {
|
|
70
|
+
value: string;
|
|
71
|
+
setEditing: React.Dispatch<React.SetStateAction<boolean>>;
|
|
72
|
+
saveLabel: string;
|
|
73
|
+
cancelLabel: string;
|
|
66
74
|
handleSave: (value: any) => void;
|
|
67
75
|
}
|
|
68
76
|
|
|
69
|
-
const EditingTableRow: React.FC<
|
|
77
|
+
const EditingTableRow: React.FC<EditingTableRowProps & InputTypes> = ({
|
|
70
78
|
value,
|
|
71
79
|
setEditing,
|
|
72
80
|
handleSave,
|
|
73
81
|
inputType,
|
|
82
|
+
saveLabel,
|
|
83
|
+
cancelLabel,
|
|
74
84
|
}) => {
|
|
75
|
-
const { t } = useTranslation();
|
|
76
|
-
|
|
77
85
|
const {
|
|
78
86
|
register,
|
|
79
87
|
handleSubmit,
|
|
@@ -94,13 +102,13 @@ const EditingTableRow: React.FC<SpecificRowsProps & EditingTableRowProps & Input
|
|
|
94
102
|
<div className={styles.editButtonsContainer}>
|
|
95
103
|
<button type="submit" className={styles.submit}>
|
|
96
104
|
<Link icon={<CheckedIcon />} iconAlign="start">
|
|
97
|
-
{
|
|
105
|
+
{saveLabel}
|
|
98
106
|
</Link>
|
|
99
107
|
</button>
|
|
100
108
|
|
|
101
109
|
<div onClick={() => setEditing(false)}>
|
|
102
110
|
<Link icon={<CloseIcon />} iconAlign="start" className={styles.cancel}>
|
|
103
|
-
{
|
|
111
|
+
{cancelLabel}
|
|
104
112
|
</Link>
|
|
105
113
|
</div>
|
|
106
114
|
</div>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { FormControlLabel } from "@gemeente-denhaag/components-react";
|
|
2
|
-
import {
|
|
2
|
+
import { IReactHookFormProps } from "./types";
|
|
3
|
+
|
|
4
|
+
export interface ICheckboxProps {
|
|
5
|
+
label: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
3
8
|
|
|
4
9
|
export const InputCheckbox: React.FC<ICheckboxProps & IReactHookFormProps> = ({
|
|
5
10
|
name,
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { TextField } from "@gemeente-denhaag/components-react";
|
|
3
3
|
import { ShowIcon, HideIcon } from "@gemeente-denhaag/icons";
|
|
4
|
-
import {
|
|
4
|
+
import { IReactHookFormProps } from "./types";
|
|
5
|
+
|
|
6
|
+
export interface IInputProps {
|
|
7
|
+
name: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
}
|
|
5
11
|
|
|
6
12
|
export const InputPassword: React.FC<IInputProps & IReactHookFormProps> = ({
|
|
7
13
|
disabled,
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { TextArea } from "@gemeente-denhaag/textarea";
|
|
3
|
-
import {
|
|
3
|
+
import { IReactHookFormProps } from "./types";
|
|
4
|
+
|
|
5
|
+
export interface ITextAreaProps {
|
|
6
|
+
name: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
}
|
|
4
10
|
|
|
5
11
|
export const Textarea: React.FC<ITextAreaProps & IReactHookFormProps> = ({ name, validation, register, errors }) => (
|
|
6
12
|
<TextArea {...register(name, { ...validation })} invalid={errors[name]} />
|
|
@@ -5,20 +5,3 @@ export interface IReactHookFormProps {
|
|
|
5
5
|
errors: FieldErrors;
|
|
6
6
|
validation?: Omit<RegisterOptions<FieldValues, any>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
export interface IInputProps {
|
|
10
|
-
name: string;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
defaultValue?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface ITextAreaProps {
|
|
16
|
-
name: string;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
defaultValue?: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface ICheckboxProps {
|
|
22
|
-
label: string;
|
|
23
|
-
name: string;
|
|
24
|
-
}
|
package/src/custom.d.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, RichContentCard } from "./components/card";
|
|
2
|
-
import { CasesTable } from "./components/casesTable/CasesTable";
|
|
3
2
|
import { Container } from "./components/container/Container";
|
|
4
3
|
import { Breadcrumbs } from "./components/denhaag-wrappers/breadcrumbs/Breadcrumbs";
|
|
5
4
|
import { EditableTableRow } from "./components/editableTableRow/EditableTableRow";
|
|
@@ -14,8 +13,6 @@ import {
|
|
|
14
13
|
} from "./components/formFields";
|
|
15
14
|
import { ImageDivider } from "./components/imageDivider/ImageDivider";
|
|
16
15
|
import { AuthenticatedLogo, UnauthenticatedLogo } from "./components/logo/Logo";
|
|
17
|
-
import { MessageForm } from "./components/messageForm/MessageForm";
|
|
18
|
-
import { MessagesTable } from "./components/messagesTable/MessagesTable";
|
|
19
16
|
import { MetaIcon } from "./components/metaIcon/MetaIcon";
|
|
20
17
|
import { PrivateRoute } from "./components/privateRoute/PrivateRoute";
|
|
21
18
|
import { StatusSteps } from "./components/statusSteps/StatusSteps";
|
|
@@ -26,7 +23,6 @@ export {
|
|
|
26
23
|
HorizontalImageCard,
|
|
27
24
|
ImageAndDetailsCard,
|
|
28
25
|
RichContentCard,
|
|
29
|
-
CasesTable,
|
|
30
26
|
Container,
|
|
31
27
|
Breadcrumbs,
|
|
32
28
|
EditableTableRow,
|
|
@@ -40,8 +36,6 @@ export {
|
|
|
40
36
|
ImageDivider,
|
|
41
37
|
AuthenticatedLogo,
|
|
42
38
|
UnauthenticatedLogo,
|
|
43
|
-
MessageForm,
|
|
44
|
-
MessagesTable,
|
|
45
39
|
MetaIcon,
|
|
46
40
|
PrivateRoute,
|
|
47
41
|
StatusSteps,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as styles from "./CasesTable.module.css";
|
|
3
|
-
import { Link } from "@gemeente-denhaag/components-react";
|
|
4
|
-
import { Table, TableBody, TableCell, TableHeader, TableRow } from "@gemeente-denhaag/table";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
|
-
import { ArrowRightIcon } from "@gemeente-denhaag/icons";
|
|
7
|
-
import { navigate } from "gatsby";
|
|
8
|
-
export const CasesTable = ({ cases }) => {
|
|
9
|
-
const { t } = useTranslation();
|
|
10
|
-
return (_jsx(Table, { children: _jsxs(TableBody, { children: [_jsxs(TableRow, { children: [_jsx(TableHeader, { children: t("Title") }), _jsx(TableHeader, { children: t("Status") }), _jsx(TableHeader, { children: t("Date") }), _jsx(TableHeader, {})] }), cases.map((_case) => (_jsxs(TableRow, { className: styles.contentRow, children: [_jsx(TableCell, { children: _case.omschrijving }), _jsx(TableCell, { children: _case.status }), _jsx(TableCell, { children: _case.startdatum }), _jsx(TableCell, { onClick: () => navigate(`/my-cases/${_case.id}`), children: _jsx(Link, { icon: _jsx(ArrowRightIcon, {}), iconAlign: "start", children: t("View case") }) })] }, _case.id)))] }) }));
|
|
11
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useForm } from "react-hook-form";
|
|
3
|
-
import { Button, FormField, FormFieldInput, FormFieldLabel } from "@gemeente-denhaag/components-react";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { Textarea } from "../formFields";
|
|
6
|
-
export const MessageForm = () => {
|
|
7
|
-
const { t } = useTranslation();
|
|
8
|
-
const { register, handleSubmit, formState: { errors }, } = useForm();
|
|
9
|
-
//the empty onSubmit is dependend on an API to function. This API is not yet implemented
|
|
10
|
-
const onSubmit = async () => { };
|
|
11
|
-
return (_jsxs("form", { onSubmit: handleSubmit(onSubmit), children: [_jsx(FormField, { children: _jsxs(FormFieldInput, { children: [_jsx(FormFieldLabel, { children: t("Message") }), _jsx(Textarea, { ...{ register, errors }, name: "message", validation: { required: true } })] }) }), _jsx(Button, { size: "large", type: "submit", children: t("Send") })] }));
|
|
12
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface IMessageTableItem {
|
|
3
|
-
organisation: string;
|
|
4
|
-
date: Date;
|
|
5
|
-
id: string;
|
|
6
|
-
}
|
|
7
|
-
interface MessagesTableProps {
|
|
8
|
-
messages: IMessageTableItem[];
|
|
9
|
-
}
|
|
10
|
-
export declare const MessagesTable: React.FC<MessagesTableProps>;
|
|
11
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as styles from "./MessagesTable.module.css";
|
|
3
|
-
import { Link } from "@gemeente-denhaag/components-react";
|
|
4
|
-
import { Table, TableBody, TableCell, TableHeader, TableRow } from "@gemeente-denhaag/table";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
|
-
import { ArrowRightIcon } from "@gemeente-denhaag/icons";
|
|
7
|
-
import { navigate } from "gatsby";
|
|
8
|
-
export const MessagesTable = ({ messages }) => {
|
|
9
|
-
const { t } = useTranslation();
|
|
10
|
-
return (_jsx(Table, { children: _jsxs(TableBody, { children: [_jsxs(TableRow, { children: [_jsx(TableHeader, { children: t("Organisation") }), _jsx(TableHeader, { children: t("Date") }), _jsx(TableHeader, {})] }), messages.map(({ organisation, date, id }) => (_jsxs(TableRow, { className: styles.contentRow, children: [_jsx(TableCell, { children: organisation }), _jsx(TableCell, { children: date }), _jsx(TableCell, { onClick: () => navigate(`/my-messages/${id}`), children: _jsx(Link, { icon: _jsx(ArrowRightIcon, {}), iconAlign: "start", children: t("View message") }) })] }, id)))] }) }));
|
|
11
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as styles from "./CasesTable.module.css";
|
|
3
|
-
import { Link } from "@gemeente-denhaag/components-react";
|
|
4
|
-
import { Table, TableBody, TableCell, TableHeader, TableRow } from "@gemeente-denhaag/table";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
|
-
import { ArrowRightIcon } from "@gemeente-denhaag/icons";
|
|
7
|
-
import { navigate } from "gatsby";
|
|
8
|
-
export const CasesTable = ({ cases }) => {
|
|
9
|
-
const { t } = useTranslation();
|
|
10
|
-
return (_jsx(Table, { children: _jsxs(TableBody, { children: [_jsxs(TableRow, { children: [_jsx(TableHeader, { children: t("Title") }), _jsx(TableHeader, { children: t("Status") }), _jsx(TableHeader, { children: t("Date") }), _jsx(TableHeader, {})] }), cases.map((_case) => (_jsxs(TableRow, { className: styles.contentRow, children: [_jsx(TableCell, { children: _case.omschrijving }), _jsx(TableCell, { children: _case.status }), _jsx(TableCell, { children: _case.startdatum }), _jsx(TableCell, { onClick: () => navigate(`/my-cases/${_case.id}`), children: _jsx(Link, { icon: _jsx(ArrowRightIcon, {}), iconAlign: "start", children: t("View case") }) })] }, _case.id)))] }) }));
|
|
11
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as styles from "./CasesTable.module.css";
|
|
3
|
-
import { Link } from "@gemeente-denhaag/components-react";
|
|
4
|
-
import { Table, TableBody, TableCell, TableHeader, TableRow } from "@gemeente-denhaag/table";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
|
-
import { ArrowRightIcon } from "@gemeente-denhaag/icons";
|
|
7
|
-
import { navigate } from "gatsby";
|
|
8
|
-
|
|
9
|
-
interface CasesTableProps {
|
|
10
|
-
cases: any[];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const CasesTable: React.FC<CasesTableProps> = ({ cases }) => {
|
|
14
|
-
const { t } = useTranslation();
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<Table>
|
|
18
|
-
<TableBody>
|
|
19
|
-
<TableRow>
|
|
20
|
-
<TableHeader>{t("Title")}</TableHeader>
|
|
21
|
-
<TableHeader>{t("Status")}</TableHeader>
|
|
22
|
-
<TableHeader>{t("Date")}</TableHeader>
|
|
23
|
-
<TableHeader />
|
|
24
|
-
</TableRow>
|
|
25
|
-
{cases.map((_case) => (
|
|
26
|
-
<TableRow key={_case.id} className={styles.contentRow}>
|
|
27
|
-
<TableCell>{_case.omschrijving}</TableCell>
|
|
28
|
-
<TableCell>{_case.status}</TableCell>
|
|
29
|
-
<TableCell>{_case.startdatum}</TableCell>
|
|
30
|
-
|
|
31
|
-
<TableCell onClick={() => navigate(`/my-cases/${_case.id}`)}>
|
|
32
|
-
<Link icon={<ArrowRightIcon />} iconAlign="start">
|
|
33
|
-
{t("View case")}
|
|
34
|
-
</Link>
|
|
35
|
-
</TableCell>
|
|
36
|
-
</TableRow>
|
|
37
|
-
))}
|
|
38
|
-
</TableBody>
|
|
39
|
-
</Table>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useForm } from "react-hook-form";
|
|
3
|
-
import { Button, FormField, FormFieldInput, FormFieldLabel } from "@gemeente-denhaag/components-react";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { Textarea } from "../formFields";
|
|
6
|
-
export const MessageForm = () => {
|
|
7
|
-
const { t } = useTranslation();
|
|
8
|
-
const { register, handleSubmit, formState: { errors }, } = useForm();
|
|
9
|
-
//the empty onSubmit is dependend on an API to function. This API is not yet implemented
|
|
10
|
-
const onSubmit = async () => { };
|
|
11
|
-
return (_jsxs("form", { onSubmit: handleSubmit(onSubmit), children: [_jsx(FormField, { children: _jsxs(FormFieldInput, { children: [_jsx(FormFieldLabel, { children: t("Message") }), _jsx(Textarea, { ...{ register, errors }, name: "message", validation: { required: true } })] }) }), _jsx(Button, { size: "large", type: "submit", children: t("Send") })] }));
|
|
12
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { useForm } from "react-hook-form";
|
|
3
|
-
import { Button, FormField, FormFieldInput, FormFieldLabel } from "@gemeente-denhaag/components-react";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { Textarea } from "../formFields";
|
|
6
|
-
|
|
7
|
-
export const MessageForm: React.FC = () => {
|
|
8
|
-
const { t } = useTranslation();
|
|
9
|
-
|
|
10
|
-
const {
|
|
11
|
-
register,
|
|
12
|
-
handleSubmit,
|
|
13
|
-
formState: { errors },
|
|
14
|
-
} = useForm();
|
|
15
|
-
|
|
16
|
-
//the empty onSubmit is dependend on an API to function. This API is not yet implemented
|
|
17
|
-
const onSubmit = async () => {};
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<form onSubmit={handleSubmit(onSubmit)}>
|
|
21
|
-
<FormField>
|
|
22
|
-
<FormFieldInput>
|
|
23
|
-
<FormFieldLabel>{t("Message")}</FormFieldLabel>
|
|
24
|
-
<Textarea {...{ register, errors }} name="message" validation={{ required: true }} />
|
|
25
|
-
</FormFieldInput>
|
|
26
|
-
</FormField>
|
|
27
|
-
<Button size="large" type="submit">
|
|
28
|
-
{t("Send")}
|
|
29
|
-
</Button>
|
|
30
|
-
</form>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as styles from "./MessagesTable.module.css";
|
|
3
|
-
import { Link } from "@gemeente-denhaag/components-react";
|
|
4
|
-
import { Table, TableBody, TableCell, TableHeader, TableRow } from "@gemeente-denhaag/table";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
|
-
import { ArrowRightIcon } from "@gemeente-denhaag/icons";
|
|
7
|
-
import { navigate } from "gatsby";
|
|
8
|
-
export const MessagesTable = ({ messages }) => {
|
|
9
|
-
const { t } = useTranslation();
|
|
10
|
-
return (_jsx(Table, { children: _jsxs(TableBody, { children: [_jsxs(TableRow, { children: [_jsx(TableHeader, { children: t("Organisation") }), _jsx(TableHeader, { children: t("Date") }), _jsx(TableHeader, {})] }), messages.map(({ organisation, date, id }) => (_jsxs(TableRow, { className: styles.contentRow, children: [_jsx(TableCell, { children: organisation }), _jsx(TableCell, { children: date }), _jsx(TableCell, { onClick: () => navigate(`/my-messages/${id}`), children: _jsx(Link, { icon: _jsx(ArrowRightIcon, {}), iconAlign: "start", children: t("View message") }) })] }, id)))] }) }));
|
|
11
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as styles from "./MessagesTable.module.css";
|
|
3
|
-
import { Link } from "@gemeente-denhaag/components-react";
|
|
4
|
-
import { Table, TableBody, TableCell, TableHeader, TableRow } from "@gemeente-denhaag/table";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
|
-
import { ArrowRightIcon } from "@gemeente-denhaag/icons";
|
|
7
|
-
import { navigate } from "gatsby";
|
|
8
|
-
|
|
9
|
-
export interface IMessageTableItem {
|
|
10
|
-
organisation: string;
|
|
11
|
-
date: Date;
|
|
12
|
-
id: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface MessagesTableProps {
|
|
16
|
-
messages: IMessageTableItem[];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const MessagesTable: React.FC<MessagesTableProps> = ({ messages }) => {
|
|
20
|
-
const { t } = useTranslation();
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<Table>
|
|
24
|
-
<TableBody>
|
|
25
|
-
<TableRow>
|
|
26
|
-
<TableHeader>{t("Organisation")}</TableHeader>
|
|
27
|
-
<TableHeader>{t("Date")}</TableHeader>
|
|
28
|
-
<TableHeader />
|
|
29
|
-
</TableRow>
|
|
30
|
-
{messages.map(({ organisation, date, id }) => (
|
|
31
|
-
<TableRow key={id} className={styles.contentRow}>
|
|
32
|
-
<TableCell>{organisation}</TableCell>
|
|
33
|
-
<TableCell>{date}</TableCell>
|
|
34
|
-
|
|
35
|
-
<TableCell onClick={() => navigate(`/my-messages/${id}`)}>
|
|
36
|
-
<Link icon={<ArrowRightIcon />} iconAlign="start">
|
|
37
|
-
{t("View message")}
|
|
38
|
-
</Link>
|
|
39
|
-
</TableCell>
|
|
40
|
-
</TableRow>
|
|
41
|
-
))}
|
|
42
|
-
</TableBody>
|
|
43
|
-
</Table>
|
|
44
|
-
);
|
|
45
|
-
};
|