@hipay/hipay-material-ui 2.0.0-beta.51 → 2.0.0-beta.52
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/HiCheckbox/HiCheckbox.js +3 -3
- package/HiColoredLabel/HiColoredLabel.js +3 -2
- package/HiSelectNew/HiNestedSelectContent.js +13 -75
- package/HiSelectableList/HiSelectableListItem.js +9 -4
- package/HiTable/HiTableRow.js +11 -4
- package/es/HiCheckbox/HiCheckbox.js +1 -1
- package/es/HiColoredLabel/HiColoredLabel.js +3 -2
- package/es/HiSelectNew/HiNestedSelectContent.js +5 -64
- package/es/HiSelectableList/HiSelectableListItem.js +5 -2
- package/es/HiTable/HiTableRow.js +10 -4
- package/es/styles/createPalette.js +9 -1
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/styles/createPalette.js +10 -1
- package/umd/hipay-material-ui.development.js +30 -15
- package/umd/hipay-material-ui.production.min.js +2 -2
package/HiCheckbox/HiCheckbox.js
CHANGED
@@ -74,8 +74,8 @@ exports.styles = styles;
|
|
74
74
|
|
75
75
|
var HiCheckbox =
|
76
76
|
/*#__PURE__*/
|
77
|
-
function (_React$
|
78
|
-
(0, _inherits2.default)(HiCheckbox, _React$
|
77
|
+
function (_React$PureComponent) {
|
78
|
+
(0, _inherits2.default)(HiCheckbox, _React$PureComponent);
|
79
79
|
|
80
80
|
function HiCheckbox(props) {
|
81
81
|
var _this;
|
@@ -158,7 +158,7 @@ function (_React$Component) {
|
|
158
158
|
}
|
159
159
|
}]);
|
160
160
|
return HiCheckbox;
|
161
|
-
}(_react.default.
|
161
|
+
}(_react.default.PureComponent);
|
162
162
|
|
163
163
|
HiCheckbox.defaultProps = {
|
164
164
|
checked: false,
|
@@ -136,13 +136,14 @@ function HiColoredLabel(props) {
|
|
136
136
|
color = props.color,
|
137
137
|
active = props.active,
|
138
138
|
fontWeight = props.fontWeight,
|
139
|
+
style = props.style,
|
139
140
|
theme = props.theme,
|
140
|
-
other = (0, _objectWithoutProperties2.default)(props, ["classes", "className", "label", "color", "active", "fontWeight", "theme"]);
|
141
|
+
other = (0, _objectWithoutProperties2.default)(props, ["classes", "className", "label", "color", "active", "fontWeight", "style", "theme"]);
|
141
142
|
var isHiColor = ['primary', 'secondary', 'positive', 'negative', 'middle', 'neutral'].includes(color);
|
142
143
|
var isHexColor = !isHiColor && /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(color);
|
143
144
|
return _react.default.createElement("div", (0, _extends2.default)({
|
144
145
|
className: (0, _classnames.default)(classes.root, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.color, !active), (0, _defineProperty2.default)(_classNames, classes.activeColor, active), (0, _defineProperty2.default)(_classNames, classes["activeColor".concat((0, _helpers.capitalize)(color))], active && isHiColor), (0, _defineProperty2.default)(_classNames, classes["color".concat((0, _helpers.capitalize)(color))], !active && isHiColor), _classNames), className),
|
145
|
-
style: (0, _extends2.default)({}, isHexColor && {
|
146
|
+
style: (0, _extends2.default)({}, style, isHexColor && {
|
146
147
|
backgroundColor: active ? color : (0, _colorManipulator.fade)(color, 0.08),
|
147
148
|
color: active ? theme.palette.getContrastText(color) : color
|
148
149
|
}, fontWeight && {
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
});
|
8
8
|
exports.getRecursiveFinalItemIdList = getRecursiveFinalItemIdList;
|
9
9
|
exports.findFinalItemRecursively = findFinalItemRecursively;
|
10
|
-
exports.default =
|
10
|
+
exports.default = void 0;
|
11
11
|
|
12
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
13
13
|
|
@@ -17,12 +17,10 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
17
17
|
|
18
18
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
19
19
|
|
20
|
-
var
|
20
|
+
var _getPrototypeOf3 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
21
21
|
|
22
22
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
23
23
|
|
24
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
25
|
-
|
26
24
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
27
25
|
|
28
26
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
@@ -33,16 +31,12 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
33
31
|
|
34
32
|
var _HiSelectContent = _interopRequireDefault(require("./HiSelectContent"));
|
35
33
|
|
36
|
-
var _HiIcon = _interopRequireDefault(require("../HiIcon"));
|
37
|
-
|
38
|
-
var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
|
39
|
-
|
40
34
|
var _helpers = require("../utils/helpers");
|
41
35
|
|
42
36
|
// @inheritedComponent HiSelectContent
|
43
37
|
|
44
38
|
/**
|
45
|
-
* Return array of final item id in nested list (via props
|
39
|
+
* Return array of final item id in nested list (via props children)
|
46
40
|
* @param itemList
|
47
41
|
* @param finalItemIdList
|
48
42
|
* @returns {*[]}
|
@@ -156,50 +150,6 @@ function buildFilteredItemList(itemList) {
|
|
156
150
|
v: visibleParent
|
157
151
|
});
|
158
152
|
}
|
159
|
-
|
160
|
-
var styles = function styles(theme) {
|
161
|
-
return {
|
162
|
-
root: {
|
163
|
-
backgroundColor: theme.palette.background2,
|
164
|
-
maxWidth: 500,
|
165
|
-
width: '100%',
|
166
|
-
position: 'relative'
|
167
|
-
},
|
168
|
-
popper: {
|
169
|
-
// width: '100%',
|
170
|
-
zIndex: 1200
|
171
|
-
},
|
172
|
-
paper: {
|
173
|
-
borderRadius: '0px 2px',
|
174
|
-
maxHeight: 480,
|
175
|
-
transition: 'none !important'
|
176
|
-
},
|
177
|
-
labelImg: {
|
178
|
-
height: 18,
|
179
|
-
width: 'auto',
|
180
|
-
margin: '0 4px',
|
181
|
-
verticalAlign: 'middle'
|
182
|
-
},
|
183
|
-
selectIconLabel: (0, _extends2.default)({
|
184
|
-
whiteSpace: 'nowrap',
|
185
|
-
overflow: 'hidden',
|
186
|
-
textOverflow: 'ellipsis',
|
187
|
-
paddingRight: 16
|
188
|
-
}, theme.typography.b1, {
|
189
|
-
display: 'inline-flex',
|
190
|
-
width: '100%'
|
191
|
-
}),
|
192
|
-
selectImgLabel: (0, _extends2.default)({
|
193
|
-
whiteSpace: 'nowrap',
|
194
|
-
overflow: 'hidden',
|
195
|
-
textOverflow: 'ellipsis',
|
196
|
-
paddingRight: 16
|
197
|
-
}, theme.typography.b1, {
|
198
|
-
display: 'inline-flex',
|
199
|
-
width: '100%'
|
200
|
-
})
|
201
|
-
};
|
202
|
-
};
|
203
153
|
/**
|
204
154
|
* HiNestedSelectContent hérite du composant HiSelectContent
|
205
155
|
*
|
@@ -214,18 +164,23 @@ var styles = function styles(theme) {
|
|
214
164
|
*/
|
215
165
|
|
216
166
|
|
217
|
-
exports.styles = styles;
|
218
|
-
|
219
167
|
var HiNestedSelectContent =
|
220
168
|
/*#__PURE__*/
|
221
169
|
function (_React$PureComponent) {
|
222
170
|
(0, _inherits2.default)(HiNestedSelectContent, _React$PureComponent);
|
223
171
|
|
224
|
-
function HiNestedSelectContent(
|
172
|
+
function HiNestedSelectContent() {
|
173
|
+
var _getPrototypeOf2;
|
174
|
+
|
225
175
|
var _this;
|
226
176
|
|
227
177
|
(0, _classCallCheck2.default)(this, HiNestedSelectContent);
|
228
|
-
|
178
|
+
|
179
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
180
|
+
args[_key] = arguments[_key];
|
181
|
+
}
|
182
|
+
|
183
|
+
_this = (0, _possibleConstructorReturn2.default)(this, (_getPrototypeOf2 = (0, _getPrototypeOf3.default)(HiNestedSelectContent)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
229
184
|
|
230
185
|
_this.handleSelect = function (event, item) {
|
231
186
|
var _this$props = _this.props,
|
@@ -329,20 +284,8 @@ function (_React$PureComponent) {
|
|
329
284
|
};
|
330
285
|
};
|
331
286
|
|
332
|
-
_this.handleSelect = _this.handleSelect.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
333
287
|
return _this;
|
334
288
|
}
|
335
|
-
/**
|
336
|
-
* Call onChange with the updated value
|
337
|
-
*
|
338
|
-
* - handle single value
|
339
|
-
* - handle multiple value
|
340
|
-
* - handle '_all' id
|
341
|
-
*
|
342
|
-
* @param event
|
343
|
-
* @param item
|
344
|
-
*/
|
345
|
-
|
346
289
|
|
347
290
|
(0, _createClass2.default)(HiNestedSelectContent, [{
|
348
291
|
key: "render",
|
@@ -463,10 +406,5 @@ HiNestedSelectContent.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
463
406
|
*/
|
464
407
|
value: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string, _propTypes.default.array])
|
465
408
|
} : {};
|
466
|
-
|
467
|
-
var _default = (0, _withStyles.default)(styles, {
|
468
|
-
hiComponent: true,
|
469
|
-
name: 'HmuiHiNestedSelectContent'
|
470
|
-
})(HiNestedSelectContent);
|
471
|
-
|
409
|
+
var _default = HiNestedSelectContent;
|
472
410
|
exports.default = _default;
|
@@ -45,6 +45,11 @@ var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
|
|
45
45
|
|
46
46
|
var _helpers = require("../utils/helpers");
|
47
47
|
|
48
|
+
var _pure = _interopRequireDefault(require("recompose/pure"));
|
49
|
+
|
50
|
+
var PureListSubheader = (0, _pure.default)(_ListSubheader.default);
|
51
|
+
var PureListItem = (0, _pure.default)(_ListItem.default);
|
52
|
+
|
48
53
|
var styles = function styles(theme) {
|
49
54
|
return {
|
50
55
|
root: {
|
@@ -170,8 +175,8 @@ exports.styles = styles;
|
|
170
175
|
|
171
176
|
var HiSelectableListItem =
|
172
177
|
/*#__PURE__*/
|
173
|
-
function (_React$
|
174
|
-
(0, _inherits2.default)(HiSelectableListItem, _React$
|
178
|
+
function (_React$PureComponent) {
|
179
|
+
(0, _inherits2.default)(HiSelectableListItem, _React$PureComponent);
|
175
180
|
|
176
181
|
function HiSelectableListItem(props) {
|
177
182
|
var _this;
|
@@ -288,7 +293,7 @@ function (_React$Component) {
|
|
288
293
|
displayedIcon = icon;
|
289
294
|
}
|
290
295
|
|
291
|
-
var ListItemComponentName = pinned ?
|
296
|
+
var ListItemComponentName = pinned ? PureListSubheader : PureListItem;
|
292
297
|
return _react.default.createElement(ListItemComponentName, (0, _extends2.default)({
|
293
298
|
id: id,
|
294
299
|
tabIndex: disabled ? '-1' : 0,
|
@@ -342,7 +347,7 @@ function (_React$Component) {
|
|
342
347
|
}
|
343
348
|
}]);
|
344
349
|
return HiSelectableListItem;
|
345
|
-
}(_react.default.
|
350
|
+
}(_react.default.PureComponent);
|
346
351
|
|
347
352
|
HiSelectableListItem.defaultProps = {
|
348
353
|
centered: false,
|
package/HiTable/HiTableRow.js
CHANGED
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
9
9
|
});
|
10
10
|
exports.default = exports.styles = void 0;
|
11
11
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
13
|
+
|
12
14
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
13
15
|
|
14
16
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
@@ -27,6 +29,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
29
|
|
28
30
|
var _keycode = _interopRequireDefault(require("keycode"));
|
29
31
|
|
32
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
33
|
+
|
30
34
|
var _withStyles = _interopRequireDefault(require("../styles/withStyles"));
|
31
35
|
|
32
36
|
var _TableRow = _interopRequireDefault(require("@material-ui/core/TableRow"));
|
@@ -48,6 +52,9 @@ var styles = function styles(theme) {
|
|
48
52
|
'&:hover, &:focus': {
|
49
53
|
backgroundColor: "".concat(theme.palette.action.hover, " !important")
|
50
54
|
}
|
55
|
+
},
|
56
|
+
clicableRow: {
|
57
|
+
cursor: 'pointer'
|
51
58
|
}
|
52
59
|
};
|
53
60
|
};
|
@@ -88,7 +95,7 @@ function (_React$PureComponent) {
|
|
88
95
|
locale = _this$props.locale,
|
89
96
|
rowdata = _this$props.rowdata;
|
90
97
|
return _react.default.createElement(_TableRow.default, {
|
91
|
-
className: classes.row,
|
98
|
+
className: (0, _classnames.default)(classes.row, (0, _defineProperty2.default)({}, classes.clicableRow, this.props.onClick)),
|
92
99
|
hover: true,
|
93
100
|
onClick: function onClick(event) {
|
94
101
|
return _this2.handleClick(event, rowdata);
|
@@ -105,10 +112,10 @@ function (_React$PureComponent) {
|
|
105
112
|
height: dense ? cst.CELL_HEIGHT_DENSE : cst.CELL_HEIGHT
|
106
113
|
},
|
107
114
|
tabIndex: 0
|
108
|
-
}, Object.keys(columns).map(function (
|
115
|
+
}, Object.keys(columns).map(function (column) {
|
109
116
|
return _react.default.createElement(_HiCellBuilder.default, {
|
110
|
-
key: columns[
|
111
|
-
column: columns[
|
117
|
+
key: columns[column].colId,
|
118
|
+
column: columns[column],
|
112
119
|
data: rowdata,
|
113
120
|
locale: locale
|
114
121
|
});
|
@@ -112,9 +112,10 @@ function HiColoredLabel(props) {
|
|
112
112
|
color,
|
113
113
|
active,
|
114
114
|
fontWeight,
|
115
|
+
style,
|
115
116
|
theme
|
116
117
|
} = props,
|
117
|
-
other = _objectWithoutProperties(props, ["classes", "className", "label", "color", "active", "fontWeight", "theme"]);
|
118
|
+
other = _objectWithoutProperties(props, ["classes", "className", "label", "color", "active", "fontWeight", "style", "theme"]);
|
118
119
|
|
119
120
|
const isHiColor = ['primary', 'secondary', 'positive', 'negative', 'middle', 'neutral'].includes(color);
|
120
121
|
const isHexColor = !isHiColor && /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(color);
|
@@ -125,7 +126,7 @@ function HiColoredLabel(props) {
|
|
125
126
|
[classes[`activeColor${capitalize(color)}`]]: active && isHiColor,
|
126
127
|
[classes[`color${capitalize(color)}`]]: !active && isHiColor
|
127
128
|
}, className),
|
128
|
-
style: _objectSpread({}, isHexColor && {
|
129
|
+
style: _objectSpread({}, style, isHexColor && {
|
129
130
|
backgroundColor: active ? color : fade(color, 0.08),
|
130
131
|
color: active ? theme.palette.getContrastText(color) : color
|
131
132
|
}, fontWeight && {
|
@@ -5,11 +5,9 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread";
|
|
5
5
|
import React from 'react';
|
6
6
|
import PropTypes from 'prop-types';
|
7
7
|
import HiSelectContent from './HiSelectContent';
|
8
|
-
import HiIcon from '../HiIcon';
|
9
|
-
import withStyles from '../styles/withStyles';
|
10
8
|
import { foldAccents } from '../utils/helpers';
|
11
9
|
/**
|
12
|
-
* Return array of final item id in nested list (via props
|
10
|
+
* Return array of final item id in nested list (via props children)
|
13
11
|
* @param itemList
|
14
12
|
* @param finalItemIdList
|
15
13
|
* @returns {*[]}
|
@@ -116,48 +114,6 @@ function buildFilteredItemList(itemList, selectedItemIdList = [], searchValue =
|
|
116
114
|
v: visibleParent
|
117
115
|
});
|
118
116
|
}
|
119
|
-
|
120
|
-
export const styles = theme => ({
|
121
|
-
root: {
|
122
|
-
backgroundColor: theme.palette.background2,
|
123
|
-
maxWidth: 500,
|
124
|
-
width: '100%',
|
125
|
-
position: 'relative'
|
126
|
-
},
|
127
|
-
popper: {
|
128
|
-
// width: '100%',
|
129
|
-
zIndex: 1200
|
130
|
-
},
|
131
|
-
paper: {
|
132
|
-
borderRadius: '0px 2px',
|
133
|
-
maxHeight: 480,
|
134
|
-
transition: 'none !important'
|
135
|
-
},
|
136
|
-
labelImg: {
|
137
|
-
height: 18,
|
138
|
-
width: 'auto',
|
139
|
-
margin: '0 4px',
|
140
|
-
verticalAlign: 'middle'
|
141
|
-
},
|
142
|
-
selectIconLabel: _objectSpread({
|
143
|
-
whiteSpace: 'nowrap',
|
144
|
-
overflow: 'hidden',
|
145
|
-
textOverflow: 'ellipsis',
|
146
|
-
paddingRight: 16
|
147
|
-
}, theme.typography.b1, {
|
148
|
-
display: 'inline-flex',
|
149
|
-
width: '100%'
|
150
|
-
}),
|
151
|
-
selectImgLabel: _objectSpread({
|
152
|
-
whiteSpace: 'nowrap',
|
153
|
-
overflow: 'hidden',
|
154
|
-
textOverflow: 'ellipsis',
|
155
|
-
paddingRight: 16
|
156
|
-
}, theme.typography.b1, {
|
157
|
-
display: 'inline-flex',
|
158
|
-
width: '100%'
|
159
|
-
})
|
160
|
-
});
|
161
117
|
/**
|
162
118
|
* HiNestedSelectContent hérite du composant HiSelectContent
|
163
119
|
*
|
@@ -171,9 +127,10 @@ export const styles = theme => ({
|
|
171
127
|
* - si aucun enfant n'est sélectionné, le parent est affiché "unselected".
|
172
128
|
*/
|
173
129
|
|
130
|
+
|
174
131
|
class HiNestedSelectContent extends React.PureComponent {
|
175
|
-
constructor(
|
176
|
-
super(
|
132
|
+
constructor(...args) {
|
133
|
+
super(...args);
|
177
134
|
|
178
135
|
this.handleSelect = (event, item) => {
|
179
136
|
const {
|
@@ -267,20 +224,7 @@ class HiNestedSelectContent extends React.PureComponent {
|
|
267
224
|
itemList
|
268
225
|
};
|
269
226
|
};
|
270
|
-
|
271
|
-
this.handleSelect = this.handleSelect.bind(this);
|
272
227
|
}
|
273
|
-
/**
|
274
|
-
* Call onChange with the updated value
|
275
|
-
*
|
276
|
-
* - handle single value
|
277
|
-
* - handle multiple value
|
278
|
-
* - handle '_all' id
|
279
|
-
*
|
280
|
-
* @param event
|
281
|
-
* @param item
|
282
|
-
*/
|
283
|
-
|
284
228
|
|
285
229
|
render() {
|
286
230
|
const _this$props = this.props,
|
@@ -400,7 +344,4 @@ HiNestedSelectContent.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
400
344
|
*/
|
401
345
|
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.array])
|
402
346
|
} : {};
|
403
|
-
export default
|
404
|
-
hiComponent: true,
|
405
|
-
name: 'HmuiHiNestedSelectContent'
|
406
|
-
})(HiNestedSelectContent);
|
347
|
+
export default HiNestedSelectContent;
|
@@ -11,6 +11,9 @@ import HiColoredLabel from '../HiColoredLabel';
|
|
11
11
|
import HiLoader from '../HiLoader';
|
12
12
|
import withStyles from '../styles/withStyles';
|
13
13
|
import { escapeHTML } from '../utils/helpers';
|
14
|
+
import pure from 'recompose/pure';
|
15
|
+
const PureListSubheader = pure(ListSubheader);
|
16
|
+
const PureListItem = pure(ListItem);
|
14
17
|
export const styles = theme => ({
|
15
18
|
root: {
|
16
19
|
paddingLeft: 4
|
@@ -129,7 +132,7 @@ export const styles = theme => ({
|
|
129
132
|
* Construit un élément de liste sélectionnable (avec checkbox)
|
130
133
|
*/
|
131
134
|
|
132
|
-
class HiSelectableListItem extends React.
|
135
|
+
class HiSelectableListItem extends React.PureComponent {
|
133
136
|
constructor(props) {
|
134
137
|
super(props);
|
135
138
|
|
@@ -235,7 +238,7 @@ class HiSelectableListItem extends React.Component {
|
|
235
238
|
displayedIcon = icon;
|
236
239
|
}
|
237
240
|
|
238
|
-
const ListItemComponentName = pinned ?
|
241
|
+
const ListItemComponentName = pinned ? PureListSubheader : PureListItem;
|
239
242
|
return React.createElement(ListItemComponentName, _extends({
|
240
243
|
id: id,
|
241
244
|
tabIndex: disabled ? '-1' : 0,
|
package/es/HiTable/HiTableRow.js
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
import React from 'react';
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
import keycode from 'keycode';
|
5
|
+
import classNames from 'classnames';
|
5
6
|
import withStyles from '../styles/withStyles';
|
6
7
|
import TableRow from '@material-ui/core/TableRow';
|
7
8
|
import HiCellBuilder from './HiCellBuilder';
|
@@ -17,6 +18,9 @@ export const styles = theme => ({
|
|
17
18
|
'&:hover, &:focus': {
|
18
19
|
backgroundColor: `${theme.palette.action.hover} !important`
|
19
20
|
}
|
21
|
+
},
|
22
|
+
clicableRow: {
|
23
|
+
cursor: 'pointer'
|
20
24
|
}
|
21
25
|
});
|
22
26
|
|
@@ -42,7 +46,9 @@ class HiTableRow extends React.PureComponent {
|
|
42
46
|
rowdata
|
43
47
|
} = this.props;
|
44
48
|
return React.createElement(TableRow, {
|
45
|
-
className: classes.row,
|
49
|
+
className: classNames(classes.row, {
|
50
|
+
[classes.clicableRow]: this.props.onClick
|
51
|
+
}),
|
46
52
|
hover: true,
|
47
53
|
onClick: event => this.handleClick(event, rowdata),
|
48
54
|
onKeyDown: event => {
|
@@ -56,10 +62,10 @@ class HiTableRow extends React.PureComponent {
|
|
56
62
|
height: dense ? cst.CELL_HEIGHT_DENSE : cst.CELL_HEIGHT
|
57
63
|
},
|
58
64
|
tabIndex: 0
|
59
|
-
}, Object.keys(columns).map(
|
65
|
+
}, Object.keys(columns).map(column => {
|
60
66
|
return React.createElement(HiCellBuilder, {
|
61
|
-
key: columns[
|
62
|
-
column: columns[
|
67
|
+
key: columns[column].colId,
|
68
|
+
column: columns[column],
|
63
69
|
data: rowdata,
|
64
70
|
locale: locale
|
65
71
|
});
|
@@ -132,6 +132,7 @@ export default function createPalette(palette) {
|
|
132
132
|
contrastText: '#FFFFFF'
|
133
133
|
},
|
134
134
|
negative = {
|
135
|
+
ultraLight: '#EA9494',
|
135
136
|
light: '#E66666',
|
136
137
|
main: '#D50000',
|
137
138
|
dark: '#A00000',
|
@@ -144,6 +145,7 @@ export default function createPalette(palette) {
|
|
144
145
|
contrastText: '#FFFFFF'
|
145
146
|
},
|
146
147
|
neutral = {
|
148
|
+
ultraLight: '#8B8B8B',
|
147
149
|
light: '#838383',
|
148
150
|
main: '#737373',
|
149
151
|
dark: '#20272B',
|
@@ -154,13 +156,17 @@ export default function createPalette(palette) {
|
|
154
156
|
main: red[500],
|
155
157
|
dark: red[700]
|
156
158
|
},
|
159
|
+
lookup = {
|
160
|
+
light: '#FFFF8D',
|
161
|
+
main: '#EDED14'
|
162
|
+
},
|
157
163
|
type = 'light',
|
158
164
|
contrastThreshold = 2.9,
|
159
165
|
// max light contrast
|
160
166
|
tonalOffset = 0.2,
|
161
167
|
context = 'local'
|
162
168
|
} = palette,
|
163
|
-
other = _objectWithoutProperties(palette, ["primary", "secondary", "positive", "negative", "middle", "neutral", "error", "type", "contrastThreshold", "tonalOffset", "context"]);
|
169
|
+
other = _objectWithoutProperties(palette, ["primary", "secondary", "positive", "negative", "middle", "neutral", "error", "lookup", "type", "contrastThreshold", "tonalOffset", "context"]);
|
164
170
|
|
165
171
|
function getContrastText(background) {
|
166
172
|
// Use the same logic as
|
@@ -225,6 +231,8 @@ export default function createPalette(palette) {
|
|
225
231
|
neutral,
|
226
232
|
// The colors used to represent interface elements that the user should be made aware of.
|
227
233
|
error,
|
234
|
+
// The colors used to represent form elements that have lookup state.
|
235
|
+
lookup,
|
228
236
|
// The grey colors.
|
229
237
|
grey,
|
230
238
|
// Used by `getContrastText()` to maximize the contrast between the background and
|
package/index.es.js
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
package/styles/createPalette.js
CHANGED
@@ -155,6 +155,7 @@ function createPalette(palette) {
|
|
155
155
|
} : _palette$positive,
|
156
156
|
_palette$negative = palette.negative,
|
157
157
|
negative = _palette$negative === void 0 ? {
|
158
|
+
ultraLight: '#EA9494',
|
158
159
|
light: '#E66666',
|
159
160
|
main: '#D50000',
|
160
161
|
dark: '#A00000',
|
@@ -169,6 +170,7 @@ function createPalette(palette) {
|
|
169
170
|
} : _palette$middle,
|
170
171
|
_palette$neutral = palette.neutral,
|
171
172
|
neutral = _palette$neutral === void 0 ? {
|
173
|
+
ultraLight: '#8B8B8B',
|
172
174
|
light: '#838383',
|
173
175
|
main: '#737373',
|
174
176
|
dark: '#20272B',
|
@@ -180,6 +182,11 @@ function createPalette(palette) {
|
|
180
182
|
main: _red.default[500],
|
181
183
|
dark: _red.default[700]
|
182
184
|
} : _palette$error,
|
185
|
+
_palette$lookup = palette.lookup,
|
186
|
+
lookup = _palette$lookup === void 0 ? {
|
187
|
+
light: '#FFFF8D',
|
188
|
+
main: '#EDED14'
|
189
|
+
} : _palette$lookup,
|
183
190
|
_palette$type = palette.type,
|
184
191
|
type = _palette$type === void 0 ? 'light' : _palette$type,
|
185
192
|
_palette$contrastThre = palette.contrastThreshold,
|
@@ -188,7 +195,7 @@ function createPalette(palette) {
|
|
188
195
|
tonalOffset = _palette$tonalOffset === void 0 ? 0.2 : _palette$tonalOffset,
|
189
196
|
_palette$context = palette.context,
|
190
197
|
context = _palette$context === void 0 ? 'local' : _palette$context,
|
191
|
-
other = (0, _objectWithoutProperties2.default)(palette, ["primary", "secondary", "positive", "negative", "middle", "neutral", "error", "type", "contrastThreshold", "tonalOffset", "context"]);
|
198
|
+
other = (0, _objectWithoutProperties2.default)(palette, ["primary", "secondary", "positive", "negative", "middle", "neutral", "error", "lookup", "type", "contrastThreshold", "tonalOffset", "context"]);
|
192
199
|
|
193
200
|
function getContrastText(background) {
|
194
201
|
// Use the same logic as
|
@@ -257,6 +264,8 @@ function createPalette(palette) {
|
|
257
264
|
neutral: neutral,
|
258
265
|
// The colors used to represent interface elements that the user should be made aware of.
|
259
266
|
error: error,
|
267
|
+
// The colors used to represent form elements that have lookup state.
|
268
|
+
lookup: lookup,
|
260
269
|
// The grey colors.
|
261
270
|
grey: _grey.default,
|
262
271
|
// Used by `getContrastText()` to maximize the contrast between the background and
|