@aarhus-university/au-lib-react-components 10.1.0 → 10.2.2
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/build/umd/all.css +2 -2
- package/build/umd/all.js +1 -1
- package/build/umd/alphabox.js +1 -1
- package/build/umd/databox.js +1 -1
- package/build/umd/diagramme.js +1 -1
- package/build/umd/flowbox.js +1 -1
- package/build/umd/universe.js +1 -1
- package/package.json +4 -4
- package/src/components/AUAutoSuggestComponent.js +158 -158
- package/src/components/AUTabbedContentComponent.tsx +1 -1
- package/src/components/AUToastComponent.tsx +12 -13
- package/src/components/profile/AUProfileLoginComponent.tsx +26 -26
- package/src/layout-2016/components/alphabox/AlphaBoxComponent.js +143 -143
- package/src/layout-2016/components/alphabox/AlphaBoxContentComponent.js +136 -136
- package/src/layout-2016/components/common/AUCollapsibleComponent.js +152 -152
- package/src/layout-2016/components/common/AUSpinnerComponent.js +103 -103
- package/src/layout-2016/components/databox/DataBoxAlphabetComponent.js +144 -144
- package/src/layout-2016/components/databox/DataBoxAssociationComponent.js +122 -122
- package/src/layout-2016/components/databox/DataBoxButtonComponent.js +157 -157
- package/src/layout-2016/components/databox/DataBoxComponent.js +297 -297
- package/src/layout-2016/components/databox/DataBoxGroupingComponent.js +64 -64
- package/src/layout-2016/components/databox/DataBoxSearchResultComponent.js +36 -36
- package/src/layout-2016/components/databox/DataBoxStackedAssociationComponent.js +54 -54
- package/src/layout-2016/components/databox/DataBoxSuggestionComponent.js +39 -39
- package/src/layout-2016/components/diagramme/AUDiagrammeComponent.js +309 -309
- package/src/layout-2016/components/flowbox/FlowBoxComponent.js +126 -126
- package/src/layout-2016/components/flowbox/FlowBoxPhoneComponent.js +104 -104
- package/src/layout-2016/components/profile/AUProfileAvatar2016Component.js +103 -103
- package/src/layout-2016/components/universe/StaffTopComponent.js +363 -363
- package/src/layout-2016/components/universe/StudentTopComponent.js +137 -137
- package/src/layout-2016/components/universe/UniverseContainerComponent.js +65 -65
- package/src/layout-2016/lib/all.js +3 -3
- package/src/layout-2016/lib/au-alphabox.js +100 -100
- package/src/layout-2016/lib/au-databox.js +400 -400
- package/src/layout-2016/lib/au-diagramme.js +85 -85
- package/src/layout-2016/lib/au-flowbox.js +93 -93
- package/src/layout-2016/lib/universe.js +9 -9
- package/src/lib/helpers.ts +194 -194
- package/tsconfig.json +46 -46
- package/types/common/interfaces/gui.d.ts +2 -1
- package/types/common/interfaces/model.d.ts +29 -29
- package/types/common/props.d.ts +166 -165
- package/webpack.config.js +89 -89
|
@@ -1,144 +1,144 @@
|
|
|
1
|
-
/* eslint-env browser */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { sortAlphaObj } from '../../../lib/helpers';
|
|
5
|
-
|
|
6
|
-
class DataBoxAlphabetComponent extends React.Component {
|
|
7
|
-
constructor(props) {
|
|
8
|
-
super(props);
|
|
9
|
-
this.letters = ['...', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'æ', 'ø', 'å'];
|
|
10
|
-
this.state = {
|
|
11
|
-
letterIndex: this.letters.indexOf(props.initLetter.toLowerCase()),
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
render() {
|
|
16
|
-
const { letterIndex } = this.state;
|
|
17
|
-
const { linkColor, rememberState, boxID } = this.props;
|
|
18
|
-
const renderLetters = this.letters.map((l, i) => {
|
|
19
|
-
const { items } = this.props;
|
|
20
|
-
const available = i === 0
|
|
21
|
-
|| items.filter((x) => x.name.toLowerCase().indexOf(l) === 0).length > 0;
|
|
22
|
-
|
|
23
|
-
let classNames = '';
|
|
24
|
-
if (available) {
|
|
25
|
-
classNames += 'available';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (i === letterIndex) {
|
|
29
|
-
classNames += ' active';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
let style = {};
|
|
33
|
-
if (available) {
|
|
34
|
-
if (letterIndex === i) {
|
|
35
|
-
style = { backgroundColor: '#fff', color: linkColor };
|
|
36
|
-
} else {
|
|
37
|
-
style = { backgroundColor: linkColor };
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<li
|
|
43
|
-
key={l}
|
|
44
|
-
className={classNames}
|
|
45
|
-
>
|
|
46
|
-
<button
|
|
47
|
-
type="button"
|
|
48
|
-
style={style}
|
|
49
|
-
onClick={() => {
|
|
50
|
-
if (available) {
|
|
51
|
-
this.setState({
|
|
52
|
-
letterIndex: i,
|
|
53
|
-
});
|
|
54
|
-
if (rememberState) {
|
|
55
|
-
sessionStorage.setItem(`box-alphabet-${boxID}`, this.letters[i]);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}}
|
|
59
|
-
>
|
|
60
|
-
{l}
|
|
61
|
-
</button>
|
|
62
|
-
</li>
|
|
63
|
-
);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
let { items } = this.props;
|
|
67
|
-
if (letterIndex !== 0) {
|
|
68
|
-
items = items.filter((x) => x.name.toLowerCase().indexOf(this.letters[letterIndex]) === 0);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const renderItems = items.sort(sortAlphaObj).map((item) => {
|
|
72
|
-
const renderChildren = item.children.map((c) => (
|
|
73
|
-
<li key={c.id}>
|
|
74
|
-
<a href={c.url}>
|
|
75
|
-
{c.name}
|
|
76
|
-
</a>
|
|
77
|
-
</li>
|
|
78
|
-
));
|
|
79
|
-
|
|
80
|
-
if (item.children.length > 0) {
|
|
81
|
-
return (
|
|
82
|
-
<li key={item.id}>
|
|
83
|
-
{(() => {
|
|
84
|
-
if (!item.url) {
|
|
85
|
-
return (
|
|
86
|
-
<span>
|
|
87
|
-
{item.name}
|
|
88
|
-
</span>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return (
|
|
93
|
-
<a href={item.url}>
|
|
94
|
-
{item.name}
|
|
95
|
-
</a>
|
|
96
|
-
);
|
|
97
|
-
})()}
|
|
98
|
-
<ul>
|
|
99
|
-
{renderChildren}
|
|
100
|
-
</ul>
|
|
101
|
-
</li>
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (!item.parent) {
|
|
106
|
-
return (
|
|
107
|
-
<li key={item.id}>
|
|
108
|
-
<a href={item.url}>
|
|
109
|
-
{item.name}
|
|
110
|
-
</a>
|
|
111
|
-
</li>
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return null;
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
return (
|
|
119
|
-
<div>
|
|
120
|
-
<ul className="letters">
|
|
121
|
-
{renderLetters}
|
|
122
|
-
</ul>
|
|
123
|
-
<ul>
|
|
124
|
-
{renderItems}
|
|
125
|
-
</ul>
|
|
126
|
-
</div>
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
DataBoxAlphabetComponent.defaultProps = {
|
|
132
|
-
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
DataBoxAlphabetComponent.propTypes = {
|
|
136
|
-
initLetter: PropTypes.string.isRequired,
|
|
137
|
-
items: PropTypes.arrayOf(PropTypes.shape({})).isRequired,
|
|
138
|
-
linkColor: PropTypes.string.isRequired,
|
|
139
|
-
rememberState: PropTypes.bool.isRequired,
|
|
140
|
-
boxID: PropTypes.number.isRequired,
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
DataBoxAlphabetComponent.displayName = 'DataBoxAlphabetComponent';
|
|
144
|
-
export default DataBoxAlphabetComponent;
|
|
1
|
+
/* eslint-env browser */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { sortAlphaObj } from '../../../lib/helpers';
|
|
5
|
+
|
|
6
|
+
class DataBoxAlphabetComponent extends React.Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
this.letters = ['...', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'æ', 'ø', 'å'];
|
|
10
|
+
this.state = {
|
|
11
|
+
letterIndex: this.letters.indexOf(props.initLetter.toLowerCase()),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
render() {
|
|
16
|
+
const { letterIndex } = this.state;
|
|
17
|
+
const { linkColor, rememberState, boxID } = this.props;
|
|
18
|
+
const renderLetters = this.letters.map((l, i) => {
|
|
19
|
+
const { items } = this.props;
|
|
20
|
+
const available = i === 0
|
|
21
|
+
|| items.filter((x) => x.name.toLowerCase().indexOf(l) === 0).length > 0;
|
|
22
|
+
|
|
23
|
+
let classNames = '';
|
|
24
|
+
if (available) {
|
|
25
|
+
classNames += 'available';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (i === letterIndex) {
|
|
29
|
+
classNames += ' active';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let style = {};
|
|
33
|
+
if (available) {
|
|
34
|
+
if (letterIndex === i) {
|
|
35
|
+
style = { backgroundColor: '#fff', color: linkColor };
|
|
36
|
+
} else {
|
|
37
|
+
style = { backgroundColor: linkColor };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<li
|
|
43
|
+
key={l}
|
|
44
|
+
className={classNames}
|
|
45
|
+
>
|
|
46
|
+
<button
|
|
47
|
+
type="button"
|
|
48
|
+
style={style}
|
|
49
|
+
onClick={() => {
|
|
50
|
+
if (available) {
|
|
51
|
+
this.setState({
|
|
52
|
+
letterIndex: i,
|
|
53
|
+
});
|
|
54
|
+
if (rememberState) {
|
|
55
|
+
sessionStorage.setItem(`box-alphabet-${boxID}`, this.letters[i]);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}}
|
|
59
|
+
>
|
|
60
|
+
{l}
|
|
61
|
+
</button>
|
|
62
|
+
</li>
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
let { items } = this.props;
|
|
67
|
+
if (letterIndex !== 0) {
|
|
68
|
+
items = items.filter((x) => x.name.toLowerCase().indexOf(this.letters[letterIndex]) === 0);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const renderItems = items.sort(sortAlphaObj).map((item) => {
|
|
72
|
+
const renderChildren = item.children.map((c) => (
|
|
73
|
+
<li key={c.id}>
|
|
74
|
+
<a href={c.url}>
|
|
75
|
+
{c.name}
|
|
76
|
+
</a>
|
|
77
|
+
</li>
|
|
78
|
+
));
|
|
79
|
+
|
|
80
|
+
if (item.children.length > 0) {
|
|
81
|
+
return (
|
|
82
|
+
<li key={item.id}>
|
|
83
|
+
{(() => {
|
|
84
|
+
if (!item.url) {
|
|
85
|
+
return (
|
|
86
|
+
<span>
|
|
87
|
+
{item.name}
|
|
88
|
+
</span>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<a href={item.url}>
|
|
94
|
+
{item.name}
|
|
95
|
+
</a>
|
|
96
|
+
);
|
|
97
|
+
})()}
|
|
98
|
+
<ul>
|
|
99
|
+
{renderChildren}
|
|
100
|
+
</ul>
|
|
101
|
+
</li>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (!item.parent) {
|
|
106
|
+
return (
|
|
107
|
+
<li key={item.id}>
|
|
108
|
+
<a href={item.url}>
|
|
109
|
+
{item.name}
|
|
110
|
+
</a>
|
|
111
|
+
</li>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return null;
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<div>
|
|
120
|
+
<ul className="letters">
|
|
121
|
+
{renderLetters}
|
|
122
|
+
</ul>
|
|
123
|
+
<ul>
|
|
124
|
+
{renderItems}
|
|
125
|
+
</ul>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
DataBoxAlphabetComponent.defaultProps = {
|
|
132
|
+
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
DataBoxAlphabetComponent.propTypes = {
|
|
136
|
+
initLetter: PropTypes.string.isRequired,
|
|
137
|
+
items: PropTypes.arrayOf(PropTypes.shape({})).isRequired,
|
|
138
|
+
linkColor: PropTypes.string.isRequired,
|
|
139
|
+
rememberState: PropTypes.bool.isRequired,
|
|
140
|
+
boxID: PropTypes.number.isRequired,
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
DataBoxAlphabetComponent.displayName = 'DataBoxAlphabetComponent';
|
|
144
|
+
export default DataBoxAlphabetComponent;
|
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
/* eslint-env browser */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { sortAlphaObj } from '../../../lib/helpers';
|
|
5
|
-
import AUCollapsibleComponent from '../common/AUCollapsibleComponent';
|
|
6
|
-
|
|
7
|
-
class DataBoxAssociationComponent extends React.Component {
|
|
8
|
-
constructor(props) {
|
|
9
|
-
super(props);
|
|
10
|
-
|
|
11
|
-
this.state = {
|
|
12
|
-
open: props.open,
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
this.handleClick = this.handleClick.bind(this);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
handleClick() {
|
|
19
|
-
const {
|
|
20
|
-
rememberState,
|
|
21
|
-
boxID,
|
|
22
|
-
grouping,
|
|
23
|
-
index,
|
|
24
|
-
} = this.props;
|
|
25
|
-
const { open } = this.state;
|
|
26
|
-
if (rememberState) {
|
|
27
|
-
if (open) {
|
|
28
|
-
sessionStorage.removeItem(`box-${boxID}-group-${grouping}-index-${index}`);
|
|
29
|
-
} else {
|
|
30
|
-
sessionStorage.setItem(`box-${boxID}-group-${grouping}-index-${index}`, true);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
this.setState((prevState) => ({
|
|
34
|
-
open: !prevState.open,
|
|
35
|
-
}));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
render() {
|
|
39
|
-
const { open } = this.state;
|
|
40
|
-
const { assoc } = this.props;
|
|
41
|
-
const { items } = assoc;
|
|
42
|
-
const renderItems = items.sort(sortAlphaObj).map((item) => {
|
|
43
|
-
if (item.children.length > 0) {
|
|
44
|
-
const renderChildren = item.children.sort(sortAlphaObj).map((c) => (
|
|
45
|
-
<li key={c.id}>
|
|
46
|
-
<a href={c.url}>
|
|
47
|
-
{c.name}
|
|
48
|
-
</a>
|
|
49
|
-
</li>
|
|
50
|
-
));
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<li key={item.id}>
|
|
54
|
-
{(() => {
|
|
55
|
-
if (!item.url) {
|
|
56
|
-
return (
|
|
57
|
-
<span>
|
|
58
|
-
{item.name}
|
|
59
|
-
</span>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
return (
|
|
63
|
-
<a href={item.url}>
|
|
64
|
-
{item.name}
|
|
65
|
-
</a>
|
|
66
|
-
);
|
|
67
|
-
})()}
|
|
68
|
-
<ul>
|
|
69
|
-
{renderChildren}
|
|
70
|
-
</ul>
|
|
71
|
-
</li>
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return (
|
|
76
|
-
<li key={item.id}>
|
|
77
|
-
<a href={item.url}>
|
|
78
|
-
{item.name}
|
|
79
|
-
</a>
|
|
80
|
-
</li>
|
|
81
|
-
);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
const content = (
|
|
85
|
-
<ul>
|
|
86
|
-
{renderItems}
|
|
87
|
-
</ul>
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
return (
|
|
91
|
-
<AUCollapsibleComponent
|
|
92
|
-
key={open}
|
|
93
|
-
collapsed={!open}
|
|
94
|
-
level={3}
|
|
95
|
-
header={assoc.name}
|
|
96
|
-
content={content}
|
|
97
|
-
onClick={this.handleClick}
|
|
98
|
-
/>
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
DataBoxAssociationComponent.defaultProps = {
|
|
104
|
-
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
DataBoxAssociationComponent.propTypes = {
|
|
108
|
-
boxID: PropTypes.number.isRequired,
|
|
109
|
-
grouping: PropTypes.number.isRequired,
|
|
110
|
-
assoc: PropTypes.shape({
|
|
111
|
-
name: PropTypes.string.isRequired,
|
|
112
|
-
items: PropTypes.arrayOf(PropTypes.shape({
|
|
113
|
-
|
|
114
|
-
})).isRequired,
|
|
115
|
-
}).isRequired,
|
|
116
|
-
index: PropTypes.number.isRequired,
|
|
117
|
-
open: PropTypes.bool.isRequired,
|
|
118
|
-
rememberState: PropTypes.bool.isRequired,
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
DataBoxAssociationComponent.displayName = 'DataBoxAssociationComponent';
|
|
122
|
-
export default DataBoxAssociationComponent;
|
|
1
|
+
/* eslint-env browser */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { sortAlphaObj } from '../../../lib/helpers';
|
|
5
|
+
import AUCollapsibleComponent from '../common/AUCollapsibleComponent';
|
|
6
|
+
|
|
7
|
+
class DataBoxAssociationComponent extends React.Component {
|
|
8
|
+
constructor(props) {
|
|
9
|
+
super(props);
|
|
10
|
+
|
|
11
|
+
this.state = {
|
|
12
|
+
open: props.open,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
this.handleClick = this.handleClick.bind(this);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
handleClick() {
|
|
19
|
+
const {
|
|
20
|
+
rememberState,
|
|
21
|
+
boxID,
|
|
22
|
+
grouping,
|
|
23
|
+
index,
|
|
24
|
+
} = this.props;
|
|
25
|
+
const { open } = this.state;
|
|
26
|
+
if (rememberState) {
|
|
27
|
+
if (open) {
|
|
28
|
+
sessionStorage.removeItem(`box-${boxID}-group-${grouping}-index-${index}`);
|
|
29
|
+
} else {
|
|
30
|
+
sessionStorage.setItem(`box-${boxID}-group-${grouping}-index-${index}`, true);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
this.setState((prevState) => ({
|
|
34
|
+
open: !prevState.open,
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
render() {
|
|
39
|
+
const { open } = this.state;
|
|
40
|
+
const { assoc } = this.props;
|
|
41
|
+
const { items } = assoc;
|
|
42
|
+
const renderItems = items.sort(sortAlphaObj).map((item) => {
|
|
43
|
+
if (item.children.length > 0) {
|
|
44
|
+
const renderChildren = item.children.sort(sortAlphaObj).map((c) => (
|
|
45
|
+
<li key={c.id}>
|
|
46
|
+
<a href={c.url}>
|
|
47
|
+
{c.name}
|
|
48
|
+
</a>
|
|
49
|
+
</li>
|
|
50
|
+
));
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<li key={item.id}>
|
|
54
|
+
{(() => {
|
|
55
|
+
if (!item.url) {
|
|
56
|
+
return (
|
|
57
|
+
<span>
|
|
58
|
+
{item.name}
|
|
59
|
+
</span>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
return (
|
|
63
|
+
<a href={item.url}>
|
|
64
|
+
{item.name}
|
|
65
|
+
</a>
|
|
66
|
+
);
|
|
67
|
+
})()}
|
|
68
|
+
<ul>
|
|
69
|
+
{renderChildren}
|
|
70
|
+
</ul>
|
|
71
|
+
</li>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<li key={item.id}>
|
|
77
|
+
<a href={item.url}>
|
|
78
|
+
{item.name}
|
|
79
|
+
</a>
|
|
80
|
+
</li>
|
|
81
|
+
);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const content = (
|
|
85
|
+
<ul>
|
|
86
|
+
{renderItems}
|
|
87
|
+
</ul>
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<AUCollapsibleComponent
|
|
92
|
+
key={open}
|
|
93
|
+
collapsed={!open}
|
|
94
|
+
level={3}
|
|
95
|
+
header={assoc.name}
|
|
96
|
+
content={content}
|
|
97
|
+
onClick={this.handleClick}
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
DataBoxAssociationComponent.defaultProps = {
|
|
104
|
+
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
DataBoxAssociationComponent.propTypes = {
|
|
108
|
+
boxID: PropTypes.number.isRequired,
|
|
109
|
+
grouping: PropTypes.number.isRequired,
|
|
110
|
+
assoc: PropTypes.shape({
|
|
111
|
+
name: PropTypes.string.isRequired,
|
|
112
|
+
items: PropTypes.arrayOf(PropTypes.shape({
|
|
113
|
+
|
|
114
|
+
})).isRequired,
|
|
115
|
+
}).isRequired,
|
|
116
|
+
index: PropTypes.number.isRequired,
|
|
117
|
+
open: PropTypes.bool.isRequired,
|
|
118
|
+
rememberState: PropTypes.bool.isRequired,
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
DataBoxAssociationComponent.displayName = 'DataBoxAssociationComponent';
|
|
122
|
+
export default DataBoxAssociationComponent;
|