@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.
- package/CHANGELOG.md +9 -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/{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/{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
|
@@ -5,9 +5,9 @@ import React from 'react';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Use
|
|
8
|
+
* Use TableHeadCell inside the Table component to provide the header row and/or column of the table.
|
|
9
9
|
*/
|
|
10
|
-
export var
|
|
10
|
+
export var TableHeadCell = /*#__PURE__*/React.forwardRef(function TableHeadCell(_ref, ref) {
|
|
11
11
|
var _ref$dataType = _ref.dataType,
|
|
12
12
|
dataType = _ref$dataType === void 0 ? 'text' : _ref$dataType,
|
|
13
13
|
cellWidth = _ref.cellWidth,
|
|
@@ -20,4 +20,4 @@ export var TableHeaderCell = /*#__PURE__*/React.forwardRef(function TableHeaderC
|
|
|
20
20
|
className: clsx(className, cellWidth === 'three-quarters' && 'govgr-!-width-three-quarters', cellWidth === 'one-quarter' && 'govgr-!-width-one-quarter', cellWidth === 'two-thirds' && 'govgr-!-width-two-thirds', cellWidth === 'one-third' && 'govgr-!-width-one-third', cellWidth === 'one-half' && 'govgr-!-width-one-half', dataType === 'numeric' && 'govgr-table__header--numeric', cellWidth === 'full' && 'govgr-!-width-full', true && 'govgr-table__header')
|
|
21
21
|
}, props), children);
|
|
22
22
|
});
|
|
23
|
-
export default
|
|
23
|
+
export default TableHeadCell;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import TableHeadCell from '@digigov/react-core/TableHeadCell';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(TableHeadCell, null, "hello");
|
|
6
|
+
|
|
7
|
+
it('renders the Table with no props', function () {
|
|
8
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
var _ref2 = /*#__PURE__*/React.createElement(TableHeadCell, {
|
|
12
|
+
dataType: "numeric"
|
|
13
|
+
}, "hello");
|
|
14
|
+
|
|
15
|
+
it('renders the Table with dataType="numeric" prop', function () {
|
|
16
|
+
expect(mount(_ref2)).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _ref3 = /*#__PURE__*/React.createElement(TableHeadCell, {
|
|
20
|
+
cellWidth: 'one-quarter'
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('renders the TableHeadCell with cellWidth=one-quarter', function () {
|
|
24
|
+
expect(mount(_ref3)).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
var _ref4 = /*#__PURE__*/React.createElement(TableHeadCell, {
|
|
28
|
+
cellWidth: 'one-third'
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('renders the TableHeadCell with cellWidth=one-third', function () {
|
|
32
|
+
expect(mount(_ref4)).toMatchSnapshot();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
var _ref5 = /*#__PURE__*/React.createElement(TableHeadCell, {
|
|
36
|
+
cellWidth: 'one-half'
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('renders the TableHeadCell with cellWidth=one-half', function () {
|
|
40
|
+
expect(mount(_ref5)).toMatchSnapshot();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
var _ref6 = /*#__PURE__*/React.createElement(TableHeadCell, {
|
|
44
|
+
cellWidth: 'two-thirds'
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('renders the TableHeadCell with cellWidth=two-thirds', function () {
|
|
48
|
+
expect(mount(_ref6)).toMatchSnapshot();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
var _ref7 = /*#__PURE__*/React.createElement(TableHeadCell, {
|
|
52
|
+
cellWidth: 'three-quarters'
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('renders the TableHeadCell with cellWidth=three-quarters', function () {
|
|
56
|
+
expect(mount(_ref7)).toMatchSnapshot();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
var _ref8 = /*#__PURE__*/React.createElement(TableHeadCell, {
|
|
60
|
+
cellWidth: 'full'
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('renders the TableHeadCell with cellWidth=full', function () {
|
|
64
|
+
expect(mount(_ref8)).toMatchSnapshot();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
var _ref9 = /*#__PURE__*/React.createElement(TableHeadCell, {
|
|
68
|
+
dataType: "numeric",
|
|
69
|
+
cellWidth: 'one-quarter'
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('renders the TableHeadCell with dataType="numeric" cellWidth=one-quarter', function () {
|
|
73
|
+
expect(mount(_ref9)).toMatchSnapshot();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
var _ref10 = /*#__PURE__*/React.createElement(TableHeadCell, {
|
|
77
|
+
dataType: "numeric",
|
|
78
|
+
cellWidth: 'one-third'
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('renders the TableHeadCell with dataType="numeric" and cellWidth=one-third', function () {
|
|
82
|
+
expect(mount(_ref10)).toMatchSnapshot();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
var _ref11 = /*#__PURE__*/React.createElement(TableHeadCell, {
|
|
86
|
+
dataType: "numeric",
|
|
87
|
+
cellWidth: 'one-half'
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('renders the TableHeadCell with dataType="numeric" and dataType="numeric" and cellWidth=one-half', function () {
|
|
91
|
+
expect(mount(_ref11)).toMatchSnapshot();
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
var _ref12 = /*#__PURE__*/React.createElement(TableHeadCell, {
|
|
95
|
+
dataType: "numeric",
|
|
96
|
+
cellWidth: 'two-thirds'
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('renders the TableHeadCell with dataType="numeric" and cellWidth=two-thirds', function () {
|
|
100
|
+
expect(mount(_ref12)).toMatchSnapshot();
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
var _ref13 = /*#__PURE__*/React.createElement(TableHeadCell, {
|
|
104
|
+
dataType: "numeric",
|
|
105
|
+
cellWidth: 'three-quarters'
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('renders the TableHeadCell with dataType="numeric" and cellWidth=three-quarters', function () {
|
|
109
|
+
expect(mount(_ref13)).toMatchSnapshot();
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
var _ref14 = /*#__PURE__*/React.createElement(TableHeadCell, {
|
|
113
|
+
dataType: "numeric",
|
|
114
|
+
cellWidth: 'full'
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it('renders the TableHeadCell dataType="numeric" and with cellWidth=full', function () {
|
|
118
|
+
expect(mount(_ref14)).toMatchSnapshot();
|
|
119
|
+
});
|
|
@@ -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,24 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "children"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Use TableNoDataRow inside the Table component when there is no data to show.
|
|
9
|
+
* you can use colSpan prop attribute to expand the td width
|
|
10
|
+
*/
|
|
11
|
+
export var TableNoDataRow = /*#__PURE__*/React.forwardRef(function TableNoDataRow(_ref, ref) {
|
|
12
|
+
var className = _ref.className,
|
|
13
|
+
children = _ref.children,
|
|
14
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
|
|
16
|
+
return /*#__PURE__*/React.createElement("tr", {
|
|
17
|
+
className: "govgr-table__row"
|
|
18
|
+
}, /*#__PURE__*/React.createElement("td", _extends({
|
|
19
|
+
colSpan: 100,
|
|
20
|
+
ref: ref,
|
|
21
|
+
className: clsx(className, true && 'govgr-table__cell--no-data')
|
|
22
|
+
}, props), children));
|
|
23
|
+
});
|
|
24
|
+
export default TableNoDataRow;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import TableNoDataRow from '@digigov/react-core/TableNoDataRow';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(TableNoDataRow, null, "hello");
|
|
6
|
+
|
|
7
|
+
it('renders the Table with no props', function () {
|
|
8
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
+
});
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license Digigov v0.
|
|
1
|
+
/** @license Digigov v0.9.0
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -124,8 +124,9 @@ export { default as Table } from '@digigov/react-core/Table';
|
|
|
124
124
|
export { default as TableBody } from '@digigov/react-core/TableBody';
|
|
125
125
|
export { default as TableCaption } from '@digigov/react-core/TableCaption';
|
|
126
126
|
export { default as TableDataCell } from '@digigov/react-core/TableDataCell';
|
|
127
|
+
export { default as TableNoDataRow } from '@digigov/react-core/TableNoDataRow';
|
|
127
128
|
export { default as TableHead } from '@digigov/react-core/TableHead';
|
|
128
|
-
export { default as
|
|
129
|
+
export { default as TableHeadCell } from '@digigov/react-core/TableHeadCell';
|
|
129
130
|
export { default as TableRow } from '@digigov/react-core/TableRow';
|
|
130
131
|
export { default as Tabs } from '@digigov/react-core/Tabs';
|
|
131
132
|
export { default as TabsHeading } from '@digigov/react-core/TabsHeading';
|
package/index.d.ts
CHANGED
|
@@ -119,8 +119,9 @@ export { default as Table } from '@digigov/react-core/Table';
|
|
|
119
119
|
export { default as TableBody } from '@digigov/react-core/TableBody';
|
|
120
120
|
export { default as TableCaption } from '@digigov/react-core/TableCaption';
|
|
121
121
|
export { default as TableDataCell } from '@digigov/react-core/TableDataCell';
|
|
122
|
+
export { default as TableNoDataRow } from '@digigov/react-core/TableNoDataRow';
|
|
122
123
|
export { default as TableHead } from '@digigov/react-core/TableHead';
|
|
123
|
-
export { default as
|
|
124
|
+
export { default as TableHeadCell } from '@digigov/react-core/TableHeadCell';
|
|
124
125
|
export { default as TableRow } from '@digigov/react-core/TableRow';
|
|
125
126
|
export { default as Tabs } from '@digigov/react-core/Tabs';
|
|
126
127
|
export { default as TabsHeading } from '@digigov/react-core/TabsHeading';
|
package/index.js
CHANGED
|
@@ -731,10 +731,16 @@ Object.defineProperty(exports, "TableHead", {
|
|
|
731
731
|
return _TableHead["default"];
|
|
732
732
|
}
|
|
733
733
|
});
|
|
734
|
-
Object.defineProperty(exports, "
|
|
734
|
+
Object.defineProperty(exports, "TableHeadCell", {
|
|
735
735
|
enumerable: true,
|
|
736
736
|
get: function get() {
|
|
737
|
-
return
|
|
737
|
+
return _TableHeadCell["default"];
|
|
738
|
+
}
|
|
739
|
+
});
|
|
740
|
+
Object.defineProperty(exports, "TableNoDataRow", {
|
|
741
|
+
enumerable: true,
|
|
742
|
+
get: function get() {
|
|
743
|
+
return _TableNoDataRow["default"];
|
|
738
744
|
}
|
|
739
745
|
});
|
|
740
746
|
Object.defineProperty(exports, "TableRow", {
|
|
@@ -1052,9 +1058,11 @@ var _TableCaption = _interopRequireDefault(require("@digigov/react-core/TableCap
|
|
|
1052
1058
|
|
|
1053
1059
|
var _TableDataCell = _interopRequireDefault(require("@digigov/react-core/TableDataCell"));
|
|
1054
1060
|
|
|
1061
|
+
var _TableNoDataRow = _interopRequireDefault(require("@digigov/react-core/TableNoDataRow"));
|
|
1062
|
+
|
|
1055
1063
|
var _TableHead = _interopRequireDefault(require("@digigov/react-core/TableHead"));
|
|
1056
1064
|
|
|
1057
|
-
var
|
|
1065
|
+
var _TableHeadCell = _interopRequireDefault(require("@digigov/react-core/TableHeadCell"));
|
|
1058
1066
|
|
|
1059
1067
|
var _TableRow = _interopRequireDefault(require("@digigov/react-core/TableRow"));
|
|
1060
1068
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/react-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "@digigov react core components",
|
|
5
5
|
"author": "GRNET Developers <devs@lists.grnet.gr>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "dist"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@digigov/css": "0.
|
|
14
|
+
"@digigov/css": "0.17.0",
|
|
15
15
|
"clsx": "1.1.1",
|
|
16
16
|
"react": "16.14.0",
|
|
17
17
|
"react-dom": "16.14.0"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare type ThElementAttributes = JSX.IntrinsicElements['th'];
|
|
3
|
-
export interface TableHeaderCellProps 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 TableHeaderCell inside the Table component to provide the header row and/or column of the table.
|
|
19
|
-
*/
|
|
20
|
-
export declare const TableHeaderCell: React.ForwardRefExoticComponent<Pick<TableHeaderCellProps, "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 TableHeaderCell;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { mount } from 'enzyme';
|
|
3
|
-
import TableHeaderCell from '@digigov/react-core/TableHeaderCell';
|
|
4
|
-
|
|
5
|
-
var _ref = /*#__PURE__*/React.createElement(TableHeaderCell, null, "hello");
|
|
6
|
-
|
|
7
|
-
it('renders the Table with no props', function () {
|
|
8
|
-
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
var _ref2 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
12
|
-
dataType: "numeric"
|
|
13
|
-
}, "hello");
|
|
14
|
-
|
|
15
|
-
it('renders the Table with dataType="numeric" prop', function () {
|
|
16
|
-
expect(mount(_ref2)).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
var _ref3 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
20
|
-
cellWidth: 'one-quarter'
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('renders the TableHeaderCell with cellWidth=one-quarter', function () {
|
|
24
|
-
expect(mount(_ref3)).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
var _ref4 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
28
|
-
cellWidth: 'one-third'
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('renders the TableHeaderCell with cellWidth=one-third', function () {
|
|
32
|
-
expect(mount(_ref4)).toMatchSnapshot();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
var _ref5 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
36
|
-
cellWidth: 'one-half'
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('renders the TableHeaderCell with cellWidth=one-half', function () {
|
|
40
|
-
expect(mount(_ref5)).toMatchSnapshot();
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
var _ref6 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
44
|
-
cellWidth: 'two-thirds'
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('renders the TableHeaderCell with cellWidth=two-thirds', function () {
|
|
48
|
-
expect(mount(_ref6)).toMatchSnapshot();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
var _ref7 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
52
|
-
cellWidth: 'three-quarters'
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('renders the TableHeaderCell with cellWidth=three-quarters', function () {
|
|
56
|
-
expect(mount(_ref7)).toMatchSnapshot();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
var _ref8 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
60
|
-
cellWidth: 'full'
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('renders the TableHeaderCell with cellWidth=full', function () {
|
|
64
|
-
expect(mount(_ref8)).toMatchSnapshot();
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
var _ref9 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
68
|
-
dataType: "numeric",
|
|
69
|
-
cellWidth: 'one-quarter'
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('renders the TableHeaderCell with dataType="numeric" cellWidth=one-quarter', function () {
|
|
73
|
-
expect(mount(_ref9)).toMatchSnapshot();
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
var _ref10 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
77
|
-
dataType: "numeric",
|
|
78
|
-
cellWidth: 'one-third'
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it('renders the TableHeaderCell with dataType="numeric" and cellWidth=one-third', function () {
|
|
82
|
-
expect(mount(_ref10)).toMatchSnapshot();
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
var _ref11 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
86
|
-
dataType: "numeric",
|
|
87
|
-
cellWidth: 'one-half'
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('renders the TableHeaderCell with dataType="numeric" and dataType="numeric" and cellWidth=one-half', function () {
|
|
91
|
-
expect(mount(_ref11)).toMatchSnapshot();
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
var _ref12 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
95
|
-
dataType: "numeric",
|
|
96
|
-
cellWidth: 'two-thirds'
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('renders the TableHeaderCell with dataType="numeric" and cellWidth=two-thirds', function () {
|
|
100
|
-
expect(mount(_ref12)).toMatchSnapshot();
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
var _ref13 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
104
|
-
dataType: "numeric",
|
|
105
|
-
cellWidth: 'three-quarters'
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('renders the TableHeaderCell with dataType="numeric" and cellWidth=three-quarters', function () {
|
|
109
|
-
expect(mount(_ref13)).toMatchSnapshot();
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
var _ref14 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
113
|
-
dataType: "numeric",
|
|
114
|
-
cellWidth: 'full'
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it('renders the TableHeaderCell dataType="numeric" and with cellWidth=full', function () {
|
|
118
|
-
expect(mount(_ref14)).toMatchSnapshot();
|
|
119
|
-
});
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { mount } from 'enzyme';
|
|
3
|
-
import TableHeaderCell from '@digigov/react-core/TableHeaderCell';
|
|
4
|
-
|
|
5
|
-
var _ref = /*#__PURE__*/React.createElement(TableHeaderCell, null, "hello");
|
|
6
|
-
|
|
7
|
-
it('renders the Table with no props', function () {
|
|
8
|
-
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
var _ref2 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
12
|
-
dataType: "numeric"
|
|
13
|
-
}, "hello");
|
|
14
|
-
|
|
15
|
-
it('renders the Table with dataType="numeric" prop', function () {
|
|
16
|
-
expect(mount(_ref2)).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
var _ref3 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
20
|
-
cellWidth: 'one-quarter'
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('renders the TableHeaderCell with cellWidth=one-quarter', function () {
|
|
24
|
-
expect(mount(_ref3)).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
var _ref4 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
28
|
-
cellWidth: 'one-third'
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('renders the TableHeaderCell with cellWidth=one-third', function () {
|
|
32
|
-
expect(mount(_ref4)).toMatchSnapshot();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
var _ref5 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
36
|
-
cellWidth: 'one-half'
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('renders the TableHeaderCell with cellWidth=one-half', function () {
|
|
40
|
-
expect(mount(_ref5)).toMatchSnapshot();
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
var _ref6 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
44
|
-
cellWidth: 'two-thirds'
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('renders the TableHeaderCell with cellWidth=two-thirds', function () {
|
|
48
|
-
expect(mount(_ref6)).toMatchSnapshot();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
var _ref7 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
52
|
-
cellWidth: 'three-quarters'
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('renders the TableHeaderCell with cellWidth=three-quarters', function () {
|
|
56
|
-
expect(mount(_ref7)).toMatchSnapshot();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
var _ref8 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
60
|
-
cellWidth: 'full'
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it('renders the TableHeaderCell with cellWidth=full', function () {
|
|
64
|
-
expect(mount(_ref8)).toMatchSnapshot();
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
var _ref9 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
68
|
-
dataType: "numeric",
|
|
69
|
-
cellWidth: 'one-quarter'
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('renders the TableHeaderCell with dataType="numeric" cellWidth=one-quarter', function () {
|
|
73
|
-
expect(mount(_ref9)).toMatchSnapshot();
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
var _ref10 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
77
|
-
dataType: "numeric",
|
|
78
|
-
cellWidth: 'one-third'
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it('renders the TableHeaderCell with dataType="numeric" and cellWidth=one-third', function () {
|
|
82
|
-
expect(mount(_ref10)).toMatchSnapshot();
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
var _ref11 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
86
|
-
dataType: "numeric",
|
|
87
|
-
cellWidth: 'one-half'
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('renders the TableHeaderCell with dataType="numeric" and dataType="numeric" and cellWidth=one-half', function () {
|
|
91
|
-
expect(mount(_ref11)).toMatchSnapshot();
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
var _ref12 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
95
|
-
dataType: "numeric",
|
|
96
|
-
cellWidth: 'two-thirds'
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('renders the TableHeaderCell with dataType="numeric" and cellWidth=two-thirds', function () {
|
|
100
|
-
expect(mount(_ref12)).toMatchSnapshot();
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
var _ref13 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
104
|
-
dataType: "numeric",
|
|
105
|
-
cellWidth: 'three-quarters'
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('renders the TableHeaderCell with dataType="numeric" and cellWidth=three-quarters', function () {
|
|
109
|
-
expect(mount(_ref13)).toMatchSnapshot();
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
var _ref14 = /*#__PURE__*/React.createElement(TableHeaderCell, {
|
|
113
|
-
dataType: "numeric",
|
|
114
|
-
cellWidth: 'full'
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it('renders the TableHeaderCell dataType="numeric" and with cellWidth=full', function () {
|
|
118
|
-
expect(mount(_ref14)).toMatchSnapshot();
|
|
119
|
-
});
|