@aarhus-university/au-lib-react-components 8.20.1 → 8.81.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/.eslintrc.js +44 -0
- package/README.md +19 -20
- package/babel.config.js +7 -0
- package/build/umd/all.css +1 -2
- 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 -6
- 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 -65
- package/src/components/AUAlertComponent.tsx +70 -0
- 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} +78 -76
- package/src/components/{form/AUReceiptComponent.js → AUReceiptComponent.tsx} +33 -40
- package/src/components/AUSpinnerComponent.tsx +64 -0
- package/src/components/{delphinus/AUSubNavComponent.js → AUSubNavComponent.tsx} +38 -53
- package/src/components/{form/AUSubmitButtonContainerComponent.js → AUSubmitButtonContainerComponent.tsx} +31 -39
- package/src/components/AUTabbedContentComponent.tsx +145 -0
- 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 -113
- package/src/components/profile/AUProfileAvatarComponent.js +83 -83
- package/src/components/profile/AUProfileAvatarV2Component.js +91 -0
- package/src/components/profile/AUProfileAvatarV3Component.tsx +42 -0
- package/src/components/profile/AUProfileContainerComponent.js +283 -285
- 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 +0 -2
- package/src/components/profile/AUProfileMailComponent.js +307 -299
- 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 -210
- package/src/components/profile/AUProfileWidgetComponent.js +95 -95
- package/src/components/profile/AUProfileWidgetV2Component.js +116 -0
- package/src/components/profile/AUProfileWidgetV3Component.tsx +118 -0
- package/src/components/wrapping/AUEmbedComponent.js +47 -47
- package/src/{components → layout-2016/components}/alphabox/AlphaBoxComponent.js +29 -28
- 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} +41 -66
- package/src/{components/delphinus/hooks.js → lib/hooks.ts} +33 -26
- package/src/lib/{i18n.js → i18n.ts} +600 -595
- package/src/lib/tracking.ts +69 -0
- package/src/lib/{wrapping.js → wrapping.ts} +21 -16
- package/src/styles/_settings.scss +11 -11
- package/src/styles/alphabox.scss +222 -209
- package/src/styles/app.scss +7 -12
- 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 +396 -0
- package/tsconfig.json +47 -0
- package/types/common/interfaces.d.ts +83 -0
- package/types/common/main.d.ts +4 -0
- package/types/common/package.json +5 -0
- package/types/common/payloads.d.ts +0 -0
- package/types/common/props.d.ts +158 -0
- package/webpack.config.js +89 -0
- package/.eslintrc +0 -19
- package/DOCUMENTATION.md +0 -369
- package/build/cjs/auAuth.js +0 -2
- package/build/cjs/auAuth.js.map +0 -1
- package/build/dev.html +0 -329
- package/build/umd/auAuth.js +0 -2
- package/build/umd/auAuth.js.map +0 -1
- 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 -422
- package/src/components/delphinus/AUContentToggleComponent.js +0 -32
- package/src/components/delphinus/AUDatepickerComponent.js +0 -113
- package/src/components/delphinus/AULoginComponent.js +0 -65
- package/src/components/delphinus/AUSpinnerComponent.js +0 -114
- package/src/components/delphinus/AUTabbedContentComponent.js +0 -53
- 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/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/config/webpack.cjs.config.js +0 -75
- package/src/config/webpack.dev.config.js +0 -61
- package/src/config/webpack.umd.config.js +0 -107
- package/src/index.js +0 -6
- package/src/lib/au-auth.js +0 -221
- package/src/lib/au-news.js +0 -306
- 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,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,53 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { setTabbedContent } from '@aarhus-university/au-designsystem-delphinus/source/js/components/tabs';
|
|
4
|
-
|
|
5
|
-
const AUTabbedContentComponent = ({
|
|
6
|
-
tabKey,
|
|
7
|
-
tabs,
|
|
8
|
-
children,
|
|
9
|
-
focus,
|
|
10
|
-
initial,
|
|
11
|
-
lang,
|
|
12
|
-
}) => {
|
|
13
|
-
const tabsElement = useRef();
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
setTabbedContent(tabKey, tabsElement.current, initial, focus);
|
|
16
|
-
}, []);
|
|
17
|
-
|
|
18
|
-
const renderTabs = tabs.map((tab) => <a key={tab.href} href={tab.href} className="nav__item" dangerouslySetInnerHTML={{ __html: tab.text }} />);
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<div ref={tabsElement} className="tabbed-content">
|
|
22
|
-
<div className="nav nav--has-active-item">
|
|
23
|
-
<div className="nav__items">
|
|
24
|
-
{renderTabs}
|
|
25
|
-
</div>
|
|
26
|
-
<button className="nav__toggle">{lang === 'da' ? 'Mere' : 'More'}</button>
|
|
27
|
-
</div>
|
|
28
|
-
{children}
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
AUTabbedContentComponent.defaultProps = {
|
|
34
|
-
tabKey: 0,
|
|
35
|
-
focus: true,
|
|
36
|
-
initial: 0,
|
|
37
|
-
lang: 'da',
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
AUTabbedContentComponent.propTypes = {
|
|
41
|
-
tabKey: PropTypes.number,
|
|
42
|
-
tabs: PropTypes.shape({
|
|
43
|
-
text: PropTypes.string.isRequired,
|
|
44
|
-
href: PropTypes.string.isRequired,
|
|
45
|
-
}).isRequired,
|
|
46
|
-
children: PropTypes.element.isRequired,
|
|
47
|
-
focus: PropTypes.bool,
|
|
48
|
-
initial: PropTypes.number,
|
|
49
|
-
lang: PropTypes.string,
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
AUTabbedContentComponent.displayName = 'AUTabbedContentComponent';
|
|
53
|
-
export default AUTabbedContentComponent;
|
|
@@ -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,125 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import EventLayout1Component from './EventLayout1Component';
|
|
4
|
-
import EventLayout2Component from './EventLayout2Component';
|
|
5
|
-
import EventLayout3Component from './EventLayout3Component';
|
|
6
|
-
import NewsLayout1Component from './NewsLayout1Component';
|
|
7
|
-
import NewsLayout2Component from './NewsLayout2Component';
|
|
8
|
-
import NewsLayout3Component from './NewsLayout3Component';
|
|
9
|
-
import NewsLayout4Component from './NewsLayout4Component';
|
|
10
|
-
import NewsLayout5Component from './NewsLayout5Component';
|
|
11
|
-
import NewsLayout6Component from './NewsLayout6Component';
|
|
12
|
-
import NewsLayout7Component from './NewsLayout7Component';
|
|
13
|
-
import NewsLayout8Component from './NewsLayout8Component';
|
|
14
|
-
|
|
15
|
-
const NewsColumnsComponent = (props) => {
|
|
16
|
-
const layouts = [
|
|
17
|
-
<NewsLayout1Component />,
|
|
18
|
-
<NewsLayout2Component />,
|
|
19
|
-
<NewsLayout3Component />,
|
|
20
|
-
<NewsLayout4Component />,
|
|
21
|
-
<NewsLayout5Component />,
|
|
22
|
-
<NewsLayout6Component />,
|
|
23
|
-
<NewsLayout7Component />,
|
|
24
|
-
<NewsLayout8Component />,
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
const layoutsEvents = [
|
|
28
|
-
<EventLayout1Component />,
|
|
29
|
-
<EventLayout2Component />,
|
|
30
|
-
<EventLayout3Component />,
|
|
31
|
-
];
|
|
32
|
-
|
|
33
|
-
const {
|
|
34
|
-
type,
|
|
35
|
-
cols,
|
|
36
|
-
items,
|
|
37
|
-
setPopupItem,
|
|
38
|
-
incrementPointer,
|
|
39
|
-
listid,
|
|
40
|
-
lang,
|
|
41
|
-
} = props;
|
|
42
|
-
let count = -1;
|
|
43
|
-
const headerElementValue = type === 'events' ? 3 : 6;
|
|
44
|
-
const renderColumns = cols.map((col, i) => {
|
|
45
|
-
const outerKey = i; // LOL
|
|
46
|
-
let isHeader = false;
|
|
47
|
-
const renderItems = col.map((element, j) => {
|
|
48
|
-
const innerKey = j; // Mere LOL
|
|
49
|
-
count += 1;
|
|
50
|
-
if (parseInt(element, 10) === headerElementValue && !isHeader) {
|
|
51
|
-
isHeader = true;
|
|
52
|
-
const hItems = [];
|
|
53
|
-
for (let x = j; x < col.length; x += 1) {
|
|
54
|
-
if (parseInt(col[x], 10) === headerElementValue) {
|
|
55
|
-
hItems.push(items[count + x]);
|
|
56
|
-
} else {
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (type === 'events') {
|
|
62
|
-
return (
|
|
63
|
-
<EventLayout3Component
|
|
64
|
-
key={innerKey}
|
|
65
|
-
listid={listid}
|
|
66
|
-
items={hItems}
|
|
67
|
-
setPopupItem={setPopupItem}
|
|
68
|
-
lang={lang}
|
|
69
|
-
/>
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return (
|
|
74
|
-
<NewsLayout6Component
|
|
75
|
-
key={innerKey}
|
|
76
|
-
listid={listid}
|
|
77
|
-
items={hItems}
|
|
78
|
-
setPopupItem={setPopupItem}
|
|
79
|
-
lang={lang}
|
|
80
|
-
/>
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (parseInt(element, 10) !== headerElementValue) {
|
|
85
|
-
incrementPointer();
|
|
86
|
-
isHeader = false;
|
|
87
|
-
const layoutsArray = type === 'events' ? layoutsEvents : layouts;
|
|
88
|
-
return React.cloneElement(layoutsArray[parseInt(element, 10) - 1], {
|
|
89
|
-
key: innerKey,
|
|
90
|
-
item: items[count],
|
|
91
|
-
listid,
|
|
92
|
-
setPopupItem,
|
|
93
|
-
lang,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return null;
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
return (
|
|
101
|
-
<div key={outerKey} className="column large-6 medium-6 small-12">
|
|
102
|
-
{renderItems}
|
|
103
|
-
</div>
|
|
104
|
-
);
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
return (
|
|
108
|
-
<div className="row">
|
|
109
|
-
{renderColumns}
|
|
110
|
-
</div>
|
|
111
|
-
);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
NewsColumnsComponent.propTypes = {
|
|
115
|
-
type: PropTypes.string.isRequired,
|
|
116
|
-
cols: PropTypes.arrayOf(PropTypes.shape({})).isRequired,
|
|
117
|
-
items: PropTypes.shape({}).isRequired,
|
|
118
|
-
setPopupItem: PropTypes.func.isRequired,
|
|
119
|
-
incrementPointer: PropTypes.func.isRequired,
|
|
120
|
-
listid: PropTypes.number.isRequired,
|
|
121
|
-
lang: PropTypes.bool.isRequired,
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
NewsColumnsComponent.displayName = 'NewsColumnsComponent';
|
|
125
|
-
export default NewsColumnsComponent;
|