@elliemae/ds-form-combobox 3.55.0-next.24 → 3.55.0-next.25

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,9 +34,8 @@ module.exports = __toCommonJS(Container_exports);
34
34
  var React = __toESM(require("react"));
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_react = require("react");
37
- var import_react2 = __toESM(require("react"));
37
+ var import_react2 = require("react");
38
38
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
39
- var import_ds_system = require("@elliemae/ds-system");
40
39
  var import_ds_floating_context = require("@elliemae/ds-floating-context");
41
40
  var import_ComboBoxCTX = __toESM(require("../../ComboBoxCTX.js"));
42
41
  var import_styled = require("./styled.js");
@@ -46,7 +45,6 @@ var import_ComboboxDataTestids = require("../../ComboboxDataTestids.js");
46
45
  var import_LiveRegion = require("../LiveRegion.js");
47
46
  var import_useClickOutside = require("../../config/useClickOutside.js");
48
47
  const Container = () => {
49
- const [referenceElement, setReferenceElement] = import_react2.default.useState(null);
50
48
  const { props, internalRef, setMenuState, menuState } = (0, import_react2.useContext)(import_ComboBoxCTX.default);
51
49
  const { inline, startPlacementPreference, placementOrderPreference, isLoading, isSkeleton, applyAriaDisabled } = props;
52
50
  const globalAttributes = (0, import_ds_props_helpers.useGetGlobalAttributes)(props);
@@ -85,16 +83,15 @@ const Container = () => {
85
83
  [startPlacementPreference, placementOrderPreference, correctZIndex, handleCloseMenu, menuState]
86
84
  );
87
85
  const { refs, floatingStyles, context } = (0, import_ds_floating_context.useFloatingContext)(config);
88
- const comboboxRef = (0, import_ds_system.mergeRefs)(setReferenceElement, refs.setReference);
89
86
  const hideTooltip = (0, import_react2.useCallback)(() => {
90
87
  setMenuState(false, "blur");
91
88
  }, [setMenuState]);
92
- (0, import_useClickOutside.useOnClickOutside)(referenceElement, hideTooltip, refs.floating);
89
+ (0, import_useClickOutside.useOnClickOutside)(refs.reference, hideTooltip, refs.floating);
93
90
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
94
91
  import_styled.StyledContainer,
95
92
  {
96
93
  "data-testid": dataTestId ?? import_ComboboxDataTestids.ComboboxDataTestid.CONTAINER,
97
- innerRef: comboboxRef,
94
+ innerRef: refs.setReference,
98
95
  className,
99
96
  applyAriaDisabled,
100
97
  ...xStyledProps,
@@ -104,7 +101,7 @@ const Container = () => {
104
101
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LiveRegion.LiveRegion, {}),
105
102
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_controls.Controls, {}),
106
103
  menuState && inline ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_menu_list.MenuList, {}) : null,
107
- menuState && !inline && referenceElement ? /* @__PURE__ */ (0, import_react.createElement)(
104
+ menuState && !inline && refs.reference ? /* @__PURE__ */ (0, import_react.createElement)(
108
105
  import_ds_floating_context.FloatingWrapper,
109
106
  {
110
107
  innerRef: refs.setFloating,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/container/Container.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable consistent-return */\n/* eslint-disable complexity */\nimport React, { useCallback, useMemo, useEffect, useContext } from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport { useFloatingContext, FloatingWrapper, type DSHookFloatingContextT } from '@elliemae/ds-floating-context';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { StyledContainer, StyledPopperWrapper } from './styled.js';\nimport { Controls } from '../controls/index.js';\nimport { MenuList } from '../menu-list/index.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { LiveRegion } from '../LiveRegion.js';\nimport { useOnClickOutside } from '../../config/useClickOutside.js';\n\nexport const Container = (): JSX.Element => {\n const [referenceElement, setReferenceElement] = React.useState<HTMLElement | null>(null);\n const { props, internalRef, setMenuState, menuState } = useContext(ComboBoxContext);\n\n const { inline, startPlacementPreference, placementOrderPreference, isLoading, isSkeleton, applyAriaDisabled } =\n props;\n const globalAttributes = useGetGlobalAttributes(props) as ReturnType<typeof useGetGlobalAttributes> & {\n 'data-testid'?: string;\n };\n const { zIndex, ...xStyledProps } = useGetXstyledProps(props);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const correctZIndex = zIndex ? parseInt(zIndex as string, 10) : undefined;\n // Removing possible collisionable props\n const { className, 'data-testid': dataTestId } = globalAttributes;\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n }, []);\n\n const handleCloseMenu = useCallback(() => {\n setMenuState(false, 'blur');\n if (internalRef?.current) internalRef.current.blur();\n }, [internalRef, setMenuState]);\n\n useEffect(() => {\n const closeMenuOnWindowBlur = () => {\n if (menuState) setMenuState(false, 'blur');\n };\n\n window.addEventListener('blur', closeMenuOnWindowBlur);\n\n return () => {\n window.removeEventListener('blur', closeMenuOnWindowBlur);\n };\n }, [menuState, setMenuState]);\n\n const config = useMemo(\n () => ({\n placement: 'bottom' as DSHookFloatingContextT.PopperPlacementsT,\n withoutAnimation: true,\n startPlacementPreference,\n placementOrderPreference,\n zIndex: correctZIndex,\n customOffset: [0, 5] as [number, number],\n handleCloseMenu,\n portalDOMContainer: document.body,\n externallyControlledIsOpen: menuState,\n }),\n [startPlacementPreference, placementOrderPreference, correctZIndex, handleCloseMenu, menuState],\n );\n\n const { refs, floatingStyles, context } = useFloatingContext(config);\n\n const comboboxRef = mergeRefs(setReferenceElement, refs.setReference);\n\n const hideTooltip = useCallback(() => {\n setMenuState(false, 'blur');\n }, [setMenuState]);\n\n useOnClickOutside(referenceElement, hideTooltip, refs.floating);\n\n return (\n <StyledContainer\n data-testid={dataTestId ?? ComboboxDataTestid.CONTAINER}\n innerRef={comboboxRef}\n className={className}\n applyAriaDisabled={applyAriaDisabled}\n {...xStyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <LiveRegion />\n <Controls />\n\n {menuState && inline ? <MenuList /> : null}\n {menuState && !inline && referenceElement ? (\n <FloatingWrapper\n innerRef={refs.setFloating}\n floatingStyles={floatingStyles}\n isOpen={menuState}\n context={context}\n {...props.popperProps}\n key={`${isLoading}${isSkeleton}`} // to force remount when loading/skeleton changes\n >\n <StyledPopperWrapper tabIndex={-1} onMouseDown={handleMouseDown} applyAriaDisabled={applyAriaDisabled}>\n <MenuList />\n </StyledPopperWrapper>\n </FloatingWrapper>\n ) : null}\n </StyledContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD4EnB;AAcI;AAxFR,IAAAA,gBAAmE;AACnE,8BAA0E;AAC1E,uBAA0B;AAC1B,iCAAiF;AACjF,yBAA4B;AAC5B,oBAAqD;AACrD,sBAAyB;AACzB,uBAAyB;AACzB,iCAAmC;AACnC,wBAA2B;AAC3B,6BAAkC;AAE3B,MAAM,YAAY,MAAmB;AAC1C,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,cAAAC,QAAM,SAA6B,IAAI;AACvF,QAAM,EAAE,OAAO,aAAa,cAAc,UAAU,QAAI,0BAAW,mBAAAC,OAAe;AAElF,QAAM,EAAE,QAAQ,0BAA0B,0BAA0B,WAAW,YAAY,kBAAkB,IAC3G;AACF,QAAM,uBAAmB,gDAAuB,KAAK;AAGrD,QAAM,EAAE,QAAQ,GAAG,aAAa,QAAI,4CAAmB,KAAK;AAC5D,QAAM,EAAE,eAAe,uBAAuB,QAAI,uCAAc,KAAK;AAErE,QAAM,gBAAgB,SAAS,SAAS,QAAkB,EAAE,IAAI;AAEhE,QAAM,EAAE,WAAW,eAAe,WAAW,IAAI;AACjD,QAAM,sBAAkB,2BAAY,CAAC,MAAwB;AAC3D,MAAE,e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B;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf;AAAA,YACA,QAAQ;AAAA,YACR;AAAA,YACC,GAAG,MAAM;AAAA,YACV,KAAK,GAAG,SAAS,GAAG,UAAU;AAAA;AAAA,UAE9B,4CAAC,qCAAoB,UAAU,IAAI,aAAa,iBAAiB,mBAC/D,sDAAC,6BAAS,GACZ;AAAA,QACF,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;",
6
- "names": ["import_react", "React", "ComboBoxContext"]
4
+ "sourcesContent": ["/* eslint-disable consistent-return */\n/* eslint-disable complexity */\nimport React, { useCallback, useMemo, useEffect, useContext } from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { useFloatingContext, FloatingWrapper, type DSHookFloatingContextT } from '@elliemae/ds-floating-context';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { StyledContainer, StyledPopperWrapper } from './styled.js';\nimport { Controls } from '../controls/index.js';\nimport { MenuList } from '../menu-list/index.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { LiveRegion } from '../LiveRegion.js';\nimport { useOnClickOutside } from '../../config/useClickOutside.js';\n\nexport const Container = (): JSX.Element => {\n const { props, internalRef, setMenuState, menuState } = useContext(ComboBoxContext);\n\n const { inline, startPlacementPreference, placementOrderPreference, isLoading, isSkeleton, applyAriaDisabled } =\n props;\n const globalAttributes = useGetGlobalAttributes(props) as ReturnType<typeof useGetGlobalAttributes> & {\n 'data-testid'?: string;\n };\n const { zIndex, ...xStyledProps } = useGetXstyledProps(props);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const correctZIndex = zIndex ? parseInt(zIndex as string, 10) : undefined;\n // Removing possible collisionable props\n const { className, 'data-testid': dataTestId } = globalAttributes;\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n }, []);\n\n const handleCloseMenu = useCallback(() => {\n setMenuState(false, 'blur');\n if (internalRef?.current) internalRef.current.blur();\n }, [internalRef, setMenuState]);\n\n useEffect(() => {\n const closeMenuOnWindowBlur = () => {\n if (menuState) setMenuState(false, 'blur');\n };\n\n window.addEventListener('blur', closeMenuOnWindowBlur);\n\n return () => {\n window.removeEventListener('blur', closeMenuOnWindowBlur);\n };\n }, [menuState, setMenuState]);\n\n const config = useMemo(\n () => ({\n placement: 'bottom' as DSHookFloatingContextT.PopperPlacementsT,\n withoutAnimation: true,\n startPlacementPreference,\n placementOrderPreference,\n zIndex: correctZIndex,\n customOffset: [0, 5] as [number, number],\n handleCloseMenu,\n portalDOMContainer: document.body,\n externallyControlledIsOpen: menuState,\n }),\n [startPlacementPreference, placementOrderPreference, correctZIndex, handleCloseMenu, menuState],\n );\n\n const { refs, floatingStyles, context } = useFloatingContext(config);\n\n const hideTooltip = useCallback(() => {\n setMenuState(false, 'blur');\n }, [setMenuState]);\n\n useOnClickOutside(refs.reference, hideTooltip, refs.floating);\n\n return (\n <StyledContainer\n data-testid={dataTestId ?? ComboboxDataTestid.CONTAINER}\n innerRef={refs.setReference}\n className={className}\n applyAriaDisabled={applyAriaDisabled}\n {...xStyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <LiveRegion />\n <Controls />\n\n {menuState && inline ? <MenuList /> : null}\n {menuState && !inline && refs.reference ? (\n <FloatingWrapper\n innerRef={refs.setFloating}\n floatingStyles={floatingStyles}\n isOpen={menuState}\n context={context}\n {...props.popperProps}\n key={`${isLoading}${isSkeleton}`} // to force remount when loading/skeleton changes\n >\n <StyledPopperWrapper tabIndex={-1} onMouseDown={handleMouseDown} applyAriaDisabled={applyAriaDisabled}>\n <MenuList />\n </StyledPopperWrapper>\n </FloatingWrapper>\n ) : null}\n </StyledContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YA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oB,SAAS;AAAA,MAC7B,4BAA4B;AAAA,IAC9B;AAAA,IACA,CAAC,0BAA0B,0BAA0B,eAAe,iBAAiB,SAAS;AAAA,EAChG;AAEA,QAAM,EAAE,MAAM,gBAAgB,QAAQ,QAAI,+CAAmB,MAAM;AAEnE,QAAM,kBAAc,2BAAY,MAAM;AACpC,iBAAa,OAAO,MAAM;AAAA,EAC5B,GAAG,CAAC,YAAY,CAAC;AAEjB,gDAAkB,KAAK,WAAW,aAAa,KAAK,QAAQ;AAE5D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,cAAc,8CAAmB;AAAA,MAC9C,UAAU,KAAK;AAAA,MACf;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MAEA;AAAA,oDAAC,gCAAW;AAAA,QACZ,4CAAC,4BAAS;AAAA,QAET,aAAa,SAAS,4CAAC,6BAAS,IAAK;AAAA,QACrC,aAAa,CAAC,UAAU,KAAK,YAC5B;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf;AAAA,YACA,QAAQ;AAAA,YACR;AAAA,YACC,GAAG,MAAM;AAAA,YACV,KAAK,GAAG,SAAS,GAAG,UAAU;AAAA;AAAA,UAE9B,4CAAC,qCAAoB,UAAU,IAAI,aAAa,iBAAiB,mBAC/D,sDAAC,6BAAS,GACZ;AAAA,QACF,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;",
6
+ "names": ["import_react", "ComboBoxContext"]
7
7
  }
@@ -1,9 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { createElement } from "react";
4
- import React2, { useCallback, useMemo, useEffect, useContext } from "react";
4
+ import { useCallback, useMemo, useEffect, useContext } from "react";
5
5
  import { useGetGlobalAttributes, useGetXstyledProps, useOwnerProps } from "@elliemae/ds-props-helpers";
6
- import { mergeRefs } from "@elliemae/ds-system";
7
6
  import { useFloatingContext, FloatingWrapper } from "@elliemae/ds-floating-context";
8
7
  import ComboBoxContext from "../../ComboBoxCTX.js";
9
8
  import { StyledContainer, StyledPopperWrapper } from "./styled.js";
@@ -13,7 +12,6 @@ import { ComboboxDataTestid } from "../../ComboboxDataTestids.js";
13
12
  import { LiveRegion } from "../LiveRegion.js";
14
13
  import { useOnClickOutside } from "../../config/useClickOutside.js";
15
14
  const Container = () => {
16
- const [referenceElement, setReferenceElement] = React2.useState(null);
17
15
  const { props, internalRef, setMenuState, menuState } = useContext(ComboBoxContext);
18
16
  const { inline, startPlacementPreference, placementOrderPreference, isLoading, isSkeleton, applyAriaDisabled } = props;
19
17
  const globalAttributes = useGetGlobalAttributes(props);
@@ -52,16 +50,15 @@ const Container = () => {
52
50
  [startPlacementPreference, placementOrderPreference, correctZIndex, handleCloseMenu, menuState]
53
51
  );
54
52
  const { refs, floatingStyles, context } = useFloatingContext(config);
55
- const comboboxRef = mergeRefs(setReferenceElement, refs.setReference);
56
53
  const hideTooltip = useCallback(() => {
57
54
  setMenuState(false, "blur");
58
55
  }, [setMenuState]);
59
- useOnClickOutside(referenceElement, hideTooltip, refs.floating);
56
+ useOnClickOutside(refs.reference, hideTooltip, refs.floating);
60
57
  return /* @__PURE__ */ jsxs(
61
58
  StyledContainer,
62
59
  {
63
60
  "data-testid": dataTestId ?? ComboboxDataTestid.CONTAINER,
64
- innerRef: comboboxRef,
61
+ innerRef: refs.setReference,
65
62
  className,
66
63
  applyAriaDisabled,
67
64
  ...xStyledProps,
@@ -71,7 +68,7 @@ const Container = () => {
71
68
  /* @__PURE__ */ jsx(LiveRegion, {}),
72
69
  /* @__PURE__ */ jsx(Controls, {}),
73
70
  menuState && inline ? /* @__PURE__ */ jsx(MenuList, {}) : null,
74
- menuState && !inline && referenceElement ? /* @__PURE__ */ createElement(
71
+ menuState && !inline && refs.reference ? /* @__PURE__ */ createElement(
75
72
  FloatingWrapper,
76
73
  {
77
74
  innerRef: refs.setFloating,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/container/Container.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable consistent-return */\n/* eslint-disable complexity */\nimport React, { useCallback, useMemo, useEffect, useContext } from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport { useFloatingContext, FloatingWrapper, type DSHookFloatingContextT } from '@elliemae/ds-floating-context';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { StyledContainer, StyledPopperWrapper } from './styled.js';\nimport { Controls } from '../controls/index.js';\nimport { MenuList } from '../menu-list/index.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { LiveRegion } from '../LiveRegion.js';\nimport { useOnClickOutside } from '../../config/useClickOutside.js';\n\nexport const Container = (): JSX.Element => {\n const [referenceElement, setReferenceElement] = React.useState<HTMLElement | null>(null);\n const { props, internalRef, setMenuState, menuState } = useContext(ComboBoxContext);\n\n const { inline, startPlacementPreference, placementOrderPreference, isLoading, isSkeleton, applyAriaDisabled } =\n props;\n const globalAttributes = useGetGlobalAttributes(props) as ReturnType<typeof useGetGlobalAttributes> & {\n 'data-testid'?: string;\n };\n const { zIndex, ...xStyledProps } = useGetXstyledProps(props);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const correctZIndex = zIndex ? parseInt(zIndex as string, 10) : undefined;\n // Removing possible collisionable props\n const { className, 'data-testid': dataTestId } = globalAttributes;\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n }, []);\n\n const handleCloseMenu = useCallback(() => {\n setMenuState(false, 'blur');\n if (internalRef?.current) internalRef.current.blur();\n }, [internalRef, setMenuState]);\n\n useEffect(() => {\n const closeMenuOnWindowBlur = () => {\n if (menuState) setMenuState(false, 'blur');\n };\n\n window.addEventListener('blur', closeMenuOnWindowBlur);\n\n return () => {\n window.removeEventListener('blur', closeMenuOnWindowBlur);\n };\n }, [menuState, setMenuState]);\n\n const config = useMemo(\n () => ({\n placement: 'bottom' as DSHookFloatingContextT.PopperPlacementsT,\n withoutAnimation: true,\n startPlacementPreference,\n placementOrderPreference,\n zIndex: correctZIndex,\n customOffset: [0, 5] as [number, number],\n handleCloseMenu,\n portalDOMContainer: document.body,\n externallyControlledIsOpen: menuState,\n }),\n [startPlacementPreference, placementOrderPreference, correctZIndex, handleCloseMenu, menuState],\n );\n\n const { refs, floatingStyles, context } = useFloatingContext(config);\n\n const comboboxRef = mergeRefs(setReferenceElement, refs.setReference);\n\n const hideTooltip = useCallback(() => {\n setMenuState(false, 'blur');\n }, [setMenuState]);\n\n useOnClickOutside(referenceElement, hideTooltip, refs.floating);\n\n return (\n <StyledContainer\n data-testid={dataTestId ?? ComboboxDataTestid.CONTAINER}\n innerRef={comboboxRef}\n className={className}\n applyAriaDisabled={applyAriaDisabled}\n {...xStyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <LiveRegion />\n <Controls />\n\n {menuState && inline ? <MenuList /> : null}\n {menuState && !inline && referenceElement ? (\n <FloatingWrapper\n innerRef={refs.setFloating}\n floatingStyles={floatingStyles}\n isOpen={menuState}\n context={context}\n {...props.popperProps}\n key={`${isLoading}${isSkeleton}`} // to force remount when loading/skeleton changes\n >\n <StyledPopperWrapper tabIndex={-1} onMouseDown={handleMouseDown} applyAriaDisabled={applyAriaDisabled}>\n <MenuList />\n </StyledPopperWrapper>\n </FloatingWrapper>\n ) : null}\n </StyledContainer>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC4EnB,SASE,KATF;AAcI;AAxFR,OAAOA,UAAS,aAAa,SAAS,WAAW,kBAAkB;AACnE,SAAS,wBAAwB,oBAAoB,qBAAqB;AAC1E,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB,uBAAoD;AACjF,OAAO,qBAAqB;AAC5B,SAAS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AS;AAAA,MAC7B,4BAA4B;AAAA,IAC9B;AAAA,IACA,CAAC,0BAA0B,0BAA0B,eAAe,iBAAiB,SAAS;AAAA,EAChG;AAEA,QAAM,EAAE,MAAM,gBAAgB,QAAQ,IAAI,mBAAmB,MAAM;AAEnE,QAAM,cAAc,UAAU,qBAAqB,KAAK,YAAY;AAEpE,QAAM,cAAc,YAAY,MAAM;AACpC,iBAAa,OAAO,MAAM;AAAA,EAC5B,GAAG,CAAC,YAAY,CAAC;AAEjB,oBAAkB,kBAAkB,aAAa,KAAK,QAAQ;AAE9D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,cAAc,mBAAmB;AAAA,MAC9C,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MAEA;AAAA,4BAAC,cAAW;AAAA,QACZ,oBAAC,YAAS;AAAA,QAET,aAAa,SAAS,oBAAC,YAAS,IAAK;AAAA,QACrC,aAAa,CAAC,UAAU,mBACvB;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf;AAAA,YACA,QAAQ;AAAA,YACR;AAAA,YACC,GAAG,MAAM;AAAA,YACV,KAAK,GAAG,SAAS,GAAG,UAAU;AAAA;AAAA,UAE9B,oBAAC,uBAAoB,UAAU,IAAI,aAAa,iBAAiB,mBAC/D,8BAAC,YAAS,GACZ;AAAA,QACF,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;",
6
- "names": ["React"]
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable consistent-return */\n/* eslint-disable complexity */\nimport React, { useCallback, useMemo, useEffect, useContext } from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { useFloatingContext, FloatingWrapper, type DSHookFloatingContextT } from '@elliemae/ds-floating-context';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { StyledContainer, StyledPopperWrapper } from './styled.js';\nimport { Controls } from '../controls/index.js';\nimport { MenuList } from '../menu-list/index.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { LiveRegion } from '../LiveRegion.js';\nimport { useOnClickOutside } from '../../config/useClickOutside.js';\n\nexport const Container = (): JSX.Element => {\n const { props, internalRef, setMenuState, menuState } = useContext(ComboBoxContext);\n\n const { inline, startPlacementPreference, placementOrderPreference, isLoading, isSkeleton, applyAriaDisabled } =\n props;\n const globalAttributes = useGetGlobalAttributes(props) as ReturnType<typeof useGetGlobalAttributes> & {\n 'data-testid'?: string;\n };\n const { zIndex, ...xStyledProps } = useGetXstyledProps(props);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const correctZIndex = zIndex ? parseInt(zIndex as string, 10) : undefined;\n // Removing possible collisionable props\n const { className, 'data-testid': dataTestId } = globalAttributes;\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n }, []);\n\n const handleCloseMenu = useCallback(() => {\n setMenuState(false, 'blur');\n if (internalRef?.current) internalRef.current.blur();\n }, [internalRef, setMenuState]);\n\n useEffect(() => {\n const closeMenuOnWindowBlur = () => {\n if (menuState) setMenuState(false, 'blur');\n };\n\n window.addEventListener('blur', closeMenuOnWindowBlur);\n\n return () => {\n window.removeEventListener('blur', closeMenuOnWindowBlur);\n };\n }, [menuState, setMenuState]);\n\n const config = useMemo(\n () => ({\n placement: 'bottom' as DSHookFloatingContextT.PopperPlacementsT,\n withoutAnimation: true,\n startPlacementPreference,\n placementOrderPreference,\n zIndex: correctZIndex,\n customOffset: [0, 5] as [number, number],\n handleCloseMenu,\n portalDOMContainer: document.body,\n externallyControlledIsOpen: menuState,\n }),\n [startPlacementPreference, placementOrderPreference, correctZIndex, handleCloseMenu, menuState],\n );\n\n const { refs, floatingStyles, context } = useFloatingContext(config);\n\n const hideTooltip = useCallback(() => {\n setMenuState(false, 'blur');\n }, [setMenuState]);\n\n useOnClickOutside(refs.reference, hideTooltip, refs.floating);\n\n return (\n <StyledContainer\n data-testid={dataTestId ?? ComboboxDataTestid.CONTAINER}\n innerRef={refs.setReference}\n className={className}\n applyAriaDisabled={applyAriaDisabled}\n {...xStyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <LiveRegion />\n <Controls />\n\n {menuState && inline ? <MenuList /> : null}\n {menuState && !inline && refs.reference ? (\n <FloatingWrapper\n innerRef={refs.setFloating}\n floatingStyles={floatingStyles}\n isOpen={menuState}\n context={context}\n {...props.popperProps}\n key={`${isLoading}${isSkeleton}`} // to force remount when loading/skeleton changes\n >\n <StyledPopperWrapper tabIndex={-1} onMouseDown={handleMouseDown} applyAriaDisabled={applyAriaDisabled}>\n <MenuList />\n </StyledPopperWrapper>\n </FloatingWrapper>\n ) : null}\n </StyledContainer>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACwEnB,SASE,KATF;AAcI;AApFR,SAAgB,aAAa,SAAS,WAAW,kBAAkB;AACnE,SAAS,wBAAwB,oBAAoB,qBAAqB;AAC1E,SAAS,oBAAoB,uBAAoD;AACjF,OAAO,qBAAqB;AAC5B,SAAS,iBAAiB,2BAA2B;AACrD,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,0BAA0B;AACnC,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAE3B,MAAM,YAAY,MAAmB;AAC1C,QAAM,EAAE,OAAO,aAAa,cAAc,UAAU,IAAI,WAAW,eAAe;AAElF,QAAM,EAAE,QAAQ,0BAA0B,0BAA0B,WAAW,YAAY,kBAAkB,IAC3G;AACF,QAAM,mBAAmB,uBAAuB,KAAK;AAGrD,QAAM,EAAE,QAAQ,GAAG,aAAa,IAAI,mBAAmB,KAAK;AAC5D,QAAM,EAAE,eAAe,uBAAuB,IAAI,cAAc,KAAK;AAErE,QAAM,gBAAgB,SAAS,SAAS,QAAkB,EAAE,IAAI;AAEhE,QAAM,EAAE,WAAW,eAAe,WAAW,IAAI;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U,KAAK,YAC5B;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf;AAAA,YACA,QAAQ;AAAA,YACR;AAAA,YACC,GAAG,MAAM;AAAA,YACV,KAAK,GAAG,SAAS,GAAG,UAAU;AAAA;AAAA,UAE9B,oBAAC,uBAAoB,UAAU,IAAI,aAAa,iBAAiB,mBAC/D,8BAAC,YAAS,GACZ;AAAA,QACF,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;",
6
+ "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-form-combobox",
3
- "version": "3.55.0-next.24",
3
+ "version": "3.55.0-next.25",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Controlled Form Combobox",
6
6
  "files": [
@@ -38,18 +38,18 @@
38
38
  "dependencies": {
39
39
  "react-virtual": "~2.10.4",
40
40
  "uid": "~2.0.1",
41
- "@elliemae/ds-button-v2": "3.55.0-next.24",
42
- "@elliemae/ds-circular-progress-indicator": "3.55.0-next.24",
43
- "@elliemae/ds-fast-list": "3.55.0-next.24",
44
- "@elliemae/ds-floating-context": "3.55.0-next.24",
45
- "@elliemae/ds-form-checkbox": "3.55.0-next.24",
46
- "@elliemae/ds-grid": "3.55.0-next.24",
47
- "@elliemae/ds-menu-items": "3.55.0-next.24",
48
- "@elliemae/ds-icons": "3.55.0-next.24",
49
- "@elliemae/ds-pills-v2": "3.55.0-next.24",
50
- "@elliemae/ds-props-helpers": "3.55.0-next.24",
51
- "@elliemae/ds-system": "3.55.0-next.24",
52
- "@elliemae/ds-truncated-tooltip-text": "3.55.0-next.24"
41
+ "@elliemae/ds-button-v2": "3.55.0-next.25",
42
+ "@elliemae/ds-circular-progress-indicator": "3.55.0-next.25",
43
+ "@elliemae/ds-form-checkbox": "3.55.0-next.25",
44
+ "@elliemae/ds-fast-list": "3.55.0-next.25",
45
+ "@elliemae/ds-floating-context": "3.55.0-next.25",
46
+ "@elliemae/ds-grid": "3.55.0-next.25",
47
+ "@elliemae/ds-pills-v2": "3.55.0-next.25",
48
+ "@elliemae/ds-menu-items": "3.55.0-next.25",
49
+ "@elliemae/ds-props-helpers": "3.55.0-next.25",
50
+ "@elliemae/ds-system": "3.55.0-next.25",
51
+ "@elliemae/ds-icons": "3.55.0-next.25",
52
+ "@elliemae/ds-truncated-tooltip-text": "3.55.0-next.25"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@elliemae/pui-cli": "9.0.0-next.65",
@@ -57,9 +57,9 @@
57
57
  "jest": "~29.7.0",
58
58
  "styled-components": "~5.3.9",
59
59
  "styled-system": "^5.1.5",
60
- "@elliemae/ds-form-helpers-mask-hooks": "3.55.0-next.24",
61
- "@elliemae/ds-monorepo-devops": "3.55.0-next.24",
62
- "@elliemae/ds-test-utils": "3.55.0-next.24"
60
+ "@elliemae/ds-test-utils": "3.55.0-next.25",
61
+ "@elliemae/ds-monorepo-devops": "3.55.0-next.25",
62
+ "@elliemae/ds-form-helpers-mask-hooks": "3.55.0-next.25"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "@elliemae/pui-theme": "~2.13.0",