@elliemae/pui-app-sdk 3.0.0-beta.18 → 3.0.0-beta.21
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/index.js +2 -4
- package/dist/cjs/view/app-root/hosted-app.js +9 -6
- package/dist/cjs/view/app-root/stand-alone-app.js +7 -3
- package/dist/cjs/view/{media-breakpoint/index.js → breakpoint/use-breakpoint.js} +7 -8
- package/dist/cjs/view/{useMediaBreakpoints/index.js → breakpoint/use-media-query-list.js} +7 -7
- package/dist/cjs/view/fields/check-box/index.js +4 -12
- package/dist/cjs/view/fields/combo-box/index.js +2 -4
- package/dist/cjs/view/fields/form-layout-block-item/index.js +54 -0
- package/dist/cjs/view/fields/watch-value.js +4 -2
- package/dist/cjs/view/form/personal-info-section.js +29 -25
- package/dist/cjs/view/form/submit-button/index.js +1 -1
- package/dist/cjs/view/modals/error/index.js +17 -14
- package/dist/cjs/view/modals/navigation-prompt/index.js +23 -12
- package/dist/cjs/view/modals/session-expiry/index.js +17 -17
- package/dist/cjs/view/modals/wait-message/index.js +4 -5
- package/dist/cjs/view/modals/wait-message/{html-wait-message.js → use-html-wait-message.js} +6 -7
- package/dist/cjs/view/{window-size/index.js → use-window-size-change.js} +6 -7
- package/dist/es/index.js +2 -4
- package/dist/es/view/app-root/hosted-app.js +9 -6
- package/dist/es/view/app-root/stand-alone-app.js +7 -3
- package/dist/es/view/{media-breakpoint/index.js → breakpoint/use-breakpoint.js} +4 -5
- package/dist/es/view/{useMediaBreakpoints/index.js → breakpoint/use-media-query-list.js} +4 -4
- package/dist/es/view/fields/check-box/index.js +4 -12
- package/dist/es/view/fields/combo-box/index.js +2 -4
- package/dist/es/view/fields/form-layout-block-item/index.js +25 -0
- package/dist/es/view/fields/watch-value.js +4 -2
- package/dist/es/view/form/personal-info-section.js +29 -25
- package/dist/es/view/form/submit-button/index.js +2 -2
- package/dist/es/view/modals/error/index.js +24 -15
- package/dist/es/view/modals/navigation-prompt/index.js +30 -12
- package/dist/es/view/modals/session-expiry/index.js +25 -17
- package/dist/es/view/modals/wait-message/index.js +4 -5
- package/dist/es/view/modals/wait-message/{html-wait-message.js → use-html-wait-message.js} +4 -5
- package/dist/es/view/{window-size/index.js → use-window-size-change.js} +3 -4
- package/dist/types/index.d.ts +1 -2
- package/dist/types/view/{media-breakpoint → breakpoint}/index.stories.d.ts +0 -0
- package/dist/types/view/breakpoint/use-breakpoint.d.ts +1 -0
- package/dist/types/view/breakpoint/use-media-query-list.d.ts +1 -0
- package/dist/types/view/fields/check-box/index.d.ts +2 -4
- package/dist/types/view/fields/check-box/index.stories.d.ts +1 -3
- package/dist/types/view/fields/combo-box/index.d.ts +1 -2
- package/dist/types/view/fields/combo-box/index.stories.d.ts +2 -4
- package/dist/types/view/fields/date-picker/index.d.ts +1 -0
- package/dist/types/view/fields/date-picker/index.stories.d.ts +1 -3
- package/dist/types/view/fields/form-layout-block-item/index.d.ts +8 -0
- package/dist/types/view/fields/form-layout-block-item/index.stories.d.ts +5 -0
- package/dist/types/view/fields/input-mask/index.stories.d.ts +1 -3
- package/dist/types/view/fields/large-text-box/index.stories.d.ts +1 -3
- package/dist/types/view/fields/radio/index.d.ts +1 -1
- package/dist/types/view/fields/radio/index.stories.d.ts +1 -3
- package/dist/types/view/fields/watch-value.d.ts +2 -2
- package/dist/types/view/form/submit-button/index.d.ts +1 -0
- package/dist/types/view/modals/error/index.d.ts +3 -2
- package/dist/types/view/modals/navigation-prompt/index.d.ts +0 -1
- package/dist/types/view/modals/session-expiry/index.d.ts +0 -1
- package/dist/types/view/modals/wait-message/index.stories.d.ts +6 -2
- package/dist/types/view/modals/wait-message/use-html-wait-message.d.ts +1 -0
- package/dist/types/view/session-timeout/index.stories.d.ts +1 -4
- package/dist/types/view/use-window-size-change.d.ts +1 -0
- package/package.json +12 -4
- package/dist/types/view/media-breakpoint/index.d.ts +0 -1
- package/dist/types/view/modals/wait-message/html-wait-message.d.ts +0 -6
- package/dist/types/view/useMediaBreakpoints/index.d.ts +0 -1
- package/dist/types/view/window-size/index.d.ts +0 -1
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import styled from "styled-components";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { useBreakpoint } from "../breakpoint/use-breakpoint.js";
|
|
4
|
+
import { useWindowSizeChange } from "../use-window-size-change.js";
|
|
5
|
+
import { useHTMLWaitMessage } from "../modals/wait-message/use-html-wait-message.js";
|
|
6
6
|
import GlobalStyle from "./style.js";
|
|
7
7
|
const Div = styled.div`
|
|
8
8
|
height: 100%;
|
|
9
9
|
`;
|
|
10
|
-
const HostedApp = ({ children }) =>
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const HostedApp = ({ children }) => {
|
|
11
|
+
useBreakpoint();
|
|
12
|
+
useHTMLWaitMessage(true);
|
|
13
|
+
useWindowSizeChange();
|
|
14
|
+
return /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(GlobalStyle, null), children);
|
|
15
|
+
};
|
|
13
16
|
export {
|
|
14
17
|
HostedApp
|
|
15
18
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { LiveAnnouncer } from "react-aria-live";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useBreakpoint } from "../breakpoint/use-breakpoint.js";
|
|
5
|
+
import { useWindowSizeChange } from "../use-window-size-change.js";
|
|
6
6
|
import { SessionTimeout } from "../session-timeout/index.js";
|
|
7
7
|
import { LiveMessage } from "../live-message/index.js";
|
|
8
8
|
import { ErrorToast } from "../error-toast/index.js";
|
|
@@ -15,7 +15,11 @@ const StandAloneApp = ({
|
|
|
15
15
|
manageSession,
|
|
16
16
|
WaitMessage,
|
|
17
17
|
children
|
|
18
|
-
}) =>
|
|
18
|
+
}) => {
|
|
19
|
+
useBreakpoint();
|
|
20
|
+
useWindowSizeChange();
|
|
21
|
+
return /* @__PURE__ */ React.createElement(LiveAnnouncer, null, /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement(GlobalStyle, null), manageSession && /* @__PURE__ */ React.createElement(SessionTimeout, null), /* @__PURE__ */ React.createElement(LiveMessage, null), WaitMessage || /* @__PURE__ */ React.createElement(DefaultWaitMessage, null), /* @__PURE__ */ React.createElement(ErrorToast, null), children));
|
|
22
|
+
};
|
|
19
23
|
export {
|
|
20
24
|
StandAloneApp
|
|
21
25
|
};
|
|
@@ -3,11 +3,11 @@ import { ThemeContext } from "styled-components";
|
|
|
3
3
|
import { publish } from "pubsub-js";
|
|
4
4
|
import { useAppDispatch } from "../../data/react-redux.js";
|
|
5
5
|
import { breakpoint } from "../../data/breakpoint/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useMediaQueryList } from "./use-media-query-list.js";
|
|
7
7
|
import { HOST_WINDOW_BREAKPOINT_CHANGED } from "../../utils/constants.js";
|
|
8
|
-
const
|
|
8
|
+
const useBreakpoint = () => {
|
|
9
9
|
const theme = useContext(ThemeContext);
|
|
10
|
-
const currentBreakpoint =
|
|
10
|
+
const currentBreakpoint = useMediaQueryList([
|
|
11
11
|
`(max-width: ${theme.breakpoints.small})`,
|
|
12
12
|
`(max-width: ${theme.breakpoints.medium})`,
|
|
13
13
|
`(max-width: ${theme.breakpoints.large})`
|
|
@@ -17,8 +17,7 @@ const MediaBreakpoint = () => {
|
|
|
17
17
|
dispatch({ type: breakpoint.change, payload: currentBreakpoint });
|
|
18
18
|
publish(HOST_WINDOW_BREAKPOINT_CHANGED, currentBreakpoint);
|
|
19
19
|
}, [currentBreakpoint, dispatch]);
|
|
20
|
-
return null;
|
|
21
20
|
};
|
|
22
21
|
export {
|
|
23
|
-
|
|
22
|
+
useBreakpoint
|
|
24
23
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect, useCallback } from "react";
|
|
2
|
-
const
|
|
2
|
+
const useMediaQueryList = (queries, values, defaultValue) => {
|
|
3
3
|
const mediaQueryLists = queries.map((q) => window.matchMedia(q));
|
|
4
4
|
const getValue = useCallback(() => {
|
|
5
5
|
const index = mediaQueryLists.findIndex((mql) => mql.matches);
|
|
@@ -8,11 +8,11 @@ const useMediaBreakpoints = (queries, values, defaultValue) => {
|
|
|
8
8
|
const [value, setValue] = useState(getValue);
|
|
9
9
|
useEffect(() => {
|
|
10
10
|
const handler = () => setValue(getValue);
|
|
11
|
-
mediaQueryLists.forEach((mql) => mql.
|
|
12
|
-
return () => mediaQueryLists.forEach((mql) => mql.
|
|
11
|
+
mediaQueryLists.forEach((mql) => mql.addEventListener("change", handler));
|
|
12
|
+
return () => mediaQueryLists.forEach((mql) => mql.removeEventListener("change", handler));
|
|
13
13
|
}, [getValue, mediaQueryLists]);
|
|
14
14
|
return value;
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
useMediaQueryList
|
|
18
18
|
};
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { DSControlledCheckbox } from "@elliemae/ds-controlled-form";
|
|
3
3
|
import {
|
|
4
4
|
Controller
|
|
5
5
|
} from "react-hook-form";
|
|
6
|
-
const CheckBox = ({
|
|
7
|
-
name,
|
|
8
|
-
defaultChecked = false,
|
|
9
|
-
rules = {},
|
|
10
|
-
...rest
|
|
11
|
-
}) => /* @__PURE__ */ React.createElement(Controller, {
|
|
6
|
+
const CheckBox = ({ name, rules = {}, ...rest }) => /* @__PURE__ */ React.createElement(Controller, {
|
|
12
7
|
name,
|
|
13
8
|
rules,
|
|
14
|
-
render: ({ field: {
|
|
9
|
+
render: ({ field: { value = false, ...restProps } }) => /* @__PURE__ */ React.createElement(DSControlledCheckbox, {
|
|
15
10
|
...rest,
|
|
16
11
|
...restProps,
|
|
17
|
-
|
|
18
|
-
checked: value,
|
|
19
|
-
onChange: (e) => onChange(((e || {}).target || {}).checked)
|
|
12
|
+
checked: value
|
|
20
13
|
})
|
|
21
14
|
});
|
|
22
15
|
export {
|
|
23
|
-
CHECKBOX_VARIANT,
|
|
24
16
|
CheckBox
|
|
25
17
|
};
|
|
@@ -7,7 +7,6 @@ const ComboBox = ({
|
|
|
7
7
|
name,
|
|
8
8
|
defaultValue = "",
|
|
9
9
|
rules = {},
|
|
10
|
-
onChange: changeHandler,
|
|
11
10
|
...rest
|
|
12
11
|
}) => /* @__PURE__ */ React.createElement(Controller, {
|
|
13
12
|
name,
|
|
@@ -17,9 +16,8 @@ const ComboBox = ({
|
|
|
17
16
|
...rest,
|
|
18
17
|
...props,
|
|
19
18
|
onChange: (selected) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
changeHandler(selected);
|
|
19
|
+
const { value = selected } = selected;
|
|
20
|
+
onChange(value);
|
|
23
21
|
}
|
|
24
22
|
})
|
|
25
23
|
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DSFormLayoutBlockItem } from "@elliemae/ds-form-layout-blocks";
|
|
3
|
+
import { get } from "react-hook-form";
|
|
4
|
+
import { ConnectForm } from "../connect-form.js";
|
|
5
|
+
const FormLayoutBlockItem = ({
|
|
6
|
+
inputID,
|
|
7
|
+
label,
|
|
8
|
+
...rest
|
|
9
|
+
}) => /* @__PURE__ */ React.createElement(ConnectForm, null, ({
|
|
10
|
+
formState: { errors }
|
|
11
|
+
}) => {
|
|
12
|
+
const errorField = get(errors, inputID);
|
|
13
|
+
const hasError = !!errorField;
|
|
14
|
+
const validationMessage = errorField?.message;
|
|
15
|
+
return /* @__PURE__ */ React.createElement(DSFormLayoutBlockItem, {
|
|
16
|
+
inputID,
|
|
17
|
+
label,
|
|
18
|
+
hasError,
|
|
19
|
+
validationMessage,
|
|
20
|
+
...rest
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
FormLayoutBlockItem
|
|
25
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import styled from "styled-components";
|
|
3
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
3
4
|
import { useFormContext } from "react-hook-form";
|
|
4
5
|
const Section = styled.section`
|
|
6
|
+
margin-top: 10px;
|
|
5
7
|
border-top: 2px blue dotted;
|
|
6
8
|
width: 100%;
|
|
7
9
|
`;
|
|
@@ -11,10 +13,10 @@ const Div = styled.div`
|
|
|
11
13
|
padding-left: 10px;
|
|
12
14
|
align-items: flex-start;
|
|
13
15
|
`;
|
|
14
|
-
const WatchValue = ({ name,
|
|
16
|
+
const WatchValue = ({ name, label }) => {
|
|
15
17
|
const { watch } = useFormContext();
|
|
16
18
|
const data = watch(name, false) || "";
|
|
17
|
-
return /* @__PURE__ */ React.createElement(Section, null, /* @__PURE__ */ React.createElement("h4", null, "Form Data:"), /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement("div", null,
|
|
19
|
+
return /* @__PURE__ */ React.createElement(Grid, null, /* @__PURE__ */ React.createElement(Section, null, /* @__PURE__ */ React.createElement("h4", null, "Form Data:"), /* @__PURE__ */ React.createElement(Div, null, /* @__PURE__ */ React.createElement("div", null, label, " : ", /* @__PURE__ */ React.createElement("strong", null, JSON.stringify(data))))));
|
|
18
20
|
};
|
|
19
21
|
export {
|
|
20
22
|
WatchValue
|
|
@@ -3,48 +3,52 @@ 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
|
-
import {
|
|
7
|
-
const FirstName = () => /* @__PURE__ */ React.createElement(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { FormLayoutBlockItem } from "../fields/form-layout-block-item/index.js";
|
|
7
|
+
const FirstName = () => /* @__PURE__ */ React.createElement(FormLayoutBlockItem, {
|
|
8
|
+
label: "First Name",
|
|
9
|
+
inputID: "firstname",
|
|
10
|
+
required: true
|
|
11
|
+
}, /* @__PURE__ */ React.createElement(TextBox, {
|
|
12
|
+
id: "firstname",
|
|
11
13
|
name: "firstname",
|
|
12
|
-
required: true,
|
|
13
14
|
rules: {
|
|
14
15
|
required: { value: true, message: "First Name is required" },
|
|
15
16
|
minLength: { value: 2, message: "Minimum 2 characters" },
|
|
16
17
|
maxLength: { value: 50, message: "Maximum 50 characters" }
|
|
17
18
|
}
|
|
18
|
-
});
|
|
19
|
-
const DOB = () => /* @__PURE__ */ React.createElement(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
}));
|
|
20
|
+
const DOB = () => /* @__PURE__ */ React.createElement(FormLayoutBlockItem, {
|
|
21
|
+
label: "Date of Birth",
|
|
22
|
+
inputID: "dob",
|
|
23
|
+
required: true
|
|
24
|
+
}, /* @__PURE__ */ React.createElement(DateInput, {
|
|
25
|
+
id: "dob",
|
|
23
26
|
name: "dob",
|
|
24
|
-
required: true,
|
|
25
27
|
rules: {
|
|
26
28
|
required: { value: true, message: "Date of Birth is required" },
|
|
27
29
|
validate: (value) => moment() > value || "Date of Birth can not be greater than current date"
|
|
28
30
|
}
|
|
29
|
-
});
|
|
30
|
-
const State = () => /* @__PURE__ */ React.createElement(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
}));
|
|
32
|
+
const State = () => /* @__PURE__ */ React.createElement(FormLayoutBlockItem, {
|
|
33
|
+
label: "State",
|
|
34
|
+
inputID: "state",
|
|
35
|
+
required: true
|
|
36
|
+
}, /* @__PURE__ */ React.createElement(ComboBox, {
|
|
37
|
+
id: "state",
|
|
34
38
|
name: "state",
|
|
35
|
-
required: true,
|
|
36
39
|
rules: { required: { value: true, message: "State is required" } },
|
|
37
40
|
options: [
|
|
38
41
|
{ value: "ca", label: "California" },
|
|
39
42
|
{ value: "nj", label: "New Jersey" }
|
|
40
43
|
]
|
|
41
|
-
});
|
|
42
|
-
const MaritalStatus = () => /* @__PURE__ */ React.createElement(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
}));
|
|
45
|
+
const MaritalStatus = () => /* @__PURE__ */ React.createElement(FormLayoutBlockItem, {
|
|
46
|
+
label: "Marital Status",
|
|
47
|
+
inputID: "marital_status",
|
|
48
|
+
required: true
|
|
49
|
+
}, /* @__PURE__ */ React.createElement(ComboBox, {
|
|
50
|
+
id: "marital_status",
|
|
46
51
|
name: "marital_status",
|
|
47
|
-
required: true,
|
|
48
52
|
rules: {
|
|
49
53
|
required: { value: true, message: "Marital Status is required" }
|
|
50
54
|
},
|
|
@@ -52,7 +56,7 @@ const MaritalStatus = () => /* @__PURE__ */ React.createElement(FormItemLayout,
|
|
|
52
56
|
{ value: "married", label: "Married" },
|
|
53
57
|
{ value: "single", label: "Single" }
|
|
54
58
|
]
|
|
55
|
-
});
|
|
59
|
+
}));
|
|
56
60
|
export {
|
|
57
61
|
DOB,
|
|
58
62
|
FirstName,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useFormContext } from "react-hook-form";
|
|
3
|
-
import {
|
|
3
|
+
import { DSButtonV2 } from "@elliemae/ds-button";
|
|
4
4
|
const FormSubmitButton = ({ ...rest }) => {
|
|
5
5
|
const {
|
|
6
6
|
formState,
|
|
7
7
|
formProps: { mode }
|
|
8
8
|
} = useFormContext();
|
|
9
|
-
return /* @__PURE__ */ React.createElement(
|
|
9
|
+
return /* @__PURE__ */ React.createElement(DSButtonV2, {
|
|
10
10
|
...rest,
|
|
11
11
|
type: "submit",
|
|
12
12
|
disabled: mode !== "onSubmit" && (!formState.isDirty || formState.isDirty && !formState.isValid)
|
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import {
|
|
2
|
+
import { useState, useCallback } from "react";
|
|
3
|
+
import {
|
|
4
|
+
DSDialog,
|
|
5
|
+
DSDialogBody,
|
|
6
|
+
DSDialogDefaultLayout,
|
|
7
|
+
DSDialogPrimaryMessage,
|
|
8
|
+
DSDialogSecondaryMessage
|
|
9
|
+
} from "@elliemae/ds-dialog";
|
|
10
|
+
import { ErrorHexegon } from "@elliemae/ds-icons";
|
|
4
11
|
const Error = ({
|
|
5
12
|
open,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
children
|
|
13
|
+
primaryMessage,
|
|
14
|
+
secondaryMessage
|
|
9
15
|
}) => {
|
|
10
|
-
const [isOpen,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
const [isOpen, setOpen] = useState(open);
|
|
17
|
+
const handleClick = useCallback(() => {
|
|
18
|
+
setOpen((prev) => !prev);
|
|
19
|
+
}, []);
|
|
20
|
+
return /* @__PURE__ */ React.createElement(DSDialog, {
|
|
14
21
|
isOpen,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
onClickOutside: handleClick,
|
|
23
|
+
size: "small"
|
|
24
|
+
}, /* @__PURE__ */ React.createElement(DSDialogBody, {
|
|
25
|
+
p: "s"
|
|
26
|
+
}, /* @__PURE__ */ React.createElement(DSDialogDefaultLayout, null, /* @__PURE__ */ React.createElement(ErrorHexegon, {
|
|
27
|
+
size: "xxl",
|
|
28
|
+
color: ["danger", "900"]
|
|
29
|
+
}), /* @__PURE__ */ React.createElement(DSDialogPrimaryMessage, null, primaryMessage), secondaryMessage && /* @__PURE__ */ React.createElement(DSDialogSecondaryMessage, null, secondaryMessage))));
|
|
21
30
|
};
|
|
22
31
|
export {
|
|
23
32
|
Error
|
|
@@ -1,21 +1,39 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { memo } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Close } from "@elliemae/ds-icons";
|
|
4
|
+
import { DSButtonV2 } from "@elliemae/ds-button";
|
|
5
|
+
import {
|
|
6
|
+
DSDialog,
|
|
7
|
+
DSDialogHeader,
|
|
8
|
+
DSDialogBody,
|
|
9
|
+
DSDialogFooter,
|
|
10
|
+
DSDialogSeparator,
|
|
11
|
+
DSDialogAddon
|
|
12
|
+
} from "@elliemae/ds-dialog";
|
|
4
13
|
import { useAppDispatch } from "../../../data/react-redux.js";
|
|
5
14
|
import { navigationPrompt } from "../../../data/navigation-prompt/actions.js";
|
|
6
|
-
const NavigationPrompt = memo(({ open
|
|
15
|
+
const NavigationPrompt = memo(({ open }) => {
|
|
7
16
|
const dispatch = useAppDispatch();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
17
|
+
const cancelDialog = () => dispatch(navigationPrompt.cancel());
|
|
18
|
+
const confirmDialog = () => dispatch(navigationPrompt.confirm());
|
|
19
|
+
return /* @__PURE__ */ React.createElement(DSDialog, {
|
|
11
20
|
isOpen: open,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
onClickOutside: cancelDialog,
|
|
22
|
+
centered: true
|
|
23
|
+
}, /* @__PURE__ */ React.createElement(DSDialogHeader, null, /* @__PURE__ */ React.createElement(DSDialogAddon, null, /* @__PURE__ */ React.createElement(DSButtonV2, {
|
|
24
|
+
buttonType: "icon",
|
|
25
|
+
onClick: cancelDialog
|
|
26
|
+
}, /* @__PURE__ */ React.createElement(Close, {
|
|
27
|
+
color: ["neutral", "900"]
|
|
28
|
+
})))), /* @__PURE__ */ React.createElement(DSDialogSeparator, null), /* @__PURE__ */ React.createElement(DSDialogBody, {
|
|
29
|
+
px: 24,
|
|
30
|
+
mb: 16
|
|
31
|
+
}, "You currently have unsaved changes. Are you sure you want to proceed without saving?"), /* @__PURE__ */ React.createElement(DSDialogSeparator, null), /* @__PURE__ */ React.createElement(DSDialogFooter, null, /* @__PURE__ */ React.createElement(DSButtonV2, {
|
|
32
|
+
buttonType: "outline",
|
|
33
|
+
onClick: cancelDialog
|
|
34
|
+
}, "Continue without saving"), /* @__PURE__ */ React.createElement(DSButtonV2, {
|
|
35
|
+
onClick: confirmDialog
|
|
36
|
+
}, "Save & Continue")));
|
|
19
37
|
});
|
|
20
38
|
export {
|
|
21
39
|
NavigationPrompt
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { memo, useEffect, useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { DSButtonV2 } from "@elliemae/ds-button";
|
|
4
|
+
import { WarningCircle } from "@elliemae/ds-icons";
|
|
5
|
+
import {
|
|
6
|
+
DSDialog,
|
|
7
|
+
DSDialogDefaultLayout,
|
|
8
|
+
DSDialogPrimaryMessage,
|
|
9
|
+
DSDialogSecondaryMessage,
|
|
10
|
+
DSDialogBody,
|
|
11
|
+
DSDialogFooter,
|
|
12
|
+
DSDialogSeparator
|
|
13
|
+
} from "@elliemae/ds-dialog";
|
|
4
14
|
import { useAppDispatch } from "../../../data/react-redux.js";
|
|
5
15
|
import { logout } from "../../../data/logout/actions.js";
|
|
6
16
|
import { resetUserIdleTime } from "../../../utils/session.js";
|
|
7
17
|
import { useTrackSessionExpiry } from "./customHooks.js";
|
|
8
|
-
const SessionExpiry = memo(({ open, warningNotifiedAt = 0
|
|
18
|
+
const SessionExpiry = memo(({ open, warningNotifiedAt = 0 }) => {
|
|
9
19
|
const [isOpen, setIsOpen] = useState(open);
|
|
10
20
|
const timeLeft = useTrackSessionExpiry(warningNotifiedAt);
|
|
11
21
|
const dispatch = useAppDispatch();
|
|
@@ -21,22 +31,20 @@ const SessionExpiry = memo(({ open, warningNotifiedAt = 0, showHeader = false })
|
|
|
21
31
|
setIsOpen(false);
|
|
22
32
|
dispatch(logout.confirm());
|
|
23
33
|
};
|
|
24
|
-
return /* @__PURE__ */ React.createElement(
|
|
25
|
-
centered: true,
|
|
26
|
-
modalType: MODAL_TYPE_V2.DECISION,
|
|
34
|
+
return timeLeft ? /* @__PURE__ */ React.createElement(DSDialog, {
|
|
27
35
|
isOpen,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
36
|
+
size: "small"
|
|
37
|
+
}, /* @__PURE__ */ React.createElement(DSDialogBody, {
|
|
38
|
+
p: "s"
|
|
39
|
+
}, /* @__PURE__ */ React.createElement(DSDialogDefaultLayout, null, /* @__PURE__ */ React.createElement(WarningCircle, {
|
|
40
|
+
size: "xl",
|
|
41
|
+
color: ["warning", "900"]
|
|
42
|
+
}), /* @__PURE__ */ React.createElement(DSDialogPrimaryMessage, null, `Your session will expire in ${timeLeft}`), /* @__PURE__ */ React.createElement(DSDialogSecondaryMessage, null, "Please logout or reset your session"))), /* @__PURE__ */ React.createElement(DSDialogSeparator, null), /* @__PURE__ */ React.createElement(DSDialogFooter, null, /* @__PURE__ */ React.createElement(DSButtonV2, {
|
|
43
|
+
buttonType: "outline",
|
|
44
|
+
onClick: logoutSession
|
|
45
|
+
}, "Logout"), /* @__PURE__ */ React.createElement(DSButtonV2, {
|
|
46
|
+
onClick: resetSession
|
|
47
|
+
}, "Reset"))) : null;
|
|
40
48
|
});
|
|
41
49
|
export {
|
|
42
50
|
SessionExpiry
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { memo, useEffect } from "react";
|
|
3
3
|
import { DSLoadingIndicator } from "@elliemae/ds-loading-indicator";
|
|
4
4
|
import { useAppSelector } from "../../../data/react-redux.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useHTMLWaitMessage } from "./use-html-wait-message.js";
|
|
6
6
|
import {
|
|
7
7
|
waitStartEvent,
|
|
8
8
|
waitEndEvent
|
|
@@ -20,16 +20,15 @@ const WaitMessage = memo(({
|
|
|
20
20
|
else
|
|
21
21
|
waitEndEvent();
|
|
22
22
|
}, [isOpen]);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}), /* @__PURE__ */ React.createElement(DSLoadingIndicator, {
|
|
23
|
+
useHTMLWaitMessage(isOpen !== null);
|
|
24
|
+
return /* @__PURE__ */ React.createElement(DSLoadingIndicator, {
|
|
26
25
|
id: "em-loading",
|
|
27
26
|
size,
|
|
28
27
|
style,
|
|
29
28
|
...rest,
|
|
30
29
|
loading: isOpen,
|
|
31
30
|
message
|
|
32
|
-
})
|
|
31
|
+
});
|
|
33
32
|
});
|
|
34
33
|
export {
|
|
35
34
|
WaitMessage
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
const useHTMLWaitMessage = (close) => {
|
|
3
3
|
useEffect(() => {
|
|
4
4
|
const htmlWaitMsgElement = document.getElementById("em-wait-message");
|
|
5
5
|
if (htmlWaitMsgElement && close)
|
|
6
6
|
htmlWaitMsgElement.remove();
|
|
7
7
|
}, [close]);
|
|
8
|
-
|
|
9
|
-
});
|
|
8
|
+
};
|
|
10
9
|
export {
|
|
11
|
-
|
|
10
|
+
useHTMLWaitMessage
|
|
12
11
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
2
|
import { publish } from "pubsub-js";
|
|
3
|
-
import { HOST_WINDOW_RESIZED } from "
|
|
4
|
-
const
|
|
3
|
+
import { HOST_WINDOW_RESIZED } from "../utils/constants.js";
|
|
4
|
+
const useWindowSizeChange = () => {
|
|
5
5
|
useEffect(() => {
|
|
6
6
|
if (window.ResizeObserver) {
|
|
7
7
|
const observer = new ResizeObserver((entries) => {
|
|
@@ -15,8 +15,7 @@ const WindowSize = () => {
|
|
|
15
15
|
return () => {
|
|
16
16
|
};
|
|
17
17
|
}, []);
|
|
18
|
-
return null;
|
|
19
18
|
};
|
|
20
19
|
export {
|
|
21
|
-
|
|
20
|
+
useWindowSizeChange
|
|
22
21
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -41,7 +41,6 @@ export { renderWithRouter } from './utils/testing/render-with-router.js';
|
|
|
41
41
|
export { RenderWithStateAddOns } from './utils/testing/render-with-state-addons.js';
|
|
42
42
|
export { getApiActionCreator, getSelectField } from './api/helpers.js';
|
|
43
43
|
export { getUser as fetchUserSettings } from './api/users/index.js';
|
|
44
|
-
export { useMediaBreakpoints } from './view/useMediaBreakpoints/index.js';
|
|
45
44
|
export { withAppDecorator } from './view/storybook/decorator.js';
|
|
46
45
|
export { ErrorToast } from './view/error-toast/index.js';
|
|
47
46
|
export { Form } from './view/form/index.js';
|
|
@@ -57,7 +56,7 @@ export { RadioGroup } from './view/fields/radio-group/index.js';
|
|
|
57
56
|
export { DateInput } from './view/fields/date-input/index.js';
|
|
58
57
|
export { DatePicker } from './view/fields/date-picker/index.js';
|
|
59
58
|
export { FormSubmitButton } from './view/form/submit-button/index.js';
|
|
60
|
-
export {
|
|
59
|
+
export { useMediaQueryList } from './view/breakpoint/use-media-query-list.js';
|
|
61
60
|
export { VisuallyHidden } from './view/visually-hidden/index.js';
|
|
62
61
|
export { actions as ariaLive } from './data/live-message/index.js';
|
|
63
62
|
export { actions as error } from './data/error/index.js';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useBreakpoint: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useMediaQueryList: (queries: Array<string>, values: Array<string>, defaultValue: string) => string;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { CHECKBOX_VARIANT } from '@elliemae/ds-form/Checkbox';
|
|
3
2
|
import { RegisterOptions, FieldValues, FieldPath } from 'react-hook-form';
|
|
4
3
|
export declare type CheckBoxProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
|
|
5
4
|
name: string;
|
|
6
|
-
|
|
5
|
+
label: string;
|
|
7
6
|
rules?: Omit<RegisterOptions<TFieldValues, TName>, 'valueAsNumber' | 'valueAsDate' | 'setValueAs'>;
|
|
8
7
|
[x: string]: any;
|
|
9
8
|
};
|
|
10
|
-
export declare const CheckBox: ({ name,
|
|
11
|
-
export { CHECKBOX_VARIANT };
|
|
9
|
+
export declare const CheckBox: ({ name, rules, ...rest }: CheckBoxProps) => JSX.Element;
|
|
@@ -2,6 +2,4 @@ import { Story, Meta } from '@storybook/react';
|
|
|
2
2
|
import { CheckBoxProps } from './index.js';
|
|
3
3
|
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
4
|
export default _default;
|
|
5
|
-
export declare const Basic: Story<CheckBoxProps<import("react-hook-form").FieldValues, string
|
|
6
|
-
labelText: string;
|
|
7
|
-
}>;
|
|
5
|
+
export declare const Basic: Story<CheckBoxProps<import("react-hook-form").FieldValues, string>>;
|
|
@@ -4,7 +4,6 @@ export declare type ComboBoxProps<TFieldValues extends FieldValues = FieldValues
|
|
|
4
4
|
name: string;
|
|
5
5
|
defaultValue?: string;
|
|
6
6
|
rules?: Omit<RegisterOptions<TFieldValues, TName>, 'valueAsNumber' | 'valueAsDate' | 'setValueAs'>;
|
|
7
|
-
onChange: (e: React.BaseSyntheticEvent) => void;
|
|
8
7
|
[x: string]: any;
|
|
9
8
|
};
|
|
10
|
-
export declare const ComboBox: ({ name, defaultValue, rules,
|
|
9
|
+
export declare const ComboBox: ({ name, defaultValue, rules, ...rest }: ComboBoxProps) => JSX.Element;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Story, Meta } from '@storybook/react';
|
|
2
|
-
import {
|
|
2
|
+
import { ComboBoxProps } from './index.js';
|
|
3
3
|
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
4
|
export default _default;
|
|
5
|
-
export declare const Basic: Story<
|
|
6
|
-
labelText: string;
|
|
7
|
-
}>;
|
|
5
|
+
export declare const Basic: Story<ComboBoxProps<import("react-hook-form").FieldValues, string>>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { RegisterOptions, FieldValues, FieldPath } from 'react-hook-form';
|
|
3
3
|
export declare type DatePickerProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
|
|
4
4
|
name: string;
|
|
5
|
+
labelText: string;
|
|
5
6
|
defaultValue?: string;
|
|
6
7
|
rules?: Omit<RegisterOptions<TFieldValues, TName>, 'valueAsNumber' | 'valueAsDate' | 'setValueAs'>;
|
|
7
8
|
[x: string]: any;
|
|
@@ -2,6 +2,4 @@ import { Story, Meta } from '@storybook/react';
|
|
|
2
2
|
import { DatePickerProps } from './index.js';
|
|
3
3
|
declare const _default: Meta<import("@storybook/react").Args>;
|
|
4
4
|
export default _default;
|
|
5
|
-
export declare const Basic: Story<DatePickerProps<import("react-hook-form").FieldValues, string
|
|
6
|
-
labelText: string;
|
|
7
|
-
}>;
|
|
5
|
+
export declare const Basic: Story<DatePickerProps<import("react-hook-form").FieldValues, string>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type FormLayoutBlockItemProps = {
|
|
3
|
+
inputID: string;
|
|
4
|
+
label: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
};
|
|
8
|
+
export declare const FormLayoutBlockItem: ({ inputID, label, ...rest }: FormLayoutBlockItemProps) => JSX.Element;
|