@elliemae/pui-app-sdk 4.5.1 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/dist/cjs/utils/storybook/cjs/vite.js +2 -1
  2. package/dist/cjs/utils/storybook/cjs/webpack.js +2 -1
  3. package/dist/cjs/utils/testing/index.js +1 -6
  4. package/dist/cjs/utils/testing/render-with-redux.js +1 -4
  5. package/dist/cjs/utils/testing/render-with-router-redux.js +1 -7
  6. package/dist/cjs/utils/testing/render-with-router.js +1 -4
  7. package/dist/cjs/utils/testing/render-with-state-addons.js +1 -6
  8. package/dist/cjs/view/app-root/hosted-app.js +6 -8
  9. package/dist/cjs/view/app-root/index.js +9 -25
  10. package/dist/cjs/view/app-root/stand-alone-app.js +8 -12
  11. package/dist/cjs/view/app-router.js +10 -7
  12. package/dist/cjs/view/error-boundary/default-error-template.js +4 -10
  13. package/dist/cjs/view/error-boundary/index.js +1 -4
  14. package/dist/cjs/view/error-toast/index.js +1 -3
  15. package/dist/cjs/view/fields/autocomplete/index.js +17 -11
  16. package/dist/cjs/view/fields/check-box/index.js +15 -9
  17. package/dist/cjs/view/fields/combo-box/index.js +19 -13
  18. package/dist/cjs/view/fields/combo-box-v3/index.js +17 -11
  19. package/dist/cjs/view/fields/date-input/index.js +9 -9
  20. package/dist/cjs/view/fields/date-picker/index.js +9 -9
  21. package/dist/cjs/view/fields/date-range-picker/index.js +20 -17
  22. package/dist/cjs/view/fields/date-time-picker/index.js +17 -11
  23. package/dist/cjs/view/fields/form-item-layout/index.js +12 -11
  24. package/dist/cjs/view/fields/form-layout-block-item/index.js +12 -11
  25. package/dist/cjs/view/fields/input-mask/index.js +25 -19
  26. package/dist/cjs/view/fields/input-text/index.js +9 -9
  27. package/dist/cjs/view/fields/large-text-box/index.js +9 -9
  28. package/dist/cjs/view/fields/radio/index.js +17 -11
  29. package/dist/cjs/view/fields/radio-group/index.js +8 -9
  30. package/dist/cjs/view/fields/text-box/index.js +9 -9
  31. package/dist/cjs/view/fields/toggle/index.js +18 -12
  32. package/dist/cjs/view/fields/watch-value.js +8 -20
  33. package/dist/cjs/view/form/index.js +1 -8
  34. package/dist/cjs/view/form/personal-info-section.js +20 -28
  35. package/dist/cjs/view/form/submit-button/index.js +8 -5
  36. package/dist/cjs/view/live-message/index.js +1 -5
  37. package/dist/cjs/view/loadable/index.js +1 -6
  38. package/dist/cjs/view/login/index.js +1 -3
  39. package/dist/cjs/view/micro-app/index.js +1 -3
  40. package/dist/cjs/view/micro-iframe-app/app.js +9 -6
  41. package/dist/cjs/view/micro-iframe-app/iframe/index.js +5 -4
  42. package/dist/cjs/view/micro-iframe-app/index.js +11 -8
  43. package/dist/cjs/view/modals/error/index.js +5 -22
  44. package/dist/cjs/view/modals/navigation-prompt/index.js +10 -38
  45. package/dist/cjs/view/modals/session-expiry/index.js +12 -37
  46. package/dist/cjs/view/modals/wait-message/index.js +11 -8
  47. package/dist/cjs/view/page.js +4 -10
  48. package/dist/cjs/view/render-with-delay/index.js +1 -3
  49. package/dist/cjs/view/require-auth.js +2 -11
  50. package/dist/cjs/view/session-timeout/index.js +1 -6
  51. package/dist/cjs/view/storybook/decorator.js +1 -6
  52. package/dist/cjs/view/visually-hidden/index.js +1 -4
  53. package/dist/esm/utils/testing/index.js +1 -6
  54. package/dist/esm/utils/testing/render-with-redux.js +1 -4
  55. package/dist/esm/utils/testing/render-with-router-redux.js +1 -7
  56. package/dist/esm/utils/testing/render-with-router.js +1 -4
  57. package/dist/esm/utils/testing/render-with-state-addons.js +1 -6
  58. package/dist/esm/view/app-root/hosted-app.js +6 -8
  59. package/dist/esm/view/app-root/index.js +9 -25
  60. package/dist/esm/view/app-root/stand-alone-app.js +8 -12
  61. package/dist/esm/view/app-router.js +10 -7
  62. package/dist/esm/view/error-boundary/default-error-template.js +4 -10
  63. package/dist/esm/view/error-boundary/index.js +1 -4
  64. package/dist/esm/view/error-toast/index.js +1 -3
  65. package/dist/esm/view/fields/autocomplete/index.js +17 -11
  66. package/dist/esm/view/fields/check-box/index.js +15 -9
  67. package/dist/esm/view/fields/combo-box/index.js +19 -13
  68. package/dist/esm/view/fields/combo-box-v3/index.js +17 -11
  69. package/dist/esm/view/fields/date-input/index.js +9 -9
  70. package/dist/esm/view/fields/date-picker/index.js +9 -9
  71. package/dist/esm/view/fields/date-range-picker/index.js +20 -17
  72. package/dist/esm/view/fields/date-time-picker/index.js +17 -11
  73. package/dist/esm/view/fields/form-item-layout/index.js +12 -11
  74. package/dist/esm/view/fields/form-layout-block-item/index.js +12 -11
  75. package/dist/esm/view/fields/input-mask/index.js +25 -19
  76. package/dist/esm/view/fields/input-text/index.js +9 -9
  77. package/dist/esm/view/fields/large-text-box/index.js +9 -9
  78. package/dist/esm/view/fields/radio/index.js +17 -11
  79. package/dist/esm/view/fields/radio-group/index.js +8 -9
  80. package/dist/esm/view/fields/text-box/index.js +9 -9
  81. package/dist/esm/view/fields/toggle/index.js +18 -12
  82. package/dist/esm/view/fields/watch-value.js +8 -20
  83. package/dist/esm/view/form/index.js +1 -8
  84. package/dist/esm/view/form/personal-info-section.js +20 -28
  85. package/dist/esm/view/form/submit-button/index.js +8 -5
  86. package/dist/esm/view/live-message/index.js +1 -5
  87. package/dist/esm/view/loadable/index.js +1 -6
  88. package/dist/esm/view/login/index.js +1 -3
  89. package/dist/esm/view/micro-app/index.js +1 -3
  90. package/dist/esm/view/micro-iframe-app/app.js +9 -6
  91. package/dist/esm/view/micro-iframe-app/iframe/index.js +5 -4
  92. package/dist/esm/view/micro-iframe-app/index.js +11 -8
  93. package/dist/esm/view/modals/error/index.js +5 -22
  94. package/dist/esm/view/modals/navigation-prompt/index.js +10 -38
  95. package/dist/esm/view/modals/session-expiry/index.js +12 -37
  96. package/dist/esm/view/modals/wait-message/index.js +11 -8
  97. package/dist/esm/view/page.js +4 -10
  98. package/dist/esm/view/render-with-delay/index.js +1 -3
  99. package/dist/esm/view/require-auth.js +2 -11
  100. package/dist/esm/view/session-timeout/index.js +1 -6
  101. package/dist/esm/view/storybook/decorator.js +1 -6
  102. package/dist/esm/view/visually-hidden/index.js +1 -4
  103. package/dist/types/lib/communication/http-client/index.d.ts +2 -2
  104. package/dist/types/lib/communication/http-client/response-interceptor.d.ts +1 -1
  105. package/dist/types/lib/communication/http-client/retry-axios.d.ts +2 -2
  106. package/dist/types/lib/data/error/index.d.ts +1 -1
  107. package/dist/types/lib/data/live-message/index.d.ts +1 -1
  108. package/dist/types/lib/data/react-redux.d.ts +1 -1
  109. package/dist/types/lib/data/reducers.d.ts +1 -1
  110. package/dist/types/lib/data/saga.d.ts +4 -4
  111. package/dist/types/lib/data/store.d.ts +4 -4
  112. package/dist/types/lib/data/wait-message/reducer.d.ts +1 -1
  113. package/dist/types/lib/utils/app-host-integration/react.d.ts +1 -1
  114. package/dist/types/lib/utils/await.d.ts +1 -1
  115. package/dist/types/lib/utils/micro-frontend/console-logger.d.ts +1 -1
  116. package/dist/types/lib/utils/micro-frontend/guest.d.ts +4 -4
  117. package/dist/types/lib/utils/micro-frontend/host.d.ts +3 -3
  118. package/dist/types/lib/utils/micro-frontend/types.d.ts +2 -2
  119. package/dist/types/lib/utils/session.d.ts +3 -3
  120. package/dist/types/lib/utils/storybook/cjs/main.d.ts +2 -0
  121. package/dist/types/lib/utils/storybook/cjs/vite.d.ts +1 -0
  122. package/dist/types/lib/utils/storybook/cjs/webpack.d.ts +1 -0
  123. package/dist/types/lib/utils/testing/render-with-redux.d.ts +1 -1
  124. package/dist/types/lib/utils/testing/render-with-router-redux.d.ts +1 -1
  125. package/dist/types/lib/utils/types.d.ts +1 -1
  126. package/dist/types/lib/utils/window.d.ts +1 -1
  127. package/dist/types/lib/view/app-root/hosted-app.d.ts +1 -1
  128. package/dist/types/lib/view/app-root/index.d.ts +1 -1
  129. package/dist/types/lib/view/app-root/stand-alone-app.d.ts +1 -1
  130. package/dist/types/lib/view/fields/autocomplete/index.d.ts +2 -2
  131. package/dist/types/lib/view/fields/check-box/index.d.ts +1 -1
  132. package/dist/types/lib/view/fields/combo-box/index.d.ts +1 -1
  133. package/dist/types/lib/view/fields/combo-box-v3/index.d.ts +1 -1
  134. package/dist/types/lib/view/fields/connect-form.d.ts +1 -1
  135. package/dist/types/lib/view/fields/date-input/index.d.ts +1 -1
  136. package/dist/types/lib/view/fields/date-picker/index.d.ts +1 -1
  137. package/dist/types/lib/view/fields/date-range-picker/index.d.ts +1 -1
  138. package/dist/types/lib/view/fields/date-time-picker/index.d.ts +1 -1
  139. package/dist/types/lib/view/fields/form-item-layout/index.d.ts +1 -1
  140. package/dist/types/lib/view/fields/form-layout-block-item/index.d.ts +1 -1
  141. package/dist/types/lib/view/fields/input-mask/index.d.ts +1 -1
  142. package/dist/types/lib/view/fields/input-text/index.d.ts +1 -1
  143. package/dist/types/lib/view/fields/large-text-box/index.d.ts +1 -1
  144. package/dist/types/lib/view/fields/radio/index.d.ts +1 -1
  145. package/dist/types/lib/view/fields/radio-group/index.d.ts +1 -1
  146. package/dist/types/lib/view/fields/text-box/index.d.ts +1 -1
  147. package/dist/types/lib/view/fields/toggle/index.d.ts +1 -1
  148. package/dist/types/lib/view/fields/watch-value.d.ts +1 -1
  149. package/dist/types/lib/view/form/index.d.ts +2 -2
  150. package/dist/types/lib/view/form/submit-button/index.d.ts +2 -2
  151. package/dist/types/lib/view/form/usecases.stories.d.ts +1 -1
  152. package/dist/types/lib/view/message-to-host-app/index.d.ts +1 -1
  153. package/dist/types/lib/view/micro-app/resources/manifest.d.ts +1 -1
  154. package/dist/types/lib/view/micro-app/types.d.ts +1 -1
  155. package/dist/types/lib/view/micro-app/use-app-will-render.d.ts +2 -2
  156. package/dist/types/lib/view/micro-app/utils.d.ts +1 -1
  157. package/dist/types/lib/view/micro-iframe-app/app.d.ts +1 -1
  158. package/dist/types/lib/view/micro-iframe-app/iframe/index.d.ts +1 -1
  159. package/dist/types/lib/view/micro-iframe-app/index.d.ts +1 -1
  160. package/dist/types/lib/view/micro-iframe-app/types.d.ts +1 -1
  161. package/dist/types/lib/view/storybook/decorator.d.ts +1 -1
  162. package/package.json +38 -38
@@ -24,9 +24,4 @@ module.exports = __toCommonJS(decorator_exports);
24
24
  var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_history = require("../../utils/history.js");
26
26
  var import_app_root = require("../app-root/index.js");
27
- const withAppDecorator = (theme, store, story) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_app_root.AppRoot, {
28
- store,
29
- history: import_history.browserHistory,
30
- theme,
31
- children: story()
32
- });
27
+ const withAppDecorator = (theme, store, story) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_app_root.AppRoot, { store, history: import_history.browserHistory, theme, children: story() });
@@ -43,8 +43,5 @@ const Span = import_styled_components.default.span`
43
43
  word-wrap: normal;
44
44
  `;
45
45
  const VisuallyHidden = (0, import_react.forwardRef)(
46
- (props, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Span, {
47
- ref,
48
- ...props
49
- })
46
+ (props, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Span, { ref, ...props })
50
47
  );
@@ -10,12 +10,7 @@ const AllTheProviders = ({
10
10
  store = defaultStore,
11
11
  theme = defaultTheme,
12
12
  children
13
- }) => /* @__PURE__ */ jsx(AppRoot, {
14
- store,
15
- history: browserHistory,
16
- theme,
17
- children
18
- });
13
+ }) => /* @__PURE__ */ jsx(AppRoot, { store, history: browserHistory, theme, children });
19
14
  const customRender = (ui, options) => render(ui, { wrapper: AllTheProviders, ...options });
20
15
  export * from "@testing-library/react";
21
16
  export {
@@ -7,10 +7,7 @@ const renderWithRedux = (ui, {
7
7
  initialState,
8
8
  store = createAppStore(initialState, browserHistory)
9
9
  } = {}) => ({
10
- ...render(/* @__PURE__ */ jsx(Provider, {
11
- store,
12
- children: ui
13
- })),
10
+ ...render(/* @__PURE__ */ jsx(Provider, { store, children: ui })),
14
11
  store
15
12
  });
16
13
  export {
@@ -12,13 +12,7 @@ const renderWithRouterRedux = (ui, {
12
12
  store = createAppStore(initialState, browserHistory)
13
13
  } = {}) => ({
14
14
  ...render(
15
- /* @__PURE__ */ jsx(Provider, {
16
- store,
17
- children: /* @__PURE__ */ jsx(AppRouter, {
18
- history,
19
- children: ui
20
- })
21
- })
15
+ /* @__PURE__ */ jsx(Provider, { store, children: /* @__PURE__ */ jsx(AppRouter, { history, children: ui }) })
22
16
  ),
23
17
  store
24
18
  });
@@ -6,10 +6,7 @@ const renderWithRouter = (ui, {
6
6
  route = "/",
7
7
  history = createMemoryHistory({ initialEntries: [route] })
8
8
  } = {}) => {
9
- const renderResult = render(/* @__PURE__ */ jsx(AppRouter, {
10
- history,
11
- children: ui
12
- }));
9
+ const renderResult = render(/* @__PURE__ */ jsx(AppRouter, { history, children: ui }));
13
10
  return {
14
11
  ...renderResult,
15
12
  history
@@ -27,12 +27,7 @@ const RenderWithStateAddOns = ({
27
27
  useEffect(() => {
28
28
  setReady(true);
29
29
  }, []);
30
- return ready ? /* @__PURE__ */ jsx(ThemeProvider, {
31
- theme,
32
- children: /* @__PURE__ */ jsx(Component, {
33
- ...rest
34
- })
35
- }) : null;
30
+ return ready ? /* @__PURE__ */ jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsx(Component, { ...rest }) }) : null;
36
31
  };
37
32
  export {
38
33
  RenderWithStateAddOns
@@ -13,14 +13,12 @@ const HostedApp = ({ WaitMessage, children }) => {
13
13
  useBreakpoint();
14
14
  useHTMLWaitMessage(true);
15
15
  useWindowSizeChange();
16
- return /* @__PURE__ */ jsxs(Div, {
17
- children: [
18
- /* @__PURE__ */ jsx(GlobalStyle, {}),
19
- WaitMessage || /* @__PURE__ */ jsx(DefaultWaitMessage, {}),
20
- /* @__PURE__ */ jsx(ErrorToast, {}),
21
- children
22
- ]
23
- });
16
+ return /* @__PURE__ */ jsxs(Div, { children: [
17
+ /* @__PURE__ */ jsx(GlobalStyle, {}),
18
+ WaitMessage || /* @__PURE__ */ jsx(DefaultWaitMessage, {}),
19
+ /* @__PURE__ */ jsx(ErrorToast, {}),
20
+ children
21
+ ] });
24
22
  };
25
23
  export {
26
24
  HostedApp
@@ -10,11 +10,7 @@ import { StandAloneApp } from "./stand-alone-app.js";
10
10
  import { HostedApp } from "./hosted-app.js";
11
11
  const AppToRender = (props) => {
12
12
  const isParent = isStandAloneGuest() || isHost();
13
- return isParent ? /* @__PURE__ */ jsx(StandAloneApp, {
14
- ...props
15
- }) : /* @__PURE__ */ jsx(HostedApp, {
16
- ...props
17
- });
13
+ return isParent ? /* @__PURE__ */ jsx(StandAloneApp, { ...props }) : /* @__PURE__ */ jsx(HostedApp, { ...props });
18
14
  };
19
15
  const AppRoot = ({
20
16
  store,
@@ -25,26 +21,14 @@ const AppRoot = ({
25
21
  WaitMessage,
26
22
  errorTemplate,
27
23
  children
28
- }) => /* @__PURE__ */ jsx(StrictMode, {
29
- children: /* @__PURE__ */ jsx(ErrorBoundary, {
30
- errorTemplate,
31
- children: /* @__PURE__ */ jsx(Provider, {
32
- store,
33
- children: /* @__PURE__ */ jsx(AppRouter, {
34
- history,
35
- basename,
36
- children: /* @__PURE__ */ jsx(ThemeProvider, {
37
- theme,
38
- children: /* @__PURE__ */ jsx(AppToRender, {
39
- manageSession,
40
- WaitMessage,
41
- children
42
- })
43
- })
44
- })
45
- })
46
- })
47
- });
24
+ }) => /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(ErrorBoundary, { errorTemplate, children: /* @__PURE__ */ jsx(Provider, { store, children: /* @__PURE__ */ jsx(AppRouter, { history, basename, children: /* @__PURE__ */ jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsx(
25
+ AppToRender,
26
+ {
27
+ manageSession,
28
+ WaitMessage,
29
+ children
30
+ }
31
+ ) }) }) }) }) });
48
32
  export {
49
33
  AppRoot
50
34
  };
@@ -18,18 +18,14 @@ const StandAloneApp = ({
18
18
  }) => {
19
19
  useBreakpoint();
20
20
  useWindowSizeChange();
21
- return /* @__PURE__ */ jsx(LiveAnnouncer, {
22
- children: /* @__PURE__ */ jsxs(Div, {
23
- children: [
24
- /* @__PURE__ */ jsx(GlobalStyle, {}),
25
- manageSession && /* @__PURE__ */ jsx(SessionTimeout, {}),
26
- /* @__PURE__ */ jsx(LiveMessage, {}),
27
- WaitMessage || /* @__PURE__ */ jsx(DefaultWaitMessage, {}),
28
- /* @__PURE__ */ jsx(ErrorToast, {}),
29
- children
30
- ]
31
- })
32
- });
21
+ return /* @__PURE__ */ jsx(LiveAnnouncer, { children: /* @__PURE__ */ jsxs(Div, { children: [
22
+ /* @__PURE__ */ jsx(GlobalStyle, {}),
23
+ manageSession && /* @__PURE__ */ jsx(SessionTimeout, {}),
24
+ /* @__PURE__ */ jsx(LiveMessage, {}),
25
+ WaitMessage || /* @__PURE__ */ jsx(DefaultWaitMessage, {}),
26
+ /* @__PURE__ */ jsx(ErrorToast, {}),
27
+ children
28
+ ] }) });
33
29
  };
34
30
  export {
35
31
  StandAloneApp
@@ -21,13 +21,16 @@ const AppRouter = ({ history, basename, ...props }) => {
21
21
  unlisten();
22
22
  };
23
23
  }, [history]);
24
- return /* @__PURE__ */ jsx(Router, {
25
- ...props,
26
- basename,
27
- location: state.location,
28
- navigationType: state.action,
29
- navigator: history
30
- });
24
+ return /* @__PURE__ */ jsx(
25
+ Router,
26
+ {
27
+ ...props,
28
+ basename,
29
+ location: state.location,
30
+ navigationType: state.action,
31
+ navigator: history
32
+ }
33
+ );
31
34
  };
32
35
  export {
33
36
  AppRouter
@@ -2,16 +2,10 @@ import { jsx, jsxs } from "react/jsx-runtime";
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__ */ jsxs("div", {
6
- children: [
7
- /* @__PURE__ */ jsx("h2", {
8
- children: error?.message
9
- }),
10
- /* @__PURE__ */ jsx("section", {
11
- children: errorInfo?.componentStack
12
- })
13
- ]
14
- });
5
+ }) => /* @__PURE__ */ jsxs("div", { children: [
6
+ /* @__PURE__ */ jsx("h2", { children: error?.message }),
7
+ /* @__PURE__ */ jsx("section", { children: errorInfo?.componentStack })
8
+ ] });
15
9
  export {
16
10
  DefaultErrorTemplate
17
11
  };
@@ -26,10 +26,7 @@ class ErrorBoundary extends React.Component {
26
26
  const { children, errorTemplate } = this.props;
27
27
  const ErrorTemplate = errorTemplate || DefaultErrorTemplate;
28
28
  const { error, errorInfo } = this.state;
29
- return errorInfo ? /* @__PURE__ */ jsx(ErrorTemplate, {
30
- error,
31
- errorInfo
32
- }) : children;
29
+ return errorInfo ? /* @__PURE__ */ jsx(ErrorTemplate, { error, errorInfo }) : children;
33
30
  }
34
31
  }
35
32
  export {
@@ -21,9 +21,7 @@ const ErrorToast = memo((props) => {
21
21
  dispatch(error.clear());
22
22
  }
23
23
  }, [storeError, props, dispatch]);
24
- return /* @__PURE__ */ jsx(DSToast, {
25
- ...props
26
- });
24
+ return /* @__PURE__ */ jsx(DSToast, { ...props });
27
25
  });
28
26
  export {
29
27
  ErrorToast
@@ -11,17 +11,23 @@ const Autocomplete = ({
11
11
  name,
12
12
  children,
13
13
  ...rest
14
- }) => /* @__PURE__ */ jsx(Controller, {
15
- name,
16
- render: ({ field: { onChange, value, ...props } }) => /* @__PURE__ */ jsx(DSAutocomplete, {
17
- ...props,
18
- filter: value ?? "",
19
- onSelect: onChange,
20
- ...rest,
21
- options: filterOptions(rest.options, value),
22
- children
23
- })
24
- });
14
+ }) => /* @__PURE__ */ jsx(
15
+ Controller,
16
+ {
17
+ name,
18
+ render: ({ field: { onChange, value, ...props } }) => /* @__PURE__ */ jsx(
19
+ DSAutocomplete,
20
+ {
21
+ ...props,
22
+ filter: value ?? "",
23
+ onSelect: onChange,
24
+ ...rest,
25
+ options: filterOptions(rest.options, value),
26
+ children
27
+ }
28
+ )
29
+ }
30
+ );
25
31
  export {
26
32
  Autocomplete
27
33
  };
@@ -3,15 +3,21 @@ import { DSControlledCheckbox } from "@elliemae/ds-controlled-form";
3
3
  import {
4
4
  Controller
5
5
  } from "react-hook-form";
6
- const CheckBox = ({ name, rules = {}, ...rest }) => /* @__PURE__ */ jsx(Controller, {
7
- name,
8
- rules,
9
- render: ({ field: { value = false, ...restProps } }) => /* @__PURE__ */ jsx(DSControlledCheckbox, {
10
- ...rest,
11
- ...restProps,
12
- checked: value
13
- })
14
- });
6
+ const CheckBox = ({ name, rules = {}, ...rest }) => /* @__PURE__ */ jsx(
7
+ Controller,
8
+ {
9
+ name,
10
+ rules,
11
+ render: ({ field: { value = false, ...restProps } }) => /* @__PURE__ */ jsx(
12
+ DSControlledCheckbox,
13
+ {
14
+ ...rest,
15
+ ...restProps,
16
+ checked: value
17
+ }
18
+ )
19
+ }
20
+ );
15
21
  export {
16
22
  CheckBox
17
23
  };
@@ -8,19 +8,25 @@ const ComboBox = ({
8
8
  defaultValue = "",
9
9
  rules = {},
10
10
  ...rest
11
- }) => /* @__PURE__ */ jsx(Controller, {
12
- name,
13
- rules,
14
- defaultValue,
15
- render: ({ field: { onChange, ...props } }) => /* @__PURE__ */ jsx(DSComboBox, {
16
- ...rest,
17
- ...props,
18
- onChange: (selected) => {
19
- const { value = selected } = selected || {};
20
- onChange(value);
21
- }
22
- })
23
- });
11
+ }) => /* @__PURE__ */ jsx(
12
+ Controller,
13
+ {
14
+ name,
15
+ rules,
16
+ defaultValue,
17
+ render: ({ field: { onChange, ...props } }) => /* @__PURE__ */ jsx(
18
+ DSComboBox,
19
+ {
20
+ ...rest,
21
+ ...props,
22
+ onChange: (selected) => {
23
+ const { value = selected } = selected || {};
24
+ onChange(value);
25
+ }
26
+ }
27
+ )
28
+ }
29
+ );
24
30
  export {
25
31
  ComboBox
26
32
  };
@@ -8,17 +8,23 @@ const ComboBoxV3 = ({
8
8
  defaultValue = null,
9
9
  rules = {},
10
10
  ...rest
11
- }) => /* @__PURE__ */ jsx(Controller, {
12
- name,
13
- rules,
14
- defaultValue,
15
- render: ({ field: { onChange, value, ...props } }) => /* @__PURE__ */ jsx(DSComboBox, {
16
- ...props,
17
- selectedValues: value,
18
- onChange,
19
- ...rest
20
- })
21
- });
11
+ }) => /* @__PURE__ */ jsx(
12
+ Controller,
13
+ {
14
+ name,
15
+ rules,
16
+ defaultValue,
17
+ render: ({ field: { onChange, value, ...props } }) => /* @__PURE__ */ jsx(
18
+ DSComboBox,
19
+ {
20
+ ...props,
21
+ selectedValues: value,
22
+ onChange,
23
+ ...rest
24
+ }
25
+ )
26
+ }
27
+ );
22
28
  export {
23
29
  ComboBoxV3
24
30
  };
@@ -8,15 +8,15 @@ const DateInput = ({
8
8
  defaultValue = "",
9
9
  rules = {},
10
10
  ...rest
11
- }) => /* @__PURE__ */ jsx(Controller, {
12
- name,
13
- rules,
14
- defaultValue,
15
- render: ({ field }) => /* @__PURE__ */ jsx(DSDateInput, {
16
- ...rest,
17
- ...field
18
- })
19
- });
11
+ }) => /* @__PURE__ */ jsx(
12
+ Controller,
13
+ {
14
+ name,
15
+ rules,
16
+ defaultValue,
17
+ render: ({ field }) => /* @__PURE__ */ jsx(DSDateInput, { ...rest, ...field })
18
+ }
19
+ );
20
20
  export {
21
21
  DateInput
22
22
  };
@@ -8,15 +8,15 @@ const DatePicker = ({
8
8
  defaultValue = "",
9
9
  rules = {},
10
10
  ...rest
11
- }) => /* @__PURE__ */ jsx(Controller, {
12
- name,
13
- defaultValue,
14
- rules,
15
- render: ({ field }) => /* @__PURE__ */ jsx(DSDatePicker, {
16
- ...rest,
17
- ...field
18
- })
19
- });
11
+ }) => /* @__PURE__ */ jsx(
12
+ Controller,
13
+ {
14
+ name,
15
+ defaultValue,
16
+ rules,
17
+ render: ({ field }) => /* @__PURE__ */ jsx(DSDatePicker, { ...rest, ...field })
18
+ }
19
+ );
20
20
  export {
21
21
  DatePicker
22
22
  };
@@ -17,29 +17,32 @@ const WrappedDateRangePicker = ({
17
17
  useEffect(() => {
18
18
  onChange([fromDateString, toDateString]);
19
19
  }, [fromDateString, toDateString]);
20
- return /* @__PURE__ */ jsx(DSControlledDateRangePicker, {
21
- ...restProps,
22
- fromDate: fromDateString,
23
- onFromDateChange: setFromDateString,
24
- toDate: toDateString,
25
- onToDateChange: setToDateString,
26
- ...rest
27
- });
20
+ return /* @__PURE__ */ jsx(
21
+ DSControlledDateRangePicker,
22
+ {
23
+ ...restProps,
24
+ fromDate: fromDateString,
25
+ onFromDateChange: setFromDateString,
26
+ toDate: toDateString,
27
+ onToDateChange: setToDateString,
28
+ ...rest
29
+ }
30
+ );
28
31
  };
29
32
  const DateRangePicker = ({
30
33
  name,
31
34
  defaultValue = ["", ""],
32
35
  rules = {},
33
36
  ...rest
34
- }) => /* @__PURE__ */ jsx(Controller, {
35
- name,
36
- defaultValue,
37
- rules,
38
- render: ({ field }) => /* @__PURE__ */ jsx(WrappedDateRangePicker, {
39
- field,
40
- ...rest
41
- })
42
- });
37
+ }) => /* @__PURE__ */ jsx(
38
+ Controller,
39
+ {
40
+ name,
41
+ defaultValue,
42
+ rules,
43
+ render: ({ field }) => /* @__PURE__ */ jsx(WrappedDateRangePicker, { field, ...rest })
44
+ }
45
+ );
43
46
  export {
44
47
  DateRangePicker
45
48
  };
@@ -8,17 +8,23 @@ const DateTimePicker = ({
8
8
  defaultValue = "",
9
9
  rules = {},
10
10
  ...rest
11
- }) => /* @__PURE__ */ jsx(Controller, {
12
- name,
13
- defaultValue,
14
- rules,
15
- render: ({ field: { value, onChange, ...restProps } }) => /* @__PURE__ */ jsx(DSControlledDateTimePicker, {
16
- ...restProps,
17
- dateTime: value,
18
- onDateTimeChange: onChange,
19
- ...rest
20
- })
21
- });
11
+ }) => /* @__PURE__ */ jsx(
12
+ Controller,
13
+ {
14
+ name,
15
+ defaultValue,
16
+ rules,
17
+ render: ({ field: { value, onChange, ...restProps } }) => /* @__PURE__ */ jsx(
18
+ DSControlledDateTimePicker,
19
+ {
20
+ ...restProps,
21
+ dateTime: value,
22
+ onDateTimeChange: onChange,
23
+ ...rest
24
+ }
25
+ )
26
+ }
27
+ );
22
28
  export {
23
29
  DateTimePicker
24
30
  };
@@ -2,21 +2,22 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { DSFormItemLayout } from "@elliemae/ds-form";
3
3
  import { get } from "react-hook-form";
4
4
  import { ConnectForm } from "../connect-form.js";
5
- const FormItemLayout = ({ name, ...rest }) => /* @__PURE__ */ jsx(ConnectForm, {
6
- children: ({
7
- formState: { errors }
8
- }) => {
9
- const errorField = get(errors, name);
10
- const hasError = !!errorField;
11
- const validationMessage = errorField?.message;
12
- return /* @__PURE__ */ jsx(DSFormItemLayout, {
5
+ const FormItemLayout = ({ name, ...rest }) => /* @__PURE__ */ jsx(ConnectForm, { children: ({
6
+ formState: { errors }
7
+ }) => {
8
+ const errorField = get(errors, name);
9
+ const hasError = !!errorField;
10
+ const validationMessage = errorField?.message;
11
+ return /* @__PURE__ */ jsx(
12
+ DSFormItemLayout,
13
+ {
13
14
  name,
14
15
  hasError,
15
16
  validationMessage,
16
17
  ...rest
17
- });
18
- }
19
- });
18
+ }
19
+ );
20
+ } });
20
21
  export {
21
22
  FormItemLayout
22
23
  };
@@ -6,22 +6,23 @@ const FormLayoutBlockItem = ({
6
6
  inputID,
7
7
  label,
8
8
  ...rest
9
- }) => /* @__PURE__ */ jsx(ConnectForm, {
10
- children: ({
11
- formState: { errors }
12
- }) => {
13
- const errorField = get(errors, inputID);
14
- const hasError = !!errorField;
15
- const validationMessage = errorField?.message;
16
- return /* @__PURE__ */ jsx(DSFormLayoutBlockItem, {
9
+ }) => /* @__PURE__ */ jsx(ConnectForm, { children: ({
10
+ formState: { errors }
11
+ }) => {
12
+ const errorField = get(errors, inputID);
13
+ const hasError = !!errorField;
14
+ const validationMessage = errorField?.message;
15
+ return /* @__PURE__ */ jsx(
16
+ DSFormLayoutBlockItem,
17
+ {
17
18
  inputID,
18
19
  label,
19
20
  hasError,
20
21
  validationMessage,
21
22
  ...rest
22
- });
23
- }
24
- });
23
+ }
24
+ );
25
+ } });
25
26
  export {
26
27
  FormLayoutBlockItem
27
28
  };