react-bootstrap-front 3.7.6 → 3.7.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bootstrap-front",
3
- "version": "3.7.6",
3
+ "version": "3.7.7",
4
4
  "description": "React Bootstrap Components",
5
5
  "keywords": [
6
6
  "Bootstrap 4",
@@ -8,10 +8,14 @@ export default class DefaultQuickSearch extends Component {
8
8
  name: PropTypes.string.isRequired,
9
9
  label: PropTypes.string,
10
10
  icon: PropTypes.element.isRequired,
11
+ plus: PropTypes.element,
12
+ reset: PropTypes.element,
11
13
  };
12
14
 
13
15
  static defaultProps = {
14
16
  label: '',
17
+ plus: null,
18
+ reset: null,
15
19
  };
16
20
 
17
21
  static getDerivedStateFromProps(props, state) {
@@ -38,11 +42,11 @@ export default class DefaultQuickSearch extends Component {
38
42
  this.setState({ search: event.target.value });
39
43
  }
40
44
 
41
- onSubmit(event) {
45
+ onSubmit(event, mode) {
42
46
  if (event) {
43
47
  event.preventDefault();
44
48
  }
45
- this.props.onSubmit(this.state.search);
49
+ this.props.onSubmit(this.state.search, mode);
46
50
  }
47
51
 
48
52
  render() {
@@ -58,9 +62,19 @@ export default class DefaultQuickSearch extends Component {
58
62
  onChange={this.onChange}
59
63
  />
60
64
  <div className="input-group-append">
61
- <button type="button" className="btn btn-outline-secondary bg-light" onClick={this.onSubmit}>
65
+ <button type="button" title="Recherche simple" className="btn btn-outline-secondary bg-light" onClick={(ev) => this.onSubmit(ev, "simple")}>
62
66
  {this.props.icon}
63
67
  </button>
68
+ {this.props.plus &&
69
+ <button type="button" title="Recherche mois stricte" className="btn btn-outline-secondary bg-light" onClick={(ev) => this.onSubmit(ev, "plus")}>
70
+ {this.props.plus}
71
+ </button>
72
+ }
73
+ {this.props.reset &&
74
+ <button type="button" title="Initialiser la recherche" className="btn btn-outline-secondary bg-light" onClick={(ev) => this.onSubmit(ev, "reset")}>
75
+ {this.props.reset}
76
+ </button>
77
+ }
64
78
  </div>
65
79
  </div>
66
80
  </form>
@@ -39,16 +39,13 @@ export default class DropdownWrapper extends Component {
39
39
  }
40
40
 
41
41
  render() {
42
+ const clonedTrigger = React.cloneElement(
43
+ this.props.trigger,
44
+ {ref: this.state.ref, onClick: this.onClick, title: this.props.tooltip}
45
+ )
42
46
  return (
43
47
  <>
44
- <div
45
- ref={this.state.ref}
46
- className={classnames('advanced-dropdown-wrapper', this.props.className)}
47
- onClick={this.onClick}
48
- title={this.props.tooltip}
49
- >
50
- {this.props.trigger}
51
- </div>
48
+ {clonedTrigger}
52
49
  {this.state.open && (
53
50
  <Dropdown align={this.props.align} myRef={this.state.ref} onClose={this.onClose}>
54
51
  <div onClick={this.onClose}>{this.props.children}</div>
@@ -33,7 +33,6 @@
33
33
  margin-left: 20px;
34
34
  margin-right: 10px;
35
35
  padding: 2px;
36
- background-color: theme-color('secondary');
37
36
  }
38
37
  .nav-link-inner-btn:hover {
39
38
  background-color: theme-color('secondary-light');
@@ -99,13 +99,13 @@ export default class CalmButton extends Component {
99
99
  {this.props.options.map(option => {
100
100
  return (
101
101
  <DropdownMenuOption
102
- key={`text-${option.id}`}
102
+ key={`text-${option.value}`}
103
103
  label={option.label}
104
104
  onClick={ev => {
105
105
  if (ev) {
106
106
  ev.preventDefault();
107
107
  }
108
- option.onClick();
108
+ this.props.onClick(option.value);
109
109
  this.onOptionsMenuClose();
110
110
  }}
111
111
  />