@aarhus-university/au-lib-react-components 9.11.19 → 10.0.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/.eslintrc.js +44 -0
- package/README.md +19 -20
- package/babel.config.js +7 -6
- package/build/umd/all.css +1 -1
- package/build/umd/all.css.map +1 -1
- package/build/umd/all.js +1 -1
- package/build/umd/all.js.map +1 -1
- package/build/umd/alphabox.js +1 -1
- package/build/umd/alphabox.js.map +1 -1
- package/build/umd/databox.js +1 -2
- package/build/umd/databox.js.map +1 -1
- package/build/umd/diagramme.js +1 -1
- package/build/umd/diagramme.js.map +1 -1
- package/build/umd/flowbox.js +1 -1
- package/build/umd/flowbox.js.map +1 -1
- package/build/umd/universe.js +1 -1
- package/build/umd/universe.js.map +1 -1
- package/package.json +66 -60
- package/src/components/{delphinus/AUAlertComponent.js → AUAlertComponent.tsx} +70 -85
- package/src/components/{AutoSuggestComponent.js → AUAutoSuggestComponent.js} +45 -19
- package/src/components/AUCalendarComponent.tsx +493 -0
- package/src/components/AUContentToggleComponent.tsx +33 -0
- package/src/components/AUDatepickerComponent.tsx +117 -0
- package/src/components/AUMobilePrefixComponent.tsx +15 -0
- package/src/components/{delphinus/AUModalComponent.js → AUModalComponent.tsx} +80 -94
- package/src/components/{form/AUReceiptComponent.js → AUReceiptComponent.tsx} +33 -40
- package/src/components/AUSpinnerComponent.tsx +67 -0
- package/src/components/{delphinus/AUSubNavComponent.js → AUSubNavComponent.tsx} +38 -53
- package/src/components/{form/AUSubmitButtonContainerComponent.js → AUSubmitButtonContainerComponent.tsx} +31 -39
- package/src/components/{delphinus/AUTabbedContentComponent.js → AUTabbedContentComponent.tsx} +145 -150
- package/src/components/{delphinus/AUTableComponent.js → AUTableComponent.tsx} +24 -28
- package/src/components/{delphinus/AUToastComponent.js → AUToastComponent.tsx} +104 -91
- package/src/components/{delphinus/AUToolbarComponent.js → AUToolbarComponent.tsx} +45 -48
- package/src/components/profile/AUProfileActions.js +128 -128
- package/src/components/profile/AUProfileAvatarComponent.js +83 -83
- package/src/components/profile/AUProfileAvatarV2Component.js +91 -91
- package/src/components/profile/AUProfileAvatarV3Component.tsx +42 -0
- package/src/components/profile/AUProfileContainerComponent.js +283 -283
- package/src/components/profile/AUProfileHooks.js +30 -30
- package/src/components/profile/AUProfileItemComponent.js +54 -54
- package/src/components/profile/AUProfileLanguageComponent.js +131 -131
- package/src/components/profile/{AUProfileLoginComponent.js → AUProfileLoginComponent.tsx} +3 -18
- package/src/components/profile/AUProfileMailComponent.js +307 -307
- package/src/components/profile/AUProfileMobileComponent.js +164 -164
- package/src/components/profile/AUProfileNameComponent.js +253 -253
- package/src/components/profile/AUProfileNextOfKinComponent.js +216 -216
- package/src/components/profile/AUProfileReducer.js +230 -230
- package/src/components/profile/AUProfileWidgetComponent.js +95 -95
- package/src/components/profile/AUProfileWidgetV2Component.js +116 -116
- package/src/components/profile/{AUProfileWidgetV3Component.js → AUProfileWidgetV3Component.tsx} +122 -130
- package/src/components/wrapping/AUEmbedComponent.js +47 -47
- package/src/{components → layout-2016/components}/alphabox/AlphaBoxComponent.js +28 -25
- package/src/{components → layout-2016/components}/alphabox/AlphaBoxContentComponent.js +25 -14
- package/src/{components → layout-2016/components/common}/AUCollapsibleComponent.js +1 -22
- package/src/{components → layout-2016/components/common}/AUSpinnerComponent.js +2 -24
- package/src/{components → layout-2016/components}/databox/DataBoxAlphabetComponent.js +1 -1
- package/src/{components → layout-2016/components}/databox/DataBoxAssociationComponent.js +2 -2
- package/src/{components → layout-2016/components}/databox/DataBoxButtonComponent.js +7 -3
- package/src/{components → layout-2016/components}/databox/DataBoxComponent.js +2 -2
- package/src/{components → layout-2016/components}/databox/DataBoxGroupingComponent.js +2 -0
- package/src/{components → layout-2016/components}/databox/DataBoxSearchResultComponent.js +1 -5
- package/src/{components → layout-2016/components}/databox/DataBoxStackedAssociationComponent.js +1 -5
- package/src/{components → layout-2016/components}/databox/DataBoxSuggestionComponent.js +0 -0
- package/src/{components → layout-2016/components/diagramme}/AUDiagrammeComponent.js +5 -6
- package/src/{components → layout-2016/components}/flowbox/FlowBoxComponent.js +8 -8
- package/src/{components → layout-2016/components}/flowbox/FlowBoxPhoneComponent.js +3 -5
- package/src/{components → layout-2016/components}/profile/AUProfileAvatar2016Component.js +6 -2
- package/src/{components → layout-2016/components}/universe/StaffTopComponent.js +4 -3
- package/src/{components → layout-2016/components}/universe/StudentTopComponent.js +0 -0
- package/src/{components → layout-2016/components}/universe/UniverseContainerComponent.js +11 -8
- package/src/layout-2016/lib/all.js +3 -0
- package/src/{lib → layout-2016/lib}/au-alphabox.js +1 -3
- package/src/{lib → layout-2016/lib}/au-databox.js +6 -9
- package/src/{lib → layout-2016/lib}/au-diagramme.js +2 -4
- package/src/{lib → layout-2016/lib}/au-flowbox.js +1 -3
- package/src/{lib → layout-2016/lib}/universe.js +0 -0
- package/src/lib/{helpers.js → helpers.ts} +31 -59
- package/src/{components/delphinus/hooks.js → lib/hooks.ts} +33 -28
- package/src/lib/{i18n.js → i18n.ts} +600 -601
- package/src/lib/{tracking.js → tracking.ts} +69 -65
- package/src/lib/{wrapping.js → wrapping.ts} +21 -16
- package/src/styles/_settings.scss +10 -10
- package/src/styles/alphabox.scss +222 -208
- package/src/styles/app.scss +7 -13
- package/src/styles/autosuggest.scss +57 -57
- package/src/styles/databox.scss +563 -563
- package/src/styles/diagramme.scss +119 -119
- package/src/styles/flowbox.scss +72 -72
- package/src/styles/maps.scss +395 -395
- package/tsconfig.json +47 -0
- package/types/common/interfaces/gui.d.ts +63 -0
- package/types/common/interfaces/model.d.ts +29 -0
- package/types/common/main.d.ts +5 -0
- package/types/common/package.json +5 -0
- package/types/common/payloads.d.ts +0 -0
- package/types/common/props.d.ts +165 -0
- package/{src/config/webpack.umd.config.js → webpack.config.js} +20 -16
- package/.eslintrc +0 -19
- package/build/dev.html +0 -329
- package/build/umd/auAuth.js +0 -2
- package/build/umd/auAuth.js.map +0 -1
- package/build/umd/databox.js.LICENSE.txt +0 -5
- package/build/umd/news.js +0 -2
- package/build/umd/news.js.map +0 -1
- package/src/all.js +0 -3
- package/src/app.js +0 -263
- package/src/components/AUAlertComponent.js +0 -158
- package/src/components/AUAmountComponent.js +0 -84
- package/src/components/AUBannerComponent.js +0 -99
- package/src/components/AUCalendarComponent.js +0 -393
- package/src/components/AUDatepickerComponent.js +0 -105
- package/src/components/AUFilterCheckboxComponent.js +0 -122
- package/src/components/AUFocusComponent.js +0 -55
- package/src/components/AUModalComponent.js +0 -94
- package/src/components/AUPaginationComponent.js +0 -103
- package/src/components/context/AUUserContextComponent.js +0 -91
- package/src/components/context/ImpersonateComponent.js +0 -54
- package/src/components/delphinus/AUCalendarComponent.js +0 -487
- package/src/components/delphinus/AUContentToggleComponent.js +0 -32
- package/src/components/delphinus/AUDatepickerComponent.js +0 -164
- package/src/components/delphinus/AULoginComponent.js +0 -65
- package/src/components/delphinus/AUSpinnerComponent.js +0 -114
- package/src/components/form/AUMobilePrefixComponent.js +0 -18
- package/src/components/news/EventLayout1Component.js +0 -94
- package/src/components/news/EventLayout2Component.js +0 -90
- package/src/components/news/EventLayout3Component.js +0 -68
- package/src/components/news/NewsCategoriesComponent.js +0 -21
- package/src/components/news/NewsCollageBannerComponent.js +0 -71
- package/src/components/news/NewsCollageBannerRSSComponent.js +0 -79
- package/src/components/news/NewsColumnsComponent.js +0 -125
- package/src/components/news/NewsLanguageChangeComponent.js +0 -74
- package/src/components/news/NewsLayout1Component.js +0 -80
- package/src/components/news/NewsLayout2Component.js +0 -80
- package/src/components/news/NewsLayout3Component.js +0 -81
- package/src/components/news/NewsLayout4Component.js +0 -80
- package/src/components/news/NewsLayout5Component.js +0 -61
- package/src/components/news/NewsLayout6Component.js +0 -55
- package/src/components/news/NewsLayout7Component.js +0 -58
- package/src/components/news/NewsLayout8Component.js +0 -57
- package/src/components/news/NewsListComponent.js +0 -291
- package/src/components/news/NewsPopUpComponent.js +0 -591
- package/src/components/news/NewsRSSComponent.js +0 -74
- package/src/components/news/NewsSocialComponent.js +0 -104
- package/src/components/news/NewsSubHeaderComponent.js +0 -19
- package/src/components/password/AUChangePasswordComponent.js +0 -177
- package/src/components/password/AUCurrentPasswordComponent.js +0 -72
- package/src/components/password/AUNewPasswordComponent.js +0 -143
- package/src/components/password/AUPasswordActions.js +0 -101
- package/src/components/password/AUPasswordHooks.js +0 -47
- package/src/components/password/AUPasswordReducer.js +0 -78
- package/src/components/password/AUPasswordRequirementsComponent.js +0 -29
- package/src/components/profile/AUProfileAvatarV3Component.js +0 -80
- package/src/config/webpack.dev.config.js +0 -47
- package/src/index.js +0 -6
- package/src/lib/au-auth.js +0 -227
- package/src/lib/au-news.js +0 -371
- package/src/lib/menu.js +0 -10
- package/src/lib/urlHandler.js +0 -63
- package/src/lib/validation.js +0 -181
- package/src/styles/alert.scss +0 -39
- package/src/styles/calendar.scss +0 -112
- package/src/styles/filtercheckbox.scss +0 -5
- package/src/styles/modal.scss +0 -35
- package/src/styles/pagination.scss +0 -11
- package/src/styles/spinner.scss +0 -30
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/* eslint-env browser */
|
|
2
|
-
import React, { useEffect } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
const mitstudieLabels = {
|
|
6
|
-
da: {
|
|
7
|
-
frontHeadline: 'Mit studie',
|
|
8
|
-
frontText: 'En samlet indgang til dit studieoverblik, studieinformation<br />og selvbetjeningssystemer.',
|
|
9
|
-
signIn: 'Log ind',
|
|
10
|
-
},
|
|
11
|
-
en: {
|
|
12
|
-
frontHeadline: 'My studies',
|
|
13
|
-
frontText: 'A single point of access to study information and self-service systems.',
|
|
14
|
-
signIn: 'Sign in',
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const AULoginComponent = ({ labels, signInUri, notification }) => {
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
document.querySelector('main').classList.remove('theme--normal');
|
|
21
|
-
const pageNavTop = document.querySelector('.page__navigation-top');
|
|
22
|
-
if (pageNavTop) {
|
|
23
|
-
pageNavTop.classList.remove('theme--normal');
|
|
24
|
-
}
|
|
25
|
-
}, []);
|
|
26
|
-
const redirectUri = window.location.pathname;
|
|
27
|
-
return (
|
|
28
|
-
<>
|
|
29
|
-
<div className="page__content__block">
|
|
30
|
-
<h1>
|
|
31
|
-
<strong>
|
|
32
|
-
{labels[window.appLang].frontHeadline}
|
|
33
|
-
</strong>
|
|
34
|
-
</h1>
|
|
35
|
-
<p className="text--intro" dangerouslySetInnerHTML={{ __html: labels[window.appLang].frontText }} />
|
|
36
|
-
<a
|
|
37
|
-
className="button button--large"
|
|
38
|
-
href={`/${window.appLang}/${signInUri}?redirectUri=${redirectUri}`}
|
|
39
|
-
>
|
|
40
|
-
{labels[window.appLang].signIn}
|
|
41
|
-
</a>
|
|
42
|
-
</div>
|
|
43
|
-
{notification}
|
|
44
|
-
</>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
AULoginComponent.defaultProps = {
|
|
49
|
-
labels: mitstudieLabels,
|
|
50
|
-
signInUri: 'account/signin',
|
|
51
|
-
notification: null,
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
AULoginComponent.propTypes = {
|
|
55
|
-
labels: PropTypes.shape({
|
|
56
|
-
frontHeadline: PropTypes.string.isRequired,
|
|
57
|
-
frontText: PropTypes.string.isRequired,
|
|
58
|
-
signIn: PropTypes.string.isRequired,
|
|
59
|
-
}),
|
|
60
|
-
signInUri: PropTypes.string,
|
|
61
|
-
notification: PropTypes.element,
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
AULoginComponent.displayName = 'AULoginComponent';
|
|
65
|
-
export default AULoginComponent;
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/* eslint-env browser */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { isElementInViewport } from '../../lib/helpers';
|
|
5
|
-
|
|
6
|
-
class AUSpinnerComponent extends React.Component {
|
|
7
|
-
constructor(props) {
|
|
8
|
-
super(props);
|
|
9
|
-
|
|
10
|
-
this.state = {
|
|
11
|
-
loading: true,
|
|
12
|
-
visible: props.visible,
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
this.lazyLoad = this.lazyLoad.bind(this);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
componentDidMount() {
|
|
19
|
-
this.lazyLoad();
|
|
20
|
-
window.addEventListener('scroll', () => {
|
|
21
|
-
this.lazyLoad();
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
componentDidUpdate() {
|
|
26
|
-
this.lazyLoad();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static getDerivedStateFromProps(nextProps, prevState) {
|
|
30
|
-
if (nextProps.visible !== prevState.visible) {
|
|
31
|
-
return {
|
|
32
|
-
visible: nextProps.visible,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
lazyLoad() {
|
|
40
|
-
const {
|
|
41
|
-
loadingCondition,
|
|
42
|
-
loaded,
|
|
43
|
-
domID,
|
|
44
|
-
onLoad,
|
|
45
|
-
} = this.props;
|
|
46
|
-
const { loading, visible } = this.state;
|
|
47
|
-
|
|
48
|
-
const element = document.getElementById(domID);
|
|
49
|
-
if (!loaded && loading && loadingCondition && (visible || isElementInViewport(element))) {
|
|
50
|
-
this.setState({
|
|
51
|
-
loading: false,
|
|
52
|
-
}, () => {
|
|
53
|
-
onLoad();
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
render() {
|
|
59
|
-
const {
|
|
60
|
-
className, content, loaded, domID, children, height, init,
|
|
61
|
-
} = this.props;
|
|
62
|
-
|
|
63
|
-
if (!loaded) {
|
|
64
|
-
if (init === 'table') {
|
|
65
|
-
return (
|
|
66
|
-
<div id={domID} className={`processing-state processing-state--init-table ${className}`} style={{ minHeight: height }} />
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
if (init === 'box') {
|
|
70
|
-
return (
|
|
71
|
-
<div id={domID} className={`processing-state processing-state--init-box ${className}`} style={{ minHeight: height }} />
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
return (
|
|
75
|
-
<div id={domID} className={`processing-state ${className}`} style={{ minHeight: height }} />
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return children || content;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
AUSpinnerComponent.defaultProps = {
|
|
84
|
-
domID: 'au-spinner-component',
|
|
85
|
-
visible: false,
|
|
86
|
-
className: '',
|
|
87
|
-
content: null,
|
|
88
|
-
children: null,
|
|
89
|
-
onLoad: () => { },
|
|
90
|
-
height: 'auto',
|
|
91
|
-
init: '',
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
AUSpinnerComponent.propTypes = {
|
|
95
|
-
/**
|
|
96
|
-
* Relevant ved mere end en spinner per side
|
|
97
|
-
*/
|
|
98
|
-
domID: PropTypes.string,
|
|
99
|
-
/**
|
|
100
|
-
* Om den er synlig på skærmen ved indlæsning
|
|
101
|
-
*/
|
|
102
|
-
visible: PropTypes.bool,
|
|
103
|
-
className: PropTypes.string,
|
|
104
|
-
content: PropTypes.element,
|
|
105
|
-
children: PropTypes.element,
|
|
106
|
-
loaded: PropTypes.bool.isRequired,
|
|
107
|
-
loadingCondition: PropTypes.bool.isRequired,
|
|
108
|
-
onLoad: PropTypes.func,
|
|
109
|
-
height: PropTypes.string,
|
|
110
|
-
init: PropTypes.string,
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
AUSpinnerComponent.displayName = 'AUSpinnerComponent';
|
|
114
|
-
export default AUSpinnerComponent;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
const AUMobilePrefixComponent = ({ countryCodes, important }) => {
|
|
5
|
-
const renderCountryCodes = codes => codes.map(c => <option key={c.da} value={`+${c.code}`}>{`${c.da} (+${c.code})`}</option>);
|
|
6
|
-
if (important) {
|
|
7
|
-
return renderCountryCodes(countryCodes.filter(c => c.important));
|
|
8
|
-
}
|
|
9
|
-
return renderCountryCodes(countryCodes);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
AUMobilePrefixComponent.propTypes = {
|
|
13
|
-
countryCodes: PropTypes.arrayOf(PropTypes.shape({})).isRequired,
|
|
14
|
-
important: PropTypes.bool.isRequired,
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
AUMobilePrefixComponent.displayName = 'AUMobilePrefixComponent';
|
|
18
|
-
export default AUMobilePrefixComponent;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/* eslint jsx-a11y/control-has-associated-label: 0 */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import NewsSubHeaderComponent from './NewsSubHeaderComponent';
|
|
5
|
-
import { newsLabels as labels } from '../../lib/i18n';
|
|
6
|
-
import { AUNewsHelpers } from '../../lib/au-news';
|
|
7
|
-
|
|
8
|
-
const EventLayout1Component = (props) => {
|
|
9
|
-
const {
|
|
10
|
-
item,
|
|
11
|
-
listid,
|
|
12
|
-
setPopupItem,
|
|
13
|
-
lang,
|
|
14
|
-
} = props;
|
|
15
|
-
if (!item) {
|
|
16
|
-
return <div />;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const i = AUNewsHelpers.setExternal(item);
|
|
20
|
-
|
|
21
|
-
const domID = `news-${listid}-${i.id}`;
|
|
22
|
-
const {
|
|
23
|
-
fromDate,
|
|
24
|
-
toDate,
|
|
25
|
-
fromDateSplit,
|
|
26
|
-
toDateSplit,
|
|
27
|
-
} = AUNewsHelpers.getEventDates(i, lang);
|
|
28
|
-
const multipleDates = fromDate.getTime() !== toDate.getTime();
|
|
29
|
-
const showYear = i.showyear === '1'; // Oh ffs...
|
|
30
|
-
const className = `au_news_eventlist1-calendar ${(multipleDates ? 'multiple' : 'single')}`;
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<div id={domID} className="au_news-eventlist1-item">
|
|
34
|
-
<div className={className}>
|
|
35
|
-
<span className="au_news_events_weekday">
|
|
36
|
-
{labels[lang].news.weekdaysShort[fromDate.getDay()]}
|
|
37
|
-
</span>
|
|
38
|
-
<span className="au_news_events_date">
|
|
39
|
-
{fromDateSplit[lang === 'da' ? 0 : 2]}
|
|
40
|
-
</span>
|
|
41
|
-
<span className="au_news_events_month">
|
|
42
|
-
{labels[lang].news.monthsShort[fromDate.getMonth()] + (showYear ? (` ${(`${fromDate.getFullYear()}`).substring(2)}`) : '')}
|
|
43
|
-
</span>
|
|
44
|
-
<span className="au_news_events_weekday_end multiple">
|
|
45
|
-
{labels[lang].news.weekdaysShort[toDate.getDay()]}
|
|
46
|
-
</span>
|
|
47
|
-
<span className="au_news_events_date_end multiple">
|
|
48
|
-
{toDateSplit[lang === 'da' ? 0 : 2]}
|
|
49
|
-
</span>
|
|
50
|
-
<span className="au_news_events_month_end multiple">
|
|
51
|
-
{labels[lang].news.monthsShort[toDate.getMonth()] + (showYear ? (` ${(`${toDate.getFullYear()}`).substring(2)}`) : '')}
|
|
52
|
-
</span>
|
|
53
|
-
</div>
|
|
54
|
-
<div className="au_news_eventlist1-text">
|
|
55
|
-
<p>
|
|
56
|
-
<span className="au_news_events_time">
|
|
57
|
-
{`${(multipleDates ? `${i.event_from.date} ` : '')} ${`${i.event_from.time} `} ${(multipleDates ? `${i.event_to.date} ` : '')} ${i.event_to.time}`}
|
|
58
|
-
</span>
|
|
59
|
-
{' | '}
|
|
60
|
-
<span className="au_news_events_place">
|
|
61
|
-
{i.event_where}
|
|
62
|
-
</span>
|
|
63
|
-
<br />
|
|
64
|
-
<a
|
|
65
|
-
onClick={() => {
|
|
66
|
-
if (!i.external) {
|
|
67
|
-
setPopupItem(props.item);
|
|
68
|
-
}
|
|
69
|
-
}}
|
|
70
|
-
href={i.url}
|
|
71
|
-
title={i.header}
|
|
72
|
-
dangerouslySetInnerHTML={{ __html: i.header }}
|
|
73
|
-
/>
|
|
74
|
-
</p>
|
|
75
|
-
<NewsSubHeaderComponent subheader={i.subheader} trim={350} />
|
|
76
|
-
</div>
|
|
77
|
-
<div className="au_news_clear" />
|
|
78
|
-
</div>
|
|
79
|
-
);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
EventLayout1Component.propTypes = {
|
|
83
|
-
lang: PropTypes.string.isRequired,
|
|
84
|
-
item: PropTypes.shape({
|
|
85
|
-
id: PropTypes.number.isRequired,
|
|
86
|
-
url: PropTypes.string.isRequired,
|
|
87
|
-
header: PropTypes.string.isRequired,
|
|
88
|
-
}).isRequired,
|
|
89
|
-
listid: PropTypes.number.isRequired,
|
|
90
|
-
setPopupItem: PropTypes.func.isRequired,
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
EventLayout1Component.displayName = 'EventLayout1Component';
|
|
94
|
-
export default EventLayout1Component;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/* eslint jsx-a11y/control-has-associated-label: 0 */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import NewsSubHeaderComponent from './NewsSubHeaderComponent';
|
|
5
|
-
import { newsLabels as labels } from '../../lib/i18n';
|
|
6
|
-
import { AUNewsHelpers } from '../../lib/au-news';
|
|
7
|
-
|
|
8
|
-
const EventLayout2Component = (props) => {
|
|
9
|
-
const {
|
|
10
|
-
item,
|
|
11
|
-
listid,
|
|
12
|
-
setPopupItem,
|
|
13
|
-
lang,
|
|
14
|
-
} = props;
|
|
15
|
-
if (!item) {
|
|
16
|
-
return <div />;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const i = AUNewsHelpers.setExternal(item);
|
|
20
|
-
|
|
21
|
-
const domID = `news-${listid}-${i.id}`;
|
|
22
|
-
const { fromDate, toDate, fromDateSplit } = AUNewsHelpers.getEventDates(i, lang);
|
|
23
|
-
const multipleDates = fromDate.getTime() !== toDate.getTime();
|
|
24
|
-
const showYear = i.showyear === '1';
|
|
25
|
-
const classNameOuter = `au_news-eventlist2-item ${(i.featured ? 'au_event-featured' : '')}`;
|
|
26
|
-
const classNameInner = `au_news_eventlist2-calendar ${(multipleDates ? 'multiple' : 'single') + (showYear ? ' show-year' : '')}`;
|
|
27
|
-
const style = i.image.list === '' ? {} : {
|
|
28
|
-
backgroundImage: `url('${i.image.list}')`,
|
|
29
|
-
backgroundPosition: 'top center',
|
|
30
|
-
backgroundRepeat: 'no-repeat',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<div id={domID} className={classNameOuter}>
|
|
35
|
-
<div className="au_padding">
|
|
36
|
-
<div className={classNameInner} style={style}>
|
|
37
|
-
<span className="au_news_events_weekday">
|
|
38
|
-
{labels[lang].news.weekdaysShort[fromDate.getDay()]}
|
|
39
|
-
</span>
|
|
40
|
-
<span className="au_news_events_date">
|
|
41
|
-
{fromDateSplit[lang === 'da' ? 0 : 2]}
|
|
42
|
-
</span>
|
|
43
|
-
<span className="au_news_events_month">
|
|
44
|
-
{labels[lang].news.monthsShort[fromDate.getMonth()] + (showYear ? (` ${(`${fromDate.getFullYear()}`).substring(2)}`) : '')}
|
|
45
|
-
</span>
|
|
46
|
-
</div>
|
|
47
|
-
<div className="au_news_eventlist2-text">
|
|
48
|
-
<h2>
|
|
49
|
-
<a
|
|
50
|
-
onClick={() => {
|
|
51
|
-
if (!i.external) {
|
|
52
|
-
setPopupItem(props.item);
|
|
53
|
-
}
|
|
54
|
-
}}
|
|
55
|
-
href={i.url}
|
|
56
|
-
title={i.header}
|
|
57
|
-
dangerouslySetInnerHTML={{ __html: i.header }}
|
|
58
|
-
/>
|
|
59
|
-
</h2>
|
|
60
|
-
<div>
|
|
61
|
-
<span className="au_news_events_time">
|
|
62
|
-
{`${(multipleDates ? `${i.event_from.date} ` : '')} ${`${i.event_from.time} `} ${(multipleDates ? `${i.event_to.date} ` : '')} ${i.event_to.time}`}
|
|
63
|
-
</span>
|
|
64
|
-
{' | '}
|
|
65
|
-
<span className="au_news_events_place">
|
|
66
|
-
{i.event_where}
|
|
67
|
-
</span>
|
|
68
|
-
<br />
|
|
69
|
-
<NewsSubHeaderComponent subheader={i.subheader} trim={350} />
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
<div className="au_news_clear" />
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
EventLayout2Component.propTypes = {
|
|
79
|
-
lang: PropTypes.string.isRequired,
|
|
80
|
-
item: PropTypes.shape({
|
|
81
|
-
id: PropTypes.number.isRequired,
|
|
82
|
-
url: PropTypes.string.isRequired,
|
|
83
|
-
header: PropTypes.string.isRequired,
|
|
84
|
-
}).isRequired,
|
|
85
|
-
listid: PropTypes.number.isRequired,
|
|
86
|
-
setPopupItem: PropTypes.func.isRequired,
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
EventLayout2Component.displayName = 'EventLayout2Component';
|
|
90
|
-
export default EventLayout2Component;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/* eslint jsx-a11y/control-has-associated-label: 0 */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { AUNewsHelpers } from '../../lib/au-news';
|
|
5
|
-
|
|
6
|
-
const EventLayout3Component = (props) => {
|
|
7
|
-
const {
|
|
8
|
-
items,
|
|
9
|
-
listid,
|
|
10
|
-
setPopupItem,
|
|
11
|
-
lang,
|
|
12
|
-
} = props;
|
|
13
|
-
const renderItems = items.map((_i, j) => {
|
|
14
|
-
let i = _i;
|
|
15
|
-
const key = j;
|
|
16
|
-
if (i) {
|
|
17
|
-
i = AUNewsHelpers.setExternal(i);
|
|
18
|
-
const { fromDate, toDate } = AUNewsHelpers.getEventDates(i, lang);
|
|
19
|
-
const multipleDates = fromDate.getTime() !== toDate.getTime();
|
|
20
|
-
const domID = `news-${listid}-${i.id}`;
|
|
21
|
-
return (
|
|
22
|
-
<li
|
|
23
|
-
key={key}
|
|
24
|
-
id={domID}
|
|
25
|
-
>
|
|
26
|
-
<a
|
|
27
|
-
onClick={() => {
|
|
28
|
-
if (!i.external) {
|
|
29
|
-
setPopupItem(i);
|
|
30
|
-
}
|
|
31
|
-
}}
|
|
32
|
-
href={i.url}
|
|
33
|
-
title={i.header}
|
|
34
|
-
dangerouslySetInnerHTML={{ __html: i.header }}
|
|
35
|
-
/>
|
|
36
|
-
{' ('}
|
|
37
|
-
<span className="au_news_events_time">
|
|
38
|
-
{`${i.event_from.date} ${i.event_from.time} - ${(multipleDates ? `${i.event_to.date} ` : '')} ${i.event_to.time}`}
|
|
39
|
-
</span>
|
|
40
|
-
{`, ${i.event_where}) `}
|
|
41
|
-
</li>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
return null;
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<div className="au_news-header-list">
|
|
49
|
-
<ul>
|
|
50
|
-
{renderItems}
|
|
51
|
-
</ul>
|
|
52
|
-
</div>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
EventLayout3Component.propTypes = {
|
|
57
|
-
lang: PropTypes.string.isRequired,
|
|
58
|
-
items: PropTypes.arrayOf(PropTypes.shape({
|
|
59
|
-
id: PropTypes.number.isRequired,
|
|
60
|
-
url: PropTypes.string.isRequired,
|
|
61
|
-
header: PropTypes.string.isRequired,
|
|
62
|
-
})).isRequired,
|
|
63
|
-
listid: PropTypes.number.isRequired,
|
|
64
|
-
setPopupItem: PropTypes.func.isRequired,
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
EventLayout3Component.displayName = 'EventLayout3Component';
|
|
68
|
-
export default EventLayout3Component;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
const NewsCategoriesComponent = (props) => {
|
|
5
|
-
const { categories } = props;
|
|
6
|
-
const renderCategories = categories.slice(0, 1).map((cat, i) => {
|
|
7
|
-
const key = i;
|
|
8
|
-
return <span key={key}>{(i > 0 ? ', ' : '') + cat.category}</span>;
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
return <span className="au_news-list-news-category">{renderCategories}</span>;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
NewsCategoriesComponent.propTypes = {
|
|
15
|
-
categories: PropTypes.arrayOf(PropTypes.shape({
|
|
16
|
-
category: PropTypes.string.isRequired,
|
|
17
|
-
})).isRequired,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
NewsCategoriesComponent.displayName = 'NewsCategoriesComponent';
|
|
21
|
-
export default NewsCategoriesComponent;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { AUNewsHelpers } from '../../lib/au-news';
|
|
4
|
-
|
|
5
|
-
const NewsCollageBannerComponent = (props) => {
|
|
6
|
-
const {
|
|
7
|
-
lang,
|
|
8
|
-
item,
|
|
9
|
-
title,
|
|
10
|
-
type,
|
|
11
|
-
} = props;
|
|
12
|
-
const className = `aubanner hastext aubanner-2 ${(type === 'events' ? 'bg-dark-magenta' : 'bg-dark-staff')}`;
|
|
13
|
-
const isEvent = AUNewsHelpers.typeIdToText(item.type) === 'event';
|
|
14
|
-
let multipleDates = false;
|
|
15
|
-
let dateStr = item.date;
|
|
16
|
-
if (isEvent) {
|
|
17
|
-
const { fromDate, toDate } = AUNewsHelpers.getEventDates(item, lang);
|
|
18
|
-
multipleDates = fromDate.getTime() !== toDate.getTime();
|
|
19
|
-
dateStr = `${item.event_from.date} ${item.event_from.time} - ${(multipleDates ? `${item.event_to.date} ` : '')}${item.event_to.time}`;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<div className={className}>
|
|
24
|
-
<a href={item.url} className="au_noborder">
|
|
25
|
-
{(() => {
|
|
26
|
-
if (item.image.href !== '') {
|
|
27
|
-
return <img src={item.image.href} alt="" />;
|
|
28
|
-
}
|
|
29
|
-
return null;
|
|
30
|
-
})()}
|
|
31
|
-
<div className="aubanner-content">
|
|
32
|
-
<h3>{title}</h3>
|
|
33
|
-
<h2 dangerouslySetInnerHTML={{ __html: item.header }} />
|
|
34
|
-
<p dangerouslySetInnerHTML={{ __html: item.subheader }} />
|
|
35
|
-
<p>
|
|
36
|
-
<span>{dateStr}</span>
|
|
37
|
-
<span>{item.event_where}</span>
|
|
38
|
-
</p>
|
|
39
|
-
</div>
|
|
40
|
-
</a>
|
|
41
|
-
</div>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
NewsCollageBannerComponent.propTypes = {
|
|
46
|
-
lang: PropTypes.string.isRequired,
|
|
47
|
-
item: PropTypes.shape({
|
|
48
|
-
image: PropTypes.shape({
|
|
49
|
-
href: PropTypes.string.isRequired,
|
|
50
|
-
}).isRequired,
|
|
51
|
-
header: PropTypes.string.isRequired,
|
|
52
|
-
event_from: PropTypes.shape({
|
|
53
|
-
date: PropTypes.string.isRequired,
|
|
54
|
-
time: PropTypes.string.isRequired,
|
|
55
|
-
}).isRequired,
|
|
56
|
-
event_to: PropTypes.shape({
|
|
57
|
-
date: PropTypes.string.isRequired,
|
|
58
|
-
time: PropTypes.string.isRequired,
|
|
59
|
-
}).isRequired,
|
|
60
|
-
event_where: PropTypes.string.isRequired,
|
|
61
|
-
url: PropTypes.string.isRequired,
|
|
62
|
-
type: PropTypes.string.isRequired,
|
|
63
|
-
date: PropTypes.string.isRequired,
|
|
64
|
-
subheader: PropTypes.string.isRequired,
|
|
65
|
-
}).isRequired,
|
|
66
|
-
title: PropTypes.string.isRequired,
|
|
67
|
-
type: PropTypes.string.isRequired,
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
NewsCollageBannerComponent.displayName = 'NewsCollageBannerComponent';
|
|
71
|
-
export default NewsCollageBannerComponent;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
const appendZero = (datePart) => `${datePart < 10 ? '0' : ''}${datePart}`;
|
|
5
|
-
const strDateTime = (dateTime, lang, showTime = false) => {
|
|
6
|
-
if (lang === 'da') {
|
|
7
|
-
if (showTime) {
|
|
8
|
-
return `${appendZero(dateTime.getDate())}.${appendZero(dateTime.getMonth() + 1)}.${dateTime.getFullYear()} ${appendZero(dateTime.getHours())}:${appendZero(dateTime.getMinutes())}`;
|
|
9
|
-
}
|
|
10
|
-
return `${appendZero(dateTime.getDate())}.${appendZero(dateTime.getMonth() + 1)}.${dateTime.getFullYear()}`;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (showTime) {
|
|
14
|
-
return `${appendZero(dateTime.getMonth() + 1)}.${appendZero(dateTime.getDate())}.${dateTime.getFullYear()} ${appendZero(dateTime.getHours())}:${appendZero(dateTime.getMinutes())}`;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return `${appendZero(dateTime.getMonth() + 1)}.${appendZero(dateTime.getDate())}.${dateTime.getFullYear()}`;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const NewsCollageBannerComponent = (props) => {
|
|
21
|
-
const {
|
|
22
|
-
lang,
|
|
23
|
-
item,
|
|
24
|
-
title,
|
|
25
|
-
type,
|
|
26
|
-
} = props;
|
|
27
|
-
const className = `aubanner hastext aubanner-2 ${(type === 'events' ? 'bg-dark-magenta' : 'bg-dark-staff')}`;
|
|
28
|
-
const isEvent = item.Type === 1; // Enum fra C#
|
|
29
|
-
const published = new Date(item.Published);
|
|
30
|
-
let dateStr = strDateTime(published, lang);
|
|
31
|
-
|
|
32
|
-
if (isEvent) {
|
|
33
|
-
const eventFrom = new Date(item.EventFrom);
|
|
34
|
-
const eventTo = new Date(item.EventTo);
|
|
35
|
-
const multipleDates = eventFrom !== eventTo;
|
|
36
|
-
dateStr = `${strDateTime(eventFrom, lang, true)}${multipleDates ? ` – ${strDateTime(eventTo, lang, true)}` : ''}`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<div className={className}>
|
|
41
|
-
<a href={item.Uri} className="au_noborder">
|
|
42
|
-
{
|
|
43
|
-
!!item.Image && (
|
|
44
|
-
<img src={item.Image} alt={item.Header} />
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
<div className="aubanner-content">
|
|
48
|
-
<h3>{title}</h3>
|
|
49
|
-
<h2 dangerouslySetInnerHTML={{ __html: item.Header }} />
|
|
50
|
-
<p dangerouslySetInnerHTML={{ __html: item.SubHeader }} />
|
|
51
|
-
<p>
|
|
52
|
-
<span>{dateStr}</span>
|
|
53
|
-
<span>{item.EventWhere}</span>
|
|
54
|
-
</p>
|
|
55
|
-
</div>
|
|
56
|
-
</a>
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
NewsCollageBannerComponent.propTypes = {
|
|
62
|
-
lang: PropTypes.string.isRequired,
|
|
63
|
-
item: PropTypes.shape({
|
|
64
|
-
Published: PropTypes.instanceOf(Date).isRequired,
|
|
65
|
-
Type: PropTypes.number.isRequired,
|
|
66
|
-
Image: PropTypes.string.isRequired,
|
|
67
|
-
Header: PropTypes.string.isRequired,
|
|
68
|
-
SubHeader: PropTypes.string.isRequired,
|
|
69
|
-
Uri: PropTypes.string.isRequired,
|
|
70
|
-
EventWhere: PropTypes.string.isRequired,
|
|
71
|
-
EventFrom: PropTypes.instanceOf(Date).isRequired,
|
|
72
|
-
EventTo: PropTypes.instanceOf(Date).isRequired,
|
|
73
|
-
}).isRequired,
|
|
74
|
-
title: PropTypes.string.isRequired,
|
|
75
|
-
type: PropTypes.string.isRequired,
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
NewsCollageBannerComponent.displayName = 'NewsCollageBannerComponent';
|
|
79
|
-
export default NewsCollageBannerComponent;
|