react-bootstrap-front 3.7.8 → 3.8.0

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.8",
3
+ "version": "3.8.0",
4
4
  "description": "React Bootstrap Components",
5
5
  "keywords": [
6
6
  "Bootstrap 4",
@@ -71,7 +71,7 @@ export default class DefaultQuickSearch extends Component {
71
71
  </button>
72
72
  }
73
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")}>
74
+ <button type="button" title="Initialiser la recherche" className="btn btn-outline-secondary bg-light text-warning" onClick={(ev) => this.onSubmit(ev, "reset")}>
75
75
  {this.props.reset}
76
76
  </button>
77
77
  }
@@ -12,7 +12,7 @@ export default function InputMonetary(props) {
12
12
  const rnd = getRandomInt(10000, 99999);
13
13
  myId = `${myId}-${rnd}`;
14
14
  }
15
- const value = props.value || 0;
15
+ const value = props.value || (props.allowNull ? '' : 0);
16
16
  return (
17
17
  <InputGroup {...props} id={myId}>
18
18
  {props.prepend && props.prepend !== '' && (
@@ -94,6 +94,7 @@ export default function InputMonetary(props) {
94
94
  }
95
95
 
96
96
  InputMonetary.propTypes = {
97
+ allowNull: PropTypes.bool,
97
98
  autoComplete: PropTypes.string,
98
99
  disabled: PropTypes.bool,
99
100
  error: PropTypes.element,
@@ -125,6 +126,7 @@ InputMonetary.propTypes = {
125
126
  };
126
127
 
127
128
  InputMonetary.defaultProps = {
129
+ allowNull: false,
128
130
  autoComplete: 'off',
129
131
  disabled: false,
130
132
  error: false,
@@ -73,6 +73,7 @@ export default class DefaultPanel extends Component {
73
73
  validPanelIcon: PropTypes.element.isRequired,
74
74
  cancelPanelIcon: PropTypes.element.isRequired,
75
75
  onToggleFilter: PropTypes.func.isRequired,
76
+ clearIcon: PropTypes.element.isRequired,
76
77
  sortNoneIcon: PropTypes.element,
77
78
  sortUpIcon: PropTypes.element,
78
79
  sortDownIcon: PropTypes.element,
@@ -178,7 +179,11 @@ export default class DefaultPanel extends Component {
178
179
  let { filter } = this.state;
179
180
  const col = event.target.name;
180
181
  const oper = event.target.value;
181
- filter.updateFilterOperator(col.replace('oper-', ''), oper);
182
+ if (oper !== '') {
183
+ filter.updateFilterOperator(col.replace('oper-', ''), oper);
184
+ } else {
185
+ filter.removeFilter(col.replace('oper-', ''));
186
+ }
182
187
  this.setState({ filter, local: true });
183
188
  }
184
189
 
@@ -253,6 +258,11 @@ export default class DefaultPanel extends Component {
253
258
  {this.props.cancelPanelIcon}
254
259
  </button>
255
260
  )}
261
+ {this.props.onClearFilter &&
262
+ <button className="btn btn-warning text-light" onClick={this.props.onClearFilter}>
263
+ {this.props.clearIcon}
264
+ </button>
265
+ }
256
266
  <button className="btn btn-primary text-light" onClick={this.onValid}>
257
267
  {this.props.validPanelIcon}
258
268
  </button>
@@ -192,7 +192,11 @@ export default class Filter {
192
192
  removeFilter(name, action = 'default') {
193
193
  let elem = this.data.filters.find(elt => elt.getFilterName() === name);
194
194
  if (elem) {
195
- elem.removeFilterCrit(action);
195
+ if (action === 'default') {
196
+ this.data.filters = this.data.filters.filter(elt => elt.getFilterName() !== name)
197
+ } else {
198
+ elem.removeFilterCrit(action);
199
+ }
196
200
  }
197
201
  }
198
202
 
@@ -27,33 +27,33 @@ import { InputAutocomplete, FilterHeader } from './';
27
27
  const getOptionsForType = (type, update = false) => {
28
28
  let options = [
29
29
  {value: '', label: ''},
30
- {value: FILTER_OPER_EQUAL, label: '='},
31
- {value: FILTER_OPER_NOT_EQUAL, label: '!='},
32
- {value: FILTER_OPER_EMPTY, label: 'ø'},
33
- {value: FILTER_OPER_NOT_EMPTY, label: '!ø'},
30
+ {value: FILTER_OPER_EQUAL, label: 'Est égal à'},
31
+ {value: FILTER_OPER_NOT_EQUAL, label: 'Est différenrt de'},
32
+ {value: FILTER_OPER_EMPTY, label: 'Est vide'},
33
+ {value: FILTER_OPER_NOT_EMPTY, label: 'N\'est pas vide'},
34
34
  ];
35
35
  if (type !== 'date' && type !== 'datetime' && type !== 'picker' && type !== 'select') {
36
36
  options.push(
37
- {value: FILTER_OPER_LIKE, label: '*'},
38
- {value: FILTER_OPER_NOT_LIKE, label: '!*'},
39
- {value: FILTER_OPER_START_WITH, label: '^*'},
40
- {value: FILTER_OPER_END_WITH, label: '*$'},
41
- {value: FILTER_OPER_SOUND_LIKE, label: '~'}
37
+ {value: FILTER_OPER_LIKE, label: 'Contient'},
38
+ {value: FILTER_OPER_NOT_LIKE, label: 'Ne contient pas'},
39
+ {value: FILTER_OPER_START_WITH, label: 'Commence par'},
40
+ {value: FILTER_OPER_END_WITH, label: 'Termine par'},
41
+ {value: FILTER_OPER_SOUND_LIKE, label: 'Ressemble à'}
42
42
  );
43
43
  }
44
44
  if (type !== 'picker' && type !== 'select') {
45
45
  options.push(
46
- {value: FILTER_OPER_GREATER, label: '>'},
47
- {value: FILTER_OPER_GREATER_OR_EQUAL, label: '>='},
48
- {value: FILTER_OPER_GREATER_OR_EQUAL_OR_NULL, label: '>=ø'},
49
- {value: FILTER_OPER_LOWER, label: '<'},
50
- {value: FILTER_OPER_LOWER_OR_EQUAL, label: '<='},
51
- {value: FILTER_OPER_LOWER_OR_EQUAL_OR_NULL, label: '<=ø'},
46
+ {value: FILTER_OPER_GREATER, label: 'Supérieur à'},
47
+ {value: FILTER_OPER_GREATER_OR_EQUAL, label: 'Supérieur ou égal à'},
48
+ {value: FILTER_OPER_GREATER_OR_EQUAL_OR_NULL, label: 'Vide ou supérieur et égal à'},
49
+ {value: FILTER_OPER_LOWER, label: 'Inférieur à'},
50
+ {value: FILTER_OPER_LOWER_OR_EQUAL, label: 'Inférieur ou égal à'},
51
+ {value: FILTER_OPER_LOWER_OR_EQUAL_OR_NULL, label: 'Vide ou inférieur et égal à'},
52
52
  );
53
53
  };
54
- if (update && (type === 'date' || type === 'datetime' || type === 'monetary')) {
54
+ if (update && (type === 'date' || type === 'datetime' || type === 'monetary' || type === 'number')) {
55
55
  options.push(
56
- {value: FILTER_OPER_BETWEEN, label: '<.>'}
56
+ {value: FILTER_OPER_BETWEEN, label: 'Compris entre'}
57
57
  );
58
58
  }
59
59
  return options;
@@ -71,7 +71,6 @@ export default class FilterBuilder extends Component {
71
71
  delIcon: PropTypes.element.isRequired,
72
72
  calIcon: PropTypes.element.isRequired,
73
73
  className: PropTypes.string,
74
- clearIcon: PropTypes.element.isRequired,
75
74
  withHeader: PropTypes.bool,
76
75
  };
77
76
  static defaultProps = {
@@ -118,6 +117,9 @@ export default class FilterBuilder extends Component {
118
117
  colOper = FILTER_OPER_EQUAL;
119
118
  }
120
119
  }
120
+ if (value === null) {
121
+ value = '';
122
+ }
121
123
  const prepend = (
122
124
  <select
123
125
  id={`oper-${colFilterable}`}
@@ -155,7 +157,7 @@ export default class FilterBuilder extends Component {
155
157
  display={col.filterable.display}
156
158
  value={value}
157
159
  size={this.props.size}
158
- clearIcon={this.props.clearIcon}
160
+ clearIcon={this.props.delIcon}
159
161
  onSearch={col.filterable.onSearch}
160
162
  onSelect={this.props.onChange}
161
163
  />
@@ -176,7 +178,7 @@ export default class FilterBuilder extends Component {
176
178
  value={value}
177
179
  onChange={this.props.onChange}
178
180
  calIcon={this.props.calIcon}
179
- delIcon={this.props.clearIcon}
181
+ delIcon={this.props.delIcon}
180
182
  />
181
183
  </div>
182
184
  {colOper === FILTER_OPER_BETWEEN && this.props.onUpdate &&
@@ -189,7 +191,7 @@ export default class FilterBuilder extends Component {
189
191
  value={elem.getFilterCrit('between')}
190
192
  onChange={this.props.onUpdate}
191
193
  calIcon={this.props.calIcon}
192
- delIcon={this.props.clearIcon}
194
+ delIcon={this.props.delIcon}
193
195
  />
194
196
  </div>
195
197
  }
@@ -210,7 +212,7 @@ export default class FilterBuilder extends Component {
210
212
  value={value}
211
213
  onChange={this.props.onChange}
212
214
  calIcon={this.props.calIcon}
213
- delIcon={this.props.clearIcon}
215
+ delIcon={this.props.delIcon}
214
216
  />
215
217
  </div>
216
218
  {colOper === FILTER_OPER_BETWEEN && this.props.onUpdate &&
@@ -223,7 +225,7 @@ export default class FilterBuilder extends Component {
223
225
  value={elem.getFilterCrit('between')}
224
226
  onChange={this.props.onUpdate}
225
227
  calIcon={this.props.calIcon}
226
- delIcon={this.props.clearIcon}
228
+ delIcon={this.props.delIcon}
227
229
  />
228
230
  </div>
229
231
  }
@@ -365,7 +367,7 @@ export default class FilterBuilder extends Component {
365
367
  this.props.onRemove(ev);
366
368
  }}
367
369
  >
368
- {this.props.clearIcon}
370
+ {this.props.delIcon}
369
371
  </button>
370
372
  </div>
371
373
  </div>
@@ -411,7 +413,7 @@ export default class FilterBuilder extends Component {
411
413
  this.props.onChange(ev);
412
414
  }}
413
415
  >
414
- {this.props.clearIcon}
416
+ {this.props.delIcon}
415
417
  </button>
416
418
  <button
417
419
  type="button"
@@ -466,7 +468,7 @@ export default class FilterBuilder extends Component {
466
468
  this.props.onRemove(ev);
467
469
  }}
468
470
  >
469
- {this.props.clearIcon}
471
+ {this.props.delIcon}
470
472
  </button>
471
473
  </div>
472
474
  </div>
@@ -1,5 +1,6 @@
1
1
  .filter-filter-builder {
2
2
  .input-group-prepend {
3
+ width: 180px;
3
4
  label, select, span {
4
5
  height: 100%;
5
6
  background-color: theme-color('light') !important;
@@ -9,6 +10,8 @@
9
10
  min-width: 50px;
10
11
  select{
11
12
  padding: 0px;
13
+ padding-right: 20px;
14
+ color: theme-color('dark') !important;
12
15
  }
13
16
  }
14
17
  }
@@ -40,7 +40,7 @@ export default function FilterHeader(props) {
40
40
  borderColor="secondary-light"
41
41
  />
42
42
  </div>
43
- <div className="col-xxs-w16 form-group">
43
+ <div className="col-xxs-none form-group">
44
44
  <label htmlFor="filter-oper" className="text-secondary">
45
45
  <span>Condition</span>
46
46
  </label>
@@ -149,7 +149,7 @@ export default class ActionButton extends Component {
149
149
  );
150
150
  } else {
151
151
  if (this.state.options && Array.isArray(this.state.options)) {
152
- if (this.state.options.length > 1) {
152
+ if (this.state.options.length >= 1) {
153
153
  const trigger = (
154
154
  <button
155
155
  type="button"
@@ -194,7 +194,7 @@ export default class DefaultHeader extends Component {
194
194
  'default-list-header text-secondary overflow-hidden',
195
195
  this.props.className,
196
196
  'bg-' + this.props.headerBackgroundTheme,
197
- 'text' + this.props.headerTextTheme
197
+ 'text-' + this.props.headerTextTheme
198
198
  )}
199
199
  >
200
200
  <Row>
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import classnames from 'classnames';
4
+ import { Row, Col } from '../grid';
4
5
 
5
6
  const myLocalStyle = {
6
7
  position: 'absolute',
@@ -24,7 +25,26 @@ export const DefaultContent = props => {
24
25
  }
25
26
  return (
26
27
  <>
27
- {props.header && <div className="rbf-responsive-content-header" style={headerStyle} />}
28
+ {props.header &&
29
+ <div className="rbf-responsive-content-header" style={headerStyle}>
30
+ <div className="default-page-header text-secondary overflow-hidden">
31
+ <Row>
32
+ <Col size={{ xsxs: 36 }}>
33
+ <div className="pl-2" style={{ display: 'inline-block', float: 'left' }}>
34
+ <span className={classnames('header-icon', 'no-selector', 'text-' + props.headerTextTheme)}>
35
+ {props.icon && props.icon}
36
+ </span>
37
+ </div>
38
+ <div className="pl-2" style={{ display: 'inline-block', float: 'left' }}>
39
+ <span className="header-title">
40
+ {props.headerContent}
41
+ </span>
42
+ </div>
43
+ </Col>
44
+ </Row>
45
+ </div>
46
+ </div>
47
+ }
28
48
  <div style={inlineStyle}>
29
49
  <div className="custom-scrollbar" style={{ height: '100%', overflowY: 'auto', overflowX: 'hidden' }}>
30
50
  <div className={classnames(props.className)}>
@@ -40,10 +60,12 @@ DefaultContent.propTypes = {
40
60
  className: PropTypes.string,
41
61
  children: PropTypes.element,
42
62
  header: PropTypes.bool,
63
+ headerContent: PropTypes.element,
43
64
  };
44
65
 
45
66
  DefaultContent.defaultProps = {
46
67
  children: null,
47
68
  className: '',
48
69
  header: true,
70
+ headerContent: null,
49
71
  };
@@ -1,4 +1,25 @@
1
1
  .rbf-responsive-content-header {
2
- background-color: theme-color('light');
3
- border-bottom: 1px solid theme-color('secondary-light');
2
+ background-color: theme-color('light');
3
+ border-bottom: 1px solid theme-color('secondary-light');
4
+
5
+ .default-page-header {
6
+ line-height: 50px;
7
+ }
8
+
9
+ .header-icon {
10
+ font-size: 1.1rem;
11
+ font-weight: bold;
12
+ padding-left: 5px;
13
+ padding-right: 10px;
14
+ display: inline-flex;
15
+ height: 26px;
16
+ vertical-align: middle;
17
+ }
18
+
19
+ .header-title {
20
+ font-size: 1.1rem;
21
+ font-weight: bold;
22
+ padding-left: 5px;
23
+ padding-right: 10px;
24
+ }
4
25
  }