@elliemae/ds-form-combobox 3.60.0-next.4 → 3.60.0-next.41

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/ComboBox.js +3 -3
  2. package/dist/cjs/ComboBox.js.map +2 -2
  3. package/dist/cjs/ComboBoxCTX.js +2 -26
  4. package/dist/cjs/ComboBoxCTX.js.map +2 -2
  5. package/dist/cjs/DSComboboxMultiT.js +52 -0
  6. package/dist/cjs/DSComboboxMultiT.js.map +7 -0
  7. package/dist/cjs/DSComboboxSingleT.js +52 -0
  8. package/dist/cjs/DSComboboxSingleT.js.map +7 -0
  9. package/dist/cjs/DSCommonComboboxPropsT.js +91 -0
  10. package/dist/cjs/DSCommonComboboxPropsT.js.map +7 -0
  11. package/dist/cjs/config/useComboBox.js +23 -8
  12. package/dist/cjs/config/useComboBox.js.map +2 -2
  13. package/dist/cjs/config/useCorrectOptions.js +11 -0
  14. package/dist/cjs/config/useCorrectOptions.js.map +2 -2
  15. package/dist/cjs/constants/index.js +4 -2
  16. package/dist/cjs/constants/index.js.map +2 -2
  17. package/dist/cjs/index.js +11 -3
  18. package/dist/cjs/index.js.map +2 -2
  19. package/dist/cjs/parts/DropdownIndicator.js.map +1 -1
  20. package/dist/cjs/parts/container/Container.js +17 -10
  21. package/dist/cjs/parts/container/Container.js.map +2 -2
  22. package/dist/cjs/parts/controls-input/useKeyboardNavigation.js +2 -0
  23. package/dist/cjs/parts/controls-input/useKeyboardNavigation.js.map +2 -2
  24. package/dist/cjs/parts/menu-list/MenuList.js +48 -44
  25. package/dist/cjs/parts/menu-list/MenuList.js.map +2 -2
  26. package/dist/cjs/parts/menu-list/useItemRenderer.js +2 -1
  27. package/dist/cjs/parts/menu-list/useItemRenderer.js.map +2 -2
  28. package/dist/cjs/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +21 -7
  29. package/dist/cjs/parts/multi-selected-values-container/MultiSelectedValuesContainer.js.map +2 -2
  30. package/dist/cjs/parts/multi-selected-values-container/RemovableSelectedValuePill.js +13 -5
  31. package/dist/cjs/parts/multi-selected-values-container/RemovableSelectedValuePill.js.map +2 -2
  32. package/dist/cjs/parts/multi-selected-values-container/useGroupPills.js +1 -1
  33. package/dist/cjs/parts/multi-selected-values-container/useGroupPills.js.map +2 -2
  34. package/dist/cjs/parts/styled.js +21 -1
  35. package/dist/cjs/parts/styled.js.map +2 -2
  36. package/dist/cjs/react-desc-prop-types.js +39 -35
  37. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  38. package/dist/cjs/sharedTypes.js.map +2 -2
  39. package/dist/cjs/utils/listHelper.js.map +2 -2
  40. package/dist/esm/ComboBox.js +3 -3
  41. package/dist/esm/ComboBox.js.map +2 -2
  42. package/dist/esm/ComboBoxCTX.js +3 -27
  43. package/dist/esm/ComboBoxCTX.js.map +2 -2
  44. package/dist/esm/DSComboboxMultiT.js +22 -0
  45. package/dist/esm/DSComboboxMultiT.js.map +7 -0
  46. package/dist/esm/DSComboboxSingleT.js +22 -0
  47. package/dist/esm/DSComboboxSingleT.js.map +7 -0
  48. package/dist/esm/DSCommonComboboxPropsT.js +61 -0
  49. package/dist/esm/DSCommonComboboxPropsT.js.map +7 -0
  50. package/dist/esm/config/useComboBox.js +25 -10
  51. package/dist/esm/config/useComboBox.js.map +2 -2
  52. package/dist/esm/config/useCorrectOptions.js +11 -0
  53. package/dist/esm/config/useCorrectOptions.js.map +2 -2
  54. package/dist/esm/constants/index.js +4 -2
  55. package/dist/esm/constants/index.js.map +2 -2
  56. package/dist/esm/index.js +11 -3
  57. package/dist/esm/index.js.map +2 -2
  58. package/dist/esm/parts/DropdownIndicator.js.map +1 -1
  59. package/dist/esm/parts/container/Container.js +17 -10
  60. package/dist/esm/parts/container/Container.js.map +2 -2
  61. package/dist/esm/parts/controls-input/useKeyboardNavigation.js +2 -0
  62. package/dist/esm/parts/controls-input/useKeyboardNavigation.js.map +2 -2
  63. package/dist/esm/parts/menu-list/MenuList.js +48 -44
  64. package/dist/esm/parts/menu-list/MenuList.js.map +2 -2
  65. package/dist/esm/parts/menu-list/useItemRenderer.js +2 -1
  66. package/dist/esm/parts/menu-list/useItemRenderer.js.map +2 -2
  67. package/dist/esm/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +22 -8
  68. package/dist/esm/parts/multi-selected-values-container/MultiSelectedValuesContainer.js.map +2 -2
  69. package/dist/esm/parts/multi-selected-values-container/RemovableSelectedValuePill.js +13 -5
  70. package/dist/esm/parts/multi-selected-values-container/RemovableSelectedValuePill.js.map +2 -2
  71. package/dist/esm/parts/multi-selected-values-container/useGroupPills.js +1 -1
  72. package/dist/esm/parts/multi-selected-values-container/useGroupPills.js.map +2 -2
  73. package/dist/esm/parts/styled.js +21 -1
  74. package/dist/esm/parts/styled.js.map +2 -2
  75. package/dist/esm/react-desc-prop-types.js +40 -36
  76. package/dist/esm/react-desc-prop-types.js.map +2 -2
  77. package/dist/esm/sharedTypes.js.map +2 -2
  78. package/dist/esm/utils/listHelper.js.map +2 -2
  79. package/dist/types/ComboBox.d.ts +9 -3
  80. package/dist/types/ComboBoxCTX.d.ts +29 -5
  81. package/dist/types/DSComboboxMultiT.d.ts +33 -0
  82. package/dist/types/DSComboboxSingleT.d.ts +37 -0
  83. package/dist/types/DSCommonComboboxPropsT.d.ts +74 -0
  84. package/dist/types/config/useComboBox.d.ts +32 -2
  85. package/dist/types/config/useCorrectOptions.d.ts +1 -1
  86. package/dist/types/config/useOptionsPerSection.d.ts +1 -1
  87. package/dist/types/constants/index.d.ts +2 -0
  88. package/dist/types/index.d.ts +6 -3
  89. package/dist/types/parts/multi-selected-values-container/RemovableSelectedValuePill.d.ts +4 -0
  90. package/dist/types/parts/styled.d.ts +13 -0
  91. package/dist/types/react-desc-prop-types.d.ts +34 -473
  92. package/dist/types/sharedTypes.d.ts +0 -27
  93. package/dist/types/utils/listHelper.d.ts +4 -4
  94. package/package.json +35 -39
@@ -37,11 +37,11 @@ module.exports = __toCommonJS(ComboBox_exports);
37
37
  var React = __toESM(require("react"));
38
38
  var import_jsx_runtime = require("react/jsx-runtime");
39
39
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
40
+ var import_ComboBoxCTX = require("./ComboBoxCTX.js");
40
41
  var import_useComboBox = require("./config/useComboBox.js");
41
42
  var import_container = require("./parts/container/index.js");
42
- var import_ComboBoxCTX = require("./ComboBoxCTX.js");
43
- var import_react_desc_prop_types = require("./react-desc-prop-types.js");
44
43
  var import_LiveRegion = require("./parts/LiveRegion.js");
44
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
45
45
  const offScreenStyle = {
46
46
  border: 0,
47
47
  clip: "rect(0 0 0 0)",
@@ -61,5 +61,5 @@ const DSComboBox = (props) => {
61
61
  };
62
62
  DSComboBox.displayName = "DSComboBox";
63
63
  const DSComboBoxWithSchema = (0, import_ds_props_helpers.describe)(DSComboBox);
64
- DSComboBoxWithSchema.propTypes = import_react_desc_prop_types.ComboboxPropTypes;
64
+ DSComboBoxWithSchema.propTypes = import_react_desc_prop_types.ComboboxPropTypesSchema;
65
65
  //# sourceMappingURL=ComboBox.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/ComboBox.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { useComboBox } from './config/useComboBox.js';\nimport { Container } from './parts/container/index.js';\nimport { ComboBoxContext } from './ComboBoxCTX.js';\nimport type { DSComboboxT } from './react-desc-prop-types.js';\nimport { ComboboxPropTypes } from './react-desc-prop-types.js';\nimport { Announcer } from './parts/LiveRegion.js';\n\nexport const offScreenStyle: React.CSSProperties = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n width: '1px',\n position: 'absolute',\n};\n\nconst DSComboBox: React.ComponentType<DSComboboxT.Props> = (props) => {\n const ctx = useComboBox(props);\n return (\n <ComboBoxContext.Provider value={ctx}>\n <Container />\n <Announcer message={props.isLoading || props.isSkeleton ? 'Loading options please wait' : ''} />\n </ComboBoxContext.Provider>\n );\n};\n\nDSComboBox.displayName = 'DSComboBox';\nconst DSComboBoxWithSchema = describe(DSComboBox);\n\nDSComboBoxWithSchema.propTypes = ComboboxPropTypes as WeakValidationMap<unknown>;\n\nexport { DSComboBox, DSComboBoxWithSchema, DSComboBox as DSComboBoxV3 };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADwBnB;AAtBJ,8BAAyB;AACzB,yBAA4B;AAC5B,uBAA0B;AAC1B,yBAAgC;AAEhC,mCAAkC;AAClC,wBAA0B;AAEnB,MAAM,iBAAsC;AAAA,EACjD,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AACZ;AAEA,MAAM,aAAqD,CAAC,UAAU;AACpE,QAAM,UAAM,gCAAY,KAAK;AAC7B,SACE,6CAAC,mCAAgB,UAAhB,EAAyB,OAAO,KAC/B;AAAA,gDAAC,8BAAU;AAAA,IACX,4CAAC,+BAAU,SAAS,MAAM,aAAa,MAAM,aAAa,gCAAgC,IAAI;AAAA,KAChG;AAEJ;AAEA,WAAW,cAAc;AACzB,MAAM,2BAAuB,kCAAS,UAAU;AAEhD,qBAAqB,YAAY;",
4
+ "sourcesContent": ["import { describe } from '@elliemae/ds-props-helpers';\nimport React from 'react';\nimport { ComboBoxContext } from './ComboBoxCTX.js';\nimport { useComboBox } from './config/useComboBox.js';\nimport type { DSCommonComboboxPropsT } from './DSCommonComboboxPropsT.js';\nimport { Container } from './parts/container/index.js';\nimport { Announcer } from './parts/LiveRegion.js';\nimport type { DSComboboxT } from './react-desc-prop-types.js';\nimport { ComboboxPropTypesSchema } from './react-desc-prop-types.js';\n\nexport const offScreenStyle: React.CSSProperties = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n width: '1px',\n position: 'absolute',\n};\n\nconst DSComboBox = <\n T extends DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[] | null =\n | DSCommonComboboxPropsT.ItemOption\n | DSCommonComboboxPropsT.ItemOption[],\n>(\n props: DSComboboxT.Props<T>,\n) => {\n const ctx = useComboBox<T>(props);\n return (\n <ComboBoxContext.Provider value={ctx}>\n <Container />\n <Announcer message={props.isLoading || props.isSkeleton ? 'Loading options please wait' : ''} />\n </ComboBoxContext.Provider>\n );\n};\n\nDSComboBox.displayName = 'DSComboBox';\nconst DSComboBoxWithSchema = describe(DSComboBox);\n\nDSComboBoxWithSchema.propTypes = ComboboxPropTypesSchema;\n\nexport { DSComboBox, DSComboBox as DSComboBoxV3, DSComboBoxWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8BnB;AA9BJ,8BAAyB;AAEzB,yBAAgC;AAChC,yBAA4B;AAE5B,uBAA0B;AAC1B,wBAA0B;AAE1B,mCAAwC;AAEjC,MAAM,iBAAsC;AAAA,EACjD,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AACZ;AAEA,MAAM,aAAa,CAKjB,UACG;AACH,QAAM,UAAM,gCAAe,KAAK;AAChC,SACE,6CAAC,mCAAgB,UAAhB,EAAyB,OAAO,KAC/B;AAAA,gDAAC,8BAAU;AAAA,IACX,4CAAC,+BAAU,SAAS,MAAM,aAAa,MAAM,aAAa,gCAAgC,IAAI;AAAA,KAChG;AAEJ;AAEA,WAAW,cAAc;AACzB,MAAM,2BAAuB,kCAAS,UAAU;AAEhD,qBAAqB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -29,35 +29,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var ComboBoxCTX_exports = {};
30
30
  __export(ComboBoxCTX_exports, {
31
31
  ComboBoxContext: () => ComboBoxContext,
32
- default: () => ComboBoxCTX_default,
33
- defaultProps: () => defaultProps,
34
- noop: () => noop
32
+ default: () => ComboBoxCTX_default
35
33
  });
36
34
  module.exports = __toCommonJS(ComboBoxCTX_exports);
37
35
  var React = __toESM(require("react"));
38
36
  var import_react = require("react");
39
- function noop(..._args) {
40
- }
41
- const defaultProps = {
42
- hasError: false,
43
- inline: false,
44
- withoutPortal: false,
45
- disabled: false,
46
- useMask: noop,
47
- innerRef: (0, import_react.createRef)(),
48
- startPlacementPreference: "bottom-start",
49
- placementOrderPreference: ["bottom-start", "top-start"],
50
- noOptionsMessage: "No Matches Found",
51
- isNonClearable: false,
52
- onlySelectable: false,
53
- isSkeleton: false,
54
- // override in useCombobox to avoid ref duplications when more than one cb is used
55
- applyAriaDisabled: false,
56
- readOnly: false,
57
- isMenuOpenableWithReadOnly: false,
58
- forceFocusFirstOptionOnType: false
59
- };
60
- const defaultContext = {};
61
- const ComboBoxContext = (0, import_react.createContext)(defaultContext);
37
+ const ComboBoxContext = (0, import_react.createContext)({});
62
38
  var ComboBoxCTX_default = ComboBoxContext;
63
39
  //# sourceMappingURL=ComboBoxCTX.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/ComboBoxCTX.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { createContext, createRef } from 'react';\nimport type { DSComboboxT } from './react-desc-prop-types.js';\nimport type { DSComboboxInternalsT } from './sharedTypes.js';\n// eslint-disable-next-line @typescript-eslint/no-empty-function\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\nexport function noop<T extends unknown[]>(..._args: T): void {}\n\nexport const defaultProps: DSComboboxT.DefaultProps = {\n hasError: false,\n inline: false,\n withoutPortal: false,\n disabled: false,\n useMask: noop,\n innerRef: createRef(),\n startPlacementPreference: 'bottom-start',\n placementOrderPreference: ['bottom-start', 'top-start'],\n noOptionsMessage: 'No Matches Found',\n isNonClearable: false,\n onlySelectable: false,\n isSkeleton: false,\n // override in useCombobox to avoid ref duplications when more than one cb is used\n applyAriaDisabled: false,\n readOnly: false,\n isMenuOpenableWithReadOnly: false,\n forceFocusFirstOptionOnType: false,\n};\n\nconst defaultContext = {} as DSComboboxInternalsT.ComboBoxContextT;\n/** Context for cross component communication */\nexport const ComboBoxContext = createContext(defaultContext);\n\nexport default ComboBoxContext;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAyC;AAMlC,SAAS,QAA6B,OAAgB;AAAC;AAEvD,MAAM,eAAyC;AAAA,EACpD,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,UAAU;AAAA,EACV,SAAS;AAAA,EACT,cAAU,wBAAU;AAAA,EACpB,0BAA0B;AAAA,EAC1B,0BAA0B,CAAC,gBAAgB,WAAW;AAAA,EACtD,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,YAAY;AAAA;AAAA,EAEZ,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,4BAA4B;AAAA,EAC5B,6BAA6B;AAC/B;AAEA,MAAM,iBAAiB,CAAC;AAEjB,MAAM,sBAAkB,4BAAc,cAAc;AAE3D,IAAO,sBAAQ;",
4
+ "sourcesContent": ["import { createContext } from 'react';\nimport type { UseComboBoxReturnType } from './config/useComboBox.js';\n\n/** Context for cross component communication */\nexport const ComboBoxContext = createContext({} as UseComboBoxReturnType);\n\nexport default ComboBoxContext;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAIvB,MAAM,sBAAkB,4BAAc,CAAC,CAA0B;AAExE,IAAO,sBAAQ;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,52 @@
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 DSComboboxMultiT_exports = {};
30
+ __export(DSComboboxMultiT_exports, {
31
+ multiComboboxPropTypes: () => multiComboboxPropTypes,
32
+ multiComboboxPropTypesSchema: () => multiComboboxPropTypesSchema
33
+ });
34
+ module.exports = __toCommonJS(DSComboboxMultiT_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
37
+ var import_DSCommonComboboxPropsT = require("./DSCommonComboboxPropsT.js");
38
+ const multiComboboxPropTypes = {
39
+ ...import_ds_props_helpers.globalAttributesPropTypes,
40
+ ...import_ds_props_helpers.xstyledPropTypes,
41
+ ...import_DSCommonComboboxPropsT.commonComboboxPropTypes,
42
+ onChange: import_ds_props_helpers.PropTypes.func.isRequired.description(
43
+ "Multi-select change callback. Receives the full next selection array; use an empty array when no option remains selected."
44
+ ).signature(
45
+ "(suggestedValue: ItemOption[], selectedOption: SelectionableOptions, event: React.MouseEvent | React.KeyboardEvent) => void"
46
+ ),
47
+ selectedValues: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.object).isRequired.description(
48
+ "Multi-select values as an array of selectable option objects. Use an empty array for no selection."
49
+ )
50
+ };
51
+ const multiComboboxPropTypesSchema = multiComboboxPropTypes;
52
+ //# sourceMappingURL=DSComboboxMultiT.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/DSComboboxMultiT.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { globalAttributesPropTypes, PropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type React from 'react';\nimport { commonComboboxPropTypes, type DSCommonComboboxPropsT } from './DSCommonComboboxPropsT.js';\n\nexport declare namespace DSComboboxMultiT {\n export type CommonItemOptions = DSCommonComboboxPropsT.CommonItemOptions;\n export type ItemSeparatorOptions = DSCommonComboboxPropsT.ItemSeparatorOptions;\n export type ItemSectionOptions = DSCommonComboboxPropsT.ItemSectionOptions;\n export type ItemOption = DSCommonComboboxPropsT.ItemOption;\n export type ItemCreatableOption = DSCommonComboboxPropsT.ItemCreatableOption;\n\n export type SelectionableOptions = DSCommonComboboxPropsT.SelectionableOptions;\n export type LayoutOptions = DSCommonComboboxPropsT.LayoutOptions;\n export type OptionTypes = DSCommonComboboxPropsT.OptionTypes;\n\n export interface RequiredProps extends DSCommonComboboxPropsT.RequiredProps {\n selectedValues: DSCommonComboboxPropsT.ItemOption[];\n onChange: (\n suggestedValue: DSCommonComboboxPropsT.ItemOption[],\n selectedOption: DSCommonComboboxPropsT.SelectionableOptions,\n event: React.MouseEvent | React.KeyboardEvent,\n ) => void;\n }\n export interface DefaultProps extends DSCommonComboboxPropsT.DefaultProps {}\n export interface OptionalProps extends DSCommonComboboxPropsT.OptionalProps {}\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLElement>,\n keyof RequiredProps | keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLElement>,\n keyof RequiredProps | keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\n/**\n * Multi-select schema variant.\n *\n * - `selectedValues` is always an array of selectable option objects.\n * - empty array indicates no current selection.\n */\nexport const multiComboboxPropTypes: DSPropTypesSchema<DSComboboxMultiT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n ...commonComboboxPropTypes,\n onChange: PropTypes.func.isRequired\n .description(\n 'Multi-select change callback. Receives the full next selection array; use an empty array when no option remains selected.',\n )\n .signature(\n '(suggestedValue: ItemOption[], selectedOption: SelectionableOptions, event: React.MouseEvent | React.KeyboardEvent) => void',\n ),\n selectedValues: PropTypes.arrayOf(PropTypes.object).isRequired.description(\n 'Multi-select values as an array of selectable option objects. Use an empty array for no selection.',\n ),\n};\n\nexport const multiComboboxPropTypesSchema = multiComboboxPropTypes as unknown as ValidationMap<DSComboboxMultiT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAAuE;AAEvE,oCAAqE;AAkD9D,MAAM,yBAAoE;AAAA,EAC/E,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,kCAAU,KAAK,WACtB;AAAA,IACC;AAAA,EACF,EACC;AAAA,IACC;AAAA,EACF;AAAA,EACF,gBAAgB,kCAAU,QAAQ,kCAAU,MAAM,EAAE,WAAW;AAAA,IAC7D;AAAA,EACF;AACF;AAEO,MAAM,+BAA+B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,52 @@
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 DSComboboxSingleT_exports = {};
30
+ __export(DSComboboxSingleT_exports, {
31
+ singleComboboxPropTypes: () => singleComboboxPropTypes,
32
+ singleComboboxPropTypesSchema: () => singleComboboxPropTypesSchema
33
+ });
34
+ module.exports = __toCommonJS(DSComboboxSingleT_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
37
+ var import_DSCommonComboboxPropsT = require("./DSCommonComboboxPropsT.js");
38
+ const singleComboboxPropTypes = {
39
+ ...import_ds_props_helpers.globalAttributesPropTypes,
40
+ ...import_ds_props_helpers.xstyledPropTypes,
41
+ ...import_DSCommonComboboxPropsT.commonComboboxPropTypes,
42
+ onChange: import_ds_props_helpers.PropTypes.func.isRequired.description(
43
+ "Single-select change callback. Receives the next single selected option or null when selection is cleared."
44
+ ).signature(
45
+ "(suggestedValue: ItemOption | null, selectedOption: SelectionableOptions, event: React.MouseEvent | React.KeyboardEvent) => void"
46
+ ),
47
+ selectedValues: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.object, import_ds_props_helpers.PropTypes.oneOf([null])]).isRequired.description(
48
+ "Single-select value. Use a selectable option object for a selected state, or null for no selection."
49
+ )
50
+ };
51
+ const singleComboboxPropTypesSchema = singleComboboxPropTypes;
52
+ //# sourceMappingURL=DSComboboxSingleT.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/DSComboboxSingleT.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { globalAttributesPropTypes, PropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type React from 'react';\nimport { commonComboboxPropTypes, type DSCommonComboboxPropsT } from './DSCommonComboboxPropsT.js';\n\nexport declare namespace DSComboboxSingleT {\n export type CommonItemOptions = DSCommonComboboxPropsT.CommonItemOptions;\n export type ItemSeparatorOptions = DSCommonComboboxPropsT.ItemSeparatorOptions;\n export type ItemSectionOptions = DSCommonComboboxPropsT.ItemSectionOptions;\n export type ItemOption = DSCommonComboboxPropsT.ItemOption;\n export type ItemCreatableOption = DSCommonComboboxPropsT.ItemCreatableOption;\n\n export type SelectionableOptions = DSCommonComboboxPropsT.SelectionableOptions;\n export type LayoutOptions = DSCommonComboboxPropsT.LayoutOptions;\n export type OptionTypes = DSCommonComboboxPropsT.OptionTypes;\n\n export interface RequiredProps extends DSCommonComboboxPropsT.RequiredProps {\n selectedValue: DSCommonComboboxPropsT.ItemOption | null;\n onChange: (\n suggestedValue: DSCommonComboboxPropsT.ItemOption | null,\n selectedOption: DSCommonComboboxPropsT.SelectionableOptions,\n event: React.MouseEvent | React.KeyboardEvent,\n ) => void;\n }\n export interface DefaultProps extends DSCommonComboboxPropsT.DefaultProps {}\n export interface OptionalProps extends DSCommonComboboxPropsT.OptionalProps {}\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLElement>,\n keyof RequiredProps | keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLElement>,\n keyof RequiredProps | keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\ntype SingleComboboxWithSelectedValues = Omit<DSComboboxSingleT.Props, 'selectedValue'> & {\n selectedValues: DSComboboxSingleT.RequiredProps['selectedValue'];\n};\n\n/**\n * Single-select schema variant.\n *\n * - `selectedValues` is a single selectable option object.\n * - `null` indicates no current selection.\n */\nexport const singleComboboxPropTypes: DSPropTypesSchema<SingleComboboxWithSelectedValues> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n ...commonComboboxPropTypes,\n onChange: PropTypes.func.isRequired\n .description(\n 'Single-select change callback. Receives the next single selected option or null when selection is cleared.',\n )\n .signature(\n '(suggestedValue: ItemOption | null, selectedOption: SelectionableOptions, event: React.MouseEvent | React.KeyboardEvent) => void',\n ),\n selectedValues: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf([null])]).isRequired.description(\n 'Single-select value. Use a selectable option object for a selected state, or null for no selection.',\n ),\n};\n\nexport const singleComboboxPropTypesSchema =\n singleComboboxPropTypes as unknown as ValidationMap<SingleComboboxWithSelectedValues>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAAuE;AAEvE,oCAAqE;AAsD9D,MAAM,0BAA+E;AAAA,EAC1F,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,kCAAU,KAAK,WACtB;AAAA,IACC;AAAA,EACF,EACC;AAAA,IACC;AAAA,EACF;AAAA,EACF,gBAAgB,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW;AAAA,IAC1F;AAAA,EACF;AACF;AAEO,MAAM,gCACX;",
6
+ "names": []
7
+ }
@@ -0,0 +1,91 @@
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 DSCommonComboboxPropsT_exports = {};
30
+ __export(DSCommonComboboxPropsT_exports, {
31
+ commonComboboxPropTypes: () => commonComboboxPropTypes
32
+ });
33
+ module.exports = __toCommonJS(DSCommonComboboxPropsT_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
36
+ const commonComboboxPropTypes = {
37
+ placeholder: import_ds_props_helpers.PropTypes.string.description(
38
+ "Input placeholder text. Note: announcement behavior may be handled by component logic for accessibility, while visible placeholder text remains as provided."
39
+ ),
40
+ allOptions: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.object, import_ds_props_helpers.PropTypes.string])).isRequired.description(
41
+ "Full list of options and layout rows used by the combobox before filtering."
42
+ ),
43
+ filteredOptions: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.object).description(
44
+ "Filtered list rendered in the menu for the current input value. THIS DOES NOT SUPPORT STRING OPTIONS, ALL OPTIONS MUST BE OBJECTS."
45
+ ),
46
+ disabled: import_ds_props_helpers.PropTypes.bool.description("Disables user interaction with the combobox input and menu trigger.").defaultValue("false"),
47
+ autoFocus: import_ds_props_helpers.PropTypes.bool.description("Automatically focuses the input on mount when true."),
48
+ hasError: import_ds_props_helpers.PropTypes.bool.description("Applies error styling/state to the combobox.").defaultValue("false"),
49
+ noOptionsMessage: import_ds_props_helpers.PropTypes.string.description("Message displayed when no options match the current filter.").defaultValue("No Matches Found"),
50
+ onFilter: import_ds_props_helpers.PropTypes.func.description("Called when input text changes and options are filtered.").signature("(newOptions: OptionTypes[], inputValue?: string) => void"),
51
+ onCreate: import_ds_props_helpers.PropTypes.func.description("Called when the user creates a new option from free-text input.").signature("(label: string) => void"),
52
+ onCancel: import_ds_props_helpers.PropTypes.func.description("Called when Escape dismisses/closes the menu (effectively menu dismiss semantics).").signature("() => void"),
53
+ onMenuChange: import_ds_props_helpers.PropTypes.func.description("Called when the menu open state changes.").signature(
54
+ "(state: boolean, reason: string, e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>) => void"
55
+ ),
56
+ menuMinWidth: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.number, import_ds_props_helpers.PropTypes.string]).description(
57
+ "Minimum menu width. Numeric values are interpreted as px."
58
+ ),
59
+ menuMaxHeight: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.number, import_ds_props_helpers.PropTypes.string]).description('Maximum menu height. Will always append "px" to the provided values.').defaultValue("300"),
60
+ withoutPortal: import_ds_props_helpers.PropTypes.bool.description(
61
+ "When true the contextual menu DOM will render as part of the same parent element of the input instead of the body tag."
62
+ ).defaultValue("false"),
63
+ innerRef: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.func, import_ds_props_helpers.PropTypes.shape({ current: import_ds_props_helpers.PropTypes.object })]).description("Mutable ref object or callback ref assigned to the underlying input.").defaultValue("createRef()"),
64
+ onlySelectable: import_ds_props_helpers.PropTypes.bool.description("Disables free-text filtering and allows only selectable option values.").defaultValue("false"),
65
+ isSkeleton: import_ds_props_helpers.PropTypes.bool.description("Displays the component in skeleton loading mode.").defaultValue("false"),
66
+ applyAriaDisabled: import_ds_props_helpers.PropTypes.bool.description(
67
+ "Applies disabled semantics for accessibility while preserving focusability. Primary action remains blocked."
68
+ ).defaultValue("false"),
69
+ readOnly: import_ds_props_helpers.PropTypes.bool.description("Makes input content non-editable while keeping the field accessible.").defaultValue("false"),
70
+ isMenuOpenableWithReadOnly: import_ds_props_helpers.PropTypes.bool.description("Controls whether the menu may still open while `readOnly` is true.").defaultValue("false"),
71
+ onSelectAll: import_ds_props_helpers.PropTypes.func.description("Deprecated callback fired when selecting all options.").signature("(suggestedValue: OptionTypes[] | [], event: React.MouseEvent | React.KeyboardEvent) => void").deprecated({ version: "25.2" }),
72
+ popperProps: import_ds_props_helpers.PropTypes.object.description(
73
+ "Pass-through props forwarded to the floating wrapper implementation. Behavior is primarily defined by the floating wrapper contract."
74
+ ),
75
+ forceFocusFirstOptionOnType: import_ds_props_helpers.PropTypes.bool.description("When typing, moves pseudo focus to the first available option.").defaultValue("false"),
76
+ placementOrderPreference: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.string).description(
77
+ "When the floating menu cannot be placed in the preferred start placement, it will attempt placements in the order defined by this array."
78
+ ).defaultValue('["bottom-start", "top-start"]'),
79
+ startPlacementPreference: import_ds_props_helpers.PropTypes.string.description("If possible, the contextual menu will position first and foremost according to this placement.").defaultValue("bottom-start"),
80
+ inline: import_ds_props_helpers.PropTypes.bool.description("Renders menu using inline positioning strategy when true.").defaultValue("false"),
81
+ isNonClearable: import_ds_props_helpers.PropTypes.bool.description("Prevents clearing the current selection when true, in a select-like fashion.").defaultValue("false"),
82
+ useMask: import_ds_props_helpers.PropTypes.func.description(
83
+ "Mask hook/function returning input mask handlers. Designed for the design system masks (e.g. usePhoneMask) but accepts any compatible implementation."
84
+ ).defaultValue("() => {}"),
85
+ isMenuOpen: import_ds_props_helpers.PropTypes.bool.description("Controlled open state for the menu."),
86
+ isLoading: import_ds_props_helpers.PropTypes.bool.description("Shows loading state while options are being fetched."),
87
+ onKeyDown: import_ds_props_helpers.PropTypes.func.description(
88
+ "Callback for key down events on the input text element only (not a root-level/global keyboard handler). This is intentionally narrower than generic global onKeyDown behavior."
89
+ ).signature("(e: React.KeyboardEvent<HTMLInputElement>, value: ItemOption) => void")
90
+ };
91
+ //# sourceMappingURL=DSCommonComboboxPropsT.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/DSCommonComboboxPropsT.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport type { DSFloatingWrapperT, DSHookFloatingContextT } from '@elliemae/ds-floating-context';\nimport type { DSMaskT } from '@elliemae/ds-form-helpers-mask-hooks';\nimport type { DSPropTypesSchema, GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { SizingProps } from '@elliemae/ds-system';\nimport type React from 'react';\n\nexport declare function noop<T extends unknown[]>(..._args: T): void;\n\nexport declare namespace DSCommonComboboxPropsT {\n export interface CommonItemOptions extends GlobalAttributesT {\n dsId: string;\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n render?: React.ComponentType<unknown>;\n }\n export interface ItemSeparatorOptions extends CommonItemOptions {\n type: 'separator';\n }\n export interface ItemSectionOptions extends CommonItemOptions {\n type: 'section';\n label: string;\n options: OptionTypes[];\n }\n export interface ItemOption extends CommonItemOptions {\n value: string;\n label: string;\n type: 'option';\n }\n export interface ItemCreatableOption extends CommonItemOptions {\n label: string;\n type: 'creatable';\n }\n export type SelectionableOptions = ItemOption | ItemCreatableOption;\n export type LayoutOptions = ItemSeparatorOptions | ItemSectionOptions;\n export type OptionTypes = SelectionableOptions | LayoutOptions;\n\n export interface RequiredProps {\n allOptions: OptionTypes[];\n }\n export interface DefaultProps {\n startPlacementPreference: DSHookFloatingContextT.PopperPlacementsT;\n placementOrderPreference: DSHookFloatingContextT.PopperPlacementsT[];\n hasError: boolean;\n inline: boolean;\n withoutPortal: boolean;\n isNonClearable: boolean;\n disabled: boolean;\n noOptionsMessage: string;\n innerRef: React.MutableRefObject<HTMLInputElement | null> | ((ref: HTMLInputElement | null) => void);\n useMask: DSMaskT.Hook | typeof noop;\n onlySelectable: boolean;\n isSkeleton: boolean;\n applyAriaDisabled: boolean;\n readOnly: boolean;\n isMenuOpenableWithReadOnly: boolean;\n forceFocusFirstOptionOnType: boolean;\n menuMaxHeight: SizingProps['maxHeight'];\n }\n export interface OptionalProps {\n menuMinWidth?: SizingProps['minWidth'];\n placeholder?: string;\n autoFocus?: boolean;\n filteredOptions?: OptionTypes[];\n isMenuOpen?: boolean;\n onMenuChange?: (\n state: boolean,\n reason: string,\n e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>,\n ) => void;\n onCreate?: (label: string) => void;\n onFilter?: (newOptions: OptionTypes[], inputValue?: string) => void;\n onCancel?: () => void;\n onSelectAll?: (suggestedValue: OptionTypes[] | [], event: React.MouseEvent | React.KeyboardEvent) => void;\n onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>, value: ItemOption) => void;\n isLoading?: boolean;\n popperProps?: DSFloatingWrapperT.Props;\n }\n}\n\ntype CommonComboboxProps = DSCommonComboboxPropsT.RequiredProps &\n DSCommonComboboxPropsT.DefaultProps &\n DSCommonComboboxPropsT.OptionalProps;\n\nexport const commonComboboxPropTypes: DSPropTypesSchema<CommonComboboxProps> = {\n placeholder: PropTypes.string.description(\n 'Input placeholder text. Note: announcement behavior may be handled by component logic for accessibility, while visible placeholder text remains as provided.',\n ),\n allOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.object, PropTypes.string])).isRequired.description(\n 'Full list of options and layout rows used by the combobox before filtering.',\n ),\n filteredOptions: PropTypes.arrayOf(PropTypes.object).description(\n 'Filtered list rendered in the menu for the current input value. THIS DOES NOT SUPPORT STRING OPTIONS, ALL OPTIONS MUST BE OBJECTS.',\n ),\n disabled: PropTypes.bool\n .description('Disables user interaction with the combobox input and menu trigger.')\n .defaultValue('false'),\n autoFocus: PropTypes.bool.description('Automatically focuses the input on mount when true.'),\n hasError: PropTypes.bool.description('Applies error styling/state to the combobox.').defaultValue('false'),\n noOptionsMessage: PropTypes.string\n .description('Message displayed when no options match the current filter.')\n .defaultValue('No Matches Found'),\n onFilter: PropTypes.func\n .description('Called when input text changes and options are filtered.')\n .signature('(newOptions: OptionTypes[], inputValue?: string) => void'),\n onCreate: PropTypes.func\n .description('Called when the user creates a new option from free-text input.')\n .signature('(label: string) => void'),\n onCancel: PropTypes.func\n .description('Called when Escape dismisses/closes the menu (effectively menu dismiss semantics).')\n .signature('() => void'),\n onMenuChange: PropTypes.func\n .description('Called when the menu open state changes.')\n .signature(\n '(state: boolean, reason: string, e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>) => void',\n ),\n menuMinWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description(\n 'Minimum menu width. Numeric values are interpreted as px.',\n ),\n menuMaxHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('Maximum menu height. Will always append \"px\" to the provided values.')\n .defaultValue('300'),\n withoutPortal: PropTypes.bool\n .description(\n 'When true the contextual menu DOM will render as part of the same parent element of the input instead of the body tag.',\n )\n .defaultValue('false'),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.object })])\n .description('Mutable ref object or callback ref assigned to the underlying input.')\n .defaultValue('createRef()'),\n onlySelectable: PropTypes.bool\n .description('Disables free-text filtering and allows only selectable option values.')\n .defaultValue('false'),\n isSkeleton: PropTypes.bool.description('Displays the component in skeleton loading mode.').defaultValue('false'),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Applies disabled semantics for accessibility while preserving focusability. Primary action remains blocked.',\n )\n .defaultValue('false'),\n readOnly: PropTypes.bool\n .description('Makes input content non-editable while keeping the field accessible.')\n .defaultValue('false'),\n isMenuOpenableWithReadOnly: PropTypes.bool\n .description('Controls whether the menu may still open while `readOnly` is true.')\n .defaultValue('false'),\n onSelectAll: PropTypes.func\n .description('Deprecated callback fired when selecting all options.')\n .signature('(suggestedValue: OptionTypes[] | [], event: React.MouseEvent | React.KeyboardEvent) => void')\n .deprecated({ version: '25.2' }),\n popperProps: PropTypes.object.description(\n 'Pass-through props forwarded to the floating wrapper implementation. Behavior is primarily defined by the floating wrapper contract.',\n ),\n forceFocusFirstOptionOnType: PropTypes.bool\n .description('When typing, moves pseudo focus to the first available option.')\n .defaultValue('false'),\n placementOrderPreference: PropTypes.arrayOf(PropTypes.string)\n .description(\n 'When the floating menu cannot be placed in the preferred start placement, it will attempt placements in the order defined by this array.',\n )\n .defaultValue('[\"bottom-start\", \"top-start\"]'),\n startPlacementPreference: PropTypes.string\n .description('If possible, the contextual menu will position first and foremost according to this placement.')\n .defaultValue('bottom-start'),\n inline: PropTypes.bool.description('Renders menu using inline positioning strategy when true.').defaultValue('false'),\n isNonClearable: PropTypes.bool\n .description('Prevents clearing the current selection when true, in a select-like fashion.')\n .defaultValue('false'),\n useMask: PropTypes.func\n .description(\n 'Mask hook/function returning input mask handlers. Designed for the design system masks (e.g. usePhoneMask) but accepts any compatible implementation.',\n )\n .defaultValue('() => {}'),\n isMenuOpen: PropTypes.bool.description('Controlled open state for the menu.'),\n isLoading: PropTypes.bool.description('Shows loading state while options are being fetched.'),\n onKeyDown: PropTypes.func\n .description(\n 'Callback for key down events on the input text element only (not a root-level/global keyboard handler). This is intentionally narrower than generic global onKeyDown behavior.',\n )\n .signature('(e: React.KeyboardEvent<HTMLInputElement>, value: ItemOption) => void'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": "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",
6
+ "names": []
7
+ }
@@ -32,17 +32,22 @@ __export(useComboBox_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(useComboBox_exports);
34
34
  var React = __toESM(require("react"));
35
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
35
36
  var import_react = require("react");
36
37
  var import_uid = require("uid");
37
- var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
- var import_ComboBoxCTX = require("../ComboBoxCTX.js");
39
38
  var import_react_desc_prop_types = require("../react-desc-prop-types.js");
40
39
  var import_theming = require("../theming.js");
41
40
  var import_listHelper = require("../utils/listHelper.js");
42
41
  var import_useCorrectOptions = require("./useCorrectOptions.js");
43
42
  var import_useOptionsPerSection = require("./useOptionsPerSection.js");
44
43
  const useComboBox = (props) => {
45
- const propsWithDefaults = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_ComboBoxCTX.defaultProps);
44
+ const propsWithDefaults = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(
45
+ props,
46
+ // we have a weird inference going on in this component
47
+ // weird because we are even renaming selectedValues to selectedValue for the single combobox,
48
+ // type safety here is flanky, we need to cast this, as a one ad-hoc exception
49
+ import_react_desc_prop_types.defaultProps
50
+ );
46
51
  (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefaults, import_react_desc_prop_types.ComboboxPropTypes, import_theming.DSComboBoxName);
47
52
  const [showPopover, setShowPopover] = (0, import_react.useState)(false);
48
53
  const [referenceElement, setReferenceElement] = (0, import_react.useState)(null);
@@ -53,7 +58,17 @@ const useComboBox = (props) => {
53
58
  const selectedOptionsRef = (0, import_react.useRef)(null);
54
59
  const controlsWrapperRef = (0, import_react.useRef)(null);
55
60
  const pillGroupRef = (0, import_react.useRef)(null);
56
- const { id, selectedValues, isMenuOpen, onMenuChange, applyAriaDisabled } = propsWithDefaults;
61
+ const {
62
+ id,
63
+ selectedValues,
64
+ isMenuOpen,
65
+ onMenuChange,
66
+ applyAriaDisabled,
67
+ forceFocusFirstOptionOnType,
68
+ inline,
69
+ readOnly,
70
+ isMenuOpenableWithReadOnly
71
+ } = propsWithDefaults;
57
72
  const instanceUid = (0, import_react.useMemo)(() => id || (0, import_uid.uid)(5), [id]);
58
73
  const menuState = (0, import_react.useMemo)(() => {
59
74
  if (isMenuOpen !== void 0) return isMenuOpen;
@@ -83,12 +98,12 @@ const useComboBox = (props) => {
83
98
  );
84
99
  const [focusOptionIdx, setFocusOptionIdx] = (0, import_react.useState)("");
85
100
  (0, import_react.useEffect)(() => {
86
- if (inputValue && propsWithDefaults.forceFocusFirstOptionOnType) {
101
+ if (inputValue && forceFocusFirstOptionOnType) {
87
102
  const focusedValue = (0, import_listHelper.getFirstOption)(correctOptions);
88
103
  setFocusOptionIdx(focusedValue);
89
104
  scrollOptionIntoView(focusedValue, { align: "center" });
90
105
  }
91
- }, [correctOptions, inputValue, propsWithDefaults.forceFocusFirstOptionOnType, scrollOptionIntoView, selectedValues]);
106
+ }, [correctOptions, inputValue, forceFocusFirstOptionOnType, scrollOptionIntoView, selectedValues]);
92
107
  const setMenuState = (0, import_react.useCallback)(
93
108
  (newState, reason, e) => {
94
109
  if (applyAriaDisabled) return;
@@ -105,11 +120,11 @@ const useComboBox = (props) => {
105
120
  [applyAriaDisabled, onMenuChange, inputValue, focusOptionIdx, selectedValues, correctOptions, scrollOptionIntoView]
106
121
  );
107
122
  (0, import_react.useEffect)(() => {
108
- if (propsWithDefaults.inline) {
123
+ if (inline) {
109
124
  setMenuState(true, "inline");
110
125
  }
111
126
  }, []);
112
- const shouldPreventContextMenuOpening = propsWithDefaults.readOnly && !propsWithDefaults.isMenuOpenableWithReadOnly;
127
+ const shouldPreventContextMenuOpening = readOnly && !isMenuOpenableWithReadOnly;
113
128
  const ctx = (0, import_react.useMemo)(
114
129
  () => ({
115
130
  props: { ...propsWithDefaults },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/config/useComboBox.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useMemo, useState, useRef, useCallback, useEffect } from 'react';\nimport { uid } from 'uid';\nimport { type DSFastListT } from '@elliemae/ds-fast-list';\n\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { defaultProps } from '../ComboBoxCTX.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { ComboboxPropTypes } from '../react-desc-prop-types.js';\nimport type { DSComboboxInternalsT } from '../sharedTypes.js';\nimport { DSComboBoxName } from '../theming.js';\nimport { getFirstOption, isSelectedValueEmpty } from '../utils/listHelper.js';\nimport { useCorrectOptions } from './useCorrectOptions.js';\nimport { useOptionsPerSection } from './useOptionsPerSection.js';\n\nexport const useComboBox = (props: DSComboboxT.Props): DSComboboxInternalsT.ComboBoxContextT => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSComboboxT.InternalProps>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefaults, ComboboxPropTypes, DSComboBoxName);\n const [showPopover, setShowPopover] = useState<boolean>(false);\n const [referenceElement, setReferenceElement] = useState<HTMLElement | null>(null);\n\n const [inputValue, setInputValue] = useState<string>('');\n const [hasFocus, setHasFocus] = useState<boolean>(false);\n\n const internalRef = useRef<HTMLInputElement>(null);\n const wrapperListRef = useRef<HTMLDivElement>(null);\n\n const selectedOptionsRef = useRef<HTMLDivElement>(null);\n const controlsWrapperRef = useRef<HTMLDivElement>(null);\n const pillGroupRef = useRef<HTMLDivElement>(null);\n\n const { id, selectedValues, isMenuOpen, onMenuChange, applyAriaDisabled } = propsWithDefaults;\n\n const instanceUid = useMemo(() => id || uid(5), [id]);\n\n const menuState = useMemo(() => {\n if (isMenuOpen !== undefined) return isMenuOpen;\n return showPopover;\n }, [showPopover, isMenuOpen]);\n\n // ---------------------------------------------------------------------------\n // Options with creatable option + filtered by selected\n // ---------------------------------------------------------------------------\n\n const correctOptions = useCorrectOptions(propsWithDefaults, inputValue);\n\n const optionsPerSection = useOptionsPerSection(correctOptions);\n\n const actionRef: DSComboboxT.ActionRefVirtualized = {\n scrollTo: () => {},\n };\n\n const listRef = useRef<DSComboboxT.ActionRefVirtualized>(actionRef);\n\n // ===========================================================================\n // Scroll into view function\n // ===========================================================================\n const scrollOptionIntoView = useCallback(\n (dsId: string, opts: DSFastListT.ScrollToOptions = { align: 'center' } as DSFastListT.ScrollToOptions) => {\n listRef.current.scrollTo(\n correctOptions.findIndex((opt) => opt.dsId === dsId),\n opts,\n );\n requestAnimationFrame(() => {\n listRef.current.scrollTo(\n correctOptions.findIndex((opt) => opt.dsId === dsId),\n opts,\n );\n });\n },\n [correctOptions],\n );\n\n // ===========================================================================\n // Init focused option when opening the menu list\n // ===========================================================================\n\n const [focusOptionIdx, setFocusOptionIdx] = useState<string>('');\n\n useEffect(() => {\n if (inputValue && propsWithDefaults.forceFocusFirstOptionOnType) {\n const focusedValue = getFirstOption(correctOptions);\n setFocusOptionIdx(focusedValue);\n scrollOptionIntoView(focusedValue, { align: 'center' });\n }\n }, [correctOptions, inputValue, propsWithDefaults.forceFocusFirstOptionOnType, scrollOptionIntoView, selectedValues]);\n\n const setMenuState = useCallback(\n (\n newState: boolean,\n reason: string,\n e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>,\n ) => {\n if (applyAriaDisabled) return;\n if (onMenuChange !== undefined) onMenuChange(newState, reason, e);\n setShowPopover(newState);\n if (!inputValue && newState && !focusOptionIdx && !isSelectedValueEmpty(selectedValues)) {\n const focusedValue = getFirstOption(correctOptions, selectedValues);\n setFocusOptionIdx(focusedValue);\n scrollOptionIntoView(focusedValue, { align: 'center' });\n } else {\n setFocusOptionIdx('');\n }\n },\n [applyAriaDisabled, onMenuChange, inputValue, focusOptionIdx, selectedValues, correctOptions, scrollOptionIntoView],\n );\n\n // We need to force the auto focus for the inline since we dont control the floating wrapper.\n useEffect(() => {\n if (propsWithDefaults.inline) {\n setMenuState(true, 'inline');\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const shouldPreventContextMenuOpening = propsWithDefaults.readOnly && !propsWithDefaults.isMenuOpenableWithReadOnly;\n\n const ctx = useMemo(\n () => ({\n props: { ...propsWithDefaults },\n menuState,\n referenceElement,\n listRef,\n focusOptionIdx,\n selectedOptionsRef,\n controlsWrapperRef,\n inputValue,\n setInputValue,\n setMenuState,\n hasFocus,\n pillGroupRef,\n wrapperListRef,\n setHasFocus,\n setFocusOptionIdx,\n scrollOptionIntoView,\n setReferenceElement,\n setShowPopover,\n internalRef,\n correctOptions,\n instanceUid,\n optionsPerSection,\n shouldPreventContextMenuOpening,\n }),\n [\n scrollOptionIntoView,\n setMenuState,\n correctOptions,\n hasFocus,\n propsWithDefaults,\n inputValue,\n focusOptionIdx,\n wrapperListRef,\n menuState,\n pillGroupRef,\n referenceElement,\n selectedOptionsRef,\n controlsWrapperRef,\n listRef,\n internalRef,\n instanceUid,\n optionsPerSection,\n shouldPreventContextMenuOpening,\n ],\n );\n\n return ctx;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": "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",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { type DSFastListT } from '@elliemae/ds-fast-list';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { uid } from 'uid';\nimport type { DSCommonComboboxPropsT } from '../DSCommonComboboxPropsT.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { ComboboxPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { DSComboBoxName } from '../theming.js';\nimport { getFirstOption, isSelectedValueEmpty } from '../utils/listHelper.js';\nimport { useCorrectOptions } from './useCorrectOptions.js';\nimport { useOptionsPerSection } from './useOptionsPerSection.js';\n\ntype ActionRefVirtualized = {\n scrollTo: (index: number, opts?: DSFastListT.ScrollToOptions) => void;\n};\n\nexport const useComboBox = <\n T extends DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[] | null =\n | DSCommonComboboxPropsT.ItemOption\n | DSCommonComboboxPropsT.ItemOption[],\n>(\n props: DSComboboxT.Props<T>,\n) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSComboboxT.Props<T>>(\n props,\n // we have a weird inference going on in this component\n // weird because we are even renaming selectedValues to selectedValue for the single combobox,\n // type safety here is flanky, we need to cast this, as a one ad-hoc exception\n defaultProps as DSComboboxT.Props<T>,\n );\n useValidateTypescriptPropTypes(propsWithDefaults, ComboboxPropTypes, DSComboBoxName);\n const [showPopover, setShowPopover] = useState<boolean>(false);\n const [referenceElement, setReferenceElement] = useState<HTMLElement | null>(null);\n\n const [inputValue, setInputValue] = useState<string>('');\n const [hasFocus, setHasFocus] = useState<boolean>(false);\n\n const internalRef = useRef<HTMLInputElement>(null);\n const wrapperListRef = useRef<HTMLDivElement>(null);\n\n const selectedOptionsRef = useRef<HTMLDivElement>(null);\n const controlsWrapperRef = useRef<HTMLDivElement>(null);\n const pillGroupRef = useRef<HTMLDivElement>(null);\n\n const {\n id,\n selectedValues,\n isMenuOpen,\n onMenuChange,\n applyAriaDisabled,\n forceFocusFirstOptionOnType,\n inline,\n readOnly,\n isMenuOpenableWithReadOnly,\n } = propsWithDefaults;\n\n const instanceUid = useMemo(() => id || uid(5), [id]);\n\n const menuState = useMemo(() => {\n if (isMenuOpen !== undefined) return isMenuOpen;\n return showPopover;\n }, [showPopover, isMenuOpen]);\n\n // ---------------------------------------------------------------------------\n // Options with creatable option + filtered by selected\n // ---------------------------------------------------------------------------\n\n const correctOptions = useCorrectOptions(propsWithDefaults, inputValue);\n\n const optionsPerSection = useOptionsPerSection(correctOptions);\n\n const actionRef: ActionRefVirtualized = {\n scrollTo: () => {},\n };\n\n const listRef = useRef<ActionRefVirtualized>(actionRef);\n\n // ===========================================================================\n // Scroll into view function\n // ===========================================================================\n const scrollOptionIntoView = useCallback(\n (dsId: string, opts: DSFastListT.ScrollToOptions = { align: 'center' } as DSFastListT.ScrollToOptions) => {\n listRef.current.scrollTo(\n correctOptions.findIndex((opt) => opt.dsId === dsId),\n opts,\n );\n requestAnimationFrame(() => {\n listRef.current.scrollTo(\n correctOptions.findIndex((opt) => opt.dsId === dsId),\n opts,\n );\n });\n },\n [correctOptions],\n );\n\n // ===========================================================================\n // Init focused option when opening the menu list\n // ===========================================================================\n\n const [focusOptionIdx, setFocusOptionIdx] = useState<string>('');\n\n useEffect(() => {\n if (inputValue && forceFocusFirstOptionOnType) {\n const focusedValue = getFirstOption(correctOptions);\n setFocusOptionIdx(focusedValue);\n scrollOptionIntoView(focusedValue, { align: 'center' });\n }\n }, [correctOptions, inputValue, forceFocusFirstOptionOnType, scrollOptionIntoView, selectedValues]);\n\n const setMenuState = useCallback(\n (\n newState: boolean,\n reason: string,\n e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>,\n ) => {\n if (applyAriaDisabled) return;\n if (onMenuChange !== undefined) onMenuChange(newState, reason, e);\n setShowPopover(newState);\n if (!inputValue && newState && !focusOptionIdx && !isSelectedValueEmpty(selectedValues)) {\n const focusedValue = getFirstOption(correctOptions, selectedValues);\n setFocusOptionIdx(focusedValue);\n scrollOptionIntoView(focusedValue, { align: 'center' });\n } else {\n setFocusOptionIdx('');\n }\n },\n [applyAriaDisabled, onMenuChange, inputValue, focusOptionIdx, selectedValues, correctOptions, scrollOptionIntoView],\n );\n\n // We need to force the auto focus for the inline since we dont control the floating wrapper.\n useEffect(() => {\n if (inline) {\n setMenuState(true, 'inline');\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const shouldPreventContextMenuOpening = readOnly && !isMenuOpenableWithReadOnly;\n\n const ctx = useMemo(\n () => ({\n props: { ...propsWithDefaults },\n menuState,\n referenceElement,\n listRef,\n focusOptionIdx,\n selectedOptionsRef,\n controlsWrapperRef,\n inputValue,\n setInputValue,\n setMenuState,\n hasFocus,\n pillGroupRef,\n wrapperListRef,\n setHasFocus,\n setFocusOptionIdx,\n scrollOptionIntoView,\n setReferenceElement,\n setShowPopover,\n internalRef,\n correctOptions,\n instanceUid,\n optionsPerSection,\n shouldPreventContextMenuOpening,\n }),\n [\n scrollOptionIntoView,\n setMenuState,\n correctOptions,\n hasFocus,\n propsWithDefaults,\n inputValue,\n focusOptionIdx,\n wrapperListRef,\n menuState,\n pillGroupRef,\n referenceElement,\n selectedOptionsRef,\n controlsWrapperRef,\n listRef,\n internalRef,\n instanceUid,\n optionsPerSection,\n shouldPreventContextMenuOpening,\n ],\n );\n\n return ctx;\n};\n\nexport type UseComboBoxReturnType = ReturnType<typeof useComboBox>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": "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",
6
6
  "names": []
7
7
  }
@@ -40,7 +40,13 @@ const useCorrectOptions = (propsWithDefaults, inputValue) => {
40
40
  const { filteredOptions, allOptions, onCreate } = propsWithDefaults;
41
41
  return (0, import_react.useMemo)(() => {
42
42
  let correctAllOptions = allOptions;
43
+ let someOptionIsString = false;
44
+ let allOptionsAreString = false;
45
+ if (allOptions?.some((option) => typeof option === "string")) {
46
+ someOptionIsString = true;
47
+ }
43
48
  if (allOptions?.every((option) => typeof option === "string")) {
49
+ allOptionsAreString = true;
44
50
  correctAllOptions = allOptions.map((option, index) => ({
45
51
  dsId: index.toString(),
46
52
  label: option,
@@ -48,6 +54,11 @@ const useCorrectOptions = (propsWithDefaults, inputValue) => {
48
54
  value: option
49
55
  }));
50
56
  }
57
+ if (someOptionIsString && !allOptionsAreString) {
58
+ throw new Error(
59
+ "Invalid option type: all options must be of the same type. Please provide all options as objects with a label and value, or all options as strings."
60
+ );
61
+ }
51
62
  const correctFilterOptions = filteredOptions ?? (0, import_listHelper.filterOptions)(inputValue, correctAllOptions);
52
63
  if (onCreate && inputValue && correctFilterOptions.findIndex(
53
64
  (option) => option.type === import_constants.MENU_OPTION_TYPES.OPTION && option.label === inputValue
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/config/useCorrectOptions.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable complexity */\nimport { useMemo } from 'react';\nimport { uid } from 'uid';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { MENU_OPTION_TYPES } from '../constants.js';\nimport { filterOptions } from '../utils/listHelper.js';\nconst useCorrectOptions = (propsWithDefaults: DSComboboxT.Props, inputValue: string) => {\n const { filteredOptions, allOptions, onCreate } = propsWithDefaults;\n\n return useMemo(() => {\n let correctAllOptions = allOptions;\n if (allOptions?.every((option) => typeof option === 'string')) {\n correctAllOptions = allOptions.map((option, index) => ({\n dsId: index.toString(),\n label: option as unknown as string,\n type: MENU_OPTION_TYPES.OPTION,\n value: option as unknown as string,\n }));\n }\n const correctFilterOptions = filteredOptions ?? filterOptions(inputValue, correctAllOptions);\n\n // whether oncreate is passed we add as first option the creatable action based on input value string\n if (\n onCreate &&\n inputValue &&\n correctFilterOptions.findIndex(\n (option) => option.type === MENU_OPTION_TYPES.OPTION && option.label === inputValue,\n ) === -1\n ) {\n const creatableUuid = uid();\n const creatableItem: DSComboboxT.ItemCreatableOption = {\n dsId: `creatable-${creatableUuid}`,\n label: inputValue,\n type: 'creatable',\n 'aria-describedby': `aria-creatable`,\n };\n\n return [creatableItem, ...correctFilterOptions];\n }\n\n return correctFilterOptions;\n }, [filteredOptions, allOptions, onCreate, inputValue]);\n};\n\nexport { useCorrectOptions };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAwB;AACxB,iBAAoB;AAEpB,uBAAkC;AAClC,wBAA8B;AAC9B,MAAM,oBAAoB,CAAC,mBAAsC,eAAuB;AACtF,QAAM,EAAE,iBAAiB,YAAY,SAAS,IAAI;AAElD,aAAO,sBAAQ,MAAM;AACnB,QAAI,oBAAoB;AACxB,QAAI,YAAY,MAAM,CAAC,WAAW,OAAO,WAAW,QAAQ,GAAG;AAC7D,0BAAoB,WAAW,IAAI,CAAC,QAAQ,WAAW;AAAA,QACrD,MAAM,MAAM,SAAS;AAAA,QACrB,OAAO;AAAA,QACP,MAAM,mCAAkB;AAAA,QACxB,OAAO;AAAA,MACT,EAAE;AAAA,IACJ;AACA,UAAM,uBAAuB,uBAAmB,iCAAc,YAAY,iBAAiB;AAG3F,QACE,YACA,cACA,qBAAqB;AAAA,MACnB,CAAC,WAAW,OAAO,SAAS,mCAAkB,UAAU,OAAO,UAAU;AAAA,IAC3E,MAAM,IACN;AACA,YAAM,oBAAgB,gBAAI;AAC1B,YAAM,gBAAiD;AAAA,QACrD,MAAM,aAAa,aAAa;AAAA,QAChC,OAAO;AAAA,QACP,MAAM;AAAA,QACN,oBAAoB;AAAA,MACtB;AAEA,aAAO,CAAC,eAAe,GAAG,oBAAoB;AAAA,IAChD;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,iBAAiB,YAAY,UAAU,UAAU,CAAC;AACxD;",
4
+ "sourcesContent": ["/* eslint-disable complexity */\nimport { useMemo } from 'react';\nimport { uid } from 'uid';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { MENU_OPTION_TYPES } from '../constants.js';\nimport { filterOptions } from '../utils/listHelper.js';\nconst useCorrectOptions = (propsWithDefaults: DSComboboxT.Props, inputValue: string) => {\n const { filteredOptions, allOptions, onCreate } = propsWithDefaults;\n\n return useMemo(() => {\n let correctAllOptions = allOptions;\n let someOptionIsString = false;\n let allOptionsAreString = false;\n if (allOptions?.some((option) => typeof option === 'string')) {\n someOptionIsString = true;\n }\n if (allOptions?.every((option) => typeof option === 'string')) {\n allOptionsAreString = true;\n correctAllOptions = allOptions.map((option, index) => ({\n dsId: index.toString(),\n label: option as unknown as string,\n type: MENU_OPTION_TYPES.OPTION,\n value: option as unknown as string,\n }));\n }\n if (someOptionIsString && !allOptionsAreString) {\n throw new Error(\n 'Invalid option type: all options must be of the same type. Please provide all options as objects with a label and value, or all options as strings.',\n );\n }\n const correctFilterOptions = filteredOptions ?? filterOptions(inputValue, correctAllOptions);\n\n // whether oncreate is passed we add as first option the creatable action based on input value string\n if (\n onCreate &&\n inputValue &&\n correctFilterOptions.findIndex(\n (option) => option.type === MENU_OPTION_TYPES.OPTION && option.label === inputValue,\n ) === -1\n ) {\n const creatableUuid = uid();\n const creatableItem: DSComboboxT.ItemCreatableOption = {\n dsId: `creatable-${creatableUuid}`,\n label: inputValue,\n type: 'creatable',\n 'aria-describedby': `aria-creatable`,\n };\n\n return [creatableItem, ...correctFilterOptions];\n }\n\n return correctFilterOptions;\n }, [filteredOptions, allOptions, onCreate, inputValue]);\n};\n\nexport { useCorrectOptions };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAwB;AACxB,iBAAoB;AAEpB,uBAAkC;AAClC,wBAA8B;AAC9B,MAAM,oBAAoB,CAAC,mBAAsC,eAAuB;AACtF,QAAM,EAAE,iBAAiB,YAAY,SAAS,IAAI;AAElD,aAAO,sBAAQ,MAAM;AACnB,QAAI,oBAAoB;AACxB,QAAI,qBAAqB;AACzB,QAAI,sBAAsB;AAC1B,QAAI,YAAY,KAAK,CAAC,WAAW,OAAO,WAAW,QAAQ,GAAG;AAC5D,2BAAqB;AAAA,IACvB;AACA,QAAI,YAAY,MAAM,CAAC,WAAW,OAAO,WAAW,QAAQ,GAAG;AAC7D,4BAAsB;AACtB,0BAAoB,WAAW,IAAI,CAAC,QAAQ,WAAW;AAAA,QACrD,MAAM,MAAM,SAAS;AAAA,QACrB,OAAO;AAAA,QACP,MAAM,mCAAkB;AAAA,QACxB,OAAO;AAAA,MACT,EAAE;AAAA,IACJ;AACA,QAAI,sBAAsB,CAAC,qBAAqB;AAC9C,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AACA,UAAM,uBAAuB,uBAAmB,iCAAc,YAAY,iBAAiB;AAG3F,QACE,YACA,cACA,qBAAqB;AAAA,MACnB,CAAC,WAAW,OAAO,SAAS,mCAAkB,UAAU,OAAO,UAAU;AAAA,IAC3E,MAAM,IACN;AACA,YAAM,oBAAgB,gBAAI;AAC1B,YAAM,gBAAiD;AAAA,QACrD,MAAM,aAAa,aAAa;AAAA,QAChC,OAAO;AAAA,QACP,MAAM;AAAA,QACN,oBAAoB;AAAA,MACtB;AAEA,aAAO,CAAC,eAAe,GAAG,oBAAoB;AAAA,IAChD;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,iBAAiB,YAAY,UAAU,UAAU,CAAC;AACxD;",
6
6
  "names": []
7
7
  }
@@ -48,7 +48,8 @@ const FORM_COMBOBOX_SLOTS = {
48
48
  SINGLE_MENU_ITEM: "single-menu-item",
49
49
  MULTI_MENU_ITEM: "multi-menu-item",
50
50
  LOADING_INDICATOR: "loading-indicator",
51
- SKELETON_MENU_ITEM: "skeleton-menu-item"
51
+ SKELETON_MENU_ITEM: "skeleton-menu-item",
52
+ PILL: "pill"
52
53
  };
53
54
  const FORM_COMBOBOX_DATA_TESTID = {
54
55
  ...(0, import_ds_system.slotObjectToDataTestIds)(DSFormComboboxName, FORM_COMBOBOX_SLOTS),
@@ -61,6 +62,7 @@ const FORM_COMBOBOX_DATA_TESTID = {
61
62
  SELECTED_VALUES: "combobox-selected-values",
62
63
  DROPDOWN: "combobox-dropdown-btn",
63
64
  OPTION: "combobox-option",
64
- ALLY_SELECTED_VALUES: "combobox-ally-selected-values"
65
+ ALLY_SELECTED_VALUES: "combobox-ally-selected-values",
66
+ PILL: "ds-pill-wrapper"
65
67
  };
66
68
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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;",
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 PILL: 'pill',\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 PILL: 'ds-pill-wrapper',\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;AAAA,EACpB,MAAM;AACR;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;AAAA,EACtB,MAAM;AACR;",
6
6
  "names": []
7
7
  }
package/dist/cjs/index.js CHANGED
@@ -38,13 +38,21 @@ __export(index_exports, {
38
38
  DSFormComboboxName: () => import_constants.DSFormComboboxName,
39
39
  FORM_COMBOBOX_DATA_TESTID: () => import_constants.FORM_COMBOBOX_DATA_TESTID,
40
40
  FORM_COMBOBOX_SLOTS: () => import_constants.FORM_COMBOBOX_SLOTS,
41
- offScreenStyle: () => import_ComboBox.offScreenStyle
41
+ commonComboboxPropTypes: () => import_DSCommonComboboxPropsT.commonComboboxPropTypes,
42
+ multiComboboxPropTypes: () => import_DSComboboxMultiT.multiComboboxPropTypes,
43
+ multiComboboxPropTypesSchema: () => import_DSComboboxMultiT.multiComboboxPropTypesSchema,
44
+ offScreenStyle: () => import_ComboBox.offScreenStyle,
45
+ singleComboboxPropTypes: () => import_DSComboboxSingleT.singleComboboxPropTypes,
46
+ singleComboboxPropTypesSchema: () => import_DSComboboxSingleT.singleComboboxPropTypesSchema
42
47
  });
43
48
  module.exports = __toCommonJS(index_exports);
44
49
  var React = __toESM(require("react"));
45
50
  var import_ComboBox = require("./ComboBox.js");
46
- var import_theming = require("./theming.js");
47
- var import_constants = require("./constants/index.js");
48
51
  var import_ComboboxDataTestids = require("./ComboboxDataTestids.js");
52
+ var import_constants = require("./constants/index.js");
53
+ var import_DSComboboxMultiT = require("./DSComboboxMultiT.js");
54
+ var import_DSComboboxSingleT = require("./DSComboboxSingleT.js");
55
+ var import_DSCommonComboboxPropsT = require("./DSCommonComboboxPropsT.js");
49
56
  var import_react_desc_prop_types = require("./react-desc-prop-types.js");
57
+ var import_theming = require("./theming.js");
50
58
  //# sourceMappingURL=index.js.map