@digigov/react-core 0.7.0 → 0.10.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/Hint/__snapshots__/index.test.tsx.snap +36 -0
- package/Hint/index.d.ts +6 -1
- package/Hint/index.js +4 -3
- package/Hint/index.test.js +24 -0
- 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/es/Hint/__snapshots__/index.test.tsx.snap +36 -0
- package/es/Hint/index.js +4 -3
- package/es/Hint/index.test.js +24 -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/esm/BackLink/__snapshots__/index.test.tsx.snap +34 -6
- package/esm/Hint/__snapshots__/index.test.tsx.snap +36 -0
- package/esm/Hint/index.js +4 -3
- package/esm/Hint/index.test.js +24 -0
- 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 Wed, 30 Mar 2022 12:28:30 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.10.0
|
|
6
|
+
Wed, 30 Mar 2022 12:28:30 GMT
|
|
7
|
+
|
|
8
|
+
### Minor changes
|
|
9
|
+
|
|
10
|
+
- Add `fontSize` property in Hint, update tests
|
|
11
|
+
|
|
12
|
+
## 0.9.0
|
|
13
|
+
Thu, 17 Mar 2022 10:24:06 GMT
|
|
14
|
+
|
|
15
|
+
### Minor changes
|
|
16
|
+
|
|
17
|
+
- create TableNoDataRow component to show text when table has no data
|
|
18
|
+
- rename TableHeaderCell to TableHeadCell
|
|
19
|
+
|
|
20
|
+
## 0.8.0
|
|
21
|
+
Fri, 11 Mar 2022 15:42:46 GMT
|
|
22
|
+
|
|
23
|
+
### Minor changes
|
|
24
|
+
|
|
25
|
+
- update test at BackLink component
|
|
4
26
|
|
|
5
27
|
## 0.7.0
|
|
6
28
|
Thu, 10 Mar 2022 11:36:58 GMT
|
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`renders the Hint with fontSize=14 1`] = `
|
|
4
|
+
<ForwardRef(Hint)
|
|
5
|
+
fontSize="14"
|
|
6
|
+
>
|
|
7
|
+
<p
|
|
8
|
+
className="govgr-!-font-size-14 govgr-hint"
|
|
9
|
+
>
|
|
10
|
+
hello
|
|
11
|
+
</p>
|
|
12
|
+
</ForwardRef(Hint)>
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
exports[`renders the Hint with fontSize=16 1`] = `
|
|
16
|
+
<ForwardRef(Hint)
|
|
17
|
+
fontSize="16"
|
|
18
|
+
>
|
|
19
|
+
<p
|
|
20
|
+
className="govgr-!-font-size-16 govgr-hint"
|
|
21
|
+
>
|
|
22
|
+
hello
|
|
23
|
+
</p>
|
|
24
|
+
</ForwardRef(Hint)>
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
exports[`renders the Hint with fontSize=24 1`] = `
|
|
28
|
+
<ForwardRef(Hint)
|
|
29
|
+
fontSize="24"
|
|
30
|
+
>
|
|
31
|
+
<p
|
|
32
|
+
className="govgr-!-font-size-24 govgr-hint"
|
|
33
|
+
>
|
|
34
|
+
hello
|
|
35
|
+
</p>
|
|
36
|
+
</ForwardRef(Hint)>
|
|
37
|
+
`;
|
|
38
|
+
|
|
3
39
|
exports[`renders the Hint with no props 1`] = `
|
|
4
40
|
<ForwardRef(Hint)>
|
|
5
41
|
<p
|
package/Hint/index.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare type PElementAttributes = JSX.IntrinsicElements['p'];
|
|
3
3
|
export interface HintProps extends PElementAttributes {
|
|
4
|
+
/**
|
|
5
|
+
* fontSize is optional.
|
|
6
|
+
* You can add this fontSize override prop in order to change the font size.
|
|
7
|
+
*/
|
|
8
|
+
fontSize?: '14' | '16' | '24';
|
|
4
9
|
}
|
|
5
10
|
/**
|
|
6
11
|
* Hint component can be used in form pages and it gives an extra hint description to the form.
|
|
7
12
|
*/
|
|
8
|
-
export declare const Hint: React.ForwardRefExoticComponent<Pick<HintProps, "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"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
13
|
+
export declare const Hint: React.ForwardRefExoticComponent<Pick<HintProps, "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" | "fontSize"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
9
14
|
export default Hint;
|
package/Hint/index.js
CHANGED
|
@@ -15,18 +15,19 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
17
17
|
|
|
18
|
-
var _excluded = ["className", "children"];
|
|
18
|
+
var _excluded = ["fontSize", "className", "children"];
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Hint component can be used in form pages and it gives an extra hint description to the form.
|
|
22
22
|
*/
|
|
23
23
|
var Hint = /*#__PURE__*/_react["default"].forwardRef(function Hint(_ref, ref) {
|
|
24
|
-
var
|
|
24
|
+
var fontSize = _ref.fontSize,
|
|
25
|
+
className = _ref.className,
|
|
25
26
|
children = _ref.children,
|
|
26
27
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
27
28
|
return /*#__PURE__*/_react["default"].createElement("p", (0, _extends2["default"])({
|
|
28
29
|
ref: ref,
|
|
29
|
-
className: (0, _clsx["default"])(className, true && 'govgr-hint')
|
|
30
|
+
className: (0, _clsx["default"])(className, fontSize === '14' && 'govgr-!-font-size-14', fontSize === '16' && 'govgr-!-font-size-16', fontSize === '24' && 'govgr-!-font-size-24', true && 'govgr-hint')
|
|
30
31
|
}, props), children);
|
|
31
32
|
});
|
|
32
33
|
|
package/Hint/index.test.js
CHANGED
|
@@ -12,4 +12,28 @@ var _ref = /*#__PURE__*/_react["default"].createElement(_Hint["default"], null,
|
|
|
12
12
|
|
|
13
13
|
it('renders the Hint with no props', function () {
|
|
14
14
|
expect((0, _enzyme.mount)(_ref)).toMatchSnapshot();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
var _ref2 = /*#__PURE__*/_react["default"].createElement(_Hint["default"], {
|
|
18
|
+
fontSize: "14"
|
|
19
|
+
}, "hello");
|
|
20
|
+
|
|
21
|
+
it('renders the Hint with fontSize=14', function () {
|
|
22
|
+
expect((0, _enzyme.mount)(_ref2)).toMatchSnapshot();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
var _ref3 = /*#__PURE__*/_react["default"].createElement(_Hint["default"], {
|
|
26
|
+
fontSize: "16"
|
|
27
|
+
}, "hello");
|
|
28
|
+
|
|
29
|
+
it('renders the Hint with fontSize=16', function () {
|
|
30
|
+
expect((0, _enzyme.mount)(_ref3)).toMatchSnapshot();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _ref4 = /*#__PURE__*/_react["default"].createElement(_Hint["default"], {
|
|
34
|
+
fontSize: "24"
|
|
35
|
+
}, "hello");
|
|
36
|
+
|
|
37
|
+
it('renders the Hint with fontSize=24', function () {
|
|
38
|
+
expect((0, _enzyme.mount)(_ref4)).toMatchSnapshot();
|
|
15
39
|
});
|
|
@@ -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
|