@hipay/hipay-material-ui 2.0.0-beta.39 → 2.0.0-beta.41
Sign up to get free protection for your applications and to get access to all the features.
- package/HiCheckbox/HiCheckbox.js +2 -2
- package/HiForm/HiInput.js +7 -0
- package/HiIcon/HiIcon.js +1 -1
- package/HiIconButton/HiIconButton.js +3 -1
- package/HiSelect/HiSelect.js +15 -2
- package/HiSelect/SelectInput.js +32 -6
- package/HiSelectNew/HiDynamicSelectField.js +146 -0
- package/HiSelectNew/HiNestedSelect.js +33 -4
- package/HiSelectNew/HiNestedSelectField.js +146 -0
- package/HiSelectNew/HiSelect.js +34 -6
- package/HiSelectNew/HiSelectInput.js +33 -5
- package/es/HiCheckbox/HiCheckbox.js +2 -2
- package/es/HiForm/HiInput.js +7 -0
- package/es/HiIcon/HiIcon.js +2 -2
- package/es/HiIconButton/HiIconButton.js +3 -1
- package/es/HiSelect/HiSelect.js +14 -2
- package/es/HiSelect/SelectInput.js +29 -5
- package/es/HiSelectNew/HiDynamicSelectField.js +111 -0
- package/es/HiSelectNew/HiNestedSelect.js +25 -4
- package/es/HiSelectNew/HiNestedSelectField.js +111 -0
- package/es/HiSelectNew/HiSelect.js +33 -6
- package/es/HiSelectNew/HiSelectInput.js +29 -4
- package/index.es.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/umd/hipay-material-ui.development.js +61 -13
- package/umd/hipay-material-ui.production.min.js +2 -2
@@ -5,6 +5,7 @@ import classNames from 'classnames';
|
|
5
5
|
import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown';
|
6
6
|
import ButtonBase from '@material-ui/core/ButtonBase';
|
7
7
|
import Icon from '@material-ui/core/Icon';
|
8
|
+
import HiIcon from '../HiIcon';
|
8
9
|
import withStyles from '../styles/withStyles';
|
9
10
|
import keycode from 'keycode';
|
10
11
|
export const styles = theme => ({
|
@@ -134,7 +135,14 @@ class HiSelectInput extends React.PureComponent {
|
|
134
135
|
}
|
135
136
|
};
|
136
137
|
|
138
|
+
this.handleClick = event => {
|
139
|
+
if ((!this.resetIcon || !this.resetIcon.contains(event.target)) && this.props.onClick) {
|
140
|
+
this.props.onClick(event);
|
141
|
+
}
|
142
|
+
};
|
143
|
+
|
137
144
|
this.handleKeyDown = this.handleKeyDown.bind(this);
|
145
|
+
this.handleClick = this.handleClick.bind(this);
|
138
146
|
}
|
139
147
|
|
140
148
|
render() {
|
@@ -143,13 +151,15 @@ class HiSelectInput extends React.PureComponent {
|
|
143
151
|
noButton,
|
144
152
|
disabled,
|
145
153
|
onClick,
|
154
|
+
onReset,
|
146
155
|
value,
|
147
156
|
open,
|
148
157
|
focused,
|
149
158
|
error,
|
150
159
|
id,
|
151
160
|
placeholder,
|
152
|
-
refElement
|
161
|
+
refElement,
|
162
|
+
theme
|
153
163
|
} = this.props; // On utilise classNames pour variabiliser les styles et merge les classes appliquées
|
154
164
|
|
155
165
|
const rootClass = classNames(classes.root, classes.inkbar, classes.underline, {
|
@@ -184,7 +194,7 @@ class HiSelectInput extends React.PureComponent {
|
|
184
194
|
})) : React.createElement(ButtonBase, {
|
185
195
|
id: id,
|
186
196
|
className: rootClass,
|
187
|
-
onClick:
|
197
|
+
onClick: this.handleClick,
|
188
198
|
disabled: disabled,
|
189
199
|
onMouseEnter: this.props.onMouseEnter,
|
190
200
|
onMouseLeave: this.props.onMouseLeave,
|
@@ -198,7 +208,16 @@ class HiSelectInput extends React.PureComponent {
|
|
198
208
|
className: classNames(classes.label, {
|
199
209
|
[classes.placeholder]: value === undefined
|
200
210
|
})
|
201
|
-
}, value || placeholder), React.createElement(
|
211
|
+
}, value || placeholder), onReset && focused && React.createElement("div", {
|
212
|
+
ref: el => {
|
213
|
+
this.resetIcon = el;
|
214
|
+
}
|
215
|
+
}, React.createElement(HiIcon, {
|
216
|
+
icon: "close",
|
217
|
+
size: 24,
|
218
|
+
color: theme.palette.neutral.main,
|
219
|
+
onClick: onReset
|
220
|
+
})), React.createElement(Icon, {
|
202
221
|
classes: {
|
203
222
|
root: iconClass
|
204
223
|
}
|
@@ -276,6 +295,11 @@ HiSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
276
295
|
*/
|
277
296
|
onMouseLeave: PropTypes.func,
|
278
297
|
|
298
|
+
/**
|
299
|
+
* Fonction de callback appelée lorsqu'on vide le champs
|
300
|
+
*/
|
301
|
+
onReset: PropTypes.func,
|
302
|
+
|
279
303
|
/**
|
280
304
|
* Fonction de callback à la pression de la touche "Entrée"
|
281
305
|
*/
|
@@ -303,5 +327,6 @@ HiSelectInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
303
327
|
} : {};
|
304
328
|
export default withStyles(styles, {
|
305
329
|
hiComponent: true,
|
306
|
-
name: 'HmuiHiSelectInput'
|
330
|
+
name: 'HmuiHiSelectInput',
|
331
|
+
withTheme: true
|
307
332
|
})(HiSelectInput);
|
package/index.es.js
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/** @license HiPay-Material-UI v2.0.0-beta.
|
1
|
+
/** @license HiPay-Material-UI v2.0.0-beta.41
|
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.
|
@@ -13667,6 +13667,7 @@
|
|
13667
13667
|
|
13668
13668
|
var styles$1 = function styles(theme) {
|
13669
13669
|
return {
|
13670
|
+
label: {},
|
13670
13671
|
positive: {
|
13671
13672
|
color: theme.palette.positive.main,
|
13672
13673
|
'&:hover': {
|
@@ -13724,7 +13725,8 @@
|
|
13724
13725
|
return React__default.createElement(IconButton$2, _extends_1({
|
13725
13726
|
className: className,
|
13726
13727
|
classes: {
|
13727
|
-
root: buttonClassNames
|
13728
|
+
root: buttonClassNames,
|
13729
|
+
label: classes.label
|
13728
13730
|
},
|
13729
13731
|
color: hcolor
|
13730
13732
|
}, other), children);
|
@@ -65902,7 +65904,7 @@
|
|
65902
65904
|
|
65903
65905
|
if (iconName.indexOf('fa-') === 0) {
|
65904
65906
|
return React__default.createElement("i", _extends_1({
|
65905
|
-
className: classnames('fa', iconName, classes.root, defineProperty({}, classes["color".concat(capitalize(color))], color !== 'inherit')
|
65907
|
+
className: classnames('fa', iconName, className, classes.root, defineProperty({}, classes["color".concat(capitalize(color))], color !== 'inherit')),
|
65906
65908
|
style: {
|
65907
65909
|
fontSize: size
|
65908
65910
|
}
|
@@ -66113,7 +66115,7 @@
|
|
66113
66115
|
|
66114
66116
|
HiCheckbox.defaultProps = {
|
66115
66117
|
checked: false,
|
66116
|
-
color: '
|
66118
|
+
color: 'inherit',
|
66117
66119
|
size: 20,
|
66118
66120
|
icon: 'check_box_outline_blank'
|
66119
66121
|
};
|
@@ -66136,7 +66138,7 @@
|
|
66136
66138
|
/**
|
66137
66139
|
* The color of the component. It supports those theme colors that make sense for this component.
|
66138
66140
|
*/
|
66139
|
-
color: propTypes.oneOf(['
|
66141
|
+
color: propTypes.oneOf(['inherit', 'primary', 'secondary', 'positive', 'negative', 'middle', 'neutral']),
|
66140
66142
|
|
66141
66143
|
/**
|
66142
66144
|
* icon à afficher quand le composant est non coché.
|
@@ -68617,6 +68619,10 @@
|
|
68617
68619
|
width: 40,
|
68618
68620
|
display: 'inline-block'
|
68619
68621
|
},
|
68622
|
+
eraseButtonLabel: {
|
68623
|
+
position: 'relative',
|
68624
|
+
top: -2
|
68625
|
+
},
|
68620
68626
|
disabled: {
|
68621
68627
|
borderBottom: 'none'
|
68622
68628
|
},
|
@@ -68816,6 +68822,9 @@
|
|
68816
68822
|
|
68817
68823
|
var eraseIcon = !multiline && onReset && focused && !disabled && value.length > 0 && React__default.createElement(HiIconButton$1, {
|
68818
68824
|
className: classes.eraseButton,
|
68825
|
+
classes: {
|
68826
|
+
label: classes.eraseButtonLabel
|
68827
|
+
},
|
68819
68828
|
onClick: this.handleReset,
|
68820
68829
|
onBlur: this.handleBlur
|
68821
68830
|
}, _ref$3);
|
@@ -96423,7 +96432,7 @@
|
|
96423
96432
|
}
|
96424
96433
|
},
|
96425
96434
|
disabled: {
|
96426
|
-
color: "".concat(theme.palette.
|
96435
|
+
color: "".concat(theme.palette.text.disabled),
|
96427
96436
|
'&:before': {
|
96428
96437
|
display: 'none'
|
96429
96438
|
}
|
@@ -96483,26 +96492,37 @@
|
|
96483
96492
|
}
|
96484
96493
|
};
|
96485
96494
|
|
96495
|
+
_this.handleClick = function (event) {
|
96496
|
+
if ((!_this.resetIcon || !_this.resetIcon.contains(event.target)) && _this.props.onClick) {
|
96497
|
+
_this.props.onClick(event);
|
96498
|
+
}
|
96499
|
+
};
|
96500
|
+
|
96486
96501
|
_this.handleKeyDown = _this.handleKeyDown.bind(assertThisInitialized(assertThisInitialized(_this)));
|
96502
|
+
_this.handleClick = _this.handleClick.bind(assertThisInitialized(assertThisInitialized(_this)));
|
96487
96503
|
return _this;
|
96488
96504
|
}
|
96489
96505
|
|
96490
96506
|
createClass(SelectInput, [{
|
96491
96507
|
key: "render",
|
96492
96508
|
value: function render() {
|
96493
|
-
var _classNames,
|
96509
|
+
var _classNames,
|
96510
|
+
_classNames2,
|
96511
|
+
_this2 = this;
|
96494
96512
|
|
96495
96513
|
var _this$props = this.props,
|
96496
96514
|
classes = _this$props.classes,
|
96497
96515
|
noButton = _this$props.noButton,
|
96498
96516
|
disabled = _this$props.disabled,
|
96499
96517
|
onClick = _this$props.onClick,
|
96518
|
+
onReset = _this$props.onReset,
|
96500
96519
|
value = _this$props.value,
|
96501
96520
|
open = _this$props.open,
|
96502
96521
|
focused = _this$props.focused,
|
96503
96522
|
error = _this$props.error,
|
96504
96523
|
id = _this$props.id,
|
96505
|
-
refElement = _this$props.refElement
|
96524
|
+
refElement = _this$props.refElement,
|
96525
|
+
theme = _this$props.theme; // On utilise classNames pour variabiliser les styles et merge les classes appliquées
|
96506
96526
|
|
96507
96527
|
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));
|
96508
96528
|
var iconClass = classnames(classes.icon, (_classNames2 = {}, defineProperty(_classNames2, classes.iconOpen, open), defineProperty(_classNames2, classes.iconClose, !open), _classNames2));
|
@@ -96531,7 +96551,7 @@
|
|
96531
96551
|
classes: {
|
96532
96552
|
root: rootClass
|
96533
96553
|
},
|
96534
|
-
onClick:
|
96554
|
+
onClick: this.handleClick,
|
96535
96555
|
disabled: disabled,
|
96536
96556
|
onMouseEnter: this.props.onMouseEnter,
|
96537
96557
|
onMouseLeave: this.props.onMouseLeave,
|
@@ -96543,7 +96563,16 @@
|
|
96543
96563
|
}
|
96544
96564
|
}, React__default.createElement("span", {
|
96545
96565
|
className: classes.label
|
96546
|
-
}, value), React__default.createElement(
|
96566
|
+
}, value), onReset && focused && React__default.createElement("div", {
|
96567
|
+
ref: function ref(el) {
|
96568
|
+
_this2.resetIcon = el;
|
96569
|
+
}
|
96570
|
+
}, React__default.createElement(HiIcon$1, {
|
96571
|
+
icon: "close",
|
96572
|
+
size: 24,
|
96573
|
+
color: theme.palette.neutral.main,
|
96574
|
+
onClick: onReset
|
96575
|
+
})), React__default.createElement(HiIcon$1, {
|
96547
96576
|
className: iconClass,
|
96548
96577
|
icon: "arrow_drop_down"
|
96549
96578
|
}));
|
@@ -96618,6 +96647,11 @@
|
|
96618
96647
|
*/
|
96619
96648
|
onMouseLeave: propTypes.func,
|
96620
96649
|
|
96650
|
+
/**
|
96651
|
+
* Fonction de callback appelée lorsqu'on vide le champs
|
96652
|
+
*/
|
96653
|
+
onReset: propTypes.func,
|
96654
|
+
|
96621
96655
|
/**
|
96622
96656
|
* Fonction de callback à la pression de la touche "Entrée"
|
96623
96657
|
*/
|
@@ -96640,7 +96674,8 @@
|
|
96640
96674
|
};
|
96641
96675
|
var SelectInput$1 = withStyles(styles$p, {
|
96642
96676
|
hiComponent: true,
|
96643
|
-
name: 'HmuiSelectInput'
|
96677
|
+
name: 'HmuiSelectInput',
|
96678
|
+
withTheme: true
|
96644
96679
|
})(SelectInput);
|
96645
96680
|
|
96646
96681
|
var styles$q = function styles(theme) {
|
@@ -97134,6 +97169,14 @@
|
|
97134
97169
|
});
|
97135
97170
|
}
|
97136
97171
|
}
|
97172
|
+
}, {
|
97173
|
+
key: "handleReset",
|
97174
|
+
value: function handleReset(event) {
|
97175
|
+
if (this.props.onReset) {
|
97176
|
+
event.stopPropagation();
|
97177
|
+
this.props.onReset(event);
|
97178
|
+
}
|
97179
|
+
}
|
97137
97180
|
}, {
|
97138
97181
|
key: "render",
|
97139
97182
|
value: function render() {
|
@@ -97330,14 +97373,14 @@
|
|
97330
97373
|
onMouseLeave: this.props.onMouseLeave,
|
97331
97374
|
refElement: function refElement(el) {
|
97332
97375
|
_this2.selectInputElement = el;
|
97333
|
-
}
|
97376
|
+
},
|
97377
|
+
onReset: this.props.onReset
|
97334
97378
|
}), open && staticPosition ? React__default.createElement("div", {
|
97335
97379
|
style: popperStyle
|
97336
97380
|
}, content) : React__default.createElement(Popper$3, {
|
97337
97381
|
anchorEl: this.inputEl,
|
97338
97382
|
placement: "bottom-start",
|
97339
97383
|
open: open,
|
97340
|
-
eventsEnabled: open,
|
97341
97384
|
className: popperClass,
|
97342
97385
|
style: popperStyle,
|
97343
97386
|
disablePortal: true
|
@@ -97510,6 +97553,11 @@
|
|
97510
97553
|
*/
|
97511
97554
|
onMouseLeave: propTypes.func,
|
97512
97555
|
|
97556
|
+
/**
|
97557
|
+
* Fonction de callback appelée lorsqu'on vide le champs
|
97558
|
+
*/
|
97559
|
+
onReset: propTypes.func,
|
97560
|
+
|
97513
97561
|
/**
|
97514
97562
|
* Fonction de callback appelée lorsqu'on écrit dans la barre de recherche
|
97515
97563
|
* A utiliser pour les selects avec des données dynamiques
|