@aarhus-university/au-lib-react-components 10.0.2 → 10.2.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/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 +6 -6
- package/src/components/AUAutoSuggestComponent.js +158 -158
- package/src/components/AUSpinnerComponent.tsx +91 -67
- package/src/components/AUToastComponent.tsx +11 -12
- 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 +1 -0
- package/types/common/interfaces/model.d.ts +29 -29
- package/types/common/props.d.ts +166 -165
- package/webpack.config.js +89 -89
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
/* eslint no-prototype-builtins: 0 */
|
|
2
|
-
/* eslint no-restricted-syntax: 0 */
|
|
3
|
-
/* eslint no-unused-vars: 0 */
|
|
4
|
-
/* eslint-env browser */
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import ReactDOM from 'react-dom';
|
|
7
|
-
import AUDiagrammeComponent from '../components/diagramme/AUDiagrammeComponent';
|
|
8
|
-
|
|
9
|
-
const defaultOptions = {
|
|
10
|
-
config: {
|
|
11
|
-
container: '.au_edutable_eddi_container',
|
|
12
|
-
courseID: 0,
|
|
13
|
-
track: 0,
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
class AUDiagramme {
|
|
18
|
-
constructor(lang, tables) {
|
|
19
|
-
this.tables = tables;
|
|
20
|
-
this.lang = lang;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
static mergeOptions(_table) {
|
|
24
|
-
const table = _table;
|
|
25
|
-
if (!table.hasOwnProperty('config')) {
|
|
26
|
-
table.config = {};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
for (const conf in defaultOptions.config) {
|
|
30
|
-
if (!table.config.hasOwnProperty(conf)) {
|
|
31
|
-
table.config[conf] = defaultOptions.config[conf];
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
init() {
|
|
37
|
-
const qsCourses = AU.helpers.getQuerystring('coursesprint');
|
|
38
|
-
if (qsCourses !== '') {
|
|
39
|
-
const coursesSplit = qsCourses.split(',');
|
|
40
|
-
for (let j = 0; j < coursesSplit.length; j += 1) {
|
|
41
|
-
const trackSplit = coursesSplit[j].split('|');
|
|
42
|
-
if (trackSplit.length > 1) {
|
|
43
|
-
this.tables.push({
|
|
44
|
-
config: {
|
|
45
|
-
container: `#print_course_${j}`,
|
|
46
|
-
courseID: parseInt(trackSplit[0], 10),
|
|
47
|
-
track: parseInt(trackSplit[1], 10),
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
} else {
|
|
51
|
-
this.tables.push({
|
|
52
|
-
config: {
|
|
53
|
-
container: `#print_course_${j}`,
|
|
54
|
-
courseID: parseInt(trackSplit[0], 10),
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
ReactDOM.render(<div id={`print_course_${j}`} />, document.querySelector('body'));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
for (let i = 0; i < this.tables.length; i += 1) {
|
|
62
|
-
const table = this.tables[i];
|
|
63
|
-
table.id = i;
|
|
64
|
-
AUDiagramme.mergeOptions(table);
|
|
65
|
-
const url = `https://eddiprod.au.dk/EDDI/webservices/StudieoversigtService2.cfc?method=getLinjeListByDokordningId&tjekForVisningIstudieDiagram=true&allowOrigin=true&dokordningId=${table.config.courseID}`;
|
|
66
|
-
fetch(url).then((promise) => promise.json()).then((data) => {
|
|
67
|
-
const mountNode = document.querySelector(table.config.container);
|
|
68
|
-
if (mountNode) {
|
|
69
|
-
ReactDOM.render(
|
|
70
|
-
<AUDiagrammeComponent
|
|
71
|
-
lang={this.lang}
|
|
72
|
-
response={data}
|
|
73
|
-
course={table.config.courseID}
|
|
74
|
-
track={table.config.track}
|
|
75
|
-
print={qsCourses !== ''}
|
|
76
|
-
/>,
|
|
77
|
-
mountNode,
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
window.AUDiagramme = AUDiagramme;
|
|
1
|
+
/* eslint no-prototype-builtins: 0 */
|
|
2
|
+
/* eslint no-restricted-syntax: 0 */
|
|
3
|
+
/* eslint no-unused-vars: 0 */
|
|
4
|
+
/* eslint-env browser */
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import ReactDOM from 'react-dom';
|
|
7
|
+
import AUDiagrammeComponent from '../components/diagramme/AUDiagrammeComponent';
|
|
8
|
+
|
|
9
|
+
const defaultOptions = {
|
|
10
|
+
config: {
|
|
11
|
+
container: '.au_edutable_eddi_container',
|
|
12
|
+
courseID: 0,
|
|
13
|
+
track: 0,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
class AUDiagramme {
|
|
18
|
+
constructor(lang, tables) {
|
|
19
|
+
this.tables = tables;
|
|
20
|
+
this.lang = lang;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static mergeOptions(_table) {
|
|
24
|
+
const table = _table;
|
|
25
|
+
if (!table.hasOwnProperty('config')) {
|
|
26
|
+
table.config = {};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
for (const conf in defaultOptions.config) {
|
|
30
|
+
if (!table.config.hasOwnProperty(conf)) {
|
|
31
|
+
table.config[conf] = defaultOptions.config[conf];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
init() {
|
|
37
|
+
const qsCourses = AU.helpers.getQuerystring('coursesprint');
|
|
38
|
+
if (qsCourses !== '') {
|
|
39
|
+
const coursesSplit = qsCourses.split(',');
|
|
40
|
+
for (let j = 0; j < coursesSplit.length; j += 1) {
|
|
41
|
+
const trackSplit = coursesSplit[j].split('|');
|
|
42
|
+
if (trackSplit.length > 1) {
|
|
43
|
+
this.tables.push({
|
|
44
|
+
config: {
|
|
45
|
+
container: `#print_course_${j}`,
|
|
46
|
+
courseID: parseInt(trackSplit[0], 10),
|
|
47
|
+
track: parseInt(trackSplit[1], 10),
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
} else {
|
|
51
|
+
this.tables.push({
|
|
52
|
+
config: {
|
|
53
|
+
container: `#print_course_${j}`,
|
|
54
|
+
courseID: parseInt(trackSplit[0], 10),
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
ReactDOM.render(<div id={`print_course_${j}`} />, document.querySelector('body'));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
for (let i = 0; i < this.tables.length; i += 1) {
|
|
62
|
+
const table = this.tables[i];
|
|
63
|
+
table.id = i;
|
|
64
|
+
AUDiagramme.mergeOptions(table);
|
|
65
|
+
const url = `https://eddiprod.au.dk/EDDI/webservices/StudieoversigtService2.cfc?method=getLinjeListByDokordningId&tjekForVisningIstudieDiagram=true&allowOrigin=true&dokordningId=${table.config.courseID}`;
|
|
66
|
+
fetch(url).then((promise) => promise.json()).then((data) => {
|
|
67
|
+
const mountNode = document.querySelector(table.config.container);
|
|
68
|
+
if (mountNode) {
|
|
69
|
+
ReactDOM.render(
|
|
70
|
+
<AUDiagrammeComponent
|
|
71
|
+
lang={this.lang}
|
|
72
|
+
response={data}
|
|
73
|
+
course={table.config.courseID}
|
|
74
|
+
track={table.config.track}
|
|
75
|
+
print={qsCourses !== ''}
|
|
76
|
+
/>,
|
|
77
|
+
mountNode,
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
window.AUDiagramme = AUDiagramme;
|
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
/* eslint-env browser */
|
|
2
|
-
/* eslint no-prototype-builtins: 0 */
|
|
3
|
-
/* eslint no-restricted-syntax: 0 */
|
|
4
|
-
/* eslint no-unused-vars: 0 */
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import ReactDOM from 'react-dom';
|
|
7
|
-
import FlowBoxComponent from '../components/flowbox/FlowBoxComponent';
|
|
8
|
-
|
|
9
|
-
const defaultOptions = {
|
|
10
|
-
config: {
|
|
11
|
-
container: '.au_flowbox',
|
|
12
|
-
tracking: '/virtual/flowbox/',
|
|
13
|
-
render: 'ul',
|
|
14
|
-
},
|
|
15
|
-
data: {
|
|
16
|
-
mode: 'list',
|
|
17
|
-
source: '.au_flowbox_list',
|
|
18
|
-
headline: 'Overskrift',
|
|
19
|
-
prepend: '',
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
class AUFlowbox {
|
|
24
|
-
constructor(lang, boxes) {
|
|
25
|
-
this.boxes = boxes;
|
|
26
|
-
this.lang = lang;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static mergeOptions(_box) {
|
|
30
|
-
const box = _box;
|
|
31
|
-
if (!box.hasOwnProperty('config')) {
|
|
32
|
-
box.config = {};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
for (const conf in defaultOptions.config) {
|
|
36
|
-
if (!box.config.hasOwnProperty(conf)) {
|
|
37
|
-
box.config[conf] = defaultOptions.config[conf];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (!box.hasOwnProperty('data')) {
|
|
42
|
-
box.data = {};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
for (const data in defaultOptions.data) {
|
|
46
|
-
if (!box.data.hasOwnProperty(data)) {
|
|
47
|
-
box.data[data] = defaultOptions.data[data];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
static parse(box) {
|
|
53
|
-
const parseList = (data, elements, selector) => {
|
|
54
|
-
elements.forEach((e) => {
|
|
55
|
-
const subElements = e.querySelectorAll(selector);
|
|
56
|
-
subElements.forEach((s) => {
|
|
57
|
-
const obj = {
|
|
58
|
-
name: s.innerHTML,
|
|
59
|
-
children: [],
|
|
60
|
-
parent: data,
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
data.children.push(obj);
|
|
64
|
-
const parent = s.parentElement;
|
|
65
|
-
const children = parent.querySelectorAll(':scope > ul');
|
|
66
|
-
if (children.length > 0) {
|
|
67
|
-
parseList(obj, children, ':scope > li > p'); // Det her skal vi altid gøre
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
parseList(box.item, document.querySelectorAll(box.data.source), window.flowboxScopeSelector || ':scope > li > p'); // Her kan selectoren være en anden, hvis der fx er global content i spil, så der kommer en <div> ind...
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
init() {
|
|
77
|
-
for (let i = 0; i < this.boxes.length; i += 1) {
|
|
78
|
-
const box = this.boxes[i];
|
|
79
|
-
AUFlowbox.mergeOptions(box);
|
|
80
|
-
box.id = i;
|
|
81
|
-
box.item = {
|
|
82
|
-
name: box.data.headline,
|
|
83
|
-
children: [],
|
|
84
|
-
parent: null,
|
|
85
|
-
};
|
|
86
|
-
AUFlowbox.parse(box);
|
|
87
|
-
const mountNode = document.querySelector(box.config.container);
|
|
88
|
-
ReactDOM.render(<FlowBoxComponent box={box} lang={this.lang} />, mountNode);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
window.AUFlowbox = AUFlowbox;
|
|
1
|
+
/* eslint-env browser */
|
|
2
|
+
/* eslint no-prototype-builtins: 0 */
|
|
3
|
+
/* eslint no-restricted-syntax: 0 */
|
|
4
|
+
/* eslint no-unused-vars: 0 */
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import ReactDOM from 'react-dom';
|
|
7
|
+
import FlowBoxComponent from '../components/flowbox/FlowBoxComponent';
|
|
8
|
+
|
|
9
|
+
const defaultOptions = {
|
|
10
|
+
config: {
|
|
11
|
+
container: '.au_flowbox',
|
|
12
|
+
tracking: '/virtual/flowbox/',
|
|
13
|
+
render: 'ul',
|
|
14
|
+
},
|
|
15
|
+
data: {
|
|
16
|
+
mode: 'list',
|
|
17
|
+
source: '.au_flowbox_list',
|
|
18
|
+
headline: 'Overskrift',
|
|
19
|
+
prepend: '',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
class AUFlowbox {
|
|
24
|
+
constructor(lang, boxes) {
|
|
25
|
+
this.boxes = boxes;
|
|
26
|
+
this.lang = lang;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static mergeOptions(_box) {
|
|
30
|
+
const box = _box;
|
|
31
|
+
if (!box.hasOwnProperty('config')) {
|
|
32
|
+
box.config = {};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
for (const conf in defaultOptions.config) {
|
|
36
|
+
if (!box.config.hasOwnProperty(conf)) {
|
|
37
|
+
box.config[conf] = defaultOptions.config[conf];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (!box.hasOwnProperty('data')) {
|
|
42
|
+
box.data = {};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
for (const data in defaultOptions.data) {
|
|
46
|
+
if (!box.data.hasOwnProperty(data)) {
|
|
47
|
+
box.data[data] = defaultOptions.data[data];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static parse(box) {
|
|
53
|
+
const parseList = (data, elements, selector) => {
|
|
54
|
+
elements.forEach((e) => {
|
|
55
|
+
const subElements = e.querySelectorAll(selector);
|
|
56
|
+
subElements.forEach((s) => {
|
|
57
|
+
const obj = {
|
|
58
|
+
name: s.innerHTML,
|
|
59
|
+
children: [],
|
|
60
|
+
parent: data,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
data.children.push(obj);
|
|
64
|
+
const parent = s.parentElement;
|
|
65
|
+
const children = parent.querySelectorAll(':scope > ul');
|
|
66
|
+
if (children.length > 0) {
|
|
67
|
+
parseList(obj, children, ':scope > li > p'); // Det her skal vi altid gøre
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
parseList(box.item, document.querySelectorAll(box.data.source), window.flowboxScopeSelector || ':scope > li > p'); // Her kan selectoren være en anden, hvis der fx er global content i spil, så der kommer en <div> ind...
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
init() {
|
|
77
|
+
for (let i = 0; i < this.boxes.length; i += 1) {
|
|
78
|
+
const box = this.boxes[i];
|
|
79
|
+
AUFlowbox.mergeOptions(box);
|
|
80
|
+
box.id = i;
|
|
81
|
+
box.item = {
|
|
82
|
+
name: box.data.headline,
|
|
83
|
+
children: [],
|
|
84
|
+
parent: null,
|
|
85
|
+
};
|
|
86
|
+
AUFlowbox.parse(box);
|
|
87
|
+
const mountNode = document.querySelector(box.config.container);
|
|
88
|
+
ReactDOM.render(<FlowBoxComponent box={box} lang={this.lang} />, mountNode);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
window.AUFlowbox = AUFlowbox;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* eslint-env browser */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import ReactDOM from 'react-dom';
|
|
4
|
-
import UniverseContainerComponent from '../components/universe/UniverseContainerComponent';
|
|
5
|
-
|
|
6
|
-
ReactDOM.render(
|
|
7
|
-
<UniverseContainerComponent />,
|
|
8
|
-
document.querySelector('.universeheader'),
|
|
9
|
-
);
|
|
1
|
+
/* eslint-env browser */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import ReactDOM from 'react-dom';
|
|
4
|
+
import UniverseContainerComponent from '../components/universe/UniverseContainerComponent';
|
|
5
|
+
|
|
6
|
+
ReactDOM.render(
|
|
7
|
+
<UniverseContainerComponent />,
|
|
8
|
+
document.querySelector('.universeheader'),
|
|
9
|
+
);
|