@digigov/react-core 0.8.0 → 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.
Files changed (31) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/{TableHeaderCell → TableHeadCell}/__snapshots__/index.test.tsx.snap +49 -49
  3. package/TableHeadCell/index.d.ts +21 -0
  4. package/{TableHeaderCell → TableHeadCell}/index.js +5 -5
  5. package/{TableHeaderCell → TableHeadCell}/index.test.d.ts +0 -0
  6. package/{TableHeaderCell → TableHeadCell}/index.test.js +27 -27
  7. package/TableNoDataRow/__snapshots__/index.test.tsx.snap +16 -0
  8. package/TableNoDataRow/index.d.ts +10 -0
  9. package/TableNoDataRow/index.js +39 -0
  10. package/TableNoDataRow/index.test.d.ts +1 -0
  11. package/TableNoDataRow/index.test.js +15 -0
  12. package/{esm/TableHeaderCell → es/TableHeadCell}/__snapshots__/index.test.tsx.snap +49 -49
  13. package/es/{TableHeaderCell → TableHeadCell}/index.js +3 -3
  14. package/es/TableHeadCell/index.test.js +119 -0
  15. package/es/TableNoDataRow/__snapshots__/index.test.tsx.snap +16 -0
  16. package/es/TableNoDataRow/index.js +24 -0
  17. package/es/TableNoDataRow/index.test.js +9 -0
  18. package/es/index.js +2 -1
  19. package/{es/TableHeaderCell → esm/TableHeadCell}/__snapshots__/index.test.tsx.snap +49 -49
  20. package/esm/{TableHeaderCell → TableHeadCell}/index.js +3 -3
  21. package/esm/TableHeadCell/index.test.js +119 -0
  22. package/esm/TableNoDataRow/__snapshots__/index.test.tsx.snap +16 -0
  23. package/esm/TableNoDataRow/index.js +24 -0
  24. package/esm/TableNoDataRow/index.test.js +9 -0
  25. package/esm/index.js +3 -2
  26. package/index.d.ts +2 -1
  27. package/index.js +11 -3
  28. package/package.json +2 -2
  29. package/TableHeaderCell/index.d.ts +0 -21
  30. package/es/TableHeaderCell/index.test.js +0 -119
  31. package/esm/TableHeaderCell/index.test.js +0 -119
package/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Change Log - @digigov/react-core
2
2
 
3
- This log was last generated on Fri, 11 Mar 2022 15:42:46 GMT and should not be manually modified.
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
4
12
 
5
13
  ## 0.8.0
6
14
  Fri, 11 Mar 2022 15:42:46 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(TableHeaderCell)
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(TableHeaderCell)>
12
+ </ForwardRef(TableHeadCell)>
13
13
  `;
14
14
 
15
15
  exports[`renders the Table with no props 1`] = `
16
- <ForwardRef(TableHeaderCell)>
16
+ <ForwardRef(TableHeadCell)>
17
17
  <th
18
18
  className="govgr-table__header"
19
19
  >
20
20
  hello
21
21
  </th>
22
- </ForwardRef(TableHeaderCell)>
22
+ </ForwardRef(TableHeadCell)>
23
23
  `;
24
24
 
25
- exports[`renders the TableHeaderCell dataType="numeric" and with cellWidth=full 1`] = `
26
- <ForwardRef(TableHeaderCell)
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(TableHeaderCell)>
33
+ </ForwardRef(TableHeadCell)>
34
34
  `;
35
35
 
36
- exports[`renders the TableHeaderCell dataType="numeric" and with cellWidth=full 1`] = `
37
- <ForwardRef(TableHeaderCell)
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(TableHeaderCell)>
44
+ </ForwardRef(TableHeadCell)>
45
45
  `;
46
46
 
47
- exports[`renders the TableHeaderCell with cellWidth=full 1`] = `
48
- <ForwardRef(TableHeaderCell)
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(TableHeaderCell)>
54
+ </ForwardRef(TableHeadCell)>
55
55
  `;
56
56
 
57
- exports[`renders the TableHeaderCell with cellWidth=one-half 1`] = `
58
- <ForwardRef(TableHeaderCell)
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(TableHeaderCell)>
64
+ </ForwardRef(TableHeadCell)>
65
65
  `;
66
66
 
67
- exports[`renders the TableHeaderCell with cellWidth=one-quarter 1`] = `
68
- <ForwardRef(TableHeaderCell)
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(TableHeaderCell)>
74
+ </ForwardRef(TableHeadCell)>
75
75
  `;
76
76
 
77
- exports[`renders the TableHeaderCell with cellWidth=one-third 1`] = `
78
- <ForwardRef(TableHeaderCell)
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(TableHeaderCell)>
84
+ </ForwardRef(TableHeadCell)>
85
85
  `;
86
86
 
87
- exports[`renders the TableHeaderCell with cellWidth=three-quarters 1`] = `
88
- <ForwardRef(TableHeaderCell)
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(TableHeaderCell)>
94
+ </ForwardRef(TableHeadCell)>
95
95
  `;
96
96
 
97
- exports[`renders the TableHeaderCell with cellWidth=two-thirds 1`] = `
98
- <ForwardRef(TableHeaderCell)
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(TableHeaderCell)>
104
+ </ForwardRef(TableHeadCell)>
105
105
  `;
106
106
 
107
- exports[`renders the TableHeaderCell with dataType="numeric" and cellWidth=three-quarters 1`] = `
108
- <ForwardRef(TableHeaderCell)
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(TableHeaderCell)>
115
+ </ForwardRef(TableHeadCell)>
116
116
  `;
117
117
 
118
- exports[`renders the TableHeaderCell with dataType="numeric" and cellWidth=two-thirds 1`] = `
119
- <ForwardRef(TableHeaderCell)
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(TableHeaderCell)>
126
+ </ForwardRef(TableHeadCell)>
127
127
  `;
128
128
 
129
- exports[`renders the TableHeaderCell with dataType="numeric" and cellWidth=one-third 1`] = `
130
- <ForwardRef(TableHeaderCell)
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(TableHeaderCell)>
137
+ </ForwardRef(TableHeadCell)>
138
138
  `;
139
139
 
140
- exports[`renders the TableHeaderCell with dataType="numeric" and cellWidth=three-quarters 1`] = `
141
- <ForwardRef(TableHeaderCell)
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(TableHeaderCell)>
148
+ </ForwardRef(TableHeadCell)>
149
149
  `;
150
150
 
151
- exports[`renders the TableHeaderCell with dataType="numeric" and cellWidth=two-thirds 1`] = `
152
- <ForwardRef(TableHeaderCell)
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(TableHeaderCell)>
159
+ </ForwardRef(TableHeadCell)>
160
160
  `;
161
161
 
162
- exports[`renders the TableHeaderCell with dataType="numeric" and dataType="numeric" and cellWidth=one-half 1`] = `
163
- <ForwardRef(TableHeaderCell)
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(TableHeaderCell)>
170
+ </ForwardRef(TableHeadCell)>
171
171
  `;
172
172
 
173
- exports[`renders the TableHeaderCell with dataType="numeric" cellWidth=one-quarter 1`] = `
174
- <ForwardRef(TableHeaderCell)
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(TableHeaderCell)>
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.TableHeaderCell = void 0;
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 TableHeaderCell inside the Table component to provide the header row and/or column of the table.
21
+ * Use TableHeadCell inside the Table component to provide the header row and/or column of the table.
22
22
  */
23
- var TableHeaderCell = /*#__PURE__*/_react["default"].forwardRef(function TableHeaderCell(_ref, ref) {
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.TableHeaderCell = TableHeaderCell;
37
- var _default = TableHeaderCell;
36
+ exports.TableHeadCell = TableHeadCell;
37
+ var _default = TableHeadCell;
38
38
  exports["default"] = _default;
@@ -6,15 +6,15 @@ var _react = _interopRequireDefault(require("react"));
6
6
 
7
7
  var _enzyme = require("enzyme");
8
8
 
9
- var _TableHeaderCell = _interopRequireDefault(require("@digigov/react-core/TableHeaderCell"));
9
+ var _TableHeadCell = _interopRequireDefault(require("@digigov/react-core/TableHeadCell"));
10
10
 
11
- var _ref = /*#__PURE__*/_react["default"].createElement(_TableHeaderCell["default"], null, "hello");
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(_TableHeaderCell["default"], {
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(_TableHeaderCell["default"], {
25
+ var _ref3 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
26
26
  cellWidth: 'one-quarter'
27
27
  });
28
28
 
29
- it('renders the TableHeaderCell with cellWidth=one-quarter', function () {
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(_TableHeaderCell["default"], {
33
+ var _ref4 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
34
34
  cellWidth: 'one-third'
35
35
  });
36
36
 
37
- it('renders the TableHeaderCell with cellWidth=one-third', function () {
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(_TableHeaderCell["default"], {
41
+ var _ref5 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
42
42
  cellWidth: 'one-half'
43
43
  });
44
44
 
45
- it('renders the TableHeaderCell with cellWidth=one-half', function () {
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(_TableHeaderCell["default"], {
49
+ var _ref6 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
50
50
  cellWidth: 'two-thirds'
51
51
  });
52
52
 
53
- it('renders the TableHeaderCell with cellWidth=two-thirds', function () {
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(_TableHeaderCell["default"], {
57
+ var _ref7 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
58
58
  cellWidth: 'three-quarters'
59
59
  });
60
60
 
61
- it('renders the TableHeaderCell with cellWidth=three-quarters', function () {
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(_TableHeaderCell["default"], {
65
+ var _ref8 = /*#__PURE__*/_react["default"].createElement(_TableHeadCell["default"], {
66
66
  cellWidth: 'full'
67
67
  });
68
68
 
69
- it('renders the TableHeaderCell with cellWidth=full', function () {
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(_TableHeaderCell["default"], {
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 TableHeaderCell with dataType="numeric" cellWidth=one-quarter', function () {
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(_TableHeaderCell["default"], {
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 TableHeaderCell with dataType="numeric" and cellWidth=one-third', function () {
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(_TableHeaderCell["default"], {
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 TableHeaderCell with dataType="numeric" and dataType="numeric" and cellWidth=one-half', function () {
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(_TableHeaderCell["default"], {
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 TableHeaderCell with dataType="numeric" and cellWidth=two-thirds', function () {
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(_TableHeaderCell["default"], {
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 TableHeaderCell with dataType="numeric" and cellWidth=three-quarters', function () {
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(_TableHeaderCell["default"], {
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 TableHeaderCell dataType="numeric" and with cellWidth=full', function () {
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
+ });