@digigov/react-core 0.11.0 → 0.12.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 CHANGED
@@ -1,6 +1,13 @@
1
1
  # Change Log - @digigov/react-core
2
2
 
3
- This log was last generated on Wed, 20 Apr 2022 12:11:46 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 03 May 2022 10:27:10 GMT and should not be manually modified.
4
+
5
+ ## 0.12.0
6
+ Tue, 03 May 2022 10:27:10 GMT
7
+
8
+ ### Minor changes
9
+
10
+ - add TableContainer component
4
11
 
5
12
  ## 0.11.0
6
13
  Wed, 20 Apr 2022 12:11:46 GMT
@@ -0,0 +1,23 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`renders the TableContainer with border prop 1`] = `
4
+ <ForwardRef(TableContainer)
5
+ border={true}
6
+ >
7
+ <div
8
+ className="govgr-table-container--border govgr-table-container"
9
+ >
10
+ hello
11
+ </div>
12
+ </ForwardRef(TableContainer)>
13
+ `;
14
+
15
+ exports[`renders the TableContainer with no props 1`] = `
16
+ <ForwardRef(TableContainer)>
17
+ <div
18
+ className="govgr-table-container"
19
+ >
20
+ hello
21
+ </div>
22
+ </ForwardRef(TableContainer)>
23
+ `;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ declare type DivElementAttributes = JSX.IntrinsicElements['div'];
3
+ export interface TableContainerProps extends DivElementAttributes {
4
+ /**
5
+ * border is optional. Set to true if you need a border for the Table.
6
+ */
7
+ border?: boolean;
8
+ }
9
+ /**
10
+ * Use TableContainer as a wrapper for a Table. It is used when the table is wider that the viewport width.
11
+ */
12
+ export declare const TableContainer: React.ForwardRefExoticComponent<Pick<TableContainerProps, "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" | "border"> & React.RefAttributes<HTMLDivElement>>;
13
+ export default TableContainer;
@@ -0,0 +1,37 @@
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.TableContainer = 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 = ["border", "className", "children"];
19
+
20
+ /**
21
+ * Use TableContainer as a wrapper for a Table. It is used when the table is wider that the viewport width.
22
+ */
23
+ var TableContainer = /*#__PURE__*/_react["default"].forwardRef(function TableContainer(_ref, ref) {
24
+ var _ref$border = _ref.border,
25
+ border = _ref$border === void 0 ? false : _ref$border,
26
+ className = _ref.className,
27
+ children = _ref.children,
28
+ props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
29
+ return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
30
+ ref: ref,
31
+ className: (0, _clsx["default"])(className, border && 'govgr-table-container--border', true && 'govgr-table-container')
32
+ }, props), children);
33
+ });
34
+
35
+ exports.TableContainer = TableContainer;
36
+ var _default = TableContainer;
37
+ exports["default"] = _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
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 _TableContainer = _interopRequireDefault(require("@digigov/react-core/TableContainer"));
10
+
11
+ var _ref = /*#__PURE__*/_react["default"].createElement(_TableContainer["default"], null, "hello");
12
+
13
+ it('renders the TableContainer with no props', function () {
14
+ expect((0, _enzyme.mount)(_ref)).toMatchSnapshot();
15
+ });
16
+
17
+ var _ref2 = /*#__PURE__*/_react["default"].createElement(_TableContainer["default"], {
18
+ border: true
19
+ }, "hello");
20
+
21
+ it('renders the TableContainer with border prop', function () {
22
+ expect((0, _enzyme.mount)(_ref2)).toMatchSnapshot();
23
+ });
@@ -0,0 +1,23 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`renders the TableContainer with border prop 1`] = `
4
+ <ForwardRef(TableContainer)
5
+ border={true}
6
+ >
7
+ <div
8
+ className="govgr-table-container--border govgr-table-container"
9
+ >
10
+ hello
11
+ </div>
12
+ </ForwardRef(TableContainer)>
13
+ `;
14
+
15
+ exports[`renders the TableContainer with no props 1`] = `
16
+ <ForwardRef(TableContainer)>
17
+ <div
18
+ className="govgr-table-container"
19
+ >
20
+ hello
21
+ </div>
22
+ </ForwardRef(TableContainer)>
23
+ `;
@@ -0,0 +1,22 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["border", "className", "children"];
4
+ import React from 'react';
5
+ import clsx from 'clsx';
6
+
7
+ /**
8
+ * Use TableContainer as a wrapper for a Table. It is used when the table is wider that the viewport width.
9
+ */
10
+ export var TableContainer = /*#__PURE__*/React.forwardRef(function TableContainer(_ref, ref) {
11
+ var _ref$border = _ref.border,
12
+ border = _ref$border === void 0 ? false : _ref$border,
13
+ className = _ref.className,
14
+ children = _ref.children,
15
+ props = _objectWithoutProperties(_ref, _excluded);
16
+
17
+ return /*#__PURE__*/React.createElement("div", _extends({
18
+ ref: ref,
19
+ className: clsx(className, border && 'govgr-table-container--border', true && 'govgr-table-container')
20
+ }, props), children);
21
+ });
22
+ export default TableContainer;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { mount } from 'enzyme';
3
+ import TableContainer from '@digigov/react-core/TableContainer';
4
+
5
+ var _ref = /*#__PURE__*/React.createElement(TableContainer, null, "hello");
6
+
7
+ it('renders the TableContainer with no props', function () {
8
+ expect(mount(_ref)).toMatchSnapshot();
9
+ });
10
+
11
+ var _ref2 = /*#__PURE__*/React.createElement(TableContainer, {
12
+ border: true
13
+ }, "hello");
14
+
15
+ it('renders the TableContainer with border prop', function () {
16
+ expect(mount(_ref2)).toMatchSnapshot();
17
+ });
package/es/index.js CHANGED
@@ -118,6 +118,7 @@ export { default as SvgIcon } from '@digigov/react-core/SvgIcon';
118
118
  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
+ export { default as TableContainer } from '@digigov/react-core/TableContainer';
121
122
  export { default as TableDataCell } from '@digigov/react-core/TableDataCell';
122
123
  export { default as TableNoDataRow } from '@digigov/react-core/TableNoDataRow';
123
124
  export { default as TableHead } from '@digigov/react-core/TableHead';
@@ -0,0 +1,23 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`renders the TableContainer with border prop 1`] = `
4
+ <ForwardRef(TableContainer)
5
+ border={true}
6
+ >
7
+ <div
8
+ className="govgr-table-container--border govgr-table-container"
9
+ >
10
+ hello
11
+ </div>
12
+ </ForwardRef(TableContainer)>
13
+ `;
14
+
15
+ exports[`renders the TableContainer with no props 1`] = `
16
+ <ForwardRef(TableContainer)>
17
+ <div
18
+ className="govgr-table-container"
19
+ >
20
+ hello
21
+ </div>
22
+ </ForwardRef(TableContainer)>
23
+ `;
@@ -0,0 +1,22 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["border", "className", "children"];
4
+ import React from 'react';
5
+ import clsx from 'clsx';
6
+
7
+ /**
8
+ * Use TableContainer as a wrapper for a Table. It is used when the table is wider that the viewport width.
9
+ */
10
+ export var TableContainer = /*#__PURE__*/React.forwardRef(function TableContainer(_ref, ref) {
11
+ var _ref$border = _ref.border,
12
+ border = _ref$border === void 0 ? false : _ref$border,
13
+ className = _ref.className,
14
+ children = _ref.children,
15
+ props = _objectWithoutProperties(_ref, _excluded);
16
+
17
+ return /*#__PURE__*/React.createElement("div", _extends({
18
+ ref: ref,
19
+ className: clsx(className, border && 'govgr-table-container--border', true && 'govgr-table-container')
20
+ }, props), children);
21
+ });
22
+ export default TableContainer;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { mount } from 'enzyme';
3
+ import TableContainer from '@digigov/react-core/TableContainer';
4
+
5
+ var _ref = /*#__PURE__*/React.createElement(TableContainer, null, "hello");
6
+
7
+ it('renders the TableContainer with no props', function () {
8
+ expect(mount(_ref)).toMatchSnapshot();
9
+ });
10
+
11
+ var _ref2 = /*#__PURE__*/React.createElement(TableContainer, {
12
+ border: true
13
+ }, "hello");
14
+
15
+ it('renders the TableContainer with border prop', function () {
16
+ expect(mount(_ref2)).toMatchSnapshot();
17
+ });
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Digigov v0.11.0
1
+ /** @license Digigov v0.12.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.
@@ -123,6 +123,7 @@ export { default as SvgIcon } from '@digigov/react-core/SvgIcon';
123
123
  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
+ export { default as TableContainer } from '@digigov/react-core/TableContainer';
126
127
  export { default as TableDataCell } from '@digigov/react-core/TableDataCell';
127
128
  export { default as TableNoDataRow } from '@digigov/react-core/TableNoDataRow';
128
129
  export { default as TableHead } from '@digigov/react-core/TableHead';
package/index.d.ts CHANGED
@@ -118,6 +118,7 @@ export { default as SvgIcon } from '@digigov/react-core/SvgIcon';
118
118
  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
+ export { default as TableContainer } from '@digigov/react-core/TableContainer';
121
122
  export { default as TableDataCell } from '@digigov/react-core/TableDataCell';
122
123
  export { default as TableNoDataRow } from '@digigov/react-core/TableNoDataRow';
123
124
  export { default as TableHead } from '@digigov/react-core/TableHead';
package/index.js CHANGED
@@ -719,6 +719,12 @@ Object.defineProperty(exports, "TableCaption", {
719
719
  return _TableCaption["default"];
720
720
  }
721
721
  });
722
+ Object.defineProperty(exports, "TableContainer", {
723
+ enumerable: true,
724
+ get: function get() {
725
+ return _TableContainer["default"];
726
+ }
727
+ });
722
728
  Object.defineProperty(exports, "TableDataCell", {
723
729
  enumerable: true,
724
730
  get: function get() {
@@ -1056,6 +1062,8 @@ var _TableBody = _interopRequireDefault(require("@digigov/react-core/TableBody")
1056
1062
 
1057
1063
  var _TableCaption = _interopRequireDefault(require("@digigov/react-core/TableCaption"));
1058
1064
 
1065
+ var _TableContainer = _interopRequireDefault(require("@digigov/react-core/TableContainer"));
1066
+
1059
1067
  var _TableDataCell = _interopRequireDefault(require("@digigov/react-core/TableDataCell"));
1060
1068
 
1061
1069
  var _TableNoDataRow = _interopRequireDefault(require("@digigov/react-core/TableNoDataRow"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digigov/react-core",
3
- "version": "0.11.0",
3
+ "version": "0.12.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.21.0",
14
+ "@digigov/css": "0.22.0",
15
15
  "clsx": "1.1.1",
16
16
  "react": "16.14.0",
17
17
  "react-dom": "16.14.0"