@elliemae/pui-app-sdk 4.0.0-beta.3 → 4.0.0-beta.6
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 +1 -1
- package/dist/cjs/utils/micro-frontend/guest.js +8 -16
- package/dist/cjs/utils/micro-frontend/host.js +5 -0
- package/dist/cjs/utils/micro-frontend/ssfguest-adapter.js +47 -0
- package/dist/cjs/view/app-root/index.js +3 -2
- package/dist/cjs/view/error-boundary/default-error-template.js +1 -1
- package/dist/cjs/view/fields/date-range-picker/index.js +95 -0
- package/dist/cjs/view/fields/date-time-picker/index.js +80 -0
- package/dist/cjs/view/fields/input-text/index.js +71 -0
- package/dist/cjs/view/fields/toggle/index.js +81 -0
- package/dist/cjs/view/micro-app/resources/script.js +19 -15
- package/dist/cjs/view/micro-app/resources/style.js +15 -11
- package/dist/esm/utils/micro-frontend/guest.js +8 -16
- package/dist/esm/utils/micro-frontend/host.js +5 -0
- package/dist/esm/utils/micro-frontend/ssfguest-adapter.js +25 -0
- package/dist/esm/view/app-root/index.js +3 -2
- package/dist/esm/view/error-boundary/default-error-template.js +1 -1
- package/dist/esm/view/fields/date-range-picker/index.js +77 -0
- package/dist/esm/view/fields/date-time-picker/index.js +62 -0
- package/dist/esm/view/fields/input-text/index.js +53 -0
- package/dist/esm/view/fields/toggle/index.js +63 -0
- package/dist/esm/view/micro-app/resources/script.js +19 -15
- package/dist/esm/view/micro-app/resources/style.js +15 -11
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/micro-frontend/guest.d.ts +1 -1
- package/dist/types/utils/micro-frontend/host.d.ts +3 -1
- package/dist/types/utils/micro-frontend/ssfguest-adapter.d.ts +7 -0
- package/dist/types/view/error-boundary/index.d.ts +2 -1
- package/dist/types/view/fields/date-range-picker/index.d.ts +9 -0
- package/dist/types/view/fields/date-range-picker/index.stories.d.ts +7 -0
- package/dist/types/view/fields/date-time-picker/index.d.ts +9 -0
- package/dist/types/view/fields/date-time-picker/index.stories.d.ts +7 -0
- package/dist/types/view/fields/form-item-layout/index.d.ts +1 -1
- package/dist/types/view/fields/input-text/index.d.ts +9 -0
- package/dist/types/view/fields/input-text/index.stories.d.ts +7 -0
- package/dist/types/view/fields/toggle/index.d.ts +9 -0
- package/dist/types/view/fields/toggle/index.stories.d.ts +7 -0
- package/dist/types/view/micro-app/resources/script.d.ts +1 -1
- package/dist/types/view/micro-app/resources/style.d.ts +2 -2
- package/dist/types/view/modals/error/index.d.ts +2 -0
- package/package.json +39 -39
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import ssfGuest from "@elliemae/em-ssf-guest";
|
|
2
|
+
class SSFGuestAdapter {
|
|
3
|
+
async init() {
|
|
4
|
+
if (!ssfGuest)
|
|
5
|
+
return false;
|
|
6
|
+
await ssfGuest.connect();
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
async getObject(name) {
|
|
10
|
+
return ssfGuest.getObject(name);
|
|
11
|
+
}
|
|
12
|
+
subscribe(message, func) {
|
|
13
|
+
const callback = (domainObject, eventData) => {
|
|
14
|
+
func(message, eventData);
|
|
15
|
+
};
|
|
16
|
+
const [objectId, eventName] = message.split(".");
|
|
17
|
+
return ssfGuest.subscribe(objectId, eventName || "", callback);
|
|
18
|
+
}
|
|
19
|
+
unsubscribe(token, objectId, eventName) {
|
|
20
|
+
return ssfGuest.unsubscribe(objectId, eventName, token);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
SSFGuestAdapter
|
|
25
|
+
};
|
|
@@ -15,6 +15,7 @@ var __spreadValues = (a, b) => {
|
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
17
|
import * as React from "react";
|
|
18
|
+
import { StrictMode } from "react";
|
|
18
19
|
import { Provider } from "react-redux";
|
|
19
20
|
import { ThemeProvider } from "styled-components";
|
|
20
21
|
import { getDefaultTheme } from "@elliemae/pui-theme";
|
|
@@ -35,7 +36,7 @@ const AppRoot = ({
|
|
|
35
36
|
WaitMessage,
|
|
36
37
|
errorTemplate,
|
|
37
38
|
children
|
|
38
|
-
}) => /* @__PURE__ */ React.createElement(ErrorBoundary, {
|
|
39
|
+
}) => /* @__PURE__ */ React.createElement(StrictMode, null, /* @__PURE__ */ React.createElement(ErrorBoundary, {
|
|
39
40
|
errorTemplate
|
|
40
41
|
}, /* @__PURE__ */ React.createElement(Provider, {
|
|
41
42
|
store
|
|
@@ -46,7 +47,7 @@ const AppRoot = ({
|
|
|
46
47
|
}, /* @__PURE__ */ React.createElement(AppToRender, {
|
|
47
48
|
manageSession,
|
|
48
49
|
WaitMessage
|
|
49
|
-
}, children)))));
|
|
50
|
+
}, children))))));
|
|
50
51
|
export {
|
|
51
52
|
AppRoot
|
|
52
53
|
};
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
const DefaultErrorTemplate = ({
|
|
3
3
|
error = new Error("We are unable to process your request"),
|
|
4
4
|
errorInfo = { componentStack: "Please close your browser and login again" }
|
|
5
|
-
}) => /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h2", null, error?.message), /* @__PURE__ */ React.createElement("section", null, errorInfo));
|
|
5
|
+
}) => /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h2", null, error?.message), /* @__PURE__ */ React.createElement("section", null, errorInfo?.componentStack));
|
|
6
6
|
export {
|
|
7
7
|
DefaultErrorTemplate
|
|
8
8
|
};
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
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";
|
|
33
|
+
import { useState, useEffect } from "react";
|
|
34
|
+
import { DSControlledDateRangePicker } from "@elliemae/ds-controlled-form";
|
|
35
|
+
import {
|
|
36
|
+
Controller
|
|
37
|
+
} from "react-hook-form";
|
|
38
|
+
const WrappedDateRangePicker = (_a) => {
|
|
39
|
+
var _b = _a, {
|
|
40
|
+
field: _c
|
|
41
|
+
} = _b, _d = _c, { value, onChange } = _d, restProps = __objRest(_d, ["value", "onChange"]), rest = __objRest(_b, [
|
|
42
|
+
"field"
|
|
43
|
+
]);
|
|
44
|
+
const [fromDateString, setFromDateString] = useState(value[0]);
|
|
45
|
+
const [toDateString, setToDateString] = useState(value[1]);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
onChange([fromDateString, toDateString]);
|
|
48
|
+
}, [fromDateString, toDateString]);
|
|
49
|
+
return /* @__PURE__ */ React.createElement(DSControlledDateRangePicker, __spreadProps(__spreadValues(__spreadValues({}, rest), restProps), {
|
|
50
|
+
fromDate: fromDateString,
|
|
51
|
+
onFromDateChange: setFromDateString,
|
|
52
|
+
toDate: toDateString,
|
|
53
|
+
onToDateChange: setToDateString
|
|
54
|
+
}));
|
|
55
|
+
};
|
|
56
|
+
const DateRangePicker = (_e) => {
|
|
57
|
+
var _f = _e, {
|
|
58
|
+
name,
|
|
59
|
+
defaultValue = ["", ""],
|
|
60
|
+
rules = {}
|
|
61
|
+
} = _f, rest = __objRest(_f, [
|
|
62
|
+
"name",
|
|
63
|
+
"defaultValue",
|
|
64
|
+
"rules"
|
|
65
|
+
]);
|
|
66
|
+
return /* @__PURE__ */ React.createElement(Controller, {
|
|
67
|
+
name,
|
|
68
|
+
defaultValue,
|
|
69
|
+
rules,
|
|
70
|
+
render: ({ field }) => /* @__PURE__ */ React.createElement(WrappedDateRangePicker, __spreadValues({
|
|
71
|
+
field
|
|
72
|
+
}, rest))
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
DateRangePicker
|
|
77
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
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";
|
|
33
|
+
import { DSControlledDateTimePicker } from "@elliemae/ds-controlled-form";
|
|
34
|
+
import {
|
|
35
|
+
Controller
|
|
36
|
+
} from "react-hook-form";
|
|
37
|
+
const DateTimePicker = (_a) => {
|
|
38
|
+
var _b = _a, {
|
|
39
|
+
name,
|
|
40
|
+
defaultValue = "",
|
|
41
|
+
rules = {}
|
|
42
|
+
} = _b, rest = __objRest(_b, [
|
|
43
|
+
"name",
|
|
44
|
+
"defaultValue",
|
|
45
|
+
"rules"
|
|
46
|
+
]);
|
|
47
|
+
return /* @__PURE__ */ React.createElement(Controller, {
|
|
48
|
+
name,
|
|
49
|
+
defaultValue,
|
|
50
|
+
rules,
|
|
51
|
+
render: (_a2) => {
|
|
52
|
+
var { field: _b2 } = _a2, _c = _b2, { value, onChange } = _c, restProps = __objRest(_c, ["value", "onChange"]);
|
|
53
|
+
return /* @__PURE__ */ React.createElement(DSControlledDateTimePicker, __spreadProps(__spreadValues(__spreadValues({}, rest), restProps), {
|
|
54
|
+
dateTime: value,
|
|
55
|
+
onDateTimeChange: onChange
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
DateTimePicker
|
|
62
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
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
|
+
var __objRest = (source, exclude) => {
|
|
18
|
+
var target = {};
|
|
19
|
+
for (var prop in source)
|
|
20
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
21
|
+
target[prop] = source[prop];
|
|
22
|
+
if (source != null && __getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
24
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
29
|
+
import * as React from "react";
|
|
30
|
+
import { DSInputText } from "@elliemae/ds-controlled-form";
|
|
31
|
+
import {
|
|
32
|
+
Controller
|
|
33
|
+
} from "react-hook-form";
|
|
34
|
+
const InputText = (_a) => {
|
|
35
|
+
var _b = _a, {
|
|
36
|
+
name,
|
|
37
|
+
defaultValue = "",
|
|
38
|
+
rules = {}
|
|
39
|
+
} = _b, rest = __objRest(_b, [
|
|
40
|
+
"name",
|
|
41
|
+
"defaultValue",
|
|
42
|
+
"rules"
|
|
43
|
+
]);
|
|
44
|
+
return /* @__PURE__ */ React.createElement(Controller, {
|
|
45
|
+
name,
|
|
46
|
+
defaultValue,
|
|
47
|
+
rules,
|
|
48
|
+
render: ({ field }) => /* @__PURE__ */ React.createElement(DSInputText, __spreadValues(__spreadValues({}, rest), field))
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
InputText
|
|
53
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
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";
|
|
33
|
+
import { DSControlledToggle } from "@elliemae/ds-controlled-form";
|
|
34
|
+
import {
|
|
35
|
+
Controller
|
|
36
|
+
} from "react-hook-form";
|
|
37
|
+
const Toggle = (_a) => {
|
|
38
|
+
var _b = _a, {
|
|
39
|
+
name,
|
|
40
|
+
defaultValue = false,
|
|
41
|
+
rules = {}
|
|
42
|
+
} = _b, rest = __objRest(_b, [
|
|
43
|
+
"name",
|
|
44
|
+
"defaultValue",
|
|
45
|
+
"rules"
|
|
46
|
+
]);
|
|
47
|
+
return /* @__PURE__ */ React.createElement(Controller, {
|
|
48
|
+
name,
|
|
49
|
+
rules,
|
|
50
|
+
defaultValue,
|
|
51
|
+
render: (_a2) => {
|
|
52
|
+
var { field: _b2 } = _a2, _c = _b2, { value, onChange } = _c, restProps = __objRest(_c, ["value", "onChange"]);
|
|
53
|
+
return /* @__PURE__ */ React.createElement(DSControlledToggle, __spreadProps(__spreadValues(__spreadValues({}, rest), restProps), {
|
|
54
|
+
checked: value,
|
|
55
|
+
value: value.toString(),
|
|
56
|
+
onChange: () => onChange(!value)
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
Toggle
|
|
63
|
+
};
|
|
@@ -2,21 +2,25 @@ import { removeDoubleSlash } from "../../../utils/url.js";
|
|
|
2
2
|
const APP_SCRIPT_ID_PREFIX = "emui-script-";
|
|
3
3
|
const HEAD_SCRIPTS = /(?:emuiDiagnostics|global|global-prod|emuiUserMonitoring)(?:..*)?.js/;
|
|
4
4
|
const isHeadScript = (scriptSrc) => HEAD_SCRIPTS.test(scriptSrc);
|
|
5
|
-
const addScriptToDOM = ({ name, hostUrl, documentEle }, fileName, index) =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
const addScriptToDOM = ({ name, hostUrl, documentEle, manifestPath }, fileName, index) => {
|
|
6
|
+
if (!hostUrl || !manifestPath)
|
|
7
|
+
throw new Error("Unable to add scripts to DOM. hostUrl and manifestPath are required.");
|
|
8
|
+
return new Promise((resolve, reject) => {
|
|
9
|
+
const ele = documentEle.createElement("script");
|
|
10
|
+
if (!ele)
|
|
11
|
+
reject(new Error("Unable to insert Application scripts."));
|
|
12
|
+
ele.id = `${APP_SCRIPT_ID_PREFIX}${name}-${index}`;
|
|
13
|
+
const url = new URL(`${manifestPath.replace(/\/?$/, "/")}${fileName}`, hostUrl);
|
|
14
|
+
ele.src = removeDoubleSlash(url.href);
|
|
15
|
+
ele.onload = resolve.bind(null, ele.id);
|
|
16
|
+
ele.onerror = reject.bind(null, ele.id);
|
|
17
|
+
ele.async = false;
|
|
18
|
+
if (isHeadScript(ele.src))
|
|
19
|
+
documentEle.head.appendChild(ele);
|
|
20
|
+
else
|
|
21
|
+
documentEle.body.appendChild(ele);
|
|
22
|
+
});
|
|
23
|
+
};
|
|
20
24
|
const removeScriptFromDOM = (elementId = "", documentEle = document) => new Promise((resolve) => {
|
|
21
25
|
const ele = documentEle.getElementById(elementId);
|
|
22
26
|
if (!ele)
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { removeDoubleSlash } from "../../../utils/url.js";
|
|
2
2
|
const APP_STYLE_ID_PREFIX = "emui-style-";
|
|
3
|
-
const addStylesToDOM = ({ name, hostUrl, documentEle }, fileName, index) =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
const addStylesToDOM = ({ name, hostUrl, documentEle, manifestPath }, fileName, index) => {
|
|
4
|
+
if (!hostUrl || !manifestPath)
|
|
5
|
+
throw new Error("Unable to add styles to DOM. hostUrl and manifestPath are required.");
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
const ele = documentEle.createElement("link");
|
|
8
|
+
if (!ele)
|
|
9
|
+
reject(new Error("Unable to insert Application styles."));
|
|
10
|
+
ele.id = `${APP_STYLE_ID_PREFIX}${name}-${index}`;
|
|
11
|
+
ele.rel = "stylesheet";
|
|
12
|
+
const url = new URL(`${manifestPath.replace(/\/?$/, "/")}${fileName}`, hostUrl);
|
|
13
|
+
ele.href = removeDoubleSlash(url.href);
|
|
14
|
+
ele.onload = resolve.bind(null, ele.id);
|
|
15
|
+
documentEle.head.appendChild(ele);
|
|
16
|
+
});
|
|
17
|
+
};
|
|
14
18
|
const removeStyleFromDOM = (elementId = "", documentEle = document) => new Promise((resolve) => {
|
|
15
19
|
const ele = documentEle.getElementById(elementId);
|
|
16
20
|
if (!ele)
|
package/dist/types/index.d.ts
CHANGED
|
@@ -75,5 +75,5 @@ export type { EMUI } from './utils/window.js';
|
|
|
75
75
|
export type { Await } from './utils/await.js';
|
|
76
76
|
export type { RootState, AppStore } from './data/store.js';
|
|
77
77
|
export type { AppConfig } from './utils/app-config/config.js';
|
|
78
|
-
export type { OnInitCallback, OnMountCallback, } from './utils/micro-frontend/guest.js';
|
|
78
|
+
export type { OnInitCallback, OnMountCallback, OnUnMountCallback, } from './utils/micro-frontend/guest.js';
|
|
79
79
|
export type { OnInitCallback as OnHostInitCallback } from './utils/micro-frontend/host.js';
|
|
@@ -38,7 +38,7 @@ export declare class CMicroAppGuest implements IMicroAppGuest {
|
|
|
38
38
|
getLogger(): MicroFrontEndLogger;
|
|
39
39
|
getProps(): GuestProps;
|
|
40
40
|
private getSessionStorageItem;
|
|
41
|
-
private
|
|
41
|
+
private getSSFAdapter;
|
|
42
42
|
init(this: CMicroAppGuest, options: InitOptions): Promise<void>;
|
|
43
43
|
mount(this: CMicroAppGuest, options?: MountOptions): Promise<void>;
|
|
44
44
|
unmount(this: CMicroAppGuest, options: MountOptions): Promise<JSONValue>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IMicroAppHost, ResizeEventHandler, BreakpointChangeEventHandler, SubscriptionListener, BAEvent } from '@elliemae/pui-micro-frontend-base';
|
|
1
|
+
import { IMicroAppHost, ResizeEventHandler, BreakpointChangeEventHandler, SubscriptionListener, BAEvent, IDomainObject } from '@elliemae/pui-micro-frontend-base';
|
|
2
2
|
import { History, To } from 'history';
|
|
3
3
|
import { DefaultTheme } from 'styled-components';
|
|
4
4
|
import { MicroFrontEndLogger } from './console-logger.js';
|
|
@@ -21,6 +21,7 @@ export declare class CMicroAppHost implements IMicroAppHost {
|
|
|
21
21
|
activeGuests: Record<string, unknown>;
|
|
22
22
|
private readonly onInit?;
|
|
23
23
|
private readonly onRenewSessionTimer?;
|
|
24
|
+
domainObjects: Record<string, IDomainObject>;
|
|
24
25
|
private constructor();
|
|
25
26
|
static getInstance(params?: ConstructorParams): CMicroAppHost;
|
|
26
27
|
static isInitialized(): boolean;
|
|
@@ -50,5 +51,6 @@ export declare class CMicroAppHost implements IMicroAppHost {
|
|
|
50
51
|
onBreakpointChangeEvent(eventHandler: BreakpointChangeEventHandler): string;
|
|
51
52
|
setSystemVersion(version?: string): void;
|
|
52
53
|
sendBAEvent(this: void, data: BAEvent): void;
|
|
54
|
+
getObject<T extends IDomainObject>(name: string): T;
|
|
53
55
|
}
|
|
54
56
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SubscriptionListener, IDomainObject } from '@elliemae/pui-micro-frontend-base';
|
|
2
|
+
export declare class SSFGuestAdapter {
|
|
3
|
+
init(): Promise<boolean>;
|
|
4
|
+
getObject<T extends IDomainObject>(name: string): Promise<T>;
|
|
5
|
+
subscribe<T>(message: string, func: SubscriptionListener<T>): string | number;
|
|
6
|
+
unsubscribe(token: string, objectId: string, eventName: string): void;
|
|
7
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface ErrorBoundaryProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
3
4
|
errorTemplate?: React.ComponentType;
|
|
4
5
|
}
|
|
5
6
|
export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps> {
|
|
@@ -7,6 +8,6 @@ export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps> {
|
|
|
7
8
|
componentDidCatch(error: Error, errorInfo: {
|
|
8
9
|
componentStack: string;
|
|
9
10
|
}): void;
|
|
10
|
-
render(): React.
|
|
11
|
+
render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
|
11
12
|
}
|
|
12
13
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RegisterOptions, FieldValues, FieldPath } from 'react-hook-form';
|
|
3
|
+
export declare type DateRangePickerProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
|
|
4
|
+
name: string;
|
|
5
|
+
defaultValue?: [string, string];
|
|
6
|
+
rules?: Omit<RegisterOptions<TFieldValues, TName>, 'valueAsNumber' | 'valueAsDate' | 'setValueAs'>;
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
};
|
|
9
|
+
export declare const DateRangePicker: ({ name, defaultValue, rules, ...rest }: DateRangePickerProps) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Story, Meta } from '@storybook/react';
|
|
2
|
+
import { DateRangePickerProps } from './index.js';
|
|
3
|
+
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Basic: Story<DateRangePickerProps<import("react-hook-form").FieldValues, string> & {
|
|
6
|
+
labelText: string;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RegisterOptions, FieldValues, FieldPath } from 'react-hook-form';
|
|
3
|
+
export declare type DateTimePickerProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
|
|
4
|
+
name: string;
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
rules?: Omit<RegisterOptions<TFieldValues, TName>, 'valueAsNumber' | 'valueAsDate' | 'setValueAs'>;
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
};
|
|
9
|
+
export declare const DateTimePicker: ({ name, defaultValue, rules, ...rest }: DateTimePickerProps) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Story, Meta } from '@storybook/react';
|
|
2
|
+
import { DateTimePickerProps } from './index.js';
|
|
3
|
+
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Basic: Story<DateTimePickerProps<import("react-hook-form").FieldValues, string> & {
|
|
6
|
+
labelText: string;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RegisterOptions, FieldValues, FieldPath } from 'react-hook-form';
|
|
3
|
+
export declare type InputTextProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
|
|
4
|
+
name: string;
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
rules?: Omit<RegisterOptions<TFieldValues, TName>, 'valueAsNumber' | 'valueAsDate' | 'setValueAs'>;
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
};
|
|
9
|
+
export declare const InputText: ({ name, defaultValue, rules, ...rest }: InputTextProps) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Story, Meta } from '@storybook/react';
|
|
2
|
+
import { InputTextProps } from './index.js';
|
|
3
|
+
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Basic: Story<InputTextProps<import("react-hook-form").FieldValues, string> & {
|
|
6
|
+
labelText: string;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { RegisterOptions, FieldValues, FieldPath } from 'react-hook-form';
|
|
3
|
+
export declare type ToggleProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
|
|
4
|
+
name: string;
|
|
5
|
+
defaultValue?: boolean;
|
|
6
|
+
rules?: Omit<RegisterOptions<TFieldValues, TName>, 'valueAsNumber' | 'valueAsDate' | 'setValueAs'>;
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
};
|
|
9
|
+
export declare const Toggle: ({ name, defaultValue, rules, ...rest }: ToggleProps) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Story, Meta } from '@storybook/react';
|
|
2
|
+
import { ToggleProps } from './index.js';
|
|
3
|
+
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Basic: Story<ToggleProps<import("react-hook-form").FieldValues, string> & {
|
|
6
|
+
label: string;
|
|
7
|
+
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MicroAppConfig } from '../../../utils/micro-frontend/types.js';
|
|
2
2
|
export declare const APP_SCRIPT_ID_PREFIX = "emui-script-";
|
|
3
|
-
export declare const addScriptToDOM: ({ name, hostUrl, documentEle }: MicroAppConfig, fileName: string, index: number) => Promise<string>;
|
|
3
|
+
export declare const addScriptToDOM: ({ name, hostUrl, documentEle, manifestPath }: MicroAppConfig, fileName: string, index: number) => Promise<string>;
|
|
4
4
|
export declare const removeScriptFromDOM: (elementId?: string, documentEle?: Document) => Promise<void>;
|
|
5
5
|
export declare const removeDynamicImportedScripts: (hostUrl: string, documentEle: HTMLDocument) => void;
|
|
6
6
|
export declare const removePrefetchLinks: (hostUrl: string, documentEle: HTMLDocument) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MicroAppConfig } from '../../../utils/micro-frontend/types.js';
|
|
2
2
|
export declare const APP_STYLE_ID_PREFIX = "emui-style-";
|
|
3
|
-
export declare const addStylesToDOM: ({ name, hostUrl, documentEle }: MicroAppConfig, fileName: string, index: number) => Promise<string>;
|
|
3
|
+
export declare const addStylesToDOM: ({ name, hostUrl, documentEle, manifestPath }: MicroAppConfig, fileName: string, index: number) => Promise<string>;
|
|
4
4
|
export declare const removeStyleFromDOM: (elementId?: string, documentEle?: Document) => Promise<void>;
|
|
5
|
-
export declare const removeDynamicImportedStyles: (hostUrl: string, documentEle:
|
|
5
|
+
export declare const removeDynamicImportedStyles: (hostUrl: string, documentEle: Document) => void;
|