@hipay/hipay-material-ui 2.0.0-beta.40 → 2.0.0-beta.42
Sign up to get free protection for your applications and to get access to all the features.
- package/HiButton/HiButton.js +17 -16
- package/HiForm/HiInput.js +15 -0
- package/HiSelect/HiSelect.js +15 -2
- package/HiSelect/SelectInput.js +31 -5
- package/HiSelectNew/HiNestedSelectField.js +146 -0
- package/HiSelectNew/HiSelect.js +20 -7
- package/HiSelectNew/HiSelectInput.js +75 -12
- package/es/HiButton/HiButton.js +21 -19
- package/es/HiForm/HiInput.js +14 -0
- package/es/HiSelect/HiSelect.js +14 -2
- package/es/HiSelect/SelectInput.js +28 -4
- package/es/HiSelectNew/HiNestedSelectField.js +111 -0
- package/es/HiSelectNew/HiSelect.js +19 -7
- package/es/HiSelectNew/HiSelectInput.js +70 -11
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
- package/umd/hipay-material-ui.development.js +79 -24
- package/umd/hipay-material-ui.production.min.js +2 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
/** @license HiPay-Material-UI v2.0.0-beta.
|
1
|
+
/** @license HiPay-Material-UI v2.0.0-beta.42
|
2
2
|
*
|
3
3
|
* This source code is licensed under the MIT license found in the
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
@@ -13289,7 +13289,15 @@
|
|
13289
13289
|
|
13290
13290
|
var styles = function styles(theme) {
|
13291
13291
|
return {
|
13292
|
-
root: {
|
13292
|
+
root: {
|
13293
|
+
'&$disabled': {
|
13294
|
+
color: theme.palette.neutral.contrastText,
|
13295
|
+
backgroundColor: theme.palette.neutral.main
|
13296
|
+
}
|
13297
|
+
},
|
13298
|
+
flatNeutral: {
|
13299
|
+
color: theme.palette.neutral.main
|
13300
|
+
},
|
13293
13301
|
flatPositive: {
|
13294
13302
|
color: theme.palette.positive.main,
|
13295
13303
|
'&:hover': {
|
@@ -13320,16 +13328,6 @@
|
|
13320
13328
|
}
|
13321
13329
|
}
|
13322
13330
|
},
|
13323
|
-
flatNeutral: {
|
13324
|
-
color: theme.palette.neutral.main,
|
13325
|
-
'&:hover': {
|
13326
|
-
backgroundColor: fade(theme.palette.neutral.main, theme.palette.action.hoverOpacity),
|
13327
|
-
// Reset on touch devices, it doesn't add specificity
|
13328
|
-
'@media (hover: none)': {
|
13329
|
-
backgroundColor: 'transparent'
|
13330
|
-
}
|
13331
|
-
}
|
13332
|
-
},
|
13333
13331
|
|
13334
13332
|
/* Styles applied to the root element if `variant="[contained | fab]"` and `color="positive"`. */
|
13335
13333
|
containedPositive: {
|
@@ -13413,7 +13411,8 @@
|
|
13413
13411
|
'&:hover': {
|
13414
13412
|
border: "1px solid ".concat(theme.palette.neutral.main)
|
13415
13413
|
}
|
13416
|
-
}
|
13414
|
+
},
|
13415
|
+
disabled: {}
|
13417
13416
|
};
|
13418
13417
|
};
|
13419
13418
|
|
@@ -13425,19 +13424,21 @@
|
|
13425
13424
|
className = props.className,
|
13426
13425
|
color = props.color,
|
13427
13426
|
variant = props.variant,
|
13428
|
-
|
13427
|
+
disabled = props.disabled,
|
13428
|
+
other = objectWithoutProperties(props, ["children", "classes", "className", "color", "variant", "disabled"]);
|
13429
13429
|
|
13430
13430
|
var hcolor = ['positive', 'negative', 'middle', 'neutral'].includes(color) ? 'inherit' : color;
|
13431
13431
|
var fab = variant === 'fab' || variant === 'extendedFab';
|
13432
13432
|
var contained = variant === 'contained' || variant === 'raised';
|
13433
|
-
var buttonClassNames = classnames(classes.root, (_classNames = {}, defineProperty(_classNames, classes.flatPositive, (variant === 'text' || variant === 'flat' || variant === 'outlined') && color === 'positive'), defineProperty(_classNames, classes.flatNegative, (variant === 'text' || variant === 'flat' || variant === 'outlined') && color === 'negative'), defineProperty(_classNames, classes.flatMiddle, (variant === 'text' || variant === 'flat' || variant === 'outlined') && color === 'middle'), defineProperty(_classNames, classes.flatNeutral, (variant === 'text' || variant === 'flat' || variant === 'outlined') && color === 'neutral'), defineProperty(_classNames, classes.containedPositive, (contained || fab) && color === 'positive'), defineProperty(_classNames, classes.containedNegative, (contained || fab) && color === 'negative'), defineProperty(_classNames, classes.containedMiddle, (contained || fab) && color === 'middle'), defineProperty(_classNames, classes.containedNeutral, (contained || fab) && color === 'neutral'), defineProperty(_classNames, classes.outlinedPositive, variant === 'outlined' && color === 'positive'), defineProperty(_classNames, classes.outlinedNegative, variant === 'outlined' && color === 'negative'), defineProperty(_classNames, classes.outlinedMiddle, variant === 'outlined' && color === 'middle'), defineProperty(_classNames, classes.outlinedNeutral, variant === 'outlined' && color === 'neutral'), _classNames));
|
13433
|
+
var buttonClassNames = classnames(classes.root, (_classNames = {}, defineProperty(_classNames, classes.flatPositive, (variant === 'text' || variant === 'flat' || variant === 'outlined') && color === 'positive'), defineProperty(_classNames, classes.flatNegative, (variant === 'text' || variant === 'flat' || variant === 'outlined') && color === 'negative'), defineProperty(_classNames, classes.flatMiddle, (variant === 'text' || variant === 'flat' || variant === 'outlined') && color === 'middle'), defineProperty(_classNames, classes.flatNeutral, (variant === 'text' || variant === 'flat' || variant === 'outlined') && (color === 'default' || color === 'neutral')), defineProperty(_classNames, classes.containedPositive, (contained || fab) && color === 'positive'), defineProperty(_classNames, classes.containedNegative, (contained || fab) && color === 'negative'), defineProperty(_classNames, classes.containedMiddle, (contained || fab) && color === 'middle'), defineProperty(_classNames, classes.containedNeutral, (contained || fab) && (color === 'default' || color === 'neutral')), defineProperty(_classNames, classes.outlinedPositive, variant === 'outlined' && color === 'positive'), defineProperty(_classNames, classes.outlinedNegative, variant === 'outlined' && color === 'negative'), defineProperty(_classNames, classes.outlinedMiddle, variant === 'outlined' && color === 'middle'), defineProperty(_classNames, classes.outlinedNeutral, variant === 'outlined' && (color === 'default' || color === 'neutral')), defineProperty(_classNames, classes.disabled, disabled), _classNames));
|
13434
13434
|
return React__default.createElement(Button$2, _extends_1({
|
13435
13435
|
className: className,
|
13436
13436
|
classes: {
|
13437
13437
|
root: buttonClassNames
|
13438
13438
|
},
|
13439
13439
|
color: hcolor,
|
13440
|
-
variant: variant
|
13440
|
+
variant: variant,
|
13441
|
+
disabled: disabled
|
13441
13442
|
}, other), children);
|
13442
13443
|
}
|
13443
13444
|
|
@@ -13463,7 +13464,7 @@
|
|
13463
13464
|
variant: propTypes.oneOf(['text', 'flat', 'outlined', 'contained', 'raised', 'fab', 'extendedFab'])
|
13464
13465
|
};
|
13465
13466
|
HiButton.defaultProps = {
|
13466
|
-
color: '
|
13467
|
+
color: 'neutral',
|
13467
13468
|
variant: 'text'
|
13468
13469
|
};
|
13469
13470
|
var HiButton$1 = withStyles(styles, {
|
@@ -68873,6 +68874,15 @@
|
|
68873
68874
|
}
|
68874
68875
|
}));
|
68875
68876
|
}
|
68877
|
+
}], [{
|
68878
|
+
key: "getDerivedStateFromProps",
|
68879
|
+
value: function getDerivedStateFromProps(nextProps, prevState) {
|
68880
|
+
if (typeof nextProps.focused !== 'undefined' && nextProps.focused !== prevState.focused) {
|
68881
|
+
return {
|
68882
|
+
focused: nextProps.focused
|
68883
|
+
};
|
68884
|
+
}
|
68885
|
+
}
|
68876
68886
|
}]);
|
68877
68887
|
|
68878
68888
|
return HiInput;
|
@@ -68929,6 +68939,12 @@
|
|
68929
68939
|
*/
|
68930
68940
|
error: propTypes.bool,
|
68931
68941
|
|
68942
|
+
/**
|
68943
|
+
* Force le focus de l'input et surcharge le comportement par défaut
|
68944
|
+
* où le focus est géré dans le state.
|
68945
|
+
*/
|
68946
|
+
focused: propTypes.bool,
|
68947
|
+
|
68932
68948
|
/**
|
68933
68949
|
* Utile pour surcharger les classes de l'input
|
68934
68950
|
*/
|
@@ -96492,26 +96508,37 @@
|
|
96492
96508
|
}
|
96493
96509
|
};
|
96494
96510
|
|
96511
|
+
_this.handleClick = function (event) {
|
96512
|
+
if ((!_this.resetIcon || !_this.resetIcon.contains(event.target)) && _this.props.onClick) {
|
96513
|
+
_this.props.onClick(event);
|
96514
|
+
}
|
96515
|
+
};
|
96516
|
+
|
96495
96517
|
_this.handleKeyDown = _this.handleKeyDown.bind(assertThisInitialized(assertThisInitialized(_this)));
|
96518
|
+
_this.handleClick = _this.handleClick.bind(assertThisInitialized(assertThisInitialized(_this)));
|
96496
96519
|
return _this;
|
96497
96520
|
}
|
96498
96521
|
|
96499
96522
|
createClass(SelectInput, [{
|
96500
96523
|
key: "render",
|
96501
96524
|
value: function render() {
|
96502
|
-
var _classNames,
|
96525
|
+
var _classNames,
|
96526
|
+
_classNames2,
|
96527
|
+
_this2 = this;
|
96503
96528
|
|
96504
96529
|
var _this$props = this.props,
|
96505
96530
|
classes = _this$props.classes,
|
96506
96531
|
noButton = _this$props.noButton,
|
96507
96532
|
disabled = _this$props.disabled,
|
96508
96533
|
onClick = _this$props.onClick,
|
96534
|
+
onReset = _this$props.onReset,
|
96509
96535
|
value = _this$props.value,
|
96510
96536
|
open = _this$props.open,
|
96511
96537
|
focused = _this$props.focused,
|
96512
96538
|
error = _this$props.error,
|
96513
96539
|
id = _this$props.id,
|
96514
|
-
refElement = _this$props.refElement
|
96540
|
+
refElement = _this$props.refElement,
|
96541
|
+
theme = _this$props.theme; // On utilise classNames pour variabiliser les styles et merge les classes appliquées
|
96515
96542
|
|
96516
96543
|
var rootClass = classnames(classes.root, classes.inkbar, classes.underline, (_classNames = {}, defineProperty(_classNames, classes.disabled, disabled), defineProperty(_classNames, classes.focused, focused), defineProperty(_classNames, classes.error, error && !focused), _classNames));
|
96517
96544
|
var iconClass = classnames(classes.icon, (_classNames2 = {}, defineProperty(_classNames2, classes.iconOpen, open), defineProperty(_classNames2, classes.iconClose, !open), _classNames2));
|
@@ -96540,7 +96567,7 @@
|
|
96540
96567
|
classes: {
|
96541
96568
|
root: rootClass
|
96542
96569
|
},
|
96543
|
-
onClick:
|
96570
|
+
onClick: this.handleClick,
|
96544
96571
|
disabled: disabled,
|
96545
96572
|
onMouseEnter: this.props.onMouseEnter,
|
96546
96573
|
onMouseLeave: this.props.onMouseLeave,
|
@@ -96552,7 +96579,16 @@
|
|
96552
96579
|
}
|
96553
96580
|
}, React__default.createElement("span", {
|
96554
96581
|
className: classes.label
|
96555
|
-
}, value), React__default.createElement(
|
96582
|
+
}, value), onReset && focused && React__default.createElement("div", {
|
96583
|
+
ref: function ref(el) {
|
96584
|
+
_this2.resetIcon = el;
|
96585
|
+
}
|
96586
|
+
}, React__default.createElement(HiIcon$1, {
|
96587
|
+
icon: "close",
|
96588
|
+
size: 24,
|
96589
|
+
color: theme.palette.neutral.main,
|
96590
|
+
onClick: onReset
|
96591
|
+
})), React__default.createElement(HiIcon$1, {
|
96556
96592
|
className: iconClass,
|
96557
96593
|
icon: "arrow_drop_down"
|
96558
96594
|
}));
|
@@ -96627,6 +96663,11 @@
|
|
96627
96663
|
*/
|
96628
96664
|
onMouseLeave: propTypes.func,
|
96629
96665
|
|
96666
|
+
/**
|
96667
|
+
* Fonction de callback appelée lorsqu'on vide le champs
|
96668
|
+
*/
|
96669
|
+
onReset: propTypes.func,
|
96670
|
+
|
96630
96671
|
/**
|
96631
96672
|
* Fonction de callback à la pression de la touche "Entrée"
|
96632
96673
|
*/
|
@@ -96649,7 +96690,8 @@
|
|
96649
96690
|
};
|
96650
96691
|
var SelectInput$1 = withStyles(styles$p, {
|
96651
96692
|
hiComponent: true,
|
96652
|
-
name: 'HmuiSelectInput'
|
96693
|
+
name: 'HmuiSelectInput',
|
96694
|
+
withTheme: true
|
96653
96695
|
})(SelectInput);
|
96654
96696
|
|
96655
96697
|
var styles$q = function styles(theme) {
|
@@ -97143,6 +97185,14 @@
|
|
97143
97185
|
});
|
97144
97186
|
}
|
97145
97187
|
}
|
97188
|
+
}, {
|
97189
|
+
key: "handleReset",
|
97190
|
+
value: function handleReset(event) {
|
97191
|
+
if (this.props.onReset) {
|
97192
|
+
event.stopPropagation();
|
97193
|
+
this.props.onReset(event);
|
97194
|
+
}
|
97195
|
+
}
|
97146
97196
|
}, {
|
97147
97197
|
key: "render",
|
97148
97198
|
value: function render() {
|
@@ -97339,14 +97389,14 @@
|
|
97339
97389
|
onMouseLeave: this.props.onMouseLeave,
|
97340
97390
|
refElement: function refElement(el) {
|
97341
97391
|
_this2.selectInputElement = el;
|
97342
|
-
}
|
97392
|
+
},
|
97393
|
+
onReset: this.props.onReset
|
97343
97394
|
}), open && staticPosition ? React__default.createElement("div", {
|
97344
97395
|
style: popperStyle
|
97345
97396
|
}, content) : React__default.createElement(Popper$3, {
|
97346
97397
|
anchorEl: this.inputEl,
|
97347
97398
|
placement: "bottom-start",
|
97348
97399
|
open: open,
|
97349
|
-
eventsEnabled: open,
|
97350
97400
|
className: popperClass,
|
97351
97401
|
style: popperStyle,
|
97352
97402
|
disablePortal: true
|
@@ -97519,6 +97569,11 @@
|
|
97519
97569
|
*/
|
97520
97570
|
onMouseLeave: propTypes.func,
|
97521
97571
|
|
97572
|
+
/**
|
97573
|
+
* Fonction de callback appelée lorsqu'on vide le champs
|
97574
|
+
*/
|
97575
|
+
onReset: propTypes.func,
|
97576
|
+
|
97522
97577
|
/**
|
97523
97578
|
* Fonction de callback appelée lorsqu'on écrit dans la barre de recherche
|
97524
97579
|
* A utiliser pour les selects avec des données dynamiques
|