dibk-design 2.6.5 → 2.7.1
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/dist/components/Table.js
CHANGED
|
@@ -5,12 +5,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _helpers = require("../functions/helpers");
|
|
8
10
|
var _TableModule = _interopRequireDefault(require("./Table.module.scss"));
|
|
9
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
var getCaptionAlignClass = function getCaptionAlignClass(captionAlign) {
|
|
13
|
+
var defaultValue = "left";
|
|
14
|
+
var availableValues = ["left", "center", "right"];
|
|
15
|
+
return captionAlign !== null && captionAlign !== void 0 && captionAlign.length && availableValues.includes(captionAlign) ? _TableModule.default["captionAlign-".concat(captionAlign)] : _TableModule.default["captionAlign-".concat(defaultValue)];
|
|
16
|
+
};
|
|
17
|
+
var getCaptionSideClass = function getCaptionSideClass(captionSide) {
|
|
18
|
+
var defaultValue = "top";
|
|
19
|
+
var availableValues = ["top", "bottom"];
|
|
20
|
+
return captionSide !== null && captionSide !== void 0 && captionSide.length && availableValues.includes(captionSide) ? _TableModule.default["captionSide-".concat(captionSide)] : _TableModule.default["captionSide-".concat(defaultValue)];
|
|
21
|
+
};
|
|
10
22
|
var Table = function Table(props) {
|
|
11
23
|
return _react.default.createElement("table", {
|
|
12
|
-
className: _TableModule.default.table
|
|
24
|
+
className: (0, _helpers.classNameArrayToClassNameString)([_TableModule.default.table, getCaptionAlignClass(props.captionAlign), getCaptionSideClass(props.captionSide)])
|
|
13
25
|
}, props.children);
|
|
14
26
|
};
|
|
27
|
+
Table.propTypes = {
|
|
28
|
+
captionAlign: _propTypes.default.oneOf(["left", "center", "right"]),
|
|
29
|
+
captionSide: _propTypes.default.oneOf(["top", "bottom"])
|
|
30
|
+
};
|
|
15
31
|
var _default = Table;
|
|
16
32
|
exports.default = _default;
|
|
@@ -4,6 +4,41 @@
|
|
|
4
4
|
font-family: $default-font;
|
|
5
5
|
border-collapse: collapse;
|
|
6
6
|
width: 100%;
|
|
7
|
+
caption {
|
|
8
|
+
font-family: $default-font;
|
|
9
|
+
font-weight: normal;
|
|
10
|
+
font-style: italic;
|
|
11
|
+
line-height: 1;
|
|
12
|
+
font-size: 19px;
|
|
13
|
+
color: #072938;
|
|
14
|
+
}
|
|
15
|
+
&.captionSide-top {
|
|
16
|
+
caption {
|
|
17
|
+
caption-side: top;
|
|
18
|
+
margin: 0 0 6px 0;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
&.captionSide-bottom {
|
|
22
|
+
caption {
|
|
23
|
+
caption-side: bottom;
|
|
24
|
+
margin: 6px 0 0 0;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
&.captionAlign-left {
|
|
28
|
+
caption {
|
|
29
|
+
text-align: left;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
&.captionAlign-center {
|
|
33
|
+
caption {
|
|
34
|
+
text-align: center;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
&.captionAlign-right {
|
|
38
|
+
caption {
|
|
39
|
+
text-align: right;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
7
42
|
thead {
|
|
8
43
|
tr {
|
|
9
44
|
background-color: #ededed;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dibk-design",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@testing-library/jest-dom": "^5.16.5",
|
|
13
|
-
"@testing-library/react": "^
|
|
13
|
+
"@testing-library/react": "^14.0.0",
|
|
14
14
|
"@testing-library/user-event": "^14.4.3",
|
|
15
15
|
"react": "^18.2.0",
|
|
16
16
|
"react-dom": "^18.2.0",
|