@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.
Files changed (43) hide show
  1. package/build/umd/all.css +2 -2
  2. package/build/umd/all.js +1 -1
  3. package/build/umd/alphabox.js +1 -1
  4. package/build/umd/databox.js +1 -1
  5. package/build/umd/diagramme.js +1 -1
  6. package/build/umd/flowbox.js +1 -1
  7. package/build/umd/universe.js +1 -1
  8. package/package.json +4 -4
  9. package/src/components/AUAutoSuggestComponent.js +158 -158
  10. package/src/components/AUTabbedContentComponent.tsx +1 -1
  11. package/src/components/AUToastComponent.tsx +12 -13
  12. package/src/components/profile/AUProfileLoginComponent.tsx +26 -26
  13. package/src/layout-2016/components/alphabox/AlphaBoxComponent.js +143 -143
  14. package/src/layout-2016/components/alphabox/AlphaBoxContentComponent.js +136 -136
  15. package/src/layout-2016/components/common/AUCollapsibleComponent.js +152 -152
  16. package/src/layout-2016/components/common/AUSpinnerComponent.js +103 -103
  17. package/src/layout-2016/components/databox/DataBoxAlphabetComponent.js +144 -144
  18. package/src/layout-2016/components/databox/DataBoxAssociationComponent.js +122 -122
  19. package/src/layout-2016/components/databox/DataBoxButtonComponent.js +157 -157
  20. package/src/layout-2016/components/databox/DataBoxComponent.js +297 -297
  21. package/src/layout-2016/components/databox/DataBoxGroupingComponent.js +64 -64
  22. package/src/layout-2016/components/databox/DataBoxSearchResultComponent.js +36 -36
  23. package/src/layout-2016/components/databox/DataBoxStackedAssociationComponent.js +54 -54
  24. package/src/layout-2016/components/databox/DataBoxSuggestionComponent.js +39 -39
  25. package/src/layout-2016/components/diagramme/AUDiagrammeComponent.js +309 -309
  26. package/src/layout-2016/components/flowbox/FlowBoxComponent.js +126 -126
  27. package/src/layout-2016/components/flowbox/FlowBoxPhoneComponent.js +104 -104
  28. package/src/layout-2016/components/profile/AUProfileAvatar2016Component.js +103 -103
  29. package/src/layout-2016/components/universe/StaffTopComponent.js +363 -363
  30. package/src/layout-2016/components/universe/StudentTopComponent.js +137 -137
  31. package/src/layout-2016/components/universe/UniverseContainerComponent.js +65 -65
  32. package/src/layout-2016/lib/all.js +3 -3
  33. package/src/layout-2016/lib/au-alphabox.js +100 -100
  34. package/src/layout-2016/lib/au-databox.js +400 -400
  35. package/src/layout-2016/lib/au-diagramme.js +85 -85
  36. package/src/layout-2016/lib/au-flowbox.js +93 -93
  37. package/src/layout-2016/lib/universe.js +9 -9
  38. package/src/lib/helpers.ts +194 -194
  39. package/tsconfig.json +46 -46
  40. package/types/common/interfaces/gui.d.ts +2 -1
  41. package/types/common/interfaces/model.d.ts +29 -29
  42. package/types/common/props.d.ts +166 -165
  43. package/webpack.config.js +89 -89
@@ -1,64 +1,64 @@
1
- /* eslint-env browser */
2
- import React from 'react';
3
- import PropTypes from 'prop-types';
4
- import DataBoxStackedAssociationComponent from './DataBoxStackedAssociationComponent';
5
- import DataBoxAssociationComponent from './DataBoxAssociationComponent';
6
-
7
- const DataBoxGroupingComponent = (props) => {
8
- const {
9
- stacked,
10
- grouping,
11
- expand,
12
- rememberState,
13
- boxID,
14
- } = props;
15
- let renderAssociations;
16
- if (stacked && grouping.associations.length === 1) {
17
- // eslint-disable-next-line react/destructuring-assignment
18
- renderAssociations = props.grouping.associations.map(
19
- (a) => <DataBoxStackedAssociationComponent key={a.id} assoc={a} />,
20
- );
21
- } else {
22
- // eslint-disable-next-line react/destructuring-assignment
23
- renderAssociations = props.grouping.associations.map((a, i) => {
24
- const open = expand
25
- || grouping.associations.length === 1
26
- || (rememberState && sessionStorage.getItem(`box-${boxID}-group-${grouping.id}-index-${i}`));
27
- return (
28
- <DataBoxAssociationComponent
29
- key={a.id}
30
- open={open}
31
- boxID={boxID}
32
- rememberState={rememberState}
33
- grouping={grouping.id}
34
- index={i}
35
- assoc={a}
36
- />
37
- );
38
- });
39
- }
40
-
41
- return (
42
- <div id={`box-${boxID}-grouping-${grouping.id}`}>
43
- {renderAssociations}
44
- </div>
45
- );
46
- };
47
-
48
- DataBoxGroupingComponent.defaultProps = {
49
-
50
- };
51
-
52
- DataBoxGroupingComponent.propTypes = {
53
- boxID: PropTypes.number.isRequired,
54
- stacked: PropTypes.bool.isRequired,
55
- expand: PropTypes.bool.isRequired,
56
- rememberState: PropTypes.bool.isRequired,
57
- grouping: PropTypes.shape({
58
- id: PropTypes.number.isRequired,
59
- associations: PropTypes.arrayOf(PropTypes.shape({})).isRequired,
60
- }).isRequired,
61
- };
62
-
63
- DataBoxGroupingComponent.displayName = 'DataBoxGroupingComponent';
64
- export default DataBoxGroupingComponent;
1
+ /* eslint-env browser */
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import DataBoxStackedAssociationComponent from './DataBoxStackedAssociationComponent';
5
+ import DataBoxAssociationComponent from './DataBoxAssociationComponent';
6
+
7
+ const DataBoxGroupingComponent = (props) => {
8
+ const {
9
+ stacked,
10
+ grouping,
11
+ expand,
12
+ rememberState,
13
+ boxID,
14
+ } = props;
15
+ let renderAssociations;
16
+ if (stacked && grouping.associations.length === 1) {
17
+ // eslint-disable-next-line react/destructuring-assignment
18
+ renderAssociations = props.grouping.associations.map(
19
+ (a) => <DataBoxStackedAssociationComponent key={a.id} assoc={a} />,
20
+ );
21
+ } else {
22
+ // eslint-disable-next-line react/destructuring-assignment
23
+ renderAssociations = props.grouping.associations.map((a, i) => {
24
+ const open = expand
25
+ || grouping.associations.length === 1
26
+ || (rememberState && sessionStorage.getItem(`box-${boxID}-group-${grouping.id}-index-${i}`));
27
+ return (
28
+ <DataBoxAssociationComponent
29
+ key={a.id}
30
+ open={open}
31
+ boxID={boxID}
32
+ rememberState={rememberState}
33
+ grouping={grouping.id}
34
+ index={i}
35
+ assoc={a}
36
+ />
37
+ );
38
+ });
39
+ }
40
+
41
+ return (
42
+ <div id={`box-${boxID}-grouping-${grouping.id}`}>
43
+ {renderAssociations}
44
+ </div>
45
+ );
46
+ };
47
+
48
+ DataBoxGroupingComponent.defaultProps = {
49
+
50
+ };
51
+
52
+ DataBoxGroupingComponent.propTypes = {
53
+ boxID: PropTypes.number.isRequired,
54
+ stacked: PropTypes.bool.isRequired,
55
+ expand: PropTypes.bool.isRequired,
56
+ rememberState: PropTypes.bool.isRequired,
57
+ grouping: PropTypes.shape({
58
+ id: PropTypes.number.isRequired,
59
+ associations: PropTypes.arrayOf(PropTypes.shape({})).isRequired,
60
+ }).isRequired,
61
+ };
62
+
63
+ DataBoxGroupingComponent.displayName = 'DataBoxGroupingComponent';
64
+ export default DataBoxGroupingComponent;
@@ -1,36 +1,36 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { sortAlphaObj } from '../../../lib/helpers';
4
-
5
- const DataBoxSearchResultComponent = (props) => {
6
- const { items, searchValue } = props;
7
- const renderItems = items.sort(sortAlphaObj).filter(
8
- (x) => x.name.toLowerCase().indexOf(searchValue.toLowerCase()) > -1,
9
- ).map((item) => (
10
- <li key={item.id}>
11
- <a href={item.url}>
12
- {item.name}
13
- </a>
14
- </li>
15
- ));
16
-
17
- return (
18
- <div>
19
- <ul>
20
- {renderItems}
21
- </ul>
22
- </div>
23
- );
24
- };
25
-
26
- DataBoxSearchResultComponent.propTypes = {
27
- items: PropTypes.arrayOf(PropTypes.shape({
28
- id: PropTypes.number.isRequired,
29
- url: PropTypes.string.isRequired,
30
- name: PropTypes.string.isRequired,
31
- })).isRequired,
32
- searchValue: PropTypes.string.isRequired,
33
- };
34
-
35
- DataBoxSearchResultComponent.displayName = 'DataBoxSearchResultComponent';
36
- export default DataBoxSearchResultComponent;
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { sortAlphaObj } from '../../../lib/helpers';
4
+
5
+ const DataBoxSearchResultComponent = (props) => {
6
+ const { items, searchValue } = props;
7
+ const renderItems = items.sort(sortAlphaObj).filter(
8
+ (x) => x.name.toLowerCase().indexOf(searchValue.toLowerCase()) > -1,
9
+ ).map((item) => (
10
+ <li key={item.id}>
11
+ <a href={item.url}>
12
+ {item.name}
13
+ </a>
14
+ </li>
15
+ ));
16
+
17
+ return (
18
+ <div>
19
+ <ul>
20
+ {renderItems}
21
+ </ul>
22
+ </div>
23
+ );
24
+ };
25
+
26
+ DataBoxSearchResultComponent.propTypes = {
27
+ items: PropTypes.arrayOf(PropTypes.shape({
28
+ id: PropTypes.number.isRequired,
29
+ url: PropTypes.string.isRequired,
30
+ name: PropTypes.string.isRequired,
31
+ })).isRequired,
32
+ searchValue: PropTypes.string.isRequired,
33
+ };
34
+
35
+ DataBoxSearchResultComponent.displayName = 'DataBoxSearchResultComponent';
36
+ export default DataBoxSearchResultComponent;
@@ -1,54 +1,54 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { sortAlphaObj } from '../../../lib/helpers';
4
-
5
- const DataBoxStackedAssociationComponent = (props) => {
6
- const { assoc } = props;
7
- const renderItems = assoc.items.sort(sortAlphaObj).map((item) => {
8
- if (item.children.length > 0) {
9
- const renderChildren = item.children.sort(sortAlphaObj).map((c) => (
10
- <li key={c.id}>
11
- <a href={c.url}>
12
- {c.name}
13
- </a>
14
- </li>
15
- ));
16
-
17
- return (
18
- <li key={item.id}>
19
- <a href={item.url}>
20
- {item.name}
21
- </a>
22
- <ul>
23
- {renderChildren}
24
- </ul>
25
- </li>
26
- );
27
- }
28
-
29
- return (
30
- <li key={item.id}>
31
- <a href={item.url}>
32
- {item.name}
33
- </a>
34
- </li>
35
- );
36
- });
37
-
38
- return (
39
- <div>
40
- <ul>
41
- {renderItems}
42
- </ul>
43
- </div>
44
- );
45
- };
46
-
47
- DataBoxStackedAssociationComponent.propTypes = {
48
- assoc: PropTypes.shape({
49
- items: PropTypes.arrayOf(PropTypes.shape({})).isRequired,
50
- }).isRequired,
51
- };
52
-
53
- DataBoxStackedAssociationComponent.displayName = 'DataBoxStackedAssociationComponent';
54
- export default DataBoxStackedAssociationComponent;
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { sortAlphaObj } from '../../../lib/helpers';
4
+
5
+ const DataBoxStackedAssociationComponent = (props) => {
6
+ const { assoc } = props;
7
+ const renderItems = assoc.items.sort(sortAlphaObj).map((item) => {
8
+ if (item.children.length > 0) {
9
+ const renderChildren = item.children.sort(sortAlphaObj).map((c) => (
10
+ <li key={c.id}>
11
+ <a href={c.url}>
12
+ {c.name}
13
+ </a>
14
+ </li>
15
+ ));
16
+
17
+ return (
18
+ <li key={item.id}>
19
+ <a href={item.url}>
20
+ {item.name}
21
+ </a>
22
+ <ul>
23
+ {renderChildren}
24
+ </ul>
25
+ </li>
26
+ );
27
+ }
28
+
29
+ return (
30
+ <li key={item.id}>
31
+ <a href={item.url}>
32
+ {item.name}
33
+ </a>
34
+ </li>
35
+ );
36
+ });
37
+
38
+ return (
39
+ <div>
40
+ <ul>
41
+ {renderItems}
42
+ </ul>
43
+ </div>
44
+ );
45
+ };
46
+
47
+ DataBoxStackedAssociationComponent.propTypes = {
48
+ assoc: PropTypes.shape({
49
+ items: PropTypes.arrayOf(PropTypes.shape({})).isRequired,
50
+ }).isRequired,
51
+ };
52
+
53
+ DataBoxStackedAssociationComponent.displayName = 'DataBoxStackedAssociationComponent';
54
+ export default DataBoxStackedAssociationComponent;
@@ -1,39 +1,39 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
-
4
- class DataBoxSuggestionComponent extends React.Component {
5
- constructor(props) {
6
- super(props);
7
-
8
- this.state = {
9
- item: props.item,
10
- };
11
- }
12
-
13
- static getDerivedStateFromProps(nextProps, prevState) {
14
- if (nextProps.item.id !== prevState.item.id) {
15
- return {
16
- item: nextProps.item,
17
- };
18
- }
19
-
20
- return null;
21
- }
22
-
23
- render() {
24
- const { item } = this.state;
25
- return (
26
- <span>
27
- {item.name}
28
- </span>
29
- );
30
- }
31
- }
32
-
33
- DataBoxSuggestionComponent.propTypes = {
34
- item: PropTypes.shape({
35
- id: PropTypes.number.isRequired,
36
- }).isRequired,
37
- };
38
- DataBoxSuggestionComponent.displayName = 'DataBoxSuggestionComponent';
39
- export default DataBoxSuggestionComponent;
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ class DataBoxSuggestionComponent extends React.Component {
5
+ constructor(props) {
6
+ super(props);
7
+
8
+ this.state = {
9
+ item: props.item,
10
+ };
11
+ }
12
+
13
+ static getDerivedStateFromProps(nextProps, prevState) {
14
+ if (nextProps.item.id !== prevState.item.id) {
15
+ return {
16
+ item: nextProps.item,
17
+ };
18
+ }
19
+
20
+ return null;
21
+ }
22
+
23
+ render() {
24
+ const { item } = this.state;
25
+ return (
26
+ <span>
27
+ {item.name}
28
+ </span>
29
+ );
30
+ }
31
+ }
32
+
33
+ DataBoxSuggestionComponent.propTypes = {
34
+ item: PropTypes.shape({
35
+ id: PropTypes.number.isRequired,
36
+ }).isRequired,
37
+ };
38
+ DataBoxSuggestionComponent.displayName = 'DataBoxSuggestionComponent';
39
+ export default DataBoxSuggestionComponent;