@elliemae/pui-app-sdk 4.0.0-beta.5 → 4.1.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/README.md +5 -1
- package/dist/cjs/analytics/appdynamics.js +6 -16
- package/dist/cjs/analytics/index.js +2 -15
- package/dist/cjs/analytics/page-view-event.js +1 -0
- package/dist/cjs/analytics/user-session-event.js +1 -0
- package/dist/cjs/analytics/user-wait-event.js +1 -0
- package/dist/cjs/analytics/web-analytics.js +2 -15
- package/dist/cjs/api/auth/index.js +9 -2
- package/dist/cjs/api/helpers.js +8 -1
- package/dist/cjs/api/users/index.js +4 -1
- package/dist/cjs/communication/http-client/index.js +14 -43
- package/dist/cjs/communication/http-client/request-interceptor.js +1 -0
- package/dist/cjs/communication/http-client/response-interceptor.js +5 -1
- package/dist/cjs/communication/http-client/retry-axios.js +5 -1
- package/dist/cjs/communication/http-client/retry.js +1 -0
- package/dist/cjs/data/auth/actions.js +1 -0
- package/dist/cjs/data/auth/reducer.js +15 -8
- package/dist/cjs/data/breakpoint/index.js +5 -1
- package/dist/cjs/data/error/index.js +1 -0
- package/dist/cjs/data/index.js +2 -0
- package/dist/cjs/data/live-message/index.js +1 -0
- package/dist/cjs/data/logout/actions.js +1 -0
- package/dist/cjs/data/navigation-prompt/actions.js +1 -0
- package/dist/cjs/data/react-redux.js +1 -0
- package/dist/cjs/data/reducers.js +5 -17
- package/dist/cjs/data/saga.js +1 -0
- package/dist/cjs/data/store.js +11 -2
- package/dist/cjs/data/wait-message/actions.js +1 -0
- package/dist/cjs/data/wait-message/reducer.js +5 -1
- package/dist/cjs/data/webpack-hmr.js +1 -0
- package/dist/cjs/index.js +13 -1
- package/dist/cjs/micro-frontend.js +1 -0
- package/dist/cjs/sideeffect/auth/index.js +7 -21
- package/dist/cjs/sideeffect/error-toast/index.js +7 -20
- package/dist/cjs/sideeffect/wait-message/index.js +13 -23
- package/dist/cjs/utils/app-config/config.js +5 -1
- package/dist/cjs/utils/app-config/index.js +12 -4
- package/dist/cjs/utils/app-host-integration/react.js +1 -0
- package/dist/cjs/utils/auth/helper.js +5 -1
- package/dist/cjs/utils/auth/index.js +13 -25
- package/dist/cjs/utils/await.js +1 -0
- package/dist/cjs/utils/constants.js +1 -0
- package/dist/cjs/utils/font-size.js +1 -0
- package/dist/cjs/utils/guest-with-service.js +1 -0
- package/dist/cjs/utils/helpers.js +2 -1
- package/dist/cjs/utils/history.js +1 -0
- package/dist/cjs/utils/log-records.js +1 -0
- package/dist/cjs/utils/micro-frontend/console-logger.js +1 -0
- package/dist/cjs/utils/micro-frontend/guest.js +10 -7
- package/dist/cjs/utils/micro-frontend/host.js +10 -3
- package/dist/cjs/utils/micro-frontend/index.js +28 -10
- package/dist/cjs/utils/micro-frontend/ssfguest-adapter.js +11 -3
- package/dist/cjs/utils/micro-frontend/types.js +1 -0
- package/dist/cjs/utils/redact-pii.js +9 -2
- package/dist/cjs/utils/service-worker.js +4 -2
- package/dist/cjs/utils/session.js +15 -4
- package/dist/cjs/utils/storybook/cjs/main.js +1 -0
- package/dist/cjs/utils/storybook/cjs/middleware.js +1 -0
- package/dist/cjs/utils/storybook/cjs/vite.js +1 -0
- package/dist/cjs/utils/storybook/cjs/webpack.js +2 -4
- package/dist/cjs/utils/storybook/manager.js +1 -0
- package/dist/cjs/utils/storybook/preview.js +2 -1
- package/dist/cjs/utils/storybook/theme.js +10 -39
- package/dist/cjs/utils/testing/index.js +7 -22
- package/dist/cjs/utils/testing/render-with-redux.js +7 -24
- package/dist/cjs/utils/testing/render-with-router-redux.js +12 -26
- package/dist/cjs/utils/testing/render-with-router.js +9 -26
- package/dist/cjs/utils/testing/render-with-state-addons.js +15 -45
- package/dist/cjs/utils/types.js +1 -0
- package/dist/cjs/utils/url.js +1 -0
- package/dist/cjs/utils/web-storage.js +5 -1
- package/dist/cjs/utils/window.js +9 -2
- package/dist/cjs/view/app-root/hosted-app.js +14 -3
- package/dist/cjs/view/app-root/index.js +29 -31
- package/dist/cjs/view/app-root/stand-alone-app.js +18 -3
- package/dist/cjs/view/app-root/style.js +1 -0
- package/dist/cjs/view/app-router.js +7 -37
- package/dist/cjs/view/breakpoint/use-breakpoint.js +10 -5
- package/dist/cjs/view/breakpoint/use-media-query-list.js +4 -1
- package/dist/cjs/view/error-boundary/default-error-template.js +12 -5
- package/dist/cjs/view/error-boundary/index.js +10 -21
- package/dist/cjs/view/error-toast/index.js +11 -23
- package/dist/cjs/view/fetch-host-app-data/index.js +5 -1
- package/dist/cjs/view/fetch-host-app-data/store.js +2 -15
- package/dist/cjs/view/fields/autocomplete/index.js +47 -0
- package/dist/cjs/view/fields/check-box/index.js +11 -46
- package/dist/cjs/view/fields/combo-box/index.js +19 -57
- package/dist/cjs/view/fields/combo-box-v3/index.js +42 -0
- package/dist/cjs/view/fields/connect-form.js +4 -15
- package/dist/cjs/view/fields/date-input/index.js +16 -47
- package/dist/cjs/view/fields/date-picker/index.js +20 -45
- package/dist/cjs/view/fields/date-range-picker/index.js +30 -62
- package/dist/cjs/view/fields/date-time-picker/index.js +18 -56
- package/dist/cjs/view/fields/form-item-layout/index.js +10 -38
- package/dist/cjs/view/fields/form-layout-block-item/index.js +14 -44
- package/dist/cjs/view/fields/input-mask/index.js +28 -47
- package/dist/cjs/view/fields/input-text/index.js +16 -47
- package/dist/cjs/view/fields/large-text-box/index.js +16 -47
- package/dist/cjs/view/fields/radio/index.js +18 -56
- package/dist/cjs/view/fields/radio-group/index.js +11 -46
- package/dist/cjs/view/fields/text-box/index.js +16 -47
- package/dist/cjs/view/fields/toggle/index.js +19 -57
- package/dist/cjs/view/fields/watch-value.js +26 -3
- package/dist/cjs/view/form/index.js +14 -19
- package/dist/cjs/view/form/personal-info-section.js +55 -47
- package/dist/cjs/view/form/submit-button/index.js +6 -37
- package/dist/cjs/view/guest-unload-handlers/index.js +1 -0
- package/dist/cjs/view/host-binding-events/index.js +1 -0
- package/dist/cjs/view/live-message/index.js +3 -5
- package/dist/cjs/view/loadable/index.js +9 -22
- package/dist/cjs/view/login/index.js +15 -3
- package/dist/cjs/view/message-to-host-app/index.js +1 -0
- package/dist/cjs/view/micro-app/app-factory/index.js +11 -21
- package/dist/cjs/view/micro-app/const.js +1 -0
- package/dist/cjs/view/micro-app/index.js +7 -3
- package/dist/cjs/view/micro-app/resources/manifest.js +11 -3
- package/dist/cjs/view/micro-app/resources/script.js +8 -2
- package/dist/cjs/view/micro-app/resources/style.js +8 -2
- package/dist/cjs/view/micro-app/types.js +1 -0
- package/dist/cjs/view/micro-app/use-app-will-render.js +38 -44
- package/dist/cjs/view/micro-app/utils.js +1 -0
- package/dist/cjs/view/micro-iframe-app/app.js +24 -47
- package/dist/cjs/view/micro-iframe-app/iframe/const.js +1 -0
- package/dist/cjs/view/micro-iframe-app/iframe/index.js +23 -32
- package/dist/cjs/view/micro-iframe-app/index.js +6 -37
- package/dist/cjs/view/micro-iframe-app/types.js +1 -0
- package/dist/cjs/view/micro-iframe-app/use-frame-loaded.js +1 -0
- package/dist/cjs/view/modals/error/index.js +22 -12
- package/dist/cjs/view/modals/navigation-prompt/index.js +47 -27
- package/dist/cjs/view/modals/session-expiry/customHooks.js +7 -2
- package/dist/cjs/view/modals/session-expiry/index.js +58 -35
- package/dist/cjs/view/modals/wait-message/index.js +26 -58
- package/dist/cjs/view/modals/wait-message/use-html-wait-message.js +1 -0
- package/dist/cjs/view/modals/wait-message/wait-message-launcher.js +1 -0
- package/dist/cjs/view/page.js +16 -3
- package/dist/cjs/view/render-with-delay/index.js +5 -5
- package/dist/cjs/view/render-with-host-data/index.js +3 -5
- package/dist/cjs/view/require-auth.js +22 -9
- package/dist/cjs/view/session-timeout/index.js +16 -14
- package/dist/cjs/view/storybook/decorator.js +6 -7
- package/dist/cjs/view/use-previous.js +1 -0
- package/dist/cjs/view/use-window-size-change.js +1 -0
- package/dist/cjs/view/visually-hidden/index.js +12 -19
- package/dist/esm/analytics/appdynamics.js +1 -17
- package/dist/esm/analytics/index.js +1 -17
- package/dist/esm/analytics/web-analytics.js +1 -17
- package/dist/esm/api/auth/index.js +8 -2
- package/dist/esm/api/helpers.js +7 -1
- package/dist/esm/api/users/index.js +3 -1
- package/dist/esm/communication/http-client/index.js +9 -44
- package/dist/esm/data/auth/reducer.js +10 -7
- package/dist/esm/data/index.js +6 -1
- package/dist/esm/data/reducers.js +4 -19
- package/dist/esm/data/store.js +6 -1
- package/dist/esm/index.js +14 -1
- package/dist/esm/sideeffect/auth/index.js +6 -23
- package/dist/esm/sideeffect/error-toast/index.js +6 -22
- package/dist/esm/sideeffect/wait-message/index.js +12 -25
- package/dist/esm/utils/app-config/index.js +7 -3
- package/dist/esm/utils/auth/index.js +12 -27
- package/dist/esm/utils/helpers.js +1 -1
- package/dist/esm/utils/micro-frontend/guest.js +5 -6
- package/dist/esm/utils/micro-frontend/host.js +9 -3
- package/dist/esm/utils/micro-frontend/index.js +23 -9
- package/dist/esm/utils/micro-frontend/ssfguest-adapter.js +6 -2
- package/dist/esm/utils/redact-pii.js +8 -2
- package/dist/esm/utils/service-worker.js +3 -2
- package/dist/esm/utils/session.js +14 -4
- package/dist/esm/utils/storybook/preview.js +1 -1
- package/dist/esm/utils/storybook/theme.js +9 -41
- package/dist/esm/utils/testing/index.js +6 -21
- package/dist/esm/utils/testing/render-with-redux.js +6 -23
- package/dist/esm/utils/testing/render-with-router-redux.js +11 -25
- package/dist/esm/utils/testing/render-with-router.js +8 -25
- package/dist/esm/utils/testing/render-with-state-addons.js +14 -44
- package/dist/esm/utils/window.js +8 -2
- package/dist/esm/view/app-root/hosted-app.js +9 -2
- package/dist/esm/view/app-root/index.js +28 -30
- package/dist/esm/view/app-root/stand-alone-app.js +13 -2
- package/dist/esm/view/app-router.js +6 -36
- package/dist/esm/view/breakpoint/use-breakpoint.js +9 -5
- package/dist/esm/view/breakpoint/use-media-query-list.js +3 -1
- package/dist/esm/view/error-boundary/default-error-template.js +11 -2
- package/dist/esm/view/error-boundary/index.js +5 -22
- package/dist/esm/view/error-toast/index.js +10 -22
- package/dist/esm/view/fetch-host-app-data/store.js +1 -17
- package/dist/esm/view/fields/autocomplete/index.js +27 -0
- package/dist/esm/view/fields/check-box/index.js +10 -45
- package/dist/esm/view/fields/combo-box/index.js +18 -56
- package/dist/esm/view/fields/combo-box-v3/index.js +24 -0
- package/dist/esm/view/fields/connect-form.js +3 -17
- package/dist/esm/view/fields/date-input/index.js +15 -46
- package/dist/esm/view/fields/date-picker/index.js +15 -46
- package/dist/esm/view/fields/date-range-picker/index.js +29 -61
- package/dist/esm/view/fields/date-time-picker/index.js +17 -55
- package/dist/esm/view/fields/form-item-layout/index.js +9 -37
- package/dist/esm/view/fields/form-layout-block-item/index.js +13 -43
- package/dist/esm/view/fields/input-mask/index.js +27 -46
- package/dist/esm/view/fields/input-text/index.js +15 -46
- package/dist/esm/view/fields/large-text-box/index.js +15 -46
- package/dist/esm/view/fields/radio/index.js +17 -55
- package/dist/esm/view/fields/radio-group/index.js +10 -45
- package/dist/esm/view/fields/text-box/index.js +15 -46
- package/dist/esm/view/fields/toggle/index.js +18 -56
- package/dist/esm/view/fields/watch-value.js +21 -2
- package/dist/esm/view/form/index.js +9 -20
- package/dist/esm/view/form/personal-info-section.js +50 -46
- package/dist/esm/view/form/submit-button/index.js +5 -36
- package/dist/esm/view/live-message/index.js +2 -2
- package/dist/esm/view/loadable/index.js +8 -21
- package/dist/esm/view/login/index.js +15 -4
- package/dist/esm/view/micro-app/app-factory/index.js +10 -23
- package/dist/esm/view/micro-app/index.js +2 -2
- package/dist/esm/view/micro-app/resources/manifest.js +10 -3
- package/dist/esm/view/micro-app/resources/script.js +7 -2
- package/dist/esm/view/micro-app/resources/style.js +7 -2
- package/dist/esm/view/micro-app/use-app-will-render.js +37 -46
- package/dist/esm/view/micro-iframe-app/app.js +19 -48
- package/dist/esm/view/micro-iframe-app/iframe/index.js +18 -33
- package/dist/esm/view/micro-iframe-app/index.js +5 -36
- package/dist/esm/view/modals/error/index.js +21 -9
- package/dist/esm/view/modals/navigation-prompt/index.js +46 -24
- package/dist/esm/view/modals/session-expiry/customHooks.js +6 -2
- package/dist/esm/view/modals/session-expiry/index.js +57 -32
- package/dist/esm/view/modals/wait-message/index.js +25 -57
- package/dist/esm/view/page.js +11 -2
- package/dist/esm/view/render-with-delay/index.js +4 -2
- package/dist/esm/view/render-with-host-data/index.js +2 -2
- package/dist/esm/view/require-auth.js +18 -9
- package/dist/esm/view/session-timeout/index.js +15 -11
- package/dist/esm/view/storybook/decorator.js +5 -4
- package/dist/esm/view/visually-hidden/index.js +7 -20
- package/dist/types/__mocks__/@elliemae/em-ssf-guest.d.ts +6 -0
- package/dist/types/{analytics → lib/analytics}/appdynamics.d.ts +0 -0
- package/dist/types/{analytics → lib/analytics}/index.d.ts +0 -0
- package/dist/types/{analytics → lib/analytics}/page-view-event.d.ts +0 -0
- package/dist/types/{analytics → lib/analytics}/user-session-event.d.ts +0 -0
- package/dist/types/{analytics → lib/analytics}/user-wait-event.d.ts +0 -0
- package/dist/types/{analytics → lib/analytics}/web-analytics.d.ts +0 -0
- package/dist/types/{api → lib/api}/auth/index.d.ts +0 -0
- package/dist/types/{api → lib/api}/helpers.d.ts +0 -0
- package/dist/types/{api → lib/api}/users/index.d.ts +0 -0
- package/dist/types/{api → lib/api}/users/index.endpoint.d.ts +0 -0
- package/dist/types/{communication → lib/communication}/http-client/index.d.ts +0 -0
- package/dist/types/{communication → lib/communication}/http-client/request-interceptor.d.ts +0 -0
- package/dist/types/{communication → lib/communication}/http-client/response-interceptor.d.ts +0 -0
- package/dist/types/{communication → lib/communication}/http-client/retry-axios.d.ts +0 -0
- package/dist/types/{communication → lib/communication}/http-client/retry.d.ts +0 -0
- package/dist/types/{communication → lib/communication}/http-client/tests/hello.endpoint.d.ts +0 -0
- package/dist/types/{communication → lib/communication}/http-client/tests/index.test.d.ts +0 -0
- package/dist/types/{communication → lib/communication}/http-client/tests/private.endpoint.d.ts +0 -0
- package/dist/types/{data → lib/data}/auth/actions.d.ts +0 -0
- package/dist/types/{data → lib/data}/auth/reducer.d.ts +0 -0
- package/dist/types/{data → lib/data}/breakpoint/index.d.ts +0 -0
- package/dist/types/{data → lib/data}/error/index.d.ts +0 -0
- package/dist/types/{data → lib/data}/index.d.ts +1 -1
- package/dist/types/{data → lib/data}/live-message/index.d.ts +0 -0
- package/dist/types/{data → lib/data}/logout/actions.d.ts +0 -0
- package/dist/types/{data → lib/data}/navigation-prompt/actions.d.ts +0 -0
- package/dist/types/{data → lib/data}/react-redux.d.ts +0 -0
- package/dist/types/{data → lib/data}/reducers.d.ts +0 -0
- package/dist/types/{data → lib/data}/saga.d.ts +0 -0
- package/dist/types/{data → lib/data}/store.d.ts +1 -1
- package/dist/types/{data → lib/data}/tests/store.test.d.ts +0 -0
- package/dist/types/{data → lib/data}/wait-message/actions.d.ts +0 -0
- package/dist/types/{data → lib/data}/wait-message/reducer.d.ts +0 -0
- package/dist/types/{data → lib/data}/webpack-hmr.d.ts +0 -0
- package/dist/types/{index.d.ts → lib/index.d.ts} +6 -3
- package/dist/types/{micro-frontend.d.ts → lib/micro-frontend.d.ts} +0 -0
- package/dist/types/{sideeffect → lib/sideeffect}/auth/index.d.ts +0 -0
- package/dist/types/{sideeffect → lib/sideeffect}/error-toast/index.d.ts +0 -0
- package/dist/types/{sideeffect → lib/sideeffect}/wait-message/index.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/app-config/config.d.ts +0 -0
- package/dist/types/lib/utils/app-config/index.d.ts +1 -0
- package/dist/types/{utils → lib/utils}/app-host-integration/react.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/auth/helper.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/auth/index.d.ts +3 -1
- package/dist/types/{utils → lib/utils}/await.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/constants.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/font-size.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/guest-with-service.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/helpers.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/history.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/log-records.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/micro-frontend/console-logger.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/micro-frontend/guest.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/micro-frontend/host.d.ts +3 -3
- package/dist/types/{utils → lib/utils}/micro-frontend/index.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/micro-frontend/ssfguest-adapter.d.ts +2 -2
- package/dist/types/lib/utils/micro-frontend/tests/guest-ssf-host.test.d.ts +1 -0
- package/dist/types/lib/utils/micro-frontend/tests/guest.test.d.ts +1 -0
- package/dist/types/{utils → lib/utils}/micro-frontend/types.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/redact-pii.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/service-worker.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/session.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/storybook/cjs/main.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/storybook/cjs/middleware.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/storybook/cjs/vite.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/storybook/cjs/webpack.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/storybook/manager.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/storybook/preview.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/storybook/theme.d.ts +0 -0
- package/dist/types/lib/utils/testing/index.d.ts +4 -0
- package/dist/types/{utils → lib/utils}/testing/render-with-redux.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/testing/render-with-router-redux.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/testing/render-with-router.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/testing/render-with-state-addons.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/types.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/url.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/web-storage.d.ts +0 -0
- package/dist/types/{utils → lib/utils}/window.d.ts +0 -0
- package/dist/types/{view → lib/view}/app-root/hosted-app.d.ts +0 -0
- package/dist/types/{view → lib/view}/app-root/index.d.ts +2 -1
- package/dist/types/{view → lib/view}/app-root/stand-alone-app.d.ts +0 -0
- package/dist/types/{view → lib/view}/app-root/style.d.ts +0 -0
- package/dist/types/{view → lib/view}/app-router.d.ts +1 -1
- package/dist/types/{view → lib/view}/breakpoint/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/breakpoint/use-breakpoint.d.ts +0 -0
- package/dist/types/{view → lib/view}/breakpoint/use-media-query-list.d.ts +0 -0
- package/dist/types/{view → lib/view}/error-boundary/default-error-template.d.ts +0 -0
- package/dist/types/{view → lib/view}/error-boundary/index.d.ts +2 -1
- package/dist/types/{view → lib/view}/error-toast/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/error-toast/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fetch-host-app-data/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/fetch-host-app-data/store.d.ts +0 -0
- package/dist/types/lib/view/fields/autocomplete/index.d.ts +13 -0
- package/dist/types/lib/view/fields/autocomplete/index.stories.d.ts +5 -0
- package/dist/types/{view → lib/view}/fields/check-box/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/check-box/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/check-box/set-value.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/combo-box/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/combo-box/index.stories.d.ts +0 -0
- package/dist/types/lib/view/fields/combo-box-v3/index.d.ts +9 -0
- package/dist/types/lib/view/fields/combo-box-v3/index.stories.d.ts +5 -0
- package/dist/types/{view → lib/view}/fields/connect-form.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/date-input/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/date-input/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/date-picker/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/date-picker/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/date-range-picker/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/date-range-picker/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/date-time-picker/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/date-time-picker/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/form-item-layout/index.d.ts +1 -1
- package/dist/types/{view → lib/view}/fields/form-item-layout/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/form-layout-block-item/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/form-layout-block-item/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/input-mask/index.d.ts +3 -1
- package/dist/types/{view → lib/view}/fields/input-mask/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/input-text/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/input-text/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/large-text-box/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/large-text-box/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/radio/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/radio/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/radio/set-value.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/radio-group/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/radio-group/index.stories.d.ts +0 -0
- package/dist/types/lib/view/fields/tests/combo-box-v3.test.d.ts +1 -0
- package/dist/types/{view → lib/view}/fields/text-box/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/text-box/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/toggle/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/toggle/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/fields/watch-value.d.ts +0 -0
- package/dist/types/{view → lib/view}/form/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/form/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/form/personal-info-section.d.ts +0 -0
- package/dist/types/{view → lib/view}/form/submit-button/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/form/usecases.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/guest-unload-handlers/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/host-binding-events/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/live-message/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/live-message/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/loadable/index.d.ts +0 -0
- package/dist/types/lib/view/login/index.d.ts +9 -0
- package/dist/types/{view → lib/view}/message-to-host-app/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/micro-app/app-factory/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/micro-app/const.d.ts +0 -0
- package/dist/types/{view → lib/view}/micro-app/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/micro-app/resources/manifest.d.ts +0 -0
- package/dist/types/{view → lib/view}/micro-app/resources/script.d.ts +0 -0
- package/dist/types/{view → lib/view}/micro-app/resources/style.d.ts +0 -0
- package/dist/types/{view → lib/view}/micro-app/types.d.ts +0 -0
- package/dist/types/{view → lib/view}/micro-app/use-app-will-render.d.ts +0 -0
- package/dist/types/{view → lib/view}/micro-app/utils.d.ts +0 -0
- package/dist/types/{view → lib/view}/micro-iframe-app/app.d.ts +0 -0
- package/dist/types/{view → lib/view}/micro-iframe-app/iframe/const.d.ts +0 -0
- package/dist/types/{view → lib/view}/micro-iframe-app/iframe/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/micro-iframe-app/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/micro-iframe-app/types.d.ts +0 -0
- package/dist/types/{view → lib/view}/micro-iframe-app/use-frame-loaded.d.ts +0 -0
- package/dist/types/{view → lib/view}/modals/error/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/modals/error/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/modals/navigation-prompt/index.d.ts +1 -1
- package/dist/types/{view → lib/view}/modals/navigation-prompt/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/modals/session-expiry/customHooks.d.ts +0 -0
- package/dist/types/{view → lib/view}/modals/session-expiry/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/modals/session-expiry/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/modals/wait-message/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/modals/wait-message/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/modals/wait-message/use-html-wait-message.d.ts +0 -0
- package/dist/types/{view → lib/view}/modals/wait-message/wait-message-launcher.d.ts +0 -0
- package/dist/types/{view → lib/view}/page.d.ts +0 -0
- package/dist/types/{view → lib/view}/render-with-delay/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/render-with-host-data/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/require-auth.d.ts +0 -0
- package/dist/types/{view → lib/view}/session-timeout/index.d.ts +0 -0
- package/dist/types/{view → lib/view}/session-timeout/index.stories.d.ts +0 -0
- package/dist/types/{view → lib/view}/storybook/decorator.d.ts +0 -0
- package/dist/types/{view → lib/view}/use-previous.d.ts +0 -0
- package/dist/types/{view → lib/view}/use-window-size-change.d.ts +0 -0
- package/dist/types/{view → lib/view}/visually-hidden/index.d.ts +0 -0
- package/package.json +55 -50
- package/dist/types/utils/app-config/index.d.ts +0 -1
- package/dist/types/utils/testing/index.d.ts +0 -4
- package/dist/types/view/login/index.d.ts +0 -7
|
@@ -1,63 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
import * as React from "react";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
33
2
|
import { DSControlledToggle } from "@elliemae/ds-controlled-form";
|
|
34
3
|
import {
|
|
35
4
|
Controller
|
|
36
5
|
} from "react-hook-form";
|
|
37
|
-
const Toggle = (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
checked: value,
|
|
55
|
-
value: value.toString(),
|
|
56
|
-
onChange: () => onChange(!value)
|
|
57
|
-
}));
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
};
|
|
6
|
+
const Toggle = ({
|
|
7
|
+
name,
|
|
8
|
+
defaultValue = false,
|
|
9
|
+
rules = {},
|
|
10
|
+
...rest
|
|
11
|
+
}) => /* @__PURE__ */ jsx(Controller, {
|
|
12
|
+
name,
|
|
13
|
+
rules,
|
|
14
|
+
defaultValue,
|
|
15
|
+
render: ({ field: { value, onChange, ...restProps } }) => /* @__PURE__ */ jsx(DSControlledToggle, {
|
|
16
|
+
...rest,
|
|
17
|
+
...restProps,
|
|
18
|
+
checked: value,
|
|
19
|
+
value: value.toString(),
|
|
20
|
+
onChange: () => onChange(!value)
|
|
21
|
+
})
|
|
22
|
+
});
|
|
61
23
|
export {
|
|
62
24
|
Toggle
|
|
63
25
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { Grid } from "@elliemae/ds-grid";
|
|
4
4
|
import { useFormContext } from "react-hook-form";
|
|
@@ -16,7 +16,26 @@ const Div = styled.div`
|
|
|
16
16
|
const WatchValue = ({ name, label }) => {
|
|
17
17
|
const { watch } = useFormContext();
|
|
18
18
|
const data = watch(name, false) || "";
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ jsx(Grid, {
|
|
20
|
+
children: /* @__PURE__ */ jsxs(Section, {
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ jsx("h4", {
|
|
23
|
+
children: "Form Data:"
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ jsx(Div, {
|
|
26
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
27
|
+
children: [
|
|
28
|
+
label,
|
|
29
|
+
" : ",
|
|
30
|
+
/* @__PURE__ */ jsx("strong", {
|
|
31
|
+
children: JSON.stringify(data)
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
})
|
|
38
|
+
});
|
|
20
39
|
};
|
|
21
40
|
export {
|
|
22
41
|
WatchValue
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
import * as React from "react";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
18
2
|
import styled from "styled-components";
|
|
19
3
|
import {
|
|
20
4
|
useForm,
|
|
@@ -37,9 +21,14 @@ const Form = ({
|
|
|
37
21
|
const providerProps = Object.assign(methods, {
|
|
38
22
|
formProps: reactHookFormProps
|
|
39
23
|
});
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
|
|
42
|
-
|
|
24
|
+
return /* @__PURE__ */ jsx(FormProvider, {
|
|
25
|
+
...providerProps,
|
|
26
|
+
children: /* @__PURE__ */ jsx(StyledForm, {
|
|
27
|
+
className: classname,
|
|
28
|
+
...formProps,
|
|
29
|
+
children
|
|
30
|
+
})
|
|
31
|
+
});
|
|
43
32
|
};
|
|
44
33
|
export {
|
|
45
34
|
Form
|
|
@@ -1,62 +1,66 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import moment from "moment";
|
|
3
3
|
import { TextBox } from "../fields/text-box/index.js";
|
|
4
4
|
import { ComboBox } from "../fields/combo-box/index.js";
|
|
5
5
|
import { DateInput } from "../fields/date-input/index.js";
|
|
6
6
|
import { FormLayoutBlockItem } from "../fields/form-layout-block-item/index.js";
|
|
7
|
-
const FirstName = () => /* @__PURE__ */
|
|
7
|
+
const FirstName = () => /* @__PURE__ */ jsx(FormLayoutBlockItem, {
|
|
8
8
|
label: "First Name",
|
|
9
9
|
inputID: "firstname",
|
|
10
|
-
required: true
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})
|
|
20
|
-
|
|
10
|
+
required: true,
|
|
11
|
+
children: /* @__PURE__ */ jsx(TextBox, {
|
|
12
|
+
id: "firstname",
|
|
13
|
+
name: "firstname",
|
|
14
|
+
rules: {
|
|
15
|
+
required: { value: true, message: "First Name is required" },
|
|
16
|
+
minLength: { value: 2, message: "Minimum 2 characters" },
|
|
17
|
+
maxLength: { value: 50, message: "Maximum 50 characters" }
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
const DOB = () => /* @__PURE__ */ jsx(FormLayoutBlockItem, {
|
|
21
22
|
label: "Date of Birth",
|
|
22
23
|
inputID: "dob",
|
|
23
|
-
required: true
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
})
|
|
32
|
-
|
|
24
|
+
required: true,
|
|
25
|
+
children: /* @__PURE__ */ jsx(DateInput, {
|
|
26
|
+
id: "dob",
|
|
27
|
+
name: "dob",
|
|
28
|
+
rules: {
|
|
29
|
+
required: { value: true, message: "Date of Birth is required" },
|
|
30
|
+
validate: (value) => moment() > value || "Date of Birth can not be greater than current date"
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
const State = () => /* @__PURE__ */ jsx(FormLayoutBlockItem, {
|
|
33
35
|
label: "State",
|
|
34
36
|
inputID: "state",
|
|
35
|
-
required: true
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
})
|
|
45
|
-
|
|
37
|
+
required: true,
|
|
38
|
+
children: /* @__PURE__ */ jsx(ComboBox, {
|
|
39
|
+
id: "state",
|
|
40
|
+
name: "state",
|
|
41
|
+
rules: { required: { value: true, message: "State is required" } },
|
|
42
|
+
options: [
|
|
43
|
+
{ value: "ca", label: "California" },
|
|
44
|
+
{ value: "nj", label: "New Jersey" }
|
|
45
|
+
]
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
const MaritalStatus = () => /* @__PURE__ */ jsx(FormLayoutBlockItem, {
|
|
46
49
|
label: "Marital Status",
|
|
47
50
|
inputID: "marital_status",
|
|
48
|
-
required: true
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
})
|
|
51
|
+
required: true,
|
|
52
|
+
children: /* @__PURE__ */ jsx(ComboBox, {
|
|
53
|
+
id: "marital_status",
|
|
54
|
+
name: "marital_status",
|
|
55
|
+
rules: {
|
|
56
|
+
required: { value: true, message: "Marital Status is required" }
|
|
57
|
+
},
|
|
58
|
+
options: [
|
|
59
|
+
{ value: "married", label: "Married" },
|
|
60
|
+
{ value: "single", label: "Single" }
|
|
61
|
+
]
|
|
62
|
+
})
|
|
63
|
+
});
|
|
60
64
|
export {
|
|
61
65
|
DOB,
|
|
62
66
|
FirstName,
|
|
@@ -1,47 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __objRest = (source, exclude) => {
|
|
21
|
-
var target = {};
|
|
22
|
-
for (var prop in source)
|
|
23
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
-
target[prop] = source[prop];
|
|
25
|
-
if (source != null && __getOwnPropSymbols)
|
|
26
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
import * as React from "react";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
33
2
|
import { useFormContext } from "react-hook-form";
|
|
34
3
|
import { DSButtonV2 } from "@elliemae/ds-button";
|
|
35
|
-
const FormSubmitButton = (
|
|
36
|
-
var rest = __objRest(_a, []);
|
|
4
|
+
const FormSubmitButton = ({ ...rest }) => {
|
|
37
5
|
const {
|
|
38
6
|
formState,
|
|
39
7
|
formProps: { mode }
|
|
40
8
|
} = useFormContext();
|
|
41
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ jsx(DSButtonV2, {
|
|
10
|
+
...rest,
|
|
42
11
|
type: "submit",
|
|
43
12
|
disabled: mode !== "onSubmit" && (!formState.isDirty || formState.isDirty && !formState.isValid)
|
|
44
|
-
})
|
|
13
|
+
});
|
|
45
14
|
};
|
|
46
15
|
export {
|
|
47
16
|
FormSubmitButton
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { LiveMessage as AriaLiveMessage } from "react-aria-live";
|
|
3
3
|
import { useAppSelector } from "../../data/react-redux.js";
|
|
4
4
|
const LiveMessage = () => {
|
|
5
5
|
const message = useAppSelector((state) => state.liveMessage?.message);
|
|
6
6
|
const id = useAppSelector((state) => state.liveMessage?.id);
|
|
7
7
|
const ariaLive = useAppSelector((state) => state.liveMessage?.ariaLive);
|
|
8
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ jsx(AriaLiveMessage, {
|
|
9
9
|
message,
|
|
10
10
|
"aria-live": ariaLive,
|
|
11
11
|
id
|
|
@@ -1,27 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
import * as React from "react";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
18
2
|
import { lazy, Suspense } from "react";
|
|
19
3
|
import { WaitMessageLauncher } from "../modals/wait-message/wait-message-launcher.js";
|
|
20
|
-
const loadable = (importFunc, fallback = /* @__PURE__ */
|
|
4
|
+
const loadable = (importFunc, fallback = /* @__PURE__ */ jsx(WaitMessageLauncher, {})) => {
|
|
21
5
|
const LazyComponent = lazy(importFunc);
|
|
22
|
-
return (props) => /* @__PURE__ */
|
|
23
|
-
fallback
|
|
24
|
-
|
|
6
|
+
return (props) => /* @__PURE__ */ jsx(Suspense, {
|
|
7
|
+
fallback,
|
|
8
|
+
children: /* @__PURE__ */ jsx(LazyComponent, {
|
|
9
|
+
...props
|
|
10
|
+
})
|
|
11
|
+
});
|
|
25
12
|
};
|
|
26
13
|
export {
|
|
27
14
|
loadable
|
|
@@ -1,16 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
2
3
|
import { useAppDispatch } from "../../data/react-redux.js";
|
|
3
4
|
import { login } from "../../utils/auth/index.js";
|
|
4
5
|
import { LOGIN_SUCCESS } from "../../data/auth/actions.js";
|
|
5
|
-
const Login = ({
|
|
6
|
+
const Login = ({
|
|
7
|
+
clientId,
|
|
8
|
+
scope,
|
|
9
|
+
responseType,
|
|
10
|
+
children
|
|
11
|
+
}) => {
|
|
12
|
+
const [userAuthorized, setUserAuthorized] = useState(false);
|
|
6
13
|
const dispatch = useAppDispatch();
|
|
7
14
|
useEffect(() => {
|
|
8
|
-
login({ clientId, scope, responseType }).then(() => {
|
|
15
|
+
login({ clientId, scope, responseType }).then(({ authorized }) => {
|
|
16
|
+
if (authorized)
|
|
17
|
+
setUserAuthorized(true);
|
|
9
18
|
dispatch({ type: LOGIN_SUCCESS });
|
|
10
19
|
}).catch(() => {
|
|
11
20
|
});
|
|
12
21
|
}, [dispatch, clientId, scope, responseType]);
|
|
13
|
-
return
|
|
22
|
+
return userAuthorized ? /* @__PURE__ */ jsx(Fragment, {
|
|
23
|
+
children
|
|
24
|
+
}) : null;
|
|
14
25
|
};
|
|
15
26
|
export {
|
|
16
27
|
Login
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
1
|
import { persistentStorage } from "../../../utils/web-storage.js";
|
|
21
2
|
import { CMicroAppHost } from "../../../utils/micro-frontend/host.js";
|
|
22
3
|
import { getLogger } from "../../../utils/micro-frontend/index.js";
|
|
@@ -54,7 +35,9 @@ const initApplication = async ({
|
|
|
54
35
|
const app = (window.emui || {})[id] || {};
|
|
55
36
|
const { init } = app;
|
|
56
37
|
if (!init || typeof init !== "function")
|
|
57
|
-
throw new Error(
|
|
38
|
+
throw new Error(
|
|
39
|
+
`Application ${name} with id ${id} doesn't expose init method.`
|
|
40
|
+
);
|
|
58
41
|
const prevState = await persistentStorage.get(`state-${id}`);
|
|
59
42
|
return init({
|
|
60
43
|
host: CMicroAppHost.getInstance(),
|
|
@@ -72,7 +55,9 @@ const mountApp = async ({ id, name }) => {
|
|
|
72
55
|
const app = (window.emui || {})[id] || {};
|
|
73
56
|
const { mount } = app;
|
|
74
57
|
if (!mount || typeof mount !== "function")
|
|
75
|
-
throw new Error(
|
|
58
|
+
throw new Error(
|
|
59
|
+
`Application ${name} with id ${id} doesn't expose mount method.`
|
|
60
|
+
);
|
|
76
61
|
return mount({
|
|
77
62
|
containerId: `${APP_CONTAINER_ID_PREFIX}${id}`,
|
|
78
63
|
hostBreakpoint: getCurrentBreakpoint(),
|
|
@@ -87,7 +72,9 @@ const unmountApp = async ({ id, name }) => {
|
|
|
87
72
|
if (!unmount)
|
|
88
73
|
return null;
|
|
89
74
|
if (typeof unmount !== "function")
|
|
90
|
-
throw new Error(
|
|
75
|
+
throw new Error(
|
|
76
|
+
`unmount failed for application ${name} with id ${id}. unmount is not a valid function`
|
|
77
|
+
);
|
|
91
78
|
const currentState = await unmount({
|
|
92
79
|
containerId: `${APP_CONTAINER_ID_PREFIX}${id}`
|
|
93
80
|
});
|
|
@@ -107,7 +94,7 @@ const addAppToActiveAppList = (id, elementIds) => {
|
|
|
107
94
|
};
|
|
108
95
|
const waitAndInitApplication = (appConfig, requests) => Promise.all(requests).then(addAppToActiveAppList.bind(null, appConfig.id)).then(initApplication.bind(null, appConfig)).catch((err) => {
|
|
109
96
|
const logRecord = logRecords.APP_INIT_FAILED(appConfig.id, err.message);
|
|
110
|
-
getLogger().error(
|
|
97
|
+
getLogger().error({ ...logRecord, exception: err });
|
|
111
98
|
throw new Error(logRecord.msg);
|
|
112
99
|
});
|
|
113
100
|
const removeAssetsFromDOM = (id, documentEle = document) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from "react";
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
import { APP_CONTAINER_ID_PREFIX } from "./const.js";
|
|
@@ -9,7 +9,7 @@ const Div = styled.div`
|
|
|
9
9
|
`;
|
|
10
10
|
const MicroApp = memo((props) => {
|
|
11
11
|
useAppWillRender(props);
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ jsx(Div, {
|
|
13
13
|
id: `${APP_CONTAINER_ID_PREFIX}${props.id}`
|
|
14
14
|
});
|
|
15
15
|
});
|
|
@@ -8,9 +8,16 @@ const getAppManifest = async ({
|
|
|
8
8
|
manifestPath
|
|
9
9
|
}) => {
|
|
10
10
|
if (!hostUrl || !manifestPath)
|
|
11
|
-
throw new Error(
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
throw new Error(
|
|
12
|
+
"Unable to get app manifest. hostUrl and manifestPath are required."
|
|
13
|
+
);
|
|
14
|
+
const url = new URL(
|
|
15
|
+
`${manifestPath.replace(/\/?$/, "/")}manifest.json`,
|
|
16
|
+
hostUrl
|
|
17
|
+
);
|
|
18
|
+
const response = await getHTTPClient().get(
|
|
19
|
+
removeDoubleSlash(url.href)
|
|
20
|
+
);
|
|
14
21
|
const { headers } = response;
|
|
15
22
|
if (headers["content-type"] && headers["content-type"].includes("application/json"))
|
|
16
23
|
return response.data;
|
|
@@ -4,13 +4,18 @@ const HEAD_SCRIPTS = /(?:emuiDiagnostics|global|global-prod|emuiUserMonitoring)(
|
|
|
4
4
|
const isHeadScript = (scriptSrc) => HEAD_SCRIPTS.test(scriptSrc);
|
|
5
5
|
const addScriptToDOM = ({ name, hostUrl, documentEle, manifestPath }, fileName, index) => {
|
|
6
6
|
if (!hostUrl || !manifestPath)
|
|
7
|
-
throw new Error(
|
|
7
|
+
throw new Error(
|
|
8
|
+
"Unable to add scripts to DOM. hostUrl and manifestPath are required."
|
|
9
|
+
);
|
|
8
10
|
return new Promise((resolve, reject) => {
|
|
9
11
|
const ele = documentEle.createElement("script");
|
|
10
12
|
if (!ele)
|
|
11
13
|
reject(new Error("Unable to insert Application scripts."));
|
|
12
14
|
ele.id = `${APP_SCRIPT_ID_PREFIX}${name}-${index}`;
|
|
13
|
-
const url = new URL(
|
|
15
|
+
const url = new URL(
|
|
16
|
+
`${manifestPath.replace(/\/?$/, "/")}${fileName}`,
|
|
17
|
+
hostUrl
|
|
18
|
+
);
|
|
14
19
|
ele.src = removeDoubleSlash(url.href);
|
|
15
20
|
ele.onload = resolve.bind(null, ele.id);
|
|
16
21
|
ele.onerror = reject.bind(null, ele.id);
|
|
@@ -2,14 +2,19 @@ import { removeDoubleSlash } from "../../../utils/url.js";
|
|
|
2
2
|
const APP_STYLE_ID_PREFIX = "emui-style-";
|
|
3
3
|
const addStylesToDOM = ({ name, hostUrl, documentEle, manifestPath }, fileName, index) => {
|
|
4
4
|
if (!hostUrl || !manifestPath)
|
|
5
|
-
throw new Error(
|
|
5
|
+
throw new Error(
|
|
6
|
+
"Unable to add styles to DOM. hostUrl and manifestPath are required."
|
|
7
|
+
);
|
|
6
8
|
return new Promise((resolve, reject) => {
|
|
7
9
|
const ele = documentEle.createElement("link");
|
|
8
10
|
if (!ele)
|
|
9
11
|
reject(new Error("Unable to insert Application styles."));
|
|
10
12
|
ele.id = `${APP_STYLE_ID_PREFIX}${name}-${index}`;
|
|
11
13
|
ele.rel = "stylesheet";
|
|
12
|
-
const url = new URL(
|
|
14
|
+
const url = new URL(
|
|
15
|
+
`${manifestPath.replace(/\/?$/, "/")}${fileName}`,
|
|
16
|
+
hostUrl
|
|
17
|
+
);
|
|
13
18
|
ele.href = removeDoubleSlash(url.href);
|
|
14
19
|
ele.onload = resolve.bind(null, ele.id);
|
|
15
20
|
documentEle.head.appendChild(ele);
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
1
|
import { useRef, useLayoutEffect, useCallback } from "react";
|
|
21
2
|
import { merge } from "lodash";
|
|
22
3
|
import { useDispatch } from "react-redux";
|
|
@@ -42,33 +23,43 @@ const useAppWillRender = ({
|
|
|
42
23
|
}) => {
|
|
43
24
|
const dispatch = useDispatch ? useDispatch() : null;
|
|
44
25
|
const ref = useRef(Promise.resolve());
|
|
45
|
-
const getConfig = useCallback(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
26
|
+
const getConfig = useCallback(
|
|
27
|
+
() => getMicroFrontEndAppConfig({
|
|
28
|
+
id
|
|
29
|
+
}),
|
|
30
|
+
[id]
|
|
31
|
+
);
|
|
32
|
+
const unload = useCallback(
|
|
33
|
+
async (appConfig, loadFailed = false) => {
|
|
34
|
+
await unmountApp(appConfig);
|
|
35
|
+
unloadApp(appConfig);
|
|
36
|
+
if (!loadFailed && onUnloadComplete)
|
|
37
|
+
onUnloadComplete();
|
|
38
|
+
},
|
|
39
|
+
[]
|
|
40
|
+
);
|
|
41
|
+
const load = useCallback(
|
|
42
|
+
async (appConfig) => {
|
|
43
|
+
if (dispatch)
|
|
44
|
+
dispatch(waitMessage.open());
|
|
45
|
+
try {
|
|
46
|
+
if (ref.current)
|
|
47
|
+
await ref.current;
|
|
48
|
+
await loadApp(appConfig);
|
|
49
|
+
await mountApp(appConfig);
|
|
50
|
+
} catch (ex) {
|
|
51
|
+
getLogger().error({
|
|
52
|
+
...logRecords.APP_CONFIG_LOAD_FAILED,
|
|
53
|
+
exception: ex
|
|
54
|
+
});
|
|
55
|
+
await unload(appConfig, true);
|
|
56
|
+
throw ex;
|
|
57
|
+
}
|
|
58
|
+
if (dispatch)
|
|
59
|
+
dispatch(waitMessage.close());
|
|
60
|
+
},
|
|
61
|
+
[dispatch, unload]
|
|
62
|
+
);
|
|
72
63
|
useLayoutEffect(() => {
|
|
73
64
|
if (!documentEle)
|
|
74
65
|
return () => {
|