@elliemae/pui-app-sdk 2.12.3 → 2.13.2
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/appdynamics.js +36 -0
- package/dist/cjs/analytics/index.js +15 -13
- package/dist/cjs/analytics/page-view-event.js +16 -19
- package/dist/cjs/analytics/user-session-event.js +13 -14
- package/dist/cjs/analytics/user-wait-event.js +4 -4
- package/dist/cjs/analytics/{ba-event-parameters.js → web-analytics.js} +2 -2
- package/dist/cjs/api/auth/index.js +13 -20
- package/dist/cjs/api/helpers.js +4 -16
- package/dist/cjs/api/users/index.js +4 -5
- package/dist/cjs/communication/http-client/index.js +16 -21
- package/dist/cjs/communication/http-client/retry-axios.js +0 -2
- package/dist/cjs/communication/http-client/tests/index.test-disable.js +5 -6
- package/dist/cjs/data/auth/actions.js +22 -28
- package/dist/cjs/data/breakpoint/index.js +1 -3
- package/dist/cjs/data/live-message/index.js +8 -11
- package/dist/cjs/data/reducers.js +1 -2
- package/dist/cjs/data/store.js +4 -8
- package/dist/cjs/data/wait-message/actions.js +6 -9
- package/dist/cjs/data/wait-message/reducer.js +13 -17
- package/dist/cjs/index.js +21 -15
- package/dist/cjs/route/index.js +23 -12
- package/dist/cjs/route/{usePageView.js → page-view.js} +12 -22
- package/dist/cjs/route/private-route/index.js +9 -10
- package/dist/cjs/sideeffect/auth/index.js +6 -10
- package/dist/cjs/utils/app-config/config.js +3 -14
- package/dist/cjs/utils/app-config/index.js +11 -15
- package/dist/cjs/utils/app-host-integration/react.js +7 -10
- package/dist/cjs/utils/auth/index.js +40 -44
- package/dist/cjs/utils/font-size.js +1 -1
- package/dist/cjs/utils/helpers.js +0 -6
- package/dist/cjs/utils/log-records.js +7 -7
- package/dist/cjs/utils/micro-frontend/guest.js +31 -8
- package/dist/cjs/utils/micro-frontend/host.js +14 -7
- package/dist/cjs/utils/micro-frontend/index.js +2 -4
- package/dist/cjs/utils/redact-pii.js +39 -0
- package/dist/cjs/utils/service-worker.js +2 -5
- package/dist/cjs/utils/session.js +2 -8
- package/dist/cjs/utils/storybook/theme.js +9 -12
- package/dist/cjs/utils/testing/index.js +9 -18
- package/dist/cjs/utils/testing/render-with-redux.js +11 -14
- package/dist/cjs/utils/testing/render-with-router-redux.js +17 -20
- package/dist/cjs/utils/testing/render-with-router.js +13 -16
- package/dist/cjs/utils/testing/render-with-state-addons.js +7 -16
- package/dist/cjs/utils/url.js +0 -8
- package/dist/cjs/utils/web-storage.js +1 -7
- package/dist/cjs/utils/window.js +0 -2
- package/dist/cjs/view/app-root/hosted-app.js +5 -8
- package/dist/cjs/view/app-root/index.js +20 -23
- package/dist/cjs/view/app-root/stand-alone-app.js +5 -8
- package/dist/cjs/view/app-root/style.js +5 -12
- package/dist/cjs/view/error-toast/index.stories.js +22 -31
- package/dist/cjs/view/fetch-host-app-data/store.js +1 -5
- package/dist/cjs/view/fields/check-box/index.js +20 -32
- package/dist/cjs/view/fields/check-box/index.stories.js +20 -24
- package/dist/cjs/view/fields/check-box/set-value.stories.js +17 -21
- package/dist/cjs/view/fields/combo-box/index.js +22 -28
- package/dist/cjs/view/fields/connect-form.js +3 -4
- package/dist/cjs/view/fields/date-input/index.js +15 -21
- package/dist/cjs/view/fields/date-picker/index.js +15 -21
- package/dist/cjs/view/fields/form-item-layout/index.js +16 -20
- package/dist/cjs/view/fields/input-mask/index.js +16 -28
- package/dist/cjs/view/fields/large-text-box/index.js +15 -21
- package/dist/cjs/view/fields/radio/index.js +20 -26
- package/dist/cjs/view/fields/radio/index.stories.js +17 -21
- package/dist/cjs/view/fields/radio/set-value.stories.js +15 -19
- package/dist/cjs/view/fields/radio-group/index.js +16 -22
- package/dist/cjs/view/fields/radio-group/index.stories.js +37 -44
- package/dist/cjs/view/fields/text-box/index.js +15 -21
- package/dist/cjs/view/fields/watch-value.js +4 -5
- package/dist/cjs/view/form/index.js +9 -10
- package/dist/cjs/view/form/index.stories.js +3 -6
- package/dist/cjs/view/form/submit-button/index.js +2 -3
- package/dist/cjs/view/form/usecases.stories.js +3 -6
- package/dist/cjs/view/guest-unload-handlers/index.js +1 -2
- package/dist/cjs/view/header/center-region/index.js +8 -20
- package/dist/cjs/view/header/index.js +8 -11
- package/dist/cjs/view/host-binding-events/index.js +2 -2
- package/dist/cjs/view/live-message/index.stories.js +0 -6
- package/dist/cjs/view/loadable/index.js +1 -2
- package/dist/cjs/view/login/index.js +5 -6
- package/dist/cjs/view/media-breakpoint/index.js +1 -1
- package/dist/cjs/view/message-to-host-app/index.js +1 -2
- package/dist/cjs/view/micro-app/app-factory/index.js +30 -48
- package/dist/cjs/view/micro-app/index.js +1 -1
- package/dist/cjs/view/micro-app/resources/manifest.js +27 -39
- package/dist/cjs/view/micro-app/resources/script.js +22 -35
- package/dist/cjs/view/micro-app/resources/style.js +20 -33
- package/dist/cjs/view/micro-app/use-app-will-render.js +12 -12
- package/dist/cjs/view/micro-app/utils.js +0 -6
- package/dist/cjs/view/micro-iframe-app/app.js +6 -9
- package/dist/cjs/view/micro-iframe-app/iframe/index.js +8 -9
- package/dist/cjs/view/micro-iframe-app/index.js +4 -7
- package/dist/cjs/view/micro-iframe-app/use-frame-loaded.js +5 -12
- package/dist/cjs/view/modals/error/index.js +6 -13
- package/dist/cjs/view/modals/navigation-prompt/index.js +4 -11
- package/dist/cjs/view/modals/session-expiry/customHooks.js +3 -5
- package/dist/cjs/view/modals/session-expiry/index.js +6 -13
- package/dist/cjs/view/modals/wait-message/html-wait-message.js +3 -4
- package/dist/cjs/view/modals/wait-message/index.js +8 -9
- package/dist/cjs/view/modals/wait-message/index.stories.js +4 -5
- package/dist/cjs/view/render-with-delay/index.js +3 -6
- package/dist/cjs/view/render-with-host-data/index.js +0 -2
- package/dist/cjs/view/session-timeout/index.js +0 -2
- package/dist/cjs/view/useMediaBreakpoints/index.js +0 -12
- package/dist/es/analytics/appdynamics.js +18 -0
- package/dist/es/analytics/index.js +14 -13
- package/dist/es/analytics/page-view-event.js +16 -19
- package/dist/es/analytics/user-session-event.js +12 -13
- package/dist/es/analytics/user-wait-event.js +4 -4
- package/dist/es/analytics/{ba-event-parameters.js → web-analytics.js} +2 -2
- package/dist/es/api/auth/index.js +13 -18
- package/dist/es/api/helpers.js +4 -14
- package/dist/es/api/users/index.js +4 -5
- package/dist/es/communication/http-client/index.js +16 -20
- package/dist/es/communication/http-client/retry-axios.js +0 -2
- package/dist/es/communication/http-client/tests/index.test-disable.js +5 -6
- package/dist/es/data/auth/actions.js +22 -28
- package/dist/es/data/breakpoint/index.js +1 -3
- package/dist/es/data/live-message/index.js +8 -11
- package/dist/es/data/reducers.js +1 -2
- package/dist/es/data/store.js +4 -8
- package/dist/es/data/wait-message/actions.js +6 -9
- package/dist/es/data/wait-message/reducer.js +12 -16
- package/dist/es/index.js +4 -1
- package/dist/es/route/index.js +23 -13
- package/dist/es/route/page-view.js +15 -0
- package/dist/es/route/private-route/index.js +9 -10
- package/dist/es/sideeffect/auth/index.js +6 -10
- package/dist/es/utils/app-config/config.js +3 -14
- package/dist/es/utils/app-config/index.js +11 -15
- package/dist/es/utils/app-host-integration/react.js +7 -10
- package/dist/es/utils/auth/index.js +39 -41
- package/dist/es/utils/font-size.js +1 -1
- package/dist/es/utils/helpers.js +0 -3
- package/dist/es/utils/log-records.js +7 -7
- package/dist/es/utils/micro-frontend/guest.js +29 -6
- package/dist/es/utils/micro-frontend/host.js +13 -7
- package/dist/es/utils/micro-frontend/index.js +2 -3
- package/dist/es/utils/redact-pii.js +31 -0
- package/dist/es/utils/service-worker.js +2 -4
- package/dist/es/utils/session.js +2 -8
- package/dist/es/utils/storybook/theme.js +9 -12
- package/dist/es/utils/testing/index.js +9 -12
- package/dist/es/utils/testing/render-with-redux.js +11 -14
- package/dist/es/utils/testing/render-with-router-redux.js +17 -20
- package/dist/es/utils/testing/render-with-router.js +13 -16
- package/dist/es/utils/testing/render-with-state-addons.js +7 -12
- package/dist/es/utils/url.js +0 -4
- package/dist/es/utils/web-storage.js +1 -4
- package/dist/es/utils/window.js +0 -1
- package/dist/es/view/app-root/hosted-app.js +5 -8
- package/dist/es/view/app-root/index.js +20 -23
- package/dist/es/view/app-root/stand-alone-app.js +5 -8
- package/dist/es/view/app-root/style.js +5 -10
- package/dist/es/view/error-toast/index.stories.js +22 -30
- package/dist/es/view/fetch-host-app-data/store.js +1 -5
- package/dist/es/view/fields/check-box/index.js +20 -26
- package/dist/es/view/fields/check-box/index.stories.js +20 -24
- package/dist/es/view/fields/check-box/set-value.stories.js +17 -21
- package/dist/es/view/fields/combo-box/index.js +22 -28
- package/dist/es/view/fields/connect-form.js +3 -4
- package/dist/es/view/fields/date-input/index.js +15 -21
- package/dist/es/view/fields/date-picker/index.js +15 -21
- package/dist/es/view/fields/form-item-layout/index.js +16 -20
- package/dist/es/view/fields/input-mask/index.js +16 -22
- package/dist/es/view/fields/large-text-box/index.js +15 -21
- package/dist/es/view/fields/radio/index.js +20 -26
- package/dist/es/view/fields/radio/index.stories.js +17 -21
- package/dist/es/view/fields/radio/set-value.stories.js +15 -19
- package/dist/es/view/fields/radio-group/index.js +16 -22
- package/dist/es/view/fields/radio-group/index.stories.js +37 -44
- package/dist/es/view/fields/text-box/index.js +15 -21
- package/dist/es/view/fields/watch-value.js +4 -5
- package/dist/es/view/form/index.js +9 -10
- package/dist/es/view/form/index.stories.js +3 -6
- package/dist/es/view/form/submit-button/index.js +2 -3
- package/dist/es/view/form/usecases.stories.js +3 -6
- package/dist/es/view/guest-unload-handlers/index.js +1 -2
- package/dist/es/view/header/center-region/index.js +8 -17
- package/dist/es/view/header/index.js +8 -11
- package/dist/es/view/host-binding-events/index.js +2 -2
- package/dist/es/view/live-message/index.stories.js +0 -1
- package/dist/es/view/loadable/index.js +1 -2
- package/dist/es/view/login/index.js +5 -6
- package/dist/es/view/media-breakpoint/index.js +1 -1
- package/dist/es/view/message-to-host-app/index.js +1 -2
- package/dist/es/view/micro-app/app-factory/index.js +30 -42
- package/dist/es/view/micro-app/index.js +1 -1
- package/dist/es/view/micro-app/resources/manifest.js +26 -31
- package/dist/es/view/micro-app/resources/script.js +21 -31
- package/dist/es/view/micro-app/resources/style.js +20 -30
- package/dist/es/view/micro-app/use-app-will-render.js +12 -12
- package/dist/es/view/micro-app/utils.js +0 -3
- package/dist/es/view/micro-iframe-app/app.js +6 -8
- package/dist/es/view/micro-iframe-app/iframe/index.js +8 -9
- package/dist/es/view/micro-iframe-app/index.js +4 -6
- package/dist/es/view/micro-iframe-app/use-frame-loaded.js +5 -9
- package/dist/es/view/modals/error/index.js +6 -8
- package/dist/es/view/modals/navigation-prompt/index.js +4 -5
- package/dist/es/view/modals/session-expiry/customHooks.js +3 -4
- package/dist/es/view/modals/session-expiry/index.js +6 -8
- package/dist/es/view/modals/wait-message/html-wait-message.js +3 -4
- package/dist/es/view/modals/wait-message/index.js +8 -9
- package/dist/es/view/modals/wait-message/index.stories.js +4 -5
- package/dist/es/view/render-with-delay/index.js +3 -5
- package/dist/es/view/render-with-host-data/index.js +0 -1
- package/dist/es/view/session-timeout/index.js +0 -1
- package/dist/es/view/useMediaBreakpoints/index.js +0 -6
- package/dist/types/analytics/appdynamics.d.ts +9 -0
- package/dist/types/analytics/index.d.ts +2 -2
- package/dist/types/analytics/web-analytics.d.ts +8 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/route/page-view.d.ts +1 -0
- package/dist/types/utils/micro-frontend/guest.d.ts +1 -0
- package/dist/types/utils/micro-frontend/host.d.ts +1 -1
- package/dist/types/utils/redact-pii.d.ts +1 -0
- package/dist/types/view/visually-hidden/index.d.ts +1 -1
- package/package.json +7 -3
- package/dist/es/route/usePageView.js +0 -18
- package/dist/public/app.config.json +0 -129
- package/dist/public/assets/index.ad459dcebaa616bff55e77d860405729.svg +0 -1
- package/dist/public/assets/index.dae17c8817fd9c5ab29e7c3a8925a1f4.svg +0 -1
- package/dist/public/assets/logo.0cbd33c5006f8ea6d106f8ab13f6e6dc.svg +0 -1
- package/dist/public/iframe.b3911eaf1a99a53ef7b10a1e1f0bdfc4.html +0 -8
- package/dist/public/index.html +0 -5
- package/dist/public/js/emuiAppSdk.e28a62497e211b4c6132.js +0 -3
- package/dist/public/js/emuiAppSdk.e28a62497e211b4c6132.js.LICENSE.txt +0 -95
- package/dist/public/js/emuiAppSdk.e28a62497e211b4c6132.js.gz +0 -0
- package/dist/public/js/emuiAppSdk.e28a62497e211b4c6132.js.map +0 -1
- package/dist/types/analytics/ba-event-parameters.d.ts +0 -8
- package/dist/types/route/usePageView.d.ts +0 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.redactPii = void 0;
|
|
7
|
+
const aptRegex = /(apt|bldg|dept|fl|hngr|lot|pier|rm|ste|slip|trlr|unit|#)\.? *[a-z0-9-]+\b/gi;
|
|
8
|
+
const poBoxRegex = /P\.? ?O\.? *Box +\d+/gi;
|
|
9
|
+
const roadRegex = /(street|st|road|rd|avenue|ave|drive|dr|loop|court|ct|circle|cir|lane|ln|boulevard|blvd|way)\.?\b/gi;
|
|
10
|
+
const piiPatterns = {
|
|
11
|
+
creditCardNumber: /\d{4}[ -]?\d{4}[ -]?\d{4}[ -]?\d{4}|\d{4}[ -]?\d{6}[ -]?\d{4}\d?/g,
|
|
12
|
+
streetAddress: new RegExp(`(\\d+\\s*(\\w+ ){1,2}${roadRegex.source}(\\s+${aptRegex.source})?)|(${poBoxRegex.source})`, 'gi'),
|
|
13
|
+
zipcode: /\b\d{5}\b(-\d{4})?\b/g,
|
|
14
|
+
phoneNumber: /(\(?\+?[0-9]{1,2}\)?[-. ]?)?(\(?[0-9]{3}\)?|[0-9]{3})[-. ]?([0-9]{3}[-. ]?[0-9]{4}|\b[A-Z0-9]{7}\b)/g,
|
|
15
|
+
ipAddress: /(\d{1,3}(\.\d{1,3}){3}|[0-9A-F]{4}(:[0-9A-F]{4}){5}(::|(:0000)+))/gi,
|
|
16
|
+
usSocialSecurityNumber: /\b\d{3}[ -.]\d{2}[ -.]\d{4}\b/g,
|
|
17
|
+
emailAddress: /([a-z0-9_\-.+]+)@\w+(\.\w+)*/gi,
|
|
18
|
+
// username: /(user( ?name)?|login): \S+/gi,
|
|
19
|
+
password: /(pass(word|phrase)?|secret): \S+/gi,
|
|
20
|
+
credentials: /(login( cred(ential)?s| info(rmation)?)?|cred(ential)?s) ?:\s*\S+\s+\/?\s*\S+/gi // digits: /\b\d{4,}\b/g,
|
|
21
|
+
// url: /([^\s:/?#]+):\/\/([^/?#\s]*)([^?#\s]*)(\?([^#\s]*))?(#([^\s]*))?/g,
|
|
22
|
+
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const replacer = (key, value) => {
|
|
26
|
+
if (!key || typeof value !== 'string' || key === 'correlationId') return value;
|
|
27
|
+
return Object.values(piiPatterns).reduce((redactedString, piiPattern) => redactedString.replace(piiPattern, '****'), value);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const redactPii = data => {
|
|
31
|
+
try {
|
|
32
|
+
const redactedData = JSON.stringify(data, replacer);
|
|
33
|
+
return JSON.parse(redactedData);
|
|
34
|
+
} catch (err) {
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
exports.redactPii = redactPii;
|
|
@@ -5,19 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.initServiceWorker = void 0;
|
|
7
7
|
|
|
8
|
-
require("core-js/modules/es.string.replace.js");
|
|
9
|
-
|
|
10
8
|
var _logRecords = require("./log-records.js");
|
|
11
9
|
|
|
12
10
|
var _index = require("./micro-frontend/index.js");
|
|
13
11
|
|
|
14
|
-
const initServiceWorker =
|
|
15
|
-
let swDest = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
12
|
+
const initServiceWorker = (swDest = '') => {
|
|
16
13
|
const logger = (0, _index.getLogger)() || console;
|
|
17
14
|
|
|
18
15
|
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
|
19
16
|
window.addEventListener('load', () => {
|
|
20
|
-
navigator.serviceWorker.register(
|
|
17
|
+
navigator.serviceWorker.register(`${swDest.replace(/\/?$/, '/')}sw.js`).then(() => {
|
|
21
18
|
logger.debug('Service Worker registered');
|
|
22
19
|
}).catch(registrationError => {
|
|
23
20
|
logger.error({ ..._logRecords.logRecords.SERVICE_WORKER_FAILED,
|
|
@@ -37,15 +37,9 @@ const throttledResetUserIdleTime = (0, _throttle2.default)(resetUserIdleTime, TH
|
|
|
37
37
|
leading: true
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
const isPastWarningTime =
|
|
41
|
-
let warnInterval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _config.getAppConfigValue)('sessionTimeoutWarnInterval') || _constants.SESSION_TIMEOUT_INTERVAL.WARN;
|
|
42
|
-
return Date.now() - lastUserActivityTimeStamp > warnInterval;
|
|
43
|
-
};
|
|
40
|
+
const isPastWarningTime = (warnInterval = (0, _config.getAppConfigValue)('sessionTimeoutWarnInterval') || _constants.SESSION_TIMEOUT_INTERVAL.WARN) => Date.now() - lastUserActivityTimeStamp > warnInterval;
|
|
44
41
|
|
|
45
|
-
const isPastSessionTimeoutTime =
|
|
46
|
-
let sessionTimeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _config.getAppConfigValue)('sessionTimeoutInterval') || _constants.SESSION_TIMEOUT_INTERVAL.EXPIRY;
|
|
47
|
-
return Date.now() - lastUserActivityTimeStamp > sessionTimeout;
|
|
48
|
-
};
|
|
42
|
+
const isPastSessionTimeoutTime = (sessionTimeout = (0, _config.getAppConfigValue)('sessionTimeoutInterval') || _constants.SESSION_TIMEOUT_INTERVAL.EXPIRY) => Date.now() - lastUserActivityTimeStamp > sessionTimeout;
|
|
49
43
|
|
|
50
44
|
const notifySessionExpiryWarning = () => {
|
|
51
45
|
sessionExpiryWarningNotified = true;
|
|
@@ -7,17 +7,14 @@ exports.createTheme = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _create = require("@storybook/theming/create");
|
|
9
9
|
|
|
10
|
-
const createTheme =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
...rest
|
|
20
|
-
});
|
|
21
|
-
};
|
|
10
|
+
const createTheme = ({
|
|
11
|
+
base = 'light',
|
|
12
|
+
brandTitle = 'Platform UI Components',
|
|
13
|
+
...rest
|
|
14
|
+
}) => (0, _create.create)({
|
|
15
|
+
base,
|
|
16
|
+
brandTitle: `${brandTitle} ${process.env.STORYBOOK_VERSION || ''}`,
|
|
17
|
+
...rest
|
|
18
|
+
});
|
|
22
19
|
|
|
23
20
|
exports.createTheme = createTheme;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
8
|
-
|
|
9
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
10
4
|
|
|
11
5
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -43,18 +37,15 @@ var _history = require("../history.js");
|
|
|
43
37
|
const defaultStore = (0, _store.createAppStore)({}, _history.browserHistory);
|
|
44
38
|
const defaultTheme = (0, _puiTheme.getDefaultTheme)();
|
|
45
39
|
|
|
46
|
-
const AllTheProviders =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
theme: theme
|
|
56
|
-
}, void 0, children);
|
|
57
|
-
};
|
|
40
|
+
const AllTheProviders = ({
|
|
41
|
+
store = defaultStore,
|
|
42
|
+
theme = defaultTheme,
|
|
43
|
+
children
|
|
44
|
+
}) => /*#__PURE__*/(0, _jsx2.default)(_index.AppRoot, {
|
|
45
|
+
store: store,
|
|
46
|
+
history: _history.browserHistory,
|
|
47
|
+
theme: theme
|
|
48
|
+
}, void 0, children);
|
|
58
49
|
|
|
59
50
|
const customRender = (ui, options) => (0, _react.render)(ui, {
|
|
60
51
|
wrapper: AllTheProviders,
|
|
@@ -17,19 +17,16 @@ var _store = require("../../data/store.js");
|
|
|
17
17
|
|
|
18
18
|
var _history = require("../history.js");
|
|
19
19
|
|
|
20
|
-
const renderWithRedux =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
store
|
|
32
|
-
};
|
|
33
|
-
};
|
|
20
|
+
const renderWithRedux = (ui, {
|
|
21
|
+
initialState,
|
|
22
|
+
store = (0, _store.createAppStore)(initialState, _history.browserHistory)
|
|
23
|
+
} = {}) => ({ ...(0, _react.render)( /*#__PURE__*/(0, _jsx2.default)(_reactRedux.Provider, {
|
|
24
|
+
store: store
|
|
25
|
+
}, void 0, ui)),
|
|
26
|
+
// adding `store` to the returned utilities to allow us
|
|
27
|
+
// to reference it in our tests (just try to avoid using
|
|
28
|
+
// this to test implementation details).
|
|
29
|
+
store
|
|
30
|
+
});
|
|
34
31
|
|
|
35
32
|
exports.renderWithRedux = renderWithRedux;
|
|
@@ -21,25 +21,22 @@ var _store = require("../../data/store.js");
|
|
|
21
21
|
|
|
22
22
|
var _history2 = require("../history.js");
|
|
23
23
|
|
|
24
|
-
const renderWithRouterRedux =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
store
|
|
42
|
-
};
|
|
43
|
-
};
|
|
24
|
+
const renderWithRouterRedux = (ui, {
|
|
25
|
+
route = '/',
|
|
26
|
+
history = (0, _history.createMemoryHistory)({
|
|
27
|
+
initialEntries: [route]
|
|
28
|
+
}),
|
|
29
|
+
initialState,
|
|
30
|
+
store = (0, _store.createAppStore)(initialState, _history2.browserHistory)
|
|
31
|
+
} = {}) => ({ ...(0, _react.render)( /*#__PURE__*/(0, _jsx2.default)(_reactRedux.Provider, {
|
|
32
|
+
store: store
|
|
33
|
+
}, void 0, /*#__PURE__*/(0, _jsx2.default)(_reactRouterDom.Router, {
|
|
34
|
+
history: history
|
|
35
|
+
}, void 0, ui))),
|
|
36
|
+
// adding `store` to the returned utilities to allow us
|
|
37
|
+
// to reference it in our tests (just try to avoid using
|
|
38
|
+
// this to test implementation details).
|
|
39
|
+
store
|
|
40
|
+
});
|
|
44
41
|
|
|
45
42
|
exports.renderWithRouterRedux = renderWithRouterRedux;
|
|
@@ -15,21 +15,18 @@ var _reactRouterDom = require("react-router-dom");
|
|
|
15
15
|
|
|
16
16
|
var _history = require("history");
|
|
17
17
|
|
|
18
|
-
const renderWithRouter =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
history
|
|
32
|
-
};
|
|
33
|
-
};
|
|
18
|
+
const renderWithRouter = (ui, {
|
|
19
|
+
route = '/',
|
|
20
|
+
history = (0, _history.createMemoryHistory)({
|
|
21
|
+
initialEntries: [route]
|
|
22
|
+
})
|
|
23
|
+
} = {}) => ({ ...(0, _react.render)( /*#__PURE__*/(0, _jsx2.default)(_reactRouterDom.Router, {
|
|
24
|
+
history: history
|
|
25
|
+
}, void 0, ui)),
|
|
26
|
+
// adding `history` to the returned utilities to allow us
|
|
27
|
+
// to reference it in our tests (just try to avoid using
|
|
28
|
+
// this to test implementation details).
|
|
29
|
+
history
|
|
30
|
+
});
|
|
34
31
|
|
|
35
32
|
exports.renderWithRouter = renderWithRouter;
|
|
@@ -9,14 +9,6 @@ exports.RenderWithStateAddOns = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _jsx3 = _interopRequireDefault(require("@babel/runtime/helpers/jsx"));
|
|
11
11
|
|
|
12
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
13
|
-
|
|
14
|
-
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
15
|
-
|
|
16
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
17
|
-
|
|
18
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
19
|
-
|
|
20
12
|
var _react = require("react");
|
|
21
13
|
|
|
22
14
|
var _styledComponents = require("styled-components");
|
|
@@ -28,14 +20,13 @@ var _reduxInjectors = require("redux-injectors");
|
|
|
28
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
21
|
|
|
30
22
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
31
|
-
const RenderWithStateAddOns =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} = _ref;
|
|
23
|
+
const RenderWithStateAddOns = ({
|
|
24
|
+
Component,
|
|
25
|
+
reducer,
|
|
26
|
+
saga,
|
|
27
|
+
theme = (0, _puiTheme.getDefaultTheme)(),
|
|
28
|
+
...rest
|
|
29
|
+
}) => {
|
|
39
30
|
const [ready, setReady] = (0, _react.useState)(false);
|
|
40
31
|
|
|
41
32
|
if (Array.isArray(reducer)) {
|
package/dist/cjs/utils/url.js
CHANGED
|
@@ -5,14 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.removeDoubleSlash = exports.getRedirectUrl = void 0;
|
|
7
7
|
|
|
8
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/web.url.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/web.url-search-params.js");
|
|
13
|
-
|
|
14
|
-
require("core-js/modules/es.string.replace.js");
|
|
15
|
-
|
|
16
8
|
const getRedirectUrl = () => {
|
|
17
9
|
const url = new URL(window.location.href);
|
|
18
10
|
url.search = '';
|
|
@@ -7,12 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.removeStorageEvents = exports.persistentStorage = exports.listenStorageEvents = void 0;
|
|
9
9
|
|
|
10
|
-
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
13
|
-
|
|
14
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
15
|
-
|
|
16
10
|
var _localforage = _interopRequireDefault(require("localforage"));
|
|
17
11
|
|
|
18
12
|
const STORAGE = 'storage';
|
|
@@ -45,7 +39,7 @@ exports.persistentStorage = persistentStorage;
|
|
|
45
39
|
|
|
46
40
|
const listenStorageEvents = () => {
|
|
47
41
|
window.addEventListener(STORAGE, onStorageChange);
|
|
48
|
-
if (isSessionStorageEmpty()) localStorage.setItem(GET_SESSION_STORAGE,
|
|
42
|
+
if (isSessionStorageEmpty()) localStorage.setItem(GET_SESSION_STORAGE, `${Date.now()}`);
|
|
49
43
|
};
|
|
50
44
|
|
|
51
45
|
exports.listenStorageEvents = listenStorageEvents;
|
package/dist/cjs/utils/window.js
CHANGED
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getWindow = exports.getViewportSize = exports.getCurrentBreakpoint = void 0;
|
|
7
7
|
|
|
8
|
-
require("core-js/modules/es.string.replace.js");
|
|
9
|
-
|
|
10
8
|
var _puiTheme = require("@elliemae/pui-theme");
|
|
11
9
|
|
|
12
10
|
const getWindow = () => {
|
|
@@ -21,14 +21,11 @@ var _style = _interopRequireDefault(require("./style.js"));
|
|
|
21
21
|
|
|
22
22
|
var _GlobalStyle, _MediaBreakpoint, _WindowSize, _HTMLWaitMessage;
|
|
23
23
|
|
|
24
|
-
const HostedApp =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
close: true
|
|
30
|
-
})), children);
|
|
31
|
-
};
|
|
24
|
+
const HostedApp = ({
|
|
25
|
+
children
|
|
26
|
+
}) => /*#__PURE__*/(0, _jsx2.default)(_StyledDiv, {}, void 0, _GlobalStyle || (_GlobalStyle = /*#__PURE__*/(0, _jsx2.default)(_style.default, {})), _MediaBreakpoint || (_MediaBreakpoint = /*#__PURE__*/(0, _jsx2.default)(_index.MediaBreakpoint, {})), _WindowSize || (_WindowSize = /*#__PURE__*/(0, _jsx2.default)(_index2.WindowSize, {})), _HTMLWaitMessage || (_HTMLWaitMessage = /*#__PURE__*/(0, _jsx2.default)(_htmlWaitMessage.HTMLWaitMessage, {
|
|
27
|
+
close: true
|
|
28
|
+
})), children);
|
|
32
29
|
|
|
33
30
|
exports.HostedApp = HostedApp;
|
|
34
31
|
|
|
@@ -48,28 +48,25 @@ const AppToRender = props => {
|
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
const AppRoot =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
WaitMessage: WaitMessage
|
|
72
|
-
}, void 0, children)))));
|
|
73
|
-
};
|
|
51
|
+
const AppRoot = ({
|
|
52
|
+
store,
|
|
53
|
+
history,
|
|
54
|
+
theme = (0, _puiTheme.getDefaultTheme)(),
|
|
55
|
+
manageSession = false,
|
|
56
|
+
WaitMessage,
|
|
57
|
+
errorTemplate,
|
|
58
|
+
children
|
|
59
|
+
}) => /*#__PURE__*/(0, _jsx3.default)(_index4.ErrorBoundary, {
|
|
60
|
+
errorTemplate: errorTemplate
|
|
61
|
+
}, void 0, /*#__PURE__*/(0, _jsx3.default)(_reactRedux.Provider, {
|
|
62
|
+
store: store
|
|
63
|
+
}, void 0, /*#__PURE__*/(0, _jsx3.default)(_reactRouterDom.Router, {
|
|
64
|
+
history: history
|
|
65
|
+
}, void 0, /*#__PURE__*/(0, _jsx3.default)(_styledComponents.ThemeProvider, {
|
|
66
|
+
theme: theme
|
|
67
|
+
}, void 0, /*#__PURE__*/(0, _jsx3.default)(AppToRender, {
|
|
68
|
+
manageSession: manageSession,
|
|
69
|
+
WaitMessage: WaitMessage
|
|
70
|
+
}, void 0, children)))));
|
|
74
71
|
|
|
75
72
|
exports.AppRoot = AppRoot;
|
|
@@ -29,14 +29,11 @@ var _style = _interopRequireDefault(require("./style.js"));
|
|
|
29
29
|
|
|
30
30
|
var _GlobalStyle, _SessionTimeout, _MediaBreakpoint, _WindowSize, _LiveMessage, _DefaultWaitMessage, _ErrorToast;
|
|
31
31
|
|
|
32
|
-
const StandAloneApp =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = _ref;
|
|
38
|
-
return /*#__PURE__*/(0, _jsx2.default)(_reactAriaLive.LiveAnnouncer, {}, void 0, /*#__PURE__*/(0, _jsx2.default)(_StyledDiv, {}, void 0, _GlobalStyle || (_GlobalStyle = /*#__PURE__*/(0, _jsx2.default)(_style.default, {})), manageSession && (_SessionTimeout || (_SessionTimeout = /*#__PURE__*/(0, _jsx2.default)(_index3.SessionTimeout, {}))), _MediaBreakpoint || (_MediaBreakpoint = /*#__PURE__*/(0, _jsx2.default)(_index.MediaBreakpoint, {})), _WindowSize || (_WindowSize = /*#__PURE__*/(0, _jsx2.default)(_index2.WindowSize, {})), _LiveMessage || (_LiveMessage = /*#__PURE__*/(0, _jsx2.default)(_index4.LiveMessage, {})), WaitMessage || _DefaultWaitMessage || (_DefaultWaitMessage = /*#__PURE__*/(0, _jsx2.default)(_index6.WaitMessage, {})), _ErrorToast || (_ErrorToast = /*#__PURE__*/(0, _jsx2.default)(_index5.ErrorToast, {})), children));
|
|
39
|
-
};
|
|
32
|
+
const StandAloneApp = ({
|
|
33
|
+
manageSession,
|
|
34
|
+
WaitMessage,
|
|
35
|
+
children
|
|
36
|
+
}) => /*#__PURE__*/(0, _jsx2.default)(_reactAriaLive.LiveAnnouncer, {}, void 0, /*#__PURE__*/(0, _jsx2.default)(_StyledDiv, {}, void 0, _GlobalStyle || (_GlobalStyle = /*#__PURE__*/(0, _jsx2.default)(_style.default, {})), manageSession && (_SessionTimeout || (_SessionTimeout = /*#__PURE__*/(0, _jsx2.default)(_index3.SessionTimeout, {}))), _MediaBreakpoint || (_MediaBreakpoint = /*#__PURE__*/(0, _jsx2.default)(_index.MediaBreakpoint, {})), _WindowSize || (_WindowSize = /*#__PURE__*/(0, _jsx2.default)(_index2.WindowSize, {})), _LiveMessage || (_LiveMessage = /*#__PURE__*/(0, _jsx2.default)(_index4.LiveMessage, {})), WaitMessage || _DefaultWaitMessage || (_DefaultWaitMessage = /*#__PURE__*/(0, _jsx2.default)(_index6.WaitMessage, {})), _ErrorToast || (_ErrorToast = /*#__PURE__*/(0, _jsx2.default)(_index5.ErrorToast, {})), children));
|
|
40
37
|
|
|
41
38
|
exports.StandAloneApp = StandAloneApp;
|
|
42
39
|
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
7
|
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
8
|
var _styledComponents = require("styled-components");
|
|
13
9
|
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
theme
|
|
19
|
-
} = _ref;
|
|
20
|
-
return theme.media.small(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n font-size: 100%;\n "])));
|
|
21
|
-
}, props => props.theme.lineHeights.m, props => props.theme.fonts.default, props => props.theme.colors.neutral['000']);
|
|
10
|
+
var _default = (0, _styledComponents.createGlobalStyle)([":root{font-size:81.25%;", ";}html,body{height:100%;width:100%;line-height:", ";}body{font-family:", ";background-color:", ";}#app,#app-container,#root,main{height:100%;width:100%;min-height:100%;min-width:100%;}"], ({
|
|
11
|
+
theme
|
|
12
|
+
}) => theme.media.small`
|
|
13
|
+
font-size: 100%;
|
|
14
|
+
`, props => props.theme.lineHeights.m, props => props.theme.fonts.default, props => props.theme.colors.neutral['000']);
|
|
22
15
|
|
|
23
16
|
exports.default = _default;
|
|
@@ -9,8 +9,6 @@ exports.default = exports.ToastDifferentTypes = exports.BasicError = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _jsx3 = _interopRequireDefault(require("@babel/runtime/helpers/jsx"));
|
|
11
11
|
|
|
12
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
13
|
-
|
|
14
12
|
var _react = require("react");
|
|
15
13
|
|
|
16
14
|
var _Toast = require("@elliemae/ds-basic/Toast");
|
|
@@ -33,10 +31,9 @@ var _default = {
|
|
|
33
31
|
};
|
|
34
32
|
exports.default = _default;
|
|
35
33
|
|
|
36
|
-
const Renderer =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} = _ref;
|
|
34
|
+
const Renderer = ({
|
|
35
|
+
Comp
|
|
36
|
+
}) => {
|
|
40
37
|
const [show, setShow] = (0, _react.useState)(false);
|
|
41
38
|
(0, _react.useEffect)(() => {
|
|
42
39
|
setShow(true);
|
|
@@ -63,20 +60,17 @@ const BasicError = () => _Renderer || (_Renderer = /*#__PURE__*/(0, _jsx3.defaul
|
|
|
63
60
|
|
|
64
61
|
exports.BasicError = BasicError;
|
|
65
62
|
|
|
66
|
-
const showToast =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
...props
|
|
78
|
-
});
|
|
79
|
-
};
|
|
63
|
+
const showToast = ({
|
|
64
|
+
messageText = 'Toast Message',
|
|
65
|
+
type = _Toast.ToastType.DEFAULT,
|
|
66
|
+
...props
|
|
67
|
+
}) => _index.error.set({
|
|
68
|
+
type,
|
|
69
|
+
messageText,
|
|
70
|
+
messageTitle: type,
|
|
71
|
+
containerId: 'app-toast',
|
|
72
|
+
...props
|
|
73
|
+
});
|
|
80
74
|
|
|
81
75
|
const successToast = props => showToast({ ...props,
|
|
82
76
|
type: _Toast.ToastType.SUCCESS
|
|
@@ -94,17 +88,14 @@ const errorToast = props => showToast({ ...props,
|
|
|
94
88
|
type: _Toast.ToastType.ERROR
|
|
95
89
|
});
|
|
96
90
|
|
|
97
|
-
const ToastButton =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
onClick: onClick
|
|
106
|
-
});
|
|
107
|
-
};
|
|
91
|
+
const ToastButton = ({
|
|
92
|
+
labelText,
|
|
93
|
+
onClick
|
|
94
|
+
}) => /*#__PURE__*/(0, _jsx3.default)(_Button.default, {
|
|
95
|
+
buttonType: "text",
|
|
96
|
+
labelText: labelText,
|
|
97
|
+
onClick: onClick
|
|
98
|
+
});
|
|
108
99
|
|
|
109
100
|
const ToastMultipleTypes = () => {
|
|
110
101
|
const dispatch = (0, _reactRedux.useAppDispatch)();
|
|
@@ -19,11 +19,7 @@ const setHostAppData = appData => {
|
|
|
19
19
|
|
|
20
20
|
exports.setHostAppData = setHostAppData;
|
|
21
21
|
|
|
22
|
-
const getHostAppDataByKey =
|
|
23
|
-
let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
24
|
-
let defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
25
|
-
return (0, _get2.default)(hostAppData, key, defaultValue);
|
|
26
|
-
};
|
|
22
|
+
const getHostAppDataByKey = (key = '', defaultValue = null) => (0, _get2.default)(hostAppData, key, defaultValue);
|
|
27
23
|
|
|
28
24
|
exports.getHostAppDataByKey = getHostAppDataByKey;
|
|
29
25
|
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/esnext.weak-map.emplace.js");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
8
|
-
|
|
9
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
10
4
|
|
|
11
5
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -31,32 +25,26 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
31
25
|
|
|
32
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
27
|
|
|
34
|
-
const CheckBox =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
onChange,
|
|
48
|
-
value,
|
|
49
|
-
...restProps
|
|
50
|
-
}
|
|
51
|
-
} = _ref2;
|
|
52
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, { ...rest,
|
|
53
|
-
...restProps,
|
|
54
|
-
defaultChecked: defaultChecked,
|
|
55
|
-
checked: value,
|
|
56
|
-
onChange: e => onChange(((e || {}).target || {}).checked)
|
|
57
|
-
});
|
|
28
|
+
const CheckBox = ({
|
|
29
|
+
name,
|
|
30
|
+
defaultChecked = false,
|
|
31
|
+
rules = {},
|
|
32
|
+
...rest
|
|
33
|
+
}) => /*#__PURE__*/(0, _jsx3.default)(_reactHookForm.Controller, {
|
|
34
|
+
name: name,
|
|
35
|
+
rules: rules,
|
|
36
|
+
render: ({
|
|
37
|
+
field: {
|
|
38
|
+
onChange,
|
|
39
|
+
value,
|
|
40
|
+
...restProps
|
|
58
41
|
}
|
|
59
|
-
})
|
|
60
|
-
|
|
42
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Checkbox.default, { ...rest,
|
|
43
|
+
...restProps,
|
|
44
|
+
defaultChecked: defaultChecked,
|
|
45
|
+
checked: value,
|
|
46
|
+
onChange: e => onChange(((e || {}).target || {}).checked)
|
|
47
|
+
})
|
|
48
|
+
});
|
|
61
49
|
|
|
62
50
|
exports.CheckBox = CheckBox;
|