@aarhus-university/au-lib-react-components 9.11.17 → 10.0.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 -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} +78 -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} +44 -66
- 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 +52 -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,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { newsLabels as labels } from '../../lib/i18n';
|
|
4
|
-
import { AUNewsHelpers } from '../../lib/au-news';
|
|
5
|
-
|
|
6
|
-
const NewsLayout8Component = (props) => {
|
|
7
|
-
const {
|
|
8
|
-
item,
|
|
9
|
-
listid,
|
|
10
|
-
setPopupItem,
|
|
11
|
-
lang,
|
|
12
|
-
} = props;
|
|
13
|
-
if (!item) {
|
|
14
|
-
return <div />;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const i = AUNewsHelpers.setExternal(item);
|
|
18
|
-
const domID = `news-${listid}-${i.id}`;
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<div id={domID} className="au_focus au_focus_small" style={{ backgroundImage: `url('${i.image ? i.image.layout2 : ''}')` }}>
|
|
22
|
-
<div className="au_focus_content">
|
|
23
|
-
<div dangerouslySetInnerHTML={{ __html: i.header }} />
|
|
24
|
-
<ul>
|
|
25
|
-
<li>
|
|
26
|
-
<a
|
|
27
|
-
onClick={() => {
|
|
28
|
-
if (!i.external) {
|
|
29
|
-
setPopupItem(props.item);
|
|
30
|
-
}
|
|
31
|
-
}}
|
|
32
|
-
href={i.url}
|
|
33
|
-
>
|
|
34
|
-
{labels[lang].news.readMore}
|
|
35
|
-
</a>
|
|
36
|
-
</li>
|
|
37
|
-
</ul>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
NewsLayout8Component.propTypes = {
|
|
44
|
-
lang: PropTypes.string.isRequired,
|
|
45
|
-
item: PropTypes.shape({
|
|
46
|
-
id: PropTypes.number.isRequired,
|
|
47
|
-
header: PropTypes.string.isRequired,
|
|
48
|
-
subheader: PropTypes.string.isRequired,
|
|
49
|
-
url: PropTypes.string.isRequired,
|
|
50
|
-
external: PropTypes.bool.isRequired,
|
|
51
|
-
}).isRequired,
|
|
52
|
-
listid: PropTypes.number.isRequired,
|
|
53
|
-
setPopupItem: PropTypes.func.isRequired,
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
NewsLayout8Component.displayName = 'NewsLayout8Component';
|
|
57
|
-
export default NewsLayout8Component;
|
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
/* eslint-env browser */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import ReactDOM from 'react-dom';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import EventLayout1Component from './EventLayout1Component';
|
|
6
|
-
import EventLayout2Component from './EventLayout2Component';
|
|
7
|
-
import EventLayout3Component from './EventLayout3Component';
|
|
8
|
-
import NewsLayout1Component from './NewsLayout1Component';
|
|
9
|
-
import NewsLayout2Component from './NewsLayout2Component';
|
|
10
|
-
import NewsLayout3Component from './NewsLayout3Component';
|
|
11
|
-
import NewsLayout4Component from './NewsLayout4Component';
|
|
12
|
-
import NewsLayout5Component from './NewsLayout5Component';
|
|
13
|
-
import NewsLayout6Component from './NewsLayout6Component';
|
|
14
|
-
import NewsLayout7Component from './NewsLayout7Component';
|
|
15
|
-
import NewsLayout8Component from './NewsLayout8Component';
|
|
16
|
-
import NewsColumnsComponent from './NewsColumnsComponent';
|
|
17
|
-
import NewsRSSComponent from './NewsRSSComponent';
|
|
18
|
-
import AUSpinnerComponent from '../AUSpinnerComponent';
|
|
19
|
-
import { newsLabels as labels } from '../../lib/i18n';
|
|
20
|
-
import { AUNewsConfig } from '../../lib/au-news';
|
|
21
|
-
|
|
22
|
-
class NewsListComponent extends React.Component {
|
|
23
|
-
constructor(props) {
|
|
24
|
-
super(props);
|
|
25
|
-
|
|
26
|
-
this.pointer = -1;
|
|
27
|
-
this.layouts = [
|
|
28
|
-
<NewsLayout1Component />,
|
|
29
|
-
<NewsLayout2Component />,
|
|
30
|
-
<NewsLayout3Component />,
|
|
31
|
-
<NewsLayout4Component />,
|
|
32
|
-
<NewsLayout5Component />,
|
|
33
|
-
<NewsLayout6Component />,
|
|
34
|
-
<NewsLayout7Component />,
|
|
35
|
-
<NewsLayout8Component />,
|
|
36
|
-
];
|
|
37
|
-
|
|
38
|
-
this.layoutsEvents = [
|
|
39
|
-
<EventLayout1Component />,
|
|
40
|
-
<EventLayout2Component />,
|
|
41
|
-
<EventLayout3Component />,
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
const { list, elements } = props;
|
|
45
|
-
|
|
46
|
-
this.state = {
|
|
47
|
-
loading: true,
|
|
48
|
-
more: !list.noPageBrowser,
|
|
49
|
-
items: [],
|
|
50
|
-
elements,
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
this.handleLoadMore = this.handleLoadMore.bind(this);
|
|
54
|
-
this.incrementPointer = this.incrementPointer.bind(this);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
componentDidMount() {
|
|
58
|
-
this.setHeader();
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
getItems(index, amount, callback) {
|
|
62
|
-
const { list, lang } = this.props;
|
|
63
|
-
const url = `${AUNewsConfig.server}/index.php?eID=getAuNewsFeed&mode=key&key=${list.feed_key}&index=${index}&amount=${(amount + (list.noPageBrowser === 0 ? 1 : 0))}&lang=${lang}${list.extra_param}&callback=?`;
|
|
64
|
-
|
|
65
|
-
// Axios does not support JSONP requests!
|
|
66
|
-
$.ajax({
|
|
67
|
-
url,
|
|
68
|
-
dataType: 'json',
|
|
69
|
-
jsonpCallback: url.hashCode(),
|
|
70
|
-
jsonp: true,
|
|
71
|
-
cache: true,
|
|
72
|
-
success: (items) => {
|
|
73
|
-
callback(items, items.length > amount && list.noPageBrowser === 0);
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
setHeader() {
|
|
79
|
-
const { list } = this.props;
|
|
80
|
-
list.header = document.querySelector(`#c${list.id} .csc-header h1`);
|
|
81
|
-
if (!list.header) {
|
|
82
|
-
list.header = document.querySelector(`#c${list.id} .csc-header h2`);
|
|
83
|
-
}
|
|
84
|
-
if (list.header) {
|
|
85
|
-
list.header.parentNode.classList.add('relative');
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
incrementPointer() {
|
|
90
|
-
// "Global" pointer til at holde styr på, hvor langt vi er nået igennem data
|
|
91
|
-
// til de forskellige elementer
|
|
92
|
-
this.pointer += 1;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
handleLoadMore(e) {
|
|
96
|
-
e.preventDefault();
|
|
97
|
-
this.setState({
|
|
98
|
-
loading: true,
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
const { elements } = this.props;
|
|
102
|
-
let lastElement = elements[elements.length - 1];
|
|
103
|
-
if (Array.isArray(lastElement)) {
|
|
104
|
-
const temp = lastElement[lastElement.length - 1];
|
|
105
|
-
if (Array.isArray(temp)) {
|
|
106
|
-
lastElement = temp[temp.length - 1];
|
|
107
|
-
} else {
|
|
108
|
-
lastElement = temp;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const amount = 10;
|
|
113
|
-
const newElements = [];
|
|
114
|
-
for (let i = 0; i < amount; i += 1) {
|
|
115
|
-
newElements.push(lastElement);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const { items, elements: sElements } = this.state;
|
|
119
|
-
this.getItems(items.length - 1, amount, (_items, more) => {
|
|
120
|
-
this.setState({
|
|
121
|
-
items: items.slice(0, items.length - 1).concat(_items),
|
|
122
|
-
elements: sElements.concat(newElements),
|
|
123
|
-
loading: false,
|
|
124
|
-
more,
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
render() {
|
|
130
|
-
this.pointer = -1;
|
|
131
|
-
const {
|
|
132
|
-
list,
|
|
133
|
-
elements: pElements,
|
|
134
|
-
lang,
|
|
135
|
-
setItem,
|
|
136
|
-
} = this.props;
|
|
137
|
-
const {
|
|
138
|
-
items,
|
|
139
|
-
elements,
|
|
140
|
-
loading,
|
|
141
|
-
more,
|
|
142
|
-
} = this.state;
|
|
143
|
-
let isHeader = false;
|
|
144
|
-
const headerElementValue = list.feed_type === 'events' ? 3 : 6;
|
|
145
|
-
const renderElements = elements.map((e, j) => {
|
|
146
|
-
const key = j;
|
|
147
|
-
// Kolonne
|
|
148
|
-
if (Array.isArray(e)) {
|
|
149
|
-
let length = 0;
|
|
150
|
-
for (let i = 0; i < e.length; i += 1) {
|
|
151
|
-
for (let n = 0; n < e[i].length; n += 1) {
|
|
152
|
-
this.incrementPointer();
|
|
153
|
-
length += 1;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
return (
|
|
158
|
-
<NewsColumnsComponent
|
|
159
|
-
key={key}
|
|
160
|
-
type={list.feed_type}
|
|
161
|
-
listid={list.id}
|
|
162
|
-
cols={e}
|
|
163
|
-
items={items.slice(j, j + length)}
|
|
164
|
-
setPopupItem={setItem}
|
|
165
|
-
incrementPointer={this.incrementPointer}
|
|
166
|
-
lang={lang}
|
|
167
|
-
/>
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// Ikke-kolonne
|
|
172
|
-
const element = parseInt(e, 10);
|
|
173
|
-
if (element === headerElementValue && !isHeader) {
|
|
174
|
-
isHeader = true;
|
|
175
|
-
const hItems = [];
|
|
176
|
-
for (let x = j; x < items.length; x += 1) {
|
|
177
|
-
// Høker-hack-fix af load more ved listevisning
|
|
178
|
-
// jf. FB84396 - der er givetvis stadig et issue, hvis listerne ligger i en kolonne...
|
|
179
|
-
if (parseInt(pElements[x], 10) === headerElementValue
|
|
180
|
-
|| (!Number.isNaN(pElements[x]) && items.length - pElements.length > 2)) {
|
|
181
|
-
this.incrementPointer();
|
|
182
|
-
hItems.push(items[this.pointer]);
|
|
183
|
-
} else {
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
if (list.feed_type === 'events') {
|
|
189
|
-
return (
|
|
190
|
-
<EventLayout3Component
|
|
191
|
-
key={key}
|
|
192
|
-
listid={list.id}
|
|
193
|
-
items={hItems}
|
|
194
|
-
setPopupItem={setItem}
|
|
195
|
-
lang={lang}
|
|
196
|
-
/>
|
|
197
|
-
);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
return (
|
|
201
|
-
<NewsLayout6Component
|
|
202
|
-
key={key}
|
|
203
|
-
listid={list.id}
|
|
204
|
-
items={hItems}
|
|
205
|
-
setPopupItem={setItem}
|
|
206
|
-
lang={lang}
|
|
207
|
-
/>
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
if (element !== headerElementValue) {
|
|
212
|
-
this.incrementPointer();
|
|
213
|
-
isHeader = false;
|
|
214
|
-
const layoutsArray = list.feed_type === 'events' ? this.layoutsEvents : this.layouts;
|
|
215
|
-
return React.cloneElement(layoutsArray[element - 1], {
|
|
216
|
-
key,
|
|
217
|
-
item: items[this.pointer],
|
|
218
|
-
listid: list.id,
|
|
219
|
-
setPopupItem: setItem,
|
|
220
|
-
lang,
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
return null;
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
let syndication = null;
|
|
228
|
-
const syndicationNode = document.querySelector(`#c${list.id} .csc-header`);
|
|
229
|
-
if (syndicationNode && AUNewsConfig.useSyndication && list.feed_type !== 'events') {
|
|
230
|
-
syndication = ReactDOM.createPortal(
|
|
231
|
-
<NewsRSSComponent
|
|
232
|
-
url={`http:${AUNewsConfig.server}/index.php?eID=getAuNewsFeed&mode=xml&key=${list.feed_key}&lang=${lang}`}
|
|
233
|
-
lang={lang}
|
|
234
|
-
/>,
|
|
235
|
-
syndicationNode,
|
|
236
|
-
'2',
|
|
237
|
-
);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
return [
|
|
241
|
-
<div key={0}>
|
|
242
|
-
{renderElements}
|
|
243
|
-
{(() => {
|
|
244
|
-
if (more) {
|
|
245
|
-
return (
|
|
246
|
-
<button
|
|
247
|
-
type="button"
|
|
248
|
-
onClick={this.handleLoadMore}
|
|
249
|
-
className="button small"
|
|
250
|
-
>
|
|
251
|
-
{labels[lang].news.listLoadMore}
|
|
252
|
-
</button>
|
|
253
|
-
);
|
|
254
|
-
}
|
|
255
|
-
return null;
|
|
256
|
-
})()}
|
|
257
|
-
</div>,
|
|
258
|
-
<AUSpinnerComponent
|
|
259
|
-
key={1}
|
|
260
|
-
domID={`news-spinner-${list.id}`}
|
|
261
|
-
loaded={!loading}
|
|
262
|
-
loadingCondition={loading}
|
|
263
|
-
onLoad={() => {
|
|
264
|
-
this.getItems(0, list.amount, (_items, _more) => {
|
|
265
|
-
this.setState({ items: _items, loading: false, more: _more });
|
|
266
|
-
});
|
|
267
|
-
}}
|
|
268
|
-
content={<div />}
|
|
269
|
-
/>,
|
|
270
|
-
syndication,
|
|
271
|
-
];
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
NewsListComponent.propTypes = {
|
|
276
|
-
lang: PropTypes.string.isRequired,
|
|
277
|
-
list: PropTypes.shape({
|
|
278
|
-
feed_key: PropTypes.string.isRequired,
|
|
279
|
-
noPageBrowser: PropTypes.bool.isRequired,
|
|
280
|
-
id: PropTypes.number.isRequired,
|
|
281
|
-
amount: PropTypes.number.isRequired,
|
|
282
|
-
extra_param: PropTypes.string.isRequired,
|
|
283
|
-
header: PropTypes.instanceOf(Element).isRequired,
|
|
284
|
-
feed_type: PropTypes.string.isRequired,
|
|
285
|
-
}).isRequired,
|
|
286
|
-
elements: PropTypes.arrayOf(PropTypes.number).isRequired,
|
|
287
|
-
setItem: PropTypes.func.isRequired,
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
NewsListComponent.displayName = 'NewsListComponent';
|
|
291
|
-
export default NewsListComponent;
|