pixelize-design-library 1.1.52 → 1.1.53

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.
@@ -102,20 +102,37 @@ var TableBody = function (_a) {
102
102
  backgroundColor: theme.colors.gray[100],
103
103
  },
104
104
  }
105
- : {}, _hover: {
106
- "& > td": {
107
- backgroundColor: theme.colors.gray[100],
108
- },
109
- } },
105
+ : {} },
110
106
  isContent && (react_2.default.createElement(RenderContent, { rowIndex: rowIndex, isExpanded: isExpanded, isContent: !!row.content })),
111
107
  isCheckbox && react_2.default.createElement(RenderCheckbox, { row: row, isChecked: isChecked }),
112
108
  columns.map(function (header, headerIndex) {
113
- var _a;
109
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
114
110
  var isFrozen = header.isFreeze;
115
111
  var leftOffset = isFrozen
116
112
  ? (0, table_1.calculateLeftOffset)(columnWidths, headerIndex) +
117
113
  (isCheckbox ? 50 : 0)
118
114
  : 0;
115
+ var cellBgColor = undefined;
116
+ var cellTextColor = undefined;
117
+ if ((_a = row.cellStyle) === null || _a === void 0 ? void 0 : _a[header.id]) {
118
+ cellBgColor =
119
+ (_d = (_c = (_b = row.cellStyle) === null || _b === void 0 ? void 0 : _b[header.id]) === null || _c === void 0 ? void 0 : _c.bg) !== null && _d !== void 0 ? _d : theme.colors.backgroundColor.light;
120
+ cellTextColor =
121
+ (_g = (_f = (_e = row.cellStyle) === null || _e === void 0 ? void 0 : _e[header.id]) === null || _f === void 0 ? void 0 : _f.color) !== null && _g !== void 0 ? _g : undefined;
122
+ }
123
+ else if (isFrozen) {
124
+ cellBgColor = freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : undefined;
125
+ cellTextColor = freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : undefined;
126
+ }
127
+ else if (index % 2 === 1) {
128
+ cellBgColor = theme.colors.backgroundColor.light;
129
+ }
130
+ var rowBgColor = undefined;
131
+ var rowTextColor = undefined;
132
+ if (row.rowStyle) {
133
+ rowBgColor = (_h = row.rowStyle) === null || _h === void 0 ? void 0 : _h.bg;
134
+ rowTextColor = (_j = row.rowStyle) === null || _j === void 0 ? void 0 : _j.color;
135
+ }
119
136
  return (visibleColumns[header.label] && (react_2.default.createElement(react_1.Td, { maxWidth: 500, minWidth: 120, key: headerIndex + 1, onClick: function () {
120
137
  return !header.node
121
138
  ? handleRowClick(row, {
@@ -123,13 +140,13 @@ var TableBody = function (_a) {
123
140
  id: header.id,
124
141
  })
125
142
  : null;
126
- }, fontSize: 14, fontWeight: 400, position: isFrozen ? "sticky" : undefined, left: isFrozen ? leftOffset : undefined, zIndex: isFrozen ? 1 : 0, backgroundColor: isFrozen
127
- ? freezedBgColor
128
- : index % 2 === 1
129
- ? theme.colors.backgroundColor.light
130
- : "white", textOverflow: "ellipsis", border: noBorders
143
+ }, fontSize: 14, fontWeight: 400, position: isFrozen ? "sticky" : undefined, left: isFrozen ? leftOffset : undefined, zIndex: isFrozen ? 1 : 0, backgroundColor: cellBgColor !== null && cellBgColor !== void 0 ? cellBgColor : rowBgColor, textOverflow: "ellipsis", border: noBorders
131
144
  ? "none"
132
- : "1px solid ".concat((_a = theme.colors) === null || _a === void 0 ? void 0 : _a.gray[isFrozen || isChecked ? 300 : 200]), className: "columns ".concat(isFrozen ? "sticky-columns" : "scrollable-columns"), boxSizing: "border-box", color: isFrozen ? freezedTextColor : undefined },
145
+ : "1px solid ".concat((_k = theme.colors) === null || _k === void 0 ? void 0 : _k.gray[isFrozen || isChecked ? 300 : 200]), className: "columns ".concat(isFrozen ? "sticky-columns" : "scrollable-columns"), boxSizing: "border-box", color: cellTextColor !== null && cellTextColor !== void 0 ? cellTextColor : rowTextColor, _hover: ((_l = row.cellStyle) === null || _l === void 0 ? void 0 : _l[header.id]) || row.rowStyle
146
+ ? {}
147
+ : {
148
+ backgroundColor: theme.colors.gray[100],
149
+ } },
133
150
  react_2.default.createElement(react_1.Box, { textOverflow: "ellipsis", whiteSpace: "nowrap", display: "block", overflow: "hidden" }, header.node ? header.node(row) : row[header.id]))));
134
151
  }),
135
152
  isLink && react_2.default.createElement(RenderView, { row: row, bgcolor: freezeViewColor })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "1.1.52",
3
+ "version": "1.1.53",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",