react-bootstrap-front 3.7.7 → 3.7.8

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.7",
3
+ "version": "3.7.8",
4
4
  "description": "React Bootstrap Components",
5
5
  "keywords": [
6
6
  "Bootstrap 4",
@@ -0,0 +1,20 @@
1
+ import React, { Component } from 'react';
2
+ import classnames from 'classnames';
3
+
4
+ export default class DefaultLineBreak extends Component {
5
+ render() {
6
+ let rowOddEven = '';
7
+ if (this.props.counter) {
8
+ rowOddEven = this.props.counter % 2 === 0 ? 'row-even' : 'row-odd';
9
+ }
10
+ return (
11
+ <div
12
+ className={classnames("inline-default-list-wrapper row row-line no-gutters", rowOddEven)}
13
+ >
14
+ <div class="col col-xs-w36">
15
+ {this.props.label}
16
+ </div>
17
+ </div>
18
+ );
19
+ }
20
+ }
File without changes
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { DefaultHeader, DefaultLine, DefaultLineAction } from './';
3
+ import { DefaultHeader, DefaultLine, DefaultLineAction, DefaultLineBreak } from './';
4
4
  import { rbfIntl } from '../intl';
5
5
 
6
6
  export const DefaultList = props => {
7
- let counter = 1;
7
+ let counter = 1;
8
+ let previous = null;
8
9
  return (
9
10
  <div className="ui-inline-list-default-list">
10
11
  <div className="inline-list">
@@ -12,15 +13,38 @@ export const DefaultList = props => {
12
13
  {props.lines && (
13
14
  <div className="ui-inline-list-default-list-content">
14
15
  {Array.isArray(props.items) &&
15
- props.items.map(item => (
16
- <DefaultLine
17
- {...props}
18
- key={item.id}
19
- id={item.id}
20
- item={item}
21
- counter={props.oddEven ? counter++ : 0}
22
- />
23
- ))}
16
+ props.items.map(item => {
17
+ let myBreak = false;
18
+ if (props.breakpoint) {
19
+ myBreak = props.breakpoint(previous, item);
20
+ }
21
+ previous = item;
22
+ if (myBreak !== false) {
23
+ return (
24
+ <>
25
+ <DefaultLineBreak label={myBreak} counter={props.oddEven ? counter++ : 0}/>
26
+ <DefaultLine
27
+ {...props}
28
+ key={item.id}
29
+ id={item.id}
30
+ item={item}
31
+ counter={props.oddEven ? counter++ : 0}
32
+ />
33
+ </>
34
+ );
35
+ } else {
36
+ return (
37
+ <DefaultLine
38
+ {...props}
39
+ key={item.id}
40
+ id={item.id}
41
+ item={item}
42
+ counter={props.oddEven ? counter++ : 0}
43
+ />
44
+ )
45
+ }
46
+ })
47
+ }
24
48
  </div>
25
49
  )}
26
50
  {props.lines &&
@@ -47,6 +71,7 @@ export const DefaultList = props => {
47
71
  };
48
72
 
49
73
  DefaultList.propTypes = {
74
+ breakpoint: PropTypes.func,
50
75
  title: PropTypes.bool,
51
76
  lines: PropTypes.bool,
52
77
  oddEven: PropTypes.bool,
@@ -54,6 +79,7 @@ DefaultList.propTypes = {
54
79
  t: PropTypes.func,
55
80
  };
56
81
  DefaultList.defaultProps = {
82
+ breakpoint: false,
57
83
  title: true,
58
84
  lines: true,
59
85
  oddEven: true,
@@ -2,6 +2,7 @@ export * from './ColLink';
2
2
  export { default as DefaultLine } from './DefaultLine';
3
3
  export * from './InlineEmpty';
4
4
  export { default as MobileLineAction } from './MobileLineAction';
5
+ export { default as DefaultLineBreak } from './DefaultLineBreak';
5
6
  export { default as DefaultLineAction } from './DefaultLineAction';
6
7
  export { default as MobileLineText } from './MobileLineText';
7
8
  export * from './ResponsiveInlineList.jsx';
@@ -4,6 +4,7 @@
4
4
  @import './ResponsiveInlineList';
5
5
  @import './DefaultLine';
6
6
  @import './MobileLineAction';
7
+ @import './DefaultLineBreak';
7
8
  @import './DefaultLineAction';
8
9
  @import './MobileLineText';
9
10
  @import './ResponsiveInlineHeader';