@crystaldesign/diva-core 25.4.0-beta.8 → 25.4.0-rc.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/build/esm/{ModalsWrapper-800b2119.js → ModalsWrapper-4fcaaaa8.js} +2 -1
- package/build/esm/{index-dd794163.js → index-1931fe5c.js} +525 -419
- package/build/esm/{index-0997b9bd.js → index-1dcb6cb8.js} +161 -120
- package/build/esm/index.js +3 -1
- package/build/types/core/src/elements/Auth/Button/index.d.ts +2 -1
- package/build/types/core/src/elements/Auth/Button/index.d.ts.map +1 -1
- package/build/types/core/src/elements/Auth/Header/index.d.ts +9 -0
- package/build/types/core/src/elements/Auth/Header/index.d.ts.map +1 -0
- package/build/types/core/src/elements/Auth/Input/index.d.ts +3 -1
- package/build/types/core/src/elements/Auth/Input/index.d.ts.map +1 -1
- package/build/types/core/src/elements/Auth/Login/index.d.ts.map +1 -1
- package/build/types/core/src/elements/Auth/Register/index.d.ts.map +1 -1
- package/build/types/core/src/elements/Auth/RequestNewPassword/index.d.ts.map +1 -1
- package/build/types/core/src/elements/Auth/WelcomeScreen/index.d.ts.map +1 -1
- package/build/types/core/src/elements/Auth/index.d.ts.map +1 -1
- package/build/types/core/src/elements/Fullscreen/index.d.ts +3 -1
- package/build/types/core/src/elements/Fullscreen/index.d.ts.map +1 -1
- package/build/types/core/src/externalTypes.d.ts +3 -2
- package/build/types/core/src/externalTypes.d.ts.map +1 -1
- package/build/types/core/src/handler/InternalApiHandler.d.ts +1 -2
- package/build/types/core/src/handler/InternalApiHandler.d.ts.map +1 -1
- package/build/types/core/src/handler/MediaHandler/index.d.ts +3 -2
- package/build/types/core/src/handler/MediaHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/OrganizationHandler/index.d.ts +1 -1
- package/build/types/core/src/handler/OrganizationHandler/index.d.ts.map +1 -1
- package/build/types/core/src/store/ConfigurationStore.d.ts.map +1 -1
- package/build/types/core/src/store/ContentStore.d.ts +2 -0
- package/build/types/core/src/store/ContentStore.d.ts.map +1 -1
- package/build/types/core/src/store/DataStore.d.ts +1 -1
- package/build/types/core/src/store/index.d.ts +4 -0
- package/build/types/core/src/store/index.d.ts.map +1 -1
- package/build/umd/{109.diva-core.umd.min.js → 135.diva-core.umd.min.js} +2 -2
- package/build/umd/135.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/210.diva-core.umd.min.js +2 -0
- package/build/umd/210.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/215.diva-core.umd.min.js +2 -0
- package/build/umd/215.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/{962.diva-core.umd.min.js → 263.diva-core.umd.min.js} +2 -2
- package/build/umd/263.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/429.diva-core.umd.min.js +2 -0
- package/build/umd/429.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/43.diva-core.umd.min.js +2 -0
- package/build/umd/43.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/{535.diva-core.umd.min.js → 700.diva-core.umd.min.js} +2 -2
- package/build/umd/700.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/731.diva-core.umd.min.js +2 -0
- package/build/umd/731.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/{304.diva-core.umd.min.js → 800.diva-core.umd.min.js} +2 -2
- package/build/umd/800.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/83.diva-core.umd.min.js +2 -0
- package/build/umd/83.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/diva-core.umd.min.js +29 -2
- package/build/umd/diva-core.umd.min.js.LICENSE.txt +11 -1
- package/build/umd/report.html +1 -1
- package/package.json +10 -10
- package/build/umd/109.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/304.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/41.diva-core.umd.min.js +0 -2
- package/build/umd/41.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/53.diva-core.umd.min.js +0 -2
- package/build/umd/53.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/535.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/671.diva-core.umd.min.js +0 -2
- package/build/umd/671.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/704.diva-core.umd.min.js +0 -2
- package/build/umd/704.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/806.diva-core.umd.min.js +0 -2
- package/build/umd/806.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/902.diva-core.umd.min.js +0 -2
- package/build/umd/902.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/962.diva-core.umd.min.js.LICENSE.txt +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as useDivaCoreContext, B as Button, s as socialButton, g as google, m as microsoft,
|
|
1
|
+
import { u as useDivaCoreContext, B as Button, s as socialButton, g as google, m as microsoft, t as titlecontainer, e as error, a as getLogger, b as separator, I as Input, l as link, c as success, d as auth, f as loginBox, h as logoContainer } from './index-1931fe5c.js';
|
|
2
2
|
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
3
3
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
4
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
@@ -9,8 +9,11 @@ import { flowResult, toJS } from 'mobx';
|
|
|
9
9
|
import { useTranslation } from 'react-i18next';
|
|
10
10
|
import classnames from 'classnames';
|
|
11
11
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
12
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
13
|
+
import Alert from '@mui/material/Alert';
|
|
14
|
+
import { useTranslation as useTranslation$1 } from '@crystaldesign/diva-core';
|
|
12
15
|
import { ContentBoxComponent } from '@crystaldesign/content-box';
|
|
13
|
-
import {
|
|
16
|
+
import { Alert as Alert$1, CircularProgress as CircularProgress$1 } from '@mui/material';
|
|
14
17
|
import Checkbox from '@mui/material/Checkbox';
|
|
15
18
|
import Snowfall from 'react-snowfall';
|
|
16
19
|
import '@babel/runtime/helpers/classCallCheck';
|
|
@@ -32,12 +35,13 @@ import '@mui/material/styles';
|
|
|
32
35
|
import '@mui/material/locale';
|
|
33
36
|
import '@elastic/apm-rum-react';
|
|
34
37
|
import '@mui/material/Typography';
|
|
38
|
+
import '@mui/material/Button';
|
|
39
|
+
import '@mui/icons-material';
|
|
35
40
|
import '@crystaldesign/basket-model';
|
|
36
41
|
import 'lodash/debounce';
|
|
37
42
|
import 'axios';
|
|
38
43
|
import '@crystaldesign/product-handler';
|
|
39
44
|
import 'react-swipeable';
|
|
40
|
-
import '@crystaldesign/diva-core';
|
|
41
45
|
import 'react-qr-code';
|
|
42
46
|
import '@mui/icons-material/Close';
|
|
43
47
|
import '@mui/material/IconButton';
|
|
@@ -87,6 +91,28 @@ function OpenId () {
|
|
|
87
91
|
});
|
|
88
92
|
}
|
|
89
93
|
|
|
94
|
+
function Header (_ref) {
|
|
95
|
+
var title = _ref.title,
|
|
96
|
+
text = _ref.text,
|
|
97
|
+
errorText = _ref.errorText;
|
|
98
|
+
var _useTranslation = useTranslation$1(),
|
|
99
|
+
t = _useTranslation.t;
|
|
100
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
101
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
102
|
+
className: titlecontainer,
|
|
103
|
+
children: /*#__PURE__*/jsx("h2", {
|
|
104
|
+
children: title
|
|
105
|
+
})
|
|
106
|
+
}), /*#__PURE__*/jsx("p", {
|
|
107
|
+
children: text
|
|
108
|
+
}), errorText && /*#__PURE__*/jsx(Alert, {
|
|
109
|
+
severity: "error",
|
|
110
|
+
className: error,
|
|
111
|
+
children: t(errorText)
|
|
112
|
+
})]
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
90
116
|
var LOG$3 = getLogger('Framework', 'Login');
|
|
91
117
|
function Login() {
|
|
92
118
|
var _email, _authorizationStore$s, _authorizationStore$s2, _authorizationStore$s3;
|
|
@@ -97,30 +123,34 @@ function Login() {
|
|
|
97
123
|
_useState2 = _slicedToArray(_useState, 2),
|
|
98
124
|
step = _useState2[0],
|
|
99
125
|
setStep = _useState2[1];
|
|
100
|
-
var _useState3 = useState(
|
|
126
|
+
var _useState3 = useState(false),
|
|
101
127
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
var _useState5 = useState(''),
|
|
128
|
+
loading = _useState4[0],
|
|
129
|
+
setLoading = _useState4[1];
|
|
130
|
+
var _useState5 = useState((_email = (_authorizationStore$s = authorizationStore.state) === null || _authorizationStore$s === void 0 ? void 0 : _authorizationStore$s.email) !== null && _email !== void 0 ? _email : ''),
|
|
105
131
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
106
|
-
|
|
107
|
-
|
|
132
|
+
email = _useState6[0],
|
|
133
|
+
setEmail = _useState6[1];
|
|
108
134
|
var _useState7 = useState(''),
|
|
109
135
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
var _useState9 = useState(
|
|
136
|
+
password = _useState8[0],
|
|
137
|
+
setPassword = _useState8[1];
|
|
138
|
+
var _useState9 = useState(''),
|
|
113
139
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
var _useState11 = useState(
|
|
140
|
+
otp = _useState10[0],
|
|
141
|
+
setOtp = _useState10[1];
|
|
142
|
+
var _useState11 = useState(false),
|
|
117
143
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
var _useState13 = useState(
|
|
144
|
+
useOtp = _useState12[0],
|
|
145
|
+
setUseOtp = _useState12[1];
|
|
146
|
+
var _useState13 = useState(authorizationStore.state.invitationId),
|
|
121
147
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
122
|
-
|
|
123
|
-
|
|
148
|
+
invitationFound = _useState14[0],
|
|
149
|
+
setInvitationFound = _useState14[1];
|
|
150
|
+
var _useState15 = useState(((_authorizationStore$s2 = authorizationStore.state) === null || _authorizationStore$s2 === void 0 ? void 0 : _authorizationStore$s2.type) == 'LOGIN' ? authorizationStore.state.error : undefined),
|
|
151
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
152
|
+
errorText = _useState16[0],
|
|
153
|
+
setError = _useState16[1];
|
|
124
154
|
var _useTranslation = useTranslation(),
|
|
125
155
|
t = _useTranslation.t;
|
|
126
156
|
var onContinue = /*#__PURE__*/function () {
|
|
@@ -129,14 +159,18 @@ function Login() {
|
|
|
129
159
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
130
160
|
while (1) switch (_context.prev = _context.next) {
|
|
131
161
|
case 0:
|
|
132
|
-
|
|
162
|
+
setLoading(true);
|
|
163
|
+
if (errorText) {
|
|
164
|
+
setError(undefined);
|
|
165
|
+
}
|
|
166
|
+
_context.prev = 2;
|
|
133
167
|
if (invitationFound) {
|
|
134
|
-
_context.next =
|
|
168
|
+
_context.next = 8;
|
|
135
169
|
break;
|
|
136
170
|
}
|
|
137
|
-
_context.next =
|
|
171
|
+
_context.next = 6;
|
|
138
172
|
return authorizationHandler.getInvitationValue('id', email);
|
|
139
|
-
case
|
|
173
|
+
case 6:
|
|
140
174
|
checkInvitation = _context.sent;
|
|
141
175
|
if (checkInvitation) {
|
|
142
176
|
if (checkInvitation.isNewUser) {
|
|
@@ -146,32 +180,36 @@ function Login() {
|
|
|
146
180
|
setInvitationFound(true);
|
|
147
181
|
if (checkInvitation.useotp) setUseOtp(true);
|
|
148
182
|
}
|
|
149
|
-
case
|
|
150
|
-
_context.next =
|
|
183
|
+
case 8:
|
|
184
|
+
_context.next = 10;
|
|
151
185
|
return authorizationHandler.fetchLoginProvider({
|
|
152
186
|
email: email
|
|
153
187
|
});
|
|
154
|
-
case
|
|
188
|
+
case 10:
|
|
155
189
|
response = _context.sent;
|
|
156
190
|
if (response.provider == 'standard') {
|
|
157
191
|
setStep('login');
|
|
158
192
|
} else {
|
|
159
193
|
authorizationStore.openOAuthLogin(response.provider, authorizationStore.state.organizationId, authorizationStore.state.invitationId);
|
|
160
194
|
}
|
|
161
|
-
_context.next =
|
|
195
|
+
_context.next = 18;
|
|
162
196
|
break;
|
|
163
|
-
case
|
|
164
|
-
_context.prev =
|
|
165
|
-
_context.t0 = _context["catch"](
|
|
197
|
+
case 14:
|
|
198
|
+
_context.prev = 14;
|
|
199
|
+
_context.t0 = _context["catch"](2);
|
|
166
200
|
LOG$3.error(new DivaError('Error while fetching login provider', {
|
|
167
201
|
cause: _context.t0
|
|
168
202
|
}));
|
|
169
203
|
setError('auth.error.password');
|
|
170
|
-
case
|
|
204
|
+
case 18:
|
|
205
|
+
_context.prev = 18;
|
|
206
|
+
setLoading(false);
|
|
207
|
+
return _context.finish(18);
|
|
208
|
+
case 21:
|
|
171
209
|
case "end":
|
|
172
210
|
return _context.stop();
|
|
173
211
|
}
|
|
174
|
-
}, _callee, null, [[
|
|
212
|
+
}, _callee, null, [[2, 14, 18, 21]]);
|
|
175
213
|
}));
|
|
176
214
|
return function onContinue() {
|
|
177
215
|
return _ref.apply(this, arguments);
|
|
@@ -182,27 +220,35 @@ function Login() {
|
|
|
182
220
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
183
221
|
while (1) switch (_context2.prev = _context2.next) {
|
|
184
222
|
case 0:
|
|
185
|
-
|
|
186
|
-
|
|
223
|
+
setLoading(true);
|
|
224
|
+
if (errorText) {
|
|
225
|
+
setError(undefined);
|
|
226
|
+
}
|
|
227
|
+
_context2.prev = 2;
|
|
228
|
+
_context2.next = 5;
|
|
187
229
|
return flowResult(authorizationStore.login(email, password, false, authorizationStore.state.organizationId, authorizationStore.state.invitationId, otp));
|
|
188
|
-
case
|
|
230
|
+
case 5:
|
|
189
231
|
setEmail('');
|
|
190
232
|
setPassword('');
|
|
191
233
|
setError(undefined);
|
|
192
|
-
_context2.next =
|
|
234
|
+
_context2.next = 14;
|
|
193
235
|
break;
|
|
194
|
-
case
|
|
195
|
-
_context2.prev =
|
|
196
|
-
_context2.t0 = _context2["catch"](
|
|
236
|
+
case 10:
|
|
237
|
+
_context2.prev = 10;
|
|
238
|
+
_context2.t0 = _context2["catch"](2);
|
|
197
239
|
LOG$3.error(new DivaError('Error while logging in', {
|
|
198
240
|
cause: _context2.t0
|
|
199
241
|
}));
|
|
200
242
|
setError(invitationFound ? 'auth.error.passwordotp' : 'auth.error.password');
|
|
201
|
-
case
|
|
243
|
+
case 14:
|
|
244
|
+
_context2.prev = 14;
|
|
245
|
+
setLoading(false);
|
|
246
|
+
return _context2.finish(14);
|
|
247
|
+
case 17:
|
|
202
248
|
case "end":
|
|
203
249
|
return _context2.stop();
|
|
204
250
|
}
|
|
205
|
-
}, _callee2, null, [[
|
|
251
|
+
}, _callee2, null, [[2, 10, 14, 17]]);
|
|
206
252
|
}));
|
|
207
253
|
return function onLogin() {
|
|
208
254
|
return _ref2.apply(this, arguments);
|
|
@@ -234,16 +280,10 @@ function Login() {
|
|
|
234
280
|
if (useOtp && !loginDisabled) loginDisabled = otp.length == 0;
|
|
235
281
|
var loginMethods = (_authorizationStore$s3 = authorizationStore.state) === null || _authorizationStore$s3 === void 0 ? void 0 : _authorizationStore$s3.loginMethods;
|
|
236
282
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
237
|
-
children: [/*#__PURE__*/jsx(
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}), !!errorText && /*#__PURE__*/jsxs("div", {
|
|
242
|
-
className: error,
|
|
243
|
-
children: [/*#__PURE__*/jsx("span", {}), /*#__PURE__*/jsx("div", {
|
|
244
|
-
id: "loginerrortext",
|
|
245
|
-
children: t(errorText)
|
|
246
|
-
})]
|
|
283
|
+
children: [/*#__PURE__*/jsx(Header, {
|
|
284
|
+
title: t('auth.title.login'),
|
|
285
|
+
text: t('auth.text.login', ''),
|
|
286
|
+
errorText: errorText !== null && errorText !== void 0 ? errorText : ''
|
|
247
287
|
}), /*#__PURE__*/jsx(OpenId, {}), ((loginMethods === null || loginMethods === void 0 ? void 0 : loginMethods.generic) || (loginMethods === null || loginMethods === void 0 ? void 0 : loginMethods.google) || (loginMethods === null || loginMethods === void 0 ? void 0 : loginMethods.microsoft)) && loginMethods.standard && /*#__PURE__*/jsx("div", {
|
|
248
288
|
className: separator,
|
|
249
289
|
children: "or"
|
|
@@ -254,6 +294,7 @@ function Login() {
|
|
|
254
294
|
value: email,
|
|
255
295
|
autoComplete: "username",
|
|
256
296
|
autoFocus: true,
|
|
297
|
+
type: "email",
|
|
257
298
|
placeholder: t('auth.input.email'),
|
|
258
299
|
onChange: function onChange(e) {
|
|
259
300
|
return setEmail(e.target.value);
|
|
@@ -285,14 +326,12 @@ function Login() {
|
|
|
285
326
|
onChange: function onChange(e) {
|
|
286
327
|
return setOtp(e.target.value);
|
|
287
328
|
}
|
|
288
|
-
}), /*#__PURE__*/jsx(
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
placeholder: t('auth.input.email')
|
|
295
|
-
})
|
|
329
|
+
}), /*#__PURE__*/jsx(Input, {
|
|
330
|
+
value: email,
|
|
331
|
+
type: "email",
|
|
332
|
+
readOnly: true,
|
|
333
|
+
placeholder: t('auth.input.email'),
|
|
334
|
+
resetInput: reset
|
|
296
335
|
}), /*#__PURE__*/jsx(Input, {
|
|
297
336
|
value: password,
|
|
298
337
|
type: "password",
|
|
@@ -305,20 +344,25 @@ function Login() {
|
|
|
305
344
|
onKeyPress: function onKeyPress(e) {
|
|
306
345
|
return e.key == 'Enter' ? onLogin() : false;
|
|
307
346
|
}
|
|
308
|
-
}), /*#__PURE__*/jsx("div", {
|
|
309
|
-
className: link,
|
|
310
|
-
style: {
|
|
311
|
-
textAlign: 'right'
|
|
312
|
-
},
|
|
313
|
-
onClick: resetPassword,
|
|
314
|
-
children: t('auth.button.forgotpassword')
|
|
315
347
|
})]
|
|
316
|
-
}), /*#__PURE__*/
|
|
348
|
+
}), /*#__PURE__*/jsxs(Button, {
|
|
317
349
|
id: "submit",
|
|
318
|
-
disabled: loginDisabled,
|
|
350
|
+
disabled: loginDisabled || loading,
|
|
319
351
|
onClick: step == 'enter' ? onContinue : onLogin,
|
|
320
|
-
children:
|
|
321
|
-
|
|
352
|
+
children: [loading ? /*#__PURE__*/jsx(CircularProgress, {
|
|
353
|
+
size: 24,
|
|
354
|
+
color: "inherit"
|
|
355
|
+
}) : undefined, loading ? undefined : step == 'enter' ? t('auth.button.continue') : t('auth.button.login')]
|
|
356
|
+
}), step == 'login' && /*#__PURE__*/jsx("div", {
|
|
357
|
+
style: {
|
|
358
|
+
textAlign: 'center'
|
|
359
|
+
},
|
|
360
|
+
children: /*#__PURE__*/jsx("div", {
|
|
361
|
+
className: link,
|
|
362
|
+
onClick: resetPassword,
|
|
363
|
+
children: t('auth.button.forgotpassword')
|
|
364
|
+
})
|
|
365
|
+
}), ' ']
|
|
322
366
|
})]
|
|
323
367
|
});
|
|
324
368
|
}
|
|
@@ -392,15 +436,10 @@ function RequestNewPassword (_ref) {
|
|
|
392
436
|
authorizationStore.showLogin();
|
|
393
437
|
};
|
|
394
438
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
395
|
-
children: [/*#__PURE__*/jsx(
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
}), !!errorText && /*#__PURE__*/jsxs("div", {
|
|
400
|
-
className: error,
|
|
401
|
-
children: [/*#__PURE__*/jsx("span", {}), /*#__PURE__*/jsx("div", {
|
|
402
|
-
children: t(errorText)
|
|
403
|
-
})]
|
|
439
|
+
children: [/*#__PURE__*/jsx(Header, {
|
|
440
|
+
title: t('auth.title.resetpassword'),
|
|
441
|
+
text: t('auth.info.resetdescription', ''),
|
|
442
|
+
errorText: errorText !== null && errorText !== void 0 ? errorText : ''
|
|
404
443
|
}), requested && /*#__PURE__*/jsxs("div", {
|
|
405
444
|
className: success,
|
|
406
445
|
children: [/*#__PURE__*/jsx("span", {}), /*#__PURE__*/jsx("div", {
|
|
@@ -416,7 +455,8 @@ function RequestNewPassword (_ref) {
|
|
|
416
455
|
},
|
|
417
456
|
onKeyPress: function onKeyPress(e) {
|
|
418
457
|
return e.key == 'Enter' ? resetPassword() : false;
|
|
419
|
-
}
|
|
458
|
+
},
|
|
459
|
+
resetInput: toLogin
|
|
420
460
|
}), /*#__PURE__*/jsx(Button, {
|
|
421
461
|
disabled: email.length == 0,
|
|
422
462
|
onClick: resetPassword,
|
|
@@ -703,15 +743,10 @@ function WelcomeScreen (_ref) {
|
|
|
703
743
|
return _checkInvitation.apply(this, arguments);
|
|
704
744
|
}
|
|
705
745
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
706
|
-
children: [/*#__PURE__*/jsx(
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
}), invitationError && /*#__PURE__*/jsxs("div", {
|
|
711
|
-
className: error,
|
|
712
|
-
children: [/*#__PURE__*/jsx("span", {}), /*#__PURE__*/jsx("div", {
|
|
713
|
-
children: t(invitationError)
|
|
714
|
-
})]
|
|
746
|
+
children: [/*#__PURE__*/jsx(Header, {
|
|
747
|
+
title: t('auth.title.welcome'),
|
|
748
|
+
text: t('auth.info.welcomedescription', ''),
|
|
749
|
+
errorText: invitationError !== null && invitationError !== void 0 ? invitationError : ''
|
|
715
750
|
}), isNewUser && !invitationError && /*#__PURE__*/jsx(Button, {
|
|
716
751
|
onClick: toRegister,
|
|
717
752
|
children: t('auth.title.register')
|
|
@@ -760,8 +795,12 @@ function Register() {
|
|
|
760
795
|
setOtp = _useState14[1];
|
|
761
796
|
var _useState15 = useState(false),
|
|
762
797
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
763
|
-
|
|
764
|
-
|
|
798
|
+
loading = _useState16[0],
|
|
799
|
+
setLoading = _useState16[1];
|
|
800
|
+
var _useState17 = useState(false),
|
|
801
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
802
|
+
agbAccepted = _useState18[0],
|
|
803
|
+
setAgbAccepted = _useState18[1];
|
|
765
804
|
var onRegister = /*#__PURE__*/function () {
|
|
766
805
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
767
806
|
var _authorizationStore$s2;
|
|
@@ -769,28 +808,33 @@ function Register() {
|
|
|
769
808
|
while (1) switch (_context.prev = _context.next) {
|
|
770
809
|
case 0:
|
|
771
810
|
_context.prev = 0;
|
|
772
|
-
|
|
811
|
+
setLoading(true);
|
|
812
|
+
_context.next = 4;
|
|
773
813
|
return flowResult(authorizationStore.register(email, password, firstname, familyname, (_authorizationStore$s2 = authorizationStore.state) === null || _authorizationStore$s2 === void 0 ? void 0 : _authorizationStore$s2.invitationId, useOtp ? otp : undefined));
|
|
774
|
-
case
|
|
814
|
+
case 4:
|
|
775
815
|
setEmail('');
|
|
776
816
|
setPassword('');
|
|
777
817
|
setRepeatPassword('');
|
|
778
818
|
setFirstname('');
|
|
779
819
|
setFamilyname('');
|
|
780
|
-
_context.next =
|
|
820
|
+
_context.next = 15;
|
|
781
821
|
break;
|
|
782
|
-
case
|
|
783
|
-
_context.prev =
|
|
822
|
+
case 11:
|
|
823
|
+
_context.prev = 11;
|
|
784
824
|
_context.t0 = _context["catch"](0);
|
|
785
825
|
setErrorText('auth.error.invitationotp');
|
|
786
826
|
LOG.error(new DivaError('Error while registering', {
|
|
787
827
|
cause: _context.t0
|
|
788
828
|
}));
|
|
789
|
-
case
|
|
829
|
+
case 15:
|
|
830
|
+
_context.prev = 15;
|
|
831
|
+
setLoading(false);
|
|
832
|
+
return _context.finish(15);
|
|
833
|
+
case 18:
|
|
790
834
|
case "end":
|
|
791
835
|
return _context.stop();
|
|
792
836
|
}
|
|
793
|
-
}, _callee, null, [[0,
|
|
837
|
+
}, _callee, null, [[0, 11, 15, 18]]);
|
|
794
838
|
}));
|
|
795
839
|
return function onRegister() {
|
|
796
840
|
return _ref.apply(this, arguments);
|
|
@@ -803,15 +847,10 @@ function Register() {
|
|
|
803
847
|
};
|
|
804
848
|
var loginMethods = (_authorizationStore$s4 = authorizationStore.state) === null || _authorizationStore$s4 === void 0 ? void 0 : _authorizationStore$s4.loginMethods;
|
|
805
849
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
806
|
-
children: [/*#__PURE__*/jsx(
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
}), !!errorText && /*#__PURE__*/jsxs("div", {
|
|
811
|
-
className: error,
|
|
812
|
-
children: [/*#__PURE__*/jsx("span", {}), /*#__PURE__*/jsx("div", {
|
|
813
|
-
children: t(errorText)
|
|
814
|
-
})]
|
|
850
|
+
children: [/*#__PURE__*/jsx(Header, {
|
|
851
|
+
title: t('auth.title.register'),
|
|
852
|
+
text: t('auth.text.register', ''),
|
|
853
|
+
errorText: errorText !== null && errorText !== void 0 ? errorText : ''
|
|
815
854
|
}), /*#__PURE__*/jsx(OpenId, {}), ((loginMethods === null || loginMethods === void 0 ? void 0 : loginMethods.generic) || (loginMethods === null || loginMethods === void 0 ? void 0 : loginMethods.google) || (loginMethods === null || loginMethods === void 0 ? void 0 : loginMethods.microsoft)) && loginMethods.standard && /*#__PURE__*/jsx("div", {
|
|
816
855
|
className: separator,
|
|
817
856
|
children: "or"
|
|
@@ -892,19 +931,20 @@ function Register() {
|
|
|
892
931
|
})]
|
|
893
932
|
})]
|
|
894
933
|
})]
|
|
895
|
-
}), /*#__PURE__*/jsx(
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
fontSize: 14
|
|
934
|
+
}), /*#__PURE__*/jsx(Alert$1, {
|
|
935
|
+
severity: "warning",
|
|
936
|
+
sx: {
|
|
937
|
+
display: validPassword() ? 'none' : 'flex'
|
|
900
938
|
},
|
|
901
|
-
hidden: validPassword(),
|
|
902
939
|
children: t('auth.input.passwordsnotmatch')
|
|
903
940
|
})]
|
|
904
|
-
}), /*#__PURE__*/
|
|
905
|
-
disabled: !validPassword(),
|
|
941
|
+
}), /*#__PURE__*/jsxs(Button, {
|
|
942
|
+
disabled: !validPassword() || loading,
|
|
906
943
|
onClick: validPassword() ? onRegister : undefined,
|
|
907
|
-
children:
|
|
944
|
+
children: [loading ? /*#__PURE__*/jsx(CircularProgress$1, {
|
|
945
|
+
size: 24,
|
|
946
|
+
color: "inherit"
|
|
947
|
+
}) : undefined, loading ? undefined : t('auth.input.login')]
|
|
908
948
|
})]
|
|
909
949
|
})]
|
|
910
950
|
});
|
|
@@ -916,7 +956,8 @@ function Auth() {
|
|
|
916
956
|
var _useDivaCoreContext = useDivaCoreContext(),
|
|
917
957
|
authorizationStore = _useDivaCoreContext.authorizationStore,
|
|
918
958
|
configurationStore = _useDivaCoreContext.configurationStore,
|
|
919
|
-
dataStore = _useDivaCoreContext.dataStore
|
|
959
|
+
dataStore = _useDivaCoreContext.dataStore,
|
|
960
|
+
contentStore = _useDivaCoreContext.contentStore;
|
|
920
961
|
var logo = useMemo(function () {
|
|
921
962
|
var _dataStore$organizati, _configurationStore$n;
|
|
922
963
|
var logo = divaLogo;
|
|
@@ -945,14 +986,14 @@ function Auth() {
|
|
|
945
986
|
}
|
|
946
987
|
}), /*#__PURE__*/jsxs("div", {
|
|
947
988
|
className: loginBox,
|
|
948
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
989
|
+
children: [(!contentStore.containerDimensions.isMobile || contentStore.containerDimensions.isPortrait) && /*#__PURE__*/jsx("div", {
|
|
949
990
|
className: logoContainer,
|
|
950
991
|
style: {
|
|
951
992
|
height: (_configurationStore$c = configurationStore.configuration.loginLogoHeight) !== null && _configurationStore$c !== void 0 ? _configurationStore$c : 50,
|
|
952
993
|
backgroundImage: "url(".concat(logo, ")")
|
|
953
994
|
}
|
|
954
995
|
}), /*#__PURE__*/jsx(AuthElements, {})]
|
|
955
|
-
}), configurationStore.authentication.contentBox && /*#__PURE__*/jsx("div", {
|
|
996
|
+
}), configurationStore.authentication.contentBox && !contentStore.containerDimensions.isMobile && /*#__PURE__*/jsx("div", {
|
|
956
997
|
style: {
|
|
957
998
|
width: 'calc(100% - 400px)',
|
|
958
999
|
height: '100%',
|
package/build/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { k as AnalyticsHandler, A as AuthorizationHandler, o as ClientArticleHandler, C as Content, p as DivaMockProvider, H as HelpButton, O as ONE_DAY_UNIX, n as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, D as default, a as getLogger, q as storyBookCoreMock, j as useDivaCore } from './index-
|
|
1
|
+
export { k as AnalyticsHandler, A as AuthorizationHandler, o as ClientArticleHandler, C as Content, p as DivaMockProvider, H as HelpButton, O as ONE_DAY_UNIX, n as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, D as default, a as getLogger, q as storyBookCoreMock, j as useDivaCore } from './index-1931fe5c.js';
|
|
2
2
|
export { DivaError, default as DivaUtils } from '@crystaldesign/diva-utils';
|
|
3
3
|
export { Trans, useTranslation } from 'react-i18next';
|
|
4
4
|
export * from '@crystaldesign/basket-model';
|
|
@@ -28,7 +28,9 @@ import '@mui/material/locale';
|
|
|
28
28
|
import '@elastic/apm-rum-react';
|
|
29
29
|
import '@mui/material/Typography';
|
|
30
30
|
import 'classnames';
|
|
31
|
+
import '@mui/material/Button';
|
|
31
32
|
import 'react/jsx-runtime';
|
|
33
|
+
import '@mui/icons-material';
|
|
32
34
|
import 'lodash/debounce';
|
|
33
35
|
import 'axios';
|
|
34
36
|
import '@crystaldesign/product-handler';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { DetailedHTMLProps } from 'react';
|
|
2
|
-
export default function ({ className, disabled, children,
|
|
2
|
+
export default function ({ className, disabled, children, onClick, }: DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
|
|
3
3
|
disabled?: boolean;
|
|
4
|
+
onClick?: () => void;
|
|
4
5
|
}): React.JSX.Element;
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/elements/Auth/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/elements/Auth/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKjD,MAAM,CAAC,OAAO,WAAW,EACvB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,OAAO,GACR,EAAE,iBAAiB,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC,GAAG;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,qBAYA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/elements/Auth/Header/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,KAAK,qBAgBzD"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<React.
|
|
2
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLInputElement> & React.InputHTMLAttributes<HTMLInputElement> & {
|
|
3
|
+
resetInput?: () => void;
|
|
4
|
+
}, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
3
5
|
export default _default;
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/elements/Auth/Input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/elements/Auth/Input/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;;iBAQjE,MAAM,IAAI;;AAH3B,wBA8BG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/elements/Auth/Login/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/elements/Auth/Login/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAiBxC,iBAAS,KAAK,sBA4Jb;;;;AAED,wBAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/elements/Auth/Register/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/elements/Auth/Register/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAgBxC,iBAAS,QAAQ,sBAmHhB;;;;AAED,wBAAkC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/elements/Auth/RequestNewPassword/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/elements/Auth/RequestNewPassword/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAWxC,MAAM,CAAC,OAAO,WAAW,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,qBA+D5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/elements/Auth/WelcomeScreen/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/elements/Auth/WelcomeScreen/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,MAAM,CAAC,OAAO,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,qBAsC9I"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/elements/Auth/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAcvC,iBAAS,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/elements/Auth/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAcvC,iBAAS,IAAI,sBAoDZ;;;;AA6BD,wBAA8B"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare function Fullscreen(
|
|
2
|
+
declare function Fullscreen({ inAbsoluteFullscreen }: {
|
|
3
|
+
inAbsoluteFullscreen?: boolean;
|
|
4
|
+
}): React.JSX.Element;
|
|
3
5
|
declare const _default: typeof Fullscreen & {
|
|
4
6
|
displayName: string;
|
|
5
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/elements/Fullscreen/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AAW1E,iBAAS,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/elements/Fullscreen/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AAW1E,iBAAS,UAAU,CAAC,EAAE,oBAAoB,EAAE,EAAE;IAAE,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAAE,qBAyH/E;;;;AAED,wBAAoC"}
|
|
@@ -315,13 +315,14 @@ export interface OrganizationData {
|
|
|
315
315
|
shopType: string;
|
|
316
316
|
}[];
|
|
317
317
|
childOrganizations?: string[];
|
|
318
|
-
type?: 'SUPPLIER' | 'RETAILER';
|
|
319
|
-
parentType?: 'SUPPLIER' | 'RETAILER';
|
|
318
|
+
type?: 'SUPPLIER' | 'RETAILER' | 'ASSOCIATION';
|
|
319
|
+
parentType?: 'SUPPLIER' | 'RETAILER' | 'ASSOCIATION';
|
|
320
320
|
settings: {
|
|
321
321
|
defaultCurrency: string;
|
|
322
322
|
useCatalogTranslations: string;
|
|
323
323
|
calcEkPriceForProducts?: boolean;
|
|
324
324
|
hidePrices?: 'DEFAULT_VISIBLE' | 'DEFAULT_HIDDEN' | 'ONLY_VISIBLE' | 'ONLY_HIDDEN';
|
|
325
|
+
pricePreview?: 'fromBasePrice' | 'fromCurrentPrice' | 'fromCurrentPriceHideCurrent' | 'off';
|
|
325
326
|
languages?: string[];
|
|
326
327
|
invitationType?: 'OTP' | 'STANDARD';
|
|
327
328
|
wwsClient?: string;
|