react-data-matrix 0.1.5 → 0.1.6
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/README.md +2 -0
- package/dist/components/matrixHeaders.js +7 -29
- package/dist/components/matrixRows.js +7 -22
- package/dist/components/reactMatrix.js +40 -82
- package/dist/context/index.js +15 -0
- package/dist/helpers/getStyles.js +70 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,16 +9,12 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
+
var _getStyles = require("../helpers/getStyles");
|
|
13
|
+
|
|
12
14
|
var _functions = require("../utils/functions");
|
|
13
15
|
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
-
|
|
20
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
-
|
|
22
18
|
// import "./styles/riskMatrix.scss";
|
|
23
19
|
const MatrixHeaders = props => {
|
|
24
20
|
const {
|
|
@@ -33,29 +29,10 @@ const MatrixHeaders = props => {
|
|
|
33
29
|
customDynamicHeaderTitleIdValue,
|
|
34
30
|
customDynamicSubHeaderTitleIdValue
|
|
35
31
|
} = props;
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}, thPrimaryTitleStyles) : _objectSpread({}, customPrimaryTitleStyles);
|
|
41
|
-
const customRowStyles = !thRowStyles ? {} : thRowStyles;
|
|
42
|
-
const headerRowStyles = hasInlineStyles ? _objectSpread({
|
|
43
|
-
borderColor: "black",
|
|
44
|
-
borderStyle: "solid",
|
|
45
|
-
padding: "".concat(10, "rem ", 0, " ", 0, " ", 0),
|
|
46
|
-
borderWidth: "".concat(0, " ", 0, " ", 0, " ", 10, "px")
|
|
47
|
-
}, thRowStyles) : _objectSpread({}, customRowStyles);
|
|
48
|
-
const customThTitleStyles = !thTitleStyles ? {} : thTitleStyles;
|
|
49
|
-
const headerTitleStyles = hasInlineStyles ? _objectSpread({
|
|
50
|
-
padding: "".concat(0, " ", 0.5, "rem ", 0, " ", 0.5, "rem"),
|
|
51
|
-
backgroundColor: "light-grey",
|
|
52
|
-
border: "".concat(1, "px solid black")
|
|
53
|
-
}, thTitleStyles) : _objectSpread({}, customThTitleStyles);
|
|
54
|
-
const customThSubTitleStyles = !thSubTitleStyles ? {} : thSubTitleStyles;
|
|
55
|
-
const headerSubTitleStyles = hasInlineStyles ? _objectSpread({
|
|
56
|
-
fontSize: "".concat(0.9, "em"),
|
|
57
|
-
fontWeight: "normal"
|
|
58
|
-
}, thSubTitleStyles) : _objectSpread({}, customThSubTitleStyles);
|
|
32
|
+
const headerRowStyles = (0, _getStyles.getHeaderRowStyles)(hasInlineStyles, thRowStyles);
|
|
33
|
+
const headerTitleStyles = (0, _getStyles.getHeaderTitleStyles)(hasInlineStyles, thTitleStyles);
|
|
34
|
+
const headerSubTitleStyles = (0, _getStyles.getHeaderSubTitleStyles)(hasInlineStyles, thSubTitleStyles);
|
|
35
|
+
const headerPrimaryTitleStyles = (0, _getStyles.getHeaderPrimaryTitleStyles)(hasInlineStyles, thPrimaryTitleStyles);
|
|
59
36
|
const headerPrimaryTitle = headerPrimaryUpper ? (0, _functions.capitaliseString)(data.primary_header_title) : data.primary_header_title;
|
|
60
37
|
return /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", {
|
|
61
38
|
id: "react-matrix-blank-headers-primary-title-row"
|
|
@@ -94,6 +71,7 @@ MatrixHeaders.defaultProps = {
|
|
|
94
71
|
thTitleStyles: {},
|
|
95
72
|
thSubTitleStyles: {},
|
|
96
73
|
thPrimaryTitleStyles: {},
|
|
74
|
+
matrixSizeSelected: 5,
|
|
97
75
|
customHeaderRowIdValue: "",
|
|
98
76
|
customDynamicHeaderTitleIdValue: "",
|
|
99
77
|
customDynamicSubHeaderTitleIdValue: ""
|
|
@@ -9,6 +9,8 @@ require("core-js/modules/es.array.reverse.js");
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
+
var _getStyles = require("../helpers/getStyles");
|
|
13
|
+
|
|
12
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
15
|
|
|
14
16
|
var _functions = require("../utils/functions");
|
|
@@ -17,12 +19,6 @@ var _tableData = _interopRequireDefault(require("./tableData"));
|
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
-
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
-
|
|
24
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
|
-
|
|
26
22
|
const MatrixRows = props => {
|
|
27
23
|
const {
|
|
28
24
|
data,
|
|
@@ -39,22 +35,10 @@ const MatrixRows = props => {
|
|
|
39
35
|
customTableDataDynamicIdValue
|
|
40
36
|
} = props;
|
|
41
37
|
const valuesArray = reverseMatrixValues ? (0, _functions.groupObjectsByProp)(data.matrix_values, "likelihood_descriptor").reverse().slice(0, data.matrix_size) : (0, _functions.groupObjectsByProp)(data.matrix_values, "likelihood_descriptor").slice(0, data.matrix_size);
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
border: "".concat(1, "px solid black")
|
|
47
|
-
}, customRowStyles) : _objectSpread({}, customRowStyles);
|
|
48
|
-
const customTitleStyle = !trTitleStyles ? {} : trTitleStyles;
|
|
49
|
-
const tableRowHeaderTitleStyles = hasInlineStyles ? _objectSpread({
|
|
50
|
-
padding: "".concat(0, " ", 0.5, "rem ", 0, " ", 0.5, "rem"),
|
|
51
|
-
border: "".concat(1, "px solid black")
|
|
52
|
-
}, trTitleStyles) : _objectSpread({}, customTitleStyle);
|
|
53
|
-
const customSubTitleStyle = !trSubTitleStyles ? {} : trSubTitleStyles;
|
|
54
|
-
const tableRowHeaderSubTitleStyles = hasInlineStyles ? _objectSpread({
|
|
55
|
-
fontSize: "".concat(0.9, "em"),
|
|
56
|
-
fontWeight: "normal"
|
|
57
|
-
}, trSubTitleStyles) : _objectSpread({}, customSubTitleStyle);
|
|
38
|
+
const tableRowStyles = (0, _getStyles.getHeaderRowStyles)(hasInlineStyles, trRowStyles);
|
|
39
|
+
const tableRowHeaderTitleStyles = (0, _getStyles.getHeaderTitleStyles)(hasInlineStyles, trTitleStyles);
|
|
40
|
+
const tableRowHeaderSubTitleStyles = (0, _getStyles.getHeaderSubTitleStyles)(hasInlineStyles, trSubTitleStyles);
|
|
41
|
+
const rowHeaderPrimaryTitleStyles = (0, _getStyles.getHeaderPrimaryTitleStyles)(hasInlineStyles, trPrimaryTitleStyles);
|
|
58
42
|
const rowPrimaryTitle = rowPrimaryUpper ? (0, _functions.capitaliseString)(data.primary_row_header_title) : data.primary_row_header_title;
|
|
59
43
|
return /*#__PURE__*/_react.default.createElement("tbody", null, /*#__PURE__*/_react.default.createElement("tr", {
|
|
60
44
|
id: "react-matrix-row-primary-title"
|
|
@@ -97,6 +81,7 @@ MatrixRows.defaultProps = {
|
|
|
97
81
|
trSubTitleStyles: {},
|
|
98
82
|
trPrimaryTitleStyles: {},
|
|
99
83
|
tdStyles: {},
|
|
84
|
+
matrixSizeSelected: 5,
|
|
100
85
|
customRowDynamicIdValue: "",
|
|
101
86
|
customRowHeaderDynamicIdValue: "",
|
|
102
87
|
customTableDataDynamicIdValue: ""
|
|
@@ -9,10 +9,14 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
12
|
+
var _getStyles = require("../helpers/getStyles");
|
|
13
|
+
|
|
12
14
|
var _matrixHeaders = _interopRequireDefault(require("./matrixHeaders"));
|
|
13
15
|
|
|
14
16
|
var _matrixRows = _interopRequireDefault(require("./matrixRows"));
|
|
15
17
|
|
|
18
|
+
var _context = require("../context");
|
|
19
|
+
|
|
16
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
21
|
|
|
18
22
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -23,103 +27,57 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
23
27
|
|
|
24
28
|
const ReactMatrix = props => {
|
|
25
29
|
const {
|
|
26
|
-
|
|
30
|
+
matrixName,
|
|
27
31
|
tableStyles,
|
|
28
|
-
thRowStyles,
|
|
29
|
-
trRowStyles,
|
|
30
|
-
trTitleStyles,
|
|
31
|
-
thTitleStyles,
|
|
32
32
|
hasTableBorder,
|
|
33
|
-
rowPrimaryUpper,
|
|
34
33
|
hasInlineStyles,
|
|
35
|
-
|
|
36
|
-
trSubTitleStyles,
|
|
37
|
-
headerPrimaryUpper,
|
|
38
|
-
matrixSizeSelected,
|
|
34
|
+
matrixDescription,
|
|
39
35
|
hasContainerStyles,
|
|
40
|
-
|
|
41
|
-
thPrimaryTitleStyles,
|
|
42
|
-
trPrimaryTitleStyles,
|
|
43
|
-
tableContainerStyles,
|
|
44
|
-
customHeaderRowIdValue,
|
|
45
|
-
customRowDynamicIdValue,
|
|
46
|
-
customTableDataDynamicIdValue,
|
|
47
|
-
customDynamicHeaderTitleIdValue,
|
|
48
|
-
customDynamicSubHeaderTitleIdValue
|
|
36
|
+
tableContainerStyles
|
|
49
37
|
} = props;
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
left: "".concat(50, "%"),
|
|
54
|
-
height: "".concat(100, "%"),
|
|
55
|
-
textAlign: "center",
|
|
56
|
-
position: "absolute",
|
|
57
|
-
transform: "translate(".concat(-50, "%, ").concat(-50, "%)")
|
|
58
|
-
}, tableContainerStyles) : _objectSpread({}, customContainerStyles);
|
|
59
|
-
const tableBorder = hasInlineStyles && hasTableBorder ? {
|
|
60
|
-
border: "".concat(1, "px solid black")
|
|
61
|
-
} : {};
|
|
62
|
-
const customTableStyles = !tableStyles ? {} : tableStyles;
|
|
63
|
-
const tableElmStyles = hasInlineStyles && tableStyles ? _objectSpread({
|
|
64
|
-
width: "".concat(70, "rem")
|
|
65
|
-
}, tableStyles) : _objectSpread({}, customTableStyles);
|
|
38
|
+
const tableBorder = (0, _getStyles.getTableBoarder)(hasInlineStyles && hasTableBorder);
|
|
39
|
+
const tableElmStyles = (0, _getStyles.getTableStyles)(hasInlineStyles && tableStyles, tableStyles);
|
|
40
|
+
const containerStyles = (0, _getStyles.getContainerStyles)(hasInlineStyles && hasContainerStyles, tableContainerStyles);
|
|
66
41
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
67
42
|
style: containerStyles
|
|
68
|
-
}, /*#__PURE__*/_react.default.createElement("h1", null,
|
|
43
|
+
}, /*#__PURE__*/_react.default.createElement("h1", null, matrixName), /*#__PURE__*/_react.default.createElement("h4", null, matrixDescription), /*#__PURE__*/_react.default.createElement("table", {
|
|
69
44
|
id: "matrix-table",
|
|
70
45
|
style: _objectSpread(_objectSpread({}, tableElmStyles), tableBorder)
|
|
71
|
-
}, /*#__PURE__*/_react.default.createElement(_matrixHeaders.default, {
|
|
72
|
-
data: data,
|
|
73
|
-
thRowStyles: thRowStyles,
|
|
74
|
-
thTitleStyles: thTitleStyles,
|
|
75
|
-
hasInlineStyles: hasInlineStyles,
|
|
76
|
-
thSubTitleStyles: thSubTitleStyles,
|
|
77
|
-
headerPrimaryUpper: headerPrimaryUpper,
|
|
78
|
-
matrixSizeSelected: matrixSizeSelected,
|
|
79
|
-
thPrimaryTitleStyles: thPrimaryTitleStyles,
|
|
80
|
-
customHeaderRowIdValue: customHeaderRowIdValue,
|
|
81
|
-
customDynamicHeaderTitleIdValue: customDynamicHeaderTitleIdValue,
|
|
82
|
-
customDynamicSubHeaderTitleIdValue: customDynamicSubHeaderTitleIdValue
|
|
83
|
-
}), /*#__PURE__*/_react.default.createElement(_matrixRows.default, {
|
|
84
|
-
data: data,
|
|
85
|
-
trRowStyles: trRowStyles,
|
|
86
|
-
trTitleStyles: trTitleStyles,
|
|
87
|
-
rowPrimaryUpper: rowPrimaryUpper,
|
|
88
|
-
hasInlineStyles: hasInlineStyles,
|
|
89
|
-
trSubTitleStyles: trSubTitleStyles,
|
|
90
|
-
matrixSizeSelected: matrixSizeSelected,
|
|
91
|
-
reverseMatrixValues: reverseMatrixValues,
|
|
92
|
-
trPrimaryTitleStyles: trPrimaryTitleStyles,
|
|
93
|
-
customRowDynamicIdValue: customRowDynamicIdValue,
|
|
94
|
-
customTableDataDynamicIdValue: customTableDataDynamicIdValue
|
|
95
|
-
})));
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement(_context.Consumer, null, context => /*#__PURE__*/_react.default.createElement(_matrixHeaders.default, {
|
|
47
|
+
data: context.data,
|
|
48
|
+
thRowStyles: context.thRowStyles,
|
|
49
|
+
thTitleStyles: context.thTitleStyles,
|
|
50
|
+
hasInlineStyles: context.hasInlineStyles,
|
|
51
|
+
thSubTitleStyles: context.thSubTitleStyles,
|
|
52
|
+
headerPrimaryUpper: context.headerPrimaryUpper,
|
|
53
|
+
matrixSizeSelected: context.matrixSizeSelected,
|
|
54
|
+
thPrimaryTitleStyles: context.thPrimaryTitleStyles,
|
|
55
|
+
customHeaderRowIdValue: context.customHeaderRowIdValue,
|
|
56
|
+
customDynamicHeaderTitleIdValue: context.customDynamicHeaderTitleIdValue,
|
|
57
|
+
customDynamicSubHeaderTitleIdValue: context.customDynamicSubHeaderTitleIdValue
|
|
58
|
+
})), /*#__PURE__*/_react.default.createElement(_context.Consumer, null, context => /*#__PURE__*/_react.default.createElement(_matrixRows.default, {
|
|
59
|
+
data: context.data,
|
|
60
|
+
trRowStyles: context.trRowStyles,
|
|
61
|
+
trTitleStyles: context.trTitleStyles,
|
|
62
|
+
rowPrimaryUpper: context.rowPrimaryUpper,
|
|
63
|
+
hasInlineStyles: context.hasInlineStyles,
|
|
64
|
+
trSubTitleStyles: context.trSubTitleStyles,
|
|
65
|
+
matrixSizeSelected: context.matrixSizeSelected,
|
|
66
|
+
reverseMatrixValues: context.reverseMatrixValues,
|
|
67
|
+
trPrimaryTitleStyles: context.trPrimaryTitleStyles,
|
|
68
|
+
customRowDynamicIdValue: context.customRowDynamicIdValue,
|
|
69
|
+
customTableDataDynamicIdValue: context.customTableDataDynamicIdValue
|
|
70
|
+
}))));
|
|
96
71
|
};
|
|
97
72
|
|
|
98
73
|
ReactMatrix.defaultProps = {
|
|
74
|
+
tableStyles: {},
|
|
99
75
|
hasTableBorder: true,
|
|
100
|
-
rowPrimaryUpper: true,
|
|
101
76
|
hasInlineStyles: true,
|
|
102
|
-
matrixSizeSelected: 5,
|
|
103
|
-
headerPrimaryUpper: true,
|
|
104
77
|
hasContainerStyles: true,
|
|
105
|
-
reverseMatrixValues: true,
|
|
106
78
|
tableContainerStyles: {},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
thTitleStyles: {},
|
|
110
|
-
thSubTitleStyles: {},
|
|
111
|
-
thPrimaryTitleStyles: {},
|
|
112
|
-
trRowStyles: {},
|
|
113
|
-
trTitleStyles: {},
|
|
114
|
-
trSubTitleStyles: {},
|
|
115
|
-
trPrimaryTitleStyles: {},
|
|
116
|
-
tdStyles: {},
|
|
117
|
-
customHeaderRowIdValue: "",
|
|
118
|
-
customRowDynamicIdValue: "",
|
|
119
|
-
customTableDataDynamicIdValue: "",
|
|
120
|
-
customRowHeaderDynamicIdValue: "",
|
|
121
|
-
customDynamicHeaderTitleIdValue: "",
|
|
122
|
-
customDynamicSubHeaderTitleIdValue: ""
|
|
79
|
+
matrixName: "",
|
|
80
|
+
matrixDescription: ""
|
|
123
81
|
};
|
|
124
82
|
ReactMatrix.propTypes = {
|
|
125
83
|
data: _propTypes.default.shape({
|
|
@@ -147,7 +105,7 @@ ReactMatrix.propTypes = {
|
|
|
147
105
|
likelihood_descriptor: _propTypes.default.string.isRequired,
|
|
148
106
|
consequence_descriptor: _propTypes.default.number
|
|
149
107
|
})).isRequired
|
|
150
|
-
})
|
|
108
|
+
}),
|
|
151
109
|
hasTableBorder: _propTypes.default.bool,
|
|
152
110
|
hasInlineStyles: _propTypes.default.bool,
|
|
153
111
|
hasContainerStyles: _propTypes.default.bool,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Provider = exports.Consumer = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
const {
|
|
11
|
+
Provider,
|
|
12
|
+
Consumer
|
|
13
|
+
} = /*#__PURE__*/(0, _react.createContext)();
|
|
14
|
+
exports.Consumer = Consumer;
|
|
15
|
+
exports.Provider = Provider;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getTableStyles = exports.getTableBoarder = exports.getHeaderTitleStyles = exports.getHeaderSubTitleStyles = exports.getHeaderRowStyles = exports.getHeaderPrimaryTitleStyles = exports.getCustomStyles = exports.getContainerStyles = void 0;
|
|
7
|
+
|
|
8
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
+
|
|
10
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
|
+
|
|
12
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
|
|
14
|
+
const getCustomStyles = hasStyle => !hasStyle ? {} : hasStyle;
|
|
15
|
+
|
|
16
|
+
exports.getCustomStyles = getCustomStyles;
|
|
17
|
+
|
|
18
|
+
const getContainerStyles = (hasStyle, styles) => !hasStyle ? _objectSpread({}, getCustomStyles(styles)) : _objectSpread({
|
|
19
|
+
top: "".concat(50, "%"),
|
|
20
|
+
left: "".concat(50, "%"),
|
|
21
|
+
height: "".concat(100, "%"),
|
|
22
|
+
textAlign: "center",
|
|
23
|
+
position: "absolute",
|
|
24
|
+
transform: "translate(".concat(-50, "%, ").concat(-50, "%)")
|
|
25
|
+
}, styles);
|
|
26
|
+
|
|
27
|
+
exports.getContainerStyles = getContainerStyles;
|
|
28
|
+
|
|
29
|
+
const getTableBoarder = hasStyle => !hasStyle ? {} : {
|
|
30
|
+
border: "".concat(1, "px solid black")
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.getTableBoarder = getTableBoarder;
|
|
34
|
+
|
|
35
|
+
const getTableStyles = (hasStyle, styles) => !hasStyle ? _objectSpread({}, getCustomStyles(styles)) : _objectSpread({
|
|
36
|
+
width: "".concat(70, "rem")
|
|
37
|
+
}, styles);
|
|
38
|
+
|
|
39
|
+
exports.getTableStyles = getTableStyles;
|
|
40
|
+
|
|
41
|
+
const getHeaderPrimaryTitleStyles = (hasStyle, styles) => !hasStyle ? _objectSpread({}, getCustomStyles(styles)) : _objectSpread({
|
|
42
|
+
borderWidth: "".concat(0),
|
|
43
|
+
padding: "".concat(1, "rem ", 0, " ", 1, "rem ", 0)
|
|
44
|
+
}, styles);
|
|
45
|
+
|
|
46
|
+
exports.getHeaderPrimaryTitleStyles = getHeaderPrimaryTitleStyles;
|
|
47
|
+
|
|
48
|
+
const getHeaderRowStyles = (hasStyle, styles) => !hasStyle ? _objectSpread({}, getCustomStyles(styles)) : _objectSpread({
|
|
49
|
+
borderColor: "black",
|
|
50
|
+
borderStyle: "solid",
|
|
51
|
+
padding: "".concat(10, "rem ", 0, " ", 0, " ", 0),
|
|
52
|
+
borderWidth: "".concat(0, " ", 0, " ", 0, " ", 10, "px")
|
|
53
|
+
}, styles);
|
|
54
|
+
|
|
55
|
+
exports.getHeaderRowStyles = getHeaderRowStyles;
|
|
56
|
+
|
|
57
|
+
const getHeaderTitleStyles = (hasStyle, styles) => !hasStyle ? _objectSpread({}, getCustomStyles(styles)) : _objectSpread({
|
|
58
|
+
padding: "".concat(0, " ", 0.5, "rem ", 0, " ", 0.5, "rem"),
|
|
59
|
+
backgroundColor: "light-grey",
|
|
60
|
+
border: "".concat(1, "px solid black")
|
|
61
|
+
}, styles);
|
|
62
|
+
|
|
63
|
+
exports.getHeaderTitleStyles = getHeaderTitleStyles;
|
|
64
|
+
|
|
65
|
+
const getHeaderSubTitleStyles = (hasStyle, styles) => !hasStyle ? _objectSpread({}, getCustomStyles(styles)) : _objectSpread({
|
|
66
|
+
fontSize: "".concat(0.9, "em"),
|
|
67
|
+
fontWeight: "normal"
|
|
68
|
+
}, styles);
|
|
69
|
+
|
|
70
|
+
exports.getHeaderSubTitleStyles = getHeaderSubTitleStyles;
|