@digigov/react-core 0.6.5 → 0.9.0
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/BackLink/__snapshots__/index.test.tsx.snap +34 -6
- package/CHANGELOG.md +23 -1
- package/{TableHeaderCell → TableHeadCell}/__snapshots__/index.test.tsx.snap +49 -49
- package/TableHeadCell/index.d.ts +21 -0
- package/{TableHeaderCell → TableHeadCell}/index.js +5 -5
- package/{TableHeaderCell → TableHeadCell}/index.test.d.ts +0 -0
- package/{TableHeaderCell → TableHeadCell}/index.test.js +27 -27
- package/TableNoDataRow/__snapshots__/index.test.tsx.snap +16 -0
- package/TableNoDataRow/index.d.ts +10 -0
- package/TableNoDataRow/index.js +39 -0
- package/TableNoDataRow/index.test.d.ts +1 -0
- package/TableNoDataRow/index.test.js +15 -0
- package/es/BackLink/__snapshots__/index.test.tsx.snap +34 -6
- package/{esm/TableHeaderCell → es/TableHeadCell}/__snapshots__/index.test.tsx.snap +49 -49
- package/es/{TableHeaderCell → TableHeadCell}/index.js +3 -3
- package/es/TableHeadCell/index.test.js +119 -0
- package/es/TableNoDataRow/__snapshots__/index.test.tsx.snap +16 -0
- package/es/TableNoDataRow/index.js +24 -0
- package/es/TableNoDataRow/index.test.js +9 -0
- package/es/index.js +2 -1
- package/esm/BackLink/__snapshots__/index.test.tsx.snap +34 -6
- package/{es/TableHeaderCell → esm/TableHeadCell}/__snapshots__/index.test.tsx.snap +49 -49
- package/esm/{TableHeaderCell → TableHeadCell}/index.js +3 -3
- package/esm/TableHeadCell/index.test.js +119 -0
- package/esm/TableNoDataRow/__snapshots__/index.test.tsx.snap +16 -0
- package/esm/TableNoDataRow/index.js +24 -0
- package/esm/TableNoDataRow/index.test.js +9 -0
- package/esm/index.js +3 -2
- package/index.d.ts +2 -1
- package/index.js +11 -3
- package/package.json +2 -2
- package/TableHeaderCell/index.d.ts +0 -21
- package/es/TableHeaderCell/index.test.js +0 -119
- package/esm/TableHeaderCell/index.test.js +0 -119
|
@@ -7,10 +7,24 @@ exports[`renders the BackLink with href="#" 1`] = `
|
|
|
7
7
|
<a
|
|
8
8
|
className="govgr-back-link"
|
|
9
9
|
href="#"
|
|
10
|
+
onClick={[Function]}
|
|
10
11
|
>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
<ForwardRef(CaretIcon)>
|
|
13
|
+
<ForwardRef(SvgIcon)
|
|
14
|
+
className="govgr-caret--left"
|
|
15
|
+
>
|
|
16
|
+
<svg
|
|
17
|
+
aria-hidden="true"
|
|
18
|
+
className="govgr-caret--left govgr-svg-icon"
|
|
19
|
+
focusable="false"
|
|
20
|
+
viewBox="0 0 24 24"
|
|
21
|
+
>
|
|
22
|
+
<path
|
|
23
|
+
d="M18,22V2L6,12L18,22z"
|
|
24
|
+
/>
|
|
25
|
+
</svg>
|
|
26
|
+
</ForwardRef(SvgIcon)>
|
|
27
|
+
</ForwardRef(CaretIcon)>
|
|
14
28
|
hello
|
|
15
29
|
</a>
|
|
16
30
|
</ForwardRef(BackLink)>
|
|
@@ -20,10 +34,24 @@ exports[`renders the BackLink with no props 1`] = `
|
|
|
20
34
|
<ForwardRef(BackLink)>
|
|
21
35
|
<a
|
|
22
36
|
className="govgr-back-link"
|
|
37
|
+
onClick={[Function]}
|
|
23
38
|
>
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
39
|
+
<ForwardRef(CaretIcon)>
|
|
40
|
+
<ForwardRef(SvgIcon)
|
|
41
|
+
className="govgr-caret--left"
|
|
42
|
+
>
|
|
43
|
+
<svg
|
|
44
|
+
aria-hidden="true"
|
|
45
|
+
className="govgr-caret--left govgr-svg-icon"
|
|
46
|
+
focusable="false"
|
|
47
|
+
viewBox="0 0 24 24"
|
|
48
|
+
>
|
|
49
|
+
<path
|
|
50
|
+
d="M18,22V2L6,12L18,22z"
|
|
51
|
+
/>
|
|
52
|
+
</svg>
|
|
53
|
+
</ForwardRef(SvgIcon)>
|
|
54
|
+
</ForwardRef(CaretIcon)>
|
|
27
55
|
hello
|
|
28
56
|
</a>
|
|
29
57
|
</ForwardRef(BackLink)>
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
# Change Log - @digigov/react-core
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 17 Mar 2022 10:24:06 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.9.0
|
|
6
|
+
Thu, 17 Mar 2022 10:24:06 GMT
|
|
7
|
+
|
|
8
|
+
### Minor changes
|
|
9
|
+
|
|
10
|
+
- create TableNoDataRow component to show text when table has no data
|
|
11
|
+
- rename TableHeaderCell to TableHeadCell
|
|
12
|
+
|
|
13
|
+
## 0.8.0
|
|
14
|
+
Fri, 11 Mar 2022 15:42:46 GMT
|
|
15
|
+
|
|
16
|
+
### Minor changes
|
|
17
|
+
|
|
18
|
+
- update test at BackLink component
|
|
19
|
+
|
|
20
|
+
## 0.7.0
|
|
21
|
+
Thu, 10 Mar 2022 11:36:58 GMT
|
|
22
|
+
|
|
23
|
+
### Minor changes
|
|
24
|
+
|
|
25
|
+
- implement Loader component
|
|
4
26
|
|
|
5
27
|
## 0.6.5
|
|
6
28
|
Wed, 09 Mar 2022 13:21:47 GMT
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`renders the Table with dataType="numeric" prop 1`] = `
|
|
4
|
-
<ForwardRef(
|
|
4
|
+
<ForwardRef(TableHeadCell)
|
|
5
5
|
dataType="numeric"
|
|
6
6
|
>
|
|
7
7
|
<th
|
|
@@ -9,174 +9,174 @@ exports[`renders the Table with dataType="numeric" prop 1`] = `
|
|
|
9
9
|
>
|
|
10
10
|
hello
|
|
11
11
|
</th>
|
|
12
|
-
</ForwardRef(
|
|
12
|
+
</ForwardRef(TableHeadCell)>
|
|
13
13
|
`;
|
|
14
14
|
|
|
15
15
|
exports[`renders the Table with no props 1`] = `
|
|
16
|
-
<ForwardRef(
|
|
16
|
+
<ForwardRef(TableHeadCell)>
|
|
17
17
|
<th
|
|
18
18
|
className="govgr-table__header"
|
|
19
19
|
>
|
|
20
20
|
hello
|
|
21
21
|
</th>
|
|
22
|
-
</ForwardRef(
|
|
22
|
+
</ForwardRef(TableHeadCell)>
|
|
23
23
|
`;
|
|
24
24
|
|
|
25
|
-
exports[`renders the
|
|
26
|
-
<ForwardRef(
|
|
25
|
+
exports[`renders the TableHeadCell dataType="numeric" and with cellWidth=full 1`] = `
|
|
26
|
+
<ForwardRef(TableHeadCell)
|
|
27
27
|
cellWidth="full"
|
|
28
28
|
dataType="numeric"
|
|
29
29
|
>
|
|
30
30
|
<th
|
|
31
31
|
className="govgr-table__header--numeric govgr-!-width-full govgr-table__header"
|
|
32
32
|
/>
|
|
33
|
-
</ForwardRef(
|
|
33
|
+
</ForwardRef(TableHeadCell)>
|
|
34
34
|
`;
|
|
35
35
|
|
|
36
|
-
exports[`renders the
|
|
37
|
-
<ForwardRef(
|
|
36
|
+
exports[`renders the TableHeadCell dataType="numeric" and with cellWidth=full 1`] = `
|
|
37
|
+
<ForwardRef(TableHeadCell)
|
|
38
38
|
cellWidth="full"
|
|
39
39
|
dataType="numeric"
|
|
40
40
|
>
|
|
41
41
|
<th
|
|
42
42
|
className="govgr-table__header--numeric govgr-!-width-full govgr-table__header"
|
|
43
43
|
/>
|
|
44
|
-
</ForwardRef(
|
|
44
|
+
</ForwardRef(TableHeadCell)>
|
|
45
45
|
`;
|
|
46
46
|
|
|
47
|
-
exports[`renders the
|
|
48
|
-
<ForwardRef(
|
|
47
|
+
exports[`renders the TableHeadCell with cellWidth=full 1`] = `
|
|
48
|
+
<ForwardRef(TableHeadCell)
|
|
49
49
|
cellWidth="full"
|
|
50
50
|
>
|
|
51
51
|
<th
|
|
52
52
|
className="govgr-!-width-full govgr-table__header"
|
|
53
53
|
/>
|
|
54
|
-
</ForwardRef(
|
|
54
|
+
</ForwardRef(TableHeadCell)>
|
|
55
55
|
`;
|
|
56
56
|
|
|
57
|
-
exports[`renders the
|
|
58
|
-
<ForwardRef(
|
|
57
|
+
exports[`renders the TableHeadCell with cellWidth=one-half 1`] = `
|
|
58
|
+
<ForwardRef(TableHeadCell)
|
|
59
59
|
cellWidth="one-half"
|
|
60
60
|
>
|
|
61
61
|
<th
|
|
62
62
|
className="govgr-!-width-one-half govgr-table__header"
|
|
63
63
|
/>
|
|
64
|
-
</ForwardRef(
|
|
64
|
+
</ForwardRef(TableHeadCell)>
|
|
65
65
|
`;
|
|
66
66
|
|
|
67
|
-
exports[`renders the
|
|
68
|
-
<ForwardRef(
|
|
67
|
+
exports[`renders the TableHeadCell with cellWidth=one-quarter 1`] = `
|
|
68
|
+
<ForwardRef(TableHeadCell)
|
|
69
69
|
cellWidth="one-quarter"
|
|
70
70
|
>
|
|
71
71
|
<th
|
|
72
72
|
className="govgr-!-width-one-quarter govgr-table__header"
|
|
73
73
|
/>
|
|
74
|
-
</ForwardRef(
|
|
74
|
+
</ForwardRef(TableHeadCell)>
|
|
75
75
|
`;
|
|
76
76
|
|
|
77
|
-
exports[`renders the
|
|
78
|
-
<ForwardRef(
|
|
77
|
+
exports[`renders the TableHeadCell with cellWidth=one-third 1`] = `
|
|
78
|
+
<ForwardRef(TableHeadCell)
|
|
79
79
|
cellWidth="one-third"
|
|
80
80
|
>
|
|
81
81
|
<th
|
|
82
82
|
className="govgr-!-width-one-third govgr-table__header"
|
|
83
83
|
/>
|
|
84
|
-
</ForwardRef(
|
|
84
|
+
</ForwardRef(TableHeadCell)>
|
|
85
85
|
`;
|
|
86
86
|
|
|
87
|
-
exports[`renders the
|
|
88
|
-
<ForwardRef(
|
|
87
|
+
exports[`renders the TableHeadCell with cellWidth=three-quarters 1`] = `
|
|
88
|
+
<ForwardRef(TableHeadCell)
|
|
89
89
|
cellWidth="three-quarters"
|
|
90
90
|
>
|
|
91
91
|
<th
|
|
92
92
|
className="govgr-!-width-three-quarters govgr-table__header"
|
|
93
93
|
/>
|
|
94
|
-
</ForwardRef(
|
|
94
|
+
</ForwardRef(TableHeadCell)>
|
|
95
95
|
`;
|
|
96
96
|
|
|
97
|
-
exports[`renders the
|
|
98
|
-
<ForwardRef(
|
|
97
|
+
exports[`renders the TableHeadCell with cellWidth=two-thirds 1`] = `
|
|
98
|
+
<ForwardRef(TableHeadCell)
|
|
99
99
|
cellWidth="two-thirds"
|
|
100
100
|
>
|
|
101
101
|
<th
|
|
102
102
|
className="govgr-!-width-two-thirds govgr-table__header"
|
|
103
103
|
/>
|
|
104
|
-
</ForwardRef(
|
|
104
|
+
</ForwardRef(TableHeadCell)>
|
|
105
105
|
`;
|
|
106
106
|
|
|
107
|
-
exports[`renders the
|
|
108
|
-
<ForwardRef(
|
|
107
|
+
exports[`renders the TableHeadCell with dataType="numeric" and cellWidth=three-quarters 1`] = `
|
|
108
|
+
<ForwardRef(TableHeadCell)
|
|
109
109
|
cellWidth="three-quarters"
|
|
110
110
|
dataType="numeric"
|
|
111
111
|
>
|
|
112
112
|
<th
|
|
113
113
|
className="govgr-!-width-three-quarters govgr-table__header--numeric govgr-table__header"
|
|
114
114
|
/>
|
|
115
|
-
</ForwardRef(
|
|
115
|
+
</ForwardRef(TableHeadCell)>
|
|
116
116
|
`;
|
|
117
117
|
|
|
118
|
-
exports[`renders the
|
|
119
|
-
<ForwardRef(
|
|
118
|
+
exports[`renders the TableHeadCell with dataType="numeric" and cellWidth=two-thirds 1`] = `
|
|
119
|
+
<ForwardRef(TableHeadCell)
|
|
120
120
|
cellWidth="two-thirds"
|
|
121
121
|
dataType="numeric"
|
|
122
122
|
>
|
|
123
123
|
<th
|
|
124
124
|
className="govgr-!-width-two-thirds govgr-table__header--numeric govgr-table__header"
|
|
125
125
|
/>
|
|
126
|
-
</ForwardRef(
|
|
126
|
+
</ForwardRef(TableHeadCell)>
|
|
127
127
|
`;
|
|
128
128
|
|
|
129
|
-
exports[`renders the
|
|
130
|
-
<ForwardRef(
|
|
129
|
+
exports[`renders the TableHeadCell with dataType="numeric" and cellWidth=one-third 1`] = `
|
|
130
|
+
<ForwardRef(TableHeadCell)
|
|
131
131
|
cellWidth="one-third"
|
|
132
132
|
dataType="numeric"
|
|
133
133
|
>
|
|
134
134
|
<th
|
|
135
135
|
className="govgr-!-width-one-third govgr-table__header--numeric govgr-table__header"
|
|
136
136
|
/>
|
|
137
|
-
</ForwardRef(
|
|
137
|
+
</ForwardRef(TableHeadCell)>
|
|
138
138
|
`;
|
|
139
139
|
|
|
140
|
-
exports[`renders the
|
|
141
|
-
<ForwardRef(
|
|
140
|
+
exports[`renders the TableHeadCell with dataType="numeric" and cellWidth=three-quarters 1`] = `
|
|
141
|
+
<ForwardRef(TableHeadCell)
|
|
142
142
|
cellWidth="three-quarters"
|
|
143
143
|
dataType="numeric"
|
|
144
144
|
>
|
|
145
145
|
<th
|
|
146
146
|
className="govgr-!-width-three-quarters govgr-table__header--numeric govgr-table__header"
|
|
147
147
|
/>
|
|
148
|
-
</ForwardRef(
|
|
148
|
+
</ForwardRef(TableHeadCell)>
|
|
149
149
|
`;
|
|
150
150
|
|
|
151
|
-
exports[`renders the
|
|
152
|
-
<ForwardRef(
|
|
151
|
+
exports[`renders the TableHeadCell with dataType="numeric" and cellWidth=two-thirds 1`] = `
|
|
152
|
+
<ForwardRef(TableHeadCell)
|
|
153
153
|
cellWidth="two-thirds"
|
|
154
154
|
dataType="numeric"
|
|
155
155
|
>
|
|
156
156
|
<th
|
|
157
157
|
className="govgr-!-width-two-thirds govgr-table__header--numeric govgr-table__header"
|
|
158
158
|
/>
|
|
159
|
-
</ForwardRef(
|
|
159
|
+
</ForwardRef(TableHeadCell)>
|
|
160
160
|
`;
|
|
161
161
|
|
|
162
|
-
exports[`renders the
|
|
163
|
-
<ForwardRef(
|
|
162
|
+
exports[`renders the TableHeadCell with dataType="numeric" and dataType="numeric" and cellWidth=one-half 1`] = `
|
|
163
|
+
<ForwardRef(TableHeadCell)
|
|
164
164
|
cellWidth="one-half"
|
|
165
165
|
dataType="numeric"
|
|
166
166
|
>
|
|
167
167
|
<th
|
|
168
168
|
className="govgr-!-width-one-half govgr-table__header--numeric govgr-table__header"
|
|
169
169
|
/>
|
|
170
|
-
</ForwardRef(
|
|
170
|
+
</ForwardRef(TableHeadCell)>
|
|
171
171
|
`;
|
|
172
172
|
|
|
173
|
-
exports[`renders the
|
|
174
|
-
<ForwardRef(
|
|
173
|
+
exports[`renders the TableHeadCell with dataType="numeric" cellWidth=one-quarter 1`] = `
|
|
174
|
+
<ForwardRef(TableHeadCell)
|
|
175
175
|
cellWidth="one-quarter"
|
|
176
176
|
dataType="numeric"
|
|
177
177
|
>
|
|
178
178
|
<th
|
|
179
179
|
className="govgr-!-width-one-quarter govgr-table__header--numeric govgr-table__header"
|
|
180
180
|
/>
|
|
181
|
-
</ForwardRef(
|
|
181
|
+
</ForwardRef(TableHeadCell)>
|
|
182
182
|
`;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type ThElementAttributes = JSX.IntrinsicElements['th'];
|
|
3
|
+
export interface TableHeadCellProps extends ThElementAttributes {
|
|
4
|
+
/**
|
|
5
|
+
* dataType is optional.
|
|
6
|
+
* Use numeric value prop when comparing columns of numbers, align the numbers to the right in table cells.
|
|
7
|
+
* Default value is text which aligns texts to the center
|
|
8
|
+
*/
|
|
9
|
+
dataType?: 'text' | 'numeric';
|
|
10
|
+
/**
|
|
11
|
+
* cellWidth is optional.
|
|
12
|
+
* Use cellWidth prop to define a custom width for a specific reference number in your table cell.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
cellWidth?: 'one-quarter' | 'one-third' | 'one-half' | 'two-thirds' | 'three-quarters' | 'full';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Use TableHeadCell inside the Table component to provide the header row and/or column of the table.
|
|
19
|
+
*/
|
|
20
|
+
export declare const TableHeadCell: React.ForwardRefExoticComponent<Pick<TableHeadCellProps, "className" | "children" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "abbr" | "dataType" | "align" | "colSpan" | "headers" | "rowSpan" | "scope" | "cellWidth"> & React.RefAttributes<HTMLTableCellElement>>;
|
|
21
|
+
export default TableHeadCell;
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports["default"] = exports.
|
|
8
|
+
exports["default"] = exports.TableHeadCell = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -18,9 +18,9 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
18
18
|
var _excluded = ["dataType", "cellWidth", "className", "children"];
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* Use
|
|
21
|
+
* Use TableHeadCell inside the Table component to provide the header row and/or column of the table.
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var TableHeadCell = /*#__PURE__*/_react["default"].forwardRef(function TableHeadCell(_ref, ref) {
|
|
24
24
|
var _ref$dataType = _ref.dataType,
|
|
25
25
|
dataType = _ref$dataType === void 0 ? 'text' : _ref$dataType,
|
|
26
26
|
cellWidth = _ref.cellWidth,
|
|
@@ -33,6 +33,6 @@ var TableHeaderCell = /*#__PURE__*/_react["default"].forwardRef(function TableHe
|
|
|
33
33
|
}, props), children);
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
exports.
|
|
37
|
-
var _default =
|
|
36
|
+
exports.TableHeadCell = TableHeadCell;
|
|
37
|
+
var _default = TableHeadCell;
|
|
38
38
|
exports["default"] = _default;
|
|
File without changes
|
|
@@ -6,15 +6,15 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
6
6
|
|
|
7
7
|
var _enzyme = require("enzyme");
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _TableHeadCell = _interopRequireDefault(require("@digigov/react-core/TableHeadCell"));
|
|
10
10
|
|
|
11
|
-
var _ref = /*#__PURE__*/_react["default"].createElement(
|
|
11
|
+
var _ref = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], null, "hello");
|
|
12
12
|
|
|
13
13
|
it('renders the Table with no props', function () {
|
|
14
14
|
expect((0, _enzyme.mount)(_ref)).toMatchSnapshot();
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
var _ref2 = /*#__PURE__*/_react["default"].createElement(
|
|
17
|
+
var _ref2 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
|
|
18
18
|
dataType: "numeric"
|
|
19
19
|
}, "hello");
|
|
20
20
|
|
|
@@ -22,104 +22,104 @@ it('renders the Table with dataType="numeric" prop', function () {
|
|
|
22
22
|
expect((0, _enzyme.mount)(_ref2)).toMatchSnapshot();
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
var _ref3 = /*#__PURE__*/_react["default"].createElement(
|
|
25
|
+
var _ref3 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
|
|
26
26
|
cellWidth: 'one-quarter'
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
it('renders the
|
|
29
|
+
it('renders the TableHeadCell with cellWidth=one-quarter', function () {
|
|
30
30
|
expect((0, _enzyme.mount)(_ref3)).toMatchSnapshot();
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
var _ref4 = /*#__PURE__*/_react["default"].createElement(
|
|
33
|
+
var _ref4 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
|
|
34
34
|
cellWidth: 'one-third'
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
it('renders the
|
|
37
|
+
it('renders the TableHeadCell with cellWidth=one-third', function () {
|
|
38
38
|
expect((0, _enzyme.mount)(_ref4)).toMatchSnapshot();
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
var _ref5 = /*#__PURE__*/_react["default"].createElement(
|
|
41
|
+
var _ref5 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
|
|
42
42
|
cellWidth: 'one-half'
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
it('renders the
|
|
45
|
+
it('renders the TableHeadCell with cellWidth=one-half', function () {
|
|
46
46
|
expect((0, _enzyme.mount)(_ref5)).toMatchSnapshot();
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
var _ref6 = /*#__PURE__*/_react["default"].createElement(
|
|
49
|
+
var _ref6 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
|
|
50
50
|
cellWidth: 'two-thirds'
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
it('renders the
|
|
53
|
+
it('renders the TableHeadCell with cellWidth=two-thirds', function () {
|
|
54
54
|
expect((0, _enzyme.mount)(_ref6)).toMatchSnapshot();
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
var _ref7 = /*#__PURE__*/_react["default"].createElement(
|
|
57
|
+
var _ref7 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
|
|
58
58
|
cellWidth: 'three-quarters'
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
it('renders the
|
|
61
|
+
it('renders the TableHeadCell with cellWidth=three-quarters', function () {
|
|
62
62
|
expect((0, _enzyme.mount)(_ref7)).toMatchSnapshot();
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
-
var _ref8 = /*#__PURE__*/_react["default"].createElement(
|
|
65
|
+
var _ref8 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
|
|
66
66
|
cellWidth: 'full'
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
it('renders the
|
|
69
|
+
it('renders the TableHeadCell with cellWidth=full', function () {
|
|
70
70
|
expect((0, _enzyme.mount)(_ref8)).toMatchSnapshot();
|
|
71
71
|
});
|
|
72
72
|
|
|
73
|
-
var _ref9 = /*#__PURE__*/_react["default"].createElement(
|
|
73
|
+
var _ref9 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
|
|
74
74
|
dataType: "numeric",
|
|
75
75
|
cellWidth: 'one-quarter'
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
it('renders the
|
|
78
|
+
it('renders the TableHeadCell with dataType="numeric" cellWidth=one-quarter', function () {
|
|
79
79
|
expect((0, _enzyme.mount)(_ref9)).toMatchSnapshot();
|
|
80
80
|
});
|
|
81
81
|
|
|
82
|
-
var _ref10 = /*#__PURE__*/_react["default"].createElement(
|
|
82
|
+
var _ref10 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
|
|
83
83
|
dataType: "numeric",
|
|
84
84
|
cellWidth: 'one-third'
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
it('renders the
|
|
87
|
+
it('renders the TableHeadCell with dataType="numeric" and cellWidth=one-third', function () {
|
|
88
88
|
expect((0, _enzyme.mount)(_ref10)).toMatchSnapshot();
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
-
var _ref11 = /*#__PURE__*/_react["default"].createElement(
|
|
91
|
+
var _ref11 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
|
|
92
92
|
dataType: "numeric",
|
|
93
93
|
cellWidth: 'one-half'
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
it('renders the
|
|
96
|
+
it('renders the TableHeadCell with dataType="numeric" and dataType="numeric" and cellWidth=one-half', function () {
|
|
97
97
|
expect((0, _enzyme.mount)(_ref11)).toMatchSnapshot();
|
|
98
98
|
});
|
|
99
99
|
|
|
100
|
-
var _ref12 = /*#__PURE__*/_react["default"].createElement(
|
|
100
|
+
var _ref12 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
|
|
101
101
|
dataType: "numeric",
|
|
102
102
|
cellWidth: 'two-thirds'
|
|
103
103
|
});
|
|
104
104
|
|
|
105
|
-
it('renders the
|
|
105
|
+
it('renders the TableHeadCell with dataType="numeric" and cellWidth=two-thirds', function () {
|
|
106
106
|
expect((0, _enzyme.mount)(_ref12)).toMatchSnapshot();
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
-
var _ref13 = /*#__PURE__*/_react["default"].createElement(
|
|
109
|
+
var _ref13 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
|
|
110
110
|
dataType: "numeric",
|
|
111
111
|
cellWidth: 'three-quarters'
|
|
112
112
|
});
|
|
113
113
|
|
|
114
|
-
it('renders the
|
|
114
|
+
it('renders the TableHeadCell with dataType="numeric" and cellWidth=three-quarters', function () {
|
|
115
115
|
expect((0, _enzyme.mount)(_ref13)).toMatchSnapshot();
|
|
116
116
|
});
|
|
117
117
|
|
|
118
|
-
var _ref14 = /*#__PURE__*/_react["default"].createElement(
|
|
118
|
+
var _ref14 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
|
|
119
119
|
dataType: "numeric",
|
|
120
120
|
cellWidth: 'full'
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
it('renders the
|
|
123
|
+
it('renders the TableHeadCell dataType="numeric" and with cellWidth=full', function () {
|
|
124
124
|
expect((0, _enzyme.mount)(_ref14)).toMatchSnapshot();
|
|
125
125
|
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the Table with no props 1`] = `
|
|
4
|
+
<ForwardRef(TableNoDataRow)>
|
|
5
|
+
<tr
|
|
6
|
+
className="govgr-table__row"
|
|
7
|
+
>
|
|
8
|
+
<td
|
|
9
|
+
className="govgr-table__cell--no-data"
|
|
10
|
+
colSpan={100}
|
|
11
|
+
>
|
|
12
|
+
hello
|
|
13
|
+
</td>
|
|
14
|
+
</tr>
|
|
15
|
+
</ForwardRef(TableNoDataRow)>
|
|
16
|
+
`;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type TdElementAttributes = JSX.IntrinsicElements['td'];
|
|
3
|
+
export interface TableNoDataRowProps extends TdElementAttributes {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Use TableNoDataRow inside the Table component when there is no data to show.
|
|
7
|
+
* you can use colSpan prop attribute to expand the td width
|
|
8
|
+
*/
|
|
9
|
+
export declare const TableNoDataRow: React.ForwardRefExoticComponent<Pick<TableNoDataRowProps, "className" | "children" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "abbr" | "height" | "width" | "align" | "colSpan" | "headers" | "rowSpan" | "scope" | "valign"> & React.RefAttributes<HTMLTableCellElement>>;
|
|
10
|
+
export default TableNoDataRow;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.TableNoDataRow = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
17
|
+
|
|
18
|
+
var _excluded = ["className", "children"];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Use TableNoDataRow inside the Table component when there is no data to show.
|
|
22
|
+
* you can use colSpan prop attribute to expand the td width
|
|
23
|
+
*/
|
|
24
|
+
var TableNoDataRow = /*#__PURE__*/_react["default"].forwardRef(function TableNoDataRow(_ref, ref) {
|
|
25
|
+
var className = _ref.className,
|
|
26
|
+
children = _ref.children,
|
|
27
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
28
|
+
return /*#__PURE__*/_react["default"].createElement("tr", {
|
|
29
|
+
className: "govgr-table__row"
|
|
30
|
+
}, /*#__PURE__*/_react["default"].createElement("td", (0, _extends2["default"])({
|
|
31
|
+
colSpan: 100,
|
|
32
|
+
ref: ref,
|
|
33
|
+
className: (0, _clsx["default"])(className, true && 'govgr-table__cell--no-data')
|
|
34
|
+
}, props), children));
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
exports.TableNoDataRow = TableNoDataRow;
|
|
38
|
+
var _default = TableNoDataRow;
|
|
39
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _enzyme = require("enzyme");
|
|
8
|
+
|
|
9
|
+
var _TableNoDataRow = _interopRequireDefault(require("@digigov/react-core/TableNoDataRow"));
|
|
10
|
+
|
|
11
|
+
var _ref = /*#__PURE__*/_react["default"].createElement(_TableNoDataRow["default"], null, "hello");
|
|
12
|
+
|
|
13
|
+
it('renders the Table with no props', function () {
|
|
14
|
+
expect((0, _enzyme.mount)(_ref)).toMatchSnapshot();
|
|
15
|
+
});
|