@elliemae/ds-form-combobox 3.0.0-next.46 → 3.0.0-next.49

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 (104) hide show
  1. package/dist/cjs/ComboBox.js +9 -16
  2. package/dist/cjs/ComboBox.js.map +1 -1
  3. package/dist/cjs/ComboBoxCTX.js +11 -17
  4. package/dist/cjs/ComboBoxCTX.js.map +2 -2
  5. package/dist/cjs/ComboboxDataTestids.js +9 -16
  6. package/dist/cjs/ComboboxDataTestids.js.map +1 -1
  7. package/dist/cjs/config/useComboBox.js +9 -16
  8. package/dist/cjs/config/useComboBox.js.map +1 -1
  9. package/dist/cjs/config/useCorrectOptions.js +9 -16
  10. package/dist/cjs/config/useCorrectOptions.js.map +1 -1
  11. package/dist/cjs/constants.js +9 -16
  12. package/dist/cjs/constants.js.map +1 -1
  13. package/dist/cjs/index.js +13 -19
  14. package/dist/cjs/index.js.map +1 -1
  15. package/dist/cjs/parts/A11yFocusedOption.js +9 -16
  16. package/dist/cjs/parts/A11yFocusedOption.js.map +1 -1
  17. package/dist/cjs/parts/A11ySelectedValues.js +9 -16
  18. package/dist/cjs/parts/A11ySelectedValues.js.map +1 -1
  19. package/dist/cjs/parts/DropdownIndicator.js +13 -16
  20. package/dist/cjs/parts/DropdownIndicator.js.map +2 -2
  21. package/dist/cjs/parts/container/Container.js +9 -16
  22. package/dist/cjs/parts/container/Container.js.map +1 -1
  23. package/dist/cjs/parts/container/index.js +9 -16
  24. package/dist/cjs/parts/container/index.js.map +1 -1
  25. package/dist/cjs/parts/container/styled.js +9 -16
  26. package/dist/cjs/parts/container/styled.js.map +1 -1
  27. package/dist/cjs/parts/controls/Controls.js +13 -18
  28. package/dist/cjs/parts/controls/Controls.js.map +2 -2
  29. package/dist/cjs/parts/controls/index.js +9 -16
  30. package/dist/cjs/parts/controls/index.js.map +1 -1
  31. package/dist/cjs/parts/controls/styled.js +9 -16
  32. package/dist/cjs/parts/controls/styled.js.map +1 -1
  33. package/dist/cjs/parts/controls/useOnPillsNavigation.js +9 -16
  34. package/dist/cjs/parts/controls/useOnPillsNavigation.js.map +1 -1
  35. package/dist/cjs/parts/controls-input/ControlsInput.js +10 -17
  36. package/dist/cjs/parts/controls-input/ControlsInput.js.map +2 -2
  37. package/dist/cjs/parts/controls-input/styled.js +14 -16
  38. package/dist/cjs/parts/controls-input/styled.js.map +2 -2
  39. package/dist/cjs/parts/controls-input/useControlsInput.js +14 -17
  40. package/dist/cjs/parts/controls-input/useControlsInput.js.map +2 -2
  41. package/dist/cjs/parts/controls-input/useKeyboardNavigation.js +13 -20
  42. package/dist/cjs/parts/controls-input/useKeyboardNavigation.js.map +2 -2
  43. package/dist/cjs/parts/controls-input/useMaskedOnChange.js +9 -16
  44. package/dist/cjs/parts/controls-input/useMaskedOnChange.js.map +1 -1
  45. package/dist/cjs/parts/header-list/HeaderList.js +9 -16
  46. package/dist/cjs/parts/header-list/HeaderList.js.map +1 -1
  47. package/dist/cjs/parts/header-list/index.js +9 -16
  48. package/dist/cjs/parts/header-list/index.js.map +1 -1
  49. package/dist/cjs/parts/header-list/styled.js +9 -16
  50. package/dist/cjs/parts/header-list/styled.js.map +1 -1
  51. package/dist/cjs/parts/header-list/useHeaderListHandlers.js +9 -16
  52. package/dist/cjs/parts/header-list/useHeaderListHandlers.js.map +1 -1
  53. package/dist/cjs/parts/menu-list/MenuList.js +9 -16
  54. package/dist/cjs/parts/menu-list/MenuList.js.map +1 -1
  55. package/dist/cjs/parts/menu-list/index.js +9 -16
  56. package/dist/cjs/parts/menu-list/index.js.map +1 -1
  57. package/dist/cjs/parts/menu-list/styled.js +9 -16
  58. package/dist/cjs/parts/menu-list/styled.js.map +1 -1
  59. package/dist/cjs/parts/menu-list/useItemRenderer.js +11 -18
  60. package/dist/cjs/parts/menu-list/useItemRenderer.js.map +2 -2
  61. package/dist/cjs/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +9 -16
  62. package/dist/cjs/parts/multi-selected-values-container/MultiSelectedValuesContainer.js.map +1 -1
  63. package/dist/cjs/parts/multi-selected-values-container/RemovableSelectedValuePill.js +11 -18
  64. package/dist/cjs/parts/multi-selected-values-container/RemovableSelectedValuePill.js.map +2 -2
  65. package/dist/cjs/parts/multi-selected-values-container/index.js +9 -16
  66. package/dist/cjs/parts/multi-selected-values-container/index.js.map +1 -1
  67. package/dist/cjs/parts/multi-selected-values-container/useGroupPills.js +13 -19
  68. package/dist/cjs/parts/multi-selected-values-container/useGroupPills.js.map +2 -2
  69. package/dist/cjs/parts/styled.js +9 -16
  70. package/dist/cjs/parts/styled.js.map +1 -1
  71. package/dist/cjs/react-desc-prop-types.js +9 -16
  72. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  73. package/dist/cjs/sharedTypes.js +9 -16
  74. package/dist/cjs/sharedTypes.js.map +1 -1
  75. package/dist/cjs/tests/utils.js +9 -16
  76. package/dist/cjs/tests/utils.js.map +1 -1
  77. package/dist/cjs/theming.js +9 -16
  78. package/dist/cjs/theming.js.map +1 -1
  79. package/dist/cjs/utils/listHelper.js +19 -18
  80. package/dist/cjs/utils/listHelper.js.map +2 -2
  81. package/dist/esm/ComboBoxCTX.js +2 -1
  82. package/dist/esm/ComboBoxCTX.js.map +2 -2
  83. package/dist/esm/parts/DropdownIndicator.js +4 -0
  84. package/dist/esm/parts/DropdownIndicator.js.map +2 -2
  85. package/dist/esm/parts/controls/Controls.js +4 -2
  86. package/dist/esm/parts/controls/Controls.js.map +2 -2
  87. package/dist/esm/parts/controls-input/ControlsInput.js +1 -1
  88. package/dist/esm/parts/controls-input/ControlsInput.js.map +2 -2
  89. package/dist/esm/parts/controls-input/styled.js +5 -0
  90. package/dist/esm/parts/controls-input/styled.js.map +2 -2
  91. package/dist/esm/parts/controls-input/useControlsInput.js +5 -1
  92. package/dist/esm/parts/controls-input/useControlsInput.js.map +2 -2
  93. package/dist/esm/parts/controls-input/useKeyboardNavigation.js +4 -4
  94. package/dist/esm/parts/controls-input/useKeyboardNavigation.js.map +2 -2
  95. package/dist/esm/parts/menu-list/useItemRenderer.js +2 -2
  96. package/dist/esm/parts/menu-list/useItemRenderer.js.map +2 -2
  97. package/dist/esm/parts/multi-selected-values-container/RemovableSelectedValuePill.js +2 -2
  98. package/dist/esm/parts/multi-selected-values-container/RemovableSelectedValuePill.js.map +2 -2
  99. package/dist/esm/parts/multi-selected-values-container/useGroupPills.js +4 -3
  100. package/dist/esm/parts/multi-selected-values-container/useGroupPills.js.map +2 -2
  101. package/dist/esm/react-desc-prop-types.js.map +1 -1
  102. package/dist/esm/utils/listHelper.js +10 -2
  103. package/dist/esm/utils/listHelper.js.map +2 -2
  104. package/package.json +14 -14
@@ -4,31 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
21
  var useHeaderListHandlers_exports = {};
29
22
  __export(useHeaderListHandlers_exports, {
30
23
  useHeaderListHandlers: () => useHeaderListHandlers
31
24
  });
25
+ module.exports = __toCommonJS(useHeaderListHandlers_exports);
32
26
  var React = __toESM(require("react"));
33
27
  var import_react = require("react");
34
28
  var import_listHelper = require("../../utils/listHelper");
@@ -112,5 +106,4 @@ const useHeaderListHandlers = () => {
112
106
  checkboxStatus
113
107
  ]);
114
108
  };
115
- module.exports = __toCommonJS(useHeaderListHandlers_exports);
116
109
  //# sourceMappingURL=useHeaderListHandlers.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/header-list/useHeaderListHandlers.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React, { useState, useMemo, useEffect, useContext, useCallback } from 'react';\nimport { DSComboboxT } from '../../react-desc-prop-types';\nimport { getSelectableOptions } from '../../utils/listHelper';\nimport ComboBoxContext from '../../ComboBoxCTX';\n\nconst useHeaderListHandlers = () => {\n const {\n props: { selectedValues, filteredOptions, onSelectAll, innerRef },\n showSelectedOptions,\n setShowSelectedOptions,\n setMenuState,\n } = useContext(ComboBoxContext);\n\n const multiSelectedValues = selectedValues as DSComboboxT.ItemOption[];\n const selectableOptions = getSelectableOptions(filteredOptions);\n\n const getCheckboxStatus = useMemo(() => {\n if (multiSelectedValues.length === selectableOptions.length) {\n return true;\n }\n if (multiSelectedValues?.length === 0) {\n return false;\n }\n return 'mixed';\n }, [multiSelectedValues.length, selectableOptions.length]);\n\n const [checkboxStatus, setCheckboxStatus] = useState<'mixed' | boolean>(false);\n\n useEffect(() => {\n setCheckboxStatus(getCheckboxStatus);\n }, [getCheckboxStatus, multiSelectedValues]);\n\n const handleOnMouseDown = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n // this prevent the input control to lose focus\n }, []);\n\n const handleSelectAllCheckboxChange = useCallback(\n (e: React.MouseEvent | React.KeyboardEvent) => {\n if ((!checkboxStatus || checkboxStatus === 'mixed') && onSelectAll) {\n onSelectAll(\n filteredOptions.filter((option) => option.type === 'option' && !option.disabled),\n e,\n );\n setCheckboxStatus(true);\n } else if (onSelectAll) {\n onSelectAll([], e);\n setCheckboxStatus(false);\n }\n },\n [checkboxStatus, onSelectAll, filteredOptions],\n );\n\n const handleToggleSelectedValuesFilter: React.MouseEventHandler = useCallback(\n (e) => {\n e.preventDefault();\n setShowSelectedOptions(!showSelectedOptions);\n },\n [setShowSelectedOptions, showSelectedOptions],\n );\n\n // when pressing escape on each header list button we close the menu\n // and set focus on input\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n setMenuState(false, 'close', e);\n innerRef.current?.focus();\n }\n },\n [setMenuState, innerRef],\n );\n\n // when hitting tab on selected values button filter we target the input again\n const handleFilterSelectionBtnOnTab = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Tab' && !e.shiftKey) {\n e.preventDefault();\n innerRef.current?.focus();\n }\n },\n [innerRef],\n );\n\n const handleCheckAllOnTab = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Tab' && !e.shiftKey && multiSelectedValues.length === 0) {\n e.preventDefault();\n innerRef.current?.focus();\n }\n },\n [innerRef, multiSelectedValues],\n );\n\n useEffect(() => {\n // toggle off selected values filter when removing all of them\n if (multiSelectedValues.length === 0) {\n setShowSelectedOptions(false);\n }\n }, [multiSelectedValues, setShowSelectedOptions]);\n\n return useMemo(\n () => ({\n handleKeyDown,\n handleToggleSelectedValuesFilter,\n handleFilterSelectionBtnOnTab,\n handleOnMouseDown,\n handleCheckAllOnTab,\n handleSelectAllCheckboxChange,\n checkboxStatus,\n }),\n [\n handleKeyDown,\n handleFilterSelectionBtnOnTab,\n handleToggleSelectedValuesFilter,\n handleOnMouseDown,\n handleCheckAllOnTab,\n handleSelectAllCheckboxChange,\n checkboxStatus,\n ],\n );\n};\n\nexport { useHeaderListHandlers };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA6E;AAE7E,wBAAqC;AACrC,yBAA4B;AAE5B,MAAM,wBAAwB,MAAM;AAClC,QAAM;AAAA,IACJ,OAAO,EAAE,gBAAgB,iBAAiB,aAAa;AAAA,IACvD;AAAA,IACA;AAAA,IACA;AAAA,MACE,6BAAW,0BAAe;AAE9B,QAAM,sBAAsB;AAC5B,QAAM,oBAAoB,4CAAqB,eAAe;AAE9D,QAAM,oBAAoB,0BAAQ,MAAM;AACtC,QAAI,oBAAoB,WAAW,kBAAkB,QAAQ;AAC3D,aAAO;AAAA,IACT;AACA,QAAI,qBAAqB,WAAW,GAAG;AACrC,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT,GAAG,CAAC,oBAAoB,QAAQ,kBAAkB,MAAM,CAAC;AAEzD,QAAM,CAAC,gBAAgB,qBAAqB,2BAA4B,KAAK;AAE7E,8BAAU,MAAM;AACd,sBAAkB,iBAAiB;AAAA,EACrC,GAAG,CAAC,mBAAmB,mBAAmB,CAAC;AAE3C,QAAM,oBAAoB,8BAAY,CAAC,MAAwB;AAC7D,MAAE,eAAe;AAAA,EAEnB,GA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AAA,IACzB;AAAA,EACF,GACA,CAAC,gBAAgB,aAAa,eAAe,CAC/C;AAEA,QAAM,mCAA4D,8BAChE,CAAC,MAAM;AACL,MAAE,eAAe;AACjB,2BAAuB,CAAC,mBAAmB;AAAA,EAC7C,GACA,CAAC,wBAAwB,mBAAmB,CAC9C;AAIA,QAAM,gBAAgB,8BACpB,CAAC,MAA2B;AAC1B,QAAI,EAAE,QAAQ,UAAU;AACtB,mBAAa,OAAO,SAAS,CAAC;AAC9B,eAAS,SAAS,MAAM;AAAA,IAC1B;AAAA,EACF,GACA,CAAC,cAAc,QAAQ,CACzB;AAGA,QAAM,gCAAgC,8BACpC,CAAC,MAA2B;AAC1B,QAAI,EAAE,QAAQ,SAAS,CAAC,EAAE,UAAU;AAClC,QAAE,eAAe;AACjB,eAAS,SAAS,MAAM;AAAA,IAC1B;AAAA,EACF,GACA,CAAC,QAAQ,CACX;AAEA,QAAM,sBAAsB,8BAC1B,CAAC,MAA2B;AAC1B,QAAI,EAAE,QAAQ,SAAS,CAAC,EAAE,YAAY,oBAAoB,WAAW,GAAG;AACtE,QAAE,eAAe;AACjB,eAAS,SAAS,MAAM;AAAA,IAC1B;AAAA,EACF,GACA,CAAC,UAAU,mBAAmB,CAChC;AAEA,8BAAU,MAAM;AAEd,QAAI,oBAAoB,WAAW,GAAG;AACpC,6BAAuB,KAAK;AAAA,IAC9B;AAAA,EACF,GAAG,CAAC,qBAAqB,sBAAsB,CAAC;AAEhD,SAAO,0BACL,MAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -4,31 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
21
  var MenuList_exports = {};
29
22
  __export(MenuList_exports, {
30
23
  MenuList: () => MenuList
31
24
  });
25
+ module.exports = __toCommonJS(MenuList_exports);
32
26
  var React = __toESM(require("react"));
33
27
  var import_react = __toESM(require("react"));
34
28
  var import_ds_utilities = require("@elliemae/ds-utilities");
@@ -88,5 +82,4 @@ const MenuList = () => {
88
82
  noOptionsMessage
89
83
  ]);
90
84
  };
91
- module.exports = __toCommonJS(MenuList_exports);
92
85
  //# sourceMappingURL=MenuList.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/menu-list/MenuList.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React, { useContext, useMemo, useCallback } from 'react';\nimport { useOnElementResize } from '@elliemae/ds-utilities';\n\nimport { StyledListWrapper, StyledNoResultsWrapper, StyledList, StyledVirtualListWrapper } from './styled';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids';\nimport { ComboBoxContext } from '../../ComboBoxCTX';\nimport { HeaderList } from '../header-list';\nimport { useItemRenderer } from './useItemRenderer';\n\nexport const MenuList = (): JSX.Element => {\n const {\n props: { menuMinWidth, noOptionsMessage, menuMaxHeight, onCreate, inline, filteredOptions, selectedValues },\n controlsWrapperRef,\n listRef,\n inputValue,\n wrapperListRef,\n virtualListHelpers,\n } = useContext(ComboBoxContext);\n\n const multiple = Array.isArray(selectedValues);\n // removing the header list if we are filtering or is inline cb or we have no options to show\n const withHeader = !inline && multiple && filteredOptions.length > 0 && !inputValue;\n const ItemRenderer = useItemRenderer();\n const { width } = useOnElementResize(controlsWrapperRef);\n const preventLoseInputFocus: React.MouseEventHandler = useCallback((e) => {\n e.preventDefault();\n }, []);\n\n return useMemo(\n () => (\n <StyledListWrapper\n ref={wrapperListRef}\n inline={inline}\n onMouseDown={preventLoseInputFocus}\n width={width}\n minWidth={menuMinWidth}\n // we use width as key to force react virtual re-render on window resize\n // and update the item height accordly\n key={width}\n >\n {withHeader && <HeaderList />}\n {filteredOptions.length > 0 || onCreate ? (\n <StyledVirtualListWrapper inline={inline} maxHeight={menuMaxHeight} ref={listRef} withHeader={withHeader}>\n <StyledList\n id=\"combo-listbox\"\n role=\"listbox\"\n data-testid={ComboboxDataTestid.LIST}\n style={{ height: virtualListHelpers?.totalSize, margin: inline ? '0px' : '8px 0px' }}\n >\n {ItemRenderer}\n </StyledList>\n </StyledVirtualListWrapper>\n ) : (\n <StyledNoResultsWrapper role=\"alert\">{noOptionsMessage}</StyledNoResultsWrapper>\n )}\n </StyledListWrapper>\n ),\n [\n wrapperListRef,\n inline,\n preventLoseInputFocus,\n width,\n menuMinWidth,\n withHeader,\n filteredOptions.length,\n onCreate,\n menuMaxHeight,\n listRef,\n virtualListHelpers?.totalSize,\n ItemRenderer,\n noOptionsMessage,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwD;AACxD,0BAAmC;AAEnC,oBAAgG;AAChG,iCAAmC;AACnC,yBAAgC;AAChC,yBAA2B;AAC3B,6BAAgC;AAEzB,MAAM,WAAW,MAAmB;AACzC,QAAM;AAAA,IACJ,OAAO,EAAE,cAAc,kBAAkB,eAAe,UAAU,QAAQ,iBAAiB;AAAA,IAC3F;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,6BAAW,kCAAe;AAE9B,QAAM,WAAW,MAAM,QAAQ,cAAc;AAE7C,QAAM,aAAa,CAAC,UAAU,YAAY,gBAAgB,SAAS,KAAK,CAAC;AACzE,QAAM,eAAe,4CAAgB;AACrC,QAAM,EAAE,UAAU,4CAAmB,kBAAkB;AACvD,QAAM,wBAAiD,8BAAY,CAAC,MAAM;AACxE,MAAE,eAAe;AAAA,EACnB,GAAG,CAAC,CAAC;AAEL,SAAO,0BACL,MACE,mDAAC;AAAA,IACC,KAAK;AAAA,IACL;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA,UAAU;AAAA,IAGV,KAAK;AAAA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AA,IACL;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA,UAAU;AAAA,IAGV,KAAK;AAAA,KAEJ,cAAc,mDAAC,mCAAW,GAC1B,gBAAgB,SAAS,KAAK,WAC7B,mDAAC;AAAA,IAAyB;AAAA,IAAgB,WAAW;AAAA,IAAe,KAAK;AAAA,IAAS;AAAA,KAChF,mDAAC;AAAA,IACC,IAAG;AAAA,IACH,MAAK;AAAA,IACL,eAAa,8CAAmB;AAAA,IAChC,OAAO,EAAE,QAAQ,oBAAoB,WAAW,QAAQ,SAAS,QAAQ,UAAU;AAAA,KAElF,YACH,CACF,IAEA,mDAAC;AAAA,IAAuB,MAAK;AAAA,KAAS,gBAAiB,CAE3D,GAEF;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA,oBAAoB;AAAA,IACpB;AAAA,IACA;AAAA,EACF,CACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -4,32 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
21
  var menu_list_exports = {};
29
22
  __export(menu_list_exports, {
30
23
  MenuList: () => import_MenuList.MenuList
31
24
  });
25
+ module.exports = __toCommonJS(menu_list_exports);
32
26
  var React = __toESM(require("react"));
33
27
  var import_MenuList = require("./MenuList");
34
- module.exports = __toCommonJS(menu_list_exports);
35
28
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/menu-list/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["export { MenuList } from './MenuList';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,sBAAyB;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,sBAAyB;",
6
6
  "names": []
7
7
  }
@@ -4,27 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
21
  var styled_exports = {};
29
22
  __export(styled_exports, {
30
23
  StyledCreatableLabel: () => StyledCreatableLabel,
@@ -34,6 +27,7 @@ __export(styled_exports, {
34
27
  StyledNoResultsWrapper: () => StyledNoResultsWrapper,
35
28
  StyledVirtualListWrapper: () => StyledVirtualListWrapper
36
29
  });
30
+ module.exports = __toCommonJS(styled_exports);
37
31
  var React = __toESM(require("react"));
38
32
  var import_ds_system = require("@elliemae/ds-system");
39
33
  const StyledListWrapper = import_ds_system.styled.div`
@@ -64,5 +58,4 @@ const StyledCreatableValue = import_ds_system.styled.span`
64
58
  const StyledNoResultsWrapper = import_ds_system.styled.div`
65
59
  padding: 16px;
66
60
  `;
67
- module.exports = __toCommonJS(styled_exports);
68
61
  //# sourceMappingURL=styled.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/menu-list/styled.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { styled } from '@elliemae/ds-system';\n\ninterface StyledListWrapperT {\n minWidth: number | string;\n maxHeight: number;\n width: number | string;\n inline?: boolean;\n}\nexport const StyledListWrapper = styled.div<StyledListWrapperT>`\n min-width: ${({ inline, minWidth }) => (inline ? '100%' : `${minWidth}px`)};\n width: ${({ width }) => `${width}px`};\n background-color: #ffffff;\n max-height: ${({ maxHeight }) => `${maxHeight}px`};\n z-index: 100;\n`;\n\nexport const StyledList = styled.ul`\n position: relative;\n padding: 0;\n background-color: #ffffff;\n overflow-x: hidden;\n`;\n\nexport const StyledVirtualListWrapper = styled.div<{\n inline: boolean | undefined;\n maxHeight: number;\n withHeader: boolean;\n}>`\n overflow-y: auto;\n margin-top: ${({ withHeader }) => (withHeader ? '28px' : '')};\n max-height: ${({ maxHeight }) => (maxHeight ? `${maxHeight}px` : '300px')};\n`;\n\nexport const StyledCreatableLabel = styled.span`\n font-weight: bold;\n font-style: italic;\n`;\n\nexport const StyledCreatableValue = styled.span`\n word-break: break-all;\n`;\n\nexport const StyledNoResultsWrapper = styled.div`\n padding: 16px;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AAQhB,MAAM,oBAAoB,wBAAO;AAAA,eACzB,CAAC,EAAE,QAAQ,eAAgB,SAAS,SAAS,GAAG;AAAA,WACpD,CAAC,EAAE,YAAY,GAAG;AAAA;AAAA,gBAEb,CAAC,EAAE,gBAAgB,GAAG;AAAA;AAAA;AAI/B,MAAM,aAAa,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAO1B,MAAM,2BAA2B,wBAAO;AAAA;AAAA,gBAM/B,CAAC,EAAE,iBAAkB,aAAa,SAAS;AAAA,gBAC3C,CAAC,EAAE,gBAAiB,YAAY,GAAG,gBAAgB;AAAA;AAG5D,MAAM,uBAAuB,wBAAO;AAAA;AAAA;AAAA;AAKpC,MAAM,uBAAuB,wBAAO;AAAA;AAAA;AAIpC,MAAM,yBAAyB,wBAAO;AAAA;AAAA;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AAQhB,MAAM,oBAAoB,wBAAO;AAAA,eACzB,CAAC,EAAE,QAAQ,eAAgB,SAAS,SAAS,GAAG;AAAA,WACpD,CAAC,EAAE,YAAY,GAAG;AAAA;AAAA,gBAEb,CAAC,EAAE,gBAAgB,GAAG;AAAA;AAAA;AAI/B,MAAM,aAAa,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAO1B,MAAM,2BAA2B,wBAAO;AAAA;AAAA,gBAM/B,CAAC,EAAE,iBAAkB,aAAa,SAAS;AAAA,gBAC3C,CAAC,EAAE,gBAAiB,YAAY,GAAG,gBAAgB;AAAA;AAG5D,MAAM,uBAAuB,wBAAO;AAAA;AAAA;AAAA;AAKpC,MAAM,uBAAuB,wBAAO;AAAA;AAAA;AAIpC,MAAM,yBAAyB,wBAAO;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -21,31 +21,25 @@ var __spreadValues = (a, b) => {
21
21
  return a;
22
22
  };
23
23
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
25
24
  var __export = (target, all) => {
26
25
  for (var name in all)
27
26
  __defProp(target, name, { get: all[name], enumerable: true });
28
27
  };
29
- var __reExport = (target, module2, copyDefault, desc) => {
30
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
31
- for (let key of __getOwnPropNames(module2))
32
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
33
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
28
+ var __copyProps = (to, from, except, desc) => {
29
+ if (from && typeof from === "object" || typeof from === "function") {
30
+ for (let key of __getOwnPropNames(from))
31
+ if (!__hasOwnProp.call(to, key) && key !== except)
32
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
34
33
  }
35
- return target;
34
+ return to;
36
35
  };
37
- var __toESM = (module2, isNodeMode) => {
38
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
39
- };
40
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
41
- return (module2, temp) => {
42
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
43
- };
44
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
36
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
37
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
45
38
  var useItemRenderer_exports = {};
46
39
  __export(useItemRenderer_exports, {
47
40
  useItemRenderer: () => useItemRenderer
48
41
  });
42
+ module.exports = __toCommonJS(useItemRenderer_exports);
49
43
  var React = __toESM(require("react"));
50
44
  var import_react = __toESM(require("react"));
51
45
  var import_ds_grid = require("@elliemae/ds-grid");
@@ -57,7 +51,7 @@ var import_ComboboxDataTestids = require("../../ComboboxDataTestids");
57
51
  var import_constants = require("../../constants");
58
52
  const useItemRenderer = () => {
59
53
  const {
60
- props: { filteredOptions, onCreate, onChange, selectedValues, onFilter, allOptions },
54
+ props: { filteredOptions, onCreate, onChange, isNonClearable, selectedValues, onFilter, allOptions },
61
55
  setMenuState,
62
56
  inputValue,
63
57
  focusOptionIdx,
@@ -83,7 +77,7 @@ const useItemRenderer = () => {
83
77
  if (!multiple) {
84
78
  setMenuState(false, "selectOption", e);
85
79
  }
86
- onChange((0, import_listHelper.getSuggestedValueOnChange)(option, selectedValues), option, e);
80
+ onChange((0, import_listHelper.getSuggestedValueOnChange)(option, selectedValues, isNonClearable), option, e);
87
81
  }
88
82
  }
89
83
  e.stopPropagation();
@@ -149,5 +143,4 @@ const useItemRenderer = () => {
149
143
  });
150
144
  }, [filteredOptions, focusOptionIdx, selectedValues, virtualListHelpers]);
151
145
  };
152
- module.exports = __toCommonJS(useItemRenderer_exports);
153
146
  //# sourceMappingURL=useItemRenderer.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/menu-list/useItemRenderer.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable react-hooks/exhaustive-deps */\nimport React, { useMemo, useContext, useCallback } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { SingleMenuItem, MultiMenuItem, Section, Separator } from '@elliemae/ds-common';\nimport { ComboBoxContext } from '../../ComboBoxCTX';\nimport { StyledCreatableLabel, StyledCreatableValue } from './styled';\nimport { isSelected, getSuggestedValueOnChange } from '../../utils/listHelper';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids';\nimport { DSComboboxT } from '../../react-desc-prop-types';\nimport { MENU_OPTION_TYPES, INTERNAL_MENU_OPTION_TYPES } from '../../constants';\nexport const useItemRenderer = (): Array<JSX.Element> | null => {\n const {\n props: { filteredOptions, onCreate, onChange, selectedValues, onFilter, allOptions },\n setMenuState,\n inputValue,\n focusOptionIdx,\n setInputValue,\n virtualListHelpers,\n } = useContext(ComboBoxContext);\n\n const multiple = Array.isArray(selectedValues);\n const CBItem = multiple ? MultiMenuItem : SingleMenuItem;\n\n const handleOnCreateClick = useCallback(() => {\n if (inputValue && onCreate) {\n onCreate(inputValue);\n setInputValue('');\n if (onFilter) onFilter(allOptions, inputValue);\n }\n }, [onFilter, onCreate, inputValue, allOptions, setInputValue]);\n const handleClick = useCallback(\n (option: DSComboboxT.ItemOption, e: React.MouseEvent) => {\n if (option.type === MENU_OPTION_TYPES.OPTION) {\n if (!option.disabled) {\n if (onFilter) onFilter(allOptions, inputValue);\n setInputValue('');\n if (!multiple) {\n setMenuState(false, 'selectOption', e);\n }\n onChange(getSuggestedValueOnChange(option, selectedValues), option, e);\n }\n }\n // prevent for loosing focus on input control\n e.stopPropagation();\n e.preventDefault();\n },\n [onFilter, selectedValues, allOptions, onChange, setMenuState, multiple],\n );\n\n // prevent blur from controls input\n const handleOnMouseDown = useCallback((e: React.MouseEvent<HTMLLIElement>) => {\n e.preventDefault();\n }, []);\n\n return useMemo(() => {\n if (!virtualListHelpers) {\n return null;\n }\n return virtualListHelpers.virtualItems.map((vItem) => {\n const option = filteredOptions[vItem.index];\n const generalProps = {\n wrapperStyles: {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n transform: `translateY(${vItem.start}px)`,\n },\n\n key: `${option.dsId}`,\n innerRef: vItem.measureRef,\n };\n if (option.type === MENU_OPTION_TYPES.SECTION) {\n return <Section label={option.label} {...generalProps} />;\n }\n if (option.type === MENU_OPTION_TYPES.SEPARATOR) {\n return <Separator {...generalProps} />;\n }\n if (option.type === MENU_OPTION_TYPES.OPTION) {\n return (\n <CBItem\n {...generalProps}\n value={option.value}\n label={option.label}\n dataTestid={ComboboxDataTestid.OPTION}\n disabled={option.disabled}\n onClick={(e: React.MouseEvent) => handleClick(option, e)}\n onMouseDown={handleOnMouseDown}\n isActive={option.dsId === focusOptionIdx}\n isSelected={isSelected(selectedValues, option)}\n tabIndex={-1}\n />\n );\n }\n if (option.type === INTERNAL_MENU_OPTION_TYPES.CREATABLE) {\n return (\n <SingleMenuItem\n dataTestid={ComboboxDataTestid.OPTION}\n isActive={option.dsId === focusOptionIdx}\n {...generalProps}\n render={({ label }: { label: string }) => (\n <Grid p=\"8px\" cols={['min-content', 'auto']} gutter=\"xxs\" alignItems=\"center\">\n <StyledCreatableLabel>Add:</StyledCreatableLabel>\n <StyledCreatableValue>{`\"${label}\"`}</StyledCreatableValue>\n </Grid>\n )}\n label={option.label}\n onClick={handleOnCreateClick}\n />\n );\n }\n return <></>;\n });\n }, [filteredOptions, focusOptionIdx, selectedValues, virtualListHelpers]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAwD;AACxD,qBAAqB;AACrB,uBAAkE;AAClE,yBAAgC;AAChC,oBAA2D;AAC3D,wBAAsD;AACtD,iCAAmC;AAEnC,uBAA8D;AACvD,MAAM,kBAAkB,MAAiC;AAC9D,QAAM;AAAA,IACJ,OAAO,EAAE,iBAAiB,UAAU,UAAU,gBAAgB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M;AAAA,MAClB;AACA,UAAI,OAAO,SAAS,mCAAkB,SAAS;AAC7C,eAAO,mDAAC;AAAA,UAAQ,OAAO,OAAO;AAAA,WAAW,aAAc;AAAA,MACzD;AACA,UAAI,OAAO,SAAS,mCAAkB,WAAW;AAC/C,eAAO,mDAAC,+CAAc,aAAc;AAAA,MACtC;AACA,UAAI,OAAO,SAAS,mCAAkB,QAAQ;AAC5C,eACE,mDAAC,yCACK,eADL;AAAA,UAEC,OAAO,OAAO;AAAA,UACd,OAAO,OAAO;AAAA,UACd,YAAY,8CAAmB;AAAA,UAC/B,UAAU,OAAO;AAAA,UACjB,SAAS,CAAC,MAAwB,YAAY,QAAQ,CAAC;AAAA,UACvD,aAAa;AAAA,UACb,UAAU,OAAO,SAAS;AAAA,UAC1B,YAAY,kCAAW,gBAAgB,MAAM;AAAA,UAC7C,UAAU;AAAA,UACZ;AAAA,MAEJ;AACA,UAAI,OAAO,SAAS,4CAA2B,WAAW;AACxD,eACE,mDAAC;AAAA,UACC,YAAY,8CAAmB;AAAA,UAC/B,UAAU,OAAO,SAAS;AAAA,WACtB,eAHL;AAAA,UAIC,QAAQ,CAAC,EAAE,YACT,mDAAC;AAAA,YAAK,GAAE;AAAA,YAAM,MAAM,CAAC,eAAe,MAAM;AAAA,YAAG,QAAO;AAAA,YAAM,YAAW;AAAA,aACnE,mDAAC,0CAAqB,MAAI,GAC1B,mDAAC,0CAAsB,IAAI,QAAS,CACtC;AAAA,UAEF,OAAO,OAAO;AAAA,UACd,SAAS;AAAA,UACX;AAAA,MAEJ;AACA,aAAO,sFAAE;AAAA,IACX,CAAC;AAAA,EACH,GAAG,CAAC,iBAAiB,gBAAgB,gBAAgB,kBAAkB,CAAC;AAC1E;",
4
+ "sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable react-hooks/exhaustive-deps */\nimport React, { useMemo, useContext, useCallback } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { SingleMenuItem, MultiMenuItem, Section, Separator } from '@elliemae/ds-common';\nimport { ComboBoxContext } from '../../ComboBoxCTX';\nimport { StyledCreatableLabel, StyledCreatableValue } from './styled';\nimport { isSelected, getSuggestedValueOnChange } from '../../utils/listHelper';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids';\nimport { DSComboboxT } from '../../react-desc-prop-types';\nimport { MENU_OPTION_TYPES, INTERNAL_MENU_OPTION_TYPES } from '../../constants';\nexport const useItemRenderer = (): Array<JSX.Element> | null => {\n const {\n props: { filteredOptions, onCreate, onChange, isNonClearable, selectedValues, onFilter, allOptions },\n setMenuState,\n inputValue,\n focusOptionIdx,\n setInputValue,\n virtualListHelpers,\n } = useContext(ComboBoxContext);\n\n const multiple = Array.isArray(selectedValues);\n const CBItem = multiple ? MultiMenuItem : SingleMenuItem;\n\n const handleOnCreateClick = useCallback(() => {\n if (inputValue && onCreate) {\n onCreate(inputValue);\n setInputValue('');\n if (onFilter) onFilter(allOptions, inputValue);\n }\n }, [onFilter, onCreate, inputValue, allOptions, setInputValue]);\n const handleClick = useCallback(\n (option: DSComboboxT.ItemOption, e: React.MouseEvent) => {\n if (option.type === MENU_OPTION_TYPES.OPTION) {\n if (!option.disabled) {\n if (onFilter) onFilter(allOptions, inputValue);\n setInputValue('');\n if (!multiple) {\n setMenuState(false, 'selectOption', e);\n }\n onChange(getSuggestedValueOnChange(option, selectedValues, isNonClearable), option, e);\n }\n }\n // prevent for loosing focus on input control\n e.stopPropagation();\n e.preventDefault();\n },\n [onFilter, selectedValues, allOptions, onChange, setMenuState, multiple],\n );\n\n // prevent blur from controls input\n const handleOnMouseDown = useCallback((e: React.MouseEvent<HTMLLIElement>) => {\n e.preventDefault();\n }, []);\n\n return useMemo(() => {\n if (!virtualListHelpers) {\n return null;\n }\n return virtualListHelpers.virtualItems.map((vItem) => {\n const option = filteredOptions[vItem.index];\n const generalProps = {\n wrapperStyles: {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n transform: `translateY(${vItem.start}px)`,\n },\n\n key: `${option.dsId}`,\n innerRef: vItem.measureRef,\n };\n if (option.type === MENU_OPTION_TYPES.SECTION) {\n return <Section label={option.label} {...generalProps} />;\n }\n if (option.type === MENU_OPTION_TYPES.SEPARATOR) {\n return <Separator {...generalProps} />;\n }\n if (option.type === MENU_OPTION_TYPES.OPTION) {\n return (\n <CBItem\n {...generalProps}\n value={option.value}\n label={option.label}\n dataTestid={ComboboxDataTestid.OPTION}\n disabled={option.disabled}\n onClick={(e: React.MouseEvent) => handleClick(option, e)}\n onMouseDown={handleOnMouseDown}\n isActive={option.dsId === focusOptionIdx}\n isSelected={isSelected(selectedValues, option)}\n tabIndex={-1}\n />\n );\n }\n if (option.type === INTERNAL_MENU_OPTION_TYPES.CREATABLE) {\n return (\n <SingleMenuItem\n dataTestid={ComboboxDataTestid.OPTION}\n isActive={option.dsId === focusOptionIdx}\n {...generalProps}\n render={({ label }: { label: string }) => (\n <Grid p=\"8px\" cols={['min-content', 'auto']} gutter=\"xxs\" alignItems=\"center\">\n <StyledCreatableLabel>Add:</StyledCreatableLabel>\n <StyledCreatableValue>{`\"${label}\"`}</StyledCreatableValue>\n </Grid>\n )}\n label={option.label}\n onClick={handleOnCreateClick}\n />\n );\n }\n return <></>;\n });\n }, [filteredOptions, focusOptionIdx, selectedValues, virtualListHelpers]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAwD;AACxD,qBAAqB;AACrB,uBAAkE;AAClE,yBAAgC;AAChC,oBAA2D;AAC3D,wBAAsD;AACtD,iCAAmC;AAEnC,uBAA8D;AACvD,MAAM,kBAAkB,MAAiC;AAC9D,QAAM;AAAA,IACJ,OAAO,EAAE,iBAAiB,UAAU,UAAU,gBAAgB,gBAAgB,UAAU;AAAA,IACxF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;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C7C,eAAO,mDAAC;AAAA,UAAQ,OAAO,OAAO;AAAA,WAAW,aAAc;AAAA,MACzD;AACA,UAAI,OAAO,SAAS,mCAAkB,WAAW;AAC/C,eAAO,mDAAC,+CAAc,aAAc;AAAA,MACtC;AACA,UAAI,OAAO,SAAS,mCAAkB,QAAQ;AAC5C,eACE,mDAAC,yCACK,eADL;AAAA,UAEC,OAAO,OAAO;AAAA,UACd,OAAO,OAAO;AAAA,UACd,YAAY,8CAAmB;AAAA,UAC/B,UAAU,OAAO;AAAA,UACjB,SAAS,CAAC,MAAwB,YAAY,QAAQ,CAAC;AAAA,UACvD,aAAa;AAAA,UACb,UAAU,OAAO,SAAS;AAAA,UAC1B,YAAY,kCAAW,gBAAgB,MAAM;AAAA,UAC7C,UAAU;AAAA,UACZ;AAAA,MAEJ;AACA,UAAI,OAAO,SAAS,4CAA2B,WAAW;AACxD,eACE,mDAAC;AAAA,UACC,YAAY,8CAAmB;AAAA,UAC/B,UAAU,OAAO,SAAS;AAAA,WACtB,eAHL;AAAA,UAIC,QAAQ,CAAC,EAAE,YACT,mDAAC;AAAA,YAAK,GAAE;AAAA,YAAM,MAAM,CAAC,eAAe,MAAM;AAAA,YAAG,QAAO;AAAA,YAAM,YAAW;AAAA,aACnE,mDAAC,0CAAqB,MAAI,GAC1B,mDAAC,0CAAsB,IAAI,QAAS,CACtC;AAAA,UAEF,OAAO,OAAO;AAAA,UACd,SAAS;AAAA,UACX;AAAA,MAEJ;AACA,aAAO,sFAAE;AAAA,IACX,CAAC;AAAA,EACH,GAAG,CAAC,iBAAiB,gBAAgB,gBAAgB,kBAAkB,CAAC;AAC1E;",
6
6
  "names": []
7
7
  }
@@ -4,31 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
21
  var MultiSelectedValuesContainer_exports = {};
29
22
  __export(MultiSelectedValuesContainer_exports, {
30
23
  MultiSelectedValuesContainer: () => MultiSelectedValuesContainer
31
24
  });
25
+ module.exports = __toCommonJS(MultiSelectedValuesContainer_exports);
32
26
  var React = __toESM(require("react"));
33
27
  var import_react = __toESM(require("react"));
34
28
  var import_ds_pills = require("@elliemae/ds-pills");
@@ -60,5 +54,4 @@ const MultiSelectedValuesContainer = () => {
60
54
  disabled
61
55
  }))), [pillGroupRef, multiSelectedValue, correctPillsToShow, disabled]);
62
56
  };
63
- module.exports = __toCommonJS(MultiSelectedValuesContainer_exports);
64
57
  //# sourceMappingURL=MultiSelectedValuesContainer.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/multi-selected-values-container/MultiSelectedValuesContainer.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React, { useMemo, useContext } from 'react';\nimport { DSPillGroupV2, DSPillV2 } from '@elliemae/ds-pills';\nimport ComboBoxContext from '../../ComboBoxCTX';\nimport { useGroupPills } from './useGroupPills';\nimport { DSComboboxT } from '../../react-desc-prop-types';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids';\nimport { RemovableSelectedValuePill } from './RemovableSelectedValuePill';\nexport const MultiSelectedValuesContainer = (): JSX.Element => {\n const {\n props: { selectedValues, disabled },\n pillGroupRef,\n } = useContext(ComboBoxContext);\n\n // this is always an array because logic in controls component\n const multiSelectedValue = selectedValues as DSComboboxT.ItemOption[];\n const correctPillsToShow = useGroupPills();\n\n return useMemo(\n () => (\n <div\n style={{ width: multiSelectedValue.length > 0 ? 'max-content' : '0px' }}\n data-testid={ComboboxDataTestid.SELECTED_VALUES}\n >\n <DSPillGroupV2 innerRef={pillGroupRef}>\n {multiSelectedValue.length > 0 &&\n multiSelectedValue\n .slice(0, correctPillsToShow)\n .map((pill) => <RemovableSelectedValuePill key={pill.dsId} pill={pill} />)}\n {multiSelectedValue.length > 0 && correctPillsToShow !== multiSelectedValue.length && (\n <DSPillV2\n size=\"s\"\n labelTruncated={false}\n key=\"grouped\"\n label={`+${multiSelectedValue.length - correctPillsToShow}`}\n type=\"value\"\n disabled={disabled}\n />\n )}\n </DSPillGroupV2>\n </div>\n ),\n\n [pillGroupRef, multiSelectedValue, correctPillsToShow, disabled],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA2C;AAC3C,sBAAwC;AACxC,yBAA4B;AAC5B,2BAA8B;AAE9B,iCAAmC;AACnC,wCAA2C;AACpC,MAAM,+BAA+B,MAAmB;AAC7D,QAAM;AAAA,IACJ,OAAO,EAAE,gBAAgB;AAAA,IACzB;AAAA,MACE,6BAAW,0BAAe;AAG9B,QAAM,qBAAqB;AAC3B,QAAM,qBAAqB,wCAAc;AAEzC,SAAO,0BACL,MACE,mDAAC;AAAA,IACC,OAAO,EAAE,OAAO,mBAAmB,SAAS,IAAI,gBAAgB,MAAM;AAAA,IACtE,eAAa,8CAAmB;AAAA,KAEhC,mDAAC;AAAA,IAAc,UAAU;AAAA,KACtB,mBAAmB,SAAS,KAC3B,mBACG,MAAM,GAAG,kBAAkB,EAC3B,IAAI,CAAC,SAAS,mDAAC;AAAA,IAA2B,KAAK,KAAK;AAAA,IAAM;AAAA,GAAY,CAAE,GAC5E,mBAAmB,SAAS,KAAK,uBAAuB,mBAAmB,UAC1E,mDAAC;AAAA,IACC,MAAK;AAAA,IACL,gBAAgB;AAAA,IAChB,KAAI;AAAA,IACJ,OAAO,IAAI,mBAAmB,SAAS;AAAA,IACvC,MAAK;AAAA,IACL;AAAA,GACF,CAEJ,CACF,GAGF,CAAC,cAAc,oBAAoB,oBAAoB,QAAQ,CACjE;AACF;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA2C;AAC3C,sBAAwC;AACxC,yBAA4B;AAC5B,2BAA8B;AAE9B,iCAAmC;AACnC,wCAA2C;AACpC,MAAM,+BAA+B,MAAmB;AAC7D,QAAM;AAAA,IACJ,OAAO,EAAE,gBAAgB;AAAA,IACzB;AAAA,MACE,6BAAW,0BAAe;AAG9B,QAAM,qBAAqB;AAC3B,QAAM,qBAAqB,wCAAc;AAEzC,SAAO,0BACL,MACE,mDAAC;AAAA,IACC,OAAO,EAAE,OAAO,mBAAmB,SAAS,IAAI,gBAAgB,MAAM;AAAA,IACtE,eAAa,8CAAmB;AAAA,KAEhC,mDAAC;AAAA,IAAc,UAAU;AAAA,KACtB,mBAAmB,SAAS,KAC3B,mBACG,MAAM,GAAG,kBAAkB,EAC3B,IAAI,CAAC,SAAS,mDAAC;AAAA,IAA2B,KAAK,KAAK;AAAA,IAAM;AAAA,GAAY,CAAE,GAC5E,mBAAmB,SAAS,KAAK,uBAAuB,mBAAmB,UAC1E,mDAAC;AAAA,IACC,MAAK;AAAA,IACL,gBAAgB;AAAA,IAChB,KAAI;AAAA,IACJ,OAAO,IAAI,mBAAmB,SAAS;AAAA,IACvC,MAAK;AAAA,IACL;AAAA,GACF,CAEJ,CACF,GAGF,CAAC,cAAc,oBAAoB,oBAAoB,QAAQ,CACjE;AACF;",
6
6
  "names": []
7
7
  }
@@ -4,31 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
21
  var RemovableSelectedValuePill_exports = {};
29
22
  __export(RemovableSelectedValuePill_exports, {
30
23
  RemovableSelectedValuePill: () => RemovableSelectedValuePill
31
24
  });
25
+ module.exports = __toCommonJS(RemovableSelectedValuePill_exports);
32
26
  var React = __toESM(require("react"));
33
27
  var import_react = __toESM(require("react"));
34
28
  var import_ds_pills = require("@elliemae/ds-pills");
@@ -37,14 +31,14 @@ var import_listHelper = require("../../utils/listHelper");
37
31
  const RemovableSelectedValuePill = (props) => {
38
32
  const { pill } = props;
39
33
  const {
40
- props: { onChange, disabled, selectedValues, innerRef }
34
+ props: { onChange, isNonClearable, disabled, selectedValues, innerRef }
41
35
  } = (0, import_react.useContext)(import_ComboBoxCTX.default);
42
36
  return /* @__PURE__ */ import_react.default.createElement(import_ds_pills.DSPillV2, {
43
37
  size: "s",
44
38
  key: pill.value,
45
39
  label: pill.label,
46
40
  disabled,
47
- type: disabled ? "value" : "removable",
41
+ type: disabled || isNonClearable ? "value" : "removable",
48
42
  tabIndex: -1,
49
43
  onRemove: (e) => {
50
44
  e.stopPropagation();
@@ -53,5 +47,4 @@ const RemovableSelectedValuePill = (props) => {
53
47
  }
54
48
  });
55
49
  };
56
- module.exports = __toCommonJS(RemovableSelectedValuePill_exports);
57
50
  //# sourceMappingURL=RemovableSelectedValuePill.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/multi-selected-values-container/RemovableSelectedValuePill.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useContext } from 'react';\nimport { DSPillV2 } from '@elliemae/ds-pills';\nimport ComboBoxContext from '../../ComboBoxCTX';\nimport { DSComboboxT } from '../../react-desc-prop-types';\nimport { getSuggestedValueOnChange } from '../../utils/listHelper';\nexport const RemovableSelectedValuePill: React.ComponentType<{ pill: DSComboboxT.ItemOption }> = (props) => {\n const { pill } = props;\n const {\n props: { onChange, disabled, selectedValues, innerRef },\n } = useContext(ComboBoxContext);\n\n return (\n <DSPillV2\n size=\"s\"\n key={pill.value}\n label={pill.label}\n disabled={disabled}\n type={disabled ? 'value' : 'removable'}\n tabIndex={-1}\n onRemove={(e: React.KeyboardEvent) => {\n // preventing the menu to be opened\n e.stopPropagation();\n onChange(getSuggestedValueOnChange(pill, selectedValues), pill, e);\n innerRef.current?.focus();\n }}\n />\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkC;AAClC,sBAAyB;AACzB,yBAA4B;AAE5B,wBAA0C;AACnC,MAAM,6BAAoF,CAAC,UAAU;AAC1G,QAAM,EAAE,SAAS;AACjB,QAAM;AAAA,IACJ,OAAO,EAAE,UAAU,UAAU,gBAAgB;AAAA,MAC3C,6BAAW,0BAAe;AAE9B,SACE,mDAAC;AAAA,IACC,MAAK;AAAA,IACL,KAAK,KAAK;AAAA,IACV,OAAO,KAAK;AAAA,IACZ;AAAA,IACA,MAAM,WAAW,UAAU;AAAA,IAC3B,UAAU;AAAA,IACV,UAAU,CAAC,MAA2B;AAEpC,QAAE,gBAAgB;AAClB,eAAS,iDAA0B,MAAM,cAAc,GAAG,MAAM,CAAC;AACjE,eAAS,SAAS,MAAM;AAAA,IAC1B;AAAA,GACF;AAEJ;",
4
+ "sourcesContent": ["import React, { useContext } from 'react';\nimport { DSPillV2 } from '@elliemae/ds-pills';\nimport ComboBoxContext from '../../ComboBoxCTX';\nimport { DSComboboxT } from '../../react-desc-prop-types';\nimport { getSuggestedValueOnChange } from '../../utils/listHelper';\nexport const RemovableSelectedValuePill: React.ComponentType<{ pill: DSComboboxT.ItemOption }> = (props) => {\n const { pill } = props;\n const {\n props: { onChange, isNonClearable, disabled, selectedValues, innerRef },\n } = useContext(ComboBoxContext);\n\n return (\n <DSPillV2\n size=\"s\"\n key={pill.value}\n label={pill.label}\n disabled={disabled}\n type={disabled || isNonClearable ? 'value' : 'removable'}\n tabIndex={-1}\n onRemove={(e: React.KeyboardEvent) => {\n // preventing the menu to be opened\n e.stopPropagation();\n onChange(getSuggestedValueOnChange(pill, selectedValues), pill, e);\n innerRef.current?.focus();\n }}\n />\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkC;AAClC,sBAAyB;AACzB,yBAA4B;AAE5B,wBAA0C;AACnC,MAAM,6BAAoF,CAAC,UAAU;AAC1G,QAAM,EAAE,SAAS;AACjB,QAAM;AAAA,IACJ,OAAO,EAAE,UAAU,gBAAgB,UAAU,gBAAgB;AAAA,MAC3D,6BAAW,0BAAe;AAE9B,SACE,mDAAC;AAAA,IACC,MAAK;AAAA,IACL,KAAK,KAAK;AAAA,IACV,OAAO,KAAK;AAAA,IACZ;AAAA,IACA,MAAM,YAAY,iBAAiB,UAAU;AAAA,IAC7C,UAAU;AAAA,IACV,UAAU,CAAC,MAA2B;AAEpC,QAAE,gBAAgB;AAClB,eAAS,iDAA0B,MAAM,cAAc,GAAG,MAAM,CAAC;AACjE,eAAS,SAAS,MAAM;AAAA,IAC1B;AAAA,GACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -4,32 +4,25 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
21
  var multi_selected_values_container_exports = {};
29
22
  __export(multi_selected_values_container_exports, {
30
23
  MultiSelectedValuesContainer: () => import_MultiSelectedValuesContainer.MultiSelectedValuesContainer
31
24
  });
25
+ module.exports = __toCommonJS(multi_selected_values_container_exports);
32
26
  var React = __toESM(require("react"));
33
27
  var import_MultiSelectedValuesContainer = require("./MultiSelectedValuesContainer");
34
- module.exports = __toCommonJS(multi_selected_values_container_exports);
35
28
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/multi-selected-values-container/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["export { MultiSelectedValuesContainer } from './MultiSelectedValuesContainer';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0CAA6C;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0CAA6C;",
6
6
  "names": []
7
7
  }