@entur-partner/common 9.3.3-alpha.0 → 9.3.3-alpha.1
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/dist/ActionBar.d.ts +9 -9
- package/dist/AuditInfo.d.ts +14 -14
- package/dist/Box.d.ts +57 -57
- package/dist/Breadcrumbs.d.ts +8 -8
- package/dist/ConfirmModal.d.ts +28 -28
- package/dist/Content.d.ts +10 -10
- package/dist/EnturPartnerLogo.d.ts +19 -19
- package/dist/ErrorBoundary.d.ts +22 -22
- package/dist/ExpandableMultiLanguageInput.d.ts +17 -17
- package/dist/FeatureToggle.d.ts +25 -25
- package/dist/FormatCurrencyAmount.d.ts +8 -8
- package/dist/FormatDateTime.d.ts +7 -7
- package/dist/LanguageSelect.d.ts +16 -16
- package/dist/LegacyPageTitle.d.ts +16 -0
- package/dist/Link.d.ts +6 -6
- package/dist/LinkButton.d.ts +8 -8
- package/dist/Menu.d.ts +10 -10
- package/dist/MultiLanguageInput.d.ts +28 -28
- package/dist/OrganisationDropdown.d.ts +14 -14
- package/dist/PageTitle.d.ts +6 -15
- package/dist/Pager.d.ts +8 -8
- package/dist/PermissionCheck.d.ts +24 -24
- package/dist/RouteLeavingGuard.d.ts +14 -14
- package/dist/Stack.d.ts +9 -9
- package/dist/StatusLabel.d.ts +11 -11
- package/dist/Text.d.ts +21 -21
- package/dist/Unbutton.d.ts +7 -7
- package/dist/UserMenu/components/CookieSettingsMenuItem.d.ts +9 -9
- package/dist/UserMenu/components/CustomOverflowMenu.d.ts +11 -11
- package/dist/UserMenu/components/CustomOverflowMenuItem.d.ts +3 -3
- package/dist/UserMenu/components/LanguageSwitchMenuItem.d.ts +10 -10
- package/dist/UserMenu/components/LogOutMenuItem.d.ts +9 -9
- package/dist/UserMenu/components/UserMenuItem.d.ts +9 -9
- package/dist/UserMenu/components/VersionMenuItem.d.ts +5 -5
- package/dist/UserMenu/index.d.ts +26 -25
- package/dist/UserMenu/useOutsideClick.d.ts +2 -2
- package/dist/common.cjs.development.js +199 -191
- package/dist/common.cjs.development.js.map +1 -1
- package/dist/common.cjs.production.min.js +1 -1
- package/dist/common.cjs.production.min.js.map +1 -1
- package/dist/common.esm.js +79 -67
- package/dist/common.esm.js.map +1 -1
- package/dist/environment.d.ts +13 -13
- package/dist/index.d.ts +31 -30
- package/dist/styles.css +185 -185
- package/dist/useEventListener.d.ts +3 -3
- package/package.json +6 -6
|
@@ -13,73 +13,56 @@ var typography = require('@entur/typography');
|
|
|
13
13
|
var alert = require('@entur/alert');
|
|
14
14
|
var expand = require('@entur/expand');
|
|
15
15
|
var form = require('@entur/form');
|
|
16
|
-
var dropdown = require('@entur/dropdown');
|
|
17
16
|
var reactHelmetAsync = require('react-helmet-async');
|
|
17
|
+
var dropdown = require('@entur/dropdown');
|
|
18
18
|
var icons = require('@entur/icons');
|
|
19
19
|
|
|
20
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
|
-
|
|
22
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
|
-
|
|
25
20
|
var ActionBarLeft = function ActionBarLeft(_ref) {
|
|
26
21
|
var children = _ref.children;
|
|
27
|
-
return
|
|
22
|
+
return React.createElement("div", {
|
|
28
23
|
className: "eps-action-bar-left"
|
|
29
24
|
}, children);
|
|
30
25
|
};
|
|
31
26
|
var ActionBarRight = function ActionBarRight(_ref2) {
|
|
32
27
|
var children = _ref2.children;
|
|
33
|
-
return
|
|
28
|
+
return React.createElement("div", {
|
|
34
29
|
className: "eps-action-bar-right"
|
|
35
30
|
}, children);
|
|
36
31
|
};
|
|
37
32
|
var ActionBar = function ActionBar(_ref3) {
|
|
38
33
|
var children = _ref3.children;
|
|
39
|
-
return
|
|
34
|
+
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
40
35
|
className: "eps-action-bar-padding"
|
|
41
|
-
}),
|
|
36
|
+
}), React.createElement("div", {
|
|
42
37
|
className: "eps-action-bar"
|
|
43
38
|
}, children));
|
|
44
39
|
};
|
|
45
40
|
|
|
46
41
|
function _extends() {
|
|
47
|
-
_extends = Object.assign ? Object.assign.bind() : function (
|
|
48
|
-
for (var
|
|
49
|
-
var
|
|
50
|
-
for (var
|
|
51
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
52
|
-
target[key] = source[key];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
42
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
43
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
44
|
+
var t = arguments[e];
|
|
45
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
55
46
|
}
|
|
56
|
-
return
|
|
57
|
-
};
|
|
58
|
-
return _extends.apply(this, arguments);
|
|
59
|
-
}
|
|
60
|
-
function _inheritsLoose(subClass, superClass) {
|
|
61
|
-
subClass.prototype = Object.create(superClass.prototype);
|
|
62
|
-
subClass.prototype.constructor = subClass;
|
|
63
|
-
_setPrototypeOf(subClass, superClass);
|
|
47
|
+
return n;
|
|
48
|
+
}, _extends.apply(null, arguments);
|
|
64
49
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
67
|
-
o.__proto__ = p;
|
|
68
|
-
return o;
|
|
69
|
-
};
|
|
70
|
-
return _setPrototypeOf(o, p);
|
|
50
|
+
function _inheritsLoose(t, o) {
|
|
51
|
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
71
52
|
}
|
|
72
|
-
function _objectWithoutPropertiesLoose(
|
|
73
|
-
if (
|
|
74
|
-
var
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
key = sourceKeys[i];
|
|
79
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
80
|
-
target[key] = source[key];
|
|
53
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
54
|
+
if (null == r) return {};
|
|
55
|
+
var t = {};
|
|
56
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
57
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
58
|
+
t[n] = r[n];
|
|
81
59
|
}
|
|
82
|
-
return
|
|
60
|
+
return t;
|
|
61
|
+
}
|
|
62
|
+
function _setPrototypeOf(t, e) {
|
|
63
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
64
|
+
return t.__proto__ = e, t;
|
|
65
|
+
}, _setPrototypeOf(t, e);
|
|
83
66
|
}
|
|
84
67
|
|
|
85
68
|
var _excluded$e = ["date", "locale", "as", "hideTime"];
|
|
@@ -90,7 +73,7 @@ var FormatDateTime = function FormatDateTime(_ref) {
|
|
|
90
73
|
Component = _ref$as === void 0 ? "main" : _ref$as,
|
|
91
74
|
hideTime = _ref.hideTime,
|
|
92
75
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
93
|
-
return
|
|
76
|
+
return React.createElement(Component, _extends({}, rest), hideTime ? util.localeDate(date, locale) : util.localeDateTime(date, locale));
|
|
94
77
|
};
|
|
95
78
|
|
|
96
79
|
var _excluded$d = ["as", "children", "contrast", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "padding", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "margin", "display", "justifyContent", "alignItems", "maxWidth", "width", "background", "color", "flexDirection", "flexWrap", "className"];
|
|
@@ -163,8 +146,8 @@ var Box = function Box(_ref) {
|
|
|
163
146
|
background && classes.push("eps-bg-" + background);
|
|
164
147
|
flexDirection && classes.push.apply(classes, responsiveProp("eps-flex-", flexDirection));
|
|
165
148
|
flexWrap && classes.push.apply(classes, responsiveProp("eps-flex-wrap-", flexWrap));
|
|
166
|
-
var classList =
|
|
167
|
-
return
|
|
149
|
+
var classList = cx(classes, className);
|
|
150
|
+
return React.createElement(Component, _extends({
|
|
168
151
|
className: classList
|
|
169
152
|
}, rest), children);
|
|
170
153
|
};
|
|
@@ -176,14 +159,14 @@ var Stack = function Stack(_ref) {
|
|
|
176
159
|
className = _ref.className;
|
|
177
160
|
var stackItems = React.Children.toArray(children);
|
|
178
161
|
if (stackItems.length <= 1) {
|
|
179
|
-
return
|
|
162
|
+
return React.createElement(React.Fragment, null, stackItems);
|
|
180
163
|
}
|
|
181
|
-
return
|
|
164
|
+
return React.createElement("div", {
|
|
182
165
|
className: className
|
|
183
166
|
}, stackItems.map(function (child, index) {
|
|
184
|
-
return index === stackItems.length - 1 ?
|
|
167
|
+
return index === stackItems.length - 1 ? React.createElement("div", {
|
|
185
168
|
key: index
|
|
186
|
-
}, child) :
|
|
169
|
+
}, child) : React.createElement(Box, {
|
|
187
170
|
paddingBottom: space,
|
|
188
171
|
key: index
|
|
189
172
|
}, child);
|
|
@@ -196,21 +179,21 @@ var AuditInfo = function AuditInfo(_ref) {
|
|
|
196
179
|
locale = _ref.locale,
|
|
197
180
|
className = _ref.className,
|
|
198
181
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
199
|
-
var classNames =
|
|
200
|
-
return
|
|
182
|
+
var classNames = cx("ep-audit-info", className);
|
|
183
|
+
return React.createElement("div", _extends({
|
|
201
184
|
className: classNames
|
|
202
185
|
}, rest), items.map(function (_ref2) {
|
|
203
186
|
var label = _ref2.label,
|
|
204
187
|
value = _ref2.value;
|
|
205
|
-
return
|
|
188
|
+
return React.createElement(Stack, {
|
|
206
189
|
space: "small",
|
|
207
190
|
key: value.toString()
|
|
208
|
-
},
|
|
191
|
+
}, React.createElement("div", {
|
|
209
192
|
className: "ep-audit-info-label"
|
|
210
|
-
}, label),
|
|
193
|
+
}, label), React.createElement("div", null, util.isDate(value) || util.isDateString(value) ? React.createElement(FormatDateTime, {
|
|
211
194
|
date: value,
|
|
212
195
|
locale: locale
|
|
213
|
-
}) :
|
|
196
|
+
}) : React.createElement("span", null, value)));
|
|
214
197
|
}));
|
|
215
198
|
};
|
|
216
199
|
|
|
@@ -233,21 +216,21 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
|
233
216
|
path = _ref3.path;
|
|
234
217
|
var isLast = i === breadcrumbs.length - 1;
|
|
235
218
|
if (isLast) {
|
|
236
|
-
return
|
|
219
|
+
return React.createElement(menu.BreadcrumbItem, {
|
|
237
220
|
key: path,
|
|
238
221
|
as: "span"
|
|
239
222
|
}, title);
|
|
240
223
|
}
|
|
241
|
-
return
|
|
224
|
+
return React.createElement(menu.BreadcrumbItem, {
|
|
242
225
|
key: path,
|
|
243
226
|
as: reactRouterDom.Link,
|
|
244
227
|
to: path
|
|
245
228
|
}, title);
|
|
246
229
|
});
|
|
247
230
|
if (prependBreadcrumbItem) {
|
|
248
|
-
return
|
|
231
|
+
return React.createElement(menu.BreadcrumbNavigation, null, [prependBreadcrumbItem].concat(breadcrumbElements));
|
|
249
232
|
}
|
|
250
|
-
return
|
|
233
|
+
return React.createElement(menu.BreadcrumbNavigation, null, breadcrumbElements);
|
|
251
234
|
};
|
|
252
235
|
|
|
253
236
|
var _excluded$b = ["isOpen", "children", "message", "size", "buttons", "onConfirm", "messages", "onClose", "onDismiss"];
|
|
@@ -266,16 +249,16 @@ var ConfirmModal = function ConfirmModal(_ref) {
|
|
|
266
249
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
267
250
|
var childrenToRender = children ? children : message;
|
|
268
251
|
var handleDismiss = onClose ? onClose : onDismiss;
|
|
269
|
-
return
|
|
252
|
+
return React.createElement(modal.Modal, _extends({
|
|
270
253
|
size: size,
|
|
271
254
|
open: isOpen,
|
|
272
255
|
onDismiss: handleDismiss
|
|
273
|
-
}, rest), util.isString(childrenToRender) ?
|
|
256
|
+
}, rest), util.isString(childrenToRender) ? React.createElement(typography.Paragraph, null, childrenToRender) : React.createElement(Box, {
|
|
274
257
|
paddingBottom: "medium"
|
|
275
|
-
}, childrenToRender),
|
|
258
|
+
}, childrenToRender), React.createElement(button.ButtonGroup, null, onConfirm ? React.createElement(React.Fragment, null, React.createElement(button.SecondaryButton, {
|
|
276
259
|
onClick: handleDismiss,
|
|
277
260
|
"data-testid": "cancel-modal-button"
|
|
278
|
-
}, messages.cancel),
|
|
261
|
+
}, messages.cancel), React.createElement(button.PrimaryButton, {
|
|
279
262
|
onClick: onConfirm,
|
|
280
263
|
"data-testid": "confirm-modal-button"
|
|
281
264
|
}, messages.confirm)) : buttons));
|
|
@@ -286,8 +269,8 @@ var Content = function Content(_ref) {
|
|
|
286
269
|
Component = _ref$as === void 0 ? "main" : _ref$as,
|
|
287
270
|
className = _ref.className,
|
|
288
271
|
children = _ref.children;
|
|
289
|
-
var classList =
|
|
290
|
-
return
|
|
272
|
+
var classList = cx(["eps-content", className]);
|
|
273
|
+
return React.createElement(Component, {
|
|
291
274
|
className: classList
|
|
292
275
|
}, children);
|
|
293
276
|
};
|
|
@@ -301,10 +284,10 @@ exports.Environment = void 0;
|
|
|
301
284
|
Environment["Production"] = "prod";
|
|
302
285
|
})(exports.Environment || (exports.Environment = {}));
|
|
303
286
|
var environmentColors = (_environmentColors = {}, _environmentColors[exports.Environment.Local] = "#B482FB", _environmentColors[exports.Environment.Development] = "#5AC39A", _environmentColors[exports.Environment.Staging] = "#FFCA28", _environmentColors);
|
|
304
|
-
/**
|
|
305
|
-
* Gets the color for the given environment. This is the color used for the environment
|
|
306
|
-
* indicator. There is no color for production as it should not have any special environment
|
|
307
|
-
* indication.
|
|
287
|
+
/**
|
|
288
|
+
* Gets the color for the given environment. This is the color used for the environment
|
|
289
|
+
* indicator. There is no color for production as it should not have any special environment
|
|
290
|
+
* indication.
|
|
308
291
|
*/
|
|
309
292
|
var getColorForEnvironment = function getColorForEnvironment(environment) {
|
|
310
293
|
return environmentColors[environment];
|
|
@@ -320,25 +303,25 @@ var EnturPartnerLogoSvg = function EnturPartnerLogoSvg(_ref) {
|
|
|
320
303
|
_ref$accentColor = _ref.accentColor,
|
|
321
304
|
accentColor = _ref$accentColor === void 0 ? "#FF5959" : _ref$accentColor,
|
|
322
305
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
323
|
-
return
|
|
306
|
+
return React.createElement("svg", _extends({
|
|
324
307
|
width: 257,
|
|
325
308
|
height: 37,
|
|
326
309
|
viewBox: "0 0 257 37"
|
|
327
|
-
}, rest),
|
|
310
|
+
}, rest), React.createElement("title", null, title), React.createElement("g", {
|
|
328
311
|
fill: "none",
|
|
329
312
|
fillRule: "evenodd"
|
|
330
|
-
},
|
|
313
|
+
}, React.createElement("path", {
|
|
331
314
|
fill: "#FFF",
|
|
332
315
|
d: "M0 .231V25.72h18.745v-4.318H4.869v-6.163h12.31v-4.318H4.87V4.55h13.876V.231z"
|
|
333
|
-
}),
|
|
316
|
+
}), React.createElement("path", {
|
|
334
317
|
fill: accentColor,
|
|
335
318
|
d: "M0 36.408h45.253v-4.32H0z"
|
|
336
|
-
}),
|
|
319
|
+
}), React.createElement("path", {
|
|
337
320
|
fill: "#FFF",
|
|
338
321
|
d: "M40.384.231v15.425L23.656.231h-.521V25.72h4.869V10.573L44.732 25.72h.521V.23zM69.25 15.238h-7.267v21.17h-4.87v-21.17H49.81V10.92h19.44zM83.863 36.86c-1.646 0-3.142-.255-4.486-.765-1.345-.51-2.493-1.23-3.443-2.159-.95-.928-1.687-2.054-2.208-3.378-.522-1.323-.783-2.797-.783-4.422V10.92h4.869v15.216c0 1.277.209 2.333.626 3.169.417.836.933 1.497 1.548 1.985a5.346 5.346 0 001.982 1.01c.707.186 1.339.278 1.895.278.557 0 1.188-.092 1.896-.279a5.35 5.35 0 001.982-1.01c.614-.487 1.13-1.148 1.548-1.984.417-.836.625-1.892.625-3.169V10.92h4.87v15.216c0 1.625-.256 3.1-.766 4.422-.51 1.324-1.24 2.45-2.19 3.378-.952.929-2.1 1.648-3.444 2.159-1.344.51-2.851.766-4.52.766M104.21 24.047h5.546c1.016 0 1.854-.127 2.513-.383.658-.255 1.179-.592 1.56-1.01.381-.418.641-.888.78-1.41.138-.522.208-1.05.208-1.584 0-.627-.099-1.207-.295-1.741a3.718 3.718 0 00-.901-1.393c-.405-.394-.924-.708-1.56-.94-.636-.232-1.404-.348-2.305-.348h-5.546v8.81zm0 4.248v8.113h-4.87V10.92h11.567c1.3 0 2.49.215 3.57.644 1.08.43 2.004 1.033 2.77 1.81a8.287 8.287 0 011.794 2.787c.43 1.079.645 2.257.645 3.534 0 .952-.128 1.874-.383 2.768-.256.894-.61 1.7-1.063 2.42a7.32 7.32 0 01-1.672 1.863 5.929 5.929 0 01-2.178 1.096l6.339 8.566h-5.808l-5.893-8.113h-4.818z"
|
|
339
|
-
}),
|
|
322
|
+
}), React.createElement("g", {
|
|
340
323
|
fill: accentColor
|
|
341
|
-
},
|
|
324
|
+
}, React.createElement("path", {
|
|
342
325
|
d: "M141.051 23.448h5.628c4.185 0 5.989-1.984 5.989-4.942 0-2.742-1.515-4.618-5.989-4.618h-5.628v9.56zm0 3.067v9.776h-3.571V10.75h9.632c6.674 0 9.127 3.211 9.127 7.54 0 4.979-3.102 8.226-9.2 8.226h-5.988zM169.695 28.715c-1.371-.288-2.958-.505-4.401-.505-2.85 0-4.041 1.263-4.041 3.139s1.407 2.706 3.463 2.706c2.49 0 4.979-1.443 4.979-4.221v-1.119zm-4.293-2.958c1.551 0 3.174.253 4.293.469v-.83c0-2.525-1.154-3.896-4.33-3.896-2.164 0-3.824.866-4.942 2.092l-2.02-2.272c1.732-1.66 3.644-2.598 7.07-2.598 5.052 0 7.469 1.876 7.469 7.215v10.354h-3.211V34.02h-.108c-1.082 1.767-3.211 2.705-5.592 2.705-3.32 0-6.241-1.66-6.241-5.303 0-3.103 1.912-5.664 7.612-5.664zM178.965 19.191h3.211v2.886h.108c.938-1.984 2.922-3.355 5.231-3.355.47 0 .938.036 1.335.144l-.144 3.14a6.77 6.77 0 00-1.552-.181c-3.246 0-4.798 2.633-4.798 5.483v8.983h-3.39v-17.1zM199.961 36.291h-1.912c-4.004 0-5.988-.938-5.988-5.772v-8.55h-2.778V19.19h2.778v-4.654h3.355v4.654h4.473v2.778h-4.473v7.973c0 3.427 1.587 3.535 3.319 3.535h1.226v2.814zM219.767 36.291h-3.391V26.84c0-2.778-1.083-5.375-4.257-5.375-3.14 0-5.268 2.597-5.268 6.169v8.658h-3.391v-17.1h3.32v2.814h.143c.794-1.623 3.067-3.283 5.99-3.283 4.941 0 6.854 3.644 6.854 8.081v9.488zM227.847 26.262h10.57c0-2.597-2.272-4.726-5.087-4.726-2.922 0-5.014 1.948-5.483 4.726zm-.036 2.453c.397 3.355 2.633 5.195 5.844 5.195 2.778 0 4.618-1.623 5.484-2.67l2.164 1.804c-1.37 1.913-4.365 3.716-8.045 3.716-4.942 0-8.73-3.535-8.73-8.55 0-5.195 3.752-9.488 8.983-9.488 5.303 0 8.009 4.365 8.009 8.19 0 .649-.036 1.226-.072 1.803H227.81zM246.245 19.191h3.21v2.886h.109c.938-1.984 2.922-3.355 5.231-3.355.469 0 .938.036 1.335.144l-.145 3.14a6.77 6.77 0 00-1.551-.181c-3.247 0-4.798 2.633-4.798 5.483v8.983h-3.391v-17.1z"
|
|
343
326
|
}))));
|
|
344
327
|
};
|
|
@@ -348,10 +331,10 @@ var EnturPartnerLogo = function EnturPartnerLogo(_ref2) {
|
|
|
348
331
|
className = _ref2.className,
|
|
349
332
|
altText = _ref2.altText,
|
|
350
333
|
environment = _ref2.environment;
|
|
351
|
-
var classList =
|
|
352
|
-
return
|
|
334
|
+
var classList = cx(["eps-logo-wrapper", className]);
|
|
335
|
+
return React.createElement(Component, {
|
|
353
336
|
className: classList
|
|
354
|
-
},
|
|
337
|
+
}, React.createElement(EnturPartnerLogoSvg, {
|
|
355
338
|
title: altText,
|
|
356
339
|
className: "logo",
|
|
357
340
|
accentColor: environment !== undefined && environment !== exports.Environment.Production ? getColorForEnvironment(environment) : undefined
|
|
@@ -397,7 +380,7 @@ var ErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
|
397
380
|
error: error
|
|
398
381
|
});
|
|
399
382
|
} else if (error.name === "NotFoundError" && error.message === newAppVersionErrorMessage) {
|
|
400
|
-
return
|
|
383
|
+
return React.createElement(RefreshBannerInfo, null);
|
|
401
384
|
}
|
|
402
385
|
return fallback;
|
|
403
386
|
}
|
|
@@ -410,16 +393,16 @@ function RefreshBannerInfo() {
|
|
|
410
393
|
// Taken from ./app-shell/src/storage.ts
|
|
411
394
|
var language = localStorage.getItem(LANGUAGE_STORAGE_KEY);
|
|
412
395
|
var isNorwegian = language === "nb" || language === "nb-NO";
|
|
413
|
-
return
|
|
396
|
+
return React.createElement(Box, {
|
|
414
397
|
maxWidth: "large"
|
|
415
|
-
},
|
|
398
|
+
}, React.createElement(alert.BannerAlertBox, {
|
|
416
399
|
variant: "info",
|
|
417
400
|
title: isNorwegian ? "En ny versjon av nettsiden er tilgjengelig." : "A new version of the website is available."
|
|
418
|
-
},
|
|
401
|
+
}, React.createElement(Box, {
|
|
419
402
|
paddingBottom: "medium"
|
|
420
|
-
},
|
|
403
|
+
}, React.createElement(typography.Paragraph, {
|
|
421
404
|
margin: "none"
|
|
422
|
-
}, isNorwegian ? "Vennligst oppdater." : "Please refresh.")),
|
|
405
|
+
}, isNorwegian ? "Vennligst oppdater." : "Please refresh.")), React.createElement(button.PrimaryButton, {
|
|
423
406
|
onClick: function onClick() {
|
|
424
407
|
return window.location.reload();
|
|
425
408
|
}
|
|
@@ -446,7 +429,7 @@ var ExpandableMultiLanguageInput = function ExpandableMultiLanguageInput(_ref) {
|
|
|
446
429
|
}
|
|
447
430
|
onChange(changes);
|
|
448
431
|
};
|
|
449
|
-
return
|
|
432
|
+
return React.createElement(expand.ExpandablePanel, {
|
|
450
433
|
title: title,
|
|
451
434
|
defaultOpen: true,
|
|
452
435
|
contentStyle: {
|
|
@@ -454,13 +437,13 @@ var ExpandableMultiLanguageInput = function ExpandableMultiLanguageInput(_ref) {
|
|
|
454
437
|
marginTop: "16px",
|
|
455
438
|
marginBottom: "16px"
|
|
456
439
|
}
|
|
457
|
-
},
|
|
440
|
+
}, React.createElement(Stack, {
|
|
458
441
|
space: "medium"
|
|
459
442
|
}, languages.map(function (_ref2) {
|
|
460
443
|
var langKey = _ref2.value,
|
|
461
444
|
label = _ref2.label,
|
|
462
445
|
required = _ref2.required;
|
|
463
|
-
return
|
|
446
|
+
return React.createElement(InputComponent, _extends({
|
|
464
447
|
"data-testid": "multi-lang-input-" + name + "-" + langKey,
|
|
465
448
|
key: title + langKey,
|
|
466
449
|
label: required ? label + "*" : label,
|
|
@@ -476,23 +459,23 @@ var ExpandableMultiLanguageInput = function ExpandableMultiLanguageInput(_ref) {
|
|
|
476
459
|
};
|
|
477
460
|
|
|
478
461
|
/// <reference types="vite/client" />
|
|
479
|
-
/**
|
|
480
|
-
* Returns true if the provided flag exist in localStorage
|
|
481
|
-
* or is set as an environment variable.
|
|
482
|
-
*
|
|
483
|
-
* @param flag case sensitive flag. If it is an environment variable
|
|
484
|
-
* you can drop the VITE_APP_ prefix.
|
|
462
|
+
/**
|
|
463
|
+
* Returns true if the provided flag exist in localStorage
|
|
464
|
+
* or is set as an environment variable.
|
|
465
|
+
*
|
|
466
|
+
* @param flag case sensitive flag. If it is an environment variable
|
|
467
|
+
* you can drop the VITE_APP_ prefix.
|
|
485
468
|
*/
|
|
486
469
|
function featureFlag(flag) {
|
|
487
470
|
var _window$localStorage, _window$localStorage2;
|
|
488
471
|
return undefined["VITE_APP_" + flag] === "true" || ((_window$localStorage = window.localStorage) == null ? void 0 : _window$localStorage.getItem(flag)) === "true" || ((_window$localStorage2 = window.localStorage) == null ? void 0 : _window$localStorage2.getItem("VITE_APP_" + flag)) === "true";
|
|
489
472
|
}
|
|
490
|
-
/**
|
|
491
|
-
* Returns true if the provided flag exist in localStorage
|
|
492
|
-
* or is set as an environment variable.
|
|
493
|
-
*
|
|
494
|
-
* @param flag case sensitive flag. If it is an environment variable
|
|
495
|
-
* you can drop the VITE_APP_ prefix.
|
|
473
|
+
/**
|
|
474
|
+
* Returns true if the provided flag exist in localStorage
|
|
475
|
+
* or is set as an environment variable.
|
|
476
|
+
*
|
|
477
|
+
* @param flag case sensitive flag. If it is an environment variable
|
|
478
|
+
* you can drop the VITE_APP_ prefix.
|
|
496
479
|
*/
|
|
497
480
|
function useFeatureToggle(flag) {
|
|
498
481
|
return featureFlag(flag);
|
|
@@ -502,7 +485,7 @@ var FeatureToggle = function FeatureToggle(_ref) {
|
|
|
502
485
|
flag = _ref.flag;
|
|
503
486
|
var feature = useFeatureToggle(flag);
|
|
504
487
|
if (feature) {
|
|
505
|
-
return
|
|
488
|
+
return React.createElement(React.Fragment, null, children);
|
|
506
489
|
}
|
|
507
490
|
return null;
|
|
508
491
|
};
|
|
@@ -518,7 +501,7 @@ var FormatCurrencyAmount = function FormatCurrencyAmount(_ref) {
|
|
|
518
501
|
maximumFractionDigits: 2,
|
|
519
502
|
minimumFractionDigits: 2
|
|
520
503
|
}).format(parsedAmount);
|
|
521
|
-
return
|
|
504
|
+
return React.createElement(Component, _extends({}, rest), formattedAmount);
|
|
522
505
|
};
|
|
523
506
|
|
|
524
507
|
var _excluded$7 = ["language", "options", "className", "onChange"];
|
|
@@ -528,27 +511,55 @@ var LanguageSelect = function LanguageSelect(_ref) {
|
|
|
528
511
|
className = _ref.className,
|
|
529
512
|
_onChange = _ref.onChange,
|
|
530
513
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
531
|
-
var classNames =
|
|
532
|
-
return
|
|
514
|
+
var classNames = cx("eps-language-select", className);
|
|
515
|
+
return React.createElement("div", _extends({}, rest, {
|
|
533
516
|
className: classNames
|
|
534
|
-
}),
|
|
517
|
+
}), React.createElement(form.SegmentedControl, {
|
|
535
518
|
onChange: function onChange(language) {
|
|
536
519
|
util.assertIsDefined(language);
|
|
537
520
|
_onChange(language);
|
|
538
521
|
},
|
|
539
522
|
selectedValue: language
|
|
540
523
|
}, options.map(function (option) {
|
|
541
|
-
return
|
|
524
|
+
return React.createElement(form.SegmentedChoice, {
|
|
542
525
|
key: option.value,
|
|
543
526
|
value: option.value
|
|
544
|
-
}, option.label, option.required &&
|
|
527
|
+
}, option.label, option.required && React.createElement("span", {
|
|
545
528
|
className: "asterisk-margin"
|
|
546
529
|
}, "*"));
|
|
547
530
|
})));
|
|
548
531
|
};
|
|
549
532
|
|
|
533
|
+
/**
|
|
534
|
+
* @deprecated Won't work with React 19, because of react-helmet-async
|
|
535
|
+
* This component changes page title by using helmet and current path. It will translate subpaths, join them with a dash
|
|
536
|
+
* and display it on browser tab.
|
|
537
|
+
*
|
|
538
|
+
* @param Props.pathname - The current path from react-router-dom.useLocation()
|
|
539
|
+
* @param Props.onBreadcrumbLookup - A function that takes a path and returns a i18n translated string or undefined
|
|
540
|
+
* @returns A Helmet component with updated title
|
|
541
|
+
*/
|
|
542
|
+
var LegacyPageTitle = function LegacyPageTitle(_ref) {
|
|
543
|
+
var pathname = _ref.pathname,
|
|
544
|
+
onBreadcrumbLookup = _ref.onBreadcrumbLookup;
|
|
545
|
+
var paths = util.splitUrlPath(pathname);
|
|
546
|
+
var pageTitles = paths.map(function (path) {
|
|
547
|
+
return {
|
|
548
|
+
title: onBreadcrumbLookup(path),
|
|
549
|
+
path: path
|
|
550
|
+
};
|
|
551
|
+
}).filter(function (_ref2) {
|
|
552
|
+
var title = _ref2.title;
|
|
553
|
+
return title !== undefined;
|
|
554
|
+
}).map(function (_ref3) {
|
|
555
|
+
var title = _ref3.title;
|
|
556
|
+
return title;
|
|
557
|
+
}).reverse().join(" | ");
|
|
558
|
+
return React.createElement(reactHelmetAsync.Helmet, null, React.createElement("title", null, pageTitles, " | Entur Partner"));
|
|
559
|
+
};
|
|
560
|
+
|
|
550
561
|
var Link = function Link(props) {
|
|
551
|
-
return
|
|
562
|
+
return React.createElement(typography.Link, _extends({}, props, {
|
|
552
563
|
as: reactRouterDom.Link
|
|
553
564
|
}), props.children);
|
|
554
565
|
};
|
|
@@ -558,9 +569,9 @@ var LinkButton = function LinkButton(_ref) {
|
|
|
558
569
|
var children = _ref.children,
|
|
559
570
|
className = _ref.className,
|
|
560
571
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
561
|
-
return
|
|
572
|
+
return React.createElement(typography.Link, _extends({}, rest, {
|
|
562
573
|
as: "button",
|
|
563
|
-
className:
|
|
574
|
+
className: cx("eps-link-button", className)
|
|
564
575
|
}), children);
|
|
565
576
|
};
|
|
566
577
|
|
|
@@ -569,15 +580,15 @@ var Menu = function Menu(_ref) {
|
|
|
569
580
|
Component = _ref$as === void 0 ? "nav" : _ref$as,
|
|
570
581
|
className = _ref.className,
|
|
571
582
|
children = _ref.children;
|
|
572
|
-
var classList =
|
|
573
|
-
return
|
|
583
|
+
var classList = cx(["eds-contrast", "eps-menu", className]);
|
|
584
|
+
return React.createElement(Component, {
|
|
574
585
|
className: classList
|
|
575
586
|
}, children);
|
|
576
587
|
};
|
|
577
588
|
|
|
578
589
|
var _excluded$5 = ["className", "inputComponent", "alertLabel", "alertLevel", "name", "languages", "values", "onChange", "defaultLanguage", "label", "onBlur"];
|
|
579
|
-
/**
|
|
580
|
-
* @deprecated use ExpandableMultiLanguageInput
|
|
590
|
+
/**
|
|
591
|
+
* @deprecated use ExpandableMultiLanguageInput
|
|
581
592
|
*/
|
|
582
593
|
var MultiLanguageInput = function MultiLanguageInput(_ref) {
|
|
583
594
|
var className = _ref.className,
|
|
@@ -598,7 +609,7 @@ var MultiLanguageInput = function MultiLanguageInput(_ref) {
|
|
|
598
609
|
var _useState = React.useState(defaultLanguage),
|
|
599
610
|
language = _useState[0],
|
|
600
611
|
setLanguage = _useState[1];
|
|
601
|
-
var classNames =
|
|
612
|
+
var classNames = cx("multi-language-input", className);
|
|
602
613
|
var currentValue = values[language];
|
|
603
614
|
var handleOnBlur = function handleOnBlur(e) {
|
|
604
615
|
e.persist();
|
|
@@ -623,21 +634,21 @@ var MultiLanguageInput = function MultiLanguageInput(_ref) {
|
|
|
623
634
|
};
|
|
624
635
|
return (
|
|
625
636
|
// biome-ignore lint/a11y/noStaticElementInteractions: Legacy component
|
|
626
|
-
|
|
637
|
+
React.createElement("div", {
|
|
627
638
|
className: classNames,
|
|
628
639
|
// biome-ignore lint/a11y/noNoninteractiveTabindex: Legacy component
|
|
629
640
|
tabIndex: 0,
|
|
630
641
|
onBlur: handleOnBlur,
|
|
631
642
|
"data-testid": "multi-lang-input-" + name
|
|
632
|
-
},
|
|
643
|
+
}, React.createElement(Stack, {
|
|
633
644
|
space: "extraSmall"
|
|
634
|
-
},
|
|
645
|
+
}, React.createElement(LanguageSelect, {
|
|
635
646
|
language: language,
|
|
636
647
|
options: languages,
|
|
637
648
|
onChange: function onChange(lang) {
|
|
638
649
|
return handleLanguageChange(lang);
|
|
639
650
|
}
|
|
640
|
-
}),
|
|
651
|
+
}), React.createElement(InputComponent, _extends({
|
|
641
652
|
label: label,
|
|
642
653
|
variant: alertLevel,
|
|
643
654
|
feedback: alertLabel,
|
|
@@ -666,7 +677,7 @@ var OrganisationDropDown = function OrganisationDropDown(_ref) {
|
|
|
666
677
|
return org.organisationId === selectedOrganisationId;
|
|
667
678
|
}));
|
|
668
679
|
}, [selectedOrganisationId, organisations]);
|
|
669
|
-
return
|
|
680
|
+
return React.createElement(dropdown.SearchableDropdown, _extends({
|
|
670
681
|
label: label,
|
|
671
682
|
items: [].concat(organisations.sort(function (a, b) {
|
|
672
683
|
return a.tradingName.localeCompare(b.tradingName, "nb");
|
|
@@ -695,7 +706,7 @@ var Pager = function Pager(_ref) {
|
|
|
695
706
|
_onPageChange = _ref.onPageChange,
|
|
696
707
|
currentPage = _ref.currentPage;
|
|
697
708
|
var pageCount = Math.ceil(collectionSize / pageSize);
|
|
698
|
-
return
|
|
709
|
+
return React.createElement(menu.Pagination, {
|
|
699
710
|
pageCount: pageCount,
|
|
700
711
|
currentPage: currentPage,
|
|
701
712
|
onPageChange: function onPageChange(page) {
|
|
@@ -704,15 +715,7 @@ var Pager = function Pager(_ref) {
|
|
|
704
715
|
});
|
|
705
716
|
};
|
|
706
717
|
|
|
707
|
-
|
|
708
|
-
* This component changes page title by using helmet and current path. It will translate subpaths, join them with a dash
|
|
709
|
-
* and display it on browser tab.
|
|
710
|
-
*
|
|
711
|
-
* @param Props.pathname - The current path from react-router-dom.useLocation()
|
|
712
|
-
* @param Props.onBreadcrumbLookup - A function that takes a path and returns a i18n translated string or undefined
|
|
713
|
-
* @returns A Helmet component with updated title
|
|
714
|
-
*/
|
|
715
|
-
function PageTitle(_ref) {
|
|
718
|
+
var PageTitle = function PageTitle(_ref) {
|
|
716
719
|
var pathname = _ref.pathname,
|
|
717
720
|
onBreadcrumbLookup = _ref.onBreadcrumbLookup;
|
|
718
721
|
var paths = util.splitUrlPath(pathname);
|
|
@@ -728,13 +731,16 @@ function PageTitle(_ref) {
|
|
|
728
731
|
var title = _ref3.title;
|
|
729
732
|
return title;
|
|
730
733
|
}).reverse().join(" | ");
|
|
731
|
-
|
|
732
|
-
|
|
734
|
+
React.useEffect(function () {
|
|
735
|
+
document.title = pageTitles + " | Entur Partner";
|
|
736
|
+
}, [pageTitles]);
|
|
737
|
+
return null;
|
|
738
|
+
};
|
|
733
739
|
|
|
734
|
-
/**
|
|
735
|
-
* Note: This component uses BusinessCapability, not because we only want to
|
|
736
|
-
* check BusinessCapabilities but because it represents a minimal subset of
|
|
737
|
-
* what we need to check.
|
|
740
|
+
/**
|
|
741
|
+
* Note: This component uses BusinessCapability, not because we only want to
|
|
742
|
+
* check BusinessCapabilities but because it represents a minimal subset of
|
|
743
|
+
* what we need to check.
|
|
738
744
|
*/
|
|
739
745
|
var PermissionCheck = function PermissionCheck(_ref) {
|
|
740
746
|
var children = _ref.children,
|
|
@@ -748,7 +754,7 @@ var PermissionCheck = function PermissionCheck(_ref) {
|
|
|
748
754
|
var allIsAllowed = util.hasAllPermissions(all, permissions);
|
|
749
755
|
var oneOfIsAllowed = util.hasOneOfPermissions(oneOf, permissions);
|
|
750
756
|
var allowed = allIsAllowed && oneOfIsAllowed;
|
|
751
|
-
return
|
|
757
|
+
return React.createElement(React.Fragment, null, allowed ? children : fallback);
|
|
752
758
|
};
|
|
753
759
|
|
|
754
760
|
var _excluded$3 = ["children", "shouldBlockNavigation"];
|
|
@@ -762,7 +768,7 @@ var RouteLeavingGuard = function RouteLeavingGuard(_ref) {
|
|
|
762
768
|
nextLocation = _ref2.nextLocation;
|
|
763
769
|
return currentLocation.pathname !== nextLocation.pathname && shouldBlockNavigation(nextLocation);
|
|
764
770
|
});
|
|
765
|
-
return
|
|
771
|
+
return React.createElement(ConfirmModal, _extends({
|
|
766
772
|
onDismiss: function onDismiss() {
|
|
767
773
|
if (blocker.state === "blocked") {
|
|
768
774
|
blocker.reset();
|
|
@@ -785,18 +791,18 @@ var StatusLabel = function StatusLabel(_ref) {
|
|
|
785
791
|
aggressiveInactive = _ref.aggressiveInactive,
|
|
786
792
|
showBullet = _ref.showBullet,
|
|
787
793
|
center = _ref.center;
|
|
788
|
-
var bulletClassNames =
|
|
794
|
+
var bulletClassNames = cx("eps-status-label__bullet", {
|
|
789
795
|
active: active,
|
|
790
796
|
aggressive: aggressiveInactive
|
|
791
797
|
});
|
|
792
|
-
var statusLabelClassNames =
|
|
798
|
+
var statusLabelClassNames = cx("eps-status-label", {
|
|
793
799
|
center: center
|
|
794
800
|
});
|
|
795
|
-
return
|
|
801
|
+
return React.createElement("div", {
|
|
796
802
|
className: statusLabelClassNames
|
|
797
|
-
}, showBullet &&
|
|
803
|
+
}, showBullet && React.createElement("div", {
|
|
798
804
|
className: bulletClassNames
|
|
799
|
-
}),
|
|
805
|
+
}), React.createElement("div", null, label));
|
|
800
806
|
};
|
|
801
807
|
|
|
802
808
|
var _excluded$2 = ["as", "children", "fontSize", "color", "lineHeight", "fontWeight", "className"];
|
|
@@ -814,8 +820,8 @@ var Text = function Text(_ref) {
|
|
|
814
820
|
fontSize && classes.push.apply(classes, responsiveProp("eps-font-size-", fontSize));
|
|
815
821
|
lineHeight && classes.push.apply(classes, responsiveProp("eps-line-height-", lineHeight));
|
|
816
822
|
fontWeight && classes.push("eps-font-weight-" + fontWeight);
|
|
817
|
-
var classList =
|
|
818
|
-
return
|
|
823
|
+
var classList = cx(classes, className);
|
|
824
|
+
return React.createElement(Box, _extends({
|
|
819
825
|
as: component,
|
|
820
826
|
color: color,
|
|
821
827
|
className: classList
|
|
@@ -827,16 +833,16 @@ var Unbutton = function Unbutton(_ref) {
|
|
|
827
833
|
var children = _ref.children,
|
|
828
834
|
className = _ref.className,
|
|
829
835
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
830
|
-
return
|
|
836
|
+
return React.createElement(button.Button, _extends({
|
|
831
837
|
variant: "primary"
|
|
832
838
|
}, rest, {
|
|
833
|
-
className:
|
|
839
|
+
className: cx("eps-unbutton", className)
|
|
834
840
|
}), children);
|
|
835
841
|
};
|
|
836
842
|
|
|
837
843
|
var CustomOverflowMenuItem = function CustomOverflowMenuItem(props) {
|
|
838
|
-
return
|
|
839
|
-
className:
|
|
844
|
+
return React.createElement("button", _extends({
|
|
845
|
+
className: cx(props.className, "eps-overflow-menu__item"),
|
|
840
846
|
role: "menuitem"
|
|
841
847
|
}, props));
|
|
842
848
|
};
|
|
@@ -845,22 +851,22 @@ var CookieSettingsMenuItem = function CookieSettingsMenuItem(_ref) {
|
|
|
845
851
|
var name = _ref.name,
|
|
846
852
|
setOpen = _ref.setOpen,
|
|
847
853
|
onCookieSettingsOpen = _ref.onCookieSettingsOpen;
|
|
848
|
-
return
|
|
854
|
+
return React.createElement(CustomOverflowMenuItem, {
|
|
849
855
|
onClick: function onClick() {
|
|
850
856
|
onCookieSettingsOpen();
|
|
851
857
|
setOpen(false);
|
|
852
858
|
},
|
|
853
859
|
className: "eps-overflow-menu__item"
|
|
854
|
-
},
|
|
860
|
+
}, React.createElement("span", {
|
|
855
861
|
"aria-hidden": true
|
|
856
|
-
},
|
|
862
|
+
}, React.createElement(icons.CookieIcon, {
|
|
857
863
|
size: "1rem",
|
|
858
864
|
inline: true
|
|
859
865
|
})), name);
|
|
860
866
|
};
|
|
861
867
|
|
|
862
868
|
function useOutsideClick(ref, buttonRef, handler) {
|
|
863
|
-
|
|
869
|
+
React.useEffect(function () {
|
|
864
870
|
var listener = function listener(event) {
|
|
865
871
|
if (elementContainsEventTarget(ref.current, event) || elementContainsEventTarget(buttonRef.current, event)) {
|
|
866
872
|
return;
|
|
@@ -904,40 +910,40 @@ var CustomOverflowMenu = function CustomOverflowMenu(_ref) {
|
|
|
904
910
|
onOpenChange = _ref.onOpenChange,
|
|
905
911
|
environment = _ref.environment,
|
|
906
912
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
907
|
-
var overflowItemsClasses =
|
|
913
|
+
var overflowItemsClasses = cx("eps-overflow-menu__group", {
|
|
908
914
|
"eps-overflow-menu__group--open": open
|
|
909
915
|
});
|
|
910
|
-
var overflowContentRef =
|
|
911
|
-
var overflowMenuTriggerRef =
|
|
916
|
+
var overflowContentRef = React.useRef(null);
|
|
917
|
+
var overflowMenuTriggerRef = React.useRef(null);
|
|
912
918
|
useOutsideClick(overflowContentRef, overflowMenuTriggerRef, function () {
|
|
913
919
|
return onOpenChange(false);
|
|
914
920
|
});
|
|
915
|
-
return
|
|
916
|
-
className:
|
|
921
|
+
return React.createElement("div", null, React.createElement(button.SecondaryButton, _extends({
|
|
922
|
+
className: cx("eps-overflow-menu__button", className),
|
|
917
923
|
onClick: function onClick() {
|
|
918
924
|
return onOpenChange(!open);
|
|
919
925
|
},
|
|
920
926
|
"aria-haspopup": true,
|
|
921
927
|
"aria-expanded": open,
|
|
922
928
|
ref: overflowMenuTriggerRef
|
|
923
|
-
}, rest),
|
|
929
|
+
}, rest), React.createElement("div", {
|
|
924
930
|
className: "eps-overflow-menu__button-contents"
|
|
925
|
-
},
|
|
931
|
+
}, React.createElement("span", {
|
|
926
932
|
className: "eds-overflow-menu__user-icon"
|
|
927
|
-
},
|
|
933
|
+
}, React.createElement(icons.UserIcon, {
|
|
928
934
|
inline: true
|
|
929
|
-
})),
|
|
935
|
+
})), React.createElement(typography.Heading6, {
|
|
930
936
|
margin: "none",
|
|
931
937
|
as: "span"
|
|
932
|
-
}, userName, environment !== undefined && environment !== exports.Environment.Production &&
|
|
938
|
+
}, userName, environment !== undefined && environment !== exports.Environment.Production && React.createElement("span", {
|
|
933
939
|
style: {
|
|
934
940
|
color: getColorForEnvironment(environment)
|
|
935
941
|
}
|
|
936
|
-
}, " ", "(", getHumanReadableEnvironment(environment), ")")),
|
|
942
|
+
}, " ", "(", getHumanReadableEnvironment(environment), ")")), React.createElement("span", {
|
|
937
943
|
className: "eps-arrow-icon"
|
|
938
|
-
},
|
|
944
|
+
}, React.createElement(icons.DownArrowIcon, {
|
|
939
945
|
inline: true
|
|
940
|
-
})))), open &&
|
|
946
|
+
})))), open && React.createElement("div", {
|
|
941
947
|
className: overflowItemsClasses,
|
|
942
948
|
role: "menu",
|
|
943
949
|
ref: overflowContentRef
|
|
@@ -952,28 +958,28 @@ var LanguageSwitchMenuItem = function LanguageSwitchMenuItem(_ref) {
|
|
|
952
958
|
var useB47LanguageKey = useFeatureToggle("USE_BCP-47_LANGUAGE_KEY");
|
|
953
959
|
var norwegianLanguageKey = useB47LanguageKey ? "nb-NO" : "nb";
|
|
954
960
|
var englishLanguageKey = useB47LanguageKey ? "en-GB" : "en";
|
|
955
|
-
return
|
|
961
|
+
return React.createElement(React.Fragment, null, language === englishLanguageKey ? React.createElement(CustomOverflowMenuItem, {
|
|
956
962
|
onClick: function onClick() {
|
|
957
963
|
onLanguageChange(norwegianLanguageKey);
|
|
958
964
|
setOpen(false);
|
|
959
965
|
},
|
|
960
966
|
className: "eps-overflow-menu__item"
|
|
961
|
-
},
|
|
967
|
+
}, React.createElement("span", {
|
|
962
968
|
"aria-hidden": true,
|
|
963
969
|
className: "eps-overflow-menu__icon-margin"
|
|
964
|
-
},
|
|
970
|
+
}, React.createElement(icons.NorwayIcon, {
|
|
965
971
|
size: "1rem",
|
|
966
972
|
inline: true
|
|
967
|
-
})), name) :
|
|
973
|
+
})), name) : React.createElement(CustomOverflowMenuItem, {
|
|
968
974
|
onClick: function onClick() {
|
|
969
975
|
onLanguageChange(englishLanguageKey);
|
|
970
976
|
setOpen(false);
|
|
971
977
|
},
|
|
972
978
|
className: "eps-overflow-menu__item"
|
|
973
|
-
},
|
|
979
|
+
}, React.createElement("span", {
|
|
974
980
|
"aria-hidden": true,
|
|
975
981
|
className: "eps-overflow-menu__icon-margin"
|
|
976
|
-
},
|
|
982
|
+
}, React.createElement(icons.UKIcon, {
|
|
977
983
|
size: "1rem",
|
|
978
984
|
inline: true
|
|
979
985
|
})), name));
|
|
@@ -983,16 +989,16 @@ var LogOutMenuItem = function LogOutMenuItem(_ref) {
|
|
|
983
989
|
var name = _ref.name,
|
|
984
990
|
setOpen = _ref.setOpen,
|
|
985
991
|
onLogout = _ref.onLogout;
|
|
986
|
-
return
|
|
992
|
+
return React.createElement(CustomOverflowMenuItem, {
|
|
987
993
|
onClick: function onClick() {
|
|
988
994
|
onLogout();
|
|
989
995
|
setOpen(false);
|
|
990
996
|
},
|
|
991
997
|
"data-testid": "user-menu-logout",
|
|
992
998
|
className: "eps-overflow-menu__item"
|
|
993
|
-
},
|
|
999
|
+
}, React.createElement("span", {
|
|
994
1000
|
"aria-hidden": true
|
|
995
|
-
},
|
|
1001
|
+
}, React.createElement(icons.LogOutIcon, {
|
|
996
1002
|
size: "1rem",
|
|
997
1003
|
inline: true
|
|
998
1004
|
})), name);
|
|
@@ -1002,20 +1008,20 @@ var UserMenuItem = function UserMenuItem(_ref) {
|
|
|
1002
1008
|
var name = _ref.name,
|
|
1003
1009
|
setOpen = _ref.setOpen,
|
|
1004
1010
|
onNavigateToMyProfile = _ref.onNavigateToMyProfile;
|
|
1005
|
-
return
|
|
1011
|
+
return React.createElement(reactRouterDom.Link, {
|
|
1006
1012
|
to: "/permission-admin/my-profile",
|
|
1007
1013
|
style: {
|
|
1008
1014
|
textDecoration: "none"
|
|
1009
1015
|
}
|
|
1010
|
-
},
|
|
1016
|
+
}, React.createElement(CustomOverflowMenuItem, {
|
|
1011
1017
|
onClick: function onClick() {
|
|
1012
1018
|
setOpen(false);
|
|
1013
1019
|
onNavigateToMyProfile();
|
|
1014
1020
|
},
|
|
1015
1021
|
className: "eps-overflow-menu__item"
|
|
1016
|
-
},
|
|
1022
|
+
}, React.createElement("span", {
|
|
1017
1023
|
"aria-hidden": true
|
|
1018
|
-
},
|
|
1024
|
+
}, React.createElement(icons.UserIcon, {
|
|
1019
1025
|
size: "1rem",
|
|
1020
1026
|
inline: true
|
|
1021
1027
|
})), name));
|
|
@@ -1025,21 +1031,22 @@ var VersionMenuItem = function VersionMenuItem(_ref) {
|
|
|
1025
1031
|
var title = _ref.title,
|
|
1026
1032
|
setOpen = _ref.setOpen;
|
|
1027
1033
|
var navigate = reactRouterDom.useNavigate(); // Hide useNavigate from standalone micro-frontends because it is not under RouterProvider
|
|
1028
|
-
return
|
|
1034
|
+
return React.createElement(CustomOverflowMenuItem, {
|
|
1029
1035
|
onClick: function onClick() {
|
|
1030
1036
|
navigate("/app-version");
|
|
1031
1037
|
setOpen(false);
|
|
1032
1038
|
},
|
|
1033
1039
|
className: "eps-overflow-menu__item"
|
|
1034
|
-
},
|
|
1040
|
+
}, React.createElement("span", {
|
|
1035
1041
|
"aria-hidden": true
|
|
1036
|
-
},
|
|
1042
|
+
}, React.createElement(icons.ChannelsIcon, {
|
|
1037
1043
|
className: "eps-version-icon",
|
|
1038
1044
|
size: "1rem",
|
|
1039
1045
|
inline: true
|
|
1040
1046
|
})), title);
|
|
1041
1047
|
};
|
|
1042
1048
|
|
|
1049
|
+
/** biome-ignore-all lint/correctness/useUniqueElementIds: Ignore unique id for now */
|
|
1043
1050
|
var UserMenu = function UserMenu(_ref) {
|
|
1044
1051
|
var className = _ref.className,
|
|
1045
1052
|
messages = _ref.messages,
|
|
@@ -1054,37 +1061,37 @@ var UserMenu = function UserMenu(_ref) {
|
|
|
1054
1061
|
onNavigateToMyProfile = _ref.onNavigateToMyProfile,
|
|
1055
1062
|
_ref$onCookieSettings = _ref.onCookieSettingsOpen,
|
|
1056
1063
|
onCookieSettingsOpen = _ref$onCookieSettings === void 0 ? function () {} : _ref$onCookieSettings;
|
|
1057
|
-
var triggerClassList =
|
|
1064
|
+
var triggerClassList = cx(["eps-user-menu__trigger-button", className]);
|
|
1058
1065
|
var _useState = React.useState(false),
|
|
1059
1066
|
open = _useState[0],
|
|
1060
1067
|
setOpen = _useState[1];
|
|
1061
|
-
return
|
|
1068
|
+
return React.createElement("div", {
|
|
1062
1069
|
id: "eps-user-menu"
|
|
1063
|
-
},
|
|
1070
|
+
}, React.createElement(CustomOverflowMenu, {
|
|
1064
1071
|
open: open,
|
|
1065
1072
|
onOpenChange: setOpen,
|
|
1066
1073
|
className: triggerClassList,
|
|
1067
1074
|
userName: userName,
|
|
1068
1075
|
environment: environment
|
|
1069
|
-
},
|
|
1076
|
+
}, React.createElement("div", {
|
|
1070
1077
|
id: "eps-overflow-menu"
|
|
1071
|
-
},
|
|
1078
|
+
}, React.createElement(LanguageSwitchMenuItem, {
|
|
1072
1079
|
name: messages.switchLanguage,
|
|
1073
1080
|
language: language,
|
|
1074
1081
|
onLanguageChange: onLanguageChange,
|
|
1075
1082
|
setOpen: setOpen
|
|
1076
|
-
}), showVersionItem && messages.appVersion &&
|
|
1083
|
+
}), showVersionItem && messages.appVersion && React.createElement(VersionMenuItem, {
|
|
1077
1084
|
title: messages.appVersion,
|
|
1078
1085
|
setOpen: setOpen
|
|
1079
|
-
}), showMyProfileItem && messages.myProfile &&
|
|
1086
|
+
}), showMyProfileItem && messages.myProfile && React.createElement(UserMenuItem, {
|
|
1080
1087
|
name: messages.myProfile,
|
|
1081
1088
|
setOpen: setOpen,
|
|
1082
1089
|
onNavigateToMyProfile: onNavigateToMyProfile
|
|
1083
|
-
}), showCookieSettingsItem && messages.cookieSettings &&
|
|
1090
|
+
}), showCookieSettingsItem && messages.cookieSettings && React.createElement(CookieSettingsMenuItem, {
|
|
1084
1091
|
name: messages.cookieSettings,
|
|
1085
1092
|
setOpen: setOpen,
|
|
1086
1093
|
onCookieSettingsOpen: onCookieSettingsOpen
|
|
1087
|
-
}),
|
|
1094
|
+
}), React.createElement(LogOutMenuItem, {
|
|
1088
1095
|
name: messages.logout,
|
|
1089
1096
|
setOpen: setOpen,
|
|
1090
1097
|
onLogout: onLogout
|
|
@@ -1130,6 +1137,7 @@ exports.FeatureToggle = FeatureToggle;
|
|
|
1130
1137
|
exports.FormatCurrencyAmount = FormatCurrencyAmount;
|
|
1131
1138
|
exports.FormatDateTime = FormatDateTime;
|
|
1132
1139
|
exports.LanguageSelect = LanguageSelect;
|
|
1140
|
+
exports.LegacyPageTitle = LegacyPageTitle;
|
|
1133
1141
|
exports.Link = Link;
|
|
1134
1142
|
exports.LinkButton = LinkButton;
|
|
1135
1143
|
exports.Menu = Menu;
|