@hipay/hipay-material-ui 2.0.0-beta.76 → 2.1.0-RC1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +0 -77
- package/HiNotice/HiKPI.js +6 -2
- package/HiPaymentMeans/HiPaymentMeans.js +36 -32
- package/README.md +2 -2
- package/es/HiNotice/HiKPI.js +7 -2
- package/es/HiPaymentMeans/HiPaymentMeans.js +34 -32
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,80 +1,3 @@
|
|
1
|
-
# [2.0.0-beta.76](https://gitlab.hipay.org/backend/hipay-material-ui/compare/0.0.1...2.0.0-beta.76) (2019-07-18)
|
2
|
-
|
3
|
-
|
4
|
-
### Bug Fixes
|
5
|
-
|
6
|
-
* **eslint:** remove eslint warrnings in components (ignore test files) ([d236c62](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d236c62))
|
7
|
-
* **HiAlertModal:** Correct styles and buttons positions ([2cfa2a9](https://gitlab.hipay.org/backend/hipay-material-ui/commit/2cfa2a9))
|
8
|
-
* **HiAlertModal:** Title is not required anymore and will not create warning ([4019d33](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4019d33))
|
9
|
-
* **HiBreadcrumb:** clean eslint warnings ([6db12fb](https://gitlab.hipay.org/backend/hipay-material-ui/commit/6db12fb))
|
10
|
-
* **HiDatePicker:** add static positions for custom overlays ([c3edf24](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c3edf24))
|
11
|
-
* **HiDynamicSelect:** remove onSelect override ([b803044](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b803044))
|
12
|
-
* **HiExpansionPanel:** fix props propagation collapseDisable || expanded ([eb18a96](https://gitlab.hipay.org/backend/hipay-material-ui/commit/eb18a96))
|
13
|
-
* **HiExpansionPanel:** Fix props type a requirement ([cbc3b48](https://gitlab.hipay.org/backend/hipay-material-ui/commit/cbc3b48))
|
14
|
-
* **HiInput:** forward event in onClick ([be94fe0](https://gitlab.hipay.org/backend/hipay-material-ui/commit/be94fe0))
|
15
|
-
* **HiInput:** handle focus state through prop when needed to override default comportment ([9a133cc](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9a133cc))
|
16
|
-
* **HiInput:** rename prop to spellCheck ([c11939f](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c11939f))
|
17
|
-
* **HiKpiNotice:** eslint clean warnings ([11b5552](https://gitlab.hipay.org/backend/hipay-material-ui/commit/11b5552))
|
18
|
-
* **HiSelect:** Fix build of HiSelectContent ([4b87f78](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4b87f78))
|
19
|
-
* **HiSelect:** focus on undefined item ([2d084e6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/2d084e6))
|
20
|
-
* **HiSelect:** Forward event in onBlur ([76c6778](https://gitlab.hipay.org/backend/hipay-material-ui/commit/76c6778))
|
21
|
-
* **HiSelect:** handle staticPosition & width properly for HiDateRangeSelector usage ([7b19ffb](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7b19ffb))
|
22
|
-
* **HiSelect:** remove HiSelectNew calls ([cc5397d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/cc5397d))
|
23
|
-
* **HiSelectableList:** Add lazy props to activate lazyloading (default true) and fix unit tests ([b41f8d2](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b41f8d2))
|
24
|
-
* **HiSelectableListItem:** disabled item checkbox color ([9f10552](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9f10552))
|
25
|
-
* **HiSelectableListItem:** remove item width ([a913945](https://gitlab.hipay.org/backend/hipay-material-ui/commit/a913945))
|
26
|
-
* **HiSelectContent:** Remove compute of input value ([b86db83](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b86db83))
|
27
|
-
* **HiSlider:** eslint clean warnings ([08964b1](https://gitlab.hipay.org/backend/hipay-material-ui/commit/08964b1))
|
28
|
-
* **HiTable:** Fix test ([9a009a8](https://gitlab.hipay.org/backend/hipay-material-ui/commit/9a009a8))
|
29
|
-
* **HiUploadField:** clean eslint warnings ([c76aaf1](https://gitlab.hipay.org/backend/hipay-material-ui/commit/c76aaf1))
|
30
|
-
* **migration:** fix contrast threshold ... ([6fb3b18](https://gitlab.hipay.org/backend/hipay-material-ui/commit/6fb3b18))
|
31
|
-
* **package:** add cross-env ([7098fd6](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7098fd6))
|
32
|
-
|
33
|
-
|
34
|
-
### Code Refactoring
|
35
|
-
|
36
|
-
* deleting the old HiSelect and replacing it by the new (PSYCHE-1382) ([d5fc252](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d5fc252))
|
37
|
-
|
38
|
-
|
39
|
-
### Features
|
40
|
-
|
41
|
-
* **CellImage:** Handle fallbackImage ([254799d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/254799d))
|
42
|
-
* **CellSentinel:** Uniformize cell api with front CellSentinel ([4e2975b](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4e2975b))
|
43
|
-
* **CellSentinel:** Update CellSentinel to the new way (split each result in different column) ([efe2711](https://gitlab.hipay.org/backend/hipay-material-ui/commit/efe2711))
|
44
|
-
* **CellSentinelScore:** Add CellSentinelScore ([2fff04d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/2fff04d))
|
45
|
-
* **CellText:** Handle active prop in CellText & column views in HiTable ([4366e60](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4366e60))
|
46
|
-
* **HiCells:** Add simple cells types (Address, Date, Icon, Image, Numeric, PinToAction, Rate, Senti ([f688517](https://gitlab.hipay.org/backend/hipay-material-ui/commit/f688517))
|
47
|
-
* **HiDatePicke:** add timezone props ([18360a5](https://gitlab.hipay.org/backend/hipay-material-ui/commit/18360a5))
|
48
|
-
* **HiDatePicker:** BREAKING CHANGE - add local prop to handle calendar translations ([b1b3743](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b1b3743))
|
49
|
-
* **HiIcon:** Add mdi-material-ui as available icons via 'mdi_' prefix ([1091d6d](https://gitlab.hipay.org/backend/hipay-material-ui/commit/1091d6d))
|
50
|
-
* **HiInput:** Add inputProps to enable passing props directly to input element ([d57466c](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d57466c))
|
51
|
-
* **HiInput:** add spellcheck property ([b2feac3](https://gitlab.hipay.org/backend/hipay-material-ui/commit/b2feac3))
|
52
|
-
* **HiMap:** unregister fetch on unmount ([0afa931](https://gitlab.hipay.org/backend/hipay-material-ui/commit/0afa931))
|
53
|
-
* **HiSelect:** Add (NEW) HiSelect, HiNestedSelect, HiDynamicSelect ([4c6447e](https://gitlab.hipay.org/backend/hipay-material-ui/commit/4c6447e))
|
54
|
-
* **HiSelect:** Reset search input on blur & on close ([d9af584](https://gitlab.hipay.org/backend/hipay-material-ui/commit/d9af584))
|
55
|
-
* **HiSelectableList:** Add sort props to sort item list on label ([f412ddc](https://gitlab.hipay.org/backend/hipay-material-ui/commit/f412ddc))
|
56
|
-
* **HiSelectContent:** Add new HiSelectContent & HiNestedSelectContent ([215ad8f](https://gitlab.hipay.org/backend/hipay-material-ui/commit/215ad8f))
|
57
|
-
* **HiSelectContent:** export utils functions ([7c41d87](https://gitlab.hipay.org/backend/hipay-material-ui/commit/7c41d87))
|
58
|
-
* **HiUploadField:** rename component HiUploadField ([593f77e](https://gitlab.hipay.org/backend/hipay-material-ui/commit/593f77e))
|
59
|
-
* **notice:** Création notice KPI ([bba3f89](https://gitlab.hipay.org/backend/hipay-material-ui/commit/bba3f89))
|
60
|
-
|
61
|
-
|
62
|
-
### Performance Improvements
|
63
|
-
|
64
|
-
* **PureFunction:** Use pure & functional components ([220c686](https://gitlab.hipay.org/backend/hipay-material-ui/commit/220c686))
|
65
|
-
|
66
|
-
|
67
|
-
### BREAKING CHANGES
|
68
|
-
|
69
|
-
* HiSelectNew no longer exist, make sure you're importing HiSelect instead
|
70
|
-
* **HiDatePicker:** Required "local" props (use polyglot, p.currentLocal)
|
71
|
-
* **HiUploadField:** Components names changes
|
72
|
-
* **HiCells:** Remove CellCountry, CellThirdParty, CellStatus & CellAccount (use generic type
|
73
|
-
CellImage & CellText)
|
74
|
-
* **HiSelect:** HiSelect API change, use HiNestedSelect or HiDynamicSelect relative to situation
|
75
|
-
|
76
|
-
|
77
|
-
|
78
1
|
# [2.0.0-beta.74](https://gitlab.hipay.org/backend/hipay-material-ui/compare/0.0.1...2.0.0-beta.74) (2019-07-02)
|
79
2
|
|
80
3
|
|
package/HiNotice/HiKPI.js
CHANGED
@@ -47,6 +47,9 @@ var styles = function styles(theme) {
|
|
47
47
|
alignItems: 'center',
|
48
48
|
fontFamily: theme.typography.fontFamily
|
49
49
|
},
|
50
|
+
rootDisable: {
|
51
|
+
cursor: 'default'
|
52
|
+
},
|
50
53
|
error: {
|
51
54
|
boxShadow: '0px 2px 4px 0px rgba(213, 0, 0, 0.24)',
|
52
55
|
'&:hover': {
|
@@ -149,7 +152,7 @@ function (_React$Component) {
|
|
149
152
|
id = _this$props.id,
|
150
153
|
tooltip = _this$props.tooltip,
|
151
154
|
disable = _this$props.disable;
|
152
|
-
var rootclass = (0, _classnames.default)(classes.root, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.inherit, color === 'inherit' && !disable), (0, _defineProperty2.default)(_classNames, classes.warning, color === 'warning' && !disable), (0, _defineProperty2.default)(_classNames, classes.error, color === 'error' && !disable), (0, _defineProperty2.default)(_classNames, classes.positive, color === 'positive' && !disable), (0, _defineProperty2.default)(_classNames, classes.active, active), (0, _defineProperty2.default)(_classNames, classes.minify, minify), _classNames));
|
155
|
+
var rootclass = (0, _classnames.default)(classes.root, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.inherit, color === 'inherit' && !disable), (0, _defineProperty2.default)(_classNames, classes.warning, color === 'warning' && !disable), (0, _defineProperty2.default)(_classNames, classes.error, color === 'error' && !disable), (0, _defineProperty2.default)(_classNames, classes.positive, color === 'positive' && !disable), (0, _defineProperty2.default)(_classNames, classes.active, active), (0, _defineProperty2.default)(_classNames, classes.minify, minify), (0, _defineProperty2.default)(_classNames, classes.rootDisable, disable), _classNames));
|
153
156
|
return _react.default.createElement(_Collapse.default, {
|
154
157
|
in: !minify,
|
155
158
|
timeout: "auto",
|
@@ -157,7 +160,8 @@ function (_React$Component) {
|
|
157
160
|
}, _react.default.createElement(_ButtonBase.default, {
|
158
161
|
className: rootclass,
|
159
162
|
onClick: !disable ? this.handleClick(id) : undefined,
|
160
|
-
title: tooltip
|
163
|
+
title: tooltip,
|
164
|
+
disableRipple: disable
|
161
165
|
}, title && _react.default.createElement("h3", {
|
162
166
|
className: classes.title
|
163
167
|
}, title), _react.default.createElement("div", {
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
});
|
8
8
|
exports.default = exports.styles = void 0;
|
9
9
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
|
+
|
10
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
11
13
|
|
12
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
@@ -301,6 +303,8 @@ function (_React$Component) {
|
|
301
303
|
_this = (0, _possibleConstructorReturn2.default)(this, (_getPrototypeOf2 = (0, _getPrototypeOf3.default)(HiPaymentMeans)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
302
304
|
|
303
305
|
_this.buildPaymentLayoutByType = function () {
|
306
|
+
var _classNames;
|
307
|
+
|
304
308
|
var _this$props = _this.props,
|
305
309
|
businessName = _this$props.businessName,
|
306
310
|
cardNumber = _this$props.cardNumber,
|
@@ -317,7 +321,8 @@ function (_React$Component) {
|
|
317
321
|
theme = _this$props.theme,
|
318
322
|
translations = _this$props.translations,
|
319
323
|
type = _this$props.type,
|
320
|
-
yearMember = _this$props.yearMember
|
324
|
+
yearMember = _this$props.yearMember,
|
325
|
+
fallbackImage = _this$props.fallbackImage;
|
321
326
|
var formatNumber;
|
322
327
|
|
323
328
|
if (type === 'credit-card' || type === 'debit-card' || type === 'prepaid-card') {
|
@@ -348,7 +353,25 @@ function (_React$Component) {
|
|
348
353
|
username = "".concat(translations.gender_male, " ").concat(cardUser);
|
349
354
|
}
|
350
355
|
|
351
|
-
var creditDebit =
|
356
|
+
var creditDebit = null;
|
357
|
+
|
358
|
+
if (translations.credit && translations.debit) {
|
359
|
+
creditDebit = (credit ? translations.credit : translations.debit).toUpperCase();
|
360
|
+
}
|
361
|
+
|
362
|
+
var imgComponent = _react.default.createElement("img", {
|
363
|
+
src: brandLogo,
|
364
|
+
alt: '',
|
365
|
+
className: (0, _classnames.default)(classes.logo, (_classNames = {}, (0, _defineProperty2.default)(_classNames, classes.logoLeft, ['ewallet', 'open-invoice', 'payment-reference', 'credit-consumption', 'realtime-banking'].indexOf(type) >= 0), (0, _defineProperty2.default)(_classNames, classes.logoRight, ['ewallet', 'open-invoice', 'payment-reference', 'credit-consumption', 'realtime-banking'].indexOf(type) < 0), _classNames)),
|
366
|
+
onError: function onError(e) {
|
367
|
+
if (fallbackImage) {
|
368
|
+
e.target.src = "".concat(fallbackImage);
|
369
|
+
} else {
|
370
|
+
e.target.style.display = 'none';
|
371
|
+
}
|
372
|
+
}
|
373
|
+
});
|
374
|
+
|
352
375
|
var cardLayout;
|
353
376
|
|
354
377
|
switch (type) {
|
@@ -368,11 +391,7 @@ function (_React$Component) {
|
|
368
391
|
className: (0, _classnames.default)(classes.labelLarge, classes.userNameWallet)
|
369
392
|
}, username), _react.default.createElement("span", {
|
370
393
|
className: (0, _classnames.default)(classes.stripe, classes.stripeBottomLeft)
|
371
|
-
}, _react.default.createElement("
|
372
|
-
src: brandLogo,
|
373
|
-
alt: '',
|
374
|
-
className: (0, _classnames.default)(classes.logo, classes.logoLeft)
|
375
|
-
})), _react.default.createElement("span", {
|
394
|
+
}, imgComponent), _react.default.createElement("span", {
|
376
395
|
className: (0, _classnames.default)(classes.stripeGradient, classes.stripeBottomLeft, classes.stripeGradientBottomLeft)
|
377
396
|
})));
|
378
397
|
break;
|
@@ -386,11 +405,7 @@ function (_React$Component) {
|
|
386
405
|
}
|
387
406
|
}, _react.default.createElement("span", {
|
388
407
|
className: (0, _classnames.default)(classes.stripe, classes.stripeTopRight)
|
389
|
-
}, _react.default.createElement("
|
390
|
-
src: brandLogo,
|
391
|
-
alt: '',
|
392
|
-
className: (0, _classnames.default)(classes.logo, classes.logoRight)
|
393
|
-
})), _react.default.createElement("span", {
|
408
|
+
}, imgComponent), _react.default.createElement("span", {
|
394
409
|
className: (0, _classnames.default)(classes.stripeGradient, classes.stripeTopRight, classes.stripeGradientTopRight)
|
395
410
|
}), _react.default.createElement("div", {
|
396
411
|
className: (0, _classnames.default)(classes.number, classes.cardNumber)
|
@@ -413,11 +428,7 @@ function (_React$Component) {
|
|
413
428
|
}
|
414
429
|
}, _react.default.createElement("span", {
|
415
430
|
className: (0, _classnames.default)(classes.stripe, classes.stripeTopRight)
|
416
|
-
}, _react.default.createElement("
|
417
|
-
src: brandLogo,
|
418
|
-
alt: '',
|
419
|
-
className: (0, _classnames.default)(classes.logo, classes.logoRight)
|
420
|
-
})), _react.default.createElement("span", {
|
431
|
+
}, imgComponent), _react.default.createElement("span", {
|
421
432
|
className: (0, _classnames.default)(classes.stripeGradient, classes.stripeTopRight, classes.stripeGradientTopRight)
|
422
433
|
}, _react.default.createElement("div", {
|
423
434
|
className: classes.corporateLabel,
|
@@ -454,11 +465,7 @@ function (_React$Component) {
|
|
454
465
|
}
|
455
466
|
}, _react.default.createElement("span", {
|
456
467
|
className: (0, _classnames.default)(classes.stripe, classes.stripeTopLeft)
|
457
|
-
}, _react.default.createElement("
|
458
|
-
src: brandLogo,
|
459
|
-
alt: '',
|
460
|
-
className: (0, _classnames.default)(classes.logo, classes.logoLeft)
|
461
|
-
})), _react.default.createElement("span", {
|
468
|
+
}, imgComponent), _react.default.createElement("span", {
|
462
469
|
className: (0, _classnames.default)(classes.stripeGradient, classes.stripeTopLeft, classes.stripeGradientTopLeft)
|
463
470
|
}), cardNumber && _react.default.createElement("div", {
|
464
471
|
className: (0, _classnames.default)(classes.labelMedium, classes.ibanLabel)
|
@@ -479,11 +486,7 @@ function (_React$Component) {
|
|
479
486
|
}
|
480
487
|
}, _react.default.createElement("span", {
|
481
488
|
className: (0, _classnames.default)(classes.stripe, classes.stripeTopRight)
|
482
|
-
}, _react.default.createElement("
|
483
|
-
src: brandLogo,
|
484
|
-
alt: '',
|
485
|
-
className: (0, _classnames.default)(classes.logo, classes.logoRight)
|
486
|
-
})), _react.default.createElement("span", {
|
489
|
+
}, imgComponent), _react.default.createElement("span", {
|
487
490
|
className: (0, _classnames.default)(classes.stripeGradient, classes.stripeTopRight, classes.stripeGradientTopRight)
|
488
491
|
}, _react.default.createElement("img", {
|
489
492
|
src: logoMerchant,
|
@@ -506,11 +509,7 @@ function (_React$Component) {
|
|
506
509
|
}
|
507
510
|
}, _react.default.createElement("span", {
|
508
511
|
className: (0, _classnames.default)(classes.stripe, classes.stripeTopRight)
|
509
|
-
}, _react.default.createElement("
|
510
|
-
src: brandLogo,
|
511
|
-
alt: '',
|
512
|
-
className: (0, _classnames.default)(classes.logo, classes.logoRight)
|
513
|
-
})), _react.default.createElement("span", {
|
512
|
+
}, imgComponent), _react.default.createElement("span", {
|
514
513
|
className: (0, _classnames.default)(classes.stripeGradient, classes.stripeTopRight, classes.stripeGradientTopRight)
|
515
514
|
}), _react.default.createElement("div", {
|
516
515
|
className: (0, _classnames.default)(classes.number, classes.cardNumber)
|
@@ -622,6 +621,11 @@ HiPaymentMeans.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
622
621
|
*/
|
623
622
|
credit: _propTypes.default.bool,
|
624
623
|
|
624
|
+
/**
|
625
|
+
* Chemin vers l'image à afficher par défaut si le logo n'est pas trouvé
|
626
|
+
*/
|
627
|
+
fallbackImage: _propTypes.default.string,
|
628
|
+
|
625
629
|
/**
|
626
630
|
* Logo du moyen de paiement
|
627
631
|
*/
|
package/README.md
CHANGED
@@ -240,8 +240,8 @@ npm install -g cz-conventional-changelog
|
|
240
240
|
|
241
241
|
1. Changer la version dans package.json et dans packages/hipay-material-ui/package.json
|
242
242
|
2. Générer le fichier HI-CHANGELOG.md : ```npm run changelog```
|
243
|
-
3. Commiter la release : ```git ci -am "chore(release): VERSION DATE```
|
244
|
-
4. Build : ```npm run build```
|
243
|
+
3. Commiter la release : ```git ci -am "chore(release): VERSION DATE (YYYY-mm-dd)```
|
244
|
+
4. Build : ```cd packages/hipay-material-ui/ && npm run build```
|
245
245
|
5. Publish :
|
246
246
|
|
247
247
|
```sh
|
package/es/HiNotice/HiKPI.js
CHANGED
@@ -17,6 +17,9 @@ export const styles = theme => ({
|
|
17
17
|
alignItems: 'center',
|
18
18
|
fontFamily: theme.typography.fontFamily
|
19
19
|
},
|
20
|
+
rootDisable: {
|
21
|
+
cursor: 'default'
|
22
|
+
},
|
20
23
|
error: {
|
21
24
|
boxShadow: '0px 2px 4px 0px rgba(213, 0, 0, 0.24)',
|
22
25
|
'&:hover': {
|
@@ -109,7 +112,8 @@ class HiKPI extends React.Component {
|
|
109
112
|
[classes.error]: color === 'error' && !disable,
|
110
113
|
[classes.positive]: color === 'positive' && !disable,
|
111
114
|
[classes.active]: active,
|
112
|
-
[classes.minify]: minify
|
115
|
+
[classes.minify]: minify,
|
116
|
+
[classes.rootDisable]: disable
|
113
117
|
});
|
114
118
|
return React.createElement(Collapse, {
|
115
119
|
in: !minify,
|
@@ -118,7 +122,8 @@ class HiKPI extends React.Component {
|
|
118
122
|
}, React.createElement(ButtonBase, {
|
119
123
|
className: rootclass,
|
120
124
|
onClick: !disable ? this.handleClick(id) : undefined,
|
121
|
-
title: tooltip
|
125
|
+
title: tooltip,
|
126
|
+
disableRipple: disable
|
122
127
|
}, title && React.createElement("h3", {
|
123
128
|
className: classes.title
|
124
129
|
}, title), React.createElement("div", {
|
@@ -276,7 +276,8 @@ class HiPaymentMeans extends React.Component {
|
|
276
276
|
theme,
|
277
277
|
translations,
|
278
278
|
type,
|
279
|
-
yearMember
|
279
|
+
yearMember,
|
280
|
+
fallbackImage
|
280
281
|
} = this.props;
|
281
282
|
let formatNumber;
|
282
283
|
|
@@ -308,7 +309,27 @@ class HiPaymentMeans extends React.Component {
|
|
308
309
|
username = `${translations.gender_male} ${cardUser}`;
|
309
310
|
}
|
310
311
|
|
311
|
-
|
312
|
+
let creditDebit = null;
|
313
|
+
|
314
|
+
if (translations.credit && translations.debit) {
|
315
|
+
creditDebit = (credit ? translations.credit : translations.debit).toUpperCase();
|
316
|
+
}
|
317
|
+
|
318
|
+
const imgComponent = React.createElement("img", {
|
319
|
+
src: brandLogo,
|
320
|
+
alt: '',
|
321
|
+
className: classNames(classes.logo, {
|
322
|
+
[classes.logoLeft]: ['ewallet', 'open-invoice', 'payment-reference', 'credit-consumption', 'realtime-banking'].indexOf(type) >= 0,
|
323
|
+
[classes.logoRight]: ['ewallet', 'open-invoice', 'payment-reference', 'credit-consumption', 'realtime-banking'].indexOf(type) < 0
|
324
|
+
}),
|
325
|
+
onError: e => {
|
326
|
+
if (fallbackImage) {
|
327
|
+
e.target.src = `${fallbackImage}`;
|
328
|
+
} else {
|
329
|
+
e.target.style.display = 'none';
|
330
|
+
}
|
331
|
+
}
|
332
|
+
});
|
312
333
|
let cardLayout;
|
313
334
|
|
314
335
|
switch (type) {
|
@@ -328,11 +349,7 @@ class HiPaymentMeans extends React.Component {
|
|
328
349
|
className: classNames(classes.labelLarge, classes.userNameWallet)
|
329
350
|
}, username), React.createElement("span", {
|
330
351
|
className: classNames(classes.stripe, classes.stripeBottomLeft)
|
331
|
-
}, React.createElement("
|
332
|
-
src: brandLogo,
|
333
|
-
alt: '',
|
334
|
-
className: classNames(classes.logo, classes.logoLeft)
|
335
|
-
})), React.createElement("span", {
|
352
|
+
}, imgComponent), React.createElement("span", {
|
336
353
|
className: classNames(classes.stripeGradient, classes.stripeBottomLeft, classes.stripeGradientBottomLeft)
|
337
354
|
})));
|
338
355
|
break;
|
@@ -346,11 +363,7 @@ class HiPaymentMeans extends React.Component {
|
|
346
363
|
}
|
347
364
|
}, React.createElement("span", {
|
348
365
|
className: classNames(classes.stripe, classes.stripeTopRight)
|
349
|
-
}, React.createElement("
|
350
|
-
src: brandLogo,
|
351
|
-
alt: '',
|
352
|
-
className: classNames(classes.logo, classes.logoRight)
|
353
|
-
})), React.createElement("span", {
|
366
|
+
}, imgComponent), React.createElement("span", {
|
354
367
|
className: classNames(classes.stripeGradient, classes.stripeTopRight, classes.stripeGradientTopRight)
|
355
368
|
}), React.createElement("div", {
|
356
369
|
className: classNames(classes.number, classes.cardNumber)
|
@@ -373,11 +386,7 @@ class HiPaymentMeans extends React.Component {
|
|
373
386
|
}
|
374
387
|
}, React.createElement("span", {
|
375
388
|
className: classNames(classes.stripe, classes.stripeTopRight)
|
376
|
-
}, React.createElement("
|
377
|
-
src: brandLogo,
|
378
|
-
alt: '',
|
379
|
-
className: classNames(classes.logo, classes.logoRight)
|
380
|
-
})), React.createElement("span", {
|
389
|
+
}, imgComponent), React.createElement("span", {
|
381
390
|
className: classNames(classes.stripeGradient, classes.stripeTopRight, classes.stripeGradientTopRight)
|
382
391
|
}, React.createElement("div", {
|
383
392
|
className: classes.corporateLabel,
|
@@ -414,11 +423,7 @@ class HiPaymentMeans extends React.Component {
|
|
414
423
|
}
|
415
424
|
}, React.createElement("span", {
|
416
425
|
className: classNames(classes.stripe, classes.stripeTopLeft)
|
417
|
-
}, React.createElement("
|
418
|
-
src: brandLogo,
|
419
|
-
alt: '',
|
420
|
-
className: classNames(classes.logo, classes.logoLeft)
|
421
|
-
})), React.createElement("span", {
|
426
|
+
}, imgComponent), React.createElement("span", {
|
422
427
|
className: classNames(classes.stripeGradient, classes.stripeTopLeft, classes.stripeGradientTopLeft)
|
423
428
|
}), cardNumber && React.createElement("div", {
|
424
429
|
className: classNames(classes.labelMedium, classes.ibanLabel)
|
@@ -440,11 +445,7 @@ class HiPaymentMeans extends React.Component {
|
|
440
445
|
}
|
441
446
|
}, React.createElement("span", {
|
442
447
|
className: classNames(classes.stripe, classes.stripeTopRight)
|
443
|
-
}, React.createElement("
|
444
|
-
src: brandLogo,
|
445
|
-
alt: '',
|
446
|
-
className: classNames(classes.logo, classes.logoRight)
|
447
|
-
})), React.createElement("span", {
|
448
|
+
}, imgComponent), React.createElement("span", {
|
448
449
|
className: classNames(classes.stripeGradient, classes.stripeTopRight, classes.stripeGradientTopRight)
|
449
450
|
}, React.createElement("img", {
|
450
451
|
src: logoMerchant,
|
@@ -467,11 +468,7 @@ class HiPaymentMeans extends React.Component {
|
|
467
468
|
}
|
468
469
|
}, React.createElement("span", {
|
469
470
|
className: classNames(classes.stripe, classes.stripeTopRight)
|
470
|
-
}, React.createElement("
|
471
|
-
src: brandLogo,
|
472
|
-
alt: '',
|
473
|
-
className: classNames(classes.logo, classes.logoRight)
|
474
|
-
})), React.createElement("span", {
|
471
|
+
}, imgComponent), React.createElement("span", {
|
475
472
|
className: classNames(classes.stripeGradient, classes.stripeTopRight, classes.stripeGradientTopRight)
|
476
473
|
}), React.createElement("div", {
|
477
474
|
className: classNames(classes.number, classes.cardNumber)
|
@@ -579,6 +576,11 @@ HiPaymentMeans.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
579
576
|
*/
|
580
577
|
credit: PropTypes.bool,
|
581
578
|
|
579
|
+
/**
|
580
|
+
* Chemin vers l'image à afficher par défaut si le logo n'est pas trouvé
|
581
|
+
*/
|
582
|
+
fallbackImage: PropTypes.string,
|
583
|
+
|
582
584
|
/**
|
583
585
|
* Logo du moyen de paiement
|
584
586
|
*/
|
package/index.es.js
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED