@elliemae/ds-form-combobox 3.53.0-alpha.1 → 3.53.0-alpha.2

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 (94) hide show
  1. package/dist/cjs/constants/index.js +66 -0
  2. package/dist/cjs/constants/index.js.map +7 -0
  3. package/dist/cjs/index.js +15 -5
  4. package/dist/cjs/index.js.map +2 -2
  5. package/dist/cjs/parts/DropdownIndicator.js +10 -1
  6. package/dist/cjs/parts/DropdownIndicator.js.map +2 -2
  7. package/dist/cjs/parts/Section.js +82 -34
  8. package/dist/cjs/parts/Section.js.map +3 -3
  9. package/dist/cjs/parts/container/Container.js +18 -17
  10. package/dist/cjs/parts/container/Container.js.map +3 -3
  11. package/dist/cjs/parts/controls/Controls.js +10 -5
  12. package/dist/cjs/parts/controls/Controls.js.map +2 -2
  13. package/dist/cjs/parts/controls-input/ControlsInput.js +12 -6
  14. package/dist/cjs/parts/controls-input/ControlsInput.js.map +2 -2
  15. package/dist/cjs/parts/controls-input/styled.js +1 -0
  16. package/dist/cjs/parts/controls-input/styled.js.map +2 -2
  17. package/dist/cjs/parts/controls-input/useControlsInput.js +11 -11
  18. package/dist/cjs/parts/controls-input/useControlsInput.js.map +2 -2
  19. package/dist/cjs/parts/controls-input/useKeyboardNavigation.js +8 -2
  20. package/dist/cjs/parts/controls-input/useKeyboardNavigation.js.map +2 -2
  21. package/dist/cjs/parts/controls-input/useMaskedOnChange.js +1 -1
  22. package/dist/cjs/parts/controls-input/useMaskedOnChange.js.map +2 -2
  23. package/dist/cjs/parts/menu-list/LoadingContainer.js +6 -1
  24. package/dist/cjs/parts/menu-list/LoadingContainer.js.map +2 -2
  25. package/dist/cjs/parts/menu-list/MenuList.js +36 -21
  26. package/dist/cjs/parts/menu-list/MenuList.js.map +2 -2
  27. package/dist/cjs/parts/menu-list/SkeletonContainer.js +12 -2
  28. package/dist/cjs/parts/menu-list/SkeletonContainer.js.map +2 -2
  29. package/dist/cjs/parts/menu-list/styled.js +1 -1
  30. package/dist/cjs/parts/menu-list/styled.js.map +1 -1
  31. package/dist/cjs/parts/menu-list/useItemRenderer.js +32 -5
  32. package/dist/cjs/parts/menu-list/useItemRenderer.js.map +3 -3
  33. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  34. package/dist/esm/constants/index.js +36 -0
  35. package/dist/esm/constants/index.js.map +7 -0
  36. package/dist/esm/index.js +15 -4
  37. package/dist/esm/index.js.map +2 -2
  38. package/dist/esm/parts/DropdownIndicator.js +10 -1
  39. package/dist/esm/parts/DropdownIndicator.js.map +2 -2
  40. package/dist/esm/parts/Section.js +82 -34
  41. package/dist/esm/parts/Section.js.map +2 -2
  42. package/dist/esm/parts/container/Container.js +13 -12
  43. package/dist/esm/parts/container/Container.js.map +3 -3
  44. package/dist/esm/parts/controls/Controls.js +12 -7
  45. package/dist/esm/parts/controls/Controls.js.map +2 -2
  46. package/dist/esm/parts/controls-input/ControlsInput.js +14 -8
  47. package/dist/esm/parts/controls-input/ControlsInput.js.map +2 -2
  48. package/dist/esm/parts/controls-input/styled.js +1 -0
  49. package/dist/esm/parts/controls-input/styled.js.map +2 -2
  50. package/dist/esm/parts/controls-input/useControlsInput.js +12 -12
  51. package/dist/esm/parts/controls-input/useControlsInput.js.map +2 -2
  52. package/dist/esm/parts/controls-input/useKeyboardNavigation.js +8 -2
  53. package/dist/esm/parts/controls-input/useKeyboardNavigation.js.map +2 -2
  54. package/dist/esm/parts/controls-input/useMaskedOnChange.js +1 -1
  55. package/dist/esm/parts/controls-input/useMaskedOnChange.js.map +2 -2
  56. package/dist/esm/parts/menu-list/LoadingContainer.js +6 -1
  57. package/dist/esm/parts/menu-list/LoadingContainer.js.map +2 -2
  58. package/dist/esm/parts/menu-list/MenuList.js +37 -22
  59. package/dist/esm/parts/menu-list/MenuList.js.map +2 -2
  60. package/dist/esm/parts/menu-list/SkeletonContainer.js +12 -2
  61. package/dist/esm/parts/menu-list/SkeletonContainer.js.map +2 -2
  62. package/dist/esm/parts/menu-list/styled.js +1 -1
  63. package/dist/esm/parts/menu-list/styled.js.map +1 -1
  64. package/dist/esm/parts/menu-list/useItemRenderer.js +32 -5
  65. package/dist/esm/parts/menu-list/useItemRenderer.js.map +2 -2
  66. package/dist/esm/react-desc-prop-types.js.map +2 -2
  67. package/dist/types/ComboBoxCTX.d.ts +0 -1
  68. package/dist/types/constants/index.d.ts +35 -0
  69. package/dist/types/index.d.ts +4 -3
  70. package/dist/types/parts/DropdownIndicator.d.ts +0 -1
  71. package/dist/types/parts/Section.d.ts +4 -0
  72. package/dist/types/parts/container/Container.d.ts +0 -1
  73. package/dist/types/parts/container/styled.d.ts +2 -2
  74. package/dist/types/parts/controls/Controls.d.ts +0 -1
  75. package/dist/types/parts/controls/styled.d.ts +0 -1
  76. package/dist/types/parts/controls-input/ControlsInput.d.ts +0 -1
  77. package/dist/types/parts/controls-input/useControlsInput.d.ts +0 -1
  78. package/dist/types/parts/controls-input/useKeyboardNavigation.d.ts +0 -1
  79. package/dist/types/parts/controls-input/useMaskedOnChange.d.ts +0 -1
  80. package/dist/types/parts/menu-list/LoadingContainer.d.ts +3 -1
  81. package/dist/types/parts/menu-list/MenuList.d.ts +0 -1
  82. package/dist/types/parts/menu-list/SkeletonContainer.d.ts +2 -2
  83. package/dist/types/parts/menu-list/styled.d.ts +0 -1
  84. package/dist/types/parts/menu-list/useItemRenderer.d.ts +1 -2
  85. package/dist/types/parts/multi-selected-values-container/MultiSelectedValuesContainer.d.ts +0 -1
  86. package/dist/types/react-desc-prop-types.d.ts +6 -5
  87. package/dist/types/tests/DSCombobox.exports.test.d.ts +1 -0
  88. package/dist/types/tests/DSCombobox.get-owner-props.test.d.ts +1 -0
  89. package/dist/types/utils/useOnElementResize.d.ts +1 -1
  90. package/package.json +20 -19
  91. package/dist/cjs/tests/utils.js +0 -133
  92. package/dist/cjs/tests/utils.js.map +0 -7
  93. package/dist/esm/tests/utils.js +0 -103
  94. package/dist/esm/tests/utils.js.map +0 -7
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var constants_exports = {};
30
+ __export(constants_exports, {
31
+ DSFormComboboxName: () => DSFormComboboxName,
32
+ FORM_COMBOBOX_DATA_TESTID: () => FORM_COMBOBOX_DATA_TESTID,
33
+ FORM_COMBOBOX_SLOTS: () => FORM_COMBOBOX_SLOTS
34
+ });
35
+ module.exports = __toCommonJS(constants_exports);
36
+ var React = __toESM(require("react"));
37
+ var import_ds_system = require("@elliemae/ds-system");
38
+ const DSFormComboboxName = "DSCombobox";
39
+ const FORM_COMBOBOX_SLOTS = {
40
+ // Same as old container
41
+ ROOT: "root",
42
+ INPUT_WRAPPER: "input-wrapper",
43
+ INPUT: "input",
44
+ DROPDOWN_BUTTON: "dropdown-button",
45
+ FAST_LIST: "fast-list",
46
+ SECTION_WRAPPER: "section-wrapper",
47
+ SECTION_LABEL: "section-label",
48
+ SINGLE_MENU_ITEM: "single-menu-item",
49
+ MULTI_MENU_ITEM: "multi-menu-item",
50
+ LOADING_INDICATOR: "loading-indicator",
51
+ SKELETON_MENU_ITEM: "skeleton-menu-item"
52
+ };
53
+ const FORM_COMBOBOX_DATA_TESTID = {
54
+ ...(0, import_ds_system.slotObjectToDataTestIds)(DSFormComboboxName, FORM_COMBOBOX_SLOTS),
55
+ // legacy data-testid
56
+ CONTROLS_WRAPPER: "combobox-controls-wrapper",
57
+ CONTAINER: "combobox-container",
58
+ INPUT: "combobox-input",
59
+ LIST: "combobox-menu-list",
60
+ NO_MATCHES_FOUND: "combobox-no-matches-found",
61
+ SELECTED_VALUES: "combobox-selected-values",
62
+ DROPDOWN: "combobox-dropdown-btn",
63
+ OPTION: "combobox-option",
64
+ ALLY_SELECTED_VALUES: "combobox-ally-selected-values"
65
+ };
66
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSFormComboboxName = 'DSCombobox';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const FORM_COMBOBOX_SLOTS = {\n // Same as old container\n ROOT: 'root',\n INPUT_WRAPPER: 'input-wrapper',\n INPUT: 'input',\n DROPDOWN_BUTTON: 'dropdown-button',\n FAST_LIST: 'fast-list',\n SECTION_WRAPPER: 'section-wrapper',\n SECTION_LABEL: 'section-label',\n SINGLE_MENU_ITEM: 'single-menu-item',\n MULTI_MENU_ITEM: 'multi-menu-item',\n LOADING_INDICATOR: 'loading-indicator',\n SKELETON_MENU_ITEM: 'skeleton-menu-item',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const FORM_COMBOBOX_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSFormComboboxName, FORM_COMBOBOX_SLOTS),\n // legacy data-testid\n CONTROLS_WRAPPER: 'combobox-controls-wrapper',\n CONTAINER: 'combobox-container',\n INPUT: 'combobox-input',\n LIST: 'combobox-menu-list',\n NO_MATCHES_FOUND: 'combobox-no-matches-found',\n SELECTED_VALUES: 'combobox-selected-values',\n DROPDOWN: 'combobox-dropdown-btn',\n OPTION: 'combobox-option',\n ALLY_SELECTED_VALUES: 'combobox-ally-selected-values',\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,qBAAqB;AAG3B,MAAM,sBAAsB;AAAA;AAAA,EAEjC,MAAM;AAAA,EACN,eAAe;AAAA,EACf,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,WAAW;AAAA,EACX,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,oBAAoB;AACtB;AAGO,MAAM,4BAA4B;AAAA,EACvC,OAAG,0CAAwB,oBAAoB,mBAAmB;AAAA;AAAA,EAElE,kBAAkB;AAAA,EAClB,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AAAA,EACN,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,sBAAsB;AACxB;",
6
+ "names": []
7
+ }
package/dist/cjs/index.js CHANGED
@@ -17,7 +17,6 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
21
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
21
  // If the importer is in node compatibility mode or this is not an ESM
23
22
  // file that has been converted to a CommonJS file using a Babel-
@@ -29,12 +28,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
29
  var index_exports = {};
31
30
  __export(index_exports, {
32
- ComboboxPropTypes: () => import_react_desc_prop_types.ComboboxPropTypes
31
+ ComboboxDataTestid: () => import_ComboboxDataTestids.ComboboxDataTestid,
32
+ ComboboxPropTypes: () => import_react_desc_prop_types.ComboboxPropTypes,
33
+ DSComboBox: () => import_ComboBox.DSComboBox,
34
+ DSComboBoxName: () => import_theming.DSComboBoxName,
35
+ DSComboBoxV3: () => import_ComboBox.DSComboBoxV3,
36
+ DSComboBoxWithSchema: () => import_ComboBox.DSComboBoxWithSchema,
37
+ DSComboboxSlots: () => import_theming.DSComboboxSlots,
38
+ DSFormComboboxName: () => import_constants.DSFormComboboxName,
39
+ FORM_COMBOBOX_DATA_TESTID: () => import_constants.FORM_COMBOBOX_DATA_TESTID,
40
+ FORM_COMBOBOX_SLOTS: () => import_constants.FORM_COMBOBOX_SLOTS,
41
+ offScreenStyle: () => import_ComboBox.offScreenStyle
33
42
  });
34
43
  module.exports = __toCommonJS(index_exports);
35
44
  var React = __toESM(require("react"));
36
- __reExport(index_exports, require("./ComboBox.js"), module.exports);
37
- __reExport(index_exports, require("./theming.js"), module.exports);
38
- __reExport(index_exports, require("./ComboboxDataTestids.js"), module.exports);
45
+ var import_ComboBox = require("./ComboBox.js");
46
+ var import_theming = require("./theming.js");
47
+ var import_constants = require("./constants/index.js");
48
+ var import_ComboboxDataTestids = require("./ComboboxDataTestids.js");
39
49
  var import_react_desc_prop_types = require("./react-desc-prop-types.js");
40
50
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export * from './ComboBox.js';\nexport * from './theming.js';\nexport * from './ComboboxDataTestids.js';\nexport { type DSComboboxT, ComboboxPropTypes } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAAc,0BAAd;AACA,0BAAc,yBADd;AAEA,0BAAc,qCAFd;AAGA,mCAAoD;",
4
+ "sourcesContent": ["export { DSComboBox, DSComboBoxV3, DSComboBoxWithSchema, offScreenStyle } from './ComboBox.js';\nexport { DSComboBoxName, DSComboboxSlots } from './theming.js';\nexport { DSFormComboboxName, FORM_COMBOBOX_DATA_TESTID, FORM_COMBOBOX_SLOTS } from './constants/index.js';\nexport { ComboboxDataTestid } from './ComboboxDataTestids.js';\nexport { type DSComboboxT, ComboboxPropTypes } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,sBAA+E;AAC/E,qBAAgD;AAChD,uBAAmF;AACnF,iCAAmC;AACnC,mCAAoD;",
6
6
  "names": []
7
7
  }
@@ -37,9 +37,14 @@ var import_react = require("react");
37
37
  var import_ds_system = require("@elliemae/ds-system");
38
38
  var import_ds_button_v2 = require("@elliemae/ds-button-v2");
39
39
  var import_ds_icons = require("@elliemae/ds-icons");
40
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
40
41
  var import_ComboBoxCTX = __toESM(require("../ComboBoxCTX.js"));
41
42
  var import_ComboboxDataTestids = require("../ComboboxDataTestids.js");
42
- const StyledDropDownButton = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV2)`
43
+ var import_constants = require("../constants/index.js");
44
+ const StyledDropDownButton = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV2, {
45
+ name: import_constants.DSFormComboboxName,
46
+ slot: import_constants.FORM_COMBOBOX_SLOTS.DROPDOWN_BUTTON
47
+ })`
43
48
  &:focus::after {
44
49
  border: none;
45
50
  }
@@ -55,16 +60,20 @@ const StyledDropDownButton = (0, import_ds_system.styled)(import_ds_button_v2.DS
55
60
  `;
56
61
  const DropdownIndicator = () => {
57
62
  const {
63
+ props,
58
64
  props: { disabled, applyAriaDisabled, readOnly, isMenuOpenableWithReadOnly },
59
65
  menuState,
60
66
  instanceUid
61
67
  } = (0, import_react.useContext)(import_ComboBoxCTX.default);
68
+ const { getOwnerProps, getOwnerPropsArguments } = (0, import_ds_props_helpers.useOwnerProps)(props);
62
69
  const handleOnClick = (0, import_react.useCallback)((e) => {
63
70
  e.preventDefault();
64
71
  }, []);
65
72
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
66
73
  StyledDropDownButton,
67
74
  {
75
+ getOwnerProps,
76
+ getOwnerPropsArguments,
68
77
  onClick: handleOnClick,
69
78
  "data-testid": import_ComboboxDataTestids.ComboboxDataTestid.DROPDOWN,
70
79
  "aria-controls": `combo-listbox-${instanceUid}`,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/parts/DropdownIndicator.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable react/prop-types */\n/* eslint-disable import/no-cycle */\nimport React, { useCallback, useContext } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport ComboBoxContext from '../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\n\nconst StyledDropDownButton = styled(DSButtonV2)<{ applyAriaDisabled: boolean }>`\n &:focus::after {\n border: none;\n }\n &:hover:not(:disabled) {\n background-color: transparent;\n }\n\n & svg {\n fill: ${({ theme, disabled, readOnly, applyAriaDisabled }) =>\n disabled || readOnly || applyAriaDisabled ? theme.colors.neutral['400'] : theme.colors.brand['600']};\n }\n\n ${({ applyAriaDisabled }) => applyAriaDisabled && `cursor: not-allowed`}\n`;\n\nexport const DropdownIndicator = (): JSX.Element => {\n const {\n props: { disabled, applyAriaDisabled, readOnly, isMenuOpenableWithReadOnly },\n menuState,\n instanceUid,\n } = useContext(ComboBoxContext);\n\n const handleOnClick: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void =\n useCallback((e) => {\n e.preventDefault();\n }, []);\n\n return (\n <StyledDropDownButton\n onClick={handleOnClick}\n data-testid={ComboboxDataTestid.DROPDOWN}\n aria-controls={`combo-listbox-${instanceUid}`}\n aria-labelledby=\"combo-label\"\n disabled={disabled}\n aria-disabled={readOnly && !isMenuOpenableWithReadOnly} // button never use readOnly attribute\n aria-expanded={menuState}\n aria-haspopup=\"listbox\"\n aria-hidden\n buttonType=\"icon\"\n tabIndex={-1}\n size=\"s\"\n applyAriaDisabled={applyAriaDisabled}\n >\n <ChevronSmallDown size=\"s\" />\n </StyledDropDownButton>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqDjB;AAnDN,mBAA+C;AAC/C,uBAAuB;AACvB,0BAA2B;AAC3B,sBAAiC;AACjC,yBAA4B;AAC5B,iCAAmC;AAEnC,MAAM,2BAAuB,yBAAO,8BAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YASlC,CAAC,EAAE,OAAO,UAAU,UAAU,kBAAkB,MACtD,YAAY,YAAY,oBAAoB,MAAM,OAAO,QAAQ,KAAK,IAAI,MAAM,OAAO,MAAM,KAAK,CAAC;AAAA;AAAA;AAAA,IAGrG,CAAC,EAAE,kBAAkB,MAAM,qBAAqB,qBAAqB;AAAA;AAGlE,MAAM,oBAAoB,MAAmB;AAClD,QAAM;AAAA,IACJ,OAAO,EAAE,UAAU,mBAAmB,UAAU,2BAA2B;AAAA,IAC3E;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,mBAAAA,OAAe;AAE9B,QAAM,oBACJ,0BAAY,CAAC,MAAM;AACjB,MAAE,eAAe;AAAA,EACnB,GAAG,CAAC,CAAC;AAEP,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAS;AAAA,MACT,eAAa,8CAAmB;AAAA,MAChC,iBAAe,iBAAiB,WAAW;AAAA,MAC3C,mBAAgB;AAAA,MAChB;AAAA,MACA,iBAAe,YAAY,CAAC;AAAA,MAC5B,iBAAe;AAAA,MACf,iBAAc;AAAA,MACd,eAAW;AAAA,MACX,YAAW;AAAA,MACX,UAAU;AAAA,MACV,MAAK;AAAA,MACL;AAAA,MAEA,sDAAC,oCAAiB,MAAK,KAAI;AAAA;AAAA,EAC7B;AAEJ;",
4
+ "sourcesContent": ["/* eslint-disable react/prop-types */\n/* eslint-disable import/no-cycle */\nimport React, { useCallback, useContext } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport ComboBoxContext from '../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../constants/index.js';\n\nconst StyledDropDownButton = styled(DSButtonV2, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.DROPDOWN_BUTTON,\n})<{ applyAriaDisabled: boolean }>`\n &:focus::after {\n border: none;\n }\n &:hover:not(:disabled) {\n background-color: transparent;\n }\n\n & svg {\n fill: ${({ theme, disabled, readOnly, applyAriaDisabled }) =>\n disabled || readOnly || applyAriaDisabled ? theme.colors.neutral['400'] : theme.colors.brand['600']};\n }\n\n ${({ applyAriaDisabled }) => applyAriaDisabled && `cursor: not-allowed`}\n`;\n\nexport const DropdownIndicator = (): JSX.Element => {\n const {\n props,\n props: { disabled, applyAriaDisabled, readOnly, isMenuOpenableWithReadOnly },\n menuState,\n instanceUid,\n } = useContext(ComboBoxContext);\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const handleOnClick: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void =\n useCallback((e) => {\n e.preventDefault();\n }, []);\n\n return (\n <StyledDropDownButton\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n onClick={handleOnClick}\n data-testid={ComboboxDataTestid.DROPDOWN}\n aria-controls={`combo-listbox-${instanceUid}`}\n aria-labelledby=\"combo-label\"\n disabled={disabled}\n aria-disabled={readOnly && !isMenuOpenableWithReadOnly} // button never use readOnly attribute\n aria-expanded={menuState}\n aria-haspopup=\"listbox\"\n aria-hidden\n buttonType=\"icon\"\n tabIndex={-1}\n size=\"s\"\n applyAriaDisabled={applyAriaDisabled}\n >\n <ChevronSmallDown size=\"s\" />\n </StyledDropDownButton>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+DjB;AA7DN,mBAA+C;AAC/C,uBAAuB;AACvB,0BAA2B;AAC3B,sBAAiC;AACjC,8BAA8B;AAC9B,yBAA4B;AAC5B,iCAAmC;AACnC,uBAAwD;AAExD,MAAM,2BAAuB,yBAAO,gCAAY;AAAA,EAC9C,MAAM;AAAA,EACN,MAAM,qCAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YASW,CAAC,EAAE,OAAO,UAAU,UAAU,kBAAkB,MACtD,YAAY,YAAY,oBAAoB,MAAM,OAAO,QAAQ,KAAK,IAAI,MAAM,OAAO,MAAM,KAAK,CAAC;AAAA;AAAA;AAAA,IAGrG,CAAC,EAAE,kBAAkB,MAAM,qBAAqB,qBAAqB;AAAA;AAGlE,MAAM,oBAAoB,MAAmB;AAClD,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,UAAU,mBAAmB,UAAU,2BAA2B;AAAA,IAC3E;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,mBAAAA,OAAe;AAE9B,QAAM,EAAE,eAAe,uBAAuB,QAAI,uCAAc,KAAK;AAErE,QAAM,oBACJ,0BAAY,CAAC,MAAM;AACjB,MAAE,eAAe;AAAA,EACnB,GAAG,CAAC,CAAC;AAEP,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,eAAa,8CAAmB;AAAA,MAChC,iBAAe,iBAAiB,WAAW;AAAA,MAC3C,mBAAgB;AAAA,MAChB;AAAA,MACA,iBAAe,YAAY,CAAC;AAAA,MAC5B,iBAAe;AAAA,MACf,iBAAc;AAAA,MACd,eAAW;AAAA,MACX,YAAW;AAAA,MACX,UAAU;AAAA,MACV,MAAK;AAAA,MACL;AAAA,MAEA,sDAAC,oCAAiB,MAAK,KAAI;AAAA;AAAA,EAC7B;AAEJ;",
6
6
  "names": ["ComboBoxContext"]
7
7
  }
@@ -40,13 +40,14 @@ var import_ds_menu_items = require("@elliemae/ds-menu-items");
40
40
  var import_constants = require("../constants.js");
41
41
  var import_ComboboxDataTestids = require("../ComboboxDataTestids.js");
42
42
  var import_listHelper = require("../utils/listHelper.js");
43
- const StyledSectionWrapper = (0, import_ds_system.styled)("section")`
43
+ var import_constants2 = require("../constants/index.js");
44
+ const StyledSectionWrapper = (0, import_ds_system.styled)("section", { name: import_constants2.DSFormComboboxName, slot: import_constants2.FORM_COMBOBOX_SLOTS.SECTION_WRAPPER })`
44
45
  list-style: none;
45
46
  min-height: 24px;
46
47
  display: grid;
47
48
  align-items: center;
48
49
  `;
49
- const StyledSectionLabel = (0, import_ds_system.styled)("header")`
50
+ const StyledSectionLabel = (0, import_ds_system.styled)("header", { name: import_constants2.DSFormComboboxName, slot: import_constants2.FORM_COMBOBOX_SLOTS.SECTION_LABEL })`
50
51
  display: flex;
51
52
  align-items: center;
52
53
  padding: 0px 16px;
@@ -54,39 +55,86 @@ const StyledSectionLabel = (0, import_ds_system.styled)("header")`
54
55
  font-size: 1rem;
55
56
  color: neutral-500;
56
57
  `;
58
+ const StyledSingleMenuItem = (0, import_ds_system.styled)(import_ds_menu_items.SingleMenuItem, {
59
+ name: import_constants2.DSFormComboboxName,
60
+ slot: import_constants2.FORM_COMBOBOX_SLOTS.SINGLE_MENU_ITEM
61
+ })``;
57
62
  const Section = import_react2.default.memo((props) => {
58
- const { label, wrapperStyles, focusOptionIdx, selectedValues, innerRef, handleOnMouseDown, options, handleClick } = props;
63
+ const {
64
+ label,
65
+ wrapperStyles,
66
+ focusOptionIdx,
67
+ selectedValues,
68
+ innerRef,
69
+ handleOnMouseDown,
70
+ options,
71
+ handleClick,
72
+ getOwnerProps,
73
+ getOwnerPropsArguments
74
+ } = props;
59
75
  const id = `${label.replace(/ /g, "")}-section`;
60
- const CBItem = Array.isArray(selectedValues) ? import_ds_menu_items.MultiMenuItem : import_ds_menu_items.SingleMenuItem;
61
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(StyledSectionWrapper, { role: "group", "aria-labelledby": id, style: wrapperStyles, innerRef, children: [
62
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledSectionLabel, { id, role: "presentation", children: label }),
63
- options?.map((option) => {
64
- const { dsId, type, value, label: optionLabel, readOnly, disabled, applyAriaDisabled, ...rest } = option;
65
- if (type === import_constants.MENU_OPTION_TYPES.SEPARATOR) {
66
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_menu_items.Separator, {}, dsId);
67
- }
68
- return /* @__PURE__ */ (0, import_react.createElement)(
69
- CBItem,
70
- {
71
- value,
72
- label: optionLabel,
73
- dataTestid: import_ComboboxDataTestids.ComboboxDataTestid.OPTION,
74
- disabled,
75
- applyAriaDisabled: applyAriaDisabled || readOnly,
76
- onClick: (e) => {
77
- if (applyAriaDisabled) return;
78
- handleClick(option, e);
79
- },
80
- onMouseDown: handleOnMouseDown,
81
- isActive: dsId === focusOptionIdx,
82
- isSelected: (0, import_listHelper.isSelected)(selectedValues, option),
83
- tabIndex: -1,
84
- ...rest,
85
- key: option.dsId,
86
- dsId: option.dsId
87
- }
88
- );
89
- })
90
- ] });
76
+ const CBItem = Array.isArray(selectedValues) ? import_ds_menu_items.MultiMenuItem : StyledSingleMenuItem;
77
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
78
+ StyledSectionWrapper,
79
+ {
80
+ role: "group",
81
+ "aria-labelledby": id,
82
+ style: wrapperStyles,
83
+ innerRef,
84
+ getOwnerProps,
85
+ getOwnerPropsArguments,
86
+ children: [
87
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
88
+ StyledSectionLabel,
89
+ {
90
+ id,
91
+ role: "presentation",
92
+ getOwnerProps,
93
+ getOwnerPropsArguments,
94
+ children: label
95
+ }
96
+ ),
97
+ options?.map((option) => {
98
+ const {
99
+ dsId,
100
+ type,
101
+ value,
102
+ label: optionLabel,
103
+ readOnly,
104
+ disabled,
105
+ applyAriaDisabled,
106
+ render,
107
+ ...rest
108
+ } = option;
109
+ if (type === import_constants.MENU_OPTION_TYPES.SEPARATOR) {
110
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_menu_items.Separator, {}, dsId);
111
+ }
112
+ return /* @__PURE__ */ (0, import_react.createElement)(
113
+ CBItem,
114
+ {
115
+ getOwnerProps,
116
+ getOwnerPropsArguments,
117
+ value,
118
+ label: optionLabel,
119
+ dataTestid: import_ComboboxDataTestids.ComboboxDataTestid.OPTION,
120
+ disabled,
121
+ applyAriaDisabled: applyAriaDisabled || readOnly,
122
+ onClick: (e) => {
123
+ if (applyAriaDisabled) return;
124
+ handleClick(option, e);
125
+ },
126
+ onMouseDown: handleOnMouseDown,
127
+ isActive: dsId === focusOptionIdx,
128
+ isSelected: (0, import_listHelper.isSelected)(selectedValues, option),
129
+ tabIndex: -1,
130
+ ...rest,
131
+ key: option.dsId,
132
+ dsId: option.dsId
133
+ }
134
+ );
135
+ })
136
+ ]
137
+ }
138
+ );
91
139
  });
92
140
  //# sourceMappingURL=Section.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/parts/Section.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { SingleMenuItem, MultiMenuItem, Separator } from '@elliemae/ds-menu-items';\nimport { MENU_OPTION_TYPES } from '../constants.js';\n\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { isSelected } from '../utils/listHelper.js';\n\ninterface SectionProps {\n label: string;\n wrapperStyles: React.CSSProperties;\n innerRef: (instance: HTMLDivElement | null) => void;\n options: DSComboboxT.ItemOption[] | DSComboboxT.ItemSeparatorOptions[];\n handleClick: (option: DSComboboxT.ItemOption, e: React.MouseEvent<HTMLInputElement>) => void;\n handleOnMouseDown: (e: React.MouseEvent<HTMLLIElement>) => void;\n focusOptionIdx: string;\n selectedValues: DSComboboxT.SelectedOptionsT;\n}\n\nconst StyledSectionWrapper = styled('section')`\n list-style: none;\n min-height: 24px;\n display: grid;\n align-items: center;\n`;\n\nconst StyledSectionLabel = styled('header')`\n display: flex;\n align-items: center;\n padding: 0px 16px;\n min-height: 24px;\n font-size: 1rem;\n color: neutral-500;\n`;\n\nexport const Section = React.memo((props: SectionProps) => {\n const { label, wrapperStyles, focusOptionIdx, selectedValues, innerRef, handleOnMouseDown, options, handleClick } =\n props;\n const id = `${label.replace(/ /g, '')}-section`;\n\n const CBItem = Array.isArray(selectedValues) ? MultiMenuItem : SingleMenuItem;\n\n return (\n <StyledSectionWrapper role=\"group\" aria-labelledby={id} style={wrapperStyles} innerRef={innerRef}>\n <StyledSectionLabel id={id} role=\"presentation\">\n {label}\n </StyledSectionLabel>\n {options?.map((option) => {\n const { dsId, type, value, label: optionLabel, readOnly, disabled, applyAriaDisabled, ...rest } = option;\n\n if (type === MENU_OPTION_TYPES.SEPARATOR) {\n return <Separator key={dsId} />;\n }\n\n return (\n <CBItem\n value={value}\n label={optionLabel}\n dataTestid={ComboboxDataTestid.OPTION}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled || readOnly}\n onClick={(e: React.MouseEvent<HTMLInputElement>) => {\n if (applyAriaDisabled) return;\n handleClick(option, e);\n }}\n onMouseDown={handleOnMouseDown}\n isActive={dsId === focusOptionIdx}\n isSelected={isSelected(selectedValues, option)}\n tabIndex={-1}\n {...rest}\n key={option.dsId}\n dsId={option.dsId}\n />\n );\n })}\n </StyledSectionWrapper>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD4CnB;AAYM;AAxDV,IAAAA,gBAAkB;AAClB,uBAAuB;AACvB,2BAAyD;AACzD,uBAAkC;AAElC,iCAAmC;AAEnC,wBAA2B;AAa3B,MAAM,2BAAuB,yBAAO,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAO7C,MAAM,yBAAqB,yBAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASnC,MAAM,UAAU,cAAAC,QAAM,KAAK,CAAC,UAAwB;AACzD,QAAM,EAAE,OAAO,eAAe,gBAAgB,gBAAgB,UAAU,mBAAmB,SAAS,YAAY,IAC9G;AACF,QAAM,KAAK,GAAG,MAAM,QAAQ,MAAM,EAAE,CAAC;AAErC,QAAM,SAAS,MAAM,QAAQ,cAAc,IAAI,qCAAgB;AAE/D,SACE,6CAAC,wBAAqB,MAAK,SAAQ,mBAAiB,IAAI,OAAO,eAAe,UAC5E;AAAA,gDAAC,sBAAmB,IAAQ,MAAK,gBAC9B,iBACH;AAAA,IACC,SAAS,IAAI,CAAC,WAAW;AACxB,YAAM,EAAE,MAAM,MAAM,OAAO,OAAO,aAAa,UAAU,UAAU,mBAAmB,GAAG,KAAK,IAAI;AAElG,UAAI,SAAS,mCAAkB,WAAW;AACxC,eAAO,4CAAC,oCAAe,IAAM;AAAA,MAC/B;AAEA,aACE;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,OAAO;AAAA,UACP,YAAY,8CAAmB;AAAA,UAC/B;AAAA,UACA,mBAAmB,qBAAqB;AAAA,UACxC,SAAS,CAAC,MAA0C;AAClD,gBAAI,kBAAmB;AACvB,wBAAY,QAAQ,CAAC;AAAA,UACvB;AAAA,UACA,aAAa;AAAA,UACb,UAAU,SAAS;AAAA,UACnB,gBAAY,8BAAW,gBAAgB,MAAM;AAAA,UAC7C,UAAU;AAAA,UACT,GAAG;AAAA,UACJ,KAAK,OAAO;AAAA,UACZ,MAAM,OAAO;AAAA;AAAA,MACf;AAAA,IAEJ,CAAC;AAAA,KACH;AAEJ,CAAC;",
6
- "names": ["import_react", "React"]
4
+ "sourcesContent": ["import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { SingleMenuItem, MultiMenuItem, Separator } from '@elliemae/ds-menu-items';\n\nimport { MENU_OPTION_TYPES } from '../constants.js';\n\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { isSelected } from '../utils/listHelper.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../constants/index.js';\n\ninterface SectionProps {\n label: string;\n wrapperStyles: React.CSSProperties;\n innerRef: (instance: HTMLDivElement | null) => void;\n options: DSComboboxT.ItemOption[] | DSComboboxT.ItemSeparatorOptions[];\n handleClick: (option: DSComboboxT.ItemOption, e: React.MouseEvent<HTMLInputElement>) => void;\n handleOnMouseDown: (e: React.MouseEvent<HTMLLIElement>) => void;\n focusOptionIdx: string;\n selectedValues: DSComboboxT.SelectedOptionsT;\n getOwnerProps: () => object;\n getOwnerPropsArguments?: () => { index: number };\n}\n\nconst StyledSectionWrapper = styled('section', { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_WRAPPER })`\n list-style: none;\n min-height: 24px;\n display: grid;\n align-items: center;\n`;\n\nconst StyledSectionLabel = styled('header', { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_LABEL })`\n display: flex;\n align-items: center;\n padding: 0px 16px;\n min-height: 24px;\n font-size: 1rem;\n color: neutral-500;\n`;\n\nconst StyledSingleMenuItem = styled(SingleMenuItem, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.SINGLE_MENU_ITEM,\n})``;\n\nexport const Section = React.memo((props: SectionProps) => {\n const {\n label,\n wrapperStyles,\n focusOptionIdx,\n selectedValues,\n innerRef,\n handleOnMouseDown,\n options,\n handleClick,\n getOwnerProps,\n getOwnerPropsArguments,\n } = props;\n const id = `${label.replace(/ /g, '')}-section`;\n const CBItem = Array.isArray(selectedValues) ? MultiMenuItem : StyledSingleMenuItem;\n\n return (\n <StyledSectionWrapper\n role=\"group\"\n aria-labelledby={id}\n style={wrapperStyles}\n innerRef={innerRef}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledSectionLabel\n id={id}\n role=\"presentation\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {label}\n </StyledSectionLabel>\n {options?.map((option) => {\n const {\n dsId,\n type,\n value,\n label: optionLabel,\n readOnly,\n disabled,\n applyAriaDisabled,\n render,\n ...rest\n } = option;\n\n if (type === MENU_OPTION_TYPES.SEPARATOR) {\n return <Separator key={dsId} />;\n }\n\n return (\n <CBItem\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n value={value}\n label={optionLabel}\n dataTestid={ComboboxDataTestid.OPTION}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled || readOnly}\n onClick={(e: React.MouseEvent<HTMLInputElement>) => {\n if (applyAriaDisabled) return;\n handleClick(option, e);\n }}\n onMouseDown={handleOnMouseDown}\n isActive={dsId === focusOptionIdx}\n isSelected={isSelected(selectedValues, option)}\n tabIndex={-1}\n {...rest}\n key={option.dsId}\n dsId={option.dsId}\n />\n );\n })}\n </StyledSectionWrapper>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8DnB;AAkCM;AAhGV,IAAAA,gBAAkB;AAClB,uBAAuB;AACvB,2BAAyD;AAEzD,uBAAkC;AAElC,iCAAmC;AAEnC,wBAA2B;AAC3B,IAAAC,oBAAwD;AAexD,MAAM,2BAAuB,yBAAO,WAAW,EAAE,MAAM,sCAAoB,MAAM,sCAAoB,gBAAgB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAOtH,MAAM,yBAAqB,yBAAO,UAAU,EAAE,MAAM,sCAAoB,MAAM,sCAAoB,cAAc,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASjH,MAAM,2BAAuB,yBAAO,qCAAgB;AAAA,EAClD,MAAM;AAAA,EACN,MAAM,sCAAoB;AAC5B,CAAC;AAEM,MAAM,UAAU,cAAAC,QAAM,KAAK,CAAC,UAAwB;AACzD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,KAAK,GAAG,MAAM,QAAQ,MAAM,EAAE,CAAC;AACrC,QAAM,SAAS,MAAM,QAAQ,cAAc,IAAI,qCAAgB;AAE/D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,mBAAiB;AAAA,MACjB,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,MAAK;AAAA,YACL;AAAA,YACA;AAAA,YAEC;AAAA;AAAA,QACH;AAAA,QACC,SAAS,IAAI,CAAC,WAAW;AACxB,gBAAM;AAAA,YACJ;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,GAAG;AAAA,UACL,IAAI;AAEJ,cAAI,SAAS,mCAAkB,WAAW;AACxC,mBAAO,4CAAC,oCAAe,IAAM;AAAA,UAC/B;AAEA,iBACE;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA;AAAA,cACA,OAAO;AAAA,cACP,YAAY,8CAAmB;AAAA,cAC/B;AAAA,cACA,mBAAmB,qBAAqB;AAAA,cACxC,SAAS,CAAC,MAA0C;AAClD,oBAAI,kBAAmB;AACvB,4BAAY,QAAQ,CAAC;AAAA,cACvB;AAAA,cACA,aAAa;AAAA,cACb,UAAU,SAAS;AAAA,cACnB,gBAAY,8BAAW,gBAAgB,MAAM;AAAA,cAC7C,UAAU;AAAA,cACT,GAAG;AAAA,cACJ,KAAK,OAAO;AAAA,cACZ,MAAM,OAAO;AAAA;AAAA,UACf;AAAA,QAEJ,CAAC;AAAA;AAAA;AAAA,EACH;AAEJ,CAAC;",
6
+ "names": ["import_react", "import_constants", "React"]
7
7
  }
@@ -33,9 +33,9 @@ __export(Container_exports, {
33
33
  module.exports = __toCommonJS(Container_exports);
34
34
  var React = __toESM(require("react"));
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
- var import_react = __toESM(require("react"));
36
+ var import_react = require("react");
37
+ var import_react2 = require("react");
37
38
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
- var import_ds_system = require("@elliemae/ds-system");
39
39
  var import_ds_floating_context = require("@elliemae/ds-floating-context");
40
40
  var import_ComboBoxCTX = __toESM(require("../../ComboBoxCTX.js"));
41
41
  var import_styled = require("./styled.js");
@@ -45,21 +45,21 @@ var import_ComboboxDataTestids = require("../../ComboboxDataTestids.js");
45
45
  var import_LiveRegion = require("../LiveRegion.js");
46
46
  var import_useClickOutside = require("../../config/useClickOutside.js");
47
47
  const Container = () => {
48
- const [referenceElement, setReferenceElement] = import_react.default.useState(null);
49
- const { props, internalRef, setMenuState, menuState } = (0, import_react.useContext)(import_ComboBoxCTX.default);
50
- const { inline, startPlacementPreference, placementOrderPreference, applyAriaDisabled } = props;
48
+ const { props, internalRef, setMenuState, menuState } = (0, import_react2.useContext)(import_ComboBoxCTX.default);
49
+ const { inline, startPlacementPreference, placementOrderPreference, isLoading, isSkeleton, applyAriaDisabled } = props;
51
50
  const globalAttributes = (0, import_ds_props_helpers.useGetGlobalAttributes)(props);
52
51
  const { zIndex, ...xStyledProps } = (0, import_ds_props_helpers.useGetXstyledProps)(props);
52
+ const { getOwnerProps, getOwnerPropsArguments } = (0, import_ds_props_helpers.useOwnerProps)(props);
53
53
  const correctZIndex = zIndex ? parseInt(zIndex, 10) : void 0;
54
54
  const { className, "data-testid": dataTestId } = globalAttributes;
55
- const handleMouseDown = (0, import_react.useCallback)((e) => {
55
+ const handleMouseDown = (0, import_react2.useCallback)((e) => {
56
56
  e.preventDefault();
57
57
  }, []);
58
- const handleCloseMenu = (0, import_react.useCallback)(() => {
58
+ const handleCloseMenu = (0, import_react2.useCallback)(() => {
59
59
  setMenuState(false, "blur");
60
60
  if (internalRef?.current) internalRef.current.blur();
61
61
  }, [internalRef, setMenuState]);
62
- (0, import_react.useEffect)(() => {
62
+ (0, import_react2.useEffect)(() => {
63
63
  const closeMenuOnWindowBlur = () => {
64
64
  if (menuState) setMenuState(false, "blur");
65
65
  };
@@ -68,7 +68,7 @@ const Container = () => {
68
68
  window.removeEventListener("blur", closeMenuOnWindowBlur);
69
69
  };
70
70
  }, [menuState, setMenuState]);
71
- const config = (0, import_react.useMemo)(
71
+ const config = (0, import_react2.useMemo)(
72
72
  () => ({
73
73
  placement: "bottom",
74
74
  withoutAnimation: true,
@@ -77,30 +77,30 @@ const Container = () => {
77
77
  zIndex: correctZIndex,
78
78
  customOffset: [0, 5],
79
79
  handleCloseMenu,
80
- portalDOMContainer: document.body,
81
80
  externallyControlledIsOpen: menuState
82
81
  }),
83
82
  [startPlacementPreference, placementOrderPreference, correctZIndex, handleCloseMenu, menuState]
84
83
  );
85
84
  const { refs, floatingStyles, context } = (0, import_ds_floating_context.useFloatingContext)(config);
86
- const comboboxRef = (0, import_ds_system.mergeRefs)(setReferenceElement, refs.setReference);
87
- const hideTooltip = (0, import_react.useCallback)(() => {
85
+ const hideTooltip = (0, import_react2.useCallback)(() => {
88
86
  setMenuState(false, "blur");
89
87
  }, [setMenuState]);
90
- (0, import_useClickOutside.useOnClickOutside)(referenceElement, hideTooltip, refs.floating);
88
+ (0, import_useClickOutside.useOnClickOutside)(refs.reference, hideTooltip, refs.floating);
91
89
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
92
90
  import_styled.StyledContainer,
93
91
  {
94
92
  "data-testid": dataTestId ?? import_ComboboxDataTestids.ComboboxDataTestid.CONTAINER,
95
- innerRef: comboboxRef,
93
+ innerRef: refs.setReference,
96
94
  className,
97
95
  applyAriaDisabled,
98
96
  ...xStyledProps,
97
+ getOwnerProps,
98
+ getOwnerPropsArguments,
99
99
  children: [
100
100
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LiveRegion.LiveRegion, {}),
101
101
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_controls.Controls, {}),
102
102
  menuState && inline ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_menu_list.MenuList, {}) : null,
103
- menuState && !inline && referenceElement ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
103
+ menuState && !inline && refs.reference ? /* @__PURE__ */ (0, import_react.createElement)(
104
104
  import_ds_floating_context.FloatingWrapper,
105
105
  {
106
106
  innerRef: refs.setFloating,
@@ -108,8 +108,9 @@ const Container = () => {
108
108
  isOpen: menuState,
109
109
  context,
110
110
  ...props.popperProps,
111
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledPopperWrapper, { tabIndex: -1, onMouseDown: handleMouseDown, applyAriaDisabled, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_menu_list.MenuList, {}) })
112
- }
111
+ key: `${isLoading}${isSkeleton}`
112
+ },
113
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledPopperWrapper, { tabIndex: -1, onMouseDown: handleMouseDown, applyAriaDisabled, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_menu_list.MenuList, {}) })
113
114
  ) : null
114
115
  ]
115
116
  }
@@ -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 complexity */\nimport React, { useCallback, useMemo, useEffect, useContext } from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps } 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, applyAriaDisabled } = props;\n const globalAttributes = useGetGlobalAttributes(props) as ReturnType<typeof useGetGlobalAttributes> & {\n 'data-testid'?: string;\n };\n const { zIndex, ...xStyledProps } = useGetXstyledProps(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 >\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 >\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;ADyEnB;AAxEJ,mBAAmE;AACnE,8BAA2D;AAC3D,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,aAAAA,QAAM,SAA6B,IAAI;AACvF,QAAM,EAAE,OAAO,aAAa,cAAc,UAAU,QAAI,yBAAW,mBAAAC,OAAe;AAElF,QAAM,EAAE,QAAQ,0BAA0B,0BAA0B,kBAAkB,IAAI;AAC1F,QAAM,uBAAmB,gDAAuB,KAAK;AAGrD,QAAM,EAAE,QAAQ,GAAG,aAAa,QAAI,4CAAmB,KAAK;AAE5D,QAAM,gBAAgB,SAAS,SAAS,QAAkB,EAAE,IAAI;AAEhE,QAAM,EAAE,WAAW,eAAe,WAAW,IAAI;AACjD,QAAM,sBAAkB,0BAAY,CAAC,MAAwB;AAC3D,MAAE,eAAe;AAAA,EACnB,GAAG,CAAC,CAAC;AAEL,QAAM,sBAAkB,0BAAY,MAAM;AACxC,iBAAa,OAAO,MAAM;AAC1B,QAAI,aAAa,QAAS,aAAY,QAAQ,KAAK;AAAA,EACrD,GAAG,CAAC,aAAa,YAAY,CAAC;AAE9B,8BAAU,MAAM;AACd,UAAM,wBAAwB,MAAM;AAClC,UAAI,UAAW,cAAa,OAAO,MAAM;AAAA,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slint-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 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,YAAuB;ADuEnB;AAcI;AAnFR,IAAAA,gBAAmE;AACnE,8BAA0E;AAC1E,iCAAiF;AACjF,yBAA4B;AAC5B,oBAAqD;AACrD,sBAAyB;AACzB,uBAAyB;AACzB,iCAAmC;AACnC,wBAA2B;AAC3B,6BAAkC;AAE3B,MAAM,YAAY,MAAmB;AAC1C,QAAM,EAAE,OAAO,aAAa,cAAc,UAAU,QAAI,0BAAW,mBAAAC,OAAe;AAElF,QAAM,EAAE,QAAQ,0BAA0B,0BAA0B,WAAW,YAAY,kBAAkB,IAC3G;AACF,QAAM,uB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AC9C,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
  }
@@ -33,17 +33,19 @@ __export(Controls_exports, {
33
33
  module.exports = __toCommonJS(Controls_exports);
34
34
  var React = __toESM(require("react"));
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
- var import_react = require("react");
36
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
37
37
  var import_ds_truncated_tooltip_text = require("@elliemae/ds-truncated-tooltip-text");
38
- var import_DropdownIndicator = require("../DropdownIndicator.js");
39
- var import_ComboboxDataTestids = require("../../ComboboxDataTestids.js");
38
+ var import_react = require("react");
40
39
  var import_ComboBoxCTX = __toESM(require("../../ComboBoxCTX.js"));
41
- var import_styled = require("./styled.js");
42
- var import_multi_selected_values_container = require("../multi-selected-values-container/index.js");
40
+ var import_ComboboxDataTestids = require("../../ComboboxDataTestids.js");
43
41
  var import_ControlsInput = require("../controls-input/ControlsInput.js");
42
+ var import_DropdownIndicator = require("../DropdownIndicator.js");
43
+ var import_multi_selected_values_container = require("../multi-selected-values-container/index.js");
44
+ var import_styled = require("./styled.js");
44
45
  var import_useOnPillsNavigation = require("./useOnPillsNavigation.js");
45
46
  const Controls = () => {
46
47
  const {
48
+ props,
47
49
  props: { inline, disabled, hasError, selectedValues, applyAriaDisabled, readOnly, isMenuOpenableWithReadOnly },
48
50
  selectedOptionsRef,
49
51
  setMenuState,
@@ -57,6 +59,7 @@ const Controls = () => {
57
59
  internalRef,
58
60
  shouldPreventContextMenuOpening
59
61
  } = (0, import_react.useContext)(import_ComboBoxCTX.default);
62
+ const { getOwnerProps, getOwnerPropsArguments } = (0, import_ds_props_helpers.useOwnerProps)(props);
60
63
  const handleOnClick = (0, import_react.useCallback)(() => {
61
64
  if (disabled) return;
62
65
  if (applyAriaDisabled || shouldPreventContextMenuOpening) {
@@ -111,6 +114,8 @@ const Controls = () => {
111
114
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
112
115
  import_styled.StyledControlsWrapper,
113
116
  {
117
+ getOwnerProps,
118
+ getOwnerPropsArguments,
114
119
  innerRef: controlsWrapperRef,
115
120
  readOnly,
116
121
  cols,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/controls/Controls.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport React, { useContext, useMemo, useCallback } from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { DropdownIndicator } from '../DropdownIndicator.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\n\nimport {\n StyledControlsWrapper,\n StyleHeaderActionsSeparator,\n StyledHeaderActionsWrapper,\n StyledSelection,\n StyledSingleSelectWraper,\n} from './styled.js';\nimport { MultiSelectedValuesContainer } from '../multi-selected-values-container/index.js';\nimport { ControlsInput } from '../controls-input/ControlsInput.js';\nimport { useOnPillsNavigation } from './useOnPillsNavigation.js';\nexport const Controls = (): JSX.Element => {\n const {\n props: { inline, disabled, hasError, selectedValues, applyAriaDisabled, readOnly, isMenuOpenableWithReadOnly },\n selectedOptionsRef,\n setMenuState,\n setFocusOptionIdx,\n hasFocus,\n inputValue,\n listRef,\n focusOptionIdx,\n menuState,\n controlsWrapperRef,\n internalRef,\n shouldPreventContextMenuOpening,\n } = useContext(ComboBoxContext);\n\n const handleOnClick = useCallback(() => {\n if (disabled) return;\n if (applyAriaDisabled || shouldPreventContextMenuOpening) {\n internalRef.current?.focus();\n return;\n }\n if (hasFocus && menuState && !inline) {\n setMenuState(false, 'click');\n setFocusOptionIdx('');\n internalRef.current?.blur();\n return;\n }\n internalRef.current?.focus();\n setMenuState(true, 'click');\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n disabled,\n listRef,\n hasFocus,\n menuState,\n inline,\n setMenuState,\n focusOptionIdx,\n readOnly,\n applyAriaDisabled,\n isMenuOpenableWithReadOnly,\n ]);\n\n // this callback prevent to toggle the menu when clicking or removing pills\n const handleOnPillsClick: React.MouseEventHandler = useCallback(\n (e) => {\n if (applyAriaDisabled) return;\n if (menuState || disabled || shouldPreventContextMenuOpening) {\n e.stopPropagation();\n } else {\n internalRef.current?.focus();\n setMenuState(true, 'pill-click');\n }\n },\n [applyAriaDisabled, menuState, disabled, internalRef, setMenuState, shouldPreventContextMenuOpening],\n );\n\n // callback to prevent onBlur on the input when clicking in all the wrapper\n const handleOnMouseDown: React.MouseEventHandler = useCallback(\n (e) => {\n if (document.activeElement === internalRef.current || inline) {\n e.preventDefault();\n }\n },\n [internalRef, inline],\n );\n\n const { onKeyDownPills } = useOnPillsNavigation();\n\n const cols = useMemo(\n () => (!inline ? ['minmax(0px,max-content)', 'minmax(20px, auto)', '8px', '2.231rem'] : ['minmax(0px, auto)']),\n [inline],\n );\n return (\n <StyledControlsWrapper\n innerRef={controlsWrapperRef}\n readOnly={readOnly}\n cols={cols}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n hasError={hasError}\n inline={inline}\n onClick={handleOnClick}\n onMouseDown={handleOnMouseDown}\n onKeyDown={onKeyDownPills}\n aria-disabled={applyAriaDisabled}\n data-testid={ComboboxDataTestid.CONTROLS_WRAPPER}\n >\n {!inline && (\n <StyledSelection innerRef={selectedOptionsRef} onClick={handleOnPillsClick}>\n {Array.isArray(selectedValues) ? (\n <MultiSelectedValuesContainer />\n ) : (\n <StyledSingleSelectWraper\n readOnly={readOnly}\n data-testid={ComboboxDataTestid.SELECTED_VALUES}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n >\n {selectedValues && inputValue === '' ? <SimpleTruncatedTooltipText value={selectedValues.label} /> : null}\n </StyledSingleSelectWraper>\n )}\n </StyledSelection>\n )}\n\n <ControlsInput />\n {/** This empty div is a gap between the input and the drop down indicator */}\n <div />\n {!inline && (\n <StyledHeaderActionsWrapper\n justifyItems=\"center\"\n cols={['min-content', 'minmax(28px,max-content)']}\n justifyContent=\"flex-end\"\n >\n <StyleHeaderActionsSeparator disabled={disabled} applyAriaDisabled={applyAriaDisabled} readOnly={readOnly} />\n <DropdownIndicator />\n </StyledHeaderActionsWrapper>\n )}\n </StyledControlsWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+GX;AA7GZ,mBAAwD;AACxD,uCAA2C;AAC3C,+BAAkC;AAClC,iCAAmC;AACnC,yBAA4B;AAE5B,oBAMO;AACP,6CAA6C;AAC7C,2BAA8B;AAC9B,kCAAqC;AAC9B,MAAM,WAAW,MAAmB;AACzC,QAAM;AAAA,IACJ,OAAO,EAAE,QAAQ,UAAU,UAAU,gBAAgB,mBAAmB,UAAU,2BAA2B;AAAA,IAC7G;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,mBAAAA,OAAe;AAE9B,QAAM,oBAAgB,0BAAY,MAAM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Aa,8CAAmB;AAAA,MAE/B;AAAA,SAAC,UACA,4CAAC,iCAAgB,UAAU,oBAAoB,SAAS,oBACrD,gBAAM,QAAQ,cAAc,IAC3B,4CAAC,uEAA6B,IAE9B;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,eAAa,8CAAmB;AAAA,YAChC;AAAA,YACA;AAAA,YAEC,4BAAkB,eAAe,KAAK,4CAAC,+DAA2B,OAAO,eAAe,OAAO,IAAK;AAAA;AAAA,QACvG,GAEJ;AAAA,QAGF,4CAAC,sCAAc;AAAA,QAEf,4CAAC,SAAI;AAAA,QACJ,CAAC,UACA;AAAA,UAAC;AAAA;AAAA,YACC,cAAa;AAAA,YACb,MAAM,CAAC,eAAe,0BAA0B;AAAA,YAChD,gBAAe;AAAA,YAEf;AAAA,0DAAC,6CAA4B,UAAoB,mBAAsC,UAAoB;AAAA,cAC3G,4CAAC,8CAAkB;AAAA;AAAA;AAAA,QACrB;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
4
+ "sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { ControlsInput } from '../controls-input/ControlsInput.js';\nimport { DropdownIndicator } from '../DropdownIndicator.js';\nimport { MultiSelectedValuesContainer } from '../multi-selected-values-container/index.js';\nimport {\n StyledControlsWrapper,\n StyledHeaderActionsWrapper,\n StyledSelection,\n StyledSingleSelectWraper,\n StyleHeaderActionsSeparator,\n} from './styled.js';\nimport { useOnPillsNavigation } from './useOnPillsNavigation.js';\n\nexport const Controls = (): JSX.Element => {\n const {\n props,\n props: { inline, disabled, hasError, selectedValues, applyAriaDisabled, readOnly, isMenuOpenableWithReadOnly },\n selectedOptionsRef,\n setMenuState,\n setFocusOptionIdx,\n hasFocus,\n inputValue,\n listRef,\n focusOptionIdx,\n menuState,\n controlsWrapperRef,\n internalRef,\n shouldPreventContextMenuOpening,\n } = useContext(ComboBoxContext);\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const handleOnClick = useCallback(() => {\n if (disabled) return;\n if (applyAriaDisabled || shouldPreventContextMenuOpening) {\n internalRef.current?.focus();\n return;\n }\n if (hasFocus && menuState && !inline) {\n setMenuState(false, 'click');\n setFocusOptionIdx('');\n internalRef.current?.blur();\n return;\n }\n internalRef.current?.focus();\n setMenuState(true, 'click');\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n disabled,\n listRef,\n hasFocus,\n menuState,\n inline,\n setMenuState,\n focusOptionIdx,\n readOnly,\n applyAriaDisabled,\n isMenuOpenableWithReadOnly,\n ]);\n\n // this callback prevent to toggle the menu when clicking or removing pills\n const handleOnPillsClick: React.MouseEventHandler = useCallback(\n (e) => {\n if (applyAriaDisabled) return;\n if (menuState || disabled || shouldPreventContextMenuOpening) {\n e.stopPropagation();\n } else {\n internalRef.current?.focus();\n setMenuState(true, 'pill-click');\n }\n },\n [applyAriaDisabled, menuState, disabled, internalRef, setMenuState, shouldPreventContextMenuOpening],\n );\n\n // callback to prevent onBlur on the input when clicking in all the wrapper\n const handleOnMouseDown: React.MouseEventHandler = useCallback(\n (e) => {\n if (document.activeElement === internalRef.current || inline) {\n e.preventDefault();\n }\n },\n [internalRef, inline],\n );\n\n const { onKeyDownPills } = useOnPillsNavigation();\n\n const cols = useMemo(\n () => (!inline ? ['minmax(0px,max-content)', 'minmax(20px, auto)', '8px', '2.231rem'] : ['minmax(0px, auto)']),\n [inline],\n );\n return (\n <StyledControlsWrapper\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n innerRef={controlsWrapperRef}\n readOnly={readOnly}\n cols={cols}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n hasError={hasError}\n inline={inline}\n onClick={handleOnClick}\n onMouseDown={handleOnMouseDown}\n onKeyDown={onKeyDownPills}\n aria-disabled={applyAriaDisabled}\n data-testid={ComboboxDataTestid.CONTROLS_WRAPPER}\n >\n {!inline && (\n <StyledSelection innerRef={selectedOptionsRef} onClick={handleOnPillsClick}>\n {Array.isArray(selectedValues) ? (\n <MultiSelectedValuesContainer />\n ) : (\n <StyledSingleSelectWraper\n readOnly={readOnly}\n data-testid={ComboboxDataTestid.SELECTED_VALUES}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n >\n {selectedValues && inputValue === '' ? <SimpleTruncatedTooltipText value={selectedValues.label} /> : null}\n </StyledSingleSelectWraper>\n )}\n </StyledSelection>\n )}\n\n <ControlsInput />\n {/** This empty div is a gap between the input and the drop down indicator */}\n <div />\n {!inline && (\n <StyledHeaderActionsWrapper\n justifyItems=\"center\"\n cols={['min-content', 'minmax(28px,max-content)']}\n justifyContent=\"flex-end\"\n >\n <StyleHeaderActionsSeparator disabled={disabled} applyAriaDisabled={applyAriaDisabled} readOnly={readOnly} />\n <DropdownIndicator />\n </StyledHeaderActionsWrapper>\n )}\n </StyledControlsWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqHX;AAnHZ,8BAA8B;AAC9B,uCAA2C;AAC3C,mBAAwD;AACxD,yBAA4B;AAC5B,iCAAmC;AACnC,2BAA8B;AAC9B,+BAAkC;AAClC,6CAA6C;AAC7C,oBAMO;AACP,kCAAqC;AAE9B,MAAM,WAAW,MAAmB;AACzC,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,QAAQ,UAAU,UAAU,gBAAgB,mBAAmB,UAAU,2BAA2B;AAAA,IAC7G;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA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