@conduction/components 2.2.19 → 2.2.21
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/.prettierrc +30 -30
- package/README.md +5 -0
- package/lib/components/Pagination/Pagination.d.ts +14 -14
- package/lib/components/Pagination/Pagination.js +12 -12
- package/lib/components/badgeCounter/BadgeCounter.d.ts +8 -8
- package/lib/components/badgeCounter/BadgeCounter.js +4 -4
- package/lib/components/badgeCounter/BadgeCounter.module.css +27 -27
- package/lib/components/card/cardHeader/CardHeader.d.ts +4 -4
- package/lib/components/card/cardHeader/CardHeader.js +14 -14
- package/lib/components/card/cardHeader/CardHeader.module.css +10 -0
- package/lib/components/card/cardWrapper/CardWrapper.d.ts +2 -2
- package/lib/components/card/cardWrapper/CardWrapper.js +6 -6
- package/lib/components/card/cardWrapper/CardWrapper.module.css +1 -0
- package/lib/components/card/detailsCard/DetailsCard.d.ts +14 -14
- package/lib/components/card/detailsCard/DetailsCard.js +11 -11
- package/lib/components/card/downloadCard/DownloadCard.d.ts +11 -11
- package/lib/components/card/downloadCard/DownloadCard.js +9 -9
- package/lib/components/card/horizontalImageCard/HorizontalImageCard.d.ts +13 -13
- package/lib/components/card/horizontalImageCard/HorizontalImageCard.js +10 -10
- package/lib/components/card/imageAndDetailsCard/ImageAndDetailsCard.d.ts +14 -14
- package/lib/components/card/imageAndDetailsCard/ImageAndDetailsCard.js +10 -10
- package/lib/components/card/index.d.ts +8 -8
- package/lib/components/card/index.js +8 -8
- package/lib/components/card/infoCard/InfoCard.d.ts +8 -8
- package/lib/components/card/infoCard/InfoCard.js +6 -6
- package/lib/components/card/infoCard/InfoCard.module.css +26 -26
- package/lib/components/card/richContentCard/RichContentCard.d.ts +19 -19
- package/lib/components/card/richContentCard/RichContentCard.js +15 -16
- package/lib/components/card/richContentCard/RichContentCard.module.css +103 -93
- package/lib/components/codeBlock/CodeBlock.d.ts +6 -6
- package/lib/components/codeBlock/CodeBlock.js +3 -3
- package/lib/components/codeBlock/CodeBlock.module.css +6 -6
- package/lib/components/container/Container.d.ts +6 -6
- package/lib/components/container/Container.js +4 -4
- package/lib/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.css +222 -222
- package/lib/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.d.ts +17 -17
- package/lib/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.js +20 -20
- package/lib/components/denhaag-wrappers/pagination/Pagination.css +120 -120
- package/lib/components/denhaag-wrappers/pagination/Pagination.d.ts +9 -9
- package/lib/components/denhaag-wrappers/pagination/Pagination.js +15 -15
- package/lib/components/editableTableRow/EditableTableRow.d.ts +14 -14
- package/lib/components/editableTableRow/EditableTableRow.js +31 -31
- package/lib/components/editableTableRow/EditableTableRow.module.css +25 -25
- package/lib/components/formFields/checkbox/Checkbox.module.css +7 -7
- package/lib/components/formFields/checkbox/checkbox.d.ts +9 -9
- package/lib/components/formFields/checkbox/checkbox.js +3 -3
- package/lib/components/formFields/createKeyValue/CreateKeyValue.d.ts +23 -23
- package/lib/components/formFields/createKeyValue/CreateKeyValue.js +40 -40
- package/lib/components/formFields/date/Date.d.ts +12 -12
- package/lib/components/formFields/date/Date.js +10 -10
- package/lib/components/formFields/date/Date.module.css +12 -12
- package/lib/components/formFields/errorMessage/ErrorMessage.d.ts +5 -5
- package/lib/components/formFields/errorMessage/ErrorMessage.js +3 -3
- package/lib/components/formFields/index.d.ts +7 -7
- package/lib/components/formFields/index.js +7 -7
- package/lib/components/formFields/input.d.ts +22 -22
- package/lib/components/formFields/input.js +12 -12
- package/lib/components/formFields/radio.d.ts +9 -9
- package/lib/components/formFields/radio.js +3 -3
- package/lib/components/formFields/select/select.d.ts +24 -24
- package/lib/components/formFields/select/select.js +74 -74
- package/lib/components/formFields/textarea.d.ts +10 -10
- package/lib/components/formFields/textarea.js +4 -4
- package/lib/components/formFields/types.d.ts +6 -6
- package/lib/components/formFields/types.js +1 -1
- package/lib/components/horizontalOverflowWrapper/HorizontalOverflowWrapper.d.ts +10 -10
- package/lib/components/horizontalOverflowWrapper/HorizontalOverflowWrapper.js +36 -36
- package/lib/components/htmlParser/ParsedHTML.d.ts +10 -0
- package/lib/components/htmlParser/ParsedHTML.js +17 -0
- package/lib/components/htmlParser/ParsedHTML.module.css +7 -0
- package/lib/components/htmlParser/parser/alert/getAlert.d.ts +1 -0
- package/lib/components/htmlParser/parser/alert/getAlert.js +18 -0
- package/lib/components/htmlParser/parser/alert/getAlert.module.css +28 -0
- package/lib/components/htmlParser/parser/anchor/getAnchor.d.ts +2 -0
- package/lib/components/htmlParser/parser/anchor/getAnchor.js +74 -0
- package/lib/components/htmlParser/parser/code/getCode.d.ts +1 -0
- package/lib/components/htmlParser/parser/code/getCode.js +11 -0
- package/lib/components/htmlParser/parser/getBlockquote/getBlockquote.d.ts +1 -0
- package/lib/components/htmlParser/parser/getBlockquote/getBlockquote.js +6 -0
- package/lib/components/htmlParser/parser/header/getHeader.d.ts +1 -0
- package/lib/components/htmlParser/parser/header/getHeader.js +15 -0
- package/lib/components/htmlParser/parser/image/getImage.d.ts +1 -0
- package/lib/components/htmlParser/parser/image/getImage.js +28 -0
- package/lib/components/htmlParser/parser/list/getList.d.ts +1 -0
- package/lib/components/htmlParser/parser/list/getList.js +12 -0
- package/lib/components/htmlParser/parser/list/getList.module.css +3 -0
- package/lib/components/htmlParser/parser/listItem/getListItem.d.ts +1 -0
- package/lib/components/htmlParser/parser/listItem/getListItem.js +12 -0
- package/lib/components/htmlParser/parser/paragraph/getParagraph.d.ts +1 -0
- package/lib/components/htmlParser/parser/paragraph/getParagraph.js +6 -0
- package/lib/components/htmlParser/parser/svg/getSvg.d.ts +1 -0
- package/lib/components/htmlParser/parser/svg/getSvg.js +8 -0
- package/lib/components/htmlParser/parser/table/getTable.d.ts +1 -0
- package/lib/components/htmlParser/parser/table/getTable.js +7 -0
- package/lib/components/htmlParser/parser/table/getTable.module.css +3 -0
- package/lib/components/htmlParser/parser/tableBody/getTableBody.d.ts +1 -0
- package/lib/components/htmlParser/parser/tableBody/getTableBody.js +7 -0
- package/lib/components/htmlParser/parser/tableBody/getTableBody.module.css +3 -0
- package/lib/components/htmlParser/parser/tableCell/getTableCell.d.ts +1 -0
- package/lib/components/htmlParser/parser/tableCell/getTableCell.js +7 -0
- package/lib/components/htmlParser/parser/tableCell/getTableCell.module.css +3 -0
- package/lib/components/htmlParser/parser/tableHeader/getTableHeader.d.ts +1 -0
- package/lib/components/htmlParser/parser/tableHeader/getTableHeader.js +7 -0
- package/lib/components/htmlParser/parser/tableHeader/getTableHeader.module.css +28 -0
- package/lib/components/htmlParser/parser/tableHeaderCell/getTableHeaderCell.d.ts +1 -0
- package/lib/components/htmlParser/parser/tableHeaderCell/getTableHeaderCell.js +6 -0
- package/lib/components/htmlParser/parser/tableRow/getTableRow.d.ts +1 -0
- package/lib/components/htmlParser/parser/tableRow/getTableRow.js +7 -0
- package/lib/components/htmlParser/parser/tableRow/getTableRow.module.css +29 -0
- package/lib/components/htmlParser/parser/useHtmlParser.d.ts +5 -0
- package/lib/components/htmlParser/parser/useHtmlParser.js +78 -0
- package/lib/components/htmlParser/useGitHubDirectories.d.ts +10 -0
- package/lib/components/htmlParser/useGitHubDirectories.js +31 -0
- package/lib/components/imageDivider/ImageDivider.d.ts +7 -7
- package/lib/components/imageDivider/ImageDivider.js +6 -6
- package/lib/components/imageDivider/imageDivider.module.css +5 -5
- package/lib/components/jumbotron/Jumbotron.d.ts +22 -0
- package/lib/components/jumbotron/Jumbotron.js +21 -0
- package/lib/components/jumbotron/Jumbotron.module.css +93 -0
- package/lib/components/logo/Logo.d.ts +8 -8
- package/lib/components/logo/Logo.js +10 -10
- package/lib/components/logo/Logo.module.css +15 -15
- package/lib/components/metaIcon/MetaIcon.d.ts +7 -7
- package/lib/components/metaIcon/MetaIcon.js +3 -3
- package/lib/components/metaIcon/MetaIcon.module.css +29 -29
- package/lib/components/notificationPopUp/NotificationPopUp.d.ts +26 -26
- package/lib/components/notificationPopUp/NotificationPopUp.js +32 -32
- package/lib/components/privateRoute/PrivateRoute.d.ts +6 -6
- package/lib/components/privateRoute/PrivateRoute.js +15 -15
- package/lib/components/quoteWrapper/QuoteWrapper.d.ts +7 -7
- package/lib/components/quoteWrapper/QuoteWrapper.js +5 -5
- package/lib/components/quoteWrapper/QuoteWrapper.module.css +12 -12
- package/lib/components/statusSteps/StatusSteps.d.ts +13 -0
- package/lib/components/statusSteps/StatusSteps.js +5 -0
- package/lib/components/tableWrapper/TableWrapper.d.ts +4 -0
- package/lib/components/tableWrapper/TableWrapper.js +30 -0
- package/lib/components/tableWrapper/TableWrapper.module.css +67 -0
- package/lib/components/tabs/Tabs.d.ts +5 -5
- package/lib/components/tabs/Tabs.js +49 -49
- package/lib/components/tag/Tag.d.ts +10 -10
- package/lib/components/tag/Tag.js +6 -6
- package/lib/components/tag/Tag.module.css +44 -44
- package/lib/components/toolTip/ToolTip.d.ts +14 -14
- package/lib/components/toolTip/ToolTip.js +14 -14
- package/lib/components/topNav/index.d.ts +3 -3
- package/lib/components/topNav/index.js +3 -3
- package/lib/components/topNav/primaryTopNav/PrimaryTopNav.d.ts +39 -22
- package/lib/components/topNav/primaryTopNav/PrimaryTopNav.js +23 -23
- package/lib/components/topNav/secondaryTopNav/SecondaryTopNav.d.ts +12 -12
- package/lib/components/topNav/secondaryTopNav/SecondaryTopNav.js +7 -7
- package/lib/custom.d copy.d.ts +5 -0
- package/lib/custom.d copy.js +1 -0
- package/lib/index.d.ts +28 -27
- package/lib/index.js +21 -20
- package/package.json +1 -1
- package/src/components/badgeCounter/BadgeCounter.module.css +27 -27
- package/src/components/card/cardHeader/CardHeader.module.css +10 -0
- package/src/components/card/cardWrapper/CardWrapper.module.css +1 -0
- package/src/components/card/infoCard/InfoCard.module.css +26 -26
- package/src/components/codeBlock/CodeBlock.module.css +6 -6
- package/src/components/denhaag-wrappers/breadcrumbs/Breadcrumbs.css +222 -222
- package/src/components/formFields/checkbox/Checkbox.module.css +7 -7
- package/src/components/formFields/date/Date.module.css +12 -12
- package/src/components/horizontalOverflowWrapper/HorizontalOverflowWrapper.tsx +1 -1
- package/src/components/imageDivider/imageDivider.module.css +5 -5
- package/src/components/jumbotron/Jumbotron.module.css +93 -0
- package/src/components/jumbotron/Jumbotron.tsx +119 -0
- package/src/components/logo/Logo.module.css +15 -15
- package/src/components/metaIcon/MetaIcon.module.css +29 -29
- package/src/components/quoteWrapper/QuoteWrapper.module.css +12 -12
- package/src/components/tag/Tag.module.css +44 -44
- package/src/components/topNav/index.ts +4 -4
- package/src/components/topNav/primaryTopNav/PrimaryTopNav.tsx +34 -2
- package/src/custom.d.ts +4 -4
- package/src/index.ts +2 -0
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
.denhaag-pagination {
|
|
2
|
-
--denhaag-pagination-align: center;
|
|
3
|
-
|
|
4
|
-
align-items: center;
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: row;
|
|
7
|
-
justify-content: var(--denhaag-pagination-align);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@media (min-width: 640px) {
|
|
11
|
-
.denhaag-pagination,
|
|
12
|
-
.denhaag-pagination--start {
|
|
13
|
-
--denhaag-pagination-align: flex-start;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.denhaag-pagination--center {
|
|
17
|
-
--denhaag-pagination-align: center;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.denhaag-pagination--end {
|
|
21
|
-
--denhaag-pagination-align: end;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.denhaag-pagination__links {
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-direction: row;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.denhaag-pagination__link {
|
|
31
|
-
aspect-ratio: 1 / 1;
|
|
32
|
-
align-items: center;
|
|
33
|
-
background-color: var(--denhaag-pagination-background-color, transparent);
|
|
34
|
-
border: 0;
|
|
35
|
-
border-radius: var(
|
|
36
|
-
--denhaag-pagination-border-radius,
|
|
37
|
-
var(--denhaag-border-radius)
|
|
38
|
-
);
|
|
39
|
-
color: var(--denhaag-pagination-color, var(--denhaag-pagination-link-color));
|
|
40
|
-
display: flex;
|
|
41
|
-
height: var(--denhaag-pagination-size);
|
|
42
|
-
justify-content: center;
|
|
43
|
-
line-height: 1.5;
|
|
44
|
-
position: relative;
|
|
45
|
-
text-align: center;
|
|
46
|
-
text-decoration: none;
|
|
47
|
-
width: var(--denhaag-pagination-size);
|
|
48
|
-
font-style: normal;
|
|
49
|
-
font-weight: var(--denhaag-pagination-font-weight);
|
|
50
|
-
font-size: var(--denhaag-pagination-font-size);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.denhaag-pagination__link:hover,
|
|
54
|
-
.denhaag-pagination__link--hover {
|
|
55
|
-
--denhaag-pagination-color: var(--denhaag-pagination-link-hover-color);
|
|
56
|
-
cursor: pointer;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.denhaag-pagination__link:focus,
|
|
60
|
-
.denhaag-pagination__link--focus {
|
|
61
|
-
outline: var(--denhaag-link-focus-outline);
|
|
62
|
-
border-radius: 0;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.denhaag-pagination__link:disabled,
|
|
66
|
-
.denhaag-pagination__link--disabled {
|
|
67
|
-
--denhaag-pagination-color: var(--denhaag-pagination-link-disabled-color);
|
|
68
|
-
|
|
69
|
-
pointer-events: none;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.denhaag-pagination__link--arrow {
|
|
73
|
-
--denhaag-pagination-size: var(--denhaag-pagination-arrow-size);
|
|
74
|
-
--denhaag-pagination-font-size: var(--denhaag-pagination-arrow-font-size);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
[dir="rtl"] .denhaag-pagination__link--arrow {
|
|
78
|
-
transform: scaleX(-1);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.denhaag-pagination__link + .denhaag-pagination__links,
|
|
82
|
-
.denhaag-pagination__links + .denhaag-pagination__link {
|
|
83
|
-
margin-inline-start: var(--denhaag-pagination-margin-inline, 10px);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.denhaag-pagination__link:not(:first-child):not(:last-child):not(.denhaag-pagination__link--current):not([rel]) {
|
|
87
|
-
overflow: hidden;
|
|
88
|
-
pointer-events: none;
|
|
89
|
-
text-indent: calc(var(--denhaag-pagination-size) * 2);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.denhaag-pagination__link:not(:first-child):not(:last-child):not(.denhaag-pagination__link--current):not([rel])::before {
|
|
93
|
-
content: "...";
|
|
94
|
-
left: calc(50% - 7px);
|
|
95
|
-
line-height: 0;
|
|
96
|
-
position: absolute;
|
|
97
|
-
text-indent: 0;
|
|
98
|
-
vertical-align: baseline;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.denhaag-pagination__link--current {
|
|
102
|
-
--denhaag-pagination-color: var(--denhaag-pagination-link-current-color);
|
|
103
|
-
--denhaag-pagination-font-weight: var(
|
|
104
|
-
--denhaag-pagination-link-current-font-weight
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.denhaag-pagination__link--current.denhaag-pagination__link:disabled,
|
|
109
|
-
.denhaag-pagination__link--current.denhaag-pagination__link--disabled {
|
|
110
|
-
--denhaag-pagination-color: var(
|
|
111
|
-
--denhaag-pagination-link-current-disabled-color
|
|
112
|
-
);
|
|
113
|
-
--denhaag-pagination-background-color: var(
|
|
114
|
-
--denhaag-pagination-link-current-disabled-background-color
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.denhaag-pagination .denhaag-icon {
|
|
119
|
-
font-size: inherit;
|
|
120
|
-
}
|
|
1
|
+
.denhaag-pagination {
|
|
2
|
+
--denhaag-pagination-align: center;
|
|
3
|
+
|
|
4
|
+
align-items: center;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
justify-content: var(--denhaag-pagination-align);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@media (min-width: 640px) {
|
|
11
|
+
.denhaag-pagination,
|
|
12
|
+
.denhaag-pagination--start {
|
|
13
|
+
--denhaag-pagination-align: flex-start;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.denhaag-pagination--center {
|
|
17
|
+
--denhaag-pagination-align: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.denhaag-pagination--end {
|
|
21
|
+
--denhaag-pagination-align: end;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.denhaag-pagination__links {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.denhaag-pagination__link {
|
|
31
|
+
aspect-ratio: 1 / 1;
|
|
32
|
+
align-items: center;
|
|
33
|
+
background-color: var(--denhaag-pagination-background-color, transparent);
|
|
34
|
+
border: 0;
|
|
35
|
+
border-radius: var(
|
|
36
|
+
--denhaag-pagination-border-radius,
|
|
37
|
+
var(--denhaag-border-radius)
|
|
38
|
+
);
|
|
39
|
+
color: var(--denhaag-pagination-color, var(--denhaag-pagination-link-color));
|
|
40
|
+
display: flex;
|
|
41
|
+
height: var(--denhaag-pagination-size);
|
|
42
|
+
justify-content: center;
|
|
43
|
+
line-height: 1.5;
|
|
44
|
+
position: relative;
|
|
45
|
+
text-align: center;
|
|
46
|
+
text-decoration: none;
|
|
47
|
+
width: var(--denhaag-pagination-size);
|
|
48
|
+
font-style: normal;
|
|
49
|
+
font-weight: var(--denhaag-pagination-font-weight);
|
|
50
|
+
font-size: var(--denhaag-pagination-font-size);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.denhaag-pagination__link:hover,
|
|
54
|
+
.denhaag-pagination__link--hover {
|
|
55
|
+
--denhaag-pagination-color: var(--denhaag-pagination-link-hover-color);
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.denhaag-pagination__link:focus,
|
|
60
|
+
.denhaag-pagination__link--focus {
|
|
61
|
+
outline: var(--denhaag-link-focus-outline);
|
|
62
|
+
border-radius: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.denhaag-pagination__link:disabled,
|
|
66
|
+
.denhaag-pagination__link--disabled {
|
|
67
|
+
--denhaag-pagination-color: var(--denhaag-pagination-link-disabled-color);
|
|
68
|
+
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.denhaag-pagination__link--arrow {
|
|
73
|
+
--denhaag-pagination-size: var(--denhaag-pagination-arrow-size);
|
|
74
|
+
--denhaag-pagination-font-size: var(--denhaag-pagination-arrow-font-size);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
[dir="rtl"] .denhaag-pagination__link--arrow {
|
|
78
|
+
transform: scaleX(-1);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.denhaag-pagination__link + .denhaag-pagination__links,
|
|
82
|
+
.denhaag-pagination__links + .denhaag-pagination__link {
|
|
83
|
+
margin-inline-start: var(--denhaag-pagination-margin-inline, 10px);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.denhaag-pagination__link:not(:first-child):not(:last-child):not(.denhaag-pagination__link--current):not([rel]) {
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
pointer-events: none;
|
|
89
|
+
text-indent: calc(var(--denhaag-pagination-size) * 2);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.denhaag-pagination__link:not(:first-child):not(:last-child):not(.denhaag-pagination__link--current):not([rel])::before {
|
|
93
|
+
content: "...";
|
|
94
|
+
left: calc(50% - 7px);
|
|
95
|
+
line-height: 0;
|
|
96
|
+
position: absolute;
|
|
97
|
+
text-indent: 0;
|
|
98
|
+
vertical-align: baseline;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.denhaag-pagination__link--current {
|
|
102
|
+
--denhaag-pagination-color: var(--denhaag-pagination-link-current-color);
|
|
103
|
+
--denhaag-pagination-font-weight: var(
|
|
104
|
+
--denhaag-pagination-link-current-font-weight
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.denhaag-pagination__link--current.denhaag-pagination__link:disabled,
|
|
109
|
+
.denhaag-pagination__link--current.denhaag-pagination__link--disabled {
|
|
110
|
+
--denhaag-pagination-color: var(
|
|
111
|
+
--denhaag-pagination-link-current-disabled-color
|
|
112
|
+
);
|
|
113
|
+
--denhaag-pagination-background-color: var(
|
|
114
|
+
--denhaag-pagination-link-current-disabled-background-color
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.denhaag-pagination .denhaag-icon {
|
|
119
|
+
font-size: inherit;
|
|
120
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import "./Pagination.css";
|
|
3
|
-
interface PaginationProps {
|
|
4
|
-
pages: number;
|
|
5
|
-
currentPage: number;
|
|
6
|
-
setPage: (page: number) => any;
|
|
7
|
-
}
|
|
8
|
-
export declare const Pagination: ({ pages, currentPage, setPage }: PaginationProps) => JSX.Element;
|
|
9
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./Pagination.css";
|
|
3
|
+
interface PaginationProps {
|
|
4
|
+
pages: number;
|
|
5
|
+
currentPage: number;
|
|
6
|
+
setPage: (page: number) => any;
|
|
7
|
+
}
|
|
8
|
+
export declare const Pagination: ({ pages, currentPage, setPage }: PaginationProps) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
import "./Pagination.css";
|
|
4
|
-
export const Pagination = ({ pages, currentPage, setPage }) => {
|
|
5
|
-
return (_jsxs("nav", { className: "denhaag-pagination", children: [_jsx(PreviousButton, { previousPage: currentPage > 1 ? currentPage - 1 : undefined, ...{ setPage } }), _jsx("span", { className: "denhaag-pagination__links", role: "group", children: Array.from({ length: pages }, (_, i) => i + 1).map((page, idx) => (_jsx(Link, { ...{ page }, current: page === currentPage, ...{ setPage } }, idx))) }), _jsx(NextButton, { nextPage: currentPage < pages ? currentPage + 1 : undefined, ...{ setPage } })] }));
|
|
6
|
-
};
|
|
7
|
-
const Link = ({ page, current, setPage }) => {
|
|
8
|
-
return (_jsx("a", { "aria-current": current && "page", "aria-label": `Page ${page}`, className: clsx("denhaag-pagination__link", current && "denhaag-pagination__link--current"), onClick: () => setPage(page), children: page }));
|
|
9
|
-
};
|
|
10
|
-
const PreviousButton = ({ previousPage, setPage }) => {
|
|
11
|
-
return (_jsx("a", { "aria-label": "Previous page", className: clsx("denhaag-pagination__link denhaag-pagination__link--arrow", !previousPage && "denhaag-pagination__link--disabled"), onClick: () => previousPage && setPage(previousPage), rel: "prev", children: _jsx("svg", { "aria-hidden": "true", className: "denhaag-icon", fill: "none", height: "1em", viewBox: "0 0 7 12", width: "1em", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M4.9921 10.8143C5.36382 11.1914 5.97222 11.1914 6.34393 10.8143C6.7079 10.4451 6.70822 9.8521 6.34466 9.48248L3.36315 6.45123C2.98039 6.06209 2.98039 5.43791 3.36315 5.04877L6.34466 2.01752C6.70822 1.6479 6.7079 1.05492 6.34394 0.685696C5.97222 0.308599 5.36382 0.308599 4.9921 0.685695L0.692003 5.04799C0.308224 5.43732 0.308224 6.06268 0.692003 6.45201L4.9921 10.8143Z", fill: "currentColor" }) }) }));
|
|
12
|
-
};
|
|
13
|
-
const NextButton = ({ nextPage, setPage }) => {
|
|
14
|
-
return (_jsx("a", { "aria-label": "Next page", className: clsx("denhaag-pagination__link denhaag-pagination__link--arrow", !nextPage && "denhaag-pagination__link--disabled"), onClick: () => nextPage && setPage(nextPage), rel: "next", children: _jsx("svg", { "aria-hidden": "true", className: "denhaag-icon", fill: "none", height: "1em", viewBox: "0 0 7 12", width: "1em", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M2.0079 1.1857C1.63618 0.8086 1.02778 0.8086 0.656065 1.18569V1.18569C0.292103 1.55492 0.291779 2.1479 0.655339 2.51752L3.63685 5.54877C4.01961 5.93791 4.01961 6.56209 3.63686 6.95123L0.655339 9.98248C0.291779 10.3521 0.292102 10.9451 0.656065 11.3143V11.3143C1.02778 11.6914 1.63618 11.6914 2.0079 11.3143L6.308 6.95201C6.69178 6.56268 6.69178 5.93732 6.308 5.54799L2.0079 1.1857Z", fill: "currentColor" }) }) }));
|
|
15
|
-
};
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import "./Pagination.css";
|
|
4
|
+
export const Pagination = ({ pages, currentPage, setPage }) => {
|
|
5
|
+
return (_jsxs("nav", { className: "denhaag-pagination", children: [_jsx(PreviousButton, { previousPage: currentPage > 1 ? currentPage - 1 : undefined, ...{ setPage } }), _jsx("span", { className: "denhaag-pagination__links", role: "group", children: Array.from({ length: pages }, (_, i) => i + 1).map((page, idx) => (_jsx(Link, { ...{ page }, current: page === currentPage, ...{ setPage } }, idx))) }), _jsx(NextButton, { nextPage: currentPage < pages ? currentPage + 1 : undefined, ...{ setPage } })] }));
|
|
6
|
+
};
|
|
7
|
+
const Link = ({ page, current, setPage }) => {
|
|
8
|
+
return (_jsx("a", { "aria-current": current && "page", "aria-label": `Page ${page}`, className: clsx("denhaag-pagination__link", current && "denhaag-pagination__link--current"), onClick: () => setPage(page), children: page }));
|
|
9
|
+
};
|
|
10
|
+
const PreviousButton = ({ previousPage, setPage }) => {
|
|
11
|
+
return (_jsx("a", { "aria-label": "Previous page", className: clsx("denhaag-pagination__link denhaag-pagination__link--arrow", !previousPage && "denhaag-pagination__link--disabled"), onClick: () => previousPage && setPage(previousPage), rel: "prev", children: _jsx("svg", { "aria-hidden": "true", className: "denhaag-icon", fill: "none", height: "1em", viewBox: "0 0 7 12", width: "1em", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M4.9921 10.8143C5.36382 11.1914 5.97222 11.1914 6.34393 10.8143C6.7079 10.4451 6.70822 9.8521 6.34466 9.48248L3.36315 6.45123C2.98039 6.06209 2.98039 5.43791 3.36315 5.04877L6.34466 2.01752C6.70822 1.6479 6.7079 1.05492 6.34394 0.685696C5.97222 0.308599 5.36382 0.308599 4.9921 0.685695L0.692003 5.04799C0.308224 5.43732 0.308224 6.06268 0.692003 6.45201L4.9921 10.8143Z", fill: "currentColor" }) }) }));
|
|
12
|
+
};
|
|
13
|
+
const NextButton = ({ nextPage, setPage }) => {
|
|
14
|
+
return (_jsx("a", { "aria-label": "Next page", className: clsx("denhaag-pagination__link denhaag-pagination__link--arrow", !nextPage && "denhaag-pagination__link--disabled"), onClick: () => nextPage && setPage(nextPage), rel: "next", children: _jsx("svg", { "aria-hidden": "true", className: "denhaag-icon", fill: "none", height: "1em", viewBox: "0 0 7 12", width: "1em", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M2.0079 1.1857C1.63618 0.8086 1.02778 0.8086 0.656065 1.18569V1.18569C0.292103 1.55492 0.291779 2.1479 0.655339 2.51752L3.63685 5.54877C4.01961 5.93791 4.01961 6.56209 3.63686 6.95123L0.655339 9.98248C0.291779 10.3521 0.292102 10.9451 0.656065 11.3143V11.3143C1.02778 11.6914 1.63618 11.6914 2.0079 11.3143L6.308 6.95201C6.69178 6.56268 6.69178 5.93732 6.308 5.54799L2.0079 1.1857Z", fill: "currentColor" }) }) }));
|
|
15
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
interface InputTypes {
|
|
3
|
-
inputType: "text" | "email";
|
|
4
|
-
}
|
|
5
|
-
interface EditableTableRowProps {
|
|
6
|
-
thead: string;
|
|
7
|
-
value: string;
|
|
8
|
-
saveLabel: string;
|
|
9
|
-
cancelLabel: string;
|
|
10
|
-
editLabel: string;
|
|
11
|
-
handleSave: (value: any) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare const EditableTableRow: ({ thead, value, inputType, editLabel, cancelLabel, saveLabel, handleSave, }: EditableTableRowProps & InputTypes) => JSX.Element;
|
|
14
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface InputTypes {
|
|
3
|
+
inputType: "text" | "email";
|
|
4
|
+
}
|
|
5
|
+
interface EditableTableRowProps {
|
|
6
|
+
thead: string;
|
|
7
|
+
value: string;
|
|
8
|
+
saveLabel: string;
|
|
9
|
+
cancelLabel: string;
|
|
10
|
+
editLabel: string;
|
|
11
|
+
handleSave: (value: any) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const EditableTableRow: ({ thead, value, inputType, editLabel, cancelLabel, saveLabel, handleSave, }: EditableTableRowProps & InputTypes) => JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { TableCell, TableHeader, TableRow } from "@gemeente-denhaag/table";
|
|
3
|
-
import * as styles from "./EditableTableRow.module.css";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import { Link } from "@gemeente-denhaag/link";
|
|
6
|
-
import { CheckedIcon, CloseIcon, EditIcon } from "@gemeente-denhaag/icons";
|
|
7
|
-
import { useForm } from "react-hook-form";
|
|
8
|
-
import { InputEmail, InputText } from "../formFields";
|
|
9
|
-
export const EditableTableRow = ({ thead, value, inputType, editLabel, cancelLabel, saveLabel, handleSave, }) => {
|
|
10
|
-
const [editing, setEditing] = React.useState(false);
|
|
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 } })] }));
|
|
12
|
-
};
|
|
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 }) }) })] }));
|
|
15
|
-
};
|
|
16
|
-
const EditingTableRow = ({ value, setEditing, handleSave, inputType, saveLabel, cancelLabel, }) => {
|
|
17
|
-
const { register, handleSubmit, formState: { errors }, } = useForm();
|
|
18
|
-
const onSubmit = (data) => {
|
|
19
|
-
handleSave(data.value);
|
|
20
|
-
setEditing(false);
|
|
21
|
-
};
|
|
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, {})] }));
|
|
23
|
-
};
|
|
24
|
-
const FormField = ({ inputType, value, register, errors }) => {
|
|
25
|
-
switch (inputType) {
|
|
26
|
-
case "email":
|
|
27
|
-
return _jsx(InputEmail, { defaultValue: value, ...{ register, errors }, name: "value", validation: { required: true } });
|
|
28
|
-
case "text":
|
|
29
|
-
return _jsx(InputText, { defaultValue: value, ...{ register, errors }, name: "value", validation: { required: true } });
|
|
30
|
-
}
|
|
31
|
-
};
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { TableCell, TableHeader, TableRow } from "@gemeente-denhaag/table";
|
|
3
|
+
import * as styles from "./EditableTableRow.module.css";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { Link } from "@gemeente-denhaag/link";
|
|
6
|
+
import { CheckedIcon, CloseIcon, EditIcon } from "@gemeente-denhaag/icons";
|
|
7
|
+
import { useForm } from "react-hook-form";
|
|
8
|
+
import { InputEmail, InputText } from "../formFields";
|
|
9
|
+
export const EditableTableRow = ({ thead, value, inputType, editLabel, cancelLabel, saveLabel, handleSave, }) => {
|
|
10
|
+
const [editing, setEditing] = React.useState(false);
|
|
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 } })] }));
|
|
12
|
+
};
|
|
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 }) }) })] }));
|
|
15
|
+
};
|
|
16
|
+
const EditingTableRow = ({ value, setEditing, handleSave, inputType, saveLabel, cancelLabel, }) => {
|
|
17
|
+
const { register, handleSubmit, formState: { errors }, } = useForm();
|
|
18
|
+
const onSubmit = (data) => {
|
|
19
|
+
handleSave(data.value);
|
|
20
|
+
setEditing(false);
|
|
21
|
+
};
|
|
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, {})] }));
|
|
23
|
+
};
|
|
24
|
+
const FormField = ({ inputType, value, register, errors }) => {
|
|
25
|
+
switch (inputType) {
|
|
26
|
+
case "email":
|
|
27
|
+
return _jsx(InputEmail, { defaultValue: value, ...{ register, errors }, name: "value", validation: { required: true } });
|
|
28
|
+
case "text":
|
|
29
|
+
return _jsx(InputText, { defaultValue: value, ...{ register, errors }, name: "value", validation: { required: true } });
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
.th {
|
|
2
|
-
width: 35%;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.cancel {
|
|
6
|
-
color: var(--skeleton-color-grey-3) !important;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.editButtonsContainer {
|
|
10
|
-
display: flex;
|
|
11
|
-
margin-block-start: var(--skeleton-size-xs);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.editButtonsContainer > *:not(:last-child) {
|
|
15
|
-
margin-inline-end: var(--skeleton-size-md);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.submit {
|
|
19
|
-
all: unset;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.editButton {
|
|
23
|
-
display: flex;
|
|
24
|
-
justify-content: flex-end;
|
|
25
|
-
}
|
|
1
|
+
.th {
|
|
2
|
+
width: 35%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.cancel {
|
|
6
|
+
color: var(--skeleton-color-grey-3) !important;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.editButtonsContainer {
|
|
10
|
+
display: flex;
|
|
11
|
+
margin-block-start: var(--skeleton-size-xs);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.editButtonsContainer > *:not(:last-child) {
|
|
15
|
+
margin-inline-end: var(--skeleton-size-md);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.submit {
|
|
19
|
+
all: unset;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.editButton {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: flex-end;
|
|
25
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
user-select: none;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.container:hover {
|
|
6
|
-
cursor: pointer;
|
|
7
|
-
}
|
|
1
|
+
.container {
|
|
2
|
+
user-select: none;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.container:hover {
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { IReactHookFormProps } from "./../types";
|
|
3
|
-
export interface ICheckboxProps {
|
|
4
|
-
label: string;
|
|
5
|
-
name: string;
|
|
6
|
-
defaultChecked?: boolean;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare const InputCheckbox: ({ name, validation, register, label, defaultChecked, disabled, }: ICheckboxProps & IReactHookFormProps) => JSX.Element;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IReactHookFormProps } from "./../types";
|
|
3
|
+
export interface ICheckboxProps {
|
|
4
|
+
label: string;
|
|
5
|
+
name: string;
|
|
6
|
+
defaultChecked?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const InputCheckbox: ({ name, validation, register, label, defaultChecked, disabled, }: ICheckboxProps & IReactHookFormProps) => JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as styles from "./Checkbox.module.css";
|
|
3
|
-
export const InputCheckbox = ({ name, validation, register, label, defaultChecked, disabled, }) => (_jsxs("div", { className: styles.container, children: [_jsx("input", { type: "checkbox", id: `checkbox${name}`, ...{ defaultChecked, disabled }, ...register(name, { ...validation }) }), _jsx("label", { htmlFor: `checkbox${name}`, children: label })] }));
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as styles from "./Checkbox.module.css";
|
|
3
|
+
export const InputCheckbox = ({ name, validation, register, label, defaultChecked, disabled, }) => (_jsxs("div", { className: styles.container, children: [_jsx("input", { type: "checkbox", id: `checkbox${name}`, ...{ defaultChecked, disabled }, ...register(name, { ...validation }) }), _jsx("label", { htmlFor: `checkbox${name}`, children: label })] }));
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Control, FieldValues } from "react-hook-form";
|
|
3
|
-
import { IReactHookFormProps } from "../types";
|
|
4
|
-
/**
|
|
5
|
-
* Export KeyValue input component (wrapped in FormFieldGroup)
|
|
6
|
-
*/
|
|
7
|
-
interface CreateKeyValueProps {
|
|
8
|
-
name: string;
|
|
9
|
-
control: Control<FieldValues, any>;
|
|
10
|
-
defaultValue?: IKeyValue[];
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
copyValue?: {
|
|
13
|
-
canCopy: boolean;
|
|
14
|
-
onCopied?: () => any;
|
|
15
|
-
};
|
|
16
|
-
hideErrorMessage?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface IKeyValue {
|
|
19
|
-
key: string;
|
|
20
|
-
value: string;
|
|
21
|
-
}
|
|
22
|
-
export declare const CreateKeyValue: ({ name, errors, control, validation, defaultValue, disabled, copyValue, hideErrorMessage, }: CreateKeyValueProps & IReactHookFormProps) => JSX.Element;
|
|
23
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Control, FieldValues } from "react-hook-form";
|
|
3
|
+
import { IReactHookFormProps } from "../types";
|
|
4
|
+
/**
|
|
5
|
+
* Export KeyValue input component (wrapped in FormFieldGroup)
|
|
6
|
+
*/
|
|
7
|
+
interface CreateKeyValueProps {
|
|
8
|
+
name: string;
|
|
9
|
+
control: Control<FieldValues, any>;
|
|
10
|
+
defaultValue?: IKeyValue[];
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
copyValue?: {
|
|
13
|
+
canCopy: boolean;
|
|
14
|
+
onCopied?: () => any;
|
|
15
|
+
};
|
|
16
|
+
hideErrorMessage?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface IKeyValue {
|
|
19
|
+
key: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const CreateKeyValue: ({ name, errors, control, validation, defaultValue, disabled, copyValue, hideErrorMessage, }: CreateKeyValueProps & IReactHookFormProps) => JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import * as styles from "./CreateKeyValue.module.css";
|
|
4
|
-
import { Controller } from "react-hook-form";
|
|
5
|
-
import { Table, TableBody, TableCell, TableHeaderCell, TableHeader, TableRow, Textbox, Button, } from "@utrecht/component-library-react/dist/css-module";
|
|
6
|
-
import clsx from "clsx";
|
|
7
|
-
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
8
|
-
import { faCopy, faTrash } from "@fortawesome/free-solid-svg-icons";
|
|
9
|
-
import { ErrorMessage } from "../errorMessage/ErrorMessage";
|
|
10
|
-
export const CreateKeyValue = ({ name, errors, control, validation, defaultValue, disabled, copyValue, hideErrorMessage, }) => {
|
|
11
|
-
return (_jsx(Controller, { ...{ control, name, errors }, rules: validation, render: ({ field: { onChange } }) => {
|
|
12
|
-
return (_jsxs(_Fragment, { children: [_jsx(KeyValueComponent, { handleChange: onChange, ...{ defaultValue, errors, disabled, copyValue } }), errors[name] && !hideErrorMessage && _jsx(ErrorMessage, { message: errors[name].message })] }));
|
|
13
|
-
} }));
|
|
14
|
-
};
|
|
15
|
-
const KeyValueComponent = ({ defaultValue, handleChange, disabled, copyValue, }) => {
|
|
16
|
-
const [currentKey, setCurrentKey] = React.useState("");
|
|
17
|
-
const [currentValue, setCurrentValue] = React.useState("");
|
|
18
|
-
const [keyValues, setKeyValues] = React.useState(defaultValue ?? []);
|
|
19
|
-
const [currentCopyIdx, setCurrentCopyIdx] = React.useState();
|
|
20
|
-
const currentKeyRef = React.useRef(null);
|
|
21
|
-
const currentValueRef = React.useRef(null);
|
|
22
|
-
const handleCreate = () => {
|
|
23
|
-
const keyValue = { key: currentKey, value: currentValue };
|
|
24
|
-
setCurrentKey("");
|
|
25
|
-
setCurrentValue("");
|
|
26
|
-
setKeyValues([...keyValues, keyValue]);
|
|
27
|
-
};
|
|
28
|
-
const handleCopyToClipboard = (value, id) => {
|
|
29
|
-
navigator.clipboard.writeText(value);
|
|
30
|
-
setCurrentCopyIdx(id);
|
|
31
|
-
copyValue?.onCopied && copyValue.onCopied();
|
|
32
|
-
};
|
|
33
|
-
React.useEffect(() => {
|
|
34
|
-
defaultValue && setKeyValues(defaultValue);
|
|
35
|
-
}, [defaultValue]);
|
|
36
|
-
React.useEffect(() => {
|
|
37
|
-
handleChange(keyValues);
|
|
38
|
-
}, [keyValues]);
|
|
39
|
-
return (_jsxs("div", { className: styles.keyValue, children: [keyValues && (_jsxs(Table, { className: styles.table, children: [_jsx(TableHeader, { className: styles.tableHeader, children: _jsxs(TableRow, { children: [_jsx(TableHeaderCell, { children: "Key" }), _jsx(TableHeaderCell, { children: "Value" }), _jsx(TableHeaderCell, {})] }) }), _jsx(TableBody, { children: keyValues.map((keyValue, idx) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: keyValue.key }), _jsx(TableCell, { children: keyValue.value }), _jsx(TableCell, { children: _jsxs("div", { className: styles.buttonsContainer, children: [copyValue && (_jsx(Button, { ...{ disabled }, onClick: () => handleCopyToClipboard(keyValue.value, idx), appearance: currentCopyIdx === idx ? "secondary-action-button" : "primary-action-button", children: _jsx(FontAwesomeIcon, { icon: faCopy }) })), _jsx(Button, { ...{ disabled }, onClick: () => setKeyValues(keyValues.filter((_keyValue) => _keyValue !== keyValue)), className: clsx(styles.deleteButton), children: _jsx(FontAwesomeIcon, { icon: faTrash }) })] }) })] }, `${keyValue.key}${keyValue.value}${idx}`))) })] })), _jsxs("div", { className: styles.form, children: [_jsx(Textbox, { type: "text", placeholder: "Key", value: currentKey, ref: currentKeyRef, onChange: (e) => setCurrentKey(e.target.value), ...{ disabled } }), _jsx(Textbox, { type: "text", placeholder: "Value", value: currentValue, ref: currentValueRef, onChange: (e) => setCurrentValue(e.target.value), ...{ disabled } }), _jsx(Button, { onClick: handleCreate, disabled: !currentKey || !currentValue || disabled, children: "Add" })] })] }));
|
|
40
|
-
};
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as styles from "./CreateKeyValue.module.css";
|
|
4
|
+
import { Controller } from "react-hook-form";
|
|
5
|
+
import { Table, TableBody, TableCell, TableHeaderCell, TableHeader, TableRow, Textbox, Button, } from "@utrecht/component-library-react/dist/css-module";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
8
|
+
import { faCopy, faTrash } from "@fortawesome/free-solid-svg-icons";
|
|
9
|
+
import { ErrorMessage } from "../errorMessage/ErrorMessage";
|
|
10
|
+
export const CreateKeyValue = ({ name, errors, control, validation, defaultValue, disabled, copyValue, hideErrorMessage, }) => {
|
|
11
|
+
return (_jsx(Controller, { ...{ control, name, errors }, rules: validation, render: ({ field: { onChange } }) => {
|
|
12
|
+
return (_jsxs(_Fragment, { children: [_jsx(KeyValueComponent, { handleChange: onChange, ...{ defaultValue, errors, disabled, copyValue } }), errors[name] && !hideErrorMessage && _jsx(ErrorMessage, { message: errors[name].message })] }));
|
|
13
|
+
} }));
|
|
14
|
+
};
|
|
15
|
+
const KeyValueComponent = ({ defaultValue, handleChange, disabled, copyValue, }) => {
|
|
16
|
+
const [currentKey, setCurrentKey] = React.useState("");
|
|
17
|
+
const [currentValue, setCurrentValue] = React.useState("");
|
|
18
|
+
const [keyValues, setKeyValues] = React.useState(defaultValue ?? []);
|
|
19
|
+
const [currentCopyIdx, setCurrentCopyIdx] = React.useState();
|
|
20
|
+
const currentKeyRef = React.useRef(null);
|
|
21
|
+
const currentValueRef = React.useRef(null);
|
|
22
|
+
const handleCreate = () => {
|
|
23
|
+
const keyValue = { key: currentKey, value: currentValue };
|
|
24
|
+
setCurrentKey("");
|
|
25
|
+
setCurrentValue("");
|
|
26
|
+
setKeyValues([...keyValues, keyValue]);
|
|
27
|
+
};
|
|
28
|
+
const handleCopyToClipboard = (value, id) => {
|
|
29
|
+
navigator.clipboard.writeText(value);
|
|
30
|
+
setCurrentCopyIdx(id);
|
|
31
|
+
copyValue?.onCopied && copyValue.onCopied();
|
|
32
|
+
};
|
|
33
|
+
React.useEffect(() => {
|
|
34
|
+
defaultValue && setKeyValues(defaultValue);
|
|
35
|
+
}, [defaultValue]);
|
|
36
|
+
React.useEffect(() => {
|
|
37
|
+
handleChange(keyValues);
|
|
38
|
+
}, [keyValues]);
|
|
39
|
+
return (_jsxs("div", { className: styles.keyValue, children: [keyValues && (_jsxs(Table, { className: styles.table, children: [_jsx(TableHeader, { className: styles.tableHeader, children: _jsxs(TableRow, { children: [_jsx(TableHeaderCell, { children: "Key" }), _jsx(TableHeaderCell, { children: "Value" }), _jsx(TableHeaderCell, {})] }) }), _jsx(TableBody, { children: keyValues.map((keyValue, idx) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: keyValue.key }), _jsx(TableCell, { children: keyValue.value }), _jsx(TableCell, { children: _jsxs("div", { className: styles.buttonsContainer, children: [copyValue && (_jsx(Button, { ...{ disabled }, onClick: () => handleCopyToClipboard(keyValue.value, idx), appearance: currentCopyIdx === idx ? "secondary-action-button" : "primary-action-button", children: _jsx(FontAwesomeIcon, { icon: faCopy }) })), _jsx(Button, { ...{ disabled }, onClick: () => setKeyValues(keyValues.filter((_keyValue) => _keyValue !== keyValue)), className: clsx(styles.deleteButton), children: _jsx(FontAwesomeIcon, { icon: faTrash }) })] }) })] }, `${keyValue.key}${keyValue.value}${idx}`))) })] })), _jsxs("div", { className: styles.form, children: [_jsx(Textbox, { type: "text", placeholder: "Key", value: currentKey, ref: currentKeyRef, onChange: (e) => setCurrentKey(e.target.value), ...{ disabled } }), _jsx(Textbox, { type: "text", placeholder: "Value", value: currentValue, ref: currentValueRef, onChange: (e) => setCurrentValue(e.target.value), ...{ disabled } }), _jsx(Button, { onClick: handleCreate, disabled: !currentKey || !currentValue || disabled, children: "Add" })] })] }));
|
|
40
|
+
};
|