@elliemae/ds-dropdownmenu-v2 3.62.1 → 3.70.0-alpha.9

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/exported-related/conversion-utils/conversionHelpers.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { type DSMenuButtonT, MENU_ITEMS_TYPES } from '@elliemae/ds-menu-button';\nimport { type DSDropdownMenuT } from '../../react-desc-prop-types.js';\n\n/**\n * Type guard to check if the option is of type ItemSingleOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSingleOptions, false otherwise.\n */\nconst isItemSingleOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSingleOptions =>\n option.type === 'single';\n\n/**\n * Type guard to check if the option is of type ItemActionOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemActionOptions, false otherwise.\n */\nconst isItemActionOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemActionOptions =>\n option.type === 'action';\n\n/**\n * Type guard to check if the option is of type ItemSingleWithSubmenuOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSingleWithSubmenuOptions, false otherwise.\n */\nexport const isItemSingleWithSubmenuOptions = (\n option: DSDropdownMenuT.Item,\n): option is DSDropdownMenuT.ItemSingleWithSubmenuOptions => option.type === 'singleWithSubmenu';\n\n/**\n * Type guard to check if the option is of type ItemCheckboxOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemCheckboxOptions, false otherwise.\n */\nconst isItemCheckboxOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemCheckboxOptions =>\n option.type === 'checkbox';\n\n/**\n * Type guard to check if the option is of type ItemSubmenuOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSubmenuOptions, false otherwise.\n */\nexport const isItemSubmenuOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSubmenuOptions =>\n option.type === 'submenu';\n\n/**\n * Type guard to check if the option is of type ItemSeparatorOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSeparatorOptions, false otherwise.\n */\nconst isItemSeparatorOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSeparatorOptions =>\n option.type === 'separator';\n\n/**\n * Type guard to check if the option is of type ItemSectionOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSectionOptions, false otherwise.\n */\nexport const isItemSectionOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSectionOptions =>\n option.type === 'section';\n\n/**\n * Type guard to check if the option is of type ItemSkeletonOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSkeletonOptions, false otherwise.\n */\nconst isItemSkeletonOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSkeletonOptions =>\n option.type === 'skeleton';\n\n/**\n * Converts ItemActionOptions to DSMenuButtonT.ActivableItem.\n * @param option - The ItemActionOptions to convert.\n * @returns The converted ActivableItem.\n */\nexport const convertActionOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemActionOptions,\n): DSMenuButtonT.ActivableItem => ({\n type: MENU_ITEMS_TYPES.ACTIVABLE_ITEM,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts ItemSingleOptions to DSMenuButtonT.SingleSelectItem.\n * @param option - The ItemSingleWithSubmenuOptions to convert.\n * @returns The converted SingleSelectWithSubmenuItem.\n */\nexport const convertSingleSelectionOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSingleOptions,\n): DSMenuButtonT.SingleSelectItem => ({\n type: MENU_ITEMS_TYPES.SINGLE_SELECT_ITEM,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts ItemCheckboxOptions to DSMenuButtonT.MultipleSelectItem.\n * @param option - The ItemCheckboxOptions to convert.\n * @returns The converted MultipleSelectItem.\n */\nexport const convertCheckboxOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemCheckboxOptions,\n): DSMenuButtonT.MultipleSelectItem => ({\n type: MENU_ITEMS_TYPES.MULTIPLE_SELECT_ITEM,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts ItemSeparatorOptions to DSMenuButtonT.SeparatorItem.\n * @param option - The ItemSeparatorOptions to convert.\n * @returns The converted SeparatorItem.\n */\nexport const convertSeparatorOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSeparatorOptions,\n): DSMenuButtonT.SeparatorItem => ({\n type: MENU_ITEMS_TYPES.SEPARATOR,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n});\n\n/**\n * Converts ItemSectionOptions to DSMenuButtonT.GroupItem.\n * @param option - The ItemSectionOptions to convert.\n * @returns The converted GroupItem.\n */\nexport const convertSectionOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSectionOptions,\n): DSMenuButtonT.GroupItem => ({\n type: MENU_ITEMS_TYPES.GROUP,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n});\n\n/**\n * Converts ItemSkeletonOptions to DSMenuButtonT.SkeletonItem.\n * @param option - The ItemSkeletonOptions to convert.\n * @returns The converted SkeletonItem.\n */\nexport const convertSkeletonOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSkeletonOptions,\n): DSMenuButtonT.SkeletonItem => ({\n type: MENU_ITEMS_TYPES.SKELETON_ITEM,\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n});\n\n// ========================================================================================\n// WithSubmenu conversion requires iterating nested options\n// to avoid \"cannot use before defined\", we inject the conversion as second parameter\n// ========================================================================================\n/**\n * Converts ItemSingleWithSubmenuOptions to DSMenuButtonT.SingleSelectWithSubmenuItem.\n * @param option - The ItemSingleWithSubmenuOptions to convert.\n * @param convFn - The conversion function to convert nested options - required to avoid circular dependencies.\n * @returns The converted SingleSelectWithSubmenuItem.\n */\nexport const convertSingleWithSubmenuOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSingleWithSubmenuOptions,\n convFn: (option: DSDropdownMenuT.Item) => DSMenuButtonT.MenuItemInterface,\n): DSMenuButtonT.SingleSelectWithSubmenuItem => ({\n type: MENU_ITEMS_TYPES.SINGLE_SELECT_WITH_SUBMENU_ITEM,\n label: option.label,\n subitems: option.options.map(convFn),\n maxHeight: option.maxHeight as DSMenuButtonT.SingleSelectWithSubmenuItem['maxHeight'],\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n/**\n * Converts ItemSubmenuOptions to DSMenuButtonT.WithSubmenuItem.\n * @param option - The ItemSubmenuOptions to convert.\n * @param convFn - The conversion function to convert nested options - required to avoid circular dependencies.\n * @returns The converted WithSubmenuItem.\n */\nexport const convertSubmenuOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSubmenuOptions,\n convFn: (option: DSDropdownMenuT.Item) => DSMenuButtonT.MenuItemInterface,\n): DSMenuButtonT.WithSubmenuItem => ({\n type: MENU_ITEMS_TYPES.WITH_SUBMENU_ITEM,\n label: option.label,\n subitems: option.options.map(convFn),\n maxHeight: option.maxHeight as DSMenuButtonT.WithSubmenuItem['maxHeight'],\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts a DSDropdownMenuT.Item to a DSMenuButtonT.MenuItemInterface.\n * @param option - The DSDropdownMenuT.Item to convert.\n * @returns The converted MenuItemInterface.\n */\nexport const convertDropdownItemToMenuButtonItem = (option: DSDropdownMenuT.Item): DSMenuButtonT.MenuItemInterface => {\n if (isItemActionOptions(option)) return convertActionOptToMenuButtonItem(option);\n // single selections\n if (isItemSingleOptions(option)) return convertSingleSelectionOptToMenuButtonItem(option);\n if (isItemSingleWithSubmenuOptions(option))\n return convertSingleWithSubmenuOptToMenuButtonItem(option, convertDropdownItemToMenuButtonItem);\n // multiple selections\n if (isItemCheckboxOptions(option)) return convertCheckboxOptToMenuButtonItem(option);\n // DDV2 didn't support multiple selections with submenu so we don't need to handle it\n // only submenu\n if (isItemSubmenuOptions(option))\n return convertSubmenuOptToMenuButtonItem(option, convertDropdownItemToMenuButtonItem);\n // separators, groups and skeletons\n if (isItemSeparatorOptions(option)) return convertSeparatorOptToMenuButtonItem(option);\n if (isItemSectionOptions(option)) return convertSectionOptToMenuButtonItem(option);\n if (isItemSkeletonOptions(option)) return convertSkeletonOptToMenuButtonItem(option);\n\n throw new Error('Unknown item type');\n};\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["import { type DSMenuButtonT, MENU_ITEMS_TYPES } from '@elliemae/ds-menu-button';\nimport { type DSDropdownMenuT } from '../../react-desc-prop-types.js';\n\n/**\n * Type guard to check if the option is of type ItemSingleOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSingleOptions, false otherwise.\n */\nconst isItemSingleOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSingleOptions =>\n option.type === 'single';\n\n/**\n * Type guard to check if the option is of type ItemActionOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemActionOptions, false otherwise.\n */\nconst isItemActionOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemActionOptions =>\n option.type === 'action';\n\n/**\n * Type guard to check if the option is of type ItemSingleWithSubmenuOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSingleWithSubmenuOptions, false otherwise.\n */\nexport const isItemSingleWithSubmenuOptions = (\n option: DSDropdownMenuT.Item,\n): option is DSDropdownMenuT.ItemSingleWithSubmenuOptions => option.type === 'singleWithSubmenu';\n\n/**\n * Type guard to check if the option is of type ItemCheckboxOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemCheckboxOptions, false otherwise.\n */\nconst isItemCheckboxOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemCheckboxOptions =>\n option.type === 'checkbox';\n\n/**\n * Type guard to check if the option is of type ItemSubmenuOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSubmenuOptions, false otherwise.\n */\nexport const isItemSubmenuOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSubmenuOptions =>\n option.type === 'submenu';\n\n/**\n * Type guard to check if the option is of type ItemSeparatorOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSeparatorOptions, false otherwise.\n */\nconst isItemSeparatorOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSeparatorOptions =>\n option.type === 'separator';\n\n/**\n * Type guard to check if the option is of type ItemSectionOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSectionOptions, false otherwise.\n */\nexport const isItemSectionOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSectionOptions =>\n option.type === 'section';\n\n/**\n * Type guard to check if the option is of type ItemSkeletonOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSkeletonOptions, false otherwise.\n */\nconst isItemSkeletonOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSkeletonOptions =>\n option.type === 'skeleton';\n\n/**\n * Converts ItemActionOptions to DSMenuButtonT.ActivableItem.\n * @param option - The ItemActionOptions to convert.\n * @returns The converted ActivableItem.\n */\nexport const convertActionOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemActionOptions,\n): DSMenuButtonT.ActivableItem => ({\n type: MENU_ITEMS_TYPES.ACTIVABLE_ITEM,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts ItemSingleOptions to DSMenuButtonT.SingleSelectItem.\n * @param option - The ItemSingleWithSubmenuOptions to convert.\n * @returns The converted SingleSelectWithSubmenuItem.\n */\nexport const convertSingleSelectionOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSingleOptions,\n): DSMenuButtonT.SingleSelectItem => ({\n type: MENU_ITEMS_TYPES.SINGLE_SELECT_ITEM,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts ItemCheckboxOptions to DSMenuButtonT.MultipleSelectItem.\n * @param option - The ItemCheckboxOptions to convert.\n * @returns The converted MultipleSelectItem.\n */\nexport const convertCheckboxOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemCheckboxOptions,\n): DSMenuButtonT.MultipleSelectItem => ({\n type: MENU_ITEMS_TYPES.MULTIPLE_SELECT_ITEM,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts ItemSeparatorOptions to DSMenuButtonT.SeparatorItem.\n * @param option - The ItemSeparatorOptions to convert.\n * @returns The converted SeparatorItem.\n */\nexport const convertSeparatorOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSeparatorOptions,\n): DSMenuButtonT.SeparatorItem => ({\n type: MENU_ITEMS_TYPES.SEPARATOR,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n});\n\n/**\n * Converts ItemSectionOptions to DSMenuButtonT.GroupItem.\n * @param option - The ItemSectionOptions to convert.\n * @returns The converted GroupItem.\n */\nexport const convertSectionOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSectionOptions,\n): DSMenuButtonT.GroupItem => ({\n type: MENU_ITEMS_TYPES.GROUP,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n});\n\n/**\n * Converts ItemSkeletonOptions to DSMenuButtonT.SkeletonItem.\n * @param option - The ItemSkeletonOptions to convert.\n * @returns The converted SkeletonItem.\n */\nexport const convertSkeletonOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSkeletonOptions,\n): DSMenuButtonT.SkeletonItem => ({\n type: MENU_ITEMS_TYPES.SKELETON_ITEM,\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n});\n\n// ========================================================================================\n// WithSubmenu conversion requires iterating nested options\n// to avoid \"cannot use before defined\", we inject the conversion as second parameter\n// ========================================================================================\n/**\n * Converts ItemSingleWithSubmenuOptions to DSMenuButtonT.SingleSelectWithSubmenuItem.\n * @param option - The ItemSingleWithSubmenuOptions to convert.\n * @param convFn - The conversion function to convert nested options - required to avoid circular dependencies.\n * @returns The converted SingleSelectWithSubmenuItem.\n */\nexport const convertSingleWithSubmenuOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSingleWithSubmenuOptions,\n convFn: (option: DSDropdownMenuT.Item) => DSMenuButtonT.MenuItemInterface,\n): DSMenuButtonT.SingleSelectWithSubmenuItem => ({\n type: MENU_ITEMS_TYPES.SINGLE_SELECT_WITH_SUBMENU_ITEM,\n label: option.label,\n subitems: option.options.map(convFn) as DSMenuButtonT.SingleSelectWithSubmenuItem['subitems'],\n maxHeight: option.maxHeight as DSMenuButtonT.SingleSelectWithSubmenuItem['maxHeight'],\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.SingleSelectWithSubmenuItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n/**\n * Converts ItemSubmenuOptions to DSMenuButtonT.WithSubmenuItem.\n * @param option - The ItemSubmenuOptions to convert.\n * @param convFn - The conversion function to convert nested options - required to avoid circular dependencies.\n * @returns The converted WithSubmenuItem.\n */\nexport const convertSubmenuOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSubmenuOptions,\n convFn: (option: DSDropdownMenuT.Item) => DSMenuButtonT.MenuItemInterface,\n): DSMenuButtonT.WithSubmenuItem => ({\n type: MENU_ITEMS_TYPES.WITH_SUBMENU_ITEM,\n label: option.label,\n subitems: option.options.map(convFn) as DSMenuButtonT.WithSubmenuItem['subitems'],\n maxHeight: option.maxHeight as DSMenuButtonT.WithSubmenuItem['maxHeight'],\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.WithSubmenuItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts a DSDropdownMenuT.Item to a DSMenuButtonT.MenuItemInterface.\n * @param option - The DSDropdownMenuT.Item to convert.\n * @returns The converted MenuItemInterface.\n */\nexport const convertDropdownItemToMenuButtonItem = (option: DSDropdownMenuT.Item): DSMenuButtonT.MenuItemInterface => {\n if (isItemActionOptions(option)) return convertActionOptToMenuButtonItem(option);\n // single selections\n if (isItemSingleOptions(option)) return convertSingleSelectionOptToMenuButtonItem(option);\n if (isItemSingleWithSubmenuOptions(option))\n return convertSingleWithSubmenuOptToMenuButtonItem(option, convertDropdownItemToMenuButtonItem);\n // multiple selections\n if (isItemCheckboxOptions(option)) return convertCheckboxOptToMenuButtonItem(option);\n // DDV2 didn't support multiple selections with submenu so we don't need to handle it\n // only submenu\n if (isItemSubmenuOptions(option))\n return convertSubmenuOptToMenuButtonItem(option, convertDropdownItemToMenuButtonItem);\n // separators, groups and skeletons\n if (isItemSeparatorOptions(option)) return convertSeparatorOptToMenuButtonItem(option);\n if (isItemSectionOptions(option)) return convertSectionOptToMenuButtonItem(option);\n if (isItemSkeletonOptions(option)) return convertSkeletonOptToMenuButtonItem(option);\n\n throw new Error('Unknown item type');\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,4BAAqD;AAQrD,MAAM,sBAAsB,CAAC,WAC3B,OAAO,SAAS;AAOlB,MAAM,sBAAsB,CAAC,WAC3B,OAAO,SAAS;AAOX,MAAM,iCAAiC,CAC5C,WAC2D,OAAO,SAAS;AAO7E,MAAM,wBAAwB,CAAC,WAC7B,OAAO,SAAS;AAOX,MAAM,uBAAuB,CAAC,WACnC,OAAO,SAAS;AAOlB,MAAM,yBAAyB,CAAC,WAC9B,OAAO,SAAS;AAOX,MAAM,uBAAuB,CAAC,WACnC,OAAO,SAAS;AAOlB,MAAM,wBAAwB,CAAC,WAC7B,OAAO,SAAS;AAOX,MAAM,mCAAmC,CAC9C,YACiC;AAAA,EACjC,MAAM,uCAAiB;AAAA,EACvB,OAAO,OAAO;AAAA;AAAA,EAEd,MAAM,OAAO;AAAA,EACb,UAAU,QAAQ;AAAA,EAClB,UAAU,OAAO,YAAY,OAAO;AAAA,EACpC,SAAS,OAAO;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AA,EACd,UAAU,OAAO,QAAQ,IAAI,MAAM;AAAA,EACnC,WAAW,OAAO;AAAA;AAAA,EAElB,MAAM,OAAO;AAAA,EACb,UAAU,QAAQ;AAAA,EAClB,UAAU,OAAO,YAAY,OAAO;AAAA,EACpC,SAAS,OAAO;AAAA,EAChB,WAAW,OAAO;AACpB;AAOO,MAAM,sCAAsC,CAAC,WAAkE;AACpH,MAAI,oBAAoB,MAAM,EAAG,QAAO,iCAAiC,MAAM;AAE/E,MAAI,oBAAoB,MAAM,EAAG,QAAO,0CAA0C,MAAM;AACxF,MAAI,+BAA+B,MAAM;AACvC,WAAO,4CAA4C,QAAQ,mCAAmC;AAEhG,MAAI,sBAAsB,MAAM,EAAG,QAAO,mCAAmC,MAAM;AAGnF,MAAI,qBAAqB,MAAM;AAC7B,WAAO,kCAAkC,QAAQ,mCAAmC;AAEtF,MAAI,uBAAuB,MAAM,EAAG,QAAO,oCAAoC,MAAM;AACrF,MAAI,qBAAqB,MAAM,EAAG,QAAO,kCAAkC,MAAM;AACjF,MAAI,sBAAsB,MAAM,EAAG,QAAO,mCAAmC,MAAM;AAEnF,QAAM,IAAI,MAAM,mBAAmB;AACrC;",
6
6
  "names": []
7
7
  }
@@ -92,7 +92,11 @@ const convertOptionsRecursive = (options) => {
92
92
  return;
93
93
  }
94
94
  if (option.type === "single" || option.type === "singleWithSubmenu") {
95
- groups.push({ type: "group", subitems: [convertedOption], dsId: `filled-group-starting-from-${option.dsId}` });
95
+ groups.push({
96
+ type: "group",
97
+ subitems: [convertedOption],
98
+ dsId: `filled-group-starting-from-${option.dsId}`
99
+ });
96
100
  return;
97
101
  }
98
102
  convertedOptions.push(convertedOption);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/exported-related/conversion-utils/index.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { type DSMenuButtonT } from '@elliemae/ds-menu-button';\nimport { type DSDropdownMenuT } from '../../react-desc-prop-types.js';\nimport { type DSDropdownV2BridgeT } from './types.js';\nimport {\n convertDropdownItemToMenuButtonItem,\n isItemSectionOptions,\n isItemSingleWithSubmenuOptions,\n isItemSubmenuOptions,\n} from './conversionHelpers.js';\nimport { getHumanReadableWarnings } from './getHumanReadableWarnings.js';\nimport { mutableUpdateReportPerIteration, mutableUpdateReportPostIteration } from './reportMutableUpdatesHelpers.js';\n\nexport const checkIfOptionsCanBeConverted = (\n options: DSDropdownV2BridgeT.InternalProps['options'],\n): DSDropdownV2BridgeT.ReportMutableT => {\n // this bridge component is not able to automatically bridge some configurations\n // in scenario where the component is not able to bridge the configuration we:\n // A - throw an error if it's a critical configuration\n // B - warn the configuration will be ignored if it's not critical\n // we are going to have to iterate over the options (and the tree-like but not really a DSTree) `options`\n // we should iterate only once and track all the potential violation in one go for performance reasons\n\n const mutableReport: DSDropdownV2BridgeT.ReportMutableT = {\n unrecoverableConversion: false,\n needsGracefullRecovery: false,\n wasFilledWithSkeletonDueToEmptyArrays: false,\n didFillGroupForSingleSelection: false,\n detectedLostsOnConversion: {\n ellipsis: false,\n render: false,\n },\n mutableReportsPerParentMap: {\n '__first-level-root': {\n lastSectionIndex: undefined,\n adjacentGroupsReport: [],\n hasMultipleSelections: false,\n hasSingleSelections: false,\n hasGrouplessSingleSelections: false,\n isSingleWithoutMultipleAtAll: false,\n hasEmptyOptions: false,\n requiresHierarchicalGrouping: false,\n gracefullRecoveries: { fillGroupForSingleSelection: false, fillLoading: false },\n },\n },\n humanReadableWarnings: [],\n };\n // *******************************************************************************************\n // \"options\" iteration\n // *******************************************************************************************\n // using \"every\" to short-circuit the iteration if we detect an unrecoverable issue\n options.every((option, index) => {\n mutableUpdateReportPerIteration({ mutableReport, option, index, parentDsId: '__first-level-root' });\n if (mutableReport.unrecoverableConversion) return false;\n return true;\n });\n mutableUpdateReportPostIteration({ mutableReport, options });\n mutableReport.humanReadableWarnings = getHumanReadableWarnings(mutableReport);\n return mutableReport;\n};\n\ntype CheckAndConvertOptionsRT = {\n convertedOptions: DSMenuButtonT.MenuItemInterface[];\n report: DSDropdownV2BridgeT.ReportMutableT;\n};\ntype GroupItemWithSubItems = DSMenuButtonT.GroupItem & { subitems: DSMenuButtonT.MenuItemInterface[] };\n\n/**\n * Converts dropdown menu items to menu button items, handling nested structures and grouping (including filling for missing groups if single selections are present).\n * @param options - The dropdown menu items to convert.\n * @returns The converted menu button items.\n */\nconst convertOptionsRecursive = (\n options: DSDropdownMenuT.Item[] | readonly DSDropdownMenuT.Item[],\n): DSMenuButtonT.MenuItemInterface[] => {\n const convertedOptions: DSMenuButtonT.MenuItemInterface[] = [];\n const groups: GroupItemWithSubItems[] = [];\n options.forEach((option) => {\n const convertedOption = convertDropdownItemToMenuButtonItem(option);\n if (isItemSingleWithSubmenuOptions(option) || isItemSubmenuOptions(option)) {\n // we need to iterate over the subitems found at option.options\n const subitems = convertOptionsRecursive(option.options);\n const typecastedOption = convertedOption as\n | DSMenuButtonT.WithSubmenuItem\n | DSMenuButtonT.SingleSelectWithSubmenuItem;\n typecastedOption.subitems = subitems;\n }\n // we need to unwind the sections\n // step 1 - if we encounter a new section, we start tracking a new group\n if (isItemSectionOptions(option)) {\n const typecastedOption = convertedOption as DSMenuButtonT.GroupItem;\n // step 2 - we assure subitems property is present as an array (per new API contract)\n const subitems = [...((typecastedOption as GroupItemWithSubItems).subitems ?? [])];\n // step 3 - we add the group to the groups array\n groups.push({ ...typecastedOption, subitems });\n return;\n }\n // here we can be in three scenarios:\n // A - a \"section\" is present and we are adding items to it\n if (groups.length > 0) {\n const lastGroup = groups[groups.length - 1];\n lastGroup.subitems.push(convertedOption);\n return;\n }\n // B - we encountered a single select without a \"section\" BUT there is no mixing with \"multi select\" and we need to fill a placeholder group\n if (option.type === 'single' || option.type === 'singleWithSubmenu') {\n groups.push({ type: 'group', subitems: [convertedOption], dsId: `filled-group-starting-from-${option.dsId}` });\n return;\n }\n // C - we are adding items to the root level\n convertedOptions.push(convertedOption);\n });\n convertedOptions.push(...groups);\n return convertedOptions;\n};\n\nexport const checkAndConvertOptions = (\n options: DSDropdownV2BridgeT.InternalProps['options'],\n): CheckAndConvertOptionsRT => {\n const report = checkIfOptionsCanBeConverted(options);\n if (report.unrecoverableConversion) throw new Error('DSDropdownV2Bridge - critical configuration issues');\n\n const convertedOptions: DSMenuButtonT.MenuItemInterface[] = convertOptionsRecursive(options);\n\n return { convertedOptions, report };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,+BAKO;AACP,sCAAyC;AACzC,yCAAkF;AAE3E,MAAM,+BAA+B,CAC1C,YACuC;AAQvC,QAAM,gBAAoD;AAAA,IACxD,yBAAyB;AAAA,IACzB,wBAAwB;AAAA,IACxB,uCAAuC;AAAA,IACvC,gCAAgC;AAAA,IAChC,2BAA2B;AAAA,MACzB,UAAU;AAAA,MACV,QAAQ;AAAA,IACV;AAAA,IACA,4BAA4B;AAAA,MAC1B,sBAAsB;AAAA,QACpB,kBAAkB;AAAA,QAClB,sBAAsB,CAAC;AAAA,QACvB,uBAAuB;AAAA,QACvB,qBAAqB;AAAA,QACrB,8BAA8B;AAAA,QAC9B,8BAA8B;AAAA,QAC9B,iBAAiB;AAAA,QACjB,8BAA8B;AAAA,QAC9B,qBAAqB,EAAE,6BAA6B,OAAO,aAAa,MAAM;AAAA,MAChF;AAAA,IACF;AAAA,IACA,uBAAuB,CAAC;AAAA,EAC1B;AAKA,UAAQ,MAAM,CAAC,QAAQ,UAAU;AAC/B,4EAAgC,EAAE,eAAe,QAAQ,OAAO,YAAY,qBAAqB,CAAC;AAClG,QAAI,cAAc,wBAAyB,QAAO;AAClD,WAAO;AAAA,EACT,CAAC;AACD,2EAAiC,EAAE,eAAe,QAAQ,CAAC;AAC3D,gBAAc,4BAAwB,0DAAyB,aAAa;AAC5E,SAAO;AACT;AAaA,MAAM,0BAA0B,CAC9B,YACsC;AACtC,QAAM,mBAAsD,CAAC;AAC7D,QAAM,SAAkC,CAAC;AACzC,UAAQ,QAAQ,CAAC,WAAW;AAC1B,UAAM,sBAAkB,8DAAoC,MAAM;AAClE,YAAI,yDAA+B,MAAM,SAAK,+CAAqB,MAAM,GAAG;AAE1E,YAAM,WAAW,wBAAwB,OAAO,OAAO;AACvD,YAAM,mBAAmB;AAGzB,uBAAiB,WAAW;AAAA,IAC9B;AAGA,YAAI,+CAAqB,MAAM,GAAG;AAChC,YAAM,mBAAmB;AAEzB,YAAM,WAAW,CAAC,GAAK,iBAA2C,YAAY,CAAC,CAAE;AAEjF,aAAO,KAAK,EAAE,GAAG,kBAAkB,SAAS,CAAC;AAC7C;AAAA,IACF;AAGA,QAAI,OAAO,SAAS,GAAG;AACrB,YAAM,YAAY,OAAO,OAAO,SAAS,CAAC;AAC1C,gBAAU,SAAS,KAAK,eAAe;AACvC;AAAA,IACF;AAEA,QAAI,OAAO,SAAS,YAAY,OAAO,SAAS,qBAAqB;AACnE,aAAO,KAAK,EAAE,MAAM,SAAS,UAAU,CAAC,eAAe,GAAG,MAAM,8BAA8B,OAAO,IAAI,GAAG,CAAC;AAC7G;AAAA,IACF;AAEA,qBAAiB,KAAK,eAAe;AAAA,EACvC,CAAC;AACD,mBAAiB,KAAK,GAAG,MAAM;AAC/B,SAAO;AACT;AAEO,MAAM,yBAAyB,CACpC,YAC6B;AAC7B,QAAM,SAAS,6BAA6B,OAAO;AACnD,MAAI,OAAO,wBAAyB,OAAM,IAAI,MAAM,oDAAoD;AAExG,QAAM,mBAAsD,wBAAwB,OAAO;AAE3F,SAAO,EAAE,kBAAkB,OAAO;AACpC;",
4
+ "sourcesContent": ["import { type DSMenuButtonT } from '@elliemae/ds-menu-button';\nimport { type DSDropdownMenuT } from '../../react-desc-prop-types.js';\nimport { type DSDropdownV2BridgeT } from './types.js';\nimport {\n convertDropdownItemToMenuButtonItem,\n isItemSectionOptions,\n isItemSingleWithSubmenuOptions,\n isItemSubmenuOptions,\n} from './conversionHelpers.js';\nimport { getHumanReadableWarnings } from './getHumanReadableWarnings.js';\nimport { mutableUpdateReportPerIteration, mutableUpdateReportPostIteration } from './reportMutableUpdatesHelpers.js';\n\nexport const checkIfOptionsCanBeConverted = (\n options: DSDropdownV2BridgeT.InternalProps['options'],\n): DSDropdownV2BridgeT.ReportMutableT => {\n // this bridge component is not able to automatically bridge some configurations\n // in scenario where the component is not able to bridge the configuration we:\n // A - throw an error if it's a critical configuration\n // B - warn the configuration will be ignored if it's not critical\n // we are going to have to iterate over the options (and the tree-like but not really a DSTree) `options`\n // we should iterate only once and track all the potential violation in one go for performance reasons\n\n const mutableReport: DSDropdownV2BridgeT.ReportMutableT = {\n unrecoverableConversion: false,\n needsGracefullRecovery: false,\n wasFilledWithSkeletonDueToEmptyArrays: false,\n didFillGroupForSingleSelection: false,\n detectedLostsOnConversion: {\n ellipsis: false,\n render: false,\n },\n mutableReportsPerParentMap: {\n '__first-level-root': {\n lastSectionIndex: undefined,\n adjacentGroupsReport: [],\n hasMultipleSelections: false,\n hasSingleSelections: false,\n hasGrouplessSingleSelections: false,\n isSingleWithoutMultipleAtAll: false,\n hasEmptyOptions: false,\n requiresHierarchicalGrouping: false,\n gracefullRecoveries: { fillGroupForSingleSelection: false, fillLoading: false },\n },\n },\n humanReadableWarnings: [],\n };\n // *******************************************************************************************\n // \"options\" iteration\n // *******************************************************************************************\n // using \"every\" to short-circuit the iteration if we detect an unrecoverable issue\n options.every((option, index) => {\n mutableUpdateReportPerIteration({ mutableReport, option, index, parentDsId: '__first-level-root' });\n if (mutableReport.unrecoverableConversion) return false;\n return true;\n });\n mutableUpdateReportPostIteration({ mutableReport, options });\n mutableReport.humanReadableWarnings = getHumanReadableWarnings(mutableReport);\n return mutableReport;\n};\n\ntype CheckAndConvertOptionsRT = {\n convertedOptions: DSMenuButtonT.MenuItemInterface[];\n report: DSDropdownV2BridgeT.ReportMutableT;\n};\ntype GroupItemWithSubItems = DSMenuButtonT.GroupItem & { subitems: DSMenuButtonT.MenuItemInterface[] };\n\n/**\n * Converts dropdown menu items to menu button items, handling nested structures and grouping (including filling for missing groups if single selections are present).\n * @param options - The dropdown menu items to convert.\n * @returns The converted menu button items.\n */\nconst convertOptionsRecursive = (\n options: DSDropdownMenuT.Item[] | readonly DSDropdownMenuT.Item[],\n): DSMenuButtonT.MenuItemInterface[] => {\n const convertedOptions: DSMenuButtonT.MenuItemInterface[] = [];\n const groups: GroupItemWithSubItems[] = [];\n options.forEach((option) => {\n const convertedOption = convertDropdownItemToMenuButtonItem(option);\n if (isItemSingleWithSubmenuOptions(option) || isItemSubmenuOptions(option)) {\n // we need to iterate over the subitems found at option.options\n const subitems = convertOptionsRecursive(option.options);\n const typecastedOption = convertedOption as\n DSMenuButtonT.WithSubmenuItem | DSMenuButtonT.SingleSelectWithSubmenuItem;\n typecastedOption.subitems = subitems as DSMenuButtonT.WithSubmenuItem['subitems'];\n }\n // we need to unwind the sections\n // step 1 - if we encounter a new section, we start tracking a new group\n if (isItemSectionOptions(option)) {\n const typecastedOption = convertedOption as DSMenuButtonT.GroupItem;\n // step 2 - we assure subitems property is present as an array (per new API contract)\n const subitems = [...((typecastedOption as GroupItemWithSubItems).subitems ?? [])];\n // step 3 - we add the group to the groups array\n groups.push({ ...typecastedOption, subitems });\n return;\n }\n // here we can be in three scenarios:\n // A - a \"section\" is present and we are adding items to it\n if (groups.length > 0) {\n const lastGroup = groups[groups.length - 1];\n lastGroup.subitems.push(convertedOption);\n return;\n }\n // B - we encountered a single select without a \"section\" BUT there is no mixing with \"multi select\" and we need to fill a placeholder group\n if (option.type === 'single' || option.type === 'singleWithSubmenu') {\n groups.push({\n type: 'group',\n subitems: [convertedOption as DSMenuButtonT.GroupItem],\n dsId: `filled-group-starting-from-${option.dsId}`,\n });\n return;\n }\n // C - we are adding items to the root level\n convertedOptions.push(convertedOption);\n });\n convertedOptions.push(...groups);\n return convertedOptions;\n};\n\nexport const checkAndConvertOptions = (\n options: DSDropdownV2BridgeT.InternalProps['options'],\n): CheckAndConvertOptionsRT => {\n const report = checkIfOptionsCanBeConverted(options);\n if (report.unrecoverableConversion) throw new Error('DSDropdownV2Bridge - critical configuration issues');\n\n const convertedOptions: DSMenuButtonT.MenuItemInterface[] = convertOptionsRecursive(options);\n\n return { convertedOptions, report };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,+BAKO;AACP,sCAAyC;AACzC,yCAAkF;AAE3E,MAAM,+BAA+B,CAC1C,YACuC;AAQvC,QAAM,gBAAoD;AAAA,IACxD,yBAAyB;AAAA,IACzB,wBAAwB;AAAA,IACxB,uCAAuC;AAAA,IACvC,gCAAgC;AAAA,IAChC,2BAA2B;AAAA,MACzB,UAAU;AAAA,MACV,QAAQ;AAAA,IACV;AAAA,IACA,4BAA4B;AAAA,MAC1B,sBAAsB;AAAA,QACpB,kBAAkB;AAAA,QAClB,sBAAsB,CAAC;AAAA,QACvB,uBAAuB;AAAA,QACvB,qBAAqB;AAAA,QACrB,8BAA8B;AAAA,QAC9B,8BAA8B;AAAA,QAC9B,iBAAiB;AAAA,QACjB,8BAA8B;AAAA,QAC9B,qBAAqB,EAAE,6BAA6B,OAAO,aAAa,MAAM;AAAA,MAChF;AAAA,IACF;AAAA,IACA,uBAAuB,CAAC;AAAA,EAC1B;AAKA,UAAQ,MAAM,CAAC,QAAQ,UAAU;AAC/B,4EAAgC,EAAE,eAAe,QAAQ,OAAO,YAAY,qBAAqB,CAAC;AAClG,QAAI,cAAc,wBAAyB,QAAO;AAClD,WAAO;AAAA,EACT,CAAC;AACD,2EAAiC,EAAE,eAAe,QAAQ,CAAC;AAC3D,gBAAc,4BAAwB,0DAAyB,aAAa;AAC5E,SAAO;AACT;AAaA,MAAM,0BAA0B,CAC9B,YACsC;AACtC,QAAM,mBAAsD,CAAC;AAC7D,QAAM,SAAkC,CAAC;AACzC,UAAQ,QAAQ,CAAC,WAAW;AAC1B,UAAM,sBAAkB,8DAAoC,MAAM;AAClE,YAAI,yDAA+B,MAAM,SAAK,+CAAqB,MAAM,GAAG;AAE1E,YAAM,WAAW,wBAAwB,OAAO,OAAO;AACvD,YAAM,mBAAmB;AAEzB,uBAAiB,WAAW;AAAA,IAC9B;AAGA,YAAI,+CAAqB,MAAM,GAAG;AAChC,YAAM,mBAAmB;AAEzB,YAAM,WAAW,CAAC,GAAK,iBAA2C,YAAY,CAAC,CAAE;AAEjF,aAAO,KAAK,EAAE,GAAG,kBAAkB,SAAS,CAAC;AAC7C;AAAA,IACF;AAGA,QAAI,OAAO,SAAS,GAAG;AACrB,YAAM,YAAY,OAAO,OAAO,SAAS,CAAC;AAC1C,gBAAU,SAAS,KAAK,eAAe;AACvC;AAAA,IACF;AAEA,QAAI,OAAO,SAAS,YAAY,OAAO,SAAS,qBAAqB;AACnE,aAAO,KAAK;AAAA,QACV,MAAM;AAAA,QACN,UAAU,CAAC,eAA0C;AAAA,QACrD,MAAM,8BAA8B,OAAO,IAAI;AAAA,MACjD,CAAC;AACD;AAAA,IACF;AAEA,qBAAiB,KAAK,eAAe;AAAA,EACvC,CAAC;AACD,mBAAiB,KAAK,GAAG,MAAM;AAC/B,SAAO;AACT;AAEO,MAAM,yBAAyB,CACpC,YAC6B;AAC7B,QAAM,SAAS,6BAA6B,OAAO;AACnD,MAAI,OAAO,wBAAyB,OAAM,IAAI,MAAM,oDAAoD;AAExG,QAAM,mBAAsD,wBAAwB,OAAO;AAE3F,SAAO,EAAE,kBAAkB,OAAO;AACpC;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import type {} from '@xstyled/system';\n\nexport { checkAndConvertOptions } from './exported-related/conversion-utils/index.js';\nexport { DSDropdownMenuV2, DSDropdownMenuV2WithSchema } from './DSDropdownMenu.js';\nexport { DropdownMenuDataTestId } from './DropdownMenuDataTestId.js';\nexport { DSDropdownMenuName, DSDropdownMenuPlacements, DSDropdownMenuSlots } from './exported-related/index.js';\nexport {\n defaultProps as DSDropdownMenuV2DefaultProps,\n DSDropdownMenuV2PropTypes,\n actionOptionSchema,\n checkboxOptionSchema,\n optionTypesSchemas,\n sectionOptionSchema,\n separatorOptionSchema,\n singleOptionSchema,\n singleWithSubmenuOptionSchema,\n submenuOptionSchema,\n} from './react-desc-prop-types.js';\nexport type { DSDropdownMenuT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["import type {} from '@xstyled/system';\n\nexport { checkAndConvertOptions } from './exported-related/conversion-utils/index.js';\nexport { DSDropdownMenuV2, DSDropdownMenuV2WithSchema } from './DSDropdownMenu.js';\nexport { DropdownMenuDataTestId } from './DropdownMenuDataTestId.js';\nexport { DSDropdownMenuName, DSDropdownMenuPlacements, DSDropdownMenuSlots } from './exported-related/index.js';\nexport {\n defaultProps as DSDropdownMenuV2DefaultProps,\n DSDropdownMenuV2PropTypes,\n actionOptionSchema,\n checkboxOptionSchema,\n optionTypesSchemas,\n sectionOptionSchema,\n separatorOptionSchema,\n singleOptionSchema,\n singleWithSubmenuOptionSchema,\n submenuOptionSchema,\n} from './react-desc-prop-types.js';\nexport type { DSDropdownMenuT } from './react-desc-prop-types.js';\nexport type { DSDropdownV2BridgeT } from './exported-related/conversion-utils/types.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAAuC;AACvC,4BAA6D;AAC7D,oCAAuC;AACvC,8BAAkF;AAClF,mCAWO;",
6
6
  "names": []
7
7
  }
@@ -34,7 +34,7 @@ module.exports = __toCommonJS(DropdownMenuContent_exports);
34
34
  var React = __toESM(require("react"));
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_react = require("react");
37
- var import_ds_popperjs = require("@elliemae/ds-popperjs");
37
+ var import_ds_floating_context = require("@elliemae/ds-floating-context");
38
38
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
39
39
  var import_DropdownMenuDataTestId = require("../DropdownMenuDataTestId.js");
40
40
  var import_styled = require("../styled.js");
@@ -60,14 +60,33 @@ const DropdownMenuContent = () => {
60
60
  ...globalAttributes
61
61
  } = (0, import_ds_props_helpers.useGetGlobalAttributes)(props);
62
62
  const { minWidth, minHeight, ...restXstyledProps } = (0, import_ds_props_helpers.useGetXstyledProps)(props);
63
- const onClickOutsideHandler = (e) => {
64
- const dropdownListboxes = [
65
- ...document.body.querySelectorAll(`[data-testid="${import_DropdownMenuDataTestId.DropdownMenuDataTestId.MENU_WRAPPER}"]`)
66
- ];
67
- if (dropdownListboxes.every((listbox) => !listbox.contains(e.target))) {
68
- onClickOutside(e);
69
- }
70
- };
63
+ const handleClickOutside = (0, import_react.useCallback)(
64
+ (event) => {
65
+ const target = event.target;
66
+ if (!target) return;
67
+ const dropdownListboxes = [
68
+ ...document.body.querySelectorAll(`[data-testid="${import_DropdownMenuDataTestId.DropdownMenuDataTestId.MENU_WRAPPER}"]`)
69
+ ];
70
+ if (dropdownListboxes.every((listbox) => !listbox.contains(target))) {
71
+ onClickOutside(event);
72
+ }
73
+ },
74
+ [onClickOutside]
75
+ );
76
+ const {
77
+ refs,
78
+ floatingStyles,
79
+ context,
80
+ isOpen: isFloatingOpen
81
+ } = (0, import_ds_floating_context.useFloatingContext)({
82
+ externallyControlledIsOpen: isOpened,
83
+ externalReferenceElement: triggerReferenceElement,
84
+ withoutAnimation: true,
85
+ customOffset,
86
+ placement: startPlacementPreference,
87
+ placementOrderPreference,
88
+ onClickOutside: handleClickOutside
89
+ });
71
90
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
72
91
  import_styled.StyledTriggerWrapper,
73
92
  {
@@ -81,17 +100,13 @@ const DropdownMenuContent = () => {
81
100
  children: [
82
101
  children,
83
102
  triggerReferenceElement && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
84
- import_ds_popperjs.DSPopperJS,
103
+ import_ds_floating_context.FloatingWrapper,
85
104
  {
86
- referenceElement: triggerReferenceElement,
87
- showPopover: isOpened,
88
- withoutArrow: true,
89
- withoutAnimation: true,
90
- customOffset,
91
- onClickOutside: onClickOutsideHandler,
92
- startPlacementPreference,
93
- placementOrderPreference,
94
- zIndex,
105
+ innerRef: refs.setFloating,
106
+ isOpen: isFloatingOpen,
107
+ floatingStyles: { ...floatingStyles, ...zIndex !== void 0 && { zIndex } },
108
+ context,
109
+ role: "region",
95
110
  "aria-label": dataPopoverLabel || "dropdown-menu popover",
96
111
  children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DropdownMenuLoading.DropdownMenuLoading, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DropdownMenuListBox.DropdownMenuListBox, {})
97
112
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/parts/DropdownMenuContent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable no-unused-vars */\nimport React, { useContext } from 'react';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { DropdownMenuDataTestId } from '../DropdownMenuDataTestId.js';\nimport { StyledTriggerWrapper } from '../styled.js';\nimport { DropdownMenuListBox } from './DropdownMenuListBox.js';\nimport { DSDropdownMenuContext } from '../DropdownMenuContext.js';\nimport { DropdownMenuLoading } from './DropdownMenuLoading.js';\n\nexport const DropdownMenuContent: React.ComponentType<Record<string, never>> = () => {\n const { props, triggerReferenceElement, setTriggerReferenceElement } = useContext(DSDropdownMenuContext);\n\n const {\n children,\n isOpened,\n onClickOutside,\n startPlacementPreference,\n placementOrderPreference,\n customOffset,\n wrapperStyles,\n isLoading,\n zIndex,\n as,\n } = props;\n const {\n 'data-popover-label': dataPopoverLabel,\n ...globalAttributes\n }: ReturnType<typeof useGetGlobalAttributes> & { 'data-popover-label'?: string } = useGetGlobalAttributes(props);\n // we need to exclude this props from the xstyled props because there is a conflict\n // using submenus items with the name of the prop of ddmenu and xstyled\n const { minWidth, minHeight, ...restXstyledProps } = useGetXstyledProps(props);\n const onClickOutsideHandler = (e: MouseEvent | TouchEvent) => {\n // We need to find out if the click was originated inside a child's dropdownmenu\n const dropdownListboxes = [\n ...document.body.querySelectorAll(`[data-testid=\"${DropdownMenuDataTestId.MENU_WRAPPER}\"]`),\n ];\n if (dropdownListboxes.every((listbox) => !listbox.contains(e.target as Node))) {\n onClickOutside(e);\n }\n };\n\n return (\n <StyledTriggerWrapper\n data-testid={`${DropdownMenuDataTestId.TRIGGER_WRAPPER}`}\n innerRef={setTriggerReferenceElement}\n aria-haspopup=\"listbox\"\n {...wrapperStyles}\n {...globalAttributes}\n {...restXstyledProps}\n as={as}\n >\n {children}\n {triggerReferenceElement && (\n <DSPopperJS\n referenceElement={triggerReferenceElement}\n showPopover={isOpened}\n withoutArrow\n withoutAnimation\n customOffset={customOffset}\n onClickOutside={onClickOutsideHandler}\n startPlacementPreference={startPlacementPreference}\n placementOrderPreference={placementOrderPreference}\n zIndex={zIndex}\n aria-label={(dataPopoverLabel as string) || 'dropdown-menu popover'}\n >\n {isLoading ? <DropdownMenuLoading /> : <DropdownMenuListBox />}\n </DSPopperJS>\n )}\n </StyledTriggerWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2CnB;AA1CJ,mBAAkC;AAClC,yBAA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"sourcesContent": ["/* eslint-disable no-unused-vars */\nimport React, { useCallback, useContext } from 'react';\nimport { useFloatingContext, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { DropdownMenuDataTestId } from '../DropdownMenuDataTestId.js';\nimport { StyledTriggerWrapper } from '../styled.js';\nimport { DropdownMenuListBox } from './DropdownMenuListBox.js';\nimport { DSDropdownMenuContext } from '../DropdownMenuContext.js';\nimport { DropdownMenuLoading } from './DropdownMenuLoading.js';\n\nexport const DropdownMenuContent: React.ComponentType<Record<string, never>> = () => {\n const { props, triggerReferenceElement, setTriggerReferenceElement } = useContext(DSDropdownMenuContext);\n\n const {\n children,\n isOpened,\n onClickOutside,\n startPlacementPreference,\n placementOrderPreference,\n customOffset,\n wrapperStyles,\n isLoading,\n zIndex,\n as,\n } = props;\n const {\n 'data-popover-label': dataPopoverLabel,\n ...globalAttributes\n }: ReturnType<typeof useGetGlobalAttributes> & { 'data-popover-label'?: string } = useGetGlobalAttributes(props);\n // we need to exclude this props from the xstyled props because there is a conflict\n // using submenus items with the name of the prop of ddmenu and xstyled\n const { minWidth, minHeight, ...restXstyledProps } = useGetXstyledProps(props);\n\n // Click-outside: close only when the click is not inside any child dropdown listbox.\n // The hook's onClickOutside already excludes the floating + reference elements; we add\n // a check for sibling submenu listboxes that may be portaled elsewhere in the document.\n const handleClickOutside = useCallback(\n (event: MouseEvent | TouchEvent) => {\n const target = event.target as Node | null;\n if (!target) return;\n const dropdownListboxes = [\n ...document.body.querySelectorAll(`[data-testid=\"${DropdownMenuDataTestId.MENU_WRAPPER}\"]`),\n ];\n if (dropdownListboxes.every((listbox) => !listbox.contains(target))) {\n onClickOutside(event);\n }\n },\n [onClickOutside],\n );\n\n const {\n refs,\n floatingStyles,\n context,\n isOpen: isFloatingOpen,\n } = useFloatingContext({\n externallyControlledIsOpen: isOpened,\n externalReferenceElement: triggerReferenceElement,\n withoutAnimation: true,\n customOffset,\n placement: startPlacementPreference,\n placementOrderPreference,\n onClickOutside: handleClickOutside,\n });\n\n return (\n <StyledTriggerWrapper\n data-testid={`${DropdownMenuDataTestId.TRIGGER_WRAPPER}`}\n innerRef={setTriggerReferenceElement}\n aria-haspopup=\"listbox\"\n {...wrapperStyles}\n {...globalAttributes}\n {...restXstyledProps}\n as={as}\n >\n {children}\n {triggerReferenceElement && (\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={isFloatingOpen}\n floatingStyles={{ ...floatingStyles, ...(zIndex !== undefined && { zIndex }) }}\n context={context}\n role=\"region\"\n aria-label={(dataPopoverLabel as string) || 'dropdown-menu popover'}\n >\n {isLoading ? <DropdownMenuLoading /> : <DropdownMenuListBox />}\n </FloatingWrapper>\n )}\n </StyledTriggerWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkEnB;AAjEJ,mBAA+C;AAC/C,iCAAoD;AACpD,8BAA2D;AAC3D,oCAAuC;AACvC,oBAAqC;AACrC,iCAAoC;AACpC,iCAAsC;AACtC,iCAAoC;AAE7B,MAAM,sBAAkE,MAAM;AACnF,QAAM,EAAE,OAAO,yBAAyB,2BAA2B,QAAI,yBAAW,gDAAqB;AAEvG,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM;AAAA,IACJ,sBAAsB;AAAA,IACtB,GAAG;AAAA,EACL,QAAmF,gDAAuB,KAAK;AAG/G,QAAM,EAAE,UAAU,WAAW,GAAG,iBAAiB,QAAI,4CAAmB,KAAK;AAK7E,QAAM,yBAAqB;AAAA,IACzB,CAAC,UAAmC;AAClC,YAAM,SAAS,MAAM;AACrB,UAAI,CAAC,OAAQ;AACb,YAAM,oBAAoB;AAAA,QACxB,GAAG,SAAS,KAAK,iBAAiB,iBAAiB,qDAAuB,YAAY,IAAI;AAAA,MAC5F;AACA,UAAI,kBAAkB,MAAM,CAAC,YAAY,CAAC,QAAQ,SAAS,MAAM,CAAC,GAAG;AACnE,uBAAe,KAAK;AAAA,MACtB;AAAA,IACF;AAAA,IACA,CAAC,cAAc;AAAA,EACjB;AAEA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV,QAAI,+CAAmB;AAAA,IACrB,4BAA4B;AAAA,IAC5B,0BAA0B;AAAA,IAC1B,kBAAkB;AAAA,IAClB;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,gBAAgB;AAAA,EAClB,CAAC;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,GAAG,qDAAuB,eAAe;AAAA,MACtD,UAAU;AAAA,MACV,iBAAc;AAAA,MACb,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MAEC;AAAA;AAAA,QACA,2BACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf,QAAQ;AAAA,YACR,gBAAgB,EAAE,GAAG,gBAAgB,GAAI,WAAW,UAAa,EAAE,OAAO,EAAG;AAAA,YAC7E;AAAA,YACA,MAAK;AAAA,YACL,cAAa,oBAA+B;AAAA,YAE3C,sBAAY,4CAAC,kDAAoB,IAAK,4CAAC,kDAAoB;AAAA;AAAA,QAC9D;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/conversion-utils/conversionHelpers.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { type DSMenuButtonT, MENU_ITEMS_TYPES } from '@elliemae/ds-menu-button';\nimport { type DSDropdownMenuT } from '../../react-desc-prop-types.js';\n\n/**\n * Type guard to check if the option is of type ItemSingleOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSingleOptions, false otherwise.\n */\nconst isItemSingleOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSingleOptions =>\n option.type === 'single';\n\n/**\n * Type guard to check if the option is of type ItemActionOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemActionOptions, false otherwise.\n */\nconst isItemActionOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemActionOptions =>\n option.type === 'action';\n\n/**\n * Type guard to check if the option is of type ItemSingleWithSubmenuOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSingleWithSubmenuOptions, false otherwise.\n */\nexport const isItemSingleWithSubmenuOptions = (\n option: DSDropdownMenuT.Item,\n): option is DSDropdownMenuT.ItemSingleWithSubmenuOptions => option.type === 'singleWithSubmenu';\n\n/**\n * Type guard to check if the option is of type ItemCheckboxOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemCheckboxOptions, false otherwise.\n */\nconst isItemCheckboxOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemCheckboxOptions =>\n option.type === 'checkbox';\n\n/**\n * Type guard to check if the option is of type ItemSubmenuOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSubmenuOptions, false otherwise.\n */\nexport const isItemSubmenuOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSubmenuOptions =>\n option.type === 'submenu';\n\n/**\n * Type guard to check if the option is of type ItemSeparatorOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSeparatorOptions, false otherwise.\n */\nconst isItemSeparatorOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSeparatorOptions =>\n option.type === 'separator';\n\n/**\n * Type guard to check if the option is of type ItemSectionOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSectionOptions, false otherwise.\n */\nexport const isItemSectionOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSectionOptions =>\n option.type === 'section';\n\n/**\n * Type guard to check if the option is of type ItemSkeletonOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSkeletonOptions, false otherwise.\n */\nconst isItemSkeletonOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSkeletonOptions =>\n option.type === 'skeleton';\n\n/**\n * Converts ItemActionOptions to DSMenuButtonT.ActivableItem.\n * @param option - The ItemActionOptions to convert.\n * @returns The converted ActivableItem.\n */\nexport const convertActionOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemActionOptions,\n): DSMenuButtonT.ActivableItem => ({\n type: MENU_ITEMS_TYPES.ACTIVABLE_ITEM,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts ItemSingleOptions to DSMenuButtonT.SingleSelectItem.\n * @param option - The ItemSingleWithSubmenuOptions to convert.\n * @returns The converted SingleSelectWithSubmenuItem.\n */\nexport const convertSingleSelectionOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSingleOptions,\n): DSMenuButtonT.SingleSelectItem => ({\n type: MENU_ITEMS_TYPES.SINGLE_SELECT_ITEM,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts ItemCheckboxOptions to DSMenuButtonT.MultipleSelectItem.\n * @param option - The ItemCheckboxOptions to convert.\n * @returns The converted MultipleSelectItem.\n */\nexport const convertCheckboxOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemCheckboxOptions,\n): DSMenuButtonT.MultipleSelectItem => ({\n type: MENU_ITEMS_TYPES.MULTIPLE_SELECT_ITEM,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts ItemSeparatorOptions to DSMenuButtonT.SeparatorItem.\n * @param option - The ItemSeparatorOptions to convert.\n * @returns The converted SeparatorItem.\n */\nexport const convertSeparatorOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSeparatorOptions,\n): DSMenuButtonT.SeparatorItem => ({\n type: MENU_ITEMS_TYPES.SEPARATOR,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n});\n\n/**\n * Converts ItemSectionOptions to DSMenuButtonT.GroupItem.\n * @param option - The ItemSectionOptions to convert.\n * @returns The converted GroupItem.\n */\nexport const convertSectionOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSectionOptions,\n): DSMenuButtonT.GroupItem => ({\n type: MENU_ITEMS_TYPES.GROUP,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n});\n\n/**\n * Converts ItemSkeletonOptions to DSMenuButtonT.SkeletonItem.\n * @param option - The ItemSkeletonOptions to convert.\n * @returns The converted SkeletonItem.\n */\nexport const convertSkeletonOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSkeletonOptions,\n): DSMenuButtonT.SkeletonItem => ({\n type: MENU_ITEMS_TYPES.SKELETON_ITEM,\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n});\n\n// ========================================================================================\n// WithSubmenu conversion requires iterating nested options\n// to avoid \"cannot use before defined\", we inject the conversion as second parameter\n// ========================================================================================\n/**\n * Converts ItemSingleWithSubmenuOptions to DSMenuButtonT.SingleSelectWithSubmenuItem.\n * @param option - The ItemSingleWithSubmenuOptions to convert.\n * @param convFn - The conversion function to convert nested options - required to avoid circular dependencies.\n * @returns The converted SingleSelectWithSubmenuItem.\n */\nexport const convertSingleWithSubmenuOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSingleWithSubmenuOptions,\n convFn: (option: DSDropdownMenuT.Item) => DSMenuButtonT.MenuItemInterface,\n): DSMenuButtonT.SingleSelectWithSubmenuItem => ({\n type: MENU_ITEMS_TYPES.SINGLE_SELECT_WITH_SUBMENU_ITEM,\n label: option.label,\n subitems: option.options.map(convFn),\n maxHeight: option.maxHeight as DSMenuButtonT.SingleSelectWithSubmenuItem['maxHeight'],\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n/**\n * Converts ItemSubmenuOptions to DSMenuButtonT.WithSubmenuItem.\n * @param option - The ItemSubmenuOptions to convert.\n * @param convFn - The conversion function to convert nested options - required to avoid circular dependencies.\n * @returns The converted WithSubmenuItem.\n */\nexport const convertSubmenuOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSubmenuOptions,\n convFn: (option: DSDropdownMenuT.Item) => DSMenuButtonT.MenuItemInterface,\n): DSMenuButtonT.WithSubmenuItem => ({\n type: MENU_ITEMS_TYPES.WITH_SUBMENU_ITEM,\n label: option.label,\n subitems: option.options.map(convFn),\n maxHeight: option.maxHeight as DSMenuButtonT.WithSubmenuItem['maxHeight'],\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts a DSDropdownMenuT.Item to a DSMenuButtonT.MenuItemInterface.\n * @param option - The DSDropdownMenuT.Item to convert.\n * @returns The converted MenuItemInterface.\n */\nexport const convertDropdownItemToMenuButtonItem = (option: DSDropdownMenuT.Item): DSMenuButtonT.MenuItemInterface => {\n if (isItemActionOptions(option)) return convertActionOptToMenuButtonItem(option);\n // single selections\n if (isItemSingleOptions(option)) return convertSingleSelectionOptToMenuButtonItem(option);\n if (isItemSingleWithSubmenuOptions(option))\n return convertSingleWithSubmenuOptToMenuButtonItem(option, convertDropdownItemToMenuButtonItem);\n // multiple selections\n if (isItemCheckboxOptions(option)) return convertCheckboxOptToMenuButtonItem(option);\n // DDV2 didn't support multiple selections with submenu so we don't need to handle it\n // only submenu\n if (isItemSubmenuOptions(option))\n return convertSubmenuOptToMenuButtonItem(option, convertDropdownItemToMenuButtonItem);\n // separators, groups and skeletons\n if (isItemSeparatorOptions(option)) return convertSeparatorOptToMenuButtonItem(option);\n if (isItemSectionOptions(option)) return convertSectionOptToMenuButtonItem(option);\n if (isItemSkeletonOptions(option)) return convertSkeletonOptToMenuButtonItem(option);\n\n throw new Error('Unknown item type');\n};\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { type DSMenuButtonT, MENU_ITEMS_TYPES } from '@elliemae/ds-menu-button';\nimport { type DSDropdownMenuT } from '../../react-desc-prop-types.js';\n\n/**\n * Type guard to check if the option is of type ItemSingleOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSingleOptions, false otherwise.\n */\nconst isItemSingleOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSingleOptions =>\n option.type === 'single';\n\n/**\n * Type guard to check if the option is of type ItemActionOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemActionOptions, false otherwise.\n */\nconst isItemActionOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemActionOptions =>\n option.type === 'action';\n\n/**\n * Type guard to check if the option is of type ItemSingleWithSubmenuOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSingleWithSubmenuOptions, false otherwise.\n */\nexport const isItemSingleWithSubmenuOptions = (\n option: DSDropdownMenuT.Item,\n): option is DSDropdownMenuT.ItemSingleWithSubmenuOptions => option.type === 'singleWithSubmenu';\n\n/**\n * Type guard to check if the option is of type ItemCheckboxOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemCheckboxOptions, false otherwise.\n */\nconst isItemCheckboxOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemCheckboxOptions =>\n option.type === 'checkbox';\n\n/**\n * Type guard to check if the option is of type ItemSubmenuOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSubmenuOptions, false otherwise.\n */\nexport const isItemSubmenuOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSubmenuOptions =>\n option.type === 'submenu';\n\n/**\n * Type guard to check if the option is of type ItemSeparatorOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSeparatorOptions, false otherwise.\n */\nconst isItemSeparatorOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSeparatorOptions =>\n option.type === 'separator';\n\n/**\n * Type guard to check if the option is of type ItemSectionOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSectionOptions, false otherwise.\n */\nexport const isItemSectionOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSectionOptions =>\n option.type === 'section';\n\n/**\n * Type guard to check if the option is of type ItemSkeletonOptions.\n * @param option - The option to check.\n * @returns True if the option is of type ItemSkeletonOptions, false otherwise.\n */\nconst isItemSkeletonOptions = (option: DSDropdownMenuT.Item): option is DSDropdownMenuT.ItemSkeletonOptions =>\n option.type === 'skeleton';\n\n/**\n * Converts ItemActionOptions to DSMenuButtonT.ActivableItem.\n * @param option - The ItemActionOptions to convert.\n * @returns The converted ActivableItem.\n */\nexport const convertActionOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemActionOptions,\n): DSMenuButtonT.ActivableItem => ({\n type: MENU_ITEMS_TYPES.ACTIVABLE_ITEM,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts ItemSingleOptions to DSMenuButtonT.SingleSelectItem.\n * @param option - The ItemSingleWithSubmenuOptions to convert.\n * @returns The converted SingleSelectWithSubmenuItem.\n */\nexport const convertSingleSelectionOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSingleOptions,\n): DSMenuButtonT.SingleSelectItem => ({\n type: MENU_ITEMS_TYPES.SINGLE_SELECT_ITEM,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts ItemCheckboxOptions to DSMenuButtonT.MultipleSelectItem.\n * @param option - The ItemCheckboxOptions to convert.\n * @returns The converted MultipleSelectItem.\n */\nexport const convertCheckboxOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemCheckboxOptions,\n): DSMenuButtonT.MultipleSelectItem => ({\n type: MENU_ITEMS_TYPES.MULTIPLE_SELECT_ITEM,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts ItemSeparatorOptions to DSMenuButtonT.SeparatorItem.\n * @param option - The ItemSeparatorOptions to convert.\n * @returns The converted SeparatorItem.\n */\nexport const convertSeparatorOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSeparatorOptions,\n): DSMenuButtonT.SeparatorItem => ({\n type: MENU_ITEMS_TYPES.SEPARATOR,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n});\n\n/**\n * Converts ItemSectionOptions to DSMenuButtonT.GroupItem.\n * @param option - The ItemSectionOptions to convert.\n * @returns The converted GroupItem.\n */\nexport const convertSectionOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSectionOptions,\n): DSMenuButtonT.GroupItem => ({\n type: MENU_ITEMS_TYPES.GROUP,\n label: option.label,\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n});\n\n/**\n * Converts ItemSkeletonOptions to DSMenuButtonT.SkeletonItem.\n * @param option - The ItemSkeletonOptions to convert.\n * @returns The converted SkeletonItem.\n */\nexport const convertSkeletonOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSkeletonOptions,\n): DSMenuButtonT.SkeletonItem => ({\n type: MENU_ITEMS_TYPES.SKELETON_ITEM,\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.ActivableItem['minWidth'],\n});\n\n// ========================================================================================\n// WithSubmenu conversion requires iterating nested options\n// to avoid \"cannot use before defined\", we inject the conversion as second parameter\n// ========================================================================================\n/**\n * Converts ItemSingleWithSubmenuOptions to DSMenuButtonT.SingleSelectWithSubmenuItem.\n * @param option - The ItemSingleWithSubmenuOptions to convert.\n * @param convFn - The conversion function to convert nested options - required to avoid circular dependencies.\n * @returns The converted SingleSelectWithSubmenuItem.\n */\nexport const convertSingleWithSubmenuOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSingleWithSubmenuOptions,\n convFn: (option: DSDropdownMenuT.Item) => DSMenuButtonT.MenuItemInterface,\n): DSMenuButtonT.SingleSelectWithSubmenuItem => ({\n type: MENU_ITEMS_TYPES.SINGLE_SELECT_WITH_SUBMENU_ITEM,\n label: option.label,\n subitems: option.options.map(convFn) as DSMenuButtonT.SingleSelectWithSubmenuItem['subitems'],\n maxHeight: option.maxHeight as DSMenuButtonT.SingleSelectWithSubmenuItem['maxHeight'],\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.SingleSelectWithSubmenuItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n/**\n * Converts ItemSubmenuOptions to DSMenuButtonT.WithSubmenuItem.\n * @param option - The ItemSubmenuOptions to convert.\n * @param convFn - The conversion function to convert nested options - required to avoid circular dependencies.\n * @returns The converted WithSubmenuItem.\n */\nexport const convertSubmenuOptToMenuButtonItem = (\n option: DSDropdownMenuT.ItemSubmenuOptions,\n convFn: (option: DSDropdownMenuT.Item) => DSMenuButtonT.MenuItemInterface,\n): DSMenuButtonT.WithSubmenuItem => ({\n type: MENU_ITEMS_TYPES.WITH_SUBMENU_ITEM,\n label: option.label,\n subitems: option.options.map(convFn) as DSMenuButtonT.WithSubmenuItem['subitems'],\n maxHeight: option.maxHeight as DSMenuButtonT.WithSubmenuItem['maxHeight'],\n // DSDropdownMenuT common items properties\n dsId: option.dsId,\n minWidth: option?.minWidth as DSMenuButtonT.WithSubmenuItem['minWidth'],\n disabled: option.disabled || option.applyAriaDisabled,\n onClick: option.onClick,\n onKeyDown: option.onKeyDown,\n});\n\n/**\n * Converts a DSDropdownMenuT.Item to a DSMenuButtonT.MenuItemInterface.\n * @param option - The DSDropdownMenuT.Item to convert.\n * @returns The converted MenuItemInterface.\n */\nexport const convertDropdownItemToMenuButtonItem = (option: DSDropdownMenuT.Item): DSMenuButtonT.MenuItemInterface => {\n if (isItemActionOptions(option)) return convertActionOptToMenuButtonItem(option);\n // single selections\n if (isItemSingleOptions(option)) return convertSingleSelectionOptToMenuButtonItem(option);\n if (isItemSingleWithSubmenuOptions(option))\n return convertSingleWithSubmenuOptToMenuButtonItem(option, convertDropdownItemToMenuButtonItem);\n // multiple selections\n if (isItemCheckboxOptions(option)) return convertCheckboxOptToMenuButtonItem(option);\n // DDV2 didn't support multiple selections with submenu so we don't need to handle it\n // only submenu\n if (isItemSubmenuOptions(option))\n return convertSubmenuOptToMenuButtonItem(option, convertDropdownItemToMenuButtonItem);\n // separators, groups and skeletons\n if (isItemSeparatorOptions(option)) return convertSeparatorOptToMenuButtonItem(option);\n if (isItemSectionOptions(option)) return convertSectionOptToMenuButtonItem(option);\n if (isItemSkeletonOptions(option)) return convertSkeletonOptToMenuButtonItem(option);\n\n throw new Error('Unknown item type');\n};\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,SAA6B,wBAAwB;AAQrD,MAAM,sBAAsB,CAAC,WAC3B,OAAO,SAAS;AAOlB,MAAM,sBAAsB,CAAC,WAC3B,OAAO,SAAS;AAOX,MAAM,iCAAiC,CAC5C,WAC2D,OAAO,SAAS;AAO7E,MAAM,wBAAwB,CAAC,WAC7B,OAAO,SAAS;AAOX,MAAM,uBAAuB,CAAC,WACnC,OAAO,SAAS;AAOlB,MAAM,yBAAyB,CAAC,WAC9B,OAAO,SAAS;AAOX,MAAM,uBAAuB,CAAC,WACnC,OAAO,SAAS;AAOlB,MAAM,wBAAwB,CAAC,WAC7B,OAAO,SAAS;AAOX,MAAM,mCAAmC,CAC9C,YACiC;AAAA,EACjC,MAAM,iBAAiB;AAAA,EACvB,OAAO,OAAO;AAAA;AAAA,EAEd,MAAM,OAAO;AAAA,EACb,UAAU,QAAQ;AAAA,EAClB,UAAU,OAAO,YAAY,OAAO;AAAA,EACpC,SAAS,OAAO;AAAA,EAChB,WAAW,OAAO;AACpB;AAOO,MAAM,4CAA4C,CACvD,YACoC;AAAA,EACpC,MAAM,iBAAiB;AAAA,EACvB,OAAO,OAAO;AAAA;AAAA,EAEd,MAAM,OAAO;AAAA,EACb,UAAU,QAAQ;AAAA,EAClB,UAAU,OAAO,YAAY,OAAO;AAAA,EACpC,SAAS,OAAO;AAAA,EAChB,WAAW,OAAO;AACpB;AAOO,MAAM,qCAAqC,CAChD,YACsC;AAAA,EACtC,MAAM,iBAAiB;AAAA,EACvB,OAAO,OAAO;AAAA;AAAA,EAEd,MAAM,OAAO;AAAA,EACb,UAAU,QAAQ;AAAA,EAClB,UAAU,OAAO,YAAY,OAAO;AAAA,EACpC,SAAS,OAAO;AAAA,EAChB,WAAW,OAAO;AACpB;AAOO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AM;AAC7B,WAAO,kCAAkC,QAAQ,mCAAmC;AAEtF,MAAI,uBAAuB,MAAM,EAAG,QAAO,oCAAoC,MAAM;AACrF,MAAI,qBAAqB,MAAM,EAAG,QAAO,kCAAkC,MAAM;AACjF,MAAI,sBAAsB,MAAM,EAAG,QAAO,mCAAmC,MAAM;AAEnF,QAAM,IAAI,MAAM,mBAAmB;AACrC;",
6
6
  "names": []
7
7
  }
@@ -63,7 +63,11 @@ const convertOptionsRecursive = (options) => {
63
63
  return;
64
64
  }
65
65
  if (option.type === "single" || option.type === "singleWithSubmenu") {
66
- groups.push({ type: "group", subitems: [convertedOption], dsId: `filled-group-starting-from-${option.dsId}` });
66
+ groups.push({
67
+ type: "group",
68
+ subitems: [convertedOption],
69
+ dsId: `filled-group-starting-from-${option.dsId}`
70
+ });
67
71
  return;
68
72
  }
69
73
  convertedOptions.push(convertedOption);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/conversion-utils/index.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { type DSMenuButtonT } from '@elliemae/ds-menu-button';\nimport { type DSDropdownMenuT } from '../../react-desc-prop-types.js';\nimport { type DSDropdownV2BridgeT } from './types.js';\nimport {\n convertDropdownItemToMenuButtonItem,\n isItemSectionOptions,\n isItemSingleWithSubmenuOptions,\n isItemSubmenuOptions,\n} from './conversionHelpers.js';\nimport { getHumanReadableWarnings } from './getHumanReadableWarnings.js';\nimport { mutableUpdateReportPerIteration, mutableUpdateReportPostIteration } from './reportMutableUpdatesHelpers.js';\n\nexport const checkIfOptionsCanBeConverted = (\n options: DSDropdownV2BridgeT.InternalProps['options'],\n): DSDropdownV2BridgeT.ReportMutableT => {\n // this bridge component is not able to automatically bridge some configurations\n // in scenario where the component is not able to bridge the configuration we:\n // A - throw an error if it's a critical configuration\n // B - warn the configuration will be ignored if it's not critical\n // we are going to have to iterate over the options (and the tree-like but not really a DSTree) `options`\n // we should iterate only once and track all the potential violation in one go for performance reasons\n\n const mutableReport: DSDropdownV2BridgeT.ReportMutableT = {\n unrecoverableConversion: false,\n needsGracefullRecovery: false,\n wasFilledWithSkeletonDueToEmptyArrays: false,\n didFillGroupForSingleSelection: false,\n detectedLostsOnConversion: {\n ellipsis: false,\n render: false,\n },\n mutableReportsPerParentMap: {\n '__first-level-root': {\n lastSectionIndex: undefined,\n adjacentGroupsReport: [],\n hasMultipleSelections: false,\n hasSingleSelections: false,\n hasGrouplessSingleSelections: false,\n isSingleWithoutMultipleAtAll: false,\n hasEmptyOptions: false,\n requiresHierarchicalGrouping: false,\n gracefullRecoveries: { fillGroupForSingleSelection: false, fillLoading: false },\n },\n },\n humanReadableWarnings: [],\n };\n // *******************************************************************************************\n // \"options\" iteration\n // *******************************************************************************************\n // using \"every\" to short-circuit the iteration if we detect an unrecoverable issue\n options.every((option, index) => {\n mutableUpdateReportPerIteration({ mutableReport, option, index, parentDsId: '__first-level-root' });\n if (mutableReport.unrecoverableConversion) return false;\n return true;\n });\n mutableUpdateReportPostIteration({ mutableReport, options });\n mutableReport.humanReadableWarnings = getHumanReadableWarnings(mutableReport);\n return mutableReport;\n};\n\ntype CheckAndConvertOptionsRT = {\n convertedOptions: DSMenuButtonT.MenuItemInterface[];\n report: DSDropdownV2BridgeT.ReportMutableT;\n};\ntype GroupItemWithSubItems = DSMenuButtonT.GroupItem & { subitems: DSMenuButtonT.MenuItemInterface[] };\n\n/**\n * Converts dropdown menu items to menu button items, handling nested structures and grouping (including filling for missing groups if single selections are present).\n * @param options - The dropdown menu items to convert.\n * @returns The converted menu button items.\n */\nconst convertOptionsRecursive = (\n options: DSDropdownMenuT.Item[] | readonly DSDropdownMenuT.Item[],\n): DSMenuButtonT.MenuItemInterface[] => {\n const convertedOptions: DSMenuButtonT.MenuItemInterface[] = [];\n const groups: GroupItemWithSubItems[] = [];\n options.forEach((option) => {\n const convertedOption = convertDropdownItemToMenuButtonItem(option);\n if (isItemSingleWithSubmenuOptions(option) || isItemSubmenuOptions(option)) {\n // we need to iterate over the subitems found at option.options\n const subitems = convertOptionsRecursive(option.options);\n const typecastedOption = convertedOption as\n | DSMenuButtonT.WithSubmenuItem\n | DSMenuButtonT.SingleSelectWithSubmenuItem;\n typecastedOption.subitems = subitems;\n }\n // we need to unwind the sections\n // step 1 - if we encounter a new section, we start tracking a new group\n if (isItemSectionOptions(option)) {\n const typecastedOption = convertedOption as DSMenuButtonT.GroupItem;\n // step 2 - we assure subitems property is present as an array (per new API contract)\n const subitems = [...((typecastedOption as GroupItemWithSubItems).subitems ?? [])];\n // step 3 - we add the group to the groups array\n groups.push({ ...typecastedOption, subitems });\n return;\n }\n // here we can be in three scenarios:\n // A - a \"section\" is present and we are adding items to it\n if (groups.length > 0) {\n const lastGroup = groups[groups.length - 1];\n lastGroup.subitems.push(convertedOption);\n return;\n }\n // B - we encountered a single select without a \"section\" BUT there is no mixing with \"multi select\" and we need to fill a placeholder group\n if (option.type === 'single' || option.type === 'singleWithSubmenu') {\n groups.push({ type: 'group', subitems: [convertedOption], dsId: `filled-group-starting-from-${option.dsId}` });\n return;\n }\n // C - we are adding items to the root level\n convertedOptions.push(convertedOption);\n });\n convertedOptions.push(...groups);\n return convertedOptions;\n};\n\nexport const checkAndConvertOptions = (\n options: DSDropdownV2BridgeT.InternalProps['options'],\n): CheckAndConvertOptionsRT => {\n const report = checkIfOptionsCanBeConverted(options);\n if (report.unrecoverableConversion) throw new Error('DSDropdownV2Bridge - critical configuration issues');\n\n const convertedOptions: DSMenuButtonT.MenuItemInterface[] = convertOptionsRecursive(options);\n\n return { convertedOptions, report };\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACGvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gCAAgC;AACzC,SAAS,iCAAiC,wCAAwC;AAE3E,MAAM,+BAA+B,CAC1C,YACuC;AAQvC,QAAM,gBAAoD;AAA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AAS,GAAG;AACrB,YAAM,YAAY,OAAO,OAAO,SAAS,CAAC;AAC1C,gBAAU,SAAS,KAAK,eAAe;AACvC;AAAA,IACF;AAEA,QAAI,OAAO,SAAS,YAAY,OAAO,SAAS,qBAAqB;AACnE,aAAO,KAAK,EAAE,MAAM,SAAS,UAAU,CAAC,eAAe,GAAG,MAAM,8BAA8B,OAAO,IAAI,GAAG,CAAC;AAC7G;AAAA,IACF;AAEA,qBAAiB,KAAK,eAAe;AAAA,EACvC,CAAC;AACD,mBAAiB,KAAK,GAAG,MAAM;AAC/B,SAAO;AACT;AAEO,MAAM,yBAAyB,CACpC,YAC6B;AAC7B,QAAM,SAAS,6BAA6B,OAAO;AACnD,MAAI,OAAO,wBAAyB,OAAM,IAAI,MAAM,oDAAoD;AAExG,QAAM,mBAAsD,wBAAwB,OAAO;AAE3F,SAAO,EAAE,kBAAkB,OAAO;AACpC;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { type DSMenuButtonT } from '@elliemae/ds-menu-button';\nimport { type DSDropdownMenuT } from '../../react-desc-prop-types.js';\nimport { type DSDropdownV2BridgeT } from './types.js';\nimport {\n convertDropdownItemToMenuButtonItem,\n isItemSectionOptions,\n isItemSingleWithSubmenuOptions,\n isItemSubmenuOptions,\n} from './conversionHelpers.js';\nimport { getHumanReadableWarnings } from './getHumanReadableWarnings.js';\nimport { mutableUpdateReportPerIteration, mutableUpdateReportPostIteration } from './reportMutableUpdatesHelpers.js';\n\nexport const checkIfOptionsCanBeConverted = (\n options: DSDropdownV2BridgeT.InternalProps['options'],\n): DSDropdownV2BridgeT.ReportMutableT => {\n // this bridge component is not able to automatically bridge some configurations\n // in scenario where the component is not able to bridge the configuration we:\n // A - throw an error if it's a critical configuration\n // B - warn the configuration will be ignored if it's not critical\n // we are going to have to iterate over the options (and the tree-like but not really a DSTree) `options`\n // we should iterate only once and track all the potential violation in one go for performance reasons\n\n const mutableReport: DSDropdownV2BridgeT.ReportMutableT = {\n unrecoverableConversion: false,\n needsGracefullRecovery: false,\n wasFilledWithSkeletonDueToEmptyArrays: false,\n didFillGroupForSingleSelection: false,\n detectedLostsOnConversion: {\n ellipsis: false,\n render: false,\n },\n mutableReportsPerParentMap: {\n '__first-level-root': {\n lastSectionIndex: undefined,\n adjacentGroupsReport: [],\n hasMultipleSelections: false,\n hasSingleSelections: false,\n hasGrouplessSingleSelections: false,\n isSingleWithoutMultipleAtAll: false,\n hasEmptyOptions: false,\n requiresHierarchicalGrouping: false,\n gracefullRecoveries: { fillGroupForSingleSelection: false, fillLoading: false },\n },\n },\n humanReadableWarnings: [],\n };\n // *******************************************************************************************\n // \"options\" iteration\n // *******************************************************************************************\n // using \"every\" to short-circuit the iteration if we detect an unrecoverable issue\n options.every((option, index) => {\n mutableUpdateReportPerIteration({ mutableReport, option, index, parentDsId: '__first-level-root' });\n if (mutableReport.unrecoverableConversion) return false;\n return true;\n });\n mutableUpdateReportPostIteration({ mutableReport, options });\n mutableReport.humanReadableWarnings = getHumanReadableWarnings(mutableReport);\n return mutableReport;\n};\n\ntype CheckAndConvertOptionsRT = {\n convertedOptions: DSMenuButtonT.MenuItemInterface[];\n report: DSDropdownV2BridgeT.ReportMutableT;\n};\ntype GroupItemWithSubItems = DSMenuButtonT.GroupItem & { subitems: DSMenuButtonT.MenuItemInterface[] };\n\n/**\n * Converts dropdown menu items to menu button items, handling nested structures and grouping (including filling for missing groups if single selections are present).\n * @param options - The dropdown menu items to convert.\n * @returns The converted menu button items.\n */\nconst convertOptionsRecursive = (\n options: DSDropdownMenuT.Item[] | readonly DSDropdownMenuT.Item[],\n): DSMenuButtonT.MenuItemInterface[] => {\n const convertedOptions: DSMenuButtonT.MenuItemInterface[] = [];\n const groups: GroupItemWithSubItems[] = [];\n options.forEach((option) => {\n const convertedOption = convertDropdownItemToMenuButtonItem(option);\n if (isItemSingleWithSubmenuOptions(option) || isItemSubmenuOptions(option)) {\n // we need to iterate over the subitems found at option.options\n const subitems = convertOptionsRecursive(option.options);\n const typecastedOption = convertedOption as\n DSMenuButtonT.WithSubmenuItem | DSMenuButtonT.SingleSelectWithSubmenuItem;\n typecastedOption.subitems = subitems as DSMenuButtonT.WithSubmenuItem['subitems'];\n }\n // we need to unwind the sections\n // step 1 - if we encounter a new section, we start tracking a new group\n if (isItemSectionOptions(option)) {\n const typecastedOption = convertedOption as DSMenuButtonT.GroupItem;\n // step 2 - we assure subitems property is present as an array (per new API contract)\n const subitems = [...((typecastedOption as GroupItemWithSubItems).subitems ?? [])];\n // step 3 - we add the group to the groups array\n groups.push({ ...typecastedOption, subitems });\n return;\n }\n // here we can be in three scenarios:\n // A - a \"section\" is present and we are adding items to it\n if (groups.length > 0) {\n const lastGroup = groups[groups.length - 1];\n lastGroup.subitems.push(convertedOption);\n return;\n }\n // B - we encountered a single select without a \"section\" BUT there is no mixing with \"multi select\" and we need to fill a placeholder group\n if (option.type === 'single' || option.type === 'singleWithSubmenu') {\n groups.push({\n type: 'group',\n subitems: [convertedOption as DSMenuButtonT.GroupItem],\n dsId: `filled-group-starting-from-${option.dsId}`,\n });\n return;\n }\n // C - we are adding items to the root level\n convertedOptions.push(convertedOption);\n });\n convertedOptions.push(...groups);\n return convertedOptions;\n};\n\nexport const checkAndConvertOptions = (\n options: DSDropdownV2BridgeT.InternalProps['options'],\n): CheckAndConvertOptionsRT => {\n const report = checkIfOptionsCanBeConverted(options);\n if (report.unrecoverableConversion) throw new Error('DSDropdownV2Bridge - critical configuration issues');\n\n const convertedOptions: DSMenuButtonT.MenuItemInterface[] = convertOptionsRecursive(options);\n\n return { convertedOptions, report };\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gCAAgC;AACzC,SAAS,iCAAiC,wCAAwC;AAE3E,MAAM,+BAA+B,CAC1C,YACuC;AAQvC,QAAM,gBAAoD;AAAA,IACxD,yBAAyB;AAAA,IACzB,wBAAwB;AAAA,IAC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,CAAC;AAC1C,gBAAU,SAAS,KAAK,eAAe;AACvC;AAAA,IACF;AAEA,QAAI,OAAO,SAAS,YAAY,OAAO,SAAS,qBAAqB;AACnE,aAAO,KAAK;AAAA,QACV,MAAM;AAAA,QACN,UAAU,CAAC,eAA0C;AAAA,QACrD,MAAM,8BAA8B,OAAO,IAAI;AAAA,MACjD,CAAC;AACD;AAAA,IACF;AAEA,qBAAiB,KAAK,eAAe;AAAA,EACvC,CAAC;AACD,mBAAiB,KAAK,GAAG,MAAM;AAC/B,SAAO;AACT;AAEO,MAAM,yBAAyB,CACpC,YAC6B;AAC7B,QAAM,SAAS,6BAA6B,OAAO;AACnD,MAAI,OAAO,wBAAyB,OAAM,IAAI,MAAM,oDAAoD;AAExG,QAAM,mBAAsD,wBAAwB,OAAO;AAE3F,SAAO,EAAE,kBAAkB,OAAO;AACpC;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type {} from '@xstyled/system';\n\nexport { checkAndConvertOptions } from './exported-related/conversion-utils/index.js';\nexport { DSDropdownMenuV2, DSDropdownMenuV2WithSchema } from './DSDropdownMenu.js';\nexport { DropdownMenuDataTestId } from './DropdownMenuDataTestId.js';\nexport { DSDropdownMenuName, DSDropdownMenuPlacements, DSDropdownMenuSlots } from './exported-related/index.js';\nexport {\n defaultProps as DSDropdownMenuV2DefaultProps,\n DSDropdownMenuV2PropTypes,\n actionOptionSchema,\n checkboxOptionSchema,\n optionTypesSchemas,\n sectionOptionSchema,\n separatorOptionSchema,\n singleOptionSchema,\n singleWithSubmenuOptionSchema,\n submenuOptionSchema,\n} from './react-desc-prop-types.js';\nexport type { DSDropdownMenuT } from './react-desc-prop-types.js';\n"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type {} from '@xstyled/system';\n\nexport { checkAndConvertOptions } from './exported-related/conversion-utils/index.js';\nexport { DSDropdownMenuV2, DSDropdownMenuV2WithSchema } from './DSDropdownMenu.js';\nexport { DropdownMenuDataTestId } from './DropdownMenuDataTestId.js';\nexport { DSDropdownMenuName, DSDropdownMenuPlacements, DSDropdownMenuSlots } from './exported-related/index.js';\nexport {\n defaultProps as DSDropdownMenuV2DefaultProps,\n DSDropdownMenuV2PropTypes,\n actionOptionSchema,\n checkboxOptionSchema,\n optionTypesSchemas,\n sectionOptionSchema,\n separatorOptionSchema,\n singleOptionSchema,\n singleWithSubmenuOptionSchema,\n submenuOptionSchema,\n} from './react-desc-prop-types.js';\nexport type { DSDropdownMenuT } from './react-desc-prop-types.js';\nexport type { DSDropdownV2BridgeT } from './exported-related/conversion-utils/types.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,8BAA8B;AACvC,SAAS,kBAAkB,kCAAkC;AAC7D,SAAS,8BAA8B;AACvC,SAAS,oBAAoB,0BAA0B,2BAA2B;AAClF;AAAA,EACkB;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { useContext } from "react";
4
- import { DSPopperJS } from "@elliemae/ds-popperjs";
3
+ import { useCallback, useContext } from "react";
4
+ import { useFloatingContext, FloatingWrapper } from "@elliemae/ds-floating-context";
5
5
  import { useGetGlobalAttributes, useGetXstyledProps } from "@elliemae/ds-props-helpers";
6
6
  import { DropdownMenuDataTestId } from "../DropdownMenuDataTestId.js";
7
7
  import { StyledTriggerWrapper } from "../styled.js";
@@ -27,14 +27,33 @@ const DropdownMenuContent = () => {
27
27
  ...globalAttributes
28
28
  } = useGetGlobalAttributes(props);
29
29
  const { minWidth, minHeight, ...restXstyledProps } = useGetXstyledProps(props);
30
- const onClickOutsideHandler = (e) => {
31
- const dropdownListboxes = [
32
- ...document.body.querySelectorAll(`[data-testid="${DropdownMenuDataTestId.MENU_WRAPPER}"]`)
33
- ];
34
- if (dropdownListboxes.every((listbox) => !listbox.contains(e.target))) {
35
- onClickOutside(e);
36
- }
37
- };
30
+ const handleClickOutside = useCallback(
31
+ (event) => {
32
+ const target = event.target;
33
+ if (!target) return;
34
+ const dropdownListboxes = [
35
+ ...document.body.querySelectorAll(`[data-testid="${DropdownMenuDataTestId.MENU_WRAPPER}"]`)
36
+ ];
37
+ if (dropdownListboxes.every((listbox) => !listbox.contains(target))) {
38
+ onClickOutside(event);
39
+ }
40
+ },
41
+ [onClickOutside]
42
+ );
43
+ const {
44
+ refs,
45
+ floatingStyles,
46
+ context,
47
+ isOpen: isFloatingOpen
48
+ } = useFloatingContext({
49
+ externallyControlledIsOpen: isOpened,
50
+ externalReferenceElement: triggerReferenceElement,
51
+ withoutAnimation: true,
52
+ customOffset,
53
+ placement: startPlacementPreference,
54
+ placementOrderPreference,
55
+ onClickOutside: handleClickOutside
56
+ });
38
57
  return /* @__PURE__ */ jsxs(
39
58
  StyledTriggerWrapper,
40
59
  {
@@ -48,17 +67,13 @@ const DropdownMenuContent = () => {
48
67
  children: [
49
68
  children,
50
69
  triggerReferenceElement && /* @__PURE__ */ jsx(
51
- DSPopperJS,
70
+ FloatingWrapper,
52
71
  {
53
- referenceElement: triggerReferenceElement,
54
- showPopover: isOpened,
55
- withoutArrow: true,
56
- withoutAnimation: true,
57
- customOffset,
58
- onClickOutside: onClickOutsideHandler,
59
- startPlacementPreference,
60
- placementOrderPreference,
61
- zIndex,
72
+ innerRef: refs.setFloating,
73
+ isOpen: isFloatingOpen,
74
+ floatingStyles: { ...floatingStyles, ...zIndex !== void 0 && { zIndex } },
75
+ context,
76
+ role: "region",
62
77
  "aria-label": dataPopoverLabel || "dropdown-menu popover",
63
78
  children: isLoading ? /* @__PURE__ */ jsx(DropdownMenuLoading, {}) : /* @__PURE__ */ jsx(DropdownMenuListBox, {})
64
79
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DropdownMenuContent.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-unused-vars */\nimport React, { useContext } from 'react';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { DropdownMenuDataTestId } from '../DropdownMenuDataTestId.js';\nimport { StyledTriggerWrapper } from '../styled.js';\nimport { DropdownMenuListBox } from './DropdownMenuListBox.js';\nimport { DSDropdownMenuContext } from '../DropdownMenuContext.js';\nimport { DropdownMenuLoading } from './DropdownMenuLoading.js';\n\nexport const DropdownMenuContent: React.ComponentType<Record<string, never>> = () => {\n const { props, triggerReferenceElement, setTriggerReferenceElement } = useContext(DSDropdownMenuContext);\n\n const {\n children,\n isOpened,\n onClickOutside,\n startPlacementPreference,\n placementOrderPreference,\n customOffset,\n wrapperStyles,\n isLoading,\n zIndex,\n as,\n } = props;\n const {\n 'data-popover-label': dataPopoverLabel,\n ...globalAttributes\n }: ReturnType<typeof useGetGlobalAttributes> & { 'data-popover-label'?: string } = useGetGlobalAttributes(props);\n // we need to exclude this props from the xstyled props because there is a conflict\n // using submenus items with the name of the prop of ddmenu and xstyled\n const { minWidth, minHeight, ...restXstyledProps } = useGetXstyledProps(props);\n const onClickOutsideHandler = (e: MouseEvent | TouchEvent) => {\n // We need to find out if the click was originated inside a child's dropdownmenu\n const dropdownListboxes = [\n ...document.body.querySelectorAll(`[data-testid=\"${DropdownMenuDataTestId.MENU_WRAPPER}\"]`),\n ];\n if (dropdownListboxes.every((listbox) => !listbox.contains(e.target as Node))) {\n onClickOutside(e);\n }\n };\n\n return (\n <StyledTriggerWrapper\n data-testid={`${DropdownMenuDataTestId.TRIGGER_WRAPPER}`}\n innerRef={setTriggerReferenceElement}\n aria-haspopup=\"listbox\"\n {...wrapperStyles}\n {...globalAttributes}\n {...restXstyledProps}\n as={as}\n >\n {children}\n {triggerReferenceElement && (\n <DSPopperJS\n referenceElement={triggerReferenceElement}\n showPopover={isOpened}\n withoutArrow\n withoutAnimation\n customOffset={customOffset}\n onClickOutside={onClickOutsideHandler}\n startPlacementPreference={startPlacementPreference}\n placementOrderPreference={placementOrderPreference}\n zIndex={zIndex}\n aria-label={(dataPopoverLabel as string) || 'dropdown-menu popover'}\n >\n {isLoading ? <DropdownMenuLoading /> : <DropdownMenuListBox />}\n </DSPopperJS>\n )}\n </StyledTriggerWrapper>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC2CnB,SAuBmB,KAvBnB;AA1CJ,SAAgB,kBAAkB;AAClC,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB,0BAA0B;AAC3D,SAAS,8BAA8B;AACvC,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AACpC,SAAS,6BAA6B;AACtC,SAAS,2BAA2B;AAE7B,MAAM,sBAAkE,MAAM;AACnF,QAAM,EAAE,OAAO,yBAAyB,2BAA2B,IAAI,WAAW,qBAAqB;AAEvG,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM;AAAA,IACJ,sBAAsB;AAAA,IACtB,GAAG;AAAA,EACL,IAAmF,uBAAuB,KAAK;AAG/G,QAAM,EAAE,UAAU,WAAW,GAAG,iBAAiB,IAAI,mBAAmB,KAAK;AAC7E,QAAM,wBAAwB,CAAC,MAA+B;AAE5D,UAAM,oBAAoB;AAAA,MACxB,GAAG,SAAS,KAAK,iBAAiB,iBAAiB,uBAAuB,YAAY,IAAI;AAAA,IAC5F;AACA,QAAI,kBAAkB,MAAM,CAAC,YAAY,CAAC,QAAQ,SAAS,EAAE,MAAc,CAAC,GAAG;AAC7E,qBAAe,CAAC;AAAA,IAClB;AAAA,EACF;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,GAAG,uBAAuB,eAAe;AAAA,MACtD,UAAU;AAAA,MACV,iBAAc;AAAA,MACb,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MAEC;AAAA;AAAA,QACA,2BACC;AAAA,UAAC;AAAA;AAAA,YACC,kBAAkB;AAAA,YAClB,aAAa;AAAA,YACb,cAAY;AAAA,YACZ,kBAAgB;AAAA,YAChB;AAAA,YACA,gBAAgB;AAAA,YAChB;AAAA,YACA;AAAA,YACA;AAAA,YACA,cAAa,oBAA+B;AAAA,YAE3C,sBAAY,oBAAC,uBAAoB,IAAK,oBAAC,uBAAoB;AAAA;AAAA,QAC9D;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-unused-vars */\nimport React, { useCallback, useContext } from 'react';\nimport { useFloatingContext, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { DropdownMenuDataTestId } from '../DropdownMenuDataTestId.js';\nimport { StyledTriggerWrapper } from '../styled.js';\nimport { DropdownMenuListBox } from './DropdownMenuListBox.js';\nimport { DSDropdownMenuContext } from '../DropdownMenuContext.js';\nimport { DropdownMenuLoading } from './DropdownMenuLoading.js';\n\nexport const DropdownMenuContent: React.ComponentType<Record<string, never>> = () => {\n const { props, triggerReferenceElement, setTriggerReferenceElement } = useContext(DSDropdownMenuContext);\n\n const {\n children,\n isOpened,\n onClickOutside,\n startPlacementPreference,\n placementOrderPreference,\n customOffset,\n wrapperStyles,\n isLoading,\n zIndex,\n as,\n } = props;\n const {\n 'data-popover-label': dataPopoverLabel,\n ...globalAttributes\n }: ReturnType<typeof useGetGlobalAttributes> & { 'data-popover-label'?: string } = useGetGlobalAttributes(props);\n // we need to exclude this props from the xstyled props because there is a conflict\n // using submenus items with the name of the prop of ddmenu and xstyled\n const { minWidth, minHeight, ...restXstyledProps } = useGetXstyledProps(props);\n\n // Click-outside: close only when the click is not inside any child dropdown listbox.\n // The hook's onClickOutside already excludes the floating + reference elements; we add\n // a check for sibling submenu listboxes that may be portaled elsewhere in the document.\n const handleClickOutside = useCallback(\n (event: MouseEvent | TouchEvent) => {\n const target = event.target as Node | null;\n if (!target) return;\n const dropdownListboxes = [\n ...document.body.querySelectorAll(`[data-testid=\"${DropdownMenuDataTestId.MENU_WRAPPER}\"]`),\n ];\n if (dropdownListboxes.every((listbox) => !listbox.contains(target))) {\n onClickOutside(event);\n }\n },\n [onClickOutside],\n );\n\n const {\n refs,\n floatingStyles,\n context,\n isOpen: isFloatingOpen,\n } = useFloatingContext({\n externallyControlledIsOpen: isOpened,\n externalReferenceElement: triggerReferenceElement,\n withoutAnimation: true,\n customOffset,\n placement: startPlacementPreference,\n placementOrderPreference,\n onClickOutside: handleClickOutside,\n });\n\n return (\n <StyledTriggerWrapper\n data-testid={`${DropdownMenuDataTestId.TRIGGER_WRAPPER}`}\n innerRef={setTriggerReferenceElement}\n aria-haspopup=\"listbox\"\n {...wrapperStyles}\n {...globalAttributes}\n {...restXstyledProps}\n as={as}\n >\n {children}\n {triggerReferenceElement && (\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={isFloatingOpen}\n floatingStyles={{ ...floatingStyles, ...(zIndex !== undefined && { zIndex }) }}\n context={context}\n role=\"region\"\n aria-label={(dataPopoverLabel as string) || 'dropdown-menu popover'}\n >\n {isLoading ? <DropdownMenuLoading /> : <DropdownMenuListBox />}\n </FloatingWrapper>\n )}\n </StyledTriggerWrapper>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACkEnB,SAmBmB,KAnBnB;AAjEJ,SAAgB,aAAa,kBAAkB;AAC/C,SAAS,oBAAoB,uBAAuB;AACpD,SAAS,wBAAwB,0BAA0B;A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;AAAA;AAAA,QACA,2BACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf,QAAQ;AAAA,YACR,gBAAgB,EAAE,GAAG,gBAAgB,GAAI,WAAW,UAAa,EAAE,OAAO,EAAG;AAAA,YAC7E;AAAA,YACA,MAAK;AAAA,YACL,cAAa,oBAA+B;AAAA,YAE3C,sBAAY,oBAAC,uBAAoB,IAAK,oBAAC,uBAAoB;AAAA;AAAA,QAC9D;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -4,3 +4,4 @@ export { DropdownMenuDataTestId } from './DropdownMenuDataTestId.js';
4
4
  export { DSDropdownMenuName, DSDropdownMenuPlacements, DSDropdownMenuSlots } from './exported-related/index.js';
5
5
  export { defaultProps as DSDropdownMenuV2DefaultProps, DSDropdownMenuV2PropTypes, actionOptionSchema, checkboxOptionSchema, optionTypesSchemas, sectionOptionSchema, separatorOptionSchema, singleOptionSchema, singleWithSubmenuOptionSchema, submenuOptionSchema, } from './react-desc-prop-types.js';
6
6
  export type { DSDropdownMenuT } from './react-desc-prop-types.js';
7
+ export type { DSDropdownV2BridgeT } from './exported-related/conversion-utils/types.js';
@@ -1 +1,2 @@
1
- export declare const DropdownMenuSkeleton: () => import("react/jsx-runtime").JSX.Element;
1
+ import React from 'react';
2
+ export declare const DropdownMenuSkeleton: () => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-dropdownmenu-v2",
3
- "version": "3.62.1",
3
+ "version": "3.70.0-alpha.9",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Dropdown Menu V2",
6
6
  "files": [
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "repository": {
24
24
  "type": "git",
25
- "url": "https://git.elliemae.io/platform-ui/dimsum.git"
25
+ "url": "https://github.com/intcx/PLATFORM-UI.dimsum.git"
26
26
  },
27
27
  "engines": {
28
28
  "pnpm": ">=9",
@@ -38,25 +38,25 @@
38
38
  "dependencies": {
39
39
  "@xstyled/system": "~3.8.1",
40
40
  "react-virtual": "~2.10.4",
41
- "@elliemae/ds-circular-progress-indicator": "3.62.1",
42
- "@elliemae/ds-form-input-text": "3.62.1",
43
- "@elliemae/ds-menu-items": "3.62.1",
44
- "@elliemae/ds-menu-button": "3.62.1",
45
- "@elliemae/ds-grid": "3.62.1",
46
- "@elliemae/ds-popperjs": "3.62.1",
47
- "@elliemae/ds-props-helpers": "3.62.1",
48
- "@elliemae/ds-system": "3.62.1"
41
+ "@elliemae/ds-circular-progress-indicator": "3.70.0-alpha.9",
42
+ "@elliemae/ds-floating-context": "3.70.0-alpha.9",
43
+ "@elliemae/ds-form-input-text": "3.70.0-alpha.9",
44
+ "@elliemae/ds-menu-items": "3.70.0-alpha.9",
45
+ "@elliemae/ds-grid": "3.70.0-alpha.9",
46
+ "@elliemae/ds-menu-button": "3.70.0-alpha.9",
47
+ "@elliemae/ds-props-helpers": "3.70.0-alpha.9",
48
+ "@elliemae/ds-system": "3.70.0-alpha.9"
49
49
  },
50
50
  "devDependencies": {
51
51
  "jest": "^30.0.0",
52
- "styled-components": "~5.3.9",
53
- "@elliemae/ds-monorepo-devops": "3.62.1",
54
- "@elliemae/ds-test-utils": "3.62.1"
52
+ "styled-components": "~5.3.11",
53
+ "@elliemae/ds-test-utils": "3.70.0-alpha.9",
54
+ "@elliemae/ds-monorepo-devops": "3.70.0-alpha.9"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "react": "^18.3.1",
58
58
  "react-dom": "^18.3.1",
59
- "styled-components": "~5.3.9"
59
+ "styled-components": "~5.3.11"
60
60
  },
61
61
  "publishConfig": {
62
62
  "access": "public",
@@ -1 +0,0 @@
1
- export {};