@elliemae/pui-app-sdk 2.8.3 → 2.11.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/dist/cjs/analytics/base-data.js +22 -0
- package/dist/cjs/analytics/index.js +37 -0
- package/dist/cjs/analytics/user-session.js +31 -17
- package/dist/cjs/analytics/user-wait.js +13 -5
- package/dist/cjs/api/auth/index.js +16 -13
- package/dist/cjs/api/helpers.js +17 -3
- package/dist/cjs/api/users/index.js +4 -3
- package/dist/cjs/communication/http-client/index.js +21 -16
- package/dist/cjs/communication/http-client/response-interceptor.js +2 -3
- package/dist/cjs/communication/http-client/tests/index.test-disable.js +6 -5
- package/dist/cjs/data/auth/actions.js +28 -22
- package/dist/cjs/data/breakpoint/index.js +3 -1
- package/dist/cjs/data/live-message/index.js +11 -8
- package/dist/cjs/data/reducers.js +2 -1
- package/dist/cjs/data/store.js +8 -4
- package/dist/cjs/data/wait-message/actions.js +9 -6
- package/dist/cjs/data/wait-message/reducer.js +17 -13
- package/dist/cjs/index.js +18 -1
- package/dist/cjs/route/index.js +9 -6
- package/dist/cjs/route/private-route/index.js +10 -9
- package/dist/cjs/sideeffect/auth/index.js +10 -6
- package/dist/cjs/utils/app-config/config.js +21 -4
- package/dist/cjs/utils/app-config/index.js +17 -13
- package/dist/cjs/utils/app-host-integration/react.js +10 -7
- package/dist/cjs/utils/auth/index.js +34 -33
- package/dist/cjs/utils/micro-frontend/guest.js +10 -7
- package/dist/cjs/utils/micro-frontend/host.js +12 -1
- package/dist/cjs/utils/micro-frontend/index.js +2 -4
- package/dist/cjs/utils/service-worker.js +2 -1
- package/dist/cjs/utils/session.js +13 -5
- package/dist/cjs/utils/storybook/theme.js +12 -9
- package/dist/cjs/utils/testing/index.js +18 -9
- package/dist/cjs/utils/testing/render-with-redux.js +14 -11
- package/dist/cjs/utils/testing/render-with-router-redux.js +20 -17
- package/dist/cjs/utils/testing/render-with-router.js +16 -13
- package/dist/cjs/utils/testing/render-with-state-addons.js +14 -7
- package/dist/cjs/utils/web-storage.js +6 -0
- package/dist/cjs/view/app-root/hosted-app.js +8 -5
- package/dist/cjs/view/app-root/index.js +23 -20
- package/dist/cjs/view/app-root/stand-alone-app.js +8 -5
- package/dist/cjs/view/app-root/style.js +6 -3
- package/dist/cjs/view/error-toast/index.stories.js +29 -22
- package/dist/cjs/view/fetch-host-app-data/index.js +2 -2
- package/dist/cjs/view/fetch-host-app-data/store.js +8 -2
- package/dist/cjs/view/fields/check-box/index.js +28 -20
- package/dist/cjs/view/fields/check-box/index.stories.js +24 -20
- package/dist/cjs/view/fields/check-box/set-value.stories.js +21 -17
- package/dist/cjs/view/fields/combo-box/index.js +28 -22
- package/dist/cjs/view/fields/connect-form.js +4 -3
- package/dist/cjs/view/fields/date-input/index.js +21 -15
- package/dist/cjs/view/fields/date-input/index.stories.js +1 -1
- package/dist/cjs/view/fields/date-picker/index.js +21 -15
- package/dist/cjs/view/fields/date-picker/index.stories.js +1 -1
- package/dist/cjs/view/fields/form-item-layout/index.js +20 -16
- package/dist/cjs/view/fields/input-mask/index.js +24 -16
- package/dist/cjs/view/fields/large-text-box/index.js +21 -15
- package/dist/cjs/view/fields/radio/index.js +26 -20
- package/dist/cjs/view/fields/radio/index.stories.js +21 -17
- package/dist/cjs/view/fields/radio/set-value.stories.js +19 -15
- package/dist/cjs/view/fields/radio-group/index.js +22 -16
- package/dist/cjs/view/fields/radio-group/index.stories.js +44 -37
- package/dist/cjs/view/fields/text-box/index.js +21 -15
- package/dist/cjs/view/fields/watch-value.js +5 -4
- package/dist/cjs/view/form/index.js +10 -9
- package/dist/cjs/view/form/index.stories.js +6 -3
- package/dist/cjs/view/form/submit-button/index.js +3 -2
- package/dist/cjs/view/form/usecases.stories.js +6 -3
- package/dist/cjs/view/guest-unload-handlers/index.js +2 -1
- package/dist/cjs/view/header/center-region/index.js +18 -8
- package/dist/cjs/view/header/index.js +11 -8
- package/dist/cjs/view/live-message/index.stories.js +2 -0
- package/dist/cjs/view/loadable/index.js +2 -1
- package/dist/cjs/view/login/index.js +6 -5
- package/dist/cjs/view/message-to-host-app/index.js +2 -1
- package/dist/cjs/view/micro-app/app-factory/index.js +39 -23
- package/dist/cjs/view/micro-app/resources/manifest.js +29 -16
- package/dist/cjs/view/micro-app/resources/script.js +29 -22
- package/dist/cjs/view/micro-app/resources/style.js +27 -20
- package/dist/cjs/view/micro-app/use-app-will-render.js +13 -10
- package/dist/cjs/view/micro-app/utils.js +6 -0
- package/dist/cjs/view/micro-iframe-app/app.js +7 -6
- package/dist/cjs/view/micro-iframe-app/iframe/index.js +8 -7
- package/dist/cjs/view/micro-iframe-app/index.js +5 -4
- package/dist/cjs/view/micro-iframe-app/use-frame-loaded.js +5 -4
- package/dist/cjs/view/modals/error/index.js +9 -6
- package/dist/cjs/view/modals/navigation-prompt/index.js +7 -4
- package/dist/cjs/view/modals/session-expiry/customHooks.js +7 -3
- package/dist/cjs/view/modals/session-expiry/index.js +8 -5
- package/dist/cjs/view/modals/wait-message/html-wait-message.js +4 -3
- package/dist/cjs/view/modals/wait-message/index.js +9 -8
- package/dist/cjs/view/modals/wait-message/index.stories.js +5 -4
- package/dist/cjs/view/render-with-delay/index.js +4 -3
- package/dist/cjs/view/useMediaBreakpoints/index.js +10 -0
- package/dist/es/analytics/base-data.js +10 -0
- package/dist/es/analytics/index.js +28 -0
- package/dist/es/analytics/user-session.js +30 -17
- package/dist/es/analytics/user-wait.js +12 -5
- package/dist/es/api/auth/index.js +16 -13
- package/dist/es/api/helpers.js +13 -3
- package/dist/es/api/users/index.js +4 -3
- package/dist/es/communication/http-client/index.js +20 -16
- package/dist/es/communication/http-client/response-interceptor.js +2 -3
- package/dist/es/communication/http-client/tests/index.test-disable.js +6 -5
- package/dist/es/data/auth/actions.js +28 -22
- package/dist/es/data/breakpoint/index.js +3 -1
- package/dist/es/data/live-message/index.js +11 -8
- package/dist/es/data/reducers.js +2 -1
- package/dist/es/data/store.js +8 -4
- package/dist/es/data/wait-message/actions.js +9 -6
- package/dist/es/data/wait-message/reducer.js +16 -12
- package/dist/es/index.js +3 -1
- package/dist/es/route/index.js +7 -6
- package/dist/es/route/private-route/index.js +10 -9
- package/dist/es/sideeffect/auth/index.js +10 -6
- package/dist/es/utils/app-config/config.js +18 -4
- package/dist/es/utils/app-config/index.js +17 -13
- package/dist/es/utils/app-host-integration/react.js +10 -7
- package/dist/es/utils/auth/index.js +34 -33
- package/dist/es/utils/micro-frontend/guest.js +9 -6
- package/dist/es/utils/micro-frontend/host.js +11 -1
- package/dist/es/utils/micro-frontend/index.js +2 -2
- package/dist/es/utils/service-worker.js +2 -1
- package/dist/es/utils/session.js +14 -5
- package/dist/es/utils/storybook/theme.js +12 -9
- package/dist/es/utils/testing/index.js +12 -9
- package/dist/es/utils/testing/render-with-redux.js +14 -11
- package/dist/es/utils/testing/render-with-router-redux.js +20 -17
- package/dist/es/utils/testing/render-with-router.js +16 -13
- package/dist/es/utils/testing/render-with-state-addons.js +11 -7
- package/dist/es/utils/web-storage.js +3 -0
- package/dist/es/view/app-root/hosted-app.js +8 -5
- package/dist/es/view/app-root/index.js +23 -20
- package/dist/es/view/app-root/stand-alone-app.js +8 -5
- package/dist/es/view/app-root/style.js +6 -3
- package/dist/es/view/error-toast/index.stories.js +29 -22
- package/dist/es/view/fetch-host-app-data/index.js +2 -2
- package/dist/es/view/fetch-host-app-data/store.js +6 -2
- package/dist/es/view/fields/check-box/index.js +26 -20
- package/dist/es/view/fields/check-box/index.stories.js +24 -20
- package/dist/es/view/fields/check-box/set-value.stories.js +21 -17
- package/dist/es/view/fields/combo-box/index.js +28 -22
- package/dist/es/view/fields/connect-form.js +4 -3
- package/dist/es/view/fields/date-input/index.js +21 -15
- package/dist/es/view/fields/date-input/index.stories.js +1 -1
- package/dist/es/view/fields/date-picker/index.js +21 -15
- package/dist/es/view/fields/date-picker/index.stories.js +1 -1
- package/dist/es/view/fields/form-item-layout/index.js +20 -16
- package/dist/es/view/fields/input-mask/index.js +22 -16
- package/dist/es/view/fields/large-text-box/index.js +21 -15
- package/dist/es/view/fields/radio/index.js +26 -20
- package/dist/es/view/fields/radio/index.stories.js +21 -17
- package/dist/es/view/fields/radio/set-value.stories.js +19 -15
- package/dist/es/view/fields/radio-group/index.js +22 -16
- package/dist/es/view/fields/radio-group/index.stories.js +44 -37
- package/dist/es/view/fields/text-box/index.js +21 -15
- package/dist/es/view/fields/watch-value.js +5 -4
- package/dist/es/view/form/index.js +10 -9
- package/dist/es/view/form/index.stories.js +6 -3
- package/dist/es/view/form/submit-button/index.js +3 -2
- package/dist/es/view/form/usecases.stories.js +6 -3
- package/dist/es/view/guest-unload-handlers/index.js +2 -1
- package/dist/es/view/header/center-region/index.js +16 -8
- package/dist/es/view/header/index.js +11 -8
- package/dist/es/view/loadable/index.js +2 -1
- package/dist/es/view/login/index.js +6 -5
- package/dist/es/view/message-to-host-app/index.js +2 -1
- package/dist/es/view/micro-app/app-factory/index.js +33 -23
- package/dist/es/view/micro-app/resources/manifest.js +25 -15
- package/dist/es/view/micro-app/resources/script.js +28 -21
- package/dist/es/view/micro-app/resources/style.js +27 -20
- package/dist/es/view/micro-app/use-app-will-render.js +12 -9
- package/dist/es/view/micro-app/utils.js +3 -0
- package/dist/es/view/micro-iframe-app/app.js +7 -6
- package/dist/es/view/micro-iframe-app/iframe/index.js +8 -7
- package/dist/es/view/micro-iframe-app/index.js +5 -4
- package/dist/es/view/micro-iframe-app/use-frame-loaded.js +5 -4
- package/dist/es/view/modals/error/index.js +7 -6
- package/dist/es/view/modals/navigation-prompt/index.js +5 -4
- package/dist/es/view/modals/session-expiry/customHooks.js +2 -1
- package/dist/es/view/modals/session-expiry/index.js +6 -5
- package/dist/es/view/modals/wait-message/html-wait-message.js +4 -3
- package/dist/es/view/modals/wait-message/index.js +9 -8
- package/dist/es/view/modals/wait-message/index.stories.js +5 -4
- package/dist/es/view/render-with-delay/index.js +4 -3
- package/dist/es/view/useMediaBreakpoints/index.js +5 -0
- package/dist/public/assets/index.ad459dcebaa616bff55e77d860405729.svg +1 -0
- package/dist/public/assets/index.dae17c8817fd9c5ab29e7c3a8925a1f4.svg +1 -0
- package/dist/public/assets/logo.0cbd33c5006f8ea6d106f8ab13f6e6dc.svg +1 -0
- package/dist/public/index.html +1 -1
- package/dist/public/js/emuiAppSdk.bdec42736fbd0fbcbe9a.js +3 -0
- package/dist/public/js/{emuiAppSdk.555dc403d2552c23928a.js.LICENSE.txt → emuiAppSdk.bdec42736fbd0fbcbe9a.js.LICENSE.txt} +0 -9
- package/dist/public/js/emuiAppSdk.bdec42736fbd0fbcbe9a.js.gz +0 -0
- package/dist/public/js/emuiAppSdk.bdec42736fbd0fbcbe9a.js.map +1 -0
- package/dist/types/analytics/base-data.d.ts +8 -0
- package/dist/types/analytics/index.d.ts +5 -0
- package/dist/types/analytics/user-session.d.ts +1 -4
- package/dist/types/communication/http-client/index.d.ts +2 -2
- package/dist/types/communication/http-client/request-interceptor.d.ts +1 -1
- package/dist/types/communication/http-client/response-interceptor.d.ts +1 -1
- package/dist/types/communication/http-client/retry-axios.d.ts +5 -2
- package/dist/types/index.d.ts +2 -1
- package/dist/types/utils/micro-frontend/host.d.ts +3 -2
- package/dist/types/utils/window.d.ts +3 -3
- package/dist/types/view/fields/date-input/index.d.ts +1 -2
- package/dist/types/view/fields/date-picker/index.d.ts +1 -2
- package/dist/types/view/visually-hidden/index.d.ts +1 -1
- package/package.json +17 -17
- package/dist/cjs/analytics/utils.js +0 -13
- package/dist/cjs/data/tests/store.test.js +0 -32
- package/dist/es/analytics/utils.js +0 -4
- package/dist/es/data/tests/store.test.js +0 -32
- package/dist/public/assets/index.0944904d91ed62aebf865bc6461471aa.svg +0 -4
- package/dist/public/assets/index.4c19242eb7de64399b205c842bf3185c.svg +0 -5
- package/dist/public/assets/logo.6799a57c45dd9c96b44e2bac6c4ee12c.svg +0 -2
- package/dist/public/js/emuiAppSdk.555dc403d2552c23928a.js +0 -3
- package/dist/public/js/emuiAppSdk.555dc403d2552c23928a.js.gz +0 -0
- package/dist/public/js/emuiAppSdk.555dc403d2552c23928a.js.map +0 -1
- package/dist/types/analytics/utils.d.ts +0 -4
|
@@ -12,46 +12,53 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
import { jsx as _jsx2 } from "react/jsx-runtime";
|
|
13
13
|
const radioName = 'gender';
|
|
14
14
|
|
|
15
|
-
const Gender =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
labelText: 'Gender',
|
|
22
|
-
required: true,
|
|
23
|
-
feedbackMessage
|
|
24
|
-
},
|
|
25
|
-
orientation: "horizontal",
|
|
26
|
-
...rest,
|
|
27
|
-
children: [_DSRadio || (_DSRadio = /*#__PURE__*/_jsx(DSRadio, {
|
|
15
|
+
const Gender = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
feedbackMessage,
|
|
18
|
+
...rest
|
|
19
|
+
} = _ref;
|
|
20
|
+
return /*#__PURE__*/_jsxs(RadioGroup, {
|
|
28
21
|
name: radioName,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
labelProps: {
|
|
23
|
+
labelText: 'Gender',
|
|
24
|
+
required: true,
|
|
25
|
+
feedbackMessage
|
|
26
|
+
},
|
|
27
|
+
orientation: "horizontal",
|
|
28
|
+
...rest,
|
|
29
|
+
children: [_DSRadio || (_DSRadio = /*#__PURE__*/_jsx(DSRadio, {
|
|
30
|
+
name: radioName,
|
|
31
|
+
value: "male",
|
|
32
|
+
labelText: "Male"
|
|
33
|
+
})), _DSRadio2 || (_DSRadio2 = /*#__PURE__*/_jsx(DSRadio, {
|
|
34
|
+
name: radioName,
|
|
35
|
+
value: "female",
|
|
36
|
+
labelText: "Female"
|
|
37
|
+
}))]
|
|
38
|
+
});
|
|
39
|
+
};
|
|
37
40
|
|
|
38
|
-
const Template =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
const Template = _ref2 => {
|
|
42
|
+
let {
|
|
43
|
+
props
|
|
44
|
+
} = _ref2;
|
|
45
|
+
return /*#__PURE__*/_jsx(Form, {}, void 0, /*#__PURE__*/_jsx(ConnectForm, {}, void 0, _ref3 => {
|
|
46
|
+
let {
|
|
47
|
+
formState: {
|
|
48
|
+
errors
|
|
49
|
+
}
|
|
50
|
+
} = _ref3;
|
|
51
|
+
const errField = get(errors, radioName);
|
|
52
|
+
const feedbackMessage = errField === null || errField === void 0 ? void 0 : errField.message;
|
|
53
|
+
return /*#__PURE__*/_jsx2(Gender, {
|
|
54
|
+
feedbackMessage: feedbackMessage,
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}), /*#__PURE__*/_jsx2(WatchValue, {
|
|
58
|
+
name: radioName,
|
|
49
59
|
...props
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
name: radioName,
|
|
53
|
-
...props
|
|
54
|
-
}));
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
55
62
|
|
|
56
63
|
export default {
|
|
57
64
|
title: 'Components/Form/Controls/RadioGroup',
|
|
@@ -2,18 +2,24 @@ import _jsx2 from "@babel/runtime/helpers/jsx";
|
|
|
2
2
|
import DSTextBox from '@elliemae/ds-basic/form/TextBox';
|
|
3
3
|
import { Controller } from 'react-hook-form';
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
export const TextBox =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
5
|
+
export const TextBox = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
name,
|
|
8
|
+
defaultValue = '',
|
|
9
|
+
rules = {},
|
|
10
|
+
...rest
|
|
11
|
+
} = _ref;
|
|
12
|
+
return /*#__PURE__*/_jsx2(Controller, {
|
|
13
|
+
name: name,
|
|
14
|
+
defaultValue: defaultValue,
|
|
15
|
+
rules: rules,
|
|
16
|
+
render: _ref2 => {
|
|
17
|
+
let {
|
|
18
|
+
field
|
|
19
|
+
} = _ref2;
|
|
20
|
+
return /*#__PURE__*/_jsx(DSTextBox, { ...rest,
|
|
21
|
+
...field
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
};
|
|
@@ -5,10 +5,11 @@ import _styled from "styled-components";
|
|
|
5
5
|
var _h;
|
|
6
6
|
|
|
7
7
|
import { useFormContext } from 'react-hook-form';
|
|
8
|
-
export const WatchValue =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
export const WatchValue = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
name,
|
|
11
|
+
labelText
|
|
12
|
+
} = _ref;
|
|
12
13
|
const {
|
|
13
14
|
watch
|
|
14
15
|
} = useFormContext();
|
|
@@ -2,15 +2,16 @@ import _styled from "styled-components";
|
|
|
2
2
|
import { useForm, FormProvider } from 'react-hook-form'; // eslint-disable-next-line @typescript-eslint/ban-types
|
|
3
3
|
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
export const Form =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
export const Form = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
/* eslint-disable indent */
|
|
8
|
+
classname,
|
|
9
|
+
reactHookFormProps = {
|
|
10
|
+
mode: 'onBlur'
|
|
11
|
+
},
|
|
12
|
+
children,
|
|
13
|
+
onSubmit
|
|
14
|
+
} = _ref;
|
|
14
15
|
const methods = useForm(reactHookFormProps);
|
|
15
16
|
const formProps = {};
|
|
16
17
|
if (onSubmit) formProps.onSubmit = methods.handleSubmit(onSubmit);
|
|
@@ -23,9 +23,12 @@ export default {
|
|
|
23
23
|
};
|
|
24
24
|
const StyledButton = /*#__PURE__*/styled(FormSubmitButton).withConfig({
|
|
25
25
|
componentId: "sc-1mzmcta-0"
|
|
26
|
-
})(["margin-top:", ";"],
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
})(["margin-top:", ";"], _ref => {
|
|
27
|
+
let {
|
|
28
|
+
theme
|
|
29
|
+
} = _ref;
|
|
30
|
+
return theme.space.xs;
|
|
31
|
+
});
|
|
29
32
|
|
|
30
33
|
const WatchDashBoard = () => {
|
|
31
34
|
const {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useFormContext } from 'react-hook-form';
|
|
2
2
|
import DSButton from '@elliemae/ds-basic/Button';
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
export const FormSubmitButton =
|
|
5
|
-
|
|
4
|
+
export const FormSubmitButton = _ref => {
|
|
5
|
+
let { ...rest
|
|
6
|
+
} = _ref;
|
|
6
7
|
const {
|
|
7
8
|
formState,
|
|
8
9
|
formProps: {
|
|
@@ -21,9 +21,12 @@ export default {
|
|
|
21
21
|
};
|
|
22
22
|
const StyledButton = /*#__PURE__*/styled(FormSubmitButton).withConfig({
|
|
23
23
|
componentId: "sc-1wwguuk-0"
|
|
24
|
-
})(["margin-top:", ";"],
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
})(["margin-top:", ";"], _ref => {
|
|
25
|
+
let {
|
|
26
|
+
theme
|
|
27
|
+
} = _ref;
|
|
28
|
+
return theme.space.xs;
|
|
29
|
+
});
|
|
27
30
|
|
|
28
31
|
const Template = args => /*#__PURE__*/_jsxs(Form, { ...args,
|
|
29
32
|
children: [_FirstName || (_FirstName = /*#__PURE__*/_jsx(FirstName, {})), _DOB || (_DOB = /*#__PURE__*/_jsx(DOB, {})), _State || (_State = /*#__PURE__*/_jsx(State, {})), _MaritalStatus || (_MaritalStatus = /*#__PURE__*/_jsx(MaritalStatus, {})), /*#__PURE__*/_jsx2(StyledButton, { ...btnProps
|
|
@@ -6,7 +6,8 @@ export const onGuestUnloadStart = () => new Promise(resolve => {
|
|
|
6
6
|
}
|
|
7
7
|
});
|
|
8
8
|
});
|
|
9
|
-
export const notifyGuestUnloadComplete = (guestAppConfirmation, guestAppId
|
|
9
|
+
export const notifyGuestUnloadComplete = function (guestAppConfirmation, guestAppId) {
|
|
10
|
+
let unloadType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'close_loan';
|
|
10
11
|
sendMessageToHost({
|
|
11
12
|
guestAppId,
|
|
12
13
|
message: {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _jsx from "@babel/runtime/helpers/jsx";
|
|
2
2
|
import "core-js/modules/es.string.replace.js";
|
|
3
|
+
import "core-js/modules/esnext.async-iterator.map.js";
|
|
4
|
+
import "core-js/modules/esnext.iterator.map.js";
|
|
3
5
|
import { NavLink } from 'react-router-dom';
|
|
4
6
|
import styled from 'styled-components';
|
|
5
7
|
const NavList = /*#__PURE__*/styled.ul.withConfig({
|
|
@@ -15,11 +17,17 @@ const StyledNavLink = /*#__PURE__*/styled(NavLink).attrs({
|
|
|
15
17
|
componentId: "sc-ztmnvf-2"
|
|
16
18
|
})(["display:flex;align-items:center;color:", ";text-decoration:none;text-transform:uppercase;height:100%;padding:0 ", " 0 ", ";&.", "{background-color:#48acff;}"], props => props.theme.colors.neutral['000'], props => props.theme.space.xs, props => props.theme.space.xs, activeClassName);
|
|
17
19
|
const publicPath = (process.env.ASSET_PATH || '/').replace(/\/?$/, '');
|
|
18
|
-
export const CenterRegion =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
export const CenterRegion = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
links = []
|
|
23
|
+
} = _ref;
|
|
24
|
+
return /*#__PURE__*/_jsx(NavList, {}, void 0, links.map(_ref2 => {
|
|
25
|
+
let {
|
|
26
|
+
name = '',
|
|
27
|
+
path = ''
|
|
28
|
+
} = _ref2;
|
|
29
|
+
return /*#__PURE__*/_jsx(NavListItem, {}, path, /*#__PURE__*/_jsx(StyledNavLink, {
|
|
30
|
+
to: "".concat(publicPath).concat(path.replace(/^\/?/, '/'))
|
|
31
|
+
}, void 0, name));
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
@@ -10,11 +10,14 @@ import { NavRegion } from "./nav-region/index.js";
|
|
|
10
10
|
const HeaderContainer = /*#__PURE__*/styled.header.withConfig({
|
|
11
11
|
componentId: "sc-cvwjlr-0"
|
|
12
12
|
})(["display:flex;height:56px;background-color:#2080cd;padding:0px ", " 0px ", ";"], props => props.theme.space.xs, props => props.theme.space.xxs);
|
|
13
|
-
export const Header =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
13
|
+
export const Header = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
links = [],
|
|
16
|
+
show = false
|
|
17
|
+
} = _ref;
|
|
18
|
+
return isStandAloneGuest() || isHost() || show ? /*#__PURE__*/_jsx(HeaderContainer, {
|
|
19
|
+
role: "banner"
|
|
20
|
+
}, void 0, _LogoRegion || (_LogoRegion = /*#__PURE__*/_jsx(LogoRegion, {})), /*#__PURE__*/_jsx(CenterRegion, {
|
|
21
|
+
links: links
|
|
22
|
+
}), _NavRegion || (_NavRegion = /*#__PURE__*/_jsx(NavRegion, {}))) : null;
|
|
23
|
+
};
|
|
@@ -6,7 +6,8 @@ import { lazy, Suspense } from 'react';
|
|
|
6
6
|
import { WaitMessageLauncher } from "../modals/wait-message/wait-message-launcher.js"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
7
|
|
|
8
8
|
import { jsx as _jsx2 } from "react/jsx-runtime";
|
|
9
|
-
export const loadable = (importFunc
|
|
9
|
+
export const loadable = function (importFunc) {
|
|
10
|
+
let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _WaitMessageLauncher || (_WaitMessageLauncher = /*#__PURE__*/_jsx(WaitMessageLauncher, {}));
|
|
10
11
|
const LazyComponent = /*#__PURE__*/lazy(importFunc); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
12
|
|
|
12
13
|
return props => /*#__PURE__*/_jsx(Suspense, {
|
|
@@ -4,11 +4,12 @@ import { login } from "../../utils/auth/index.js";
|
|
|
4
4
|
import { LOGIN_SUCCESS } from "../../data/auth/actions.js";
|
|
5
5
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
export const Login =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export const Login = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
clientId,
|
|
10
|
+
scope,
|
|
11
|
+
responseType
|
|
12
|
+
} = _ref;
|
|
12
13
|
const dispatch = useAppDispatch();
|
|
13
14
|
useEffect(() => {
|
|
14
15
|
login({
|
|
@@ -9,6 +9,7 @@ export const getHostAppData = (action, resolve) => event => {
|
|
|
9
9
|
|
|
10
10
|
resolve();
|
|
11
11
|
};
|
|
12
|
-
export const sendMessageToHost = (message
|
|
12
|
+
export const sendMessageToHost = function (message) {
|
|
13
|
+
let hostedAppUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.referrer;
|
|
13
14
|
window.parent.postMessage(message, hostedAppUrl);
|
|
14
15
|
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
2
|
+
import "core-js/modules/esnext.async-iterator.for-each.js";
|
|
3
|
+
import "core-js/modules/esnext.iterator.constructor.js";
|
|
4
|
+
import "core-js/modules/esnext.iterator.for-each.js";
|
|
5
|
+
import "core-js/modules/esnext.async-iterator.map.js";
|
|
6
|
+
import "core-js/modules/esnext.iterator.map.js";
|
|
2
7
|
|
|
3
8
|
/* eslint-disable max-lines */
|
|
4
9
|
import { persistentStorage } from "../../../utils/web-storage.js";
|
|
@@ -16,15 +21,16 @@ const isCss = fileName => cssType.test(fileName);
|
|
|
16
21
|
|
|
17
22
|
const activeApps = {};
|
|
18
23
|
|
|
19
|
-
const initApplication = async
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const initApplication = async _ref => {
|
|
25
|
+
let {
|
|
26
|
+
id,
|
|
27
|
+
name,
|
|
28
|
+
hostUrl,
|
|
29
|
+
history,
|
|
30
|
+
theme,
|
|
31
|
+
manifestPath,
|
|
32
|
+
homeRoute
|
|
33
|
+
} = _ref;
|
|
28
34
|
const app = (window.emui || {})[id] || {}; // eslint-disable-next-line @typescript-eslint/unbound-method
|
|
29
35
|
|
|
30
36
|
const {
|
|
@@ -45,10 +51,11 @@ const initApplication = async ({
|
|
|
45
51
|
});
|
|
46
52
|
};
|
|
47
53
|
|
|
48
|
-
export const mountApp = async
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
export const mountApp = async _ref2 => {
|
|
55
|
+
let {
|
|
56
|
+
id,
|
|
57
|
+
name
|
|
58
|
+
} = _ref2;
|
|
52
59
|
const app = (window.emui || {})[id] || {}; // eslint-disable-next-line @typescript-eslint/unbound-method
|
|
53
60
|
|
|
54
61
|
const {
|
|
@@ -61,10 +68,11 @@ export const mountApp = async ({
|
|
|
61
68
|
hostViewportSize: getViewportSize()
|
|
62
69
|
});
|
|
63
70
|
};
|
|
64
|
-
export const unmountApp = async
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
71
|
+
export const unmountApp = async _ref3 => {
|
|
72
|
+
let {
|
|
73
|
+
id,
|
|
74
|
+
name
|
|
75
|
+
} = _ref3;
|
|
68
76
|
const app = (window.emui || {})[id];
|
|
69
77
|
if (!app) return null; // eslint-disable-next-line @typescript-eslint/unbound-method
|
|
70
78
|
|
|
@@ -107,7 +115,8 @@ Promise.all(requests).then(addAppToActiveAppList.bind(null, appConfig.id)).then(
|
|
|
107
115
|
throw new Error(logRecord.msg);
|
|
108
116
|
});
|
|
109
117
|
|
|
110
|
-
const removeAssetsFromDOM = (id
|
|
118
|
+
const removeAssetsFromDOM = function (id) {
|
|
119
|
+
let documentEle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
|
|
111
120
|
const host = CMicroAppHost.getInstance();
|
|
112
121
|
if (host) delete host.activeGuests[id];
|
|
113
122
|
const {
|
|
@@ -144,11 +153,12 @@ export const loadApp = async appConfig => {
|
|
|
144
153
|
await waitAndInitApplication(appConfig, requests);
|
|
145
154
|
getLogger().info(logRecords.APP_LOADING_COMPLETE(appConfig.id));
|
|
146
155
|
};
|
|
147
|
-
export const unloadApp =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
156
|
+
export const unloadApp = _ref4 => {
|
|
157
|
+
let {
|
|
158
|
+
id,
|
|
159
|
+
hostUrl,
|
|
160
|
+
documentEle
|
|
161
|
+
} = _ref4;
|
|
152
162
|
getLogger().info(logRecords.APP_UNLOADING(id));
|
|
153
163
|
const app = (window.emui || {})[id];
|
|
154
164
|
if (!app) return;
|
|
@@ -2,6 +2,9 @@ import "core-js/modules/es.string.replace.js";
|
|
|
2
2
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
3
3
|
import "core-js/modules/web.url.js";
|
|
4
4
|
import "core-js/modules/web.url-search-params.js";
|
|
5
|
+
import "core-js/modules/esnext.async-iterator.reduce.js";
|
|
6
|
+
import "core-js/modules/esnext.iterator.constructor.js";
|
|
7
|
+
import "core-js/modules/esnext.iterator.reduce.js";
|
|
5
8
|
import { getHTTPClient } from "../../../communication/http-client/index.js";
|
|
6
9
|
import { removeDoubleSlash } from "../../../utils/url.js";
|
|
7
10
|
import { getLogger } from "../../../utils/micro-frontend/index.js";
|
|
@@ -9,25 +12,32 @@ import { logRecords } from "../../../utils/log-records.js";
|
|
|
9
12
|
|
|
10
13
|
const getUnVersionedManifestPath = path => path.replace(/\/\d+\.\d+\//, '/latest/');
|
|
11
14
|
|
|
12
|
-
export const getAppManifest = async
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
export const getAppManifest = async _ref => {
|
|
16
|
+
let {
|
|
17
|
+
hostUrl,
|
|
18
|
+
manifestPath
|
|
19
|
+
} = _ref;
|
|
16
20
|
const url = new URL("".concat(manifestPath.replace(/\/?$/, '/'), "manifest.json"), hostUrl);
|
|
17
21
|
const response = await getHTTPClient().get(removeDoubleSlash(url.href));
|
|
18
|
-
|
|
22
|
+
const {
|
|
23
|
+
headers
|
|
24
|
+
} = response;
|
|
25
|
+
if (headers['content-type'] && headers['content-type'].includes('application/json')) return response.data;
|
|
19
26
|
return getAppManifest({
|
|
20
27
|
hostUrl,
|
|
21
28
|
manifestPath: getUnVersionedManifestPath(manifestPath)
|
|
22
29
|
});
|
|
23
30
|
};
|
|
24
|
-
export const getFullFileNameofAssetsFromManifest = (manifest
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
31
|
+
export const getFullFileNameofAssetsFromManifest = function (manifest) {
|
|
32
|
+
let assetNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
33
|
+
return assetNames.reduce((assets, assetName) => {
|
|
34
|
+
const fullFileName = manifest[assetName];
|
|
35
|
+
if (fullFileName) assets.push(fullFileName); // eslint-disable-next-line no-console
|
|
36
|
+
else {
|
|
37
|
+
const logRecord = logRecords.ASSET_NOT_FOUND_IN_MANIFEST(assetName);
|
|
38
|
+
getLogger().error(logRecord);
|
|
39
|
+
throw new Error(logRecord.msg);
|
|
40
|
+
}
|
|
41
|
+
return assets;
|
|
42
|
+
}, []);
|
|
43
|
+
};
|
|
@@ -7,29 +7,36 @@ const HEAD_SCRIPTS = new RegExp('/(?:emuiDiagnostics|global|global-prod|emuiUser
|
|
|
7
7
|
|
|
8
8
|
const isHeadScript = scriptSrc => HEAD_SCRIPTS.test(scriptSrc);
|
|
9
9
|
|
|
10
|
-
export const addScriptToDOM = ({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
export const addScriptToDOM = (_ref, fileName, index) => {
|
|
11
|
+
let {
|
|
12
|
+
name,
|
|
13
|
+
hostUrl,
|
|
14
|
+
documentEle
|
|
15
|
+
} = _ref;
|
|
16
|
+
return new Promise((resolve, reject) => {
|
|
17
|
+
const ele = documentEle.createElement('script');
|
|
18
|
+
if (!ele) reject(new Error('Unable to insert Application scripts.'));
|
|
19
|
+
ele.id = "".concat(APP_SCRIPT_ID_PREFIX).concat(name, "-").concat(index);
|
|
20
|
+
const url = new URL(fileName, hostUrl);
|
|
21
|
+
ele.src = removeDoubleSlash(url.href);
|
|
22
|
+
ele.onload = resolve.bind(null, ele.id);
|
|
23
|
+
ele.onerror = reject.bind(null, ele.id);
|
|
24
|
+
ele.async = false; // execute the scripts in the same order as they are inserted
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
if (isHeadScript(ele.src)) documentEle.head.appendChild(ele);else documentEle.body.appendChild(ele);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
export const removeScriptFromDOM = function () {
|
|
30
|
+
let elementId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
31
|
+
let documentEle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
|
|
32
|
+
return new Promise(resolve => {
|
|
33
|
+
const ele = documentEle.getElementById(elementId); // eslint-disable-next-line no-console
|
|
28
34
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
35
|
+
if (!ele) console.warn(new Error("script with id ".concat(elementId, " not found")));
|
|
36
|
+
ele.remove();
|
|
37
|
+
resolve();
|
|
38
|
+
});
|
|
39
|
+
};
|
|
33
40
|
export const removeDynamicImportedScripts = (hostUrl, documentEle) => {
|
|
34
41
|
const hostPattern = new RegExp(hostUrl, 'i');
|
|
35
42
|
const scriptElements = documentEle.getElementsByTagName('script');
|
|
@@ -3,27 +3,34 @@ import "core-js/modules/web.url.js";
|
|
|
3
3
|
import "core-js/modules/web.url-search-params.js";
|
|
4
4
|
import { removeDoubleSlash } from "../../../utils/url.js";
|
|
5
5
|
export const APP_STYLE_ID_PREFIX = 'emui-style-';
|
|
6
|
-
export const addStylesToDOM = ({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
export const addStylesToDOM = (_ref, fileName, index) => {
|
|
7
|
+
let {
|
|
8
|
+
name,
|
|
9
|
+
hostUrl,
|
|
10
|
+
documentEle
|
|
11
|
+
} = _ref;
|
|
12
|
+
return new Promise((resolve, reject) => {
|
|
13
|
+
const ele = documentEle.createElement('link');
|
|
14
|
+
if (!ele) reject(new Error('Unable to insert Application styles.'));
|
|
15
|
+
ele.id = "".concat(APP_STYLE_ID_PREFIX).concat(name, "-").concat(index);
|
|
16
|
+
ele.rel = 'stylesheet';
|
|
17
|
+
const url = new URL(fileName, hostUrl);
|
|
18
|
+
ele.href = removeDoubleSlash(url.href);
|
|
19
|
+
ele.onload = resolve.bind(null, ele.id);
|
|
20
|
+
documentEle.head.appendChild(ele);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
export const removeStyleFromDOM = function () {
|
|
24
|
+
let elementId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
25
|
+
let documentEle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
|
|
26
|
+
return new Promise(resolve => {
|
|
27
|
+
const ele = documentEle.getElementById(elementId); // eslint-disable-next-line no-console
|
|
22
28
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
29
|
+
if (!ele) console.warn(new Error("style with id ".concat(elementId, " not found")));
|
|
30
|
+
ele.remove();
|
|
31
|
+
resolve();
|
|
32
|
+
});
|
|
33
|
+
};
|
|
27
34
|
export const removeDynamicImportedStyles = (hostUrl, documentEle) => {
|
|
28
35
|
const hostPattern = new RegExp(hostUrl, 'i');
|
|
29
36
|
const prefetchElements = documentEle.querySelectorAll('[rel="stylesheet"]');
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import _merge from "lodash/merge";
|
|
1
2
|
import { useRef, useLayoutEffect, useCallback } from 'react';
|
|
2
|
-
import { merge } from 'lodash';
|
|
3
3
|
import { useDispatch } from 'react-redux';
|
|
4
4
|
import { waitMessage } from "../../data/wait-message/actions.js";
|
|
5
5
|
import { loadApp, unloadApp, mountApp, unmountApp } from "./app-factory/index.js";
|
|
6
6
|
import { getLogger, getMicroFrontEndAppConfig } from "../../utils/micro-frontend/index.js";
|
|
7
7
|
import { logRecords } from "../../utils/log-records.js";
|
|
8
|
-
export const useAppWillRender =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
export const useAppWillRender = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
id,
|
|
11
|
+
documentEle,
|
|
12
|
+
history,
|
|
13
|
+
theme,
|
|
14
|
+
onUnloadComplete
|
|
15
|
+
} = _ref;
|
|
15
16
|
// ToDo: Since ecc app is using older version of react-redux we need this undefined check. once ECC upgrades to react-redux v6 or later, this check can be removed
|
|
16
17
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
17
18
|
const dispatch = useDispatch ? useDispatch() : null;
|
|
@@ -44,12 +45,14 @@ export const useAppWillRender = ({
|
|
|
44
45
|
}, [dispatch, unload]);
|
|
45
46
|
useLayoutEffect(() => {
|
|
46
47
|
if (!documentEle) return () => {};
|
|
47
|
-
|
|
48
|
+
|
|
49
|
+
const appConfig = _merge(getConfig(), {
|
|
48
50
|
documentEle,
|
|
49
51
|
history,
|
|
50
52
|
theme
|
|
51
53
|
}); // eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
52
54
|
|
|
55
|
+
|
|
53
56
|
load(appConfig);
|
|
54
57
|
return () => {
|
|
55
58
|
ref.current = unload(appConfig);
|