@elliemae/pui-app-sdk 5.3.7 → 5.3.9

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.
@@ -34,13 +34,13 @@ const Radio = ({
34
34
  {
35
35
  name,
36
36
  rules,
37
+ defaultValue: defaultChecked,
37
38
  render: ({ field: { onChange, value, ...restProps } }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
38
39
  import_ds_form.DSRadio,
39
40
  {
40
41
  ...rest,
41
42
  ...restProps,
42
43
  checked: value,
43
- defaultChecked,
44
44
  onChange: (e) => onChange(((e || {}).target || {}).checked)
45
45
  }
46
46
  )
@@ -24,11 +24,17 @@ module.exports = __toCommonJS(radio_group_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_ds_form = require("@elliemae/ds-form");
26
26
  var import_react_hook_form = require("react-hook-form");
27
- const RadioGroup = ({ name, rules = {}, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
27
+ const RadioGroup = ({
28
+ name,
29
+ rules = {},
30
+ defaultValue,
31
+ ...rest
32
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
28
33
  import_react_hook_form.Controller,
29
34
  {
30
35
  name,
31
36
  rules,
37
+ defaultValue,
32
38
  render: ({ field: { value, ...restProps } }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_form.DSRadioGroup, { ...rest, ...restProps, activeValue: value })
33
39
  }
34
40
  );
@@ -34,12 +34,18 @@ const Login = ({
34
34
  }) => {
35
35
  const [userAuthorized, setUserAuthorized] = (0, import_react.useState)(false);
36
36
  const dispatch = (0, import_react2.useAppDispatch)();
37
+ const ref = (0, import_react.useRef)(false);
37
38
  (0, import_react.useEffect)(() => {
39
+ if (ref.current)
40
+ return;
41
+ ref.current = true;
38
42
  (0, import_auth.login)({ clientId, scope, responseType }).then(({ authorized }) => {
39
43
  if (authorized)
40
44
  setUserAuthorized(true);
41
45
  dispatch({ type: import_actions.LOGIN_SUCCESS });
42
46
  }).catch(() => {
47
+ }).finally(() => {
48
+ ref.current = false;
43
49
  });
44
50
  }, [dispatch, clientId, scope, responseType]);
45
51
  return userAuthorized ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children }) : null;
@@ -13,13 +13,13 @@ const Radio = ({
13
13
  {
14
14
  name,
15
15
  rules,
16
+ defaultValue: defaultChecked,
16
17
  render: ({ field: { onChange, value, ...restProps } }) => /* @__PURE__ */ jsx(
17
18
  DSRadio,
18
19
  {
19
20
  ...rest,
20
21
  ...restProps,
21
22
  checked: value,
22
- defaultChecked,
23
23
  onChange: (e) => onChange(((e || {}).target || {}).checked)
24
24
  }
25
25
  )
@@ -3,11 +3,17 @@ import { DSRadioGroup } from "@elliemae/ds-form";
3
3
  import {
4
4
  Controller
5
5
  } from "react-hook-form";
6
- const RadioGroup = ({ name, rules = {}, ...rest }) => /* @__PURE__ */ jsx(
6
+ const RadioGroup = ({
7
+ name,
8
+ rules = {},
9
+ defaultValue,
10
+ ...rest
11
+ }) => /* @__PURE__ */ jsx(
7
12
  Controller,
8
13
  {
9
14
  name,
10
15
  rules,
16
+ defaultValue,
11
17
  render: ({ field: { value, ...restProps } }) => /* @__PURE__ */ jsx(DSRadioGroup, { ...rest, ...restProps, activeValue: value })
12
18
  }
13
19
  );
@@ -1,5 +1,5 @@
1
1
  import { Fragment, jsx } from "react/jsx-runtime";
2
- import { useEffect, useState } from "react";
2
+ import { useEffect, useState, useRef } from "react";
3
3
  import { useAppDispatch } from "../../data/react.js";
4
4
  import { login } from "../../utils/auth/index.js";
5
5
  import { LOGIN_SUCCESS } from "../../data/auth/actions.js";
@@ -11,12 +11,18 @@ const Login = ({
11
11
  }) => {
12
12
  const [userAuthorized, setUserAuthorized] = useState(false);
13
13
  const dispatch = useAppDispatch();
14
+ const ref = useRef(false);
14
15
  useEffect(() => {
16
+ if (ref.current)
17
+ return;
18
+ ref.current = true;
15
19
  login({ clientId, scope, responseType }).then(({ authorized }) => {
16
20
  if (authorized)
17
21
  setUserAuthorized(true);
18
22
  dispatch({ type: LOGIN_SUCCESS });
19
23
  }).catch(() => {
24
+ }).finally(() => {
25
+ ref.current = false;
20
26
  });
21
27
  }, [dispatch, clientId, scope, responseType]);
22
28
  return userAuthorized ? /* @__PURE__ */ jsx(Fragment, { children }) : null;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { UseFormReturn, FieldValues } from 'react-hook-form';
2
3
  export type ConnectFormProps = {
3
4
  children: <TFieldValues extends FieldValues>(methods: UseFormReturn<TFieldValues>) => JSX.Element;
@@ -2,6 +2,7 @@ import { RegisterOptions, FieldValues, FieldPath } from 'react-hook-form';
2
2
  export type RadioGroupProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
3
3
  name: string;
4
4
  rules?: Omit<RegisterOptions<TFieldValues, TName>, 'valueAsNumber' | 'valueAsDate' | 'setValueAs'>;
5
+ defaultValue?: string;
5
6
  [x: string]: any;
6
7
  };
7
- export declare const RadioGroup: ({ name, rules, ...rest }: RadioGroupProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const RadioGroup: ({ name, rules, defaultValue, ...rest }: RadioGroupProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const FirstName: () => JSX.Element;
2
3
  export declare const DOB: () => import("react/jsx-runtime.js").JSX.Element;
3
4
  export declare const State: () => import("react/jsx-runtime.js").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-app-sdk",
3
- "version": "5.3.7",
3
+ "version": "5.3.9",
4
4
  "description": "ICE MT UI Platform Application SDK ",
5
5
  "sideEffects": [
6
6
  "*.css",
@@ -111,7 +111,7 @@
111
111
  "indent": 4
112
112
  },
113
113
  "peerDependencies": {
114
- "@elliemae/app-react-dependencies": "^4.9.0",
114
+ "@elliemae/app-react-dependencies": "^4.11.0",
115
115
  "@elliemae/ds-backdrop": "^3.14.16",
116
116
  "@elliemae/ds-basic": "^3.14.16",
117
117
  "@elliemae/ds-button": "^3.14.16",
@@ -126,16 +126,17 @@
126
126
  "@elliemae/ds-modal": "^3.14.16",
127
127
  "@elliemae/ds-popperjs": "^3.14.16",
128
128
  "@elliemae/ds-toast": "^3.14.16",
129
+ "@elliemae/ds-utilities": "^3.14.16",
129
130
  "@elliemae/em-ssf-guest": "^1.11.3",
130
- "@elliemae/pui-diagnostics": "^3.2.0",
131
+ "@elliemae/pui-diagnostics": "^3.4.0",
131
132
  "@elliemae/pui-micro-frontend-base": "^1.14.0",
132
- "@elliemae/pui-scripting-object": "^1.20.0",
133
+ "@elliemae/pui-scripting-object": "^1.27.0",
133
134
  "@elliemae/pui-theme": "^2.7.0",
134
- "@elliemae/pui-user-monitoring": "^1.20.0"
135
+ "@elliemae/pui-user-monitoring": "^1.22.0"
135
136
  },
136
137
  "devDependencies": {
137
- "@elliemae/app-react-dependencies": "~4.10.0",
138
- "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.7.0",
138
+ "@elliemae/app-react-dependencies": "~4.11.0",
139
+ "@elliemae/browserslist-config-elliemae-latest-browsers": "~1.8.0",
139
140
  "@elliemae/ds-backdrop": "~3.14.16",
140
141
  "@elliemae/ds-basic": "~3.14.16",
141
142
  "@elliemae/ds-button": "~3.14.16",
@@ -150,16 +151,16 @@
150
151
  "@elliemae/ds-modal": "~3.14.16",
151
152
  "@elliemae/ds-popperjs": "~3.14.16",
152
153
  "@elliemae/ds-toast": "~3.14.16",
154
+ "@elliemae/ds-utilities": "~3.14.16",
153
155
  "@elliemae/em-ssf-guest": "~1.11.3",
154
- "@elliemae/pui-cli": "~8.13.0",
155
- "@elliemae/pui-diagnostics": "~3.3.1",
156
+ "@elliemae/pui-cli": "~8.14.1",
157
+ "@elliemae/pui-diagnostics": "~3.4.0",
156
158
  "@elliemae/pui-doc-gen": "~1.7.1",
157
159
  "@elliemae/pui-e2e-test-sdk": "~8.1.4",
158
160
  "@elliemae/pui-micro-frontend-base": "~1.14.0",
159
- "@elliemae/pui-scripting-object": "~1.26.0",
161
+ "@elliemae/pui-scripting-object": "~1.27.0",
160
162
  "@elliemae/pui-theme": "~2.7.0",
161
- "@elliemae/pui-user-monitoring": "~1.21.3",
162
- "@types/react-aria-live": "~2.0.2",
163
- "@elliemae/ds-utilities": "^3.19.0"
163
+ "@elliemae/pui-user-monitoring": "~1.22.0",
164
+ "@types/react-aria-live": "~2.0.2"
164
165
  }
165
166
  }