@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.
Files changed (165) hide show
  1. package/.eslintrc.js +44 -0
  2. package/README.md +19 -20
  3. package/babel.config.js +7 -6
  4. package/build/umd/all.css +1 -1
  5. package/build/umd/all.css.map +1 -1
  6. package/build/umd/all.js +1 -1
  7. package/build/umd/all.js.map +1 -1
  8. package/build/umd/alphabox.js +1 -1
  9. package/build/umd/alphabox.js.map +1 -1
  10. package/build/umd/databox.js +1 -2
  11. package/build/umd/databox.js.map +1 -1
  12. package/build/umd/diagramme.js +1 -1
  13. package/build/umd/diagramme.js.map +1 -1
  14. package/build/umd/flowbox.js +1 -1
  15. package/build/umd/flowbox.js.map +1 -1
  16. package/build/umd/universe.js +1 -1
  17. package/build/umd/universe.js.map +1 -1
  18. package/package.json +66 -60
  19. package/src/components/{delphinus/AUAlertComponent.js → AUAlertComponent.tsx} +70 -85
  20. package/src/components/{AutoSuggestComponent.js → AUAutoSuggestComponent.js} +45 -19
  21. package/src/components/AUCalendarComponent.tsx +493 -0
  22. package/src/components/AUContentToggleComponent.tsx +33 -0
  23. package/src/components/AUDatepickerComponent.tsx +117 -0
  24. package/src/components/AUMobilePrefixComponent.tsx +15 -0
  25. package/src/components/{delphinus/AUModalComponent.js → AUModalComponent.tsx} +78 -94
  26. package/src/components/{form/AUReceiptComponent.js → AUReceiptComponent.tsx} +33 -40
  27. package/src/components/AUSpinnerComponent.tsx +67 -0
  28. package/src/components/{delphinus/AUSubNavComponent.js → AUSubNavComponent.tsx} +38 -53
  29. package/src/components/{form/AUSubmitButtonContainerComponent.js → AUSubmitButtonContainerComponent.tsx} +31 -39
  30. package/src/components/{delphinus/AUTabbedContentComponent.js → AUTabbedContentComponent.tsx} +145 -150
  31. package/src/components/{delphinus/AUTableComponent.js → AUTableComponent.tsx} +24 -28
  32. package/src/components/{delphinus/AUToastComponent.js → AUToastComponent.tsx} +104 -91
  33. package/src/components/{delphinus/AUToolbarComponent.js → AUToolbarComponent.tsx} +45 -48
  34. package/src/components/profile/AUProfileActions.js +128 -128
  35. package/src/components/profile/AUProfileAvatarComponent.js +83 -83
  36. package/src/components/profile/AUProfileAvatarV2Component.js +91 -91
  37. package/src/components/profile/AUProfileAvatarV3Component.tsx +42 -0
  38. package/src/components/profile/AUProfileContainerComponent.js +283 -283
  39. package/src/components/profile/AUProfileHooks.js +30 -30
  40. package/src/components/profile/AUProfileItemComponent.js +54 -54
  41. package/src/components/profile/AUProfileLanguageComponent.js +131 -131
  42. package/src/components/profile/{AUProfileLoginComponent.js → AUProfileLoginComponent.tsx} +3 -18
  43. package/src/components/profile/AUProfileMailComponent.js +307 -307
  44. package/src/components/profile/AUProfileMobileComponent.js +164 -164
  45. package/src/components/profile/AUProfileNameComponent.js +253 -253
  46. package/src/components/profile/AUProfileNextOfKinComponent.js +216 -216
  47. package/src/components/profile/AUProfileReducer.js +230 -230
  48. package/src/components/profile/AUProfileWidgetComponent.js +95 -95
  49. package/src/components/profile/AUProfileWidgetV2Component.js +116 -116
  50. package/src/components/profile/{AUProfileWidgetV3Component.js → AUProfileWidgetV3Component.tsx} +122 -130
  51. package/src/components/wrapping/AUEmbedComponent.js +47 -47
  52. package/src/{components → layout-2016/components}/alphabox/AlphaBoxComponent.js +28 -25
  53. package/src/{components → layout-2016/components}/alphabox/AlphaBoxContentComponent.js +25 -14
  54. package/src/{components → layout-2016/components/common}/AUCollapsibleComponent.js +1 -22
  55. package/src/{components → layout-2016/components/common}/AUSpinnerComponent.js +2 -24
  56. package/src/{components → layout-2016/components}/databox/DataBoxAlphabetComponent.js +1 -1
  57. package/src/{components → layout-2016/components}/databox/DataBoxAssociationComponent.js +2 -2
  58. package/src/{components → layout-2016/components}/databox/DataBoxButtonComponent.js +7 -3
  59. package/src/{components → layout-2016/components}/databox/DataBoxComponent.js +2 -2
  60. package/src/{components → layout-2016/components}/databox/DataBoxGroupingComponent.js +2 -0
  61. package/src/{components → layout-2016/components}/databox/DataBoxSearchResultComponent.js +1 -5
  62. package/src/{components → layout-2016/components}/databox/DataBoxStackedAssociationComponent.js +1 -5
  63. package/src/{components → layout-2016/components}/databox/DataBoxSuggestionComponent.js +0 -0
  64. package/src/{components → layout-2016/components/diagramme}/AUDiagrammeComponent.js +5 -6
  65. package/src/{components → layout-2016/components}/flowbox/FlowBoxComponent.js +8 -8
  66. package/src/{components → layout-2016/components}/flowbox/FlowBoxPhoneComponent.js +3 -5
  67. package/src/{components → layout-2016/components}/profile/AUProfileAvatar2016Component.js +6 -2
  68. package/src/{components → layout-2016/components}/universe/StaffTopComponent.js +4 -3
  69. package/src/{components → layout-2016/components}/universe/StudentTopComponent.js +0 -0
  70. package/src/{components → layout-2016/components}/universe/UniverseContainerComponent.js +11 -8
  71. package/src/layout-2016/lib/all.js +3 -0
  72. package/src/{lib → layout-2016/lib}/au-alphabox.js +1 -3
  73. package/src/{lib → layout-2016/lib}/au-databox.js +6 -9
  74. package/src/{lib → layout-2016/lib}/au-diagramme.js +2 -4
  75. package/src/{lib → layout-2016/lib}/au-flowbox.js +1 -3
  76. package/src/{lib → layout-2016/lib}/universe.js +0 -0
  77. package/src/lib/{helpers.js → helpers.ts} +44 -66
  78. package/src/{components/delphinus/hooks.js → lib/hooks.ts} +33 -28
  79. package/src/lib/{i18n.js → i18n.ts} +600 -601
  80. package/src/lib/{tracking.js → tracking.ts} +69 -65
  81. package/src/lib/{wrapping.js → wrapping.ts} +21 -16
  82. package/src/styles/_settings.scss +10 -10
  83. package/src/styles/alphabox.scss +222 -208
  84. package/src/styles/app.scss +7 -13
  85. package/src/styles/autosuggest.scss +57 -57
  86. package/src/styles/databox.scss +563 -563
  87. package/src/styles/diagramme.scss +119 -119
  88. package/src/styles/flowbox.scss +72 -72
  89. package/src/styles/maps.scss +395 -395
  90. package/tsconfig.json +47 -0
  91. package/types/common/interfaces/gui.d.ts +52 -0
  92. package/types/common/interfaces/model.d.ts +29 -0
  93. package/types/common/main.d.ts +5 -0
  94. package/types/common/package.json +5 -0
  95. package/types/common/payloads.d.ts +0 -0
  96. package/types/common/props.d.ts +165 -0
  97. package/{src/config/webpack.umd.config.js → webpack.config.js} +20 -16
  98. package/.eslintrc +0 -19
  99. package/build/dev.html +0 -329
  100. package/build/umd/auAuth.js +0 -2
  101. package/build/umd/auAuth.js.map +0 -1
  102. package/build/umd/databox.js.LICENSE.txt +0 -5
  103. package/build/umd/news.js +0 -2
  104. package/build/umd/news.js.map +0 -1
  105. package/src/all.js +0 -3
  106. package/src/app.js +0 -263
  107. package/src/components/AUAlertComponent.js +0 -158
  108. package/src/components/AUAmountComponent.js +0 -84
  109. package/src/components/AUBannerComponent.js +0 -99
  110. package/src/components/AUCalendarComponent.js +0 -393
  111. package/src/components/AUDatepickerComponent.js +0 -105
  112. package/src/components/AUFilterCheckboxComponent.js +0 -122
  113. package/src/components/AUFocusComponent.js +0 -55
  114. package/src/components/AUModalComponent.js +0 -94
  115. package/src/components/AUPaginationComponent.js +0 -103
  116. package/src/components/context/AUUserContextComponent.js +0 -91
  117. package/src/components/context/ImpersonateComponent.js +0 -54
  118. package/src/components/delphinus/AUCalendarComponent.js +0 -487
  119. package/src/components/delphinus/AUContentToggleComponent.js +0 -32
  120. package/src/components/delphinus/AUDatepickerComponent.js +0 -164
  121. package/src/components/delphinus/AULoginComponent.js +0 -65
  122. package/src/components/delphinus/AUSpinnerComponent.js +0 -114
  123. package/src/components/form/AUMobilePrefixComponent.js +0 -18
  124. package/src/components/news/EventLayout1Component.js +0 -94
  125. package/src/components/news/EventLayout2Component.js +0 -90
  126. package/src/components/news/EventLayout3Component.js +0 -68
  127. package/src/components/news/NewsCategoriesComponent.js +0 -21
  128. package/src/components/news/NewsCollageBannerComponent.js +0 -71
  129. package/src/components/news/NewsCollageBannerRSSComponent.js +0 -79
  130. package/src/components/news/NewsColumnsComponent.js +0 -125
  131. package/src/components/news/NewsLanguageChangeComponent.js +0 -74
  132. package/src/components/news/NewsLayout1Component.js +0 -80
  133. package/src/components/news/NewsLayout2Component.js +0 -80
  134. package/src/components/news/NewsLayout3Component.js +0 -81
  135. package/src/components/news/NewsLayout4Component.js +0 -80
  136. package/src/components/news/NewsLayout5Component.js +0 -61
  137. package/src/components/news/NewsLayout6Component.js +0 -55
  138. package/src/components/news/NewsLayout7Component.js +0 -58
  139. package/src/components/news/NewsLayout8Component.js +0 -57
  140. package/src/components/news/NewsListComponent.js +0 -291
  141. package/src/components/news/NewsPopUpComponent.js +0 -591
  142. package/src/components/news/NewsRSSComponent.js +0 -74
  143. package/src/components/news/NewsSocialComponent.js +0 -104
  144. package/src/components/news/NewsSubHeaderComponent.js +0 -19
  145. package/src/components/password/AUChangePasswordComponent.js +0 -177
  146. package/src/components/password/AUCurrentPasswordComponent.js +0 -72
  147. package/src/components/password/AUNewPasswordComponent.js +0 -143
  148. package/src/components/password/AUPasswordActions.js +0 -101
  149. package/src/components/password/AUPasswordHooks.js +0 -47
  150. package/src/components/password/AUPasswordReducer.js +0 -78
  151. package/src/components/password/AUPasswordRequirementsComponent.js +0 -29
  152. package/src/components/profile/AUProfileAvatarV3Component.js +0 -80
  153. package/src/config/webpack.dev.config.js +0 -47
  154. package/src/index.js +0 -6
  155. package/src/lib/au-auth.js +0 -227
  156. package/src/lib/au-news.js +0 -371
  157. package/src/lib/menu.js +0 -10
  158. package/src/lib/urlHandler.js +0 -63
  159. package/src/lib/validation.js +0 -181
  160. package/src/styles/alert.scss +0 -39
  161. package/src/styles/calendar.scss +0 -112
  162. package/src/styles/filtercheckbox.scss +0 -5
  163. package/src/styles/modal.scss +0 -35
  164. package/src/styles/pagination.scss +0 -11
  165. package/src/styles/spinner.scss +0 -30
@@ -1,591 +0,0 @@
1
- /* eslint-env browser */
2
- /* eslint jsx-a11y/no-noninteractive-tabindex: 0 */
3
- /* eslint jsx-a11y/control-has-associated-label: 0 */
4
- import React from 'react';
5
- import PropTypes from 'prop-types';
6
- import NewsLanguageChangeComponent from './NewsLanguageChangeComponent';
7
- import NewsSocialComponent from './NewsSocialComponent';
8
- import { newsLabels as labels } from '../../lib/i18n';
9
- import { AUNewsHelpers, AUNewsConfig } from '../../lib/au-news';
10
-
11
- const setFade = () => {
12
- const fade = document.getElementById('fade');
13
- if (fade) {
14
- fade.style.display = 'block';
15
- fade.style.opacity = 0.7;
16
- fade.style.zIndex = 101;
17
- }
18
- };
19
-
20
- class NewsPopUpComponent extends React.Component {
21
- static getItem(id, lang, callback) {
22
- const url = `${AUNewsConfig.server}/index.php?eID=getAuNewsFeed&mode=id&key=${id}&lang=${lang}&callback=?`;
23
- // Axios does not support JSONP requests!
24
- $.ajax({
25
- url,
26
- dataType: 'json',
27
- jsonpCallback: url.hashCode(),
28
- jsonp: true,
29
- cache: true,
30
- success: (data) => {
31
- if (data && data.length === 1) {
32
- if (typeof callback === 'function' && data[0].hidden !== '1') {
33
- callback(data[0]);
34
- }
35
- }
36
- },
37
- });
38
- }
39
-
40
- static calculateHeight() {
41
- if (document.querySelector('.au_news_popup') && !AU.helpers.isMobileDevice()) {
42
- const element = document.querySelector('.au_news_popup');
43
- const viewPortHeight = Math.max(
44
- document.documentElement.clientHeight, window.innerHeight || 0,
45
- );
46
- const popupTop = getComputedStyle(element).top.replace('px', '');
47
- const popupBottom = getComputedStyle(element).bottom.replace('px', '');
48
- element.querySelector('.au_news_popup_inner').style.height = `${viewPortHeight - popupTop - popupBottom}px`;
49
- }
50
- }
51
-
52
- constructor(props) {
53
- super(props);
54
-
55
- const { item } = props;
56
- this.state = {
57
- item,
58
- };
59
-
60
- this.posBeforeShow = 0;
61
- }
62
-
63
- componentDidMount() {
64
- const {
65
- item,
66
- id,
67
- lang,
68
- print,
69
- } = this.props;
70
- const { item: sItem } = this.state;
71
- if (item == null) {
72
- NewsPopUpComponent.getItem(id, lang, (_item) => {
73
- const trackerLink = `/virtual/news/${AUNewsHelpers.typeIdToText(_item.type)}/open-single/id-${_item.id}/${_item.permalink}`;
74
- AU.tracking.trackSingle(trackerLink);
75
- this.setState({
76
- item: _item,
77
- }, () => {
78
- if (print) {
79
- window.print();
80
- }
81
- });
82
- });
83
- }
84
-
85
- setFade();
86
- document.querySelector('.au_news_popup_inner').focus();
87
- NewsPopUpComponent.calculateHeight();
88
- if (sItem != null) {
89
- // this.setDisqus();
90
- NewsPopUpComponent.setLightBox();
91
- }
92
- this.posBeforeShow = document.documentElement.scrollTop === 0
93
- ? document.body.scrollTop : document.documentElement.scrollTop;
94
- document.querySelector('body').classList.add('news-overlay-open');
95
- AU.resize.push(() => {
96
- NewsPopUpComponent.calculateHeight();
97
- });
98
- }
99
-
100
- componentDidUpdate() {
101
- const { item } = this.state;
102
- if (item != null) {
103
- // this.setDisqus();
104
- NewsPopUpComponent.setLightBox();
105
- setFade();
106
- }
107
- }
108
-
109
- componentWillUnmount() {
110
- const fade = document.getElementById('fade');
111
- if (fade) {
112
- fade.style.display = 'none';
113
- document.querySelector('body').style.overflowY = 'visible';
114
- document.documentElement.scrollTop = this.posBeforeShow;
115
- document.body.scrollTop = this.posBeforeShow;
116
- }
117
- }
118
-
119
- setDisqus() {
120
- const { item } = this.state;
121
- window.disqus_url = item.permalink;
122
- if (window.disqus_url !== '' && !item.comments_closed && item.id > 0) {
123
- if (!window.disqus_loaded) {
124
- $.getScript('//disqus.com/forums/rapexegesis/embed.js', () => {
125
- window.disqus_loaded = true;
126
- });
127
- } else {
128
- window.DISQUS.reset({
129
- reload: true,
130
- });
131
- }
132
- }
133
- }
134
-
135
- static setLightBox() {
136
- $('.au_news_popup a[rel="lightbox"]').magnificPopup({
137
- type: 'image',
138
- gallery: {
139
- enabled: true,
140
- },
141
- modal: false,
142
- });
143
- }
144
-
145
- render() {
146
- const { item } = this.state;
147
- const { lang } = this.props;
148
-
149
- let outerClassName = 'au_news_popup social';
150
- if (AUNewsHelpers.isiPad()) {
151
- outerClassName += ' ipad';
152
- }
153
-
154
- if (!item) {
155
- return (
156
- <div className={outerClassName}>
157
- <div className="au_news_popup_inner" tabIndex="0" />
158
- </div>
159
- );
160
- }
161
-
162
- const additionalInfo = item.links.length > 0
163
- || item.related.length > 0
164
- || item.files.length > 0;
165
- const renderCategories = null; /* item.categories ? item.categories.map(
166
- (c, j) => (
167
- <span key={c.category}>
168
- {`${j === 0 ? '' : ', '} ${c.category}`}
169
- </span>
170
- ),
171
- ) : ''; */
172
-
173
- const printUrl = window.location.href.replace(window.location.hash, `?newsprint=true${window.location.hash}`);
174
-
175
- return (
176
- <div className="au_news_popup social">
177
- <div className="au_news_popup_inner" tabIndex="0">
178
- <div className="au_news_overlay">
179
- <span className="au_news-single-print">
180
- <a
181
- href={printUrl}
182
- onClick={(e) => {
183
- e.preventDefault();
184
- window.open(printUrl, '', 'width=1025,height=600');
185
- }}
186
- >
187
- Print
188
- </a>
189
- </span>
190
- <NewsLanguageChangeComponent
191
- getItem={NewsPopUpComponent.getItem}
192
- item={item}
193
- lang={lang}
194
- />
195
- </div>
196
- <div className="au_news_overlay_wrapper">
197
- <h1
198
- className="au_news_overlay_header"
199
- dangerouslySetInnerHTML={{
200
- __html: item.header,
201
- }}
202
- />
203
- <div className="header_bg" />
204
- <div className="au_news-single-item au_news-single2-item">
205
- <p
206
- className="au_news-single-subheader"
207
- dangerouslySetInnerHTML={{
208
- __html: item.subheader,
209
- }}
210
- />
211
- {(() => {
212
- if (item.event_from == null) {
213
- return (
214
- <p className="au_news-legend">
215
- <span className="au_news-single-date">{item.date}</span>
216
- <span>
217
- <span className="au_news-date-author-separator"> | </span>
218
- <span className="aunews-single-author">
219
- <a href={`mailto:${item.author.email}`}>{item.author.name}</a>
220
- </span>
221
- </span>
222
- </p>
223
- );
224
- }
225
- return null;
226
- })()}
227
- {(() => {
228
- if (item.image.src !== '' && item.layout === 'Standard') {
229
- return (
230
- <div className="news-set1-img1all">
231
- <a href={item.image.href} title={item.image.title} rel="lightbox">
232
- <img
233
- src={item.image.src}
234
- alt={item.image.title}
235
- width={item.image.width}
236
- height={item.image.height}
237
- />
238
- </a>
239
- <p className="au_news-single2-imgcaption">{item.image.title}</p>
240
- </div>
241
- );
242
- }
243
- return null;
244
- })()}
245
- {(() => {
246
- if (item.event_from) {
247
- const fromDateSplit = item.event_from.date.split('.');
248
- const toDateSplit = item.event_to.date.split('.');
249
- let fromDate;
250
- let toDate;
251
-
252
- if (lang === 'en') {
253
- fromDate = new Date(
254
- parseInt(fromDateSplit[0], 10),
255
- parseInt(fromDateSplit[1], 10) - 1,
256
- parseInt(fromDateSplit[2], 10),
257
- );
258
- toDate = new Date(
259
- parseInt(toDateSplit[0], 10),
260
- parseInt(toDateSplit[1], 10) - 1,
261
- parseInt(toDateSplit[2], 10),
262
- );
263
- } else {
264
- fromDate = new Date(
265
- parseInt(fromDateSplit[2], 10),
266
- parseInt(fromDateSplit[1], 10) - 1,
267
- parseInt(fromDateSplit[0], 10),
268
- );
269
- toDate = new Date(
270
- parseInt(toDateSplit[2], 10),
271
- parseInt(toDateSplit[1], 10) - 1,
272
- parseInt(toDateSplit[0], 10),
273
- );
274
- }
275
-
276
- const differentDays = !(
277
- toDate.getFullYear() === fromDate.getFullYear()
278
- && toDate.getMonth() === fromDate.getMonth()
279
- && toDate.getDate() === fromDate.getDate()
280
- );
281
-
282
- return (
283
- <div>
284
- <table className="au_newsevent-event">
285
- <colgroup>
286
- <col className="first-col" />
287
- <col className="second-col" />
288
- </colgroup>
289
- <tbody>
290
- <tr className="au_newsevent_date_wrap">
291
- <td className="au_newsevent-date-text">{labels[lang].news.eventDate}</td>
292
- <td>
293
- <span className="au_newsevent-from-date">
294
- <span className="au_news_events_weekday">
295
- {`${labels[lang].news.weekdays[fromDate.getDay()]} `}
296
- </span>
297
- <span className="au_news_events_date">
298
- {`${fromDate.getDate() + (lang === 'da' ? '.' : '')} `}
299
- </span>
300
- <span className="au_news_events_month">
301
- {`${labels[lang].news.months[fromDate.getMonth()]} ${fromDate.getFullYear()}`}
302
- </span>
303
- </span>
304
- {(() => {
305
- if (differentDays) {
306
- return (
307
- <span>
308
- <span className="au_newsevent-to-text"> &mdash; </span>
309
- <span className="au_newsevent-to-date">
310
- <span className="au_news_events_weekday">
311
- {`${labels[lang].news.weekdays[toDate.getDay()]} `}
312
- </span>
313
- <span className="au_news_events_date">
314
- {`${toDate.getDate() + (lang === 'da' ? '.' : '')} `}
315
- </span>
316
- <span className="au_news_events_month">
317
- {`${labels[lang].news.months[toDate.getMonth()]} ${toDate.getFullYear()}`}
318
- </span>
319
- </span>
320
- </span>
321
- );
322
- }
323
- return null;
324
- })()}
325
-
326
- </td>
327
- </tr>
328
- <tr className="au_newsevent-row-even">
329
- <td className="au_newsevent-time-text">{labels[lang].news.eventTime}</td>
330
- <td>
331
- <span className="au_newsevent-from-time">{item.event_from.time}</span>
332
- {(() => {
333
- if (!differentDays) {
334
- return (
335
- <span>
336
- <span className="au_newsevent-to-text"> &mdash; </span>
337
- <span className="au_newsevent-to-time">{item.event_to.time}</span>
338
- </span>
339
- );
340
- }
341
- return null;
342
- })()}
343
- </td>
344
- </tr>
345
- <tr className="au_newsevent_where_wrap">
346
- <td className="au_newsevent-where-text">{labels[lang].news.eventWhere}</td>
347
- <td className="au_newsevent-where">{item.event_where}</td>
348
- </tr>
349
- </tbody>
350
- </table>
351
- {(() => {
352
- if (item.event_regurl !== '') {
353
- if (lang === 'da' && item.event_regfrom && item.event_regto) {
354
- const regFromDateSplit = item.event_regfrom.date.split('.');
355
- item.event_regfrom.date = `${regFromDateSplit[2]}.${regFromDateSplit[1]}.${regFromDateSplit[0]}`;
356
- const regToDateSplit = item.event_regto.date.split('.');
357
- item.event_regto.date = `${regToDateSplit[2]}.${regToDateSplit[1]}.${regToDateSplit[0]}`;
358
- }
359
-
360
- if (!(item.event_regfrom && item.event_regto) || (new Date() > new Date(item.event_regfrom.date.replace(/\./g, '-')) && new Date() < new Date(item.event_regto.date.replace(/\./g, '-')))) {
361
- return (
362
- <span className="au_newsevent_register">
363
- <a className="button" href={(item.event_regurl.indexOf('@') > -1 ? 'mailto:' : '') + item.event_regurl}>{labels[lang].news.eventRegistration}</a>
364
- </span>
365
- );
366
- }
367
- }
368
- return null;
369
- })()}
370
- </div>
371
- );
372
- }
373
- return null;
374
- })()}
375
- {(() => {
376
- const renderSubImages = item.subimages.map((s) => (
377
- <div key={s.href}>
378
- <a href={s.href} title={s.title} rel="lightbox">
379
- <img src={s.src} alt={s.title} width={s.width} height={s.height} />
380
- </a>
381
- <p className="au_news-single-imgcaption">
382
- {s.title}
383
- </p>
384
- </div>
385
- ));
386
-
387
- if (item.image.src !== '' && item.image.layout5 !== '' && item.layout === 'Alternativ 1') {
388
- return (
389
- <div className="au_news-single-sub-images">
390
- <div>
391
- <a href={item.image.href} title={item.image.title} rel="lightbox">
392
- <img src={item.image.layout5} alt={item.image.title} />
393
- </a>
394
- <p className="au_news-single-imgcaption">
395
- {item.image.title}
396
- </p>
397
- </div>
398
- {renderSubImages}
399
- </div>
400
- );
401
- }
402
-
403
- if (item.subimages.length > 0 && item.image.src !== '' && item.layout === 'Standard') {
404
- return (
405
- <div className="au_news-single-sub-images">
406
- {renderSubImages}
407
- </div>
408
- );
409
- }
410
- return null;
411
- })()}
412
- <div
413
- className="au_news_content"
414
- dangerouslySetInnerHTML={{
415
- __html: item.content,
416
- }}
417
- />
418
- {(() => {
419
- if (item.event_from) {
420
- return (
421
- <p className="au_news-legend">
422
- <span className="au_news-single-date">{item.date}</span>
423
- <span>
424
- <span className="au_news-date-author-separator"> | </span>
425
- <span className="aunews-single-author">
426
- <a href={`mailto:${item.author.email}`}>{item.author.name}</a>
427
- </span>
428
- </span>
429
- </p>
430
- );
431
- }
432
- return null;
433
- })()}
434
- <div className="au_news-single-news-category">
435
- <strong>{renderCategories}</strong>
436
- </div>
437
- <div className="au_news-single-news-permalink">
438
- <strong><a href={item.permalink}>{item.permalink}</a></strong>
439
- </div>
440
- {(() => {
441
- if (additionalInfo) {
442
- const renderLinks = item.links.map((l) => <a href={l.href}>{l.text}</a>);
443
-
444
- const renderRelated = item.related.map((r) => (
445
- <span>
446
- <a className="au_news-related-link" href={`${AUNewsConfig.newsUrl}${r.id}`}>{r.text}</a>
447
- {` ${r.date}`}
448
- </span>
449
- ));
450
-
451
- const renderFiles = item.files.map((f) => <a href={f.href}>{f.text}</a>);
452
-
453
- return (
454
- <div className="au_bt_dark au_bb_dark au_news-single-additional-info">
455
- {(() => {
456
- if (item.links.length > 0) {
457
- return (
458
- <dl className="au_news-single-links">
459
- <dt>Links</dt>
460
- <dd>
461
- {renderLinks}
462
- </dd>
463
- </dl>
464
- );
465
- }
466
- return null;
467
- })()}
468
- {(() => {
469
- if (item.related.length > 0) {
470
- return (
471
- <dl className="au_news-single-related">
472
- <dt>{lang === 'da' ? 'Læs også' : 'Read more'}</dt>
473
- <dd>
474
- {renderRelated}
475
- </dd>
476
- </dl>
477
- );
478
- }
479
- return null;
480
- })()}
481
- {(() => {
482
- if (item.files.length > 0) {
483
- return (
484
- <dl className="au_news-single-files">
485
- <dt>Download</dt>
486
- <dd>
487
- {renderFiles}
488
- </dd>
489
- </dl>
490
- );
491
- }
492
- return null;
493
- })()}
494
- </div>
495
- );
496
- }
497
- return null;
498
- })()}
499
- </div>
500
- {(() => {
501
- if (!item.comments_closed) {
502
- return <div id="disqus_thread" />;
503
- }
504
- return null;
505
- })()}
506
- </div>
507
- <NewsSocialComponent item={item} lang={lang} />
508
- </div>
509
- <button
510
- type="button"
511
- className="au_news_overlay_close"
512
- onClick={() => {
513
- window.location.hash = '';
514
- }}
515
- />
516
- </div>
517
- );
518
- }
519
- }
520
-
521
- NewsPopUpComponent.propTypes = {
522
- lang: PropTypes.string.isRequired,
523
- print: PropTypes.bool.isRequired,
524
- item: PropTypes.shape({
525
- type: PropTypes.number.isRequired,
526
- id: PropTypes.number.isRequired,
527
- header: PropTypes.string.isRequired,
528
- subheader: PropTypes.string.isRequired,
529
- url: PropTypes.string.isRequired,
530
- permalink: PropTypes.string.isRequired,
531
- comments_closed: PropTypes.bool.isRequired,
532
- links: PropTypes.arrayOf(PropTypes.shape({
533
- href: PropTypes.string.isRequired,
534
- text: PropTypes.string.isRequired,
535
- })).isRequired,
536
- categories: PropTypes.arrayOf(PropTypes.shape({
537
- category: PropTypes.string.isRequired,
538
- })).isRequired,
539
- files: PropTypes.arrayOf(PropTypes.shape({
540
- href: PropTypes.string.isRequired,
541
- text: PropTypes.string.isRequired,
542
- })).isRequired,
543
- related: PropTypes.arrayOf(PropTypes.shape({
544
- id: PropTypes.number.isRequired,
545
- text: PropTypes.string.isRequired,
546
- })).isRequired,
547
- event_from: PropTypes.shape({
548
- date: PropTypes.string,
549
- time: PropTypes.string,
550
- }),
551
- event_to: PropTypes.shape({
552
- date: PropTypes.string,
553
- time: PropTypes.string,
554
- }),
555
- event_where: PropTypes.string.isRequired,
556
- event_regfrom: PropTypes.shape({
557
- date: PropTypes.string,
558
- time: PropTypes.string,
559
- }),
560
- event_regto: PropTypes.shape({
561
- date: PropTypes.string,
562
- time: PropTypes.string,
563
- }),
564
- event_regurl: PropTypes.string.isRequired,
565
- date: PropTypes.string.isRequired,
566
- autor: PropTypes.shape({
567
- email: PropTypes.string.isRequired,
568
- name: PropTypes.string.isRequired,
569
- }).isRequired,
570
- image: PropTypes.shape({
571
- src: PropTypes.string.isRequired,
572
- href: PropTypes.string.isRequired,
573
- title: PropTypes.string.isRequired,
574
- width: PropTypes.string.isRequired,
575
- height: PropTypes.string.isRequired,
576
- layout5: PropTypes.string.isRequired,
577
- }),
578
- subimages: PropTypes.arrayOf(PropTypes.shape({
579
- href: PropTypes.string.isRequired,
580
- title: PropTypes.string.isRequired,
581
- width: PropTypes.string.isRequired,
582
- height: PropTypes.string.isRequired,
583
- })),
584
- layout: PropTypes.string.isRequired,
585
- content: PropTypes.string.isRequired,
586
- }).isRequired,
587
- id: PropTypes.number.isRequired,
588
- };
589
-
590
- NewsPopUpComponent.displayName = 'NewsPopUpComponent';
591
- export default NewsPopUpComponent;
@@ -1,74 +0,0 @@
1
- /* eslint jsx-a11y/click-events-have-key-events: 0 */
2
- /* eslint jsx-a11y/no-noninteractive-element-interactions: 0 */
3
- /* eslint jsx-a11y/interactive-supports-focus: 0 */
4
- /* eslint jsx-a11y/control-has-associated-label: 0 */
5
- import React from 'react';
6
- import PropTypes from 'prop-types';
7
- import { newsLabels as labels } from '../../lib/i18n';
8
-
9
- class NewsRSSComponent extends React.Component {
10
- constructor(props) {
11
- super(props);
12
-
13
- this.state = {
14
- wide: false,
15
- };
16
- }
17
-
18
- render() {
19
- const { wide } = this.state;
20
- const { url, lang } = this.props;
21
- return (
22
- <ul>
23
- <li
24
- className={`rss header-click-btn${wide ? ' wide' : ''}`}
25
- title={labels[lang].news.rssAdd}
26
- onClick={() => {
27
- this.setState((prevState) => ({
28
- wide: !prevState.wide,
29
- }));
30
- }}
31
- >
32
- {(() => {
33
- if (wide) {
34
- return (
35
- <div
36
- role="button"
37
- onClick={(e) => {
38
- e.stopPropagation();
39
- }}
40
- >
41
- <div
42
- role="button"
43
- className="close"
44
- onClick={(e) => {
45
- e.stopPropagation();
46
- this.setState({
47
- wide: false,
48
- });
49
- }}
50
- />
51
- <h2>
52
- {'RSS '}
53
- <strong>feed</strong>
54
- </h2>
55
- <p>{labels[lang].news.rssCopy}</p>
56
- <input type="text" value={url} readOnly />
57
- </div>
58
- );
59
- }
60
- return null;
61
- })()}
62
- </li>
63
- </ul>
64
- );
65
- }
66
- }
67
-
68
- NewsRSSComponent.propTypes = {
69
- url: PropTypes.string.isRequired,
70
- lang: PropTypes.string.isRequired,
71
- };
72
-
73
- NewsRSSComponent.displayName = 'NewsRSSComponent';
74
- export default NewsRSSComponent;