@lumx/react 4.3.2-alpha.23 → 4.3.2-alpha.24

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.
@@ -699,6 +699,7 @@ type RemoveOptionAction = {
699
699
  };
700
700
  };
701
701
  type ComboboxAction = OpenComboboxAction | CloseComboboxAction | SetInputValueAction | AddOptionAction | RemoveOptionAction;
702
+ type ComboboxReducer<A extends ComboboxAction> = (state: ComboboxState, action: A) => ComboboxState;
702
703
 
703
704
  /**
704
705
  * Different possible placements for the popover.
@@ -911,4 +912,4 @@ interface TooltipProps extends GenericProps, HasCloseMode {
911
912
  declare const Tooltip: Comp<TooltipProps, HTMLDivElement>;
912
913
 
913
914
  export { Alignment as A, TextField as D, FitAnchorWidth as F, Kind as K, ListItem as L, Tooltip as N, Placement as P, isClickable as U, WhiteSpace as W, ColorPalette as a, ColorVariant as h, Typography as i, Size as j, Orientation as l, AspectRatio as m, TypographyInterface as n, IconButton as s, InputLabel as t };
914
- export type { RegisteredComboboxOption as $, BaseButtonProps as B, Comp as C, Elevation as E, GlobalSize as G, HasClassName as H, IconButtonProps as I, JSXElement as J, MultipleSelection as M, Offset as O, TooltipPlacement as Q, TooltipProps as R, Selector as S, TextFieldProps as T, VerticalAlignment as V, ComboboxState as X, ComboboxSelectionType as Y, ComboboxTranslations as Z, BaseLoadingStatus as _, ComboboxOptionSelectEventSource as a0, CommonRef as b, HasTheme as c, HasAriaDisabled as d, HasDisabled as e, ComboboxOptionProps as f, ColorWithVariants as g, HorizontalAlignment as k, BaseSelectProps as o, ButtonSize as p, ComboboxAction as q, ComboboxProps as r, InputLabelProps as u, ListItemProps as v, ListItemSize as w, OnComboboxInputChange as x, OnComboboxSelect as y, SingleSelection as z };
915
+ export type { BaseLoadingStatus as $, BaseButtonProps as B, Comp as C, Elevation as E, GlobalSize as G, HasClassName as H, IconButtonProps as I, JSXElement as J, MultipleSelection as M, Offset as O, TooltipPlacement as Q, TooltipProps as R, Selector as S, TextFieldProps as T, VerticalAlignment as V, ComboboxState as X, ComboboxReducer as Y, ComboboxSelectionType as Z, ComboboxTranslations as _, RegisteredComboboxOption as a0, ComboboxOptionSelectEventSource as a1, CommonRef as b, HasTheme as c, HasAriaDisabled as d, HasDisabled as e, ComboboxOptionProps as f, ColorWithVariants as g, HorizontalAlignment as k, BaseSelectProps as o, ButtonSize as p, ComboboxAction as q, ComboboxProps as r, InputLabelProps as u, ListItemProps as v, ListItemSize as w, OnComboboxInputChange as x, OnComboboxSelect as y, SingleSelection as z };
@@ -1235,7 +1235,7 @@ const OPTIONS_UPDATED = (state, action) => {
1235
1235
  };
1236
1236
 
1237
1237
  /** Reducers for each action type: */
1238
- const REDUCERS = {
1238
+ const REDUCERS$1 = {
1239
1239
  REGISTER_TAB_STOP,
1240
1240
  UNREGISTER_TAB_STOP,
1241
1241
  UPDATE_TAB_STOP,
@@ -1247,8 +1247,8 @@ const REDUCERS = {
1247
1247
  };
1248
1248
 
1249
1249
  /** Main reducer */
1250
- const reducer = (state, action) => {
1251
- return REDUCERS[action.type]?.(state, action) || state;
1250
+ const reducer$1 = (state, action) => {
1251
+ return REDUCERS$1[action.type]?.(state, action) || state;
1252
1252
  };
1253
1253
 
1254
1254
  const MovingFocusContext = /*#__PURE__*/React__default.createContext({
@@ -1396,6 +1396,114 @@ const initialState = {
1396
1396
  optionsLength: 0
1397
1397
  };
1398
1398
 
1399
+ /** Actions when the combobox opens. */
1400
+ const OPEN_COMBOBOX = (state, action) => {
1401
+ const {
1402
+ manual
1403
+ } = action.payload || {};
1404
+ // If the combobox was manually opened, show all suggestions
1405
+ return {
1406
+ ...state,
1407
+ showAll: Boolean(manual),
1408
+ isOpen: true
1409
+ };
1410
+ };
1411
+
1412
+ /** Actions when the combobox closes */
1413
+ const CLOSE_COMBOBOX = state => {
1414
+ return {
1415
+ ...state,
1416
+ showAll: true,
1417
+ isOpen: false
1418
+ };
1419
+ };
1420
+
1421
+ /** Actions on input update. */
1422
+ const SET_INPUT_VALUE = (state, action) => {
1423
+ return {
1424
+ ...state,
1425
+ inputValue: action.payload,
1426
+ // When the user is changing the value, show only values that are related to the input value.
1427
+ showAll: false,
1428
+ isOpen: true
1429
+ };
1430
+ };
1431
+
1432
+ /** Register an option to the state */
1433
+ const ADD_OPTION = (state, action) => {
1434
+ const {
1435
+ id,
1436
+ option
1437
+ } = action.payload;
1438
+ const {
1439
+ options
1440
+ } = state;
1441
+ if (options[id]) {
1442
+ // Option already exists, return state unchanged
1443
+ return state;
1444
+ }
1445
+ const newOptions = {
1446
+ ...options,
1447
+ [id]: option
1448
+ };
1449
+ let newType = state.type;
1450
+ if (isComboboxAction(option)) {
1451
+ newType = 'grid';
1452
+ }
1453
+ let newOptionsLength = state.optionsLength;
1454
+ if (isComboboxValue(option)) {
1455
+ newOptionsLength += 1;
1456
+ }
1457
+ return {
1458
+ ...state,
1459
+ options: newOptions,
1460
+ type: newType,
1461
+ optionsLength: newOptionsLength
1462
+ };
1463
+ };
1464
+
1465
+ /** Remove an option from the state */
1466
+ const REMOVE_OPTION = (state, action) => {
1467
+ const {
1468
+ id
1469
+ } = action.payload;
1470
+ const {
1471
+ options
1472
+ } = state;
1473
+ const option = options[id];
1474
+ if (!options[id]) {
1475
+ // Option doesn't exist, return state unchanged
1476
+ return state;
1477
+ }
1478
+ const newOptions = {
1479
+ ...options
1480
+ };
1481
+ delete newOptions[id];
1482
+ let newOptionsLength = state.optionsLength;
1483
+ if (isComboboxValue(option)) {
1484
+ newOptionsLength -= 1;
1485
+ }
1486
+ return {
1487
+ ...state,
1488
+ options: newOptions,
1489
+ optionsLength: newOptionsLength
1490
+ };
1491
+ };
1492
+
1493
+ /** Reducers for each action type: */
1494
+ const REDUCERS = {
1495
+ OPEN_COMBOBOX,
1496
+ CLOSE_COMBOBOX,
1497
+ SET_INPUT_VALUE,
1498
+ ADD_OPTION,
1499
+ REMOVE_OPTION
1500
+ };
1501
+
1502
+ /** Main reducer */
1503
+ const reducer = (state, action) => {
1504
+ return REDUCERS[action.type]?.(state, action) || state;
1505
+ };
1506
+
1399
1507
  /** Dispatch for the combobox component */
1400
1508
 
1401
1509
  /** Context for the Combobox component */
@@ -1656,5 +1764,5 @@ const useRegisterOption = (registerId, option, shouldRegister) => {
1656
1764
  }, [dispatch, option, registerId, shouldRegister]);
1657
1765
  };
1658
1766
 
1659
- export { A11YLiveMessage as A, ComboboxOptionContextProvider as C, DisabledStateProvider as D, INITIAL_STATE as I, MovingFocusContext as M, NAV_KEYS as N, Portal as P, SectionContext as S, useComboboxSectionId as a, useCombobox as b, useRegisterOption as c, useVirtualFocus as d, useComboboxOptionContext as e, useComboboxRefs as f, generateOptionId as g, ClickAwayProvider as h, buildLoopAroundObject as i, getPointerTypeFromEvent as j, ComboboxContext as k, isComboboxValue as l, ComboboxOptionContext as m, ComboboxRefsProvider as n, PortalProvider as o, reducer as r, useDisabledStateContext as u };
1660
- //# sourceMappingURL=BSETDrpT.js.map
1767
+ export { A11YLiveMessage as A, ComboboxOptionContextProvider as C, DisabledStateProvider as D, INITIAL_STATE as I, MovingFocusContext as M, NAV_KEYS as N, Portal as P, SectionContext as S, useComboboxSectionId as a, useCombobox as b, useRegisterOption as c, useVirtualFocus as d, useComboboxOptionContext as e, useComboboxRefs as f, generateOptionId as g, ClickAwayProvider as h, buildLoopAroundObject as i, getPointerTypeFromEvent as j, ComboboxContext as k, isComboboxValue as l, initialState as m, ComboboxOptionContext as n, reducer as o, ComboboxRefsProvider as p, PortalProvider as q, reducer$1 as r, useDisabledStateContext as u };
1768
+ //# sourceMappingURL=BQFZG9jO.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BSETDrpT.js","sources":["../../src/utils/disabled/DisabledStateContext.tsx","../../src/hooks/useClickAway.tsx","../../src/utils/ClickAwayProvider/ClickAwayProvider.tsx","../../src/utils/A11YLiveMessage/index.tsx","../../src/utils/Portal/PortalProvider.tsx","../../src/utils/Portal/Portal.tsx","../../src/utils/moving-focus/utils/createGridMap.ts","../../src/utils/moving-focus/utils/tabStopIsEnabled.ts","../../src/utils/moving-focus/constants.ts","../../src/utils/moving-focus/utils/buildLoopAroundObject.ts","../../src/utils/moving-focus/utils/getCell.ts","../../src/utils/moving-focus/utils/getCellCoordinates.ts","../../src/utils/moving-focus/utils/shouldLoopListVertically.ts","../../src/utils/moving-focus/utils/shouldLoopListHorizontally.ts","../../src/utils/moving-focus/utils/getPointerTypeFromEvent.ts","../../src/utils/moving-focus/ducks/keyboard-navigation.ts","../../src/utils/moving-focus/ducks/tab-stop.ts","../../src/utils/moving-focus/ducks/slice.ts","../../src/utils/moving-focus/components/MovingFocusProvider/context.ts","../../src/utils/moving-focus/hooks/useVirtualFocus/useVirtualFocus.ts","../../src/components/combobox/utils.tsx","../../src/components/combobox/ducks/reducer.ts","../../src/components/combobox/context/ComboboxContext.tsx","../../src/components/combobox/context/ComboboxOptionContext.tsx","../../src/components/combobox/context/ComboboxRefsContext.tsx","../../src/components/combobox/hooks/useCombobox.tsx","../../src/components/combobox/hooks/useComboboxSectionId.tsx","../../src/components/combobox/hooks/useRegisterOption.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport { DisabledStateContextValue } from '@lumx/core/js/utils/disabledState';\n\nexport const DisabledStateContext = React.createContext<DisabledStateContextValue>({ state: null });\n\nexport type DisabledStateProviderProps = DisabledStateContextValue & {\n children: React.ReactNode;\n};\n\n/**\n * Disabled state provider.\n * All nested LumX Design System components inherit this disabled state.\n */\nexport function DisabledStateProvider({ children, ...value }: DisabledStateProviderProps) {\n return <DisabledStateContext.Provider value={value}>{children}</DisabledStateContext.Provider>;\n}\n\n/**\n * Get DisabledState context value\n */\nexport function useDisabledStateContext(): DisabledStateContextValue {\n return useContext(DisabledStateContext);\n}\n","import { RefObject, useEffect } from 'react';\n\nimport { Falsy } from '@lumx/react/utils/type';\n\nimport isEmpty from 'lodash/isEmpty';\n\nconst EVENT_TYPES = ['mousedown', 'touchstart'];\n\nfunction isClickAway(targets: HTMLElement[], refs: Array<RefObject<HTMLElement>>): boolean {\n // The targets elements are not contained in any of the listed element references.\n return !refs.some((ref) => targets.some((target) => ref?.current?.contains(target)));\n}\n\nexport interface ClickAwayParameters {\n /**\n * A callback function to call when the user clicks away from the elements.\n */\n callback: EventListener | Falsy;\n /**\n * Elements considered within the click away context (clicking outside them will trigger the click away callback).\n */\n childrenRefs: RefObject<Array<RefObject<HTMLElement>>>;\n}\n\n/**\n * Listen to clicks away from the given elements and callback the passed in function.\n *\n * Warning: If you need to detect click away on nested React portals, please use the `ClickAwayProvider` component.\n */\nexport function useClickAway({ callback, childrenRefs }: ClickAwayParameters): void {\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!callback || !currentRefs || isEmpty(currentRefs)) {\n return undefined;\n }\n const listener: EventListener = (evt) => {\n const targets = [evt.composedPath?.()[0], evt.target] as HTMLElement[];\n if (isClickAway(targets, currentRefs)) {\n callback(evt);\n }\n };\n\n EVENT_TYPES.forEach((evtType) => document.addEventListener(evtType, listener));\n return () => {\n EVENT_TYPES.forEach((evtType) => document.removeEventListener(evtType, listener));\n };\n }, [callback, childrenRefs]);\n}\n","import { createContext, RefObject, useContext, useEffect, useMemo, useRef } from 'react';\nimport { ClickAwayParameters, useClickAway } from '@lumx/react/hooks/useClickAway';\n\ninterface ContextValue {\n childrenRefs: Array<RefObject<HTMLElement>>;\n addRefs(...newChildrenRefs: Array<RefObject<HTMLElement>>): void;\n}\n\nconst ClickAwayAncestorContext = createContext<ContextValue | null>(null);\n\ninterface ClickAwayProviderProps extends ClickAwayParameters {\n /**\n * (Optional) Element that should be considered as part of the parent\n */\n parentRef?: RefObject<HTMLElement>;\n /**\n * Children\n */\n children?: React.ReactNode;\n}\n\n/**\n * Component combining the `useClickAway` hook with a React context to hook into the React component tree and make sure\n * we take into account both the DOM tree and the React tree to detect click away.\n *\n * @return the react component.\n */\nexport const ClickAwayProvider: React.FC<ClickAwayProviderProps> = ({\n children,\n callback,\n childrenRefs,\n parentRef,\n}) => {\n const parentContext = useContext(ClickAwayAncestorContext);\n const currentContext = useMemo(() => {\n const context: ContextValue = {\n childrenRefs: [],\n /**\n * Add element refs to the current context and propagate to the parent context.\n */\n addRefs(...newChildrenRefs) {\n // Add element refs that should be considered as inside the click away context.\n context.childrenRefs.push(...newChildrenRefs);\n\n if (parentContext) {\n // Also add then to the parent context\n parentContext.addRefs(...newChildrenRefs);\n if (parentRef) {\n // The parent element is also considered as inside the parent click away context but not inside the current context\n parentContext.addRefs(parentRef);\n }\n }\n },\n };\n return context;\n }, [parentContext, parentRef]);\n\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!currentRefs) {\n return;\n }\n currentContext.addRefs(...currentRefs);\n }, [currentContext, childrenRefs]);\n\n useClickAway({ callback, childrenRefs: useRef(currentContext.childrenRefs) });\n return <ClickAwayAncestorContext.Provider value={currentContext}>{children}</ClickAwayAncestorContext.Provider>;\n};\nClickAwayProvider.displayName = 'ClickAwayProvider';\n","import React, { AriaAttributes, ReactNode } from 'react';\n\nimport { visuallyHidden, join } from '@lumx/core/js/utils/classNames';\n\nexport interface A11YLiveMessageProps {\n /** The message that will be read. */\n children?: ReactNode;\n /** Whether the message should be hidden */\n hidden?: boolean;\n /**\n * The type of message.\n * Default to \"polite\"\n * Assertive should only be used for messages than need immediate attention.\n */\n type?: AriaAttributes['aria-live'];\n /**\n * Indicates whether assistive technologies will present all, or only parts of, the changed region based on\n * the change notifications defined by the aria-relevant attribute.\n */\n atomic?: AriaAttributes['aria-atomic'];\n /**\n * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.\n * @see atomic.\n */\n relevant?: AriaAttributes['aria-relevant'];\n /**\n * Whether the live region reads a current status or\n * raises an alert.\n * Only use `alert` for time sensitive information that should be read immediately\n * as it will interrupt anything being currently read.\n */\n role?: 'status' | 'alert';\n /** Scope, for tracking purposes */\n scope?: string;\n /** Optionnal classname */\n className?: string;\n}\n\n/**\n * Live region to read a message to screen readers.\n * Messages can be \"polite\" and be read when possible or\n * \"assertive\" and interrupt any message currently be read. (To be used sparingly)\n *\n * More information here: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions\n *\n * @family A11Y\n * @param A11YLiveMessageProps\n * @returns A11YLiveMessage\n */\nexport const A11YLiveMessage: React.FC<A11YLiveMessageProps> = ({\n type = 'polite',\n atomic,\n role,\n hidden,\n relevant,\n children,\n className,\n ...forwardedProps\n}) => {\n return (\n <div\n {...forwardedProps}\n className={join(hidden ? visuallyHidden() : undefined, className)}\n role={role}\n aria-live={type}\n aria-atomic={atomic}\n aria-relevant={relevant}\n >\n {children}\n </div>\n );\n};\n","import React from 'react';\n\ntype Container = DocumentFragment | Element;\n\n/**\n * Portal initializing function.\n * If it does not provide a container, the Portal children will render in classic React tree and not in a portal.\n */\nexport type PortalInit = () => {\n container?: Container;\n teardown?: () => void;\n};\n\nexport const PortalContext = React.createContext<PortalInit>(() => ({ container: document.body }));\n\nexport interface PortalProviderProps {\n children?: React.ReactNode;\n value: PortalInit;\n}\n\n/**\n * Customize where <Portal> wrapped elements render (tooltip, popover, dialog, etc.)\n */\nexport const PortalProvider: React.FC<PortalProviderProps> = PortalContext.Provider;\n","import React from 'react';\nimport { createPortal } from 'react-dom';\nimport { PortalContext } from './PortalProvider';\n\nexport interface PortalProps {\n enabled?: boolean;\n children: React.ReactNode;\n}\n\n/**\n * Render children in a portal outside the current DOM position\n * (defaults to `document.body` but can be customized with the PortalContextProvider)\n */\nexport const Portal: React.FC<PortalProps> = ({ children, enabled = true }) => {\n const init = React.useContext(PortalContext);\n const context = React.useMemo(\n () => {\n return enabled ? init() : null;\n },\n // Only update on 'enabled'\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [enabled],\n );\n\n React.useLayoutEffect(() => {\n return context?.teardown;\n }, [context?.teardown, enabled]);\n\n if (!context?.container) {\n return <>{children}</>;\n }\n return createPortal(children, context.container);\n};\n","import groupBy from 'lodash/groupBy';\nimport isNil from 'lodash/isNil';\n\nimport { GridMap, TabStop, TabStopRowKey } from '../types';\n\n/**\n * Create a map from the given tab stop to sort them by rowKey;\n */\nexport function createGridMap(tabStops: readonly TabStop[]): GridMap {\n /** Group all tabStop by rows to easily access them by their row keys */\n const tabStopsByRowKey = groupBy(tabStops, 'rowKey');\n /**\n * An array with each row key in the order set in the tabStops array.\n * Each rowKey will only appear once.\n */\n const rowKeys = tabStops.reduce<TabStopRowKey[]>((acc, { rowKey }) => {\n if (!isNil(rowKey) && !acc.includes(rowKey)) {\n return [...acc, rowKey];\n }\n return acc;\n }, []);\n\n return {\n tabStopsByRowKey,\n rowKeys,\n };\n}\n","import { TabStop } from '../types';\n\n/** Check if the given tab stop is enabled */\nexport const tabStopIsEnabled = (tabStop: TabStop) => !tabStop.disabled;\n","export const LOOP_AROUND_TYPES = {\n /**\n * Will continue navigation to the next row or column and loop back to the start\n * when the last tab stop is reached\n */\n nextLoop: 'next-loop',\n /**\n * Will continue navigation to the next row or column until\n * the last tab stop is reached\n */\n nextEnd: 'next-end',\n /**\n * Will loop within the current row or column\n */\n inside: 'inside',\n} as const;\n\nexport const CELL_SEARCH_DIRECTION = {\n /** Look ahead of the given position */\n asc: 'asc',\n /** Look before the given position */\n desc: 'desc',\n} as const;\n","import { LOOP_AROUND_TYPES } from '../constants';\nimport { LoopAround, LoopAroundByAxis } from '../types';\n\n/**\n * Build a loopAround configuration to ensure both row and col behavior are set.\n *\n * Setting a boolean will set the following behaviors:\n *\n * * true => { row: 'next-loop', col: 'next-loop' }\n * * false => { row: 'next-end', col: 'next-end' }\n */\nexport function buildLoopAroundObject(loopAround?: LoopAround): LoopAroundByAxis {\n if (typeof loopAround === 'boolean' || loopAround === undefined) {\n const newLoopAround: LoopAround = loopAround\n ? { row: LOOP_AROUND_TYPES.nextLoop, col: LOOP_AROUND_TYPES.nextLoop }\n : { row: LOOP_AROUND_TYPES.nextEnd, col: LOOP_AROUND_TYPES.nextEnd };\n\n return newLoopAround;\n }\n return loopAround;\n}\n","import find from 'lodash/find';\nimport findLast from 'lodash/findLast';\n\nimport { CELL_SEARCH_DIRECTION } from '../constants';\nimport { CellSelector, CoordsType, DirectionCoords, GridMap, TabStop } from '../types';\n\nimport { tabStopIsEnabled } from './tabStopIsEnabled';\n\n/**\n * Check that the given coordinate is a simple number\n */\nconst isNumberCoords = (coords: CoordsType): coords is number => typeof coords === 'number';\n\n/**\n * Check that the given coordinate is a direction\n */\nfunction isDirectionCoords(coords: CoordsType): coords is DirectionCoords {\n return Boolean(typeof coords !== 'number' && typeof coords?.from === 'number');\n}\n\n/**\n * Search the given column of a grid map for a cell.\n */\nfunction findCellInCol(\n gridMap: GridMap,\n col: number,\n rowCoords: DirectionCoords,\n cellSelector: CellSelector = tabStopIsEnabled,\n) {\n /** The rowIndex might not be strictly successive, so we need to use the actual row index keys. */\n const { rowKeys, tabStopsByRowKey } = gridMap;\n const lastIndex = rowKeys.length - 1;\n /**\n * If the rowCoords.from is set at -1, it means we should search from the start/end.\n */\n let searchIndex = rowCoords.from;\n if (searchIndex === -1) {\n searchIndex = rowCoords.direction === CELL_SEARCH_DIRECTION.desc ? lastIndex : 0;\n }\n\n const searchCellFunc = rowCoords.direction === CELL_SEARCH_DIRECTION.desc ? findLast : find;\n const rowKeyWithEnabledCell = searchCellFunc(rowKeys, (rowKey, index) => {\n const row = tabStopsByRowKey[rowKey];\n const cell = row[col];\n const hasCell = Boolean(cell);\n const cellRowIndex = index;\n\n /** Check that the target row index is in the right direction of the search */\n const correctRowIndex =\n rowCoords.direction === CELL_SEARCH_DIRECTION.desc\n ? cellRowIndex <= searchIndex\n : cellRowIndex >= searchIndex;\n\n if (cell && correctRowIndex) {\n return cellSelector ? hasCell && cellSelector(cell) : hasCell;\n }\n return false;\n });\n const row = rowKeyWithEnabledCell !== undefined ? tabStopsByRowKey[rowKeyWithEnabledCell] : undefined;\n return row?.[col];\n}\n\n/**\n * Search the given column of a grid map for a cell.\n */\nfunction findCellInRow(\n gridMap: GridMap,\n row: number,\n colCoords: DirectionCoords,\n cellSelector: CellSelector = tabStopIsEnabled,\n) {\n const { direction, from } = colCoords || {};\n const { rowKeys, tabStopsByRowKey } = gridMap;\n const rowKey = rowKeys[row];\n const currentRow = tabStopsByRowKey[rowKey];\n if (!currentRow) {\n return undefined;\n }\n\n const searchCellFunc = direction === CELL_SEARCH_DIRECTION.desc ? findLast : find;\n const cell = searchCellFunc(currentRow, cellSelector, from);\n return cell;\n}\n\n/**\n * Parse each column of the given gridMap to find the first cell matching the selector.\n * The direction and starting point of the search can be set using the coordinates attribute.\n */\nfunction parseColsForCell(\n /** The gridMap to search */\n gridMap: GridMap,\n /** The coordinate to search */\n { direction = CELL_SEARCH_DIRECTION.asc, from }: DirectionCoords,\n cellSelector: CellSelector = tabStopIsEnabled,\n) {\n if (from === undefined) {\n return undefined;\n }\n\n const { rowKeys, tabStopsByRowKey } = gridMap;\n\n /** As we cannot know for certain when to stop, we need to know which column is the last column */\n const maxColIndex = rowKeys.reduce<number>((maxLength, rowIndex) => {\n const rowLength = tabStopsByRowKey[rowIndex].length;\n return rowLength > maxLength ? rowLength - 1 : maxLength;\n }, 0);\n\n /** If \"from\" is set as -1, start from the end. */\n const fromIndex = from === -1 ? maxColIndex : from || 0;\n\n for (\n let index = fromIndex;\n direction === CELL_SEARCH_DIRECTION.desc ? index > -1 : index <= maxColIndex;\n direction === CELL_SEARCH_DIRECTION.desc ? (index -= 1) : (index += 1)\n ) {\n const rowWithEnabledCed = findCellInCol(\n gridMap,\n index,\n { direction, from: direction === CELL_SEARCH_DIRECTION.desc ? -1 : 0 },\n cellSelector,\n );\n\n if (rowWithEnabledCed) {\n return rowWithEnabledCed;\n }\n }\n\n return undefined;\n}\n\n/**\n * Search for a cell in a gridMap\n *\n * This allows you to\n * * Select a cell at a specific coordinate\n * * Search for a cell from a specific column in any direction\n * * Search for a cell from a specific row in any direction\n *\n * If no cell is found, returns undefined\n */\nexport function getCell(\n /** The gridMap object to search in. */\n gridMap: GridMap,\n /** The coordinates of the cell to select */\n coords: {\n /** The row on or from witch to look for */\n row: CoordsType;\n /** The column on or from witch to look for */\n col: CoordsType;\n },\n /**\n * A selector function to select the cell.\n * Selects enabled cells by default.\n */\n cellSelector: CellSelector = tabStopIsEnabled,\n): TabStop | undefined {\n const { row, col } = coords || {};\n const { rowKeys, tabStopsByRowKey } = gridMap || {};\n\n /** Defined row and col */\n if (isNumberCoords(row) && isNumberCoords(col)) {\n const rowKey = rowKeys[row];\n return tabStopsByRowKey[rowKey][col];\n }\n\n /** Defined row but variable col */\n if (isDirectionCoords(col) && isNumberCoords(row)) {\n return findCellInRow(gridMap, row, col, cellSelector);\n }\n\n if (isDirectionCoords(row)) {\n if (isDirectionCoords(col)) {\n return parseColsForCell(gridMap, col, cellSelector);\n }\n return findCellInCol(gridMap, col, row, cellSelector);\n }\n\n return undefined;\n}\n","import isNil from 'lodash/isNil';\n\nimport { GridMap, TabStop } from '../types';\n\nexport function getCellCoordinates(gridMap: GridMap, tabStop: TabStop) {\n const currentRowKey = tabStop.rowKey;\n if (isNil(currentRowKey)) {\n return undefined;\n }\n const { rowKeys, tabStopsByRowKey } = gridMap;\n const rowIndex = rowKeys.findIndex((rowKey) => rowKey === currentRowKey);\n const row = tabStopsByRowKey[currentRowKey];\n const columnOffset = row.findIndex((ts) => ts.id === tabStop.id);\n\n return {\n rowIndex,\n row,\n columnOffset,\n };\n}\n","import { KeyDirection, LoopAroundByAxis } from '../types';\n\n/** Check whether the list should vertically loop with the given configuration */\nexport function shouldLoopListVertically(direction: KeyDirection, loopAround: Pick<LoopAroundByAxis, 'col'>): boolean {\n return (\n (direction === 'vertical' && loopAround?.col !== 'next-end') ||\n (direction === 'both' && loopAround?.col !== 'next-end')\n );\n}\n","import { KeyDirection, LoopAroundByAxis } from '../types';\n\n/** Check whether the list should horizontally loop with the given configuration */\nexport function shouldLoopListHorizontally(\n direction: KeyDirection,\n loopAround: Pick<LoopAroundByAxis, 'row'>,\n): boolean {\n return (\n (direction === 'horizontal' && loopAround?.row !== 'next-end') ||\n (direction === 'both' && loopAround?.row !== 'next-end')\n );\n}\n","/**\n * Get the correct pointer type from the given event.\n * This is used when a tab stop is selected, to check if is has been selected using a keyboard or a pointer\n * (pen / mouse / touch)\n */\nexport function getPointerTypeFromEvent(event?: PointerEvent | Event) {\n return event && 'pointerType' in event && Boolean(event.pointerType) ? 'pointer' : 'keyboard';\n}\n","import find from 'lodash/find';\nimport findLast from 'lodash/findLast';\nimport findLastIndex from 'lodash/findLastIndex';\nimport isNil from 'lodash/isNil';\n\nimport { LOOP_AROUND_TYPES } from '../constants';\nimport { KeyDirection, KeyNavAction, Navigation, Reducer, State, TabStop } from '../types';\nimport {\n createGridMap,\n getCell,\n getCellCoordinates,\n shouldLoopListHorizontally,\n shouldLoopListVertically,\n tabStopIsEnabled,\n} from '../utils';\n\n// Event keys used for keyboard navigation.\nexport const VERTICAL_NAV_KEYS = ['ArrowUp', 'ArrowDown', 'Home', 'End'] as const;\nexport const HORIZONTAL_NAV_KEYS = ['ArrowLeft', 'ArrowRight', 'Home', 'End'] as const;\nexport const KEY_NAV_KEYS = [...HORIZONTAL_NAV_KEYS, ...VERTICAL_NAV_KEYS] as const;\nexport const NAV_KEYS: { [direction in KeyDirection]: ReadonlyArray<string> } = {\n both: KEY_NAV_KEYS,\n vertical: VERTICAL_NAV_KEYS,\n horizontal: HORIZONTAL_NAV_KEYS,\n};\n\n// Event keys union type\nexport type EventKey = (typeof KEY_NAV_KEYS)[number];\n\n// Handle all navigation moves resulting in a new state.\nconst MOVES: {\n [N in Navigation]: (state: State, currentTabStop: TabStop, index: number) => State;\n} = {\n // Move to the next item.\n // The grid is flatten so the item after the last of a row will be the\n // first item of the next row.\n NEXT(state, _, index) {\n for (let i = index + 1; i < state.tabStops.length; ++i) {\n const tabStop = state.tabStops[i];\n\n if (!tabStop.disabled) {\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop.id,\n };\n }\n }\n return state;\n },\n\n // Move to the previous item.\n // The grid is flatten so the item before the first of a row will be the\n // last item of the previous row.\n PREVIOUS(state, _, index) {\n for (let i = index - 1; i >= 0; --i) {\n const tabStop = state.tabStops[i];\n\n if (!tabStop.disabled) {\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop.id,\n };\n }\n }\n return state;\n },\n\n // Moving to the next row\n // We move to the next row, and we stay in the same column.\n // If we are in the last row, then we move to the first not disabled item of the next column.\n NEXT_ROW(state, currentTabStop) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { rowIndex, columnOffset } = cellCoordinates;\n const nextRow = rowIndex + 1;\n\n /** First try to get the next cell in the current column */\n let tabStop = getCell(gridMap, {\n row: {\n from: nextRow,\n direction: 'asc',\n },\n col: columnOffset,\n });\n\n // If none were found, search for the next cell depending on the loop around parameter\n if (!tabStop) {\n switch (state.loopAround.col) {\n /**\n * If columns are configured to be looped inside,\n * get the first enabled cell of the current column\n */\n case LOOP_AROUND_TYPES.inside:\n tabStop = getCell(gridMap, {\n col: columnOffset,\n row: {\n from: 0,\n direction: 'asc',\n },\n });\n break;\n /**\n * If columns are configured to be go to the next,\n * search for the next enabled cell from the next column\n */\n case LOOP_AROUND_TYPES.nextEnd:\n case LOOP_AROUND_TYPES.nextLoop:\n default:\n tabStop = getCell(gridMap, {\n row: {\n from: 0,\n direction: 'asc',\n },\n col: {\n from: columnOffset + 1,\n direction: 'asc',\n },\n });\n break;\n }\n }\n\n /**\n * If still none is found and the columns are configured to loop\n * search starting from the start\n */\n if (!tabStop && state.loopAround.col === LOOP_AROUND_TYPES.nextLoop) {\n tabStop = getCell(gridMap, {\n row: {\n from: 0,\n direction: 'asc',\n },\n col: {\n from: 0,\n direction: 'asc',\n },\n });\n }\n\n if (tabStop) {\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop.id,\n gridMap,\n };\n }\n\n return { ...state, allowFocusing: true, gridMap };\n },\n\n // Moving to the previous row\n // We move to the previous row, and we stay in the same column.\n // If we are in the first row, then we move to the last not disabled item of the previous column.\n PREVIOUS_ROW(state, currentTabStop) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { rowIndex, columnOffset } = cellCoordinates;\n const previousRow = rowIndex - 1;\n let tabStop;\n /** Search for the previous enabled cell in the current column */\n if (previousRow >= 0) {\n tabStop = getCell(gridMap, {\n row: {\n from: previousRow,\n direction: 'desc',\n },\n col: columnOffset,\n });\n }\n\n // If none were found, search for the previous cell depending on the loop around parameter\n if (!tabStop) {\n switch (state.loopAround.col) {\n /**\n * If columns are configured to be looped inside,\n * get the last enabled cell of the current column\n */\n case LOOP_AROUND_TYPES.inside:\n tabStop = getCell(gridMap, {\n col: columnOffset,\n row: {\n from: -1,\n direction: 'desc',\n },\n });\n break;\n /**\n * If columns are configured to be go to the previous,\n * search for the last enabled cell from the previous column\n */\n case LOOP_AROUND_TYPES.nextEnd:\n case LOOP_AROUND_TYPES.nextLoop:\n default:\n if (columnOffset - 1 >= 0) {\n tabStop = getCell(gridMap, {\n row: {\n from: -1,\n direction: 'desc',\n },\n col: {\n from: columnOffset - 1,\n direction: 'desc',\n },\n });\n break;\n }\n }\n }\n /**\n * If still none is found and the columns are configured to loop\n * search starting from the end\n */\n if (!tabStop && state.loopAround.col === LOOP_AROUND_TYPES.nextLoop) {\n tabStop = getCell(gridMap, {\n row: {\n from: -1,\n direction: 'desc',\n },\n col: {\n from: -1,\n direction: 'desc',\n },\n });\n }\n\n if (tabStop) {\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop.id,\n gridMap,\n };\n }\n\n return { ...state, allowFocusing: true, gridMap };\n },\n // Moving to the very first not disabled item of the list\n VERY_FIRST(state) {\n // The very first not disabled item' index.\n const tabStop = state.tabStops.find(tabStopIsEnabled);\n if (tabStop) {\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop.id,\n };\n }\n return state;\n },\n // Moving to the very last not disabled item of the list\n VERY_LAST(state) {\n // The very last not disabled item' index.\n const tabStop = findLast(state.tabStops, tabStopIsEnabled);\n if (tabStop) {\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop.id,\n };\n }\n return state;\n },\n NEXT_COLUMN(state, currentTabStop, index) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { rowIndex, columnOffset } = cellCoordinates;\n // Parse the current row and look for the next enabled cell\n let tabStop = getCell(gridMap, {\n row: rowIndex,\n col: {\n from: columnOffset + 1,\n direction: 'asc',\n },\n });\n\n // If none were found, search for the next cell depending on the loop around parameter\n if (!tabStop) {\n switch (state.loopAround.row) {\n /**\n * If rows are configured to be looped inside,\n * get the first enabled cell of the current rows\n */\n case LOOP_AROUND_TYPES.inside:\n tabStop = getCell(gridMap, {\n row: rowIndex,\n col: {\n from: 0,\n direction: 'asc',\n },\n });\n break;\n /**\n * If rows are configured to be go to the next,\n * search for the next enabled cell from the next row\n */\n case LOOP_AROUND_TYPES.nextEnd:\n case LOOP_AROUND_TYPES.nextLoop:\n default:\n tabStop = find(state.tabStops, tabStopIsEnabled, index + 1);\n break;\n }\n }\n /**\n * If still none is found and the row are configured to loop\n * search starting from the start\n */\n if (!tabStop && state.loopAround.row === LOOP_AROUND_TYPES.nextLoop) {\n tabStop = find(state.tabStops, tabStopIsEnabled);\n }\n\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop?.id || state.selectedId,\n gridMap,\n };\n },\n PREVIOUS_COLUMN(state, currentTabStop, index) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { rowIndex, columnOffset } = cellCoordinates;\n\n const previousColumn = columnOffset - 1;\n let tabStop;\n\n if (previousColumn >= 0) {\n // Parse the current row and look for the next enable cell\n tabStop = getCell(gridMap, {\n row: rowIndex,\n col: {\n from: previousColumn,\n direction: 'desc',\n },\n });\n }\n if (!tabStop) {\n switch (state.loopAround.row) {\n /**\n * If rows are configured to be looped inside,\n * get the last enabled cell of the current row\n */\n case LOOP_AROUND_TYPES.inside:\n tabStop = getCell(gridMap, {\n row: rowIndex,\n col: {\n from: -1,\n direction: 'desc',\n },\n });\n break;\n /**\n * If rows are configured to be go to the next,\n * search for the previous enabled cell from the previous row\n */\n case LOOP_AROUND_TYPES.nextEnd:\n case LOOP_AROUND_TYPES.nextLoop:\n default:\n if (index - 1 >= 0) {\n tabStop = findLast(state.tabStops, tabStopIsEnabled, index - 1);\n }\n break;\n }\n }\n /**\n * If still none is found and the rows are configured to loop\n * search starting from the end\n */\n if (!tabStop && state.loopAround.row === LOOP_AROUND_TYPES.nextLoop) {\n tabStop = findLast(state.tabStops, tabStopIsEnabled);\n }\n\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop?.id || state.selectedId,\n gridMap,\n };\n },\n FIRST_IN_COLUMN(state, currentTabStop) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { columnOffset } = cellCoordinates;\n\n const tabStop = getCell(gridMap, {\n col: columnOffset,\n row: {\n from: 0,\n direction: 'asc',\n },\n });\n\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop?.id || state.selectedId,\n gridMap,\n };\n },\n LAST_IN_COLUMN(state, currentTabStop) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { columnOffset } = cellCoordinates;\n\n const tabStop = getCell(gridMap, {\n col: columnOffset,\n row: {\n from: -1,\n direction: 'desc',\n },\n });\n\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop?.id || state.selectedId,\n gridMap,\n };\n },\n // Moving to the first item in row\n FIRST_IN_ROW(state, currentTabStop) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { rowIndex } = cellCoordinates;\n\n const tabStop = getCell(gridMap, {\n row: rowIndex,\n col: {\n from: 0,\n direction: 'asc',\n },\n });\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop?.id || state.selectedId,\n gridMap,\n };\n },\n // Moving to the last item in row\n LAST_IN_ROW(state, currentTabStop) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { rowIndex } = cellCoordinates;\n\n const tabStop = getCell(gridMap, {\n row: rowIndex,\n col: {\n from: -1,\n direction: 'desc',\n },\n });\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop?.id || state.selectedId,\n gridMap,\n };\n },\n};\n\n/** Handle `KEY_NAV` action to update */\nexport const KEY_NAV: Reducer<KeyNavAction> = (state, action) => {\n const { id = state.selectedId || state.tabStops[0]?.id, key, ctrlKey } = action.payload;\n const index = state.tabStops.findIndex((tabStop) => tabStop.id === id);\n if (index === -1) {\n // tab stop not registered\n return state;\n }\n const currentTabStop = state.tabStops[index];\n if (currentTabStop.disabled) {\n return state;\n }\n\n const isGrid = currentTabStop.rowKey !== null;\n const isFirst = index === state.tabStops.findIndex(tabStopIsEnabled);\n const isLast = index === findLastIndex(state.tabStops, tabStopIsEnabled);\n // Translates the user key down event info into a navigation instruction.\n let navigation: Navigation | null = null;\n // eslint-disable-next-line default-case\n switch (key) {\n case 'ArrowLeft':\n if (isGrid) {\n navigation = 'PREVIOUS_COLUMN';\n } else if (state.direction === 'horizontal' || state.direction === 'both') {\n navigation =\n shouldLoopListHorizontally(state.direction, state.loopAround) && isFirst ? 'VERY_LAST' : 'PREVIOUS';\n }\n break;\n case 'ArrowRight':\n if (isGrid) {\n navigation = 'NEXT_COLUMN';\n } else if (state.direction === 'horizontal' || state.direction === 'both') {\n navigation =\n shouldLoopListHorizontally(state.direction, state.loopAround) && isLast ? 'VERY_FIRST' : 'NEXT';\n }\n break;\n case 'ArrowUp':\n if (isGrid) {\n navigation = 'PREVIOUS_ROW';\n } else if (state.direction === 'vertical' || state.direction === 'both') {\n navigation =\n shouldLoopListVertically(state.direction, state.loopAround) && isFirst ? 'VERY_LAST' : 'PREVIOUS';\n }\n break;\n case 'ArrowDown':\n if (isGrid) {\n navigation = 'NEXT_ROW';\n } else if (state.direction === 'vertical' || state.direction === 'both') {\n navigation =\n shouldLoopListVertically(state.direction, state.loopAround) && isLast ? 'VERY_FIRST' : 'NEXT';\n }\n break;\n case 'Home':\n if (isGrid && !ctrlKey) {\n navigation = state.gridJumpToShortcutDirection === 'vertical' ? 'FIRST_IN_COLUMN' : 'FIRST_IN_ROW';\n } else {\n navigation = 'VERY_FIRST';\n }\n break;\n case 'End':\n if (isGrid && !ctrlKey) {\n navigation = state.gridJumpToShortcutDirection === 'vertical' ? 'LAST_IN_COLUMN' : 'LAST_IN_ROW';\n } else {\n navigation = 'VERY_LAST';\n }\n break;\n }\n\n if (!navigation) {\n return state;\n }\n\n const newState = MOVES[navigation](state, currentTabStop, index);\n\n return { ...newState, isUsingKeyboard: true };\n};\n","import findLast from 'lodash/findLast';\nimport findLastIndex from 'lodash/findLastIndex';\n\nimport {\n Reducer,\n RegisterAction,\n ResetSelectedTabStopAction,\n SelectTabStopAction,\n SetAllowFocusingAction,\n State,\n UnregisterAction,\n UpdateTabStopAction,\n} from '../types';\nimport { tabStopIsEnabled } from '../utils';\n\n/** Determine the updated value for selectedId: */\nexport const getUpdatedSelectedId = (\n tabStops: State['tabStops'],\n currentSelectedId: State['selectedId'],\n defaultSelectedId: State['selectedId'] = null,\n): State['selectedId'] => {\n // Get tab stop by id\n const tabStop = currentSelectedId && tabStops.find((ts) => ts.id === currentSelectedId && !ts.disabled);\n if (!tabStop) {\n // Fallback to default selected id if available, or first enabled tab stop if not\n return tabStops.find((ts) => ts.id === defaultSelectedId)?.id || tabStops.find(tabStopIsEnabled)?.id || null;\n }\n return tabStop?.id || defaultSelectedId;\n};\n\n/** Handle `REGISTER_TAB_STOP` action registering a new tab stop. */\nexport const REGISTER_TAB_STOP: Reducer<RegisterAction> = (state, action) => {\n const newTabStop = action.payload;\n const newTabStopElement = newTabStop.domElementRef.current;\n\n if (!newTabStopElement) {\n return state;\n }\n\n // Find index of tab stop that\n const indexToInsertAt = findLastIndex(state.tabStops, (tabStop) => {\n if (tabStop.id === newTabStop.id) {\n // tab stop already registered\n return false;\n }\n const domTabStop = tabStop.domElementRef.current;\n\n // New tab stop is following the current tab stop\n return domTabStop?.compareDocumentPosition(newTabStopElement) === Node.DOCUMENT_POSITION_FOLLOWING;\n });\n const insertIndex = indexToInsertAt + 1;\n\n // Insert new tab stop at position `indexToInsertAt`.\n const newTabStops = [...state.tabStops];\n newTabStops.splice(insertIndex, 0, newTabStop);\n\n // Handle autofocus if needed\n let { selectedId, allowFocusing } = state;\n if (\n (state.autofocus === 'first' && insertIndex === 0) ||\n (state.autofocus === 'last' && insertIndex === newTabStops.length - 1) ||\n newTabStop.autofocus\n ) {\n allowFocusing = true;\n selectedId = newTabStop.id;\n }\n\n const newSelectedId =\n newTabStop.id === state.defaultSelectedId && !newTabStop.disabled\n ? newTabStop.id\n : getUpdatedSelectedId(newTabStops, selectedId, state.defaultSelectedId);\n\n return {\n ...state,\n /**\n * If the tab currently being registered is enabled and set as default selected,\n * set as selected.\n *\n */\n selectedId: newSelectedId,\n tabStops: newTabStops,\n gridMap: null,\n allowFocusing,\n };\n};\n\n/** Handle `UNREGISTER_TAB_STOP` action un-registering a new tab stop. */\nexport const UNREGISTER_TAB_STOP: Reducer<UnregisterAction> = (state, action) => {\n const { id } = action.payload;\n const newTabStops = state.tabStops.filter((tabStop) => tabStop.id !== id);\n if (newTabStops.length === state.tabStops.length) {\n // tab stop already unregistered\n return state;\n }\n\n /** Get the previous enabled tab stop */\n const previousTabStopIndex = state.tabStops.findIndex(\n (tabStop) => tabStop.id === state.selectedId && tabStopIsEnabled(tabStop),\n );\n\n const newLocal = previousTabStopIndex - 1 > -1;\n const previousTabStop = newLocal ? findLast(newTabStops, tabStopIsEnabled, previousTabStopIndex - 1) : undefined;\n\n return {\n ...state,\n /** Set the focus on either the previous tab stop if found or the one set as default */\n selectedId: getUpdatedSelectedId(newTabStops, state.selectedId, previousTabStop?.id || state.defaultSelectedId),\n tabStops: newTabStops,\n gridMap: null,\n };\n};\n\n/** Handle `UPDATE_TAB_STOP` action updating properties of a tab stop. */\nexport const UPDATE_TAB_STOP: Reducer<UpdateTabStopAction> = (state, action) => {\n const { id, rowKey, disabled } = action.payload;\n const index = state.tabStops.findIndex((tabStop) => tabStop.id === id);\n if (index === -1) {\n // tab stop not registered\n return state;\n }\n\n const tabStop = state.tabStops[index];\n if (tabStop.disabled === disabled && tabStop.rowKey === rowKey) {\n // Nothing to do so short-circuit.\n return state;\n }\n\n const newTabStop = { ...tabStop, rowKey, disabled };\n const newTabStops = [...state.tabStops];\n newTabStops.splice(index, 1, newTabStop);\n\n return {\n ...state,\n selectedId: getUpdatedSelectedId(newTabStops, state.selectedId, state.defaultSelectedId),\n tabStops: newTabStops,\n gridMap: null,\n };\n};\n\n/** Handle `SELECT_TAB_STOP` action selecting a tab stop. */\nexport const SELECT_TAB_STOP: Reducer<SelectTabStopAction> = (state, action) => {\n const { id, type } = action.payload;\n\n const tabStop = state.tabStops.find((ts) => ts.id === id);\n if (!tabStop || tabStop.disabled) {\n return state;\n }\n\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop.id,\n isUsingKeyboard: type === 'keyboard',\n };\n};\n\nexport const SET_ALLOW_FOCUSING: Reducer<SetAllowFocusingAction> = (state, action) => {\n return {\n ...state,\n selectedId: getUpdatedSelectedId(state.tabStops, null, state.defaultSelectedId),\n allowFocusing: action.payload.allow,\n isUsingKeyboard: Boolean(action.payload.isKeyboardNavigation),\n };\n};\n\n/** Handle `RESET_SELECTED_TAB_STOP` action reseting the selected tab stop. */\nexport const RESET_SELECTED_TAB_STOP: Reducer<ResetSelectedTabStopAction> = (state) => {\n return {\n ...state,\n allowFocusing: false,\n selectedId: getUpdatedSelectedId(state.tabStops, null, state.defaultSelectedId),\n defaultSelectedId: getUpdatedSelectedId(state.tabStops, null, state.defaultSelectedId),\n isUsingKeyboard: false,\n };\n};\n","import findLast from 'lodash/findLast';\n\nimport { Action, OptionsUpdatedAction, Reducer, State } from '../types';\nimport { buildLoopAroundObject, tabStopIsEnabled } from '../utils';\nimport { KEY_NAV } from './keyboard-navigation';\nimport {\n REGISTER_TAB_STOP,\n UNREGISTER_TAB_STOP,\n UPDATE_TAB_STOP,\n SELECT_TAB_STOP,\n SET_ALLOW_FOCUSING,\n RESET_SELECTED_TAB_STOP,\n} from './tab-stop';\n\nexport const INITIAL_STATE: State = {\n selectedId: null,\n allowFocusing: false,\n tabStops: [],\n direction: 'horizontal',\n loopAround: buildLoopAroundObject(false),\n gridMap: null,\n defaultSelectedId: null,\n autofocus: undefined,\n isUsingKeyboard: false,\n};\n\nconst OPTIONS_UPDATED: Reducer<OptionsUpdatedAction> = (state, action) => {\n const { autofocus } = action.payload;\n let { selectedId, allowFocusing } = state;\n\n // Update selectedId when updating the `autofocus` option.\n if (!state.autofocus && autofocus) {\n if (autofocus === 'first') {\n selectedId = state.tabStops.find(tabStopIsEnabled)?.id || null;\n } else if (autofocus === 'last') {\n selectedId = findLast(state.tabStops, tabStopIsEnabled)?.id || null;\n }\n allowFocusing = true;\n }\n\n return {\n ...state,\n ...action.payload,\n selectedId,\n allowFocusing: action.payload.allowFocusing || allowFocusing,\n loopAround: buildLoopAroundObject(action.payload.loopAround),\n };\n};\n\n/** Reducers for each action type: */\nconst REDUCERS: { [Type in Action['type']]: Reducer<Extract<Action, { type: Type }>> } = {\n REGISTER_TAB_STOP,\n UNREGISTER_TAB_STOP,\n UPDATE_TAB_STOP,\n SELECT_TAB_STOP,\n OPTIONS_UPDATED,\n KEY_NAV,\n SET_ALLOW_FOCUSING,\n RESET_SELECTED_TAB_STOP,\n};\n\n/** Main reducer */\nexport const reducer: Reducer<Action> = (state, action) => {\n return REDUCERS[action.type]?.(state, action as any) || state;\n};\n","import React from 'react';\n\nimport noop from 'lodash/noop';\n\nimport { INITIAL_STATE } from '../../ducks/slice';\nimport { Action, State } from '../../types';\n\nexport type MovingFocusContext = Readonly<{\n state: State;\n dispatch: React.Dispatch<Action>;\n}>;\n\nexport const MovingFocusContext = React.createContext<MovingFocusContext>({\n state: INITIAL_STATE,\n dispatch: noop,\n});\n","import React, { useEffect } from 'react';\n\nimport { MovingFocusContext } from '../../components/MovingFocusProvider/context';\nimport { BaseHookOptions } from '../../types';\nimport { getPointerTypeFromEvent } from '../../utils';\n\n/**\n * Hook options\n */\ntype Options = [\n /** The DOM id of the tab stop. */\n id: string,\n ...baseOptions: BaseHookOptions,\n];\n\n/**\n * Hook to use in tab stop element of a virtual focus (ex: options of a listbox in a combobox).\n *\n * @returns true if the current tab stop has virtual focus\n */\nexport const useVirtualFocus: (...args: Options) => boolean = (\n id,\n domElementRef,\n disabled = false,\n rowKey = null,\n autofocus = false,\n) => {\n const isMounted = React.useRef(false);\n const { state, dispatch } = React.useContext(MovingFocusContext);\n\n // Register the tab stop on mount and unregister it on unmount:\n React.useEffect(\n () => {\n const { current: domElement } = domElementRef;\n if (!domElement) {\n return undefined;\n }\n // Select tab stop on click\n const onClick = (event?: PointerEvent | Event) => {\n dispatch({\n type: 'SELECT_TAB_STOP',\n payload: { id, type: getPointerTypeFromEvent(event) },\n });\n };\n domElement.addEventListener('click', onClick);\n\n // Register tab stop in context\n dispatch({ type: 'REGISTER_TAB_STOP', payload: { id, domElementRef, rowKey, disabled, autofocus } });\n\n return () => {\n domElement.removeEventListener('click', onClick);\n dispatch({ type: 'UNREGISTER_TAB_STOP', payload: { id } });\n };\n },\n /**\n * Pass the list key as dependency to make tab stops\n * re-register when it changes.\n */\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [state.listKey],\n );\n\n /*\n * Update the tab stop data if `rowKey` or `disabled` change.\n * The isMounted flag is used to prevent this effect running on mount, which is benign but redundant (as the\n * REGISTER_TAB_STOP action would have just been dispatched).\n */\n React.useEffect(\n () => {\n if (isMounted.current) {\n dispatch({ type: 'UPDATE_TAB_STOP', payload: { id, rowKey, disabled } });\n } else {\n isMounted.current = true;\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [disabled, rowKey],\n );\n\n const isActive = id === state.selectedId;\n\n // Scroll element into view when highlighted\n useEffect(() => {\n const { current } = domElementRef;\n if (isActive && current && current.scrollIntoView) {\n /**\n * In some cases, the selected item is contained in a popover\n * that won't be immediately set in the correct position.\n * Setting a small timeout before scroll the item into view\n * leaves it time to settle at the correct position.\n */\n const timeout = setTimeout(() => {\n current.scrollIntoView({ block: 'nearest' });\n }, 10);\n\n return () => {\n clearTimeout(timeout);\n };\n }\n\n return undefined;\n }, [domElementRef, isActive]);\n\n const focused = isActive && state.allowFocusing;\n\n // Determine if the current tab stop is the currently active one:\n return focused;\n};\n","import {\n ComboboxOptionProps,\n NodeOption,\n RegisteredComboboxAction,\n RegisteredComboboxOption,\n RegisteredComboboxOptionValue,\n StringOption,\n} from './types';\n\n/** Generate the combobox option id from the combobox id and the given id */\nexport const generateOptionId = (comboboxId: string, optionId: string | number) => `${comboboxId}-option-${optionId}`;\n\n/** Verifies that the combobox registered option is an action */\nexport const isComboboxAction = (option?: RegisteredComboboxOption): option is RegisteredComboboxAction =>\n Boolean(option?.isAction);\n\n/** Verifies that the combobox registered option is the option's value */\nexport const isComboboxValue = (option?: RegisteredComboboxOption): option is RegisteredComboboxOptionValue => {\n return !isComboboxAction(option);\n};\n\n/** Whether the given option has a string as child */\nexport const isStringOptionComponent = (option: ComboboxOptionProps): option is StringOption => {\n const { children } = option;\n\n return Boolean(typeof children === 'string' || typeof children === 'number');\n};\n\n/** Whether the given option has an unknown react element as child */\nexport const isNodeOptionComponent = (option: ComboboxOptionProps): option is NodeOption => {\n return !isStringOptionComponent(option);\n};\n","import uniqueId from 'lodash/uniqueId';\n\nimport {\n AddOptionAction,\n CloseComboboxAction,\n ComboboxAction,\n ComboboxReducer,\n ComboboxState,\n OpenComboboxAction,\n RemoveOptionAction,\n SetInputValueAction,\n} from '../types';\nimport { isComboboxAction, isComboboxValue } from '../utils';\n\nconst comboboxId = `combobox-${uniqueId()}`;\nexport const initialState: ComboboxState = {\n comboboxId,\n listboxId: `${comboboxId}-popover`,\n status: 'idle',\n isOpen: false,\n inputValue: '',\n showAll: true,\n options: {},\n type: 'listbox',\n optionsLength: 0,\n};\n\n/** Actions when the combobox opens. */\nconst OPEN_COMBOBOX: ComboboxReducer<OpenComboboxAction> = (state, action) => {\n const { manual } = action.payload || {};\n // If the combobox was manually opened, show all suggestions\n return {\n ...state,\n showAll: Boolean(manual),\n isOpen: true,\n };\n};\n\n/** Actions when the combobox closes */\nconst CLOSE_COMBOBOX: ComboboxReducer<CloseComboboxAction> = (state) => {\n return {\n ...state,\n showAll: true,\n isOpen: false,\n };\n};\n\n/** Actions on input update. */\nconst SET_INPUT_VALUE: ComboboxReducer<SetInputValueAction> = (state, action) => {\n return {\n ...state,\n inputValue: action.payload,\n // When the user is changing the value, show only values that are related to the input value.\n showAll: false,\n isOpen: true,\n };\n};\n\n/** Register an option to the state */\nconst ADD_OPTION: ComboboxReducer<AddOptionAction> = (state, action) => {\n const { id, option } = action.payload;\n const { options } = state;\n\n if (options[id]) {\n // Option already exists, return state unchanged\n return state;\n }\n\n const newOptions = {\n ...options,\n [id]: option,\n };\n\n let newType = state.type;\n if (isComboboxAction(option)) {\n newType = 'grid';\n }\n\n let newOptionsLength = state.optionsLength;\n if (isComboboxValue(option)) {\n newOptionsLength += 1;\n }\n\n return {\n ...state,\n options: newOptions,\n type: newType,\n optionsLength: newOptionsLength,\n };\n};\n\n/** Remove an option from the state */\nconst REMOVE_OPTION: ComboboxReducer<RemoveOptionAction> = (state, action) => {\n const { id } = action.payload;\n const { options } = state;\n const option = options[id];\n\n if (!options[id]) {\n // Option doesn't exist, return state unchanged\n return state;\n }\n\n const newOptions = { ...options };\n delete newOptions[id];\n\n let newOptionsLength = state.optionsLength;\n if (isComboboxValue(option)) {\n newOptionsLength -= 1;\n }\n\n return {\n ...state,\n options: newOptions,\n optionsLength: newOptionsLength,\n };\n};\n\n/** Reducers for each action type: */\nconst REDUCERS: { [Type in ComboboxAction['type']]: ComboboxReducer<Extract<ComboboxAction, { type: Type }>> } = {\n OPEN_COMBOBOX,\n CLOSE_COMBOBOX,\n SET_INPUT_VALUE,\n ADD_OPTION,\n REMOVE_OPTION,\n};\n\n/** Main reducer */\nexport const reducer: ComboboxReducer<ComboboxAction> = (state, action) => {\n return REDUCERS[action.type]?.(state, action as any) || state;\n};\n\n/** Dispatch for the combobox component */\nexport type ComboboxDispatch = React.Dispatch<ComboboxAction>;\n","import React from 'react';\n\nimport noop from 'lodash/noop';\n\nimport { TextFieldProps } from '@lumx/react';\n\nimport { ComboboxDispatch, initialState } from '../ducks/reducer';\nimport type {\n ComboboxProps,\n ComboboxSelectionType,\n OnComboboxSelect,\n ComboboxTranslations,\n ComboboxState,\n} from '../types';\n\nexport interface ComboboxContextActions {\n onSelect?: OnComboboxSelect;\n onInputChange?: TextFieldProps['onChange'];\n onOpen?: (params: { manual: boolean; currentValue: string }) => void;\n}\n\nexport interface ComboboxContextProps extends ComboboxState, ComboboxContextActions {\n openOnFocus?: ComboboxProps['openOnFocus'];\n openOnClick?: ComboboxProps['openOnClick'];\n optionsLength: number;\n /** The dispatch function to manage the inner state */\n dispatch: ComboboxDispatch;\n /** The ids of the currently selected options */\n selectedIds?: Array<string>;\n /** the type of selection currently configured for the combobox */\n selectionType?: ComboboxSelectionType;\n /**\n * Whether the error state should be displayed when the status is in error.\n */\n showErrorState?: boolean;\n /**\n * Whether the empty state should be displayed when there is no results.\n */\n showEmptyState?: boolean;\n /** translations to be used across the combobox */\n translations: ComboboxTranslations;\n}\n\n/** Context for the Combobox component */\nexport const ComboboxContext = React.createContext<ComboboxContextProps>({\n ...initialState,\n openOnFocus: false,\n openOnClick: false,\n selectionType: 'single',\n optionsLength: 0,\n onSelect: noop,\n onInputChange: noop,\n onOpen: noop,\n dispatch: noop,\n translations: {\n clearLabel: '',\n tryReloadLabel: '',\n showSuggestionsLabel: '',\n noResultsForInputLabel: (input) => input || '',\n loadingLabel: '',\n serviceUnavailableLabel: '',\n nbOptionsLabel: (options) => `${options}`,\n },\n});\n\n/** Context for a combobox section to store its unique id */\nexport const SectionContext = React.createContext<{ sectionId: string; isLoading?: boolean }>({ sectionId: '' });\n","import React, { ReactNode, createContext, useContext } from 'react';\n\nexport interface ComboboxOptionContextValue {\n optionId?: string;\n isKeyboardHighlighted?: boolean;\n}\nexport const ComboboxOptionContext = createContext<ComboboxOptionContextValue>({});\n\ninterface ComboboxOptionIdProviderProps extends Required<ComboboxOptionContextValue> {\n /** Option to display */\n children: ReactNode;\n}\n\n/** Context Provider to store the current combobox option id. */\nexport const ComboboxOptionContextProvider = ({\n optionId,\n isKeyboardHighlighted,\n children,\n}: ComboboxOptionIdProviderProps) => {\n const value = React.useMemo(() => ({ optionId, isKeyboardHighlighted }), [optionId, isKeyboardHighlighted]);\n return <ComboboxOptionContext.Provider value={value}>{children}</ComboboxOptionContext.Provider>;\n};\n\n/**\n * Retrieve the current combobox option id.\n * Must be used within a ComboboxOptionIdProvider\n */\nexport const useComboboxOptionContext = () => {\n const comboboxOption = useContext(ComboboxOptionContext);\n\n if (!comboboxOption?.optionId) {\n throw new Error('This hook must be used within a ComboboxOptionIdProvider');\n }\n\n return comboboxOption as Required<ComboboxOptionContextValue>;\n};\n","import { ReactNode, RefObject, createContext, useContext, useMemo } from 'react';\n\ninterface ComboboxRefsContext {\n triggerRef: RefObject<HTMLElement>;\n anchorRef: RefObject<HTMLElement>;\n}\n\n/** Context to store the refs of the combobox elements */\nconst ComboboxRefsContext = createContext<ComboboxRefsContext>({\n triggerRef: { current: null },\n anchorRef: { current: null },\n});\n\ninterface ComboboxRefsProviderProps extends ComboboxRefsContext {\n children: ReactNode;\n}\n\n/** Provider to store the required refs for the Combobox */\nexport const ComboboxRefsProvider = ({ triggerRef, anchorRef, children }: ComboboxRefsProviderProps) => {\n const value = useMemo(\n () => ({\n triggerRef,\n anchorRef,\n }),\n [triggerRef, anchorRef],\n );\n return <ComboboxRefsContext.Provider value={value}>{children}</ComboboxRefsContext.Provider>;\n};\n\n/** Retrieves the combobox elements references from context */\nexport const useComboboxRefs = () => {\n const refs = useContext(ComboboxRefsContext);\n\n if (!refs) {\n throw new Error('The useComboboxRefs hook must be called within a ComboboxRefsProvider');\n }\n\n return refs;\n};\n","import React from 'react';\n\nimport { TextFieldProps } from '@lumx/react';\nimport { MovingFocusContext } from '@lumx/react/utils';\n\nimport { ComboboxContext } from '../context/ComboboxContext';\nimport { useComboboxRefs } from '../context/ComboboxRefsContext';\nimport { ComboboxOptionSelectEventSource, RegisteredComboboxOption } from '../types';\nimport { isComboboxValue } from '../utils';\n\ntype OnOptionsMounted = (options?: RegisteredComboboxOption[]) => void;\n\n/** Retrieve the current combobox state and actions */\nexport const useCombobox = () => {\n const comboboxContext = React.useContext(ComboboxContext);\n const { dispatch: movingFocusDispatch } = React.useContext(MovingFocusContext);\n const { onSelect, onInputChange, onOpen, dispatch, inputValue, ...contextValues } = comboboxContext;\n const { triggerRef } = useComboboxRefs();\n\n /** Action triggered when the listBox is closed without selecting any option */\n const handleClose = React.useCallback(() => {\n dispatch({ type: 'CLOSE_COMBOBOX' });\n // Reset visual focus\n movingFocusDispatch({ type: 'RESET_SELECTED_TAB_STOP' });\n }, [dispatch, movingFocusDispatch]);\n\n // Handle callbacks on options mounted\n const [optionsMountedCallbacks, setOptionsMountedCallback] = React.useState<Array<OnOptionsMounted>>();\n React.useEffect(() => {\n if (comboboxContext.optionsLength > 0 && optionsMountedCallbacks?.length) {\n const optionsArray = Object.values(comboboxContext.options);\n // Execute callbacks\n for (const callback of optionsMountedCallbacks) {\n callback(optionsArray);\n }\n setOptionsMountedCallback(undefined);\n }\n }, [comboboxContext.options, comboboxContext.optionsLength, optionsMountedCallbacks]);\n\n /** Callback for when an option is selected */\n const handleSelected = React.useCallback(\n (option: RegisteredComboboxOption, source?: ComboboxOptionSelectEventSource) => {\n if (option?.isDisabled) {\n return;\n }\n\n if (isComboboxValue(option)) {\n /**\n * We only close the list if the selection type is single.\n * If it is multiple, we want to allow the user to continue\n * selecting multiple options.\n */\n if (comboboxContext.selectionType !== 'multiple') {\n handleClose();\n }\n /** Call parent onSelect callback */\n if (onSelect) {\n onSelect(option);\n }\n }\n\n /** If the option itself has a custom action, also call it */\n if (option?.onSelect) {\n option.onSelect(option, source);\n }\n\n /** Reset focus on input */\n if (triggerRef?.current) {\n triggerRef.current?.focus();\n }\n },\n [comboboxContext.selectionType, handleClose, onSelect, triggerRef],\n );\n\n /** Callback for when the input must be updated */\n const handleInputChange: TextFieldProps['onChange'] = React.useCallback(\n (value, ...args) => {\n // Update the local state\n dispatch({ type: 'SET_INPUT_VALUE', payload: value });\n // If a callback if given, call it with the value\n if (onInputChange) {\n onInputChange(value, ...args);\n }\n // Reset visual focus\n movingFocusDispatch({ type: 'RESET_SELECTED_TAB_STOP' });\n },\n [dispatch, movingFocusDispatch, onInputChange],\n );\n\n /**\n * Open the popover\n *\n * @returns a promise with the updated context once all options are mounted\n */\n const handleOpen = React.useCallback(\n (params?: { manual?: boolean }) => {\n /** update the local state */\n dispatch({ type: 'OPEN_COMBOBOX', payload: params });\n /** If a parent callback was given, trigger it with state information */\n if (onOpen) {\n onOpen({ currentValue: inputValue, manual: Boolean(params?.manual) });\n }\n\n // Promise resolving options on mount\n return new Promise<RegisteredComboboxOption[] | undefined>((resolve) => {\n // Append to the list of callback on options mounted\n setOptionsMountedCallback((callbacks = []) => {\n callbacks.push(resolve);\n return callbacks;\n });\n });\n },\n [dispatch, inputValue, onOpen],\n );\n\n return React.useMemo(\n () => ({\n handleClose,\n handleOpen,\n handleInputChange,\n handleSelected,\n dispatch,\n inputValue,\n ...contextValues,\n }),\n [contextValues, dispatch, handleClose, handleInputChange, handleOpen, handleSelected, inputValue],\n );\n};\n","import { useContext } from 'react';\n\nimport { SectionContext } from '../context/ComboboxContext';\n\n/** Retrieve the current combobox section id */\nexport const useComboboxSectionId = () => {\n return useContext(SectionContext);\n};\n","import React from 'react';\n\nimport { RegisteredComboboxOption } from '../types';\nimport { useCombobox } from './useCombobox';\n\n/**\n * Register the given option to the context\n */\nexport const useRegisterOption = (registerId: string, option: RegisteredComboboxOption, shouldRegister?: boolean) => {\n const { dispatch } = useCombobox();\n\n /** Register the given options */\n React.useEffect(() => {\n if (option && shouldRegister) {\n dispatch({ type: 'ADD_OPTION', payload: { id: registerId, option } });\n }\n\n // Unregister ids if/when the component unmounts or if option changes\n return () => {\n if (option) {\n dispatch({ type: 'REMOVE_OPTION', payload: { id: registerId } });\n }\n };\n }, [dispatch, option, registerId, shouldRegister]);\n};\n"],"names":["DisabledStateContext","React","createContext","state","DisabledStateProvider","children","value","_jsx","Provider","useDisabledStateContext","useContext","EVENT_TYPES","isClickAway","targets","refs","some","ref","target","current","contains","useClickAway","callback","childrenRefs","useEffect","currentRefs","isEmpty","undefined","listener","evt","composedPath","forEach","evtType","document","addEventListener","removeEventListener","ClickAwayAncestorContext","ClickAwayProvider","parentRef","parentContext","currentContext","useMemo","context","addRefs","newChildrenRefs","push","useRef","displayName","A11YLiveMessage","type","atomic","role","hidden","relevant","className","forwardedProps","join","visuallyHidden","PortalContext","container","body","PortalProvider","Portal","enabled","init","useLayoutEffect","teardown","_Fragment","createPortal","createGridMap","tabStops","tabStopsByRowKey","groupBy","rowKeys","reduce","acc","rowKey","isNil","includes","tabStopIsEnabled","tabStop","disabled","LOOP_AROUND_TYPES","nextLoop","nextEnd","inside","CELL_SEARCH_DIRECTION","asc","desc","buildLoopAroundObject","loopAround","newLoopAround","row","col","isNumberCoords","coords","isDirectionCoords","Boolean","from","findCellInCol","gridMap","rowCoords","cellSelector","lastIndex","length","searchIndex","direction","searchCellFunc","findLast","find","rowKeyWithEnabledCell","index","cell","hasCell","cellRowIndex","correctRowIndex","findCellInRow","colCoords","currentRow","parseColsForCell","maxColIndex","maxLength","rowIndex","rowLength","fromIndex","rowWithEnabledCed","getCell","getCellCoordinates","currentRowKey","findIndex","columnOffset","ts","id","shouldLoopListVertically","shouldLoopListHorizontally","getPointerTypeFromEvent","event","pointerType","VERTICAL_NAV_KEYS","HORIZONTAL_NAV_KEYS","KEY_NAV_KEYS","NAV_KEYS","both","vertical","horizontal","MOVES","NEXT","_","i","allowFocusing","selectedId","PREVIOUS","NEXT_ROW","currentTabStop","cellCoordinates","nextRow","PREVIOUS_ROW","previousRow","VERY_FIRST","VERY_LAST","NEXT_COLUMN","PREVIOUS_COLUMN","previousColumn","FIRST_IN_COLUMN","LAST_IN_COLUMN","FIRST_IN_ROW","LAST_IN_ROW","KEY_NAV","action","key","ctrlKey","payload","isGrid","isFirst","isLast","findLastIndex","navigation","gridJumpToShortcutDirection","newState","isUsingKeyboard","getUpdatedSelectedId","currentSelectedId","defaultSelectedId","REGISTER_TAB_STOP","newTabStop","newTabStopElement","domElementRef","indexToInsertAt","domTabStop","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","insertIndex","newTabStops","splice","autofocus","newSelectedId","UNREGISTER_TAB_STOP","filter","previousTabStopIndex","newLocal","previousTabStop","UPDATE_TAB_STOP","SELECT_TAB_STOP","SET_ALLOW_FOCUSING","allow","isKeyboardNavigation","RESET_SELECTED_TAB_STOP","INITIAL_STATE","OPTIONS_UPDATED","REDUCERS","reducer","MovingFocusContext","dispatch","noop","useVirtualFocus","isMounted","domElement","onClick","listKey","isActive","scrollIntoView","timeout","setTimeout","block","clearTimeout","focused","generateOptionId","comboboxId","optionId","isComboboxAction","option","isAction","isComboboxValue","uniqueId","initialState","listboxId","status","isOpen","inputValue","showAll","options","optionsLength","ComboboxContext","openOnFocus","openOnClick","selectionType","onSelect","onInputChange","onOpen","translations","clearLabel","tryReloadLabel","showSuggestionsLabel","noResultsForInputLabel","input","loadingLabel","serviceUnavailableLabel","nbOptionsLabel","SectionContext","sectionId","ComboboxOptionContext","ComboboxOptionContextProvider","isKeyboardHighlighted","useComboboxOptionContext","comboboxOption","Error","ComboboxRefsContext","triggerRef","anchorRef","ComboboxRefsProvider","useComboboxRefs","useCombobox","comboboxContext","movingFocusDispatch","contextValues","handleClose","useCallback","optionsMountedCallbacks","setOptionsMountedCallback","useState","optionsArray","Object","values","handleSelected","source","isDisabled","focus","handleInputChange","args","handleOpen","params","currentValue","manual","Promise","resolve","callbacks","useComboboxSectionId","useRegisterOption","registerId","shouldRegister"],"mappings":";;;;;;;;;;;;;AAIO,MAAMA,oBAAoB,gBAAGC,cAAK,CAACC,aAAa,CAA4B;AAAEC,EAAAA,KAAK,EAAE;AAAK,CAAC,CAAC;AAMnG;AACA;AACA;AACA;AACO,SAASC,qBAAqBA,CAAC;EAAEC,QAAQ;EAAE,GAAGC;AAAkC,CAAC,EAAE;AACtF,EAAA,oBAAOC,GAAA,CAACP,oBAAoB,CAACQ,QAAQ,EAAA;AAACF,IAAAA,KAAK,EAAEA,KAAM;AAAAD,IAAAA,QAAA,EAAEA;AAAQ,GAAgC,CAAC;AAClG;;AA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ClickAway.tsx","../../src/utils/ClickAwayProvider/ClickAwayProvider.tsx","../../src/utils/A11YLiveMessage/index.tsx","../../src/utils/Portal/PortalProvider.tsx","../../src/utils/Portal/Portal.tsx","../../src/utils/moving-focus/utils/createGridMap.ts","../../src/utils/moving-focus/utils/tabStopIsEnabled.ts","../../src/utils/moving-focus/constants.ts","../../src/utils/moving-focus/utils/buildLoopAroundObject.ts","../../src/utils/moving-focus/utils/getCell.ts","../../src/utils/moving-focus/utils/getCellCoordinates.ts","../../src/utils/moving-focus/utils/shouldLoopListVertically.ts","../../src/utils/moving-focus/utils/shouldLoopListHorizontally.ts","../../src/utils/moving-focus/utils/getPointerTypeFromEvent.ts","../../src/utils/moving-focus/ducks/keyboard-navigation.ts","../../src/utils/moving-focus/ducks/tab-stop.ts","../../src/utils/moving-focus/ducks/slice.ts","../../src/utils/moving-focus/components/MovingFocusProvider/context.ts","../../src/utils/moving-focus/hooks/useVirtualFocus/useVirtualFocus.ts","../../src/components/combobox/utils.tsx","../../src/components/combobox/ducks/reducer.ts","../../src/components/combobox/context/ComboboxContext.tsx","../../src/components/combobox/context/ComboboxOptionContext.tsx","../../src/components/combobox/context/ComboboxRefsContext.tsx","../../src/components/combobox/hooks/useCombobox.tsx","../../src/components/combobox/hooks/useComboboxSectionId.tsx","../../src/components/combobox/hooks/useRegisterOption.tsx"],"sourcesContent":["import React, { useContext } from 'react';\n\nimport { DisabledStateContextValue } from '@lumx/core/js/utils/disabledState';\n\nexport const DisabledStateContext = React.createContext<DisabledStateContextValue>({ state: null });\n\nexport type DisabledStateProviderProps = DisabledStateContextValue & {\n children: React.ReactNode;\n};\n\n/**\n * Disabled state provider.\n * All nested LumX Design System components inherit this disabled state.\n */\nexport function DisabledStateProvider({ children, ...value }: DisabledStateProviderProps) {\n return <DisabledStateContext.Provider value={value}>{children}</DisabledStateContext.Provider>;\n}\n\n/**\n * Get DisabledState context value\n */\nexport function useDisabledStateContext(): DisabledStateContextValue {\n return useContext(DisabledStateContext);\n}\n","import { RefObject, useEffect } from 'react';\n\nimport { Falsy } from '@lumx/react/utils/type';\n\nimport isEmpty from 'lodash/isEmpty';\n\nconst EVENT_TYPES = ['mousedown', 'touchstart'];\n\nfunction isClickAway(targets: HTMLElement[], refs: Array<RefObject<HTMLElement>>): boolean {\n // The targets elements are not contained in any of the listed element references.\n return !refs.some((ref) => targets.some((target) => ref?.current?.contains(target)));\n}\n\nexport interface ClickAwayParameters {\n /**\n * A callback function to call when the user clicks away from the elements.\n */\n callback: EventListener | Falsy;\n /**\n * Elements considered within the click away context (clicking outside them will trigger the click away callback).\n */\n childrenRefs: RefObject<Array<RefObject<HTMLElement>>>;\n}\n\n/**\n * Listen to clicks away from the given elements and callback the passed in function.\n *\n * Warning: If you need to detect click away on nested React portals, please use the `ClickAwayProvider` component.\n */\nexport function useClickAway({ callback, childrenRefs }: ClickAwayParameters): void {\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!callback || !currentRefs || isEmpty(currentRefs)) {\n return undefined;\n }\n const listener: EventListener = (evt) => {\n const targets = [evt.composedPath?.()[0], evt.target] as HTMLElement[];\n if (isClickAway(targets, currentRefs)) {\n callback(evt);\n }\n };\n\n EVENT_TYPES.forEach((evtType) => document.addEventListener(evtType, listener));\n return () => {\n EVENT_TYPES.forEach((evtType) => document.removeEventListener(evtType, listener));\n };\n }, [callback, childrenRefs]);\n}\n","import { createContext, RefObject, useContext, useEffect, useMemo, useRef } from 'react';\nimport { ClickAwayParameters, useClickAway } from '@lumx/react/hooks/useClickAway';\n\ninterface ContextValue {\n childrenRefs: Array<RefObject<HTMLElement>>;\n addRefs(...newChildrenRefs: Array<RefObject<HTMLElement>>): void;\n}\n\nconst ClickAwayAncestorContext = createContext<ContextValue | null>(null);\n\ninterface ClickAwayProviderProps extends ClickAwayParameters {\n /**\n * (Optional) Element that should be considered as part of the parent\n */\n parentRef?: RefObject<HTMLElement>;\n /**\n * Children\n */\n children?: React.ReactNode;\n}\n\n/**\n * Component combining the `useClickAway` hook with a React context to hook into the React component tree and make sure\n * we take into account both the DOM tree and the React tree to detect click away.\n *\n * @return the react component.\n */\nexport const ClickAwayProvider: React.FC<ClickAwayProviderProps> = ({\n children,\n callback,\n childrenRefs,\n parentRef,\n}) => {\n const parentContext = useContext(ClickAwayAncestorContext);\n const currentContext = useMemo(() => {\n const context: ContextValue = {\n childrenRefs: [],\n /**\n * Add element refs to the current context and propagate to the parent context.\n */\n addRefs(...newChildrenRefs) {\n // Add element refs that should be considered as inside the click away context.\n context.childrenRefs.push(...newChildrenRefs);\n\n if (parentContext) {\n // Also add then to the parent context\n parentContext.addRefs(...newChildrenRefs);\n if (parentRef) {\n // The parent element is also considered as inside the parent click away context but not inside the current context\n parentContext.addRefs(parentRef);\n }\n }\n },\n };\n return context;\n }, [parentContext, parentRef]);\n\n useEffect(() => {\n const { current: currentRefs } = childrenRefs;\n if (!currentRefs) {\n return;\n }\n currentContext.addRefs(...currentRefs);\n }, [currentContext, childrenRefs]);\n\n useClickAway({ callback, childrenRefs: useRef(currentContext.childrenRefs) });\n return <ClickAwayAncestorContext.Provider value={currentContext}>{children}</ClickAwayAncestorContext.Provider>;\n};\nClickAwayProvider.displayName = 'ClickAwayProvider';\n","import React, { AriaAttributes, ReactNode } from 'react';\n\nimport { visuallyHidden, join } from '@lumx/core/js/utils/classNames';\n\nexport interface A11YLiveMessageProps {\n /** The message that will be read. */\n children?: ReactNode;\n /** Whether the message should be hidden */\n hidden?: boolean;\n /**\n * The type of message.\n * Default to \"polite\"\n * Assertive should only be used for messages than need immediate attention.\n */\n type?: AriaAttributes['aria-live'];\n /**\n * Indicates whether assistive technologies will present all, or only parts of, the changed region based on\n * the change notifications defined by the aria-relevant attribute.\n */\n atomic?: AriaAttributes['aria-atomic'];\n /**\n * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.\n * @see atomic.\n */\n relevant?: AriaAttributes['aria-relevant'];\n /**\n * Whether the live region reads a current status or\n * raises an alert.\n * Only use `alert` for time sensitive information that should be read immediately\n * as it will interrupt anything being currently read.\n */\n role?: 'status' | 'alert';\n /** Scope, for tracking purposes */\n scope?: string;\n /** Optionnal classname */\n className?: string;\n}\n\n/**\n * Live region to read a message to screen readers.\n * Messages can be \"polite\" and be read when possible or\n * \"assertive\" and interrupt any message currently be read. (To be used sparingly)\n *\n * More information here: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions\n *\n * @family A11Y\n * @param A11YLiveMessageProps\n * @returns A11YLiveMessage\n */\nexport const A11YLiveMessage: React.FC<A11YLiveMessageProps> = ({\n type = 'polite',\n atomic,\n role,\n hidden,\n relevant,\n children,\n className,\n ...forwardedProps\n}) => {\n return (\n <div\n {...forwardedProps}\n className={join(hidden ? visuallyHidden() : undefined, className)}\n role={role}\n aria-live={type}\n aria-atomic={atomic}\n aria-relevant={relevant}\n >\n {children}\n </div>\n );\n};\n","import React from 'react';\n\ntype Container = DocumentFragment | Element;\n\n/**\n * Portal initializing function.\n * If it does not provide a container, the Portal children will render in classic React tree and not in a portal.\n */\nexport type PortalInit = () => {\n container?: Container;\n teardown?: () => void;\n};\n\nexport const PortalContext = React.createContext<PortalInit>(() => ({ container: document.body }));\n\nexport interface PortalProviderProps {\n children?: React.ReactNode;\n value: PortalInit;\n}\n\n/**\n * Customize where <Portal> wrapped elements render (tooltip, popover, dialog, etc.)\n */\nexport const PortalProvider: React.FC<PortalProviderProps> = PortalContext.Provider;\n","import React from 'react';\nimport { createPortal } from 'react-dom';\nimport { PortalContext } from './PortalProvider';\n\nexport interface PortalProps {\n enabled?: boolean;\n children: React.ReactNode;\n}\n\n/**\n * Render children in a portal outside the current DOM position\n * (defaults to `document.body` but can be customized with the PortalContextProvider)\n */\nexport const Portal: React.FC<PortalProps> = ({ children, enabled = true }) => {\n const init = React.useContext(PortalContext);\n const context = React.useMemo(\n () => {\n return enabled ? init() : null;\n },\n // Only update on 'enabled'\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [enabled],\n );\n\n React.useLayoutEffect(() => {\n return context?.teardown;\n }, [context?.teardown, enabled]);\n\n if (!context?.container) {\n return <>{children}</>;\n }\n return createPortal(children, context.container);\n};\n","import groupBy from 'lodash/groupBy';\nimport isNil from 'lodash/isNil';\n\nimport { GridMap, TabStop, TabStopRowKey } from '../types';\n\n/**\n * Create a map from the given tab stop to sort them by rowKey;\n */\nexport function createGridMap(tabStops: readonly TabStop[]): GridMap {\n /** Group all tabStop by rows to easily access them by their row keys */\n const tabStopsByRowKey = groupBy(tabStops, 'rowKey');\n /**\n * An array with each row key in the order set in the tabStops array.\n * Each rowKey will only appear once.\n */\n const rowKeys = tabStops.reduce<TabStopRowKey[]>((acc, { rowKey }) => {\n if (!isNil(rowKey) && !acc.includes(rowKey)) {\n return [...acc, rowKey];\n }\n return acc;\n }, []);\n\n return {\n tabStopsByRowKey,\n rowKeys,\n };\n}\n","import { TabStop } from '../types';\n\n/** Check if the given tab stop is enabled */\nexport const tabStopIsEnabled = (tabStop: TabStop) => !tabStop.disabled;\n","export const LOOP_AROUND_TYPES = {\n /**\n * Will continue navigation to the next row or column and loop back to the start\n * when the last tab stop is reached\n */\n nextLoop: 'next-loop',\n /**\n * Will continue navigation to the next row or column until\n * the last tab stop is reached\n */\n nextEnd: 'next-end',\n /**\n * Will loop within the current row or column\n */\n inside: 'inside',\n} as const;\n\nexport const CELL_SEARCH_DIRECTION = {\n /** Look ahead of the given position */\n asc: 'asc',\n /** Look before the given position */\n desc: 'desc',\n} as const;\n","import { LOOP_AROUND_TYPES } from '../constants';\nimport { LoopAround, LoopAroundByAxis } from '../types';\n\n/**\n * Build a loopAround configuration to ensure both row and col behavior are set.\n *\n * Setting a boolean will set the following behaviors:\n *\n * * true => { row: 'next-loop', col: 'next-loop' }\n * * false => { row: 'next-end', col: 'next-end' }\n */\nexport function buildLoopAroundObject(loopAround?: LoopAround): LoopAroundByAxis {\n if (typeof loopAround === 'boolean' || loopAround === undefined) {\n const newLoopAround: LoopAround = loopAround\n ? { row: LOOP_AROUND_TYPES.nextLoop, col: LOOP_AROUND_TYPES.nextLoop }\n : { row: LOOP_AROUND_TYPES.nextEnd, col: LOOP_AROUND_TYPES.nextEnd };\n\n return newLoopAround;\n }\n return loopAround;\n}\n","import find from 'lodash/find';\nimport findLast from 'lodash/findLast';\n\nimport { CELL_SEARCH_DIRECTION } from '../constants';\nimport { CellSelector, CoordsType, DirectionCoords, GridMap, TabStop } from '../types';\n\nimport { tabStopIsEnabled } from './tabStopIsEnabled';\n\n/**\n * Check that the given coordinate is a simple number\n */\nconst isNumberCoords = (coords: CoordsType): coords is number => typeof coords === 'number';\n\n/**\n * Check that the given coordinate is a direction\n */\nfunction isDirectionCoords(coords: CoordsType): coords is DirectionCoords {\n return Boolean(typeof coords !== 'number' && typeof coords?.from === 'number');\n}\n\n/**\n * Search the given column of a grid map for a cell.\n */\nfunction findCellInCol(\n gridMap: GridMap,\n col: number,\n rowCoords: DirectionCoords,\n cellSelector: CellSelector = tabStopIsEnabled,\n) {\n /** The rowIndex might not be strictly successive, so we need to use the actual row index keys. */\n const { rowKeys, tabStopsByRowKey } = gridMap;\n const lastIndex = rowKeys.length - 1;\n /**\n * If the rowCoords.from is set at -1, it means we should search from the start/end.\n */\n let searchIndex = rowCoords.from;\n if (searchIndex === -1) {\n searchIndex = rowCoords.direction === CELL_SEARCH_DIRECTION.desc ? lastIndex : 0;\n }\n\n const searchCellFunc = rowCoords.direction === CELL_SEARCH_DIRECTION.desc ? findLast : find;\n const rowKeyWithEnabledCell = searchCellFunc(rowKeys, (rowKey, index) => {\n const row = tabStopsByRowKey[rowKey];\n const cell = row[col];\n const hasCell = Boolean(cell);\n const cellRowIndex = index;\n\n /** Check that the target row index is in the right direction of the search */\n const correctRowIndex =\n rowCoords.direction === CELL_SEARCH_DIRECTION.desc\n ? cellRowIndex <= searchIndex\n : cellRowIndex >= searchIndex;\n\n if (cell && correctRowIndex) {\n return cellSelector ? hasCell && cellSelector(cell) : hasCell;\n }\n return false;\n });\n const row = rowKeyWithEnabledCell !== undefined ? tabStopsByRowKey[rowKeyWithEnabledCell] : undefined;\n return row?.[col];\n}\n\n/**\n * Search the given column of a grid map for a cell.\n */\nfunction findCellInRow(\n gridMap: GridMap,\n row: number,\n colCoords: DirectionCoords,\n cellSelector: CellSelector = tabStopIsEnabled,\n) {\n const { direction, from } = colCoords || {};\n const { rowKeys, tabStopsByRowKey } = gridMap;\n const rowKey = rowKeys[row];\n const currentRow = tabStopsByRowKey[rowKey];\n if (!currentRow) {\n return undefined;\n }\n\n const searchCellFunc = direction === CELL_SEARCH_DIRECTION.desc ? findLast : find;\n const cell = searchCellFunc(currentRow, cellSelector, from);\n return cell;\n}\n\n/**\n * Parse each column of the given gridMap to find the first cell matching the selector.\n * The direction and starting point of the search can be set using the coordinates attribute.\n */\nfunction parseColsForCell(\n /** The gridMap to search */\n gridMap: GridMap,\n /** The coordinate to search */\n { direction = CELL_SEARCH_DIRECTION.asc, from }: DirectionCoords,\n cellSelector: CellSelector = tabStopIsEnabled,\n) {\n if (from === undefined) {\n return undefined;\n }\n\n const { rowKeys, tabStopsByRowKey } = gridMap;\n\n /** As we cannot know for certain when to stop, we need to know which column is the last column */\n const maxColIndex = rowKeys.reduce<number>((maxLength, rowIndex) => {\n const rowLength = tabStopsByRowKey[rowIndex].length;\n return rowLength > maxLength ? rowLength - 1 : maxLength;\n }, 0);\n\n /** If \"from\" is set as -1, start from the end. */\n const fromIndex = from === -1 ? maxColIndex : from || 0;\n\n for (\n let index = fromIndex;\n direction === CELL_SEARCH_DIRECTION.desc ? index > -1 : index <= maxColIndex;\n direction === CELL_SEARCH_DIRECTION.desc ? (index -= 1) : (index += 1)\n ) {\n const rowWithEnabledCed = findCellInCol(\n gridMap,\n index,\n { direction, from: direction === CELL_SEARCH_DIRECTION.desc ? -1 : 0 },\n cellSelector,\n );\n\n if (rowWithEnabledCed) {\n return rowWithEnabledCed;\n }\n }\n\n return undefined;\n}\n\n/**\n * Search for a cell in a gridMap\n *\n * This allows you to\n * * Select a cell at a specific coordinate\n * * Search for a cell from a specific column in any direction\n * * Search for a cell from a specific row in any direction\n *\n * If no cell is found, returns undefined\n */\nexport function getCell(\n /** The gridMap object to search in. */\n gridMap: GridMap,\n /** The coordinates of the cell to select */\n coords: {\n /** The row on or from witch to look for */\n row: CoordsType;\n /** The column on or from witch to look for */\n col: CoordsType;\n },\n /**\n * A selector function to select the cell.\n * Selects enabled cells by default.\n */\n cellSelector: CellSelector = tabStopIsEnabled,\n): TabStop | undefined {\n const { row, col } = coords || {};\n const { rowKeys, tabStopsByRowKey } = gridMap || {};\n\n /** Defined row and col */\n if (isNumberCoords(row) && isNumberCoords(col)) {\n const rowKey = rowKeys[row];\n return tabStopsByRowKey[rowKey][col];\n }\n\n /** Defined row but variable col */\n if (isDirectionCoords(col) && isNumberCoords(row)) {\n return findCellInRow(gridMap, row, col, cellSelector);\n }\n\n if (isDirectionCoords(row)) {\n if (isDirectionCoords(col)) {\n return parseColsForCell(gridMap, col, cellSelector);\n }\n return findCellInCol(gridMap, col, row, cellSelector);\n }\n\n return undefined;\n}\n","import isNil from 'lodash/isNil';\n\nimport { GridMap, TabStop } from '../types';\n\nexport function getCellCoordinates(gridMap: GridMap, tabStop: TabStop) {\n const currentRowKey = tabStop.rowKey;\n if (isNil(currentRowKey)) {\n return undefined;\n }\n const { rowKeys, tabStopsByRowKey } = gridMap;\n const rowIndex = rowKeys.findIndex((rowKey) => rowKey === currentRowKey);\n const row = tabStopsByRowKey[currentRowKey];\n const columnOffset = row.findIndex((ts) => ts.id === tabStop.id);\n\n return {\n rowIndex,\n row,\n columnOffset,\n };\n}\n","import { KeyDirection, LoopAroundByAxis } from '../types';\n\n/** Check whether the list should vertically loop with the given configuration */\nexport function shouldLoopListVertically(direction: KeyDirection, loopAround: Pick<LoopAroundByAxis, 'col'>): boolean {\n return (\n (direction === 'vertical' && loopAround?.col !== 'next-end') ||\n (direction === 'both' && loopAround?.col !== 'next-end')\n );\n}\n","import { KeyDirection, LoopAroundByAxis } from '../types';\n\n/** Check whether the list should horizontally loop with the given configuration */\nexport function shouldLoopListHorizontally(\n direction: KeyDirection,\n loopAround: Pick<LoopAroundByAxis, 'row'>,\n): boolean {\n return (\n (direction === 'horizontal' && loopAround?.row !== 'next-end') ||\n (direction === 'both' && loopAround?.row !== 'next-end')\n );\n}\n","/**\n * Get the correct pointer type from the given event.\n * This is used when a tab stop is selected, to check if is has been selected using a keyboard or a pointer\n * (pen / mouse / touch)\n */\nexport function getPointerTypeFromEvent(event?: PointerEvent | Event) {\n return event && 'pointerType' in event && Boolean(event.pointerType) ? 'pointer' : 'keyboard';\n}\n","import find from 'lodash/find';\nimport findLast from 'lodash/findLast';\nimport findLastIndex from 'lodash/findLastIndex';\nimport isNil from 'lodash/isNil';\n\nimport { LOOP_AROUND_TYPES } from '../constants';\nimport { KeyDirection, KeyNavAction, Navigation, Reducer, State, TabStop } from '../types';\nimport {\n createGridMap,\n getCell,\n getCellCoordinates,\n shouldLoopListHorizontally,\n shouldLoopListVertically,\n tabStopIsEnabled,\n} from '../utils';\n\n// Event keys used for keyboard navigation.\nexport const VERTICAL_NAV_KEYS = ['ArrowUp', 'ArrowDown', 'Home', 'End'] as const;\nexport const HORIZONTAL_NAV_KEYS = ['ArrowLeft', 'ArrowRight', 'Home', 'End'] as const;\nexport const KEY_NAV_KEYS = [...HORIZONTAL_NAV_KEYS, ...VERTICAL_NAV_KEYS] as const;\nexport const NAV_KEYS: { [direction in KeyDirection]: ReadonlyArray<string> } = {\n both: KEY_NAV_KEYS,\n vertical: VERTICAL_NAV_KEYS,\n horizontal: HORIZONTAL_NAV_KEYS,\n};\n\n// Event keys union type\nexport type EventKey = (typeof KEY_NAV_KEYS)[number];\n\n// Handle all navigation moves resulting in a new state.\nconst MOVES: {\n [N in Navigation]: (state: State, currentTabStop: TabStop, index: number) => State;\n} = {\n // Move to the next item.\n // The grid is flatten so the item after the last of a row will be the\n // first item of the next row.\n NEXT(state, _, index) {\n for (let i = index + 1; i < state.tabStops.length; ++i) {\n const tabStop = state.tabStops[i];\n\n if (!tabStop.disabled) {\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop.id,\n };\n }\n }\n return state;\n },\n\n // Move to the previous item.\n // The grid is flatten so the item before the first of a row will be the\n // last item of the previous row.\n PREVIOUS(state, _, index) {\n for (let i = index - 1; i >= 0; --i) {\n const tabStop = state.tabStops[i];\n\n if (!tabStop.disabled) {\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop.id,\n };\n }\n }\n return state;\n },\n\n // Moving to the next row\n // We move to the next row, and we stay in the same column.\n // If we are in the last row, then we move to the first not disabled item of the next column.\n NEXT_ROW(state, currentTabStop) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { rowIndex, columnOffset } = cellCoordinates;\n const nextRow = rowIndex + 1;\n\n /** First try to get the next cell in the current column */\n let tabStop = getCell(gridMap, {\n row: {\n from: nextRow,\n direction: 'asc',\n },\n col: columnOffset,\n });\n\n // If none were found, search for the next cell depending on the loop around parameter\n if (!tabStop) {\n switch (state.loopAround.col) {\n /**\n * If columns are configured to be looped inside,\n * get the first enabled cell of the current column\n */\n case LOOP_AROUND_TYPES.inside:\n tabStop = getCell(gridMap, {\n col: columnOffset,\n row: {\n from: 0,\n direction: 'asc',\n },\n });\n break;\n /**\n * If columns are configured to be go to the next,\n * search for the next enabled cell from the next column\n */\n case LOOP_AROUND_TYPES.nextEnd:\n case LOOP_AROUND_TYPES.nextLoop:\n default:\n tabStop = getCell(gridMap, {\n row: {\n from: 0,\n direction: 'asc',\n },\n col: {\n from: columnOffset + 1,\n direction: 'asc',\n },\n });\n break;\n }\n }\n\n /**\n * If still none is found and the columns are configured to loop\n * search starting from the start\n */\n if (!tabStop && state.loopAround.col === LOOP_AROUND_TYPES.nextLoop) {\n tabStop = getCell(gridMap, {\n row: {\n from: 0,\n direction: 'asc',\n },\n col: {\n from: 0,\n direction: 'asc',\n },\n });\n }\n\n if (tabStop) {\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop.id,\n gridMap,\n };\n }\n\n return { ...state, allowFocusing: true, gridMap };\n },\n\n // Moving to the previous row\n // We move to the previous row, and we stay in the same column.\n // If we are in the first row, then we move to the last not disabled item of the previous column.\n PREVIOUS_ROW(state, currentTabStop) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { rowIndex, columnOffset } = cellCoordinates;\n const previousRow = rowIndex - 1;\n let tabStop;\n /** Search for the previous enabled cell in the current column */\n if (previousRow >= 0) {\n tabStop = getCell(gridMap, {\n row: {\n from: previousRow,\n direction: 'desc',\n },\n col: columnOffset,\n });\n }\n\n // If none were found, search for the previous cell depending on the loop around parameter\n if (!tabStop) {\n switch (state.loopAround.col) {\n /**\n * If columns are configured to be looped inside,\n * get the last enabled cell of the current column\n */\n case LOOP_AROUND_TYPES.inside:\n tabStop = getCell(gridMap, {\n col: columnOffset,\n row: {\n from: -1,\n direction: 'desc',\n },\n });\n break;\n /**\n * If columns are configured to be go to the previous,\n * search for the last enabled cell from the previous column\n */\n case LOOP_AROUND_TYPES.nextEnd:\n case LOOP_AROUND_TYPES.nextLoop:\n default:\n if (columnOffset - 1 >= 0) {\n tabStop = getCell(gridMap, {\n row: {\n from: -1,\n direction: 'desc',\n },\n col: {\n from: columnOffset - 1,\n direction: 'desc',\n },\n });\n break;\n }\n }\n }\n /**\n * If still none is found and the columns are configured to loop\n * search starting from the end\n */\n if (!tabStop && state.loopAround.col === LOOP_AROUND_TYPES.nextLoop) {\n tabStop = getCell(gridMap, {\n row: {\n from: -1,\n direction: 'desc',\n },\n col: {\n from: -1,\n direction: 'desc',\n },\n });\n }\n\n if (tabStop) {\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop.id,\n gridMap,\n };\n }\n\n return { ...state, allowFocusing: true, gridMap };\n },\n // Moving to the very first not disabled item of the list\n VERY_FIRST(state) {\n // The very first not disabled item' index.\n const tabStop = state.tabStops.find(tabStopIsEnabled);\n if (tabStop) {\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop.id,\n };\n }\n return state;\n },\n // Moving to the very last not disabled item of the list\n VERY_LAST(state) {\n // The very last not disabled item' index.\n const tabStop = findLast(state.tabStops, tabStopIsEnabled);\n if (tabStop) {\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop.id,\n };\n }\n return state;\n },\n NEXT_COLUMN(state, currentTabStop, index) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { rowIndex, columnOffset } = cellCoordinates;\n // Parse the current row and look for the next enabled cell\n let tabStop = getCell(gridMap, {\n row: rowIndex,\n col: {\n from: columnOffset + 1,\n direction: 'asc',\n },\n });\n\n // If none were found, search for the next cell depending on the loop around parameter\n if (!tabStop) {\n switch (state.loopAround.row) {\n /**\n * If rows are configured to be looped inside,\n * get the first enabled cell of the current rows\n */\n case LOOP_AROUND_TYPES.inside:\n tabStop = getCell(gridMap, {\n row: rowIndex,\n col: {\n from: 0,\n direction: 'asc',\n },\n });\n break;\n /**\n * If rows are configured to be go to the next,\n * search for the next enabled cell from the next row\n */\n case LOOP_AROUND_TYPES.nextEnd:\n case LOOP_AROUND_TYPES.nextLoop:\n default:\n tabStop = find(state.tabStops, tabStopIsEnabled, index + 1);\n break;\n }\n }\n /**\n * If still none is found and the row are configured to loop\n * search starting from the start\n */\n if (!tabStop && state.loopAround.row === LOOP_AROUND_TYPES.nextLoop) {\n tabStop = find(state.tabStops, tabStopIsEnabled);\n }\n\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop?.id || state.selectedId,\n gridMap,\n };\n },\n PREVIOUS_COLUMN(state, currentTabStop, index) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { rowIndex, columnOffset } = cellCoordinates;\n\n const previousColumn = columnOffset - 1;\n let tabStop;\n\n if (previousColumn >= 0) {\n // Parse the current row and look for the next enable cell\n tabStop = getCell(gridMap, {\n row: rowIndex,\n col: {\n from: previousColumn,\n direction: 'desc',\n },\n });\n }\n if (!tabStop) {\n switch (state.loopAround.row) {\n /**\n * If rows are configured to be looped inside,\n * get the last enabled cell of the current row\n */\n case LOOP_AROUND_TYPES.inside:\n tabStop = getCell(gridMap, {\n row: rowIndex,\n col: {\n from: -1,\n direction: 'desc',\n },\n });\n break;\n /**\n * If rows are configured to be go to the next,\n * search for the previous enabled cell from the previous row\n */\n case LOOP_AROUND_TYPES.nextEnd:\n case LOOP_AROUND_TYPES.nextLoop:\n default:\n if (index - 1 >= 0) {\n tabStop = findLast(state.tabStops, tabStopIsEnabled, index - 1);\n }\n break;\n }\n }\n /**\n * If still none is found and the rows are configured to loop\n * search starting from the end\n */\n if (!tabStop && state.loopAround.row === LOOP_AROUND_TYPES.nextLoop) {\n tabStop = findLast(state.tabStops, tabStopIsEnabled);\n }\n\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop?.id || state.selectedId,\n gridMap,\n };\n },\n FIRST_IN_COLUMN(state, currentTabStop) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { columnOffset } = cellCoordinates;\n\n const tabStop = getCell(gridMap, {\n col: columnOffset,\n row: {\n from: 0,\n direction: 'asc',\n },\n });\n\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop?.id || state.selectedId,\n gridMap,\n };\n },\n LAST_IN_COLUMN(state, currentTabStop) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { columnOffset } = cellCoordinates;\n\n const tabStop = getCell(gridMap, {\n col: columnOffset,\n row: {\n from: -1,\n direction: 'desc',\n },\n });\n\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop?.id || state.selectedId,\n gridMap,\n };\n },\n // Moving to the first item in row\n FIRST_IN_ROW(state, currentTabStop) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { rowIndex } = cellCoordinates;\n\n const tabStop = getCell(gridMap, {\n row: rowIndex,\n col: {\n from: 0,\n direction: 'asc',\n },\n });\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop?.id || state.selectedId,\n gridMap,\n };\n },\n // Moving to the last item in row\n LAST_IN_ROW(state, currentTabStop) {\n const currentRowKey = currentTabStop.rowKey;\n if (isNil(currentRowKey)) {\n return state;\n }\n const gridMap = state.gridMap || createGridMap(state.tabStops);\n const cellCoordinates = getCellCoordinates(gridMap, currentTabStop);\n if (!cellCoordinates) {\n return state;\n }\n const { rowIndex } = cellCoordinates;\n\n const tabStop = getCell(gridMap, {\n row: rowIndex,\n col: {\n from: -1,\n direction: 'desc',\n },\n });\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop?.id || state.selectedId,\n gridMap,\n };\n },\n};\n\n/** Handle `KEY_NAV` action to update */\nexport const KEY_NAV: Reducer<KeyNavAction> = (state, action) => {\n const { id = state.selectedId || state.tabStops[0]?.id, key, ctrlKey } = action.payload;\n const index = state.tabStops.findIndex((tabStop) => tabStop.id === id);\n if (index === -1) {\n // tab stop not registered\n return state;\n }\n const currentTabStop = state.tabStops[index];\n if (currentTabStop.disabled) {\n return state;\n }\n\n const isGrid = currentTabStop.rowKey !== null;\n const isFirst = index === state.tabStops.findIndex(tabStopIsEnabled);\n const isLast = index === findLastIndex(state.tabStops, tabStopIsEnabled);\n // Translates the user key down event info into a navigation instruction.\n let navigation: Navigation | null = null;\n // eslint-disable-next-line default-case\n switch (key) {\n case 'ArrowLeft':\n if (isGrid) {\n navigation = 'PREVIOUS_COLUMN';\n } else if (state.direction === 'horizontal' || state.direction === 'both') {\n navigation =\n shouldLoopListHorizontally(state.direction, state.loopAround) && isFirst ? 'VERY_LAST' : 'PREVIOUS';\n }\n break;\n case 'ArrowRight':\n if (isGrid) {\n navigation = 'NEXT_COLUMN';\n } else if (state.direction === 'horizontal' || state.direction === 'both') {\n navigation =\n shouldLoopListHorizontally(state.direction, state.loopAround) && isLast ? 'VERY_FIRST' : 'NEXT';\n }\n break;\n case 'ArrowUp':\n if (isGrid) {\n navigation = 'PREVIOUS_ROW';\n } else if (state.direction === 'vertical' || state.direction === 'both') {\n navigation =\n shouldLoopListVertically(state.direction, state.loopAround) && isFirst ? 'VERY_LAST' : 'PREVIOUS';\n }\n break;\n case 'ArrowDown':\n if (isGrid) {\n navigation = 'NEXT_ROW';\n } else if (state.direction === 'vertical' || state.direction === 'both') {\n navigation =\n shouldLoopListVertically(state.direction, state.loopAround) && isLast ? 'VERY_FIRST' : 'NEXT';\n }\n break;\n case 'Home':\n if (isGrid && !ctrlKey) {\n navigation = state.gridJumpToShortcutDirection === 'vertical' ? 'FIRST_IN_COLUMN' : 'FIRST_IN_ROW';\n } else {\n navigation = 'VERY_FIRST';\n }\n break;\n case 'End':\n if (isGrid && !ctrlKey) {\n navigation = state.gridJumpToShortcutDirection === 'vertical' ? 'LAST_IN_COLUMN' : 'LAST_IN_ROW';\n } else {\n navigation = 'VERY_LAST';\n }\n break;\n }\n\n if (!navigation) {\n return state;\n }\n\n const newState = MOVES[navigation](state, currentTabStop, index);\n\n return { ...newState, isUsingKeyboard: true };\n};\n","import findLast from 'lodash/findLast';\nimport findLastIndex from 'lodash/findLastIndex';\n\nimport {\n Reducer,\n RegisterAction,\n ResetSelectedTabStopAction,\n SelectTabStopAction,\n SetAllowFocusingAction,\n State,\n UnregisterAction,\n UpdateTabStopAction,\n} from '../types';\nimport { tabStopIsEnabled } from '../utils';\n\n/** Determine the updated value for selectedId: */\nexport const getUpdatedSelectedId = (\n tabStops: State['tabStops'],\n currentSelectedId: State['selectedId'],\n defaultSelectedId: State['selectedId'] = null,\n): State['selectedId'] => {\n // Get tab stop by id\n const tabStop = currentSelectedId && tabStops.find((ts) => ts.id === currentSelectedId && !ts.disabled);\n if (!tabStop) {\n // Fallback to default selected id if available, or first enabled tab stop if not\n return tabStops.find((ts) => ts.id === defaultSelectedId)?.id || tabStops.find(tabStopIsEnabled)?.id || null;\n }\n return tabStop?.id || defaultSelectedId;\n};\n\n/** Handle `REGISTER_TAB_STOP` action registering a new tab stop. */\nexport const REGISTER_TAB_STOP: Reducer<RegisterAction> = (state, action) => {\n const newTabStop = action.payload;\n const newTabStopElement = newTabStop.domElementRef.current;\n\n if (!newTabStopElement) {\n return state;\n }\n\n // Find index of tab stop that\n const indexToInsertAt = findLastIndex(state.tabStops, (tabStop) => {\n if (tabStop.id === newTabStop.id) {\n // tab stop already registered\n return false;\n }\n const domTabStop = tabStop.domElementRef.current;\n\n // New tab stop is following the current tab stop\n return domTabStop?.compareDocumentPosition(newTabStopElement) === Node.DOCUMENT_POSITION_FOLLOWING;\n });\n const insertIndex = indexToInsertAt + 1;\n\n // Insert new tab stop at position `indexToInsertAt`.\n const newTabStops = [...state.tabStops];\n newTabStops.splice(insertIndex, 0, newTabStop);\n\n // Handle autofocus if needed\n let { selectedId, allowFocusing } = state;\n if (\n (state.autofocus === 'first' && insertIndex === 0) ||\n (state.autofocus === 'last' && insertIndex === newTabStops.length - 1) ||\n newTabStop.autofocus\n ) {\n allowFocusing = true;\n selectedId = newTabStop.id;\n }\n\n const newSelectedId =\n newTabStop.id === state.defaultSelectedId && !newTabStop.disabled\n ? newTabStop.id\n : getUpdatedSelectedId(newTabStops, selectedId, state.defaultSelectedId);\n\n return {\n ...state,\n /**\n * If the tab currently being registered is enabled and set as default selected,\n * set as selected.\n *\n */\n selectedId: newSelectedId,\n tabStops: newTabStops,\n gridMap: null,\n allowFocusing,\n };\n};\n\n/** Handle `UNREGISTER_TAB_STOP` action un-registering a new tab stop. */\nexport const UNREGISTER_TAB_STOP: Reducer<UnregisterAction> = (state, action) => {\n const { id } = action.payload;\n const newTabStops = state.tabStops.filter((tabStop) => tabStop.id !== id);\n if (newTabStops.length === state.tabStops.length) {\n // tab stop already unregistered\n return state;\n }\n\n /** Get the previous enabled tab stop */\n const previousTabStopIndex = state.tabStops.findIndex(\n (tabStop) => tabStop.id === state.selectedId && tabStopIsEnabled(tabStop),\n );\n\n const newLocal = previousTabStopIndex - 1 > -1;\n const previousTabStop = newLocal ? findLast(newTabStops, tabStopIsEnabled, previousTabStopIndex - 1) : undefined;\n\n return {\n ...state,\n /** Set the focus on either the previous tab stop if found or the one set as default */\n selectedId: getUpdatedSelectedId(newTabStops, state.selectedId, previousTabStop?.id || state.defaultSelectedId),\n tabStops: newTabStops,\n gridMap: null,\n };\n};\n\n/** Handle `UPDATE_TAB_STOP` action updating properties of a tab stop. */\nexport const UPDATE_TAB_STOP: Reducer<UpdateTabStopAction> = (state, action) => {\n const { id, rowKey, disabled } = action.payload;\n const index = state.tabStops.findIndex((tabStop) => tabStop.id === id);\n if (index === -1) {\n // tab stop not registered\n return state;\n }\n\n const tabStop = state.tabStops[index];\n if (tabStop.disabled === disabled && tabStop.rowKey === rowKey) {\n // Nothing to do so short-circuit.\n return state;\n }\n\n const newTabStop = { ...tabStop, rowKey, disabled };\n const newTabStops = [...state.tabStops];\n newTabStops.splice(index, 1, newTabStop);\n\n return {\n ...state,\n selectedId: getUpdatedSelectedId(newTabStops, state.selectedId, state.defaultSelectedId),\n tabStops: newTabStops,\n gridMap: null,\n };\n};\n\n/** Handle `SELECT_TAB_STOP` action selecting a tab stop. */\nexport const SELECT_TAB_STOP: Reducer<SelectTabStopAction> = (state, action) => {\n const { id, type } = action.payload;\n\n const tabStop = state.tabStops.find((ts) => ts.id === id);\n if (!tabStop || tabStop.disabled) {\n return state;\n }\n\n return {\n ...state,\n allowFocusing: true,\n selectedId: tabStop.id,\n isUsingKeyboard: type === 'keyboard',\n };\n};\n\nexport const SET_ALLOW_FOCUSING: Reducer<SetAllowFocusingAction> = (state, action) => {\n return {\n ...state,\n selectedId: getUpdatedSelectedId(state.tabStops, null, state.defaultSelectedId),\n allowFocusing: action.payload.allow,\n isUsingKeyboard: Boolean(action.payload.isKeyboardNavigation),\n };\n};\n\n/** Handle `RESET_SELECTED_TAB_STOP` action reseting the selected tab stop. */\nexport const RESET_SELECTED_TAB_STOP: Reducer<ResetSelectedTabStopAction> = (state) => {\n return {\n ...state,\n allowFocusing: false,\n selectedId: getUpdatedSelectedId(state.tabStops, null, state.defaultSelectedId),\n defaultSelectedId: getUpdatedSelectedId(state.tabStops, null, state.defaultSelectedId),\n isUsingKeyboard: false,\n };\n};\n","import findLast from 'lodash/findLast';\n\nimport { Action, OptionsUpdatedAction, Reducer, State } from '../types';\nimport { buildLoopAroundObject, tabStopIsEnabled } from '../utils';\nimport { KEY_NAV } from './keyboard-navigation';\nimport {\n REGISTER_TAB_STOP,\n UNREGISTER_TAB_STOP,\n UPDATE_TAB_STOP,\n SELECT_TAB_STOP,\n SET_ALLOW_FOCUSING,\n RESET_SELECTED_TAB_STOP,\n} from './tab-stop';\n\nexport const INITIAL_STATE: State = {\n selectedId: null,\n allowFocusing: false,\n tabStops: [],\n direction: 'horizontal',\n loopAround: buildLoopAroundObject(false),\n gridMap: null,\n defaultSelectedId: null,\n autofocus: undefined,\n isUsingKeyboard: false,\n};\n\nconst OPTIONS_UPDATED: Reducer<OptionsUpdatedAction> = (state, action) => {\n const { autofocus } = action.payload;\n let { selectedId, allowFocusing } = state;\n\n // Update selectedId when updating the `autofocus` option.\n if (!state.autofocus && autofocus) {\n if (autofocus === 'first') {\n selectedId = state.tabStops.find(tabStopIsEnabled)?.id || null;\n } else if (autofocus === 'last') {\n selectedId = findLast(state.tabStops, tabStopIsEnabled)?.id || null;\n }\n allowFocusing = true;\n }\n\n return {\n ...state,\n ...action.payload,\n selectedId,\n allowFocusing: action.payload.allowFocusing || allowFocusing,\n loopAround: buildLoopAroundObject(action.payload.loopAround),\n };\n};\n\n/** Reducers for each action type: */\nconst REDUCERS: { [Type in Action['type']]: Reducer<Extract<Action, { type: Type }>> } = {\n REGISTER_TAB_STOP,\n UNREGISTER_TAB_STOP,\n UPDATE_TAB_STOP,\n SELECT_TAB_STOP,\n OPTIONS_UPDATED,\n KEY_NAV,\n SET_ALLOW_FOCUSING,\n RESET_SELECTED_TAB_STOP,\n};\n\n/** Main reducer */\nexport const reducer: Reducer<Action> = (state, action) => {\n return REDUCERS[action.type]?.(state, action as any) || state;\n};\n","import React from 'react';\n\nimport noop from 'lodash/noop';\n\nimport { INITIAL_STATE } from '../../ducks/slice';\nimport { Action, State } from '../../types';\n\nexport type MovingFocusContext = Readonly<{\n state: State;\n dispatch: React.Dispatch<Action>;\n}>;\n\nexport const MovingFocusContext = React.createContext<MovingFocusContext>({\n state: INITIAL_STATE,\n dispatch: noop,\n});\n","import React, { useEffect } from 'react';\n\nimport { MovingFocusContext } from '../../components/MovingFocusProvider/context';\nimport { BaseHookOptions } from '../../types';\nimport { getPointerTypeFromEvent } from '../../utils';\n\n/**\n * Hook options\n */\ntype Options = [\n /** The DOM id of the tab stop. */\n id: string,\n ...baseOptions: BaseHookOptions,\n];\n\n/**\n * Hook to use in tab stop element of a virtual focus (ex: options of a listbox in a combobox).\n *\n * @returns true if the current tab stop has virtual focus\n */\nexport const useVirtualFocus: (...args: Options) => boolean = (\n id,\n domElementRef,\n disabled = false,\n rowKey = null,\n autofocus = false,\n) => {\n const isMounted = React.useRef(false);\n const { state, dispatch } = React.useContext(MovingFocusContext);\n\n // Register the tab stop on mount and unregister it on unmount:\n React.useEffect(\n () => {\n const { current: domElement } = domElementRef;\n if (!domElement) {\n return undefined;\n }\n // Select tab stop on click\n const onClick = (event?: PointerEvent | Event) => {\n dispatch({\n type: 'SELECT_TAB_STOP',\n payload: { id, type: getPointerTypeFromEvent(event) },\n });\n };\n domElement.addEventListener('click', onClick);\n\n // Register tab stop in context\n dispatch({ type: 'REGISTER_TAB_STOP', payload: { id, domElementRef, rowKey, disabled, autofocus } });\n\n return () => {\n domElement.removeEventListener('click', onClick);\n dispatch({ type: 'UNREGISTER_TAB_STOP', payload: { id } });\n };\n },\n /**\n * Pass the list key as dependency to make tab stops\n * re-register when it changes.\n */\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [state.listKey],\n );\n\n /*\n * Update the tab stop data if `rowKey` or `disabled` change.\n * The isMounted flag is used to prevent this effect running on mount, which is benign but redundant (as the\n * REGISTER_TAB_STOP action would have just been dispatched).\n */\n React.useEffect(\n () => {\n if (isMounted.current) {\n dispatch({ type: 'UPDATE_TAB_STOP', payload: { id, rowKey, disabled } });\n } else {\n isMounted.current = true;\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [disabled, rowKey],\n );\n\n const isActive = id === state.selectedId;\n\n // Scroll element into view when highlighted\n useEffect(() => {\n const { current } = domElementRef;\n if (isActive && current && current.scrollIntoView) {\n /**\n * In some cases, the selected item is contained in a popover\n * that won't be immediately set in the correct position.\n * Setting a small timeout before scroll the item into view\n * leaves it time to settle at the correct position.\n */\n const timeout = setTimeout(() => {\n current.scrollIntoView({ block: 'nearest' });\n }, 10);\n\n return () => {\n clearTimeout(timeout);\n };\n }\n\n return undefined;\n }, [domElementRef, isActive]);\n\n const focused = isActive && state.allowFocusing;\n\n // Determine if the current tab stop is the currently active one:\n return focused;\n};\n","import {\n ComboboxOptionProps,\n NodeOption,\n RegisteredComboboxAction,\n RegisteredComboboxOption,\n RegisteredComboboxOptionValue,\n StringOption,\n} from './types';\n\n/** Generate the combobox option id from the combobox id and the given id */\nexport const generateOptionId = (comboboxId: string, optionId: string | number) => `${comboboxId}-option-${optionId}`;\n\n/** Verifies that the combobox registered option is an action */\nexport const isComboboxAction = (option?: RegisteredComboboxOption): option is RegisteredComboboxAction =>\n Boolean(option?.isAction);\n\n/** Verifies that the combobox registered option is the option's value */\nexport const isComboboxValue = (option?: RegisteredComboboxOption): option is RegisteredComboboxOptionValue => {\n return !isComboboxAction(option);\n};\n\n/** Whether the given option has a string as child */\nexport const isStringOptionComponent = (option: ComboboxOptionProps): option is StringOption => {\n const { children } = option;\n\n return Boolean(typeof children === 'string' || typeof children === 'number');\n};\n\n/** Whether the given option has an unknown react element as child */\nexport const isNodeOptionComponent = (option: ComboboxOptionProps): option is NodeOption => {\n return !isStringOptionComponent(option);\n};\n","import uniqueId from 'lodash/uniqueId';\n\nimport {\n AddOptionAction,\n CloseComboboxAction,\n ComboboxAction,\n ComboboxReducer,\n ComboboxState,\n OpenComboboxAction,\n RemoveOptionAction,\n SetInputValueAction,\n} from '../types';\nimport { isComboboxAction, isComboboxValue } from '../utils';\n\nconst comboboxId = `combobox-${uniqueId()}`;\nexport const initialState: ComboboxState = {\n comboboxId,\n listboxId: `${comboboxId}-popover`,\n status: 'idle',\n isOpen: false,\n inputValue: '',\n showAll: true,\n options: {},\n type: 'listbox',\n optionsLength: 0,\n};\n\n/** Actions when the combobox opens. */\nconst OPEN_COMBOBOX: ComboboxReducer<OpenComboboxAction> = (state, action) => {\n const { manual } = action.payload || {};\n // If the combobox was manually opened, show all suggestions\n return {\n ...state,\n showAll: Boolean(manual),\n isOpen: true,\n };\n};\n\n/** Actions when the combobox closes */\nconst CLOSE_COMBOBOX: ComboboxReducer<CloseComboboxAction> = (state) => {\n return {\n ...state,\n showAll: true,\n isOpen: false,\n };\n};\n\n/** Actions on input update. */\nconst SET_INPUT_VALUE: ComboboxReducer<SetInputValueAction> = (state, action) => {\n return {\n ...state,\n inputValue: action.payload,\n // When the user is changing the value, show only values that are related to the input value.\n showAll: false,\n isOpen: true,\n };\n};\n\n/** Register an option to the state */\nconst ADD_OPTION: ComboboxReducer<AddOptionAction> = (state, action) => {\n const { id, option } = action.payload;\n const { options } = state;\n\n if (options[id]) {\n // Option already exists, return state unchanged\n return state;\n }\n\n const newOptions = {\n ...options,\n [id]: option,\n };\n\n let newType = state.type;\n if (isComboboxAction(option)) {\n newType = 'grid';\n }\n\n let newOptionsLength = state.optionsLength;\n if (isComboboxValue(option)) {\n newOptionsLength += 1;\n }\n\n return {\n ...state,\n options: newOptions,\n type: newType,\n optionsLength: newOptionsLength,\n };\n};\n\n/** Remove an option from the state */\nconst REMOVE_OPTION: ComboboxReducer<RemoveOptionAction> = (state, action) => {\n const { id } = action.payload;\n const { options } = state;\n const option = options[id];\n\n if (!options[id]) {\n // Option doesn't exist, return state unchanged\n return state;\n }\n\n const newOptions = { ...options };\n delete newOptions[id];\n\n let newOptionsLength = state.optionsLength;\n if (isComboboxValue(option)) {\n newOptionsLength -= 1;\n }\n\n return {\n ...state,\n options: newOptions,\n optionsLength: newOptionsLength,\n };\n};\n\n/** Reducers for each action type: */\nconst REDUCERS: { [Type in ComboboxAction['type']]: ComboboxReducer<Extract<ComboboxAction, { type: Type }>> } = {\n OPEN_COMBOBOX,\n CLOSE_COMBOBOX,\n SET_INPUT_VALUE,\n ADD_OPTION,\n REMOVE_OPTION,\n};\n\n/** Main reducer */\nexport const reducer: ComboboxReducer<ComboboxAction> = (state, action) => {\n return REDUCERS[action.type]?.(state, action as any) || state;\n};\n\n/** Dispatch for the combobox component */\nexport type ComboboxDispatch = React.Dispatch<ComboboxAction>;\n","import React from 'react';\n\nimport noop from 'lodash/noop';\n\nimport { TextFieldProps } from '@lumx/react';\n\nimport { ComboboxDispatch, initialState } from '../ducks/reducer';\nimport type {\n ComboboxProps,\n ComboboxSelectionType,\n OnComboboxSelect,\n ComboboxTranslations,\n ComboboxState,\n} from '../types';\n\nexport interface ComboboxContextActions {\n onSelect?: OnComboboxSelect;\n onInputChange?: TextFieldProps['onChange'];\n onOpen?: (params: { manual: boolean; currentValue: string }) => void;\n}\n\nexport interface ComboboxContextProps extends ComboboxState, ComboboxContextActions {\n openOnFocus?: ComboboxProps['openOnFocus'];\n openOnClick?: ComboboxProps['openOnClick'];\n optionsLength: number;\n /** The dispatch function to manage the inner state */\n dispatch: ComboboxDispatch;\n /** The ids of the currently selected options */\n selectedIds?: Array<string>;\n /** the type of selection currently configured for the combobox */\n selectionType?: ComboboxSelectionType;\n /**\n * Whether the error state should be displayed when the status is in error.\n */\n showErrorState?: boolean;\n /**\n * Whether the empty state should be displayed when there is no results.\n */\n showEmptyState?: boolean;\n /** translations to be used across the combobox */\n translations: ComboboxTranslations;\n}\n\n/** Context for the Combobox component */\nexport const ComboboxContext = React.createContext<ComboboxContextProps>({\n ...initialState,\n openOnFocus: false,\n openOnClick: false,\n selectionType: 'single',\n optionsLength: 0,\n onSelect: noop,\n onInputChange: noop,\n onOpen: noop,\n dispatch: noop,\n translations: {\n clearLabel: '',\n tryReloadLabel: '',\n showSuggestionsLabel: '',\n noResultsForInputLabel: (input) => input || '',\n loadingLabel: '',\n serviceUnavailableLabel: '',\n nbOptionsLabel: (options) => `${options}`,\n },\n});\n\n/** Context for a combobox section to store its unique id */\nexport const SectionContext = React.createContext<{ sectionId: string; isLoading?: boolean }>({ sectionId: '' });\n","import React, { ReactNode, createContext, useContext } from 'react';\n\nexport interface ComboboxOptionContextValue {\n optionId?: string;\n isKeyboardHighlighted?: boolean;\n}\nexport const ComboboxOptionContext = createContext<ComboboxOptionContextValue>({});\n\ninterface ComboboxOptionIdProviderProps extends Required<ComboboxOptionContextValue> {\n /** Option to display */\n children: ReactNode;\n}\n\n/** Context Provider to store the current combobox option id. */\nexport const ComboboxOptionContextProvider = ({\n optionId,\n isKeyboardHighlighted,\n children,\n}: ComboboxOptionIdProviderProps) => {\n const value = React.useMemo(() => ({ optionId, isKeyboardHighlighted }), [optionId, isKeyboardHighlighted]);\n return <ComboboxOptionContext.Provider value={value}>{children}</ComboboxOptionContext.Provider>;\n};\n\n/**\n * Retrieve the current combobox option id.\n * Must be used within a ComboboxOptionIdProvider\n */\nexport const useComboboxOptionContext = () => {\n const comboboxOption = useContext(ComboboxOptionContext);\n\n if (!comboboxOption?.optionId) {\n throw new Error('This hook must be used within a ComboboxOptionIdProvider');\n }\n\n return comboboxOption as Required<ComboboxOptionContextValue>;\n};\n","import { ReactNode, RefObject, createContext, useContext, useMemo } from 'react';\n\ninterface ComboboxRefsContext {\n triggerRef: RefObject<HTMLElement>;\n anchorRef: RefObject<HTMLElement>;\n}\n\n/** Context to store the refs of the combobox elements */\nconst ComboboxRefsContext = createContext<ComboboxRefsContext>({\n triggerRef: { current: null },\n anchorRef: { current: null },\n});\n\ninterface ComboboxRefsProviderProps extends ComboboxRefsContext {\n children: ReactNode;\n}\n\n/** Provider to store the required refs for the Combobox */\nexport const ComboboxRefsProvider = ({ triggerRef, anchorRef, children }: ComboboxRefsProviderProps) => {\n const value = useMemo(\n () => ({\n triggerRef,\n anchorRef,\n }),\n [triggerRef, anchorRef],\n );\n return <ComboboxRefsContext.Provider value={value}>{children}</ComboboxRefsContext.Provider>;\n};\n\n/** Retrieves the combobox elements references from context */\nexport const useComboboxRefs = () => {\n const refs = useContext(ComboboxRefsContext);\n\n if (!refs) {\n throw new Error('The useComboboxRefs hook must be called within a ComboboxRefsProvider');\n }\n\n return refs;\n};\n","import React from 'react';\n\nimport { TextFieldProps } from '@lumx/react';\nimport { MovingFocusContext } from '@lumx/react/utils';\n\nimport { ComboboxContext } from '../context/ComboboxContext';\nimport { useComboboxRefs } from '../context/ComboboxRefsContext';\nimport { ComboboxOptionSelectEventSource, RegisteredComboboxOption } from '../types';\nimport { isComboboxValue } from '../utils';\n\ntype OnOptionsMounted = (options?: RegisteredComboboxOption[]) => void;\n\n/** Retrieve the current combobox state and actions */\nexport const useCombobox = () => {\n const comboboxContext = React.useContext(ComboboxContext);\n const { dispatch: movingFocusDispatch } = React.useContext(MovingFocusContext);\n const { onSelect, onInputChange, onOpen, dispatch, inputValue, ...contextValues } = comboboxContext;\n const { triggerRef } = useComboboxRefs();\n\n /** Action triggered when the listBox is closed without selecting any option */\n const handleClose = React.useCallback(() => {\n dispatch({ type: 'CLOSE_COMBOBOX' });\n // Reset visual focus\n movingFocusDispatch({ type: 'RESET_SELECTED_TAB_STOP' });\n }, [dispatch, movingFocusDispatch]);\n\n // Handle callbacks on options mounted\n const [optionsMountedCallbacks, setOptionsMountedCallback] = React.useState<Array<OnOptionsMounted>>();\n React.useEffect(() => {\n if (comboboxContext.optionsLength > 0 && optionsMountedCallbacks?.length) {\n const optionsArray = Object.values(comboboxContext.options);\n // Execute callbacks\n for (const callback of optionsMountedCallbacks) {\n callback(optionsArray);\n }\n setOptionsMountedCallback(undefined);\n }\n }, [comboboxContext.options, comboboxContext.optionsLength, optionsMountedCallbacks]);\n\n /** Callback for when an option is selected */\n const handleSelected = React.useCallback(\n (option: RegisteredComboboxOption, source?: ComboboxOptionSelectEventSource) => {\n if (option?.isDisabled) {\n return;\n }\n\n if (isComboboxValue(option)) {\n /**\n * We only close the list if the selection type is single.\n * If it is multiple, we want to allow the user to continue\n * selecting multiple options.\n */\n if (comboboxContext.selectionType !== 'multiple') {\n handleClose();\n }\n /** Call parent onSelect callback */\n if (onSelect) {\n onSelect(option);\n }\n }\n\n /** If the option itself has a custom action, also call it */\n if (option?.onSelect) {\n option.onSelect(option, source);\n }\n\n /** Reset focus on input */\n if (triggerRef?.current) {\n triggerRef.current?.focus();\n }\n },\n [comboboxContext.selectionType, handleClose, onSelect, triggerRef],\n );\n\n /** Callback for when the input must be updated */\n const handleInputChange: TextFieldProps['onChange'] = React.useCallback(\n (value, ...args) => {\n // Update the local state\n dispatch({ type: 'SET_INPUT_VALUE', payload: value });\n // If a callback if given, call it with the value\n if (onInputChange) {\n onInputChange(value, ...args);\n }\n // Reset visual focus\n movingFocusDispatch({ type: 'RESET_SELECTED_TAB_STOP' });\n },\n [dispatch, movingFocusDispatch, onInputChange],\n );\n\n /**\n * Open the popover\n *\n * @returns a promise with the updated context once all options are mounted\n */\n const handleOpen = React.useCallback(\n (params?: { manual?: boolean }) => {\n /** update the local state */\n dispatch({ type: 'OPEN_COMBOBOX', payload: params });\n /** If a parent callback was given, trigger it with state information */\n if (onOpen) {\n onOpen({ currentValue: inputValue, manual: Boolean(params?.manual) });\n }\n\n // Promise resolving options on mount\n return new Promise<RegisteredComboboxOption[] | undefined>((resolve) => {\n // Append to the list of callback on options mounted\n setOptionsMountedCallback((callbacks = []) => {\n callbacks.push(resolve);\n return callbacks;\n });\n });\n },\n [dispatch, inputValue, onOpen],\n );\n\n return React.useMemo(\n () => ({\n handleClose,\n handleOpen,\n handleInputChange,\n handleSelected,\n dispatch,\n inputValue,\n ...contextValues,\n }),\n [contextValues, dispatch, handleClose, handleInputChange, handleOpen, handleSelected, inputValue],\n );\n};\n","import { useContext } from 'react';\n\nimport { SectionContext } from '../context/ComboboxContext';\n\n/** Retrieve the current combobox section id */\nexport const useComboboxSectionId = () => {\n return useContext(SectionContext);\n};\n","import React from 'react';\n\nimport { RegisteredComboboxOption } from '../types';\nimport { useCombobox } from './useCombobox';\n\n/**\n * Register the given option to the context\n */\nexport const useRegisterOption = (registerId: string, option: RegisteredComboboxOption, shouldRegister?: boolean) => {\n const { dispatch } = useCombobox();\n\n /** Register the given options */\n React.useEffect(() => {\n if (option && shouldRegister) {\n dispatch({ type: 'ADD_OPTION', payload: { id: registerId, option } });\n }\n\n // Unregister ids if/when the component unmounts or if option changes\n return () => {\n if (option) {\n dispatch({ type: 'REMOVE_OPTION', payload: { id: registerId } });\n }\n };\n }, [dispatch, option, registerId, shouldRegister]);\n};\n"],"names":["DisabledStateContext","React","createContext","state","DisabledStateProvider","children","value","_jsx","Provider","useDisabledStateContext","useContext","EVENT_TYPES","isClickAway","targets","refs","some","ref","target","current","contains","useClickAway","callback","childrenRefs","useEffect","currentRefs","isEmpty","undefined","listener","evt","composedPath","forEach","evtType","document","addEventListener","removeEventListener","ClickAwayAncestorContext","ClickAwayProvider","parentRef","parentContext","currentContext","useMemo","context","addRefs","newChildrenRefs","push","useRef","displayName","A11YLiveMessage","type","atomic","role","hidden","relevant","className","forwardedProps","join","visuallyHidden","PortalContext","container","body","PortalProvider","Portal","enabled","init","useLayoutEffect","teardown","_Fragment","createPortal","createGridMap","tabStops","tabStopsByRowKey","groupBy","rowKeys","reduce","acc","rowKey","isNil","includes","tabStopIsEnabled","tabStop","disabled","LOOP_AROUND_TYPES","nextLoop","nextEnd","inside","CELL_SEARCH_DIRECTION","asc","desc","buildLoopAroundObject","loopAround","newLoopAround","row","col","isNumberCoords","coords","isDirectionCoords","Boolean","from","findCellInCol","gridMap","rowCoords","cellSelector","lastIndex","length","searchIndex","direction","searchCellFunc","findLast","find","rowKeyWithEnabledCell","index","cell","hasCell","cellRowIndex","correctRowIndex","findCellInRow","colCoords","currentRow","parseColsForCell","maxColIndex","maxLength","rowIndex","rowLength","fromIndex","rowWithEnabledCed","getCell","getCellCoordinates","currentRowKey","findIndex","columnOffset","ts","id","shouldLoopListVertically","shouldLoopListHorizontally","getPointerTypeFromEvent","event","pointerType","VERTICAL_NAV_KEYS","HORIZONTAL_NAV_KEYS","KEY_NAV_KEYS","NAV_KEYS","both","vertical","horizontal","MOVES","NEXT","_","i","allowFocusing","selectedId","PREVIOUS","NEXT_ROW","currentTabStop","cellCoordinates","nextRow","PREVIOUS_ROW","previousRow","VERY_FIRST","VERY_LAST","NEXT_COLUMN","PREVIOUS_COLUMN","previousColumn","FIRST_IN_COLUMN","LAST_IN_COLUMN","FIRST_IN_ROW","LAST_IN_ROW","KEY_NAV","action","key","ctrlKey","payload","isGrid","isFirst","isLast","findLastIndex","navigation","gridJumpToShortcutDirection","newState","isUsingKeyboard","getUpdatedSelectedId","currentSelectedId","defaultSelectedId","REGISTER_TAB_STOP","newTabStop","newTabStopElement","domElementRef","indexToInsertAt","domTabStop","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","insertIndex","newTabStops","splice","autofocus","newSelectedId","UNREGISTER_TAB_STOP","filter","previousTabStopIndex","newLocal","previousTabStop","UPDATE_TAB_STOP","SELECT_TAB_STOP","SET_ALLOW_FOCUSING","allow","isKeyboardNavigation","RESET_SELECTED_TAB_STOP","INITIAL_STATE","OPTIONS_UPDATED","REDUCERS","reducer","MovingFocusContext","dispatch","noop","useVirtualFocus","isMounted","domElement","onClick","listKey","isActive","scrollIntoView","timeout","setTimeout","block","clearTimeout","focused","generateOptionId","comboboxId","optionId","isComboboxAction","option","isAction","isComboboxValue","uniqueId","initialState","listboxId","status","isOpen","inputValue","showAll","options","optionsLength","OPEN_COMBOBOX","manual","CLOSE_COMBOBOX","SET_INPUT_VALUE","ADD_OPTION","newOptions","newType","newOptionsLength","REMOVE_OPTION","ComboboxContext","openOnFocus","openOnClick","selectionType","onSelect","onInputChange","onOpen","translations","clearLabel","tryReloadLabel","showSuggestionsLabel","noResultsForInputLabel","input","loadingLabel","serviceUnavailableLabel","nbOptionsLabel","SectionContext","sectionId","ComboboxOptionContext","ComboboxOptionContextProvider","isKeyboardHighlighted","useComboboxOptionContext","comboboxOption","Error","ComboboxRefsContext","triggerRef","anchorRef","ComboboxRefsProvider","useComboboxRefs","useCombobox","comboboxContext","movingFocusDispatch","contextValues","handleClose","useCallback","optionsMountedCallbacks","setOptionsMountedCallback","useState","optionsArray","Object","values","handleSelected","source","isDisabled","focus","handleInputChange","args","handleOpen","params","currentValue","Promise","resolve","callbacks","useComboboxSectionId","useRegisterOption","registerId","shouldRegister"],"mappings":";;;;;;;;;;;;;AAIO,MAAMA,oBAAoB,gBAAGC,cAAK,CAACC,aAAa,CAA4B;AAAEC,EAAAA,KAAK,EAAE;AAAK,CAA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Q,CAAC;AAAEpK,UAAAA,IAAI,EAAE,eAAe;AAAE0H,UAAAA,OAAO,EAAE;AAAEvC,YAAAA,EAAE,EAAE+K;AAAW;AAAE,SAAC,CAAC;AACpE,MAAA;IACJ,CAAC;EACL,CAAC,EAAE,CAAC9F,QAAQ,EAAEkB,MAAM,EAAE4E,UAAU,EAAEC,cAAc,CAAC,CAAC;AACtD;;;;"}
package/index.d.ts CHANGED
@@ -5,8 +5,8 @@ import { GenericProps, HasTheme, HasAriaDisabled as HasAriaDisabled$1, LumxClass
5
5
  export * from '@lumx/core/js/types';
6
6
  import * as React$1 from 'react';
7
7
  import React__default, { ReactNode, SyntheticEvent, ReactElement, MouseEventHandler, KeyboardEventHandler, Ref, RefObject, CSSProperties, ImgHTMLAttributes, AriaAttributes, SetStateAction, Key, ElementType, ComponentProps } from 'react';
8
- import { C as Comp, I as IconButtonProps, T as TextFieldProps, O as Offset, P as Placement, H as HasClassName, J as JSXElement, a as ColorPalette, b as CommonRef, B as BaseButtonProps, c as HasTheme$1, d as HasAriaDisabled, e as HasDisabled, S as Selector, f as ComboboxOptionProps, E as Elevation, F as FitAnchorWidth, g as ColorWithVariants, h as ColorVariant, i as Typography, W as WhiteSpace, j as Size$1, V as VerticalAlignment, A as Alignment, k as HorizontalAlignment$1, l as Orientation, K as Kind$1, G as GlobalSize, m as AspectRatio$1, n as TypographyInterface } from './Tooltip-D7GkxJsY.js';
9
- export { o as BaseSelectProps, p as ButtonSize, q as ComboboxAction, r as ComboboxProps, s as IconButton, t as InputLabel, u as InputLabelProps, L as ListItem, v as ListItemProps, w as ListItemSize, M as MultipleSelection, x as OnComboboxInputChange, y as OnComboboxSelect, z as SingleSelection, D as TextField, N as Tooltip, Q as TooltipPlacement, R as TooltipProps, U as isClickable } from './Tooltip-D7GkxJsY.js';
8
+ import { C as Comp, I as IconButtonProps, T as TextFieldProps, O as Offset, P as Placement, H as HasClassName, J as JSXElement, a as ColorPalette, b as CommonRef, B as BaseButtonProps, c as HasTheme$1, d as HasAriaDisabled, e as HasDisabled, S as Selector, f as ComboboxOptionProps, E as Elevation, F as FitAnchorWidth, g as ColorWithVariants, h as ColorVariant, i as Typography, W as WhiteSpace, j as Size$1, V as VerticalAlignment, A as Alignment, k as HorizontalAlignment$1, l as Orientation, K as Kind$1, G as GlobalSize, m as AspectRatio$1, n as TypographyInterface } from './Tooltip-2RZbmkfM.js';
9
+ export { o as BaseSelectProps, p as ButtonSize, q as ComboboxAction, r as ComboboxProps, s as IconButton, t as InputLabel, u as InputLabelProps, L as ListItem, v as ListItemProps, w as ListItemSize, M as MultipleSelection, x as OnComboboxInputChange, y as OnComboboxSelect, z as SingleSelection, D as TextField, N as Tooltip, Q as TooltipPlacement, R as TooltipProps, U as isClickable } from './Tooltip-2RZbmkfM.js';
10
10
  import * as react_jsx_runtime from 'react/jsx-runtime';
11
11
 
12
12
  /**
package/index.js CHANGED
@@ -16,7 +16,7 @@ import concat from 'lodash/concat.js';
16
16
  import dropRight from 'lodash/dropRight.js';
17
17
  import partition from 'lodash/partition.js';
18
18
  import reduce from 'lodash/reduce.js';
19
- import { u as useDisabledStateContext, a as useComboboxSectionId, b as useCombobox, c as useRegisterOption, g as generateOptionId, M as MovingFocusContext, d as useVirtualFocus, C as ComboboxOptionContextProvider, e as useComboboxOptionContext, f as useComboboxRefs, A as A11YLiveMessage, P as Portal, h as ClickAwayProvider } from './_internal/BSETDrpT.js';
19
+ import { u as useDisabledStateContext, a as useComboboxSectionId, b as useCombobox, c as useRegisterOption, g as generateOptionId, M as MovingFocusContext, d as useVirtualFocus, C as ComboboxOptionContextProvider, e as useComboboxOptionContext, f as useComboboxRefs, A as A11YLiveMessage, P as Portal, h as ClickAwayProvider } from './_internal/BQFZG9jO.js';
20
20
  import isEmpty from 'lodash/isEmpty.js';
21
21
  import { getDisabledState } from '@lumx/core/js/utils/disabledState';
22
22
  import { mdiCloseCircle } from '@lumx/icons/esm/close-circle.js';
package/package.json CHANGED
@@ -6,8 +6,8 @@
6
6
  "url": "https://github.com/lumapps/design-system/issues"
7
7
  },
8
8
  "dependencies": {
9
- "@lumx/core": "^4.3.2-alpha.23",
10
- "@lumx/icons": "^4.3.2-alpha.23",
9
+ "@lumx/core": "^4.3.2-alpha.24",
10
+ "@lumx/icons": "^4.3.2-alpha.24",
11
11
  "@popperjs/core": "^2.5.4",
12
12
  "body-scroll-lock": "^3.1.5",
13
13
  "react-popper": "^2.2.4"
@@ -102,6 +102,6 @@
102
102
  "build:storybook": "storybook build"
103
103
  },
104
104
  "sideEffects": false,
105
- "version": "4.3.2-alpha.23",
105
+ "version": "4.3.2-alpha.24",
106
106
  "stableVersion": "4.3.1"
107
107
  }
package/utils/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from 'react';
2
2
  import React__default, { RefObject, ReactNode, AriaAttributes } from 'react';
3
+ import { q as ComboboxAction, X as ComboboxState, Y as ComboboxReducer, y as OnComboboxSelect, T as TextFieldProps, r as ComboboxProps, Z as ComboboxSelectionType, _ as ComboboxTranslations, $ as BaseLoadingStatus, a0 as RegisteredComboboxOption, a1 as ComboboxOptionSelectEventSource } from '../Tooltip-2RZbmkfM.js';
3
4
  import { Falsy, ObjectValues } from '@lumx/core/js/types';
4
- import { q as ComboboxAction, X as ComboboxState, y as OnComboboxSelect, T as TextFieldProps, r as ComboboxProps, Y as ComboboxSelectionType, Z as ComboboxTranslations, _ as BaseLoadingStatus, $ as RegisteredComboboxOption, a0 as ComboboxOptionSelectEventSource } from '../Tooltip-D7GkxJsY.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { DisabledStateContextValue } from '@lumx/core/js/utils/disabledState';
7
7
  import '@lumx/core/js/constants';
@@ -398,6 +398,9 @@ type Output = [
398
398
  */
399
399
  declare const useRovingTabIndex: (...args: BaseHookOptions) => Output;
400
400
 
401
+ declare const initialState: ComboboxState;
402
+ /** Main reducer */
403
+ declare const reducer: ComboboxReducer<ComboboxAction>;
401
404
  /** Dispatch for the combobox component */
402
405
  type ComboboxDispatch = React.Dispatch<ComboboxAction>;
403
406
 
@@ -579,5 +582,5 @@ declare const useComboboxSectionId: () => {
579
582
  */
580
583
  declare const useRegisterOption: (registerId: string, option: RegisteredComboboxOption, shouldRegister?: boolean) => void;
581
584
 
582
- export { A11YLiveMessage, ClickAwayProvider, ComboboxContext, ComboboxOptionContext, ComboboxOptionContextProvider, ComboboxProvider, ComboboxRefsProvider, DisabledStateProvider, InfiniteScroll, MovingFocusContext, MovingFocusProvider, Portal, PortalProvider, SectionContext, useCombobox, useComboboxButton, useComboboxInput, useComboboxOptionContext, useComboboxRefs, useComboboxSectionId, useComboboxTrigger, useDisabledStateContext, useRegisterOption, useRovingTabIndex, useVirtualFocus, useVirtualFocusParent };
583
- export type { A11YLiveMessageProps, ComboboxContextActions, ComboboxContextProps, ComboboxOptionContextValue, ComboboxProviderProps, InfiniteScrollProps, PortalInit, PortalProps, PortalProviderProps, UseComboboxTriggerArgs };
585
+ export { A11YLiveMessage, ClickAwayProvider, ComboboxContext, initialState as ComboboxInitialState, ComboboxOptionContext, ComboboxOptionContextProvider, ComboboxProvider, reducer as ComboboxReducer, ComboboxRefsProvider, DisabledStateProvider, InfiniteScroll, MovingFocusContext, MovingFocusProvider, Portal, PortalProvider, SectionContext, useCombobox, useComboboxButton, useComboboxInput, useComboboxOptionContext, useComboboxRefs, useComboboxSectionId, useComboboxTrigger, useDisabledStateContext, useRegisterOption, useRovingTabIndex, useVirtualFocus, useVirtualFocusParent };
586
+ export type { A11YLiveMessageProps, ComboboxContextActions, ComboboxContextProps, ComboboxDispatch, ComboboxOptionContextValue, ComboboxProviderProps, InfiniteScrollProps, PortalInit, PortalProps, PortalProviderProps, UseComboboxTriggerArgs };
package/utils/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { r as reducer, I as INITIAL_STATE, i as buildLoopAroundObject, M as MovingFocusContext, N as NAV_KEYS, j as getPointerTypeFromEvent, k as ComboboxContext, l as isComboboxValue } from '../_internal/BSETDrpT.js';
2
- export { A as A11YLiveMessage, h as ClickAwayProvider, m as ComboboxOptionContext, C as ComboboxOptionContextProvider, n as ComboboxRefsProvider, D as DisabledStateProvider, P as Portal, o as PortalProvider, S as SectionContext, b as useCombobox, e as useComboboxOptionContext, f as useComboboxRefs, a as useComboboxSectionId, u as useDisabledStateContext, c as useRegisterOption, d as useVirtualFocus } from '../_internal/BSETDrpT.js';
1
+ import { r as reducer, I as INITIAL_STATE, i as buildLoopAroundObject, M as MovingFocusContext, N as NAV_KEYS, j as getPointerTypeFromEvent, k as ComboboxContext, l as isComboboxValue } from '../_internal/BQFZG9jO.js';
2
+ export { A as A11YLiveMessage, h as ClickAwayProvider, m as ComboboxInitialState, n as ComboboxOptionContext, C as ComboboxOptionContextProvider, o as ComboboxReducer, p as ComboboxRefsProvider, D as DisabledStateProvider, P as Portal, q as PortalProvider, S as SectionContext, b as useCombobox, e as useComboboxOptionContext, f as useComboboxRefs, a as useComboboxSectionId, u as useDisabledStateContext, c as useRegisterOption, d as useVirtualFocus } from '../_internal/BQFZG9jO.js';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
  import React__default, { useEffect } from 'react';
5
5
  import debounce from 'lodash/debounce.js';