@vibe/core 4.5.28-alpha-871ee.0 → 4.5.28
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.
- package/dist/components/combobox/dist/Combobox/Combobox.js +2 -0
- package/dist/components/combobox/dist/Combobox/Combobox.js.map +1 -0
- package/dist/components/combobox/dist/Combobox/Combobox.module.scss.js +2 -0
- package/dist/components/combobox/dist/Combobox/ComboboxHelpers/ComboboxHelpers.js +2 -0
- package/dist/components/combobox/dist/Combobox/ComboboxHelpers/ComboboxHelpers.js.map +1 -0
- package/dist/components/combobox/dist/Combobox/ComboboxHelpers/ComboboxHelpers.module.scss.js +2 -0
- package/dist/{mocked_classnames/src/components → components/combobox/dist}/Combobox/ComboboxService.js +1 -1
- package/dist/components/combobox/dist/Combobox/ComboboxService.js.map +1 -0
- package/dist/components/combobox/dist/Combobox/components/ComboboxCategory/ComboboxCategory.js +2 -0
- package/dist/components/combobox/dist/Combobox/components/ComboboxCategory/ComboboxCategory.js.map +1 -0
- package/dist/components/combobox/dist/Combobox/components/ComboboxCategory/ComboboxCategory.module.scss.js +2 -0
- package/dist/components/combobox/dist/Combobox/components/ComboboxConstants.js +2 -0
- package/dist/components/combobox/dist/Combobox/components/ComboboxConstants.js.map +1 -0
- package/dist/components/combobox/dist/Combobox/components/ComboboxItems/ComboboxItems.js +2 -0
- package/dist/components/combobox/dist/Combobox/components/ComboboxItems/ComboboxItems.js.map +1 -0
- package/dist/components/combobox/dist/Combobox/components/ComboboxItems/ComboboxItems.module.scss.js +2 -0
- package/dist/components/combobox/dist/Combobox/components/ComboboxOption/ComboboxOption.js +2 -0
- package/dist/components/combobox/dist/Combobox/components/ComboboxOption/ComboboxOption.js.map +1 -0
- package/dist/components/combobox/dist/Combobox/components/ComboboxOption/ComboboxOption.module.scss.js +2 -0
- package/dist/{mocked_classnames/src/components → components/combobox/dist}/Combobox/components/StickyCategoryHeader/StickyCategoryHeader.js +1 -1
- package/dist/components/combobox/dist/Combobox/components/StickyCategoryHeader/StickyCategoryHeader.js.map +1 -0
- package/dist/components/combobox/dist/Combobox/components/StickyCategoryHeader/StickyCategoryHeader.module.scss.js +2 -0
- package/dist/components/combobox/dist/Combobox/helpers.js +2 -0
- package/dist/components/combobox/dist/Combobox/helpers.js.map +1 -0
- package/dist/components/combobox/dist/_virtual/_tslib.js +2 -0
- package/dist/components/combobox/dist/_virtual/_tslib.js.map +1 -0
- package/dist/components/date-picker/dist/DatePicker/DatePicker.js +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/menu/dist/Menu/MenuItem/components/MenuItemSubMenu/MenuItemSubMenu.js +1 -1
- package/dist/components/menu/dist/Menu/MenuItem/components/MenuItemSubMenu/MenuItemSubMenu.js.map +1 -1
- package/dist/components/table/dist/Table/Table/Table.js +2 -0
- package/dist/components/table/dist/Table/Table/Table.js.map +1 -0
- package/dist/components/table/dist/Table/Table/Table.module.scss.js +2 -0
- package/dist/components/table/dist/Table/Table/TableConsts.js +2 -0
- package/dist/components/table/dist/Table/Table/TableConsts.js.map +1 -0
- package/dist/components/table/dist/Table/Table/tableHelpers.js +2 -0
- package/dist/components/table/dist/Table/Table/tableHelpers.js.map +1 -0
- package/dist/components/table/dist/Table/TableBody/TableBody.js +2 -0
- package/dist/components/table/dist/Table/TableBody/TableBody.js.map +1 -0
- package/dist/components/table/dist/Table/TableBody/TableBody.module.scss.js +2 -0
- package/dist/components/table/dist/Table/TableCell/TableCell.js +2 -0
- package/dist/components/table/dist/Table/TableCell/TableCell.js.map +1 -0
- package/dist/components/table/dist/Table/TableCell/TableCell.module.scss.js +2 -0
- package/dist/components/table/dist/Table/TableCellSkeleton/TableCellSkeleton.js +2 -0
- package/dist/components/table/dist/Table/TableCellSkeleton/TableCellSkeleton.js.map +1 -0
- package/dist/components/table/dist/Table/TableCellSkeleton/TableCellSkeleton.module.scss.js +2 -0
- package/dist/components/table/dist/Table/TableContainer/TableContainer.js +2 -0
- package/dist/components/table/dist/Table/TableContainer/TableContainer.js.map +1 -0
- package/dist/components/table/dist/Table/TableContainer/TableContainer.module.scss.js +2 -0
- package/dist/components/table/dist/Table/TableHeader/TableHeader.js +2 -0
- package/dist/components/table/dist/Table/TableHeader/TableHeader.js.map +1 -0
- package/dist/components/table/dist/Table/TableHeader/TableHeader.module.scss.js +2 -0
- package/dist/components/table/dist/Table/TableHeaderCell/TableHeaderCell.js +2 -0
- package/dist/components/table/dist/Table/TableHeaderCell/TableHeaderCell.js.map +1 -0
- package/dist/components/table/dist/Table/TableHeaderCell/TableHeaderCell.module.scss.js +2 -0
- package/dist/components/table/dist/Table/TableRow/TableRow.js +2 -0
- package/dist/components/table/dist/Table/TableRow/TableRow.js.map +1 -0
- package/dist/components/table/dist/Table/TableRow/TableRow.module.scss.js +2 -0
- package/dist/components/table/dist/Table/TableRowMenu/TableRowMenu.js +2 -0
- package/dist/components/table/dist/Table/TableRowMenu/TableRowMenu.js.map +1 -0
- package/dist/components/table/dist/Table/TableRowMenu/TableRowMenu.module.scss.js +2 -0
- package/dist/components/table/dist/Table/TableVirtualizedBody/TableVirtualizedBody.js +2 -0
- package/dist/components/table/dist/Table/TableVirtualizedBody/TableVirtualizedBody.js.map +1 -0
- package/dist/components/table/dist/Table/TableVirtualizedBody/TableVirtualizedBody.module.scss.js +2 -0
- package/dist/components/table/dist/Table/context/TableContainerContext/TableContainerContext.js +2 -0
- package/dist/components/table/dist/Table/context/TableContainerContext/TableContainerContext.js.map +1 -0
- package/dist/components/table/dist/Table/context/TableContext/TableContext.js +2 -0
- package/dist/components/table/dist/Table/context/TableContext/TableContext.js.map +1 -0
- package/dist/components/table/dist/Table/context/TableRowMenuContext/TableRowMenuContext.js +2 -0
- package/dist/components/table/dist/Table/context/TableRowMenuContext/TableRowMenuContext.js.map +1 -0
- package/dist/components/table/dist/_virtual/_tslib.js +2 -0
- package/dist/components/table/dist/_virtual/_tslib.js.map +1 -0
- package/dist/hooks/dist/useActiveDescendantListFocus/index.js +2 -0
- package/dist/hooks/dist/useActiveDescendantListFocus/index.js.map +1 -0
- package/dist/hooks/dist/useActiveDescendantListFocus/useActiveDescendantListFocusHelpers.js +2 -0
- package/dist/hooks/dist/useActiveDescendantListFocus/useActiveDescendantListFocusHelpers.js.map +1 -0
- package/dist/hooks/dist/useActiveDescendantListFocus/useActiveDescendantListFocusHooks.js +2 -0
- package/dist/hooks/dist/useActiveDescendantListFocus/useActiveDescendantListFocusHooks.js.map +1 -0
- package/dist/hooks/dist/useListenFocusTriggers/index.js.map +1 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/metadata/components.json +10 -18
- package/dist/metadata.json +10 -18
- package/dist/mocked_classnames/components/index.d.ts +2 -2
- package/dist/mocked_classnames/hooks/index.d.ts +1 -1
- package/dist/mocked_classnames/src/components/ListItem/ListItem.js +1 -1
- package/dist/mocked_classnames/src/components/ListItem/ListItem.js.map +1 -1
- package/dist/mocked_classnames/src/index.js +1 -1
- package/dist/src/components/ListItem/ListItem.js +1 -1
- package/dist/src/components/ListItem/ListItem.js.map +1 -1
- package/dist/src/index.js +1 -1
- package/package.json +44 -42
- package/dist/components/Combobox/Combobox.d.ts +0 -163
- package/dist/components/Combobox/Combobox.types.d.ts +0 -3
- package/dist/components/Combobox/ComboboxHelpers/ComboboxHelpers.d.ts +0 -62
- package/dist/components/Combobox/ComboboxService.d.ts +0 -7
- package/dist/components/Combobox/components/ComboboxCategory/ComboboxCategory.d.ts +0 -14
- package/dist/components/Combobox/components/ComboboxConstants.d.ts +0 -239
- package/dist/components/Combobox/components/ComboboxItems/ComboboxItems.d.ts +0 -65
- package/dist/components/Combobox/components/ComboboxOption/ComboboxOption.d.ts +0 -46
- package/dist/components/Combobox/components/StickyCategoryHeader/StickyCategoryHeader.d.ts +0 -6
- package/dist/components/Combobox/helpers.d.ts +0 -1
- package/dist/components/Combobox/index.d.ts +0 -2
- package/dist/components/Table/Table/Table.d.ts +0 -76
- package/dist/components/Table/Table/Table.types.d.ts +0 -1
- package/dist/components/Table/Table/TableConsts.d.ts +0 -14
- package/dist/components/Table/Table/tableHelpers.d.ts +0 -12
- package/dist/components/Table/TableBody/TableBody.d.ts +0 -12
- package/dist/components/Table/TableCell/TableCell.d.ts +0 -14
- package/dist/components/Table/TableCellSkeleton/TableCellSkeleton.d.ts +0 -15
- package/dist/components/Table/TableContainer/TableContainer.d.ts +0 -4
- package/dist/components/Table/TableContainer/TableContainer.types.d.ts +0 -12
- package/dist/components/Table/TableHeader/TableHeader.d.ts +0 -11
- package/dist/components/Table/TableHeaderCell/TableHeaderCell.d.ts +0 -35
- package/dist/components/Table/TableRow/TableRow.d.ts +0 -19
- package/dist/components/Table/TableRowMenu/TableRowMenu.d.ts +0 -4
- package/dist/components/Table/TableRowMenu/TableRowMenu.types.d.ts +0 -12
- package/dist/components/Table/TableVirtualizedBody/TableVirtualizedBody.d.ts +0 -35
- package/dist/components/Table/context/TableContainerContext/TableContainerContext.d.ts +0 -4
- package/dist/components/Table/context/TableContainerContext/TableContainerContext.types.d.ts +0 -9
- package/dist/components/Table/context/TableContext/TableContext.d.ts +0 -4
- package/dist/components/Table/context/TableContext/TableContext.types.d.ts +0 -27
- package/dist/components/Table/context/TableRowMenuContext/TableRowMenuContext.d.ts +0 -4
- package/dist/components/Table/context/TableRowMenuContext/TableRowMenuContext.types.d.ts +0 -23
- package/dist/components/Table/index.d.ts +0 -12
- package/dist/hooks/useActiveDescendantListFocus/index.d.ts +0 -35
- package/dist/hooks/useActiveDescendantListFocus/useActiveDescendantListFocusHelpers.d.ts +0 -8
- package/dist/hooks/useActiveDescendantListFocus/useActiveDescendantListFocusHooks.d.ts +0 -44
- package/dist/hooks/useListenFocusTriggers/index.d.ts +0 -6
- package/dist/mocked_classnames/components/Combobox/Combobox.d.ts +0 -163
- package/dist/mocked_classnames/components/Combobox/Combobox.types.d.ts +0 -3
- package/dist/mocked_classnames/components/Combobox/ComboboxHelpers/ComboboxHelpers.d.ts +0 -62
- package/dist/mocked_classnames/components/Combobox/ComboboxService.d.ts +0 -7
- package/dist/mocked_classnames/components/Combobox/components/ComboboxCategory/ComboboxCategory.d.ts +0 -14
- package/dist/mocked_classnames/components/Combobox/components/ComboboxConstants.d.ts +0 -239
- package/dist/mocked_classnames/components/Combobox/components/ComboboxItems/ComboboxItems.d.ts +0 -65
- package/dist/mocked_classnames/components/Combobox/components/ComboboxOption/ComboboxOption.d.ts +0 -46
- package/dist/mocked_classnames/components/Combobox/components/StickyCategoryHeader/StickyCategoryHeader.d.ts +0 -6
- package/dist/mocked_classnames/components/Combobox/helpers.d.ts +0 -1
- package/dist/mocked_classnames/components/Combobox/index.d.ts +0 -2
- package/dist/mocked_classnames/components/Table/Table/Table.d.ts +0 -76
- package/dist/mocked_classnames/components/Table/Table/Table.types.d.ts +0 -1
- package/dist/mocked_classnames/components/Table/Table/TableConsts.d.ts +0 -14
- package/dist/mocked_classnames/components/Table/Table/tableHelpers.d.ts +0 -12
- package/dist/mocked_classnames/components/Table/TableBody/TableBody.d.ts +0 -12
- package/dist/mocked_classnames/components/Table/TableCell/TableCell.d.ts +0 -14
- package/dist/mocked_classnames/components/Table/TableCellSkeleton/TableCellSkeleton.d.ts +0 -15
- package/dist/mocked_classnames/components/Table/TableContainer/TableContainer.d.ts +0 -4
- package/dist/mocked_classnames/components/Table/TableContainer/TableContainer.types.d.ts +0 -12
- package/dist/mocked_classnames/components/Table/TableHeader/TableHeader.d.ts +0 -11
- package/dist/mocked_classnames/components/Table/TableHeaderCell/TableHeaderCell.d.ts +0 -35
- package/dist/mocked_classnames/components/Table/TableRow/TableRow.d.ts +0 -19
- package/dist/mocked_classnames/components/Table/TableRowMenu/TableRowMenu.d.ts +0 -4
- package/dist/mocked_classnames/components/Table/TableRowMenu/TableRowMenu.types.d.ts +0 -12
- package/dist/mocked_classnames/components/Table/TableVirtualizedBody/TableVirtualizedBody.d.ts +0 -35
- package/dist/mocked_classnames/components/Table/context/TableContainerContext/TableContainerContext.d.ts +0 -4
- package/dist/mocked_classnames/components/Table/context/TableContainerContext/TableContainerContext.types.d.ts +0 -9
- package/dist/mocked_classnames/components/Table/context/TableContext/TableContext.d.ts +0 -4
- package/dist/mocked_classnames/components/Table/context/TableContext/TableContext.types.d.ts +0 -27
- package/dist/mocked_classnames/components/Table/context/TableRowMenuContext/TableRowMenuContext.d.ts +0 -4
- package/dist/mocked_classnames/components/Table/context/TableRowMenuContext/TableRowMenuContext.types.d.ts +0 -23
- package/dist/mocked_classnames/components/Table/index.d.ts +0 -12
- package/dist/mocked_classnames/hooks/useActiveDescendantListFocus/index.d.ts +0 -35
- package/dist/mocked_classnames/hooks/useActiveDescendantListFocus/useActiveDescendantListFocusHelpers.d.ts +0 -8
- package/dist/mocked_classnames/hooks/useActiveDescendantListFocus/useActiveDescendantListFocusHooks.d.ts +0 -44
- package/dist/mocked_classnames/hooks/useListenFocusTriggers/index.d.ts +0 -6
- package/dist/mocked_classnames/src/components/Combobox/Combobox.js +0 -2
- package/dist/mocked_classnames/src/components/Combobox/Combobox.js.map +0 -1
- package/dist/mocked_classnames/src/components/Combobox/Combobox.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Combobox/ComboboxHelpers/ComboboxHelpers.js +0 -2
- package/dist/mocked_classnames/src/components/Combobox/ComboboxHelpers/ComboboxHelpers.js.map +0 -1
- package/dist/mocked_classnames/src/components/Combobox/ComboboxHelpers/ComboboxHelpers.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Combobox/ComboboxService.js.map +0 -1
- package/dist/mocked_classnames/src/components/Combobox/components/ComboboxCategory/ComboboxCategory.js +0 -2
- package/dist/mocked_classnames/src/components/Combobox/components/ComboboxCategory/ComboboxCategory.js.map +0 -1
- package/dist/mocked_classnames/src/components/Combobox/components/ComboboxCategory/ComboboxCategory.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Combobox/components/ComboboxConstants.js +0 -2
- package/dist/mocked_classnames/src/components/Combobox/components/ComboboxConstants.js.map +0 -1
- package/dist/mocked_classnames/src/components/Combobox/components/ComboboxItems/ComboboxItems.js +0 -2
- package/dist/mocked_classnames/src/components/Combobox/components/ComboboxItems/ComboboxItems.js.map +0 -1
- package/dist/mocked_classnames/src/components/Combobox/components/ComboboxItems/ComboboxItems.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Combobox/components/ComboboxOption/ComboboxOption.js +0 -2
- package/dist/mocked_classnames/src/components/Combobox/components/ComboboxOption/ComboboxOption.js.map +0 -1
- package/dist/mocked_classnames/src/components/Combobox/components/ComboboxOption/ComboboxOption.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Combobox/components/StickyCategoryHeader/StickyCategoryHeader.js.map +0 -1
- package/dist/mocked_classnames/src/components/Combobox/components/StickyCategoryHeader/StickyCategoryHeader.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Combobox/helpers.js +0 -2
- package/dist/mocked_classnames/src/components/Combobox/helpers.js.map +0 -1
- package/dist/mocked_classnames/src/components/Table/Table/Table.js +0 -2
- package/dist/mocked_classnames/src/components/Table/Table/Table.js.map +0 -1
- package/dist/mocked_classnames/src/components/Table/Table/Table.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Table/Table/TableConsts.js +0 -2
- package/dist/mocked_classnames/src/components/Table/Table/TableConsts.js.map +0 -1
- package/dist/mocked_classnames/src/components/Table/Table/tableHelpers.js +0 -2
- package/dist/mocked_classnames/src/components/Table/Table/tableHelpers.js.map +0 -1
- package/dist/mocked_classnames/src/components/Table/TableBody/TableBody.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableBody/TableBody.js.map +0 -1
- package/dist/mocked_classnames/src/components/Table/TableBody/TableBody.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableCell/TableCell.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableCell/TableCell.js.map +0 -1
- package/dist/mocked_classnames/src/components/Table/TableCell/TableCell.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableCellSkeleton/TableCellSkeleton.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableCellSkeleton/TableCellSkeleton.js.map +0 -1
- package/dist/mocked_classnames/src/components/Table/TableCellSkeleton/TableCellSkeleton.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableContainer/TableContainer.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableContainer/TableContainer.js.map +0 -1
- package/dist/mocked_classnames/src/components/Table/TableContainer/TableContainer.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableHeader/TableHeader.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableHeader/TableHeader.js.map +0 -1
- package/dist/mocked_classnames/src/components/Table/TableHeader/TableHeader.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableHeaderCell/TableHeaderCell.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableHeaderCell/TableHeaderCell.js.map +0 -1
- package/dist/mocked_classnames/src/components/Table/TableHeaderCell/TableHeaderCell.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableRow/TableRow.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableRow/TableRow.js.map +0 -1
- package/dist/mocked_classnames/src/components/Table/TableRow/TableRow.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableRowMenu/TableRowMenu.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableRowMenu/TableRowMenu.js.map +0 -1
- package/dist/mocked_classnames/src/components/Table/TableRowMenu/TableRowMenu.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableVirtualizedBody/TableVirtualizedBody.js +0 -2
- package/dist/mocked_classnames/src/components/Table/TableVirtualizedBody/TableVirtualizedBody.js.map +0 -1
- package/dist/mocked_classnames/src/components/Table/TableVirtualizedBody/TableVirtualizedBody.module.scss.js +0 -2
- package/dist/mocked_classnames/src/components/Table/context/TableContainerContext/TableContainerContext.js +0 -2
- package/dist/mocked_classnames/src/components/Table/context/TableContainerContext/TableContainerContext.js.map +0 -1
- package/dist/mocked_classnames/src/components/Table/context/TableContext/TableContext.js +0 -2
- package/dist/mocked_classnames/src/components/Table/context/TableContext/TableContext.js.map +0 -1
- package/dist/mocked_classnames/src/components/Table/context/TableRowMenuContext/TableRowMenuContext.js +0 -2
- package/dist/mocked_classnames/src/components/Table/context/TableRowMenuContext/TableRowMenuContext.js.map +0 -1
- package/dist/mocked_classnames/src/hooks/useActiveDescendantListFocus/index.js +0 -2
- package/dist/mocked_classnames/src/hooks/useActiveDescendantListFocus/index.js.map +0 -1
- package/dist/mocked_classnames/src/hooks/useActiveDescendantListFocus/useActiveDescendantListFocusHelpers.js +0 -2
- package/dist/mocked_classnames/src/hooks/useActiveDescendantListFocus/useActiveDescendantListFocusHelpers.js.map +0 -1
- package/dist/mocked_classnames/src/hooks/useActiveDescendantListFocus/useActiveDescendantListFocusHooks.js +0 -2
- package/dist/mocked_classnames/src/hooks/useActiveDescendantListFocus/useActiveDescendantListFocusHooks.js.map +0 -1
- package/dist/mocked_classnames/src/hooks/useListenFocusTriggers/index.js +0 -2
- package/dist/mocked_classnames/src/hooks/useListenFocusTriggers/index.js.map +0 -1
- package/dist/src/components/Combobox/Combobox.js +0 -2
- package/dist/src/components/Combobox/Combobox.js.map +0 -1
- package/dist/src/components/Combobox/Combobox.module.scss.js +0 -2
- package/dist/src/components/Combobox/Combobox.module.scss.js.map +0 -1
- package/dist/src/components/Combobox/ComboboxHelpers/ComboboxHelpers.js +0 -2
- package/dist/src/components/Combobox/ComboboxHelpers/ComboboxHelpers.js.map +0 -1
- package/dist/src/components/Combobox/ComboboxHelpers/ComboboxHelpers.module.scss.js +0 -2
- package/dist/src/components/Combobox/ComboboxHelpers/ComboboxHelpers.module.scss.js.map +0 -1
- package/dist/src/components/Combobox/ComboboxService.js +0 -2
- package/dist/src/components/Combobox/ComboboxService.js.map +0 -1
- package/dist/src/components/Combobox/components/ComboboxCategory/ComboboxCategory.js +0 -2
- package/dist/src/components/Combobox/components/ComboboxCategory/ComboboxCategory.js.map +0 -1
- package/dist/src/components/Combobox/components/ComboboxCategory/ComboboxCategory.module.scss.js +0 -2
- package/dist/src/components/Combobox/components/ComboboxCategory/ComboboxCategory.module.scss.js.map +0 -1
- package/dist/src/components/Combobox/components/ComboboxConstants.js +0 -2
- package/dist/src/components/Combobox/components/ComboboxConstants.js.map +0 -1
- package/dist/src/components/Combobox/components/ComboboxItems/ComboboxItems.js +0 -2
- package/dist/src/components/Combobox/components/ComboboxItems/ComboboxItems.js.map +0 -1
- package/dist/src/components/Combobox/components/ComboboxItems/ComboboxItems.module.scss.js +0 -2
- package/dist/src/components/Combobox/components/ComboboxItems/ComboboxItems.module.scss.js.map +0 -1
- package/dist/src/components/Combobox/components/ComboboxOption/ComboboxOption.js +0 -2
- package/dist/src/components/Combobox/components/ComboboxOption/ComboboxOption.js.map +0 -1
- package/dist/src/components/Combobox/components/ComboboxOption/ComboboxOption.module.scss.js +0 -2
- package/dist/src/components/Combobox/components/ComboboxOption/ComboboxOption.module.scss.js.map +0 -1
- package/dist/src/components/Combobox/components/StickyCategoryHeader/StickyCategoryHeader.js +0 -2
- package/dist/src/components/Combobox/components/StickyCategoryHeader/StickyCategoryHeader.js.map +0 -1
- package/dist/src/components/Combobox/components/StickyCategoryHeader/StickyCategoryHeader.module.scss.js +0 -2
- package/dist/src/components/Combobox/components/StickyCategoryHeader/StickyCategoryHeader.module.scss.js.map +0 -1
- package/dist/src/components/Combobox/helpers.js +0 -2
- package/dist/src/components/Combobox/helpers.js.map +0 -1
- package/dist/src/components/Table/Table/Table.js +0 -2
- package/dist/src/components/Table/Table/Table.js.map +0 -1
- package/dist/src/components/Table/Table/Table.module.scss.js +0 -2
- package/dist/src/components/Table/Table/Table.module.scss.js.map +0 -1
- package/dist/src/components/Table/Table/TableConsts.js +0 -2
- package/dist/src/components/Table/Table/TableConsts.js.map +0 -1
- package/dist/src/components/Table/Table/tableHelpers.js +0 -2
- package/dist/src/components/Table/Table/tableHelpers.js.map +0 -1
- package/dist/src/components/Table/TableBody/TableBody.js +0 -2
- package/dist/src/components/Table/TableBody/TableBody.js.map +0 -1
- package/dist/src/components/Table/TableBody/TableBody.module.scss.js +0 -2
- package/dist/src/components/Table/TableBody/TableBody.module.scss.js.map +0 -1
- package/dist/src/components/Table/TableCell/TableCell.js +0 -2
- package/dist/src/components/Table/TableCell/TableCell.js.map +0 -1
- package/dist/src/components/Table/TableCell/TableCell.module.scss.js +0 -2
- package/dist/src/components/Table/TableCell/TableCell.module.scss.js.map +0 -1
- package/dist/src/components/Table/TableCellSkeleton/TableCellSkeleton.js +0 -2
- package/dist/src/components/Table/TableCellSkeleton/TableCellSkeleton.js.map +0 -1
- package/dist/src/components/Table/TableCellSkeleton/TableCellSkeleton.module.scss.js +0 -2
- package/dist/src/components/Table/TableCellSkeleton/TableCellSkeleton.module.scss.js.map +0 -1
- package/dist/src/components/Table/TableContainer/TableContainer.js +0 -2
- package/dist/src/components/Table/TableContainer/TableContainer.js.map +0 -1
- package/dist/src/components/Table/TableContainer/TableContainer.module.scss.js +0 -2
- package/dist/src/components/Table/TableContainer/TableContainer.module.scss.js.map +0 -1
- package/dist/src/components/Table/TableHeader/TableHeader.js +0 -2
- package/dist/src/components/Table/TableHeader/TableHeader.js.map +0 -1
- package/dist/src/components/Table/TableHeader/TableHeader.module.scss.js +0 -2
- package/dist/src/components/Table/TableHeader/TableHeader.module.scss.js.map +0 -1
- package/dist/src/components/Table/TableHeaderCell/TableHeaderCell.js +0 -2
- package/dist/src/components/Table/TableHeaderCell/TableHeaderCell.js.map +0 -1
- package/dist/src/components/Table/TableHeaderCell/TableHeaderCell.module.scss.js +0 -2
- package/dist/src/components/Table/TableHeaderCell/TableHeaderCell.module.scss.js.map +0 -1
- package/dist/src/components/Table/TableRow/TableRow.js +0 -2
- package/dist/src/components/Table/TableRow/TableRow.js.map +0 -1
- package/dist/src/components/Table/TableRow/TableRow.module.scss.js +0 -2
- package/dist/src/components/Table/TableRow/TableRow.module.scss.js.map +0 -1
- package/dist/src/components/Table/TableRowMenu/TableRowMenu.js +0 -2
- package/dist/src/components/Table/TableRowMenu/TableRowMenu.js.map +0 -1
- package/dist/src/components/Table/TableRowMenu/TableRowMenu.module.scss.js +0 -2
- package/dist/src/components/Table/TableRowMenu/TableRowMenu.module.scss.js.map +0 -1
- package/dist/src/components/Table/TableVirtualizedBody/TableVirtualizedBody.js +0 -2
- package/dist/src/components/Table/TableVirtualizedBody/TableVirtualizedBody.js.map +0 -1
- package/dist/src/components/Table/TableVirtualizedBody/TableVirtualizedBody.module.scss.js +0 -2
- package/dist/src/components/Table/TableVirtualizedBody/TableVirtualizedBody.module.scss.js.map +0 -1
- package/dist/src/components/Table/context/TableContainerContext/TableContainerContext.js +0 -2
- package/dist/src/components/Table/context/TableContainerContext/TableContainerContext.js.map +0 -1
- package/dist/src/components/Table/context/TableContext/TableContext.js +0 -2
- package/dist/src/components/Table/context/TableContext/TableContext.js.map +0 -1
- package/dist/src/components/Table/context/TableRowMenuContext/TableRowMenuContext.js +0 -2
- package/dist/src/components/Table/context/TableRowMenuContext/TableRowMenuContext.js.map +0 -1
- package/dist/src/hooks/useActiveDescendantListFocus/index.js +0 -2
- package/dist/src/hooks/useActiveDescendantListFocus/index.js.map +0 -1
- package/dist/src/hooks/useActiveDescendantListFocus/useActiveDescendantListFocusHelpers.js +0 -2
- package/dist/src/hooks/useActiveDescendantListFocus/useActiveDescendantListFocusHelpers.js.map +0 -1
- package/dist/src/hooks/useActiveDescendantListFocus/useActiveDescendantListFocusHooks.js +0 -2
- package/dist/src/hooks/useActiveDescendantListFocus/useActiveDescendantListFocusHooks.js.map +0 -1
- package/dist/src/hooks/useListenFocusTriggers/index.js.map +0 -1
- /package/dist/{mocked_classnames/src/components → components/combobox/dist}/Combobox/Combobox.module.scss.js.map +0 -0
- /package/dist/{mocked_classnames/src/components → components/combobox/dist}/Combobox/ComboboxHelpers/ComboboxHelpers.module.scss.js.map +0 -0
- /package/dist/{mocked_classnames/src/components → components/combobox/dist}/Combobox/components/ComboboxCategory/ComboboxCategory.module.scss.js.map +0 -0
- /package/dist/{mocked_classnames/src/components → components/combobox/dist}/Combobox/components/ComboboxItems/ComboboxItems.module.scss.js.map +0 -0
- /package/dist/{mocked_classnames/src/components → components/combobox/dist}/Combobox/components/ComboboxOption/ComboboxOption.module.scss.js.map +0 -0
- /package/dist/{mocked_classnames/src/components → components/combobox/dist}/Combobox/components/StickyCategoryHeader/StickyCategoryHeader.module.scss.js.map +0 -0
- /package/dist/{mocked_classnames/src/components → components/table/dist}/Table/Table/Table.module.scss.js.map +0 -0
- /package/dist/{mocked_classnames/src/components → components/table/dist}/Table/TableBody/TableBody.module.scss.js.map +0 -0
- /package/dist/{mocked_classnames/src/components → components/table/dist}/Table/TableCell/TableCell.module.scss.js.map +0 -0
- /package/dist/{mocked_classnames/src/components → components/table/dist}/Table/TableCellSkeleton/TableCellSkeleton.module.scss.js.map +0 -0
- /package/dist/{mocked_classnames/src/components → components/table/dist}/Table/TableContainer/TableContainer.module.scss.js.map +0 -0
- /package/dist/{mocked_classnames/src/components → components/table/dist}/Table/TableHeader/TableHeader.module.scss.js.map +0 -0
- /package/dist/{mocked_classnames/src/components → components/table/dist}/Table/TableHeaderCell/TableHeaderCell.module.scss.js.map +0 -0
- /package/dist/{mocked_classnames/src/components → components/table/dist}/Table/TableRow/TableRow.module.scss.js.map +0 -0
- /package/dist/{mocked_classnames/src/components → components/table/dist}/Table/TableRowMenu/TableRowMenu.module.scss.js.map +0 -0
- /package/dist/{mocked_classnames/src/components → components/table/dist}/Table/TableVirtualizedBody/TableVirtualizedBody.module.scss.js.map +0 -0
- /package/dist/{src/hooks → hooks/dist}/useListenFocusTriggers/index.js +0 -0
package/dist/mocked_classnames/src/components/Table/TableRowMenu/TableRowMenu.module.scss.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e={rowMenuContainer:"rowMenuContainer",small:"small",medium:"medium",large:"large"};!function(e){const n="s_id-6ebd091550ab_4_5_27";if("undefined"!=typeof document){const t=document.head||document.getElementsByTagName("head")[0];if(t.querySelector("#"+n))return;const a=document.createElement("style");a.id=n,t.firstChild?t.insertBefore(a,t.firstChild):t.appendChild(a),a.appendChild(document.createTextNode(e))}else globalThis.injectedStyles&&(globalThis.injectedStyles[n]=e)}(".rowMenuContainer {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-inline: var(--space-8);\n}\n.rowMenuContainer.small {\n padding-block: var(--space-4);\n}\n.rowMenuContainer.medium {\n padding-block: var(--space-8);\n}\n.rowMenuContainer.large {\n padding-block: 12px;\n}");export{e as default};
|
|
2
|
-
//# sourceMappingURL=TableRowMenu.module.scss.js.map
|
package/dist/mocked_classnames/src/components/Table/TableVirtualizedBody/TableVirtualizedBody.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{defineProperty as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{__rest as t}from"../../../../_virtual/_tslib.js";import r,{forwardRef as n,useCallback as o,useEffect as i,useMemo as l}from"react";import a from"../TableBody/TableBody.js";import s from"./TableVirtualizedBody.module.scss.js";import{FixedSizeList as c}from"react-window";import{useTable as d}from"../context/TableContext/TableContext.js";import m from"classnames";import{getTestId as u}from"../../../tests/testIds.js";import{ComponentDefaultTestId as f}from"../../../tests/constants.js";import{RowHeights as v}from"../Table/TableConsts.js";import p from"react-virtualized-auto-sizer";import{useTableRowMenu as b}from"../context/TableRowMenuContext/TableRowMenuContext.js";var T=r.memo((function(e){var n,o=e.style,i=(0,e.rowRenderer)(e.item),l=t(o,["width"]);return r.cloneElement(i,{style:Object.assign(Object.assign({},l),null===(n=i.props)||void 0===n?void 0:n.style)})})),h=n((function(h,E){var g=h.items,w=h.rowRenderer,y=h.onScroll,j=h.columns,R=h.headerRenderer,B=h.id,L=h.className,x=h["data-testid"],z=h.overscanCount,C=void 0===z?1:z,_=d(),I=_.size,O=_.virtualizedListRef,A=_.onVirtualizedListScroll,D=_.markTableAsVirtualized,S=_.dataState,V=b().resetHoveredRow,H=!!j&&!!R,N=(S||{}).isLoading,U=o((function(e){var t=e.target;V(),A({target:t,currentTarget:t})}),[V,A]);i((function(){var e=O.current;if(e)return e.addEventListener("scroll",U),function(){e.removeEventListener("scroll",U)}}),[U,O]);var M=o((function(e){H||null==y||y(e.scrollDirection,e.scrollOffset,e.scrollUpdateWasRequested)}),[y,H]),P=o((function(e){var t=e.index;return H&&0===t?null:r.createElement(T,{item:g[H?t-1:t],rowRenderer:w,style:e.style})}),[g,w,H]);i((function(){H||D()}),[D,H]);var Y=l((function(){return H?n((function(e,n){var o=e.children,i=t(e,["children"]);return r.createElement("div",Object.assign({ref:n},i),R(j),o)})):void 0}),[H,R,j]);return N&&H?r.createElement("div",{ref:E,id:B,className:m(s.tableBody,s.withHeader,L),"data-testid":x||u(f.TABLE_VIRTUALIZED_BODY,B)},R(j),r.createElement(a,null)):r.createElement(a,{className:m(s.tableBody,e({},s.withHeader,H),L),id:B,"data-testid":x||u(f.TABLE_VIRTUALIZED_BODY,B),ref:E},(null==g?void 0:g.length)&&r.createElement(p,null,(function(e){return r.createElement(c,{className:s.tableBodyItems,itemSize:v[I],height:e.height,itemCount:H?g.length+1:g.length,width:e.width,overscanCount:C,onScroll:M,outerRef:function(e){O.current=e},innerElementType:Y},P)})))}));export{h as default};
|
|
2
|
-
//# sourceMappingURL=TableVirtualizedBody.js.map
|
package/dist/mocked_classnames/src/components/Table/TableVirtualizedBody/TableVirtualizedBody.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableVirtualizedBody.js","sources":["../../../../../../src/components/Table/TableVirtualizedBody/TableVirtualizedBody.tsx"],"sourcesContent":["import React, { type ComponentType, forwardRef, useCallback, useEffect, useMemo } from \"react\";\nimport { type VibeComponentProps } from \"../../../types\";\nimport TableBody from \"../TableBody/TableBody\";\nimport styles from \"./TableVirtualizedBody.module.scss\";\nimport { FixedSizeList as List, type ListChildComponentProps, type ScrollDirection } from \"react-window\";\nimport { useTable } from \"../context/TableContext/TableContext\";\nimport cx from \"classnames\";\nimport { getTestId } from \"../../../tests/test-ids-utils\";\nimport { ComponentDefaultTestId } from \"../../../tests/constants\";\nimport { RowHeights } from \"../Table/TableConsts\";\nimport AutoSizer, { type Size as AutoSizerSize } from \"react-virtualized-auto-sizer\";\nimport { useTableRowMenu } from \"../context/TableRowMenuContext/TableRowMenuContext\";\nimport { type TableColumn } from \"../Table/Table\";\n\nexport type TableVirtualizedRow = Record<string, unknown> & { id: string };\n\nexport interface TableVirtualizedBodyProps<T extends TableVirtualizedRow = TableVirtualizedRow>\n extends VibeComponentProps {\n /**\n * The list of items to render in the virtualized table.\n */\n items: T[];\n /**\n * Function to render a row in the table.\n */\n rowRenderer: (item: T) => JSX.Element;\n /**\n * Callback function triggered on scroll.\n */\n onScroll?: (horizontalScrollDirection: ScrollDirection, scrollTop: number, scrollUpdateWasRequested: boolean) => void;\n /**\n * The columns configuration for the table.\n */\n columns?: TableColumn[];\n /**\n * Function to render the table header.\n */\n headerRenderer?: (columns: TableColumn[]) => JSX.Element;\n /**\n * Number of rows to render above/below the visible area.\n */\n overscanCount?: number;\n}\n\nconst MemoizedRow = React.memo(\n <T extends TableVirtualizedRow>({\n item,\n rowRenderer,\n style\n }: {\n item: T;\n rowRenderer: (item: T) => JSX.Element;\n style: React.CSSProperties;\n }) => {\n const element = rowRenderer(item);\n const { width: _width, ...styleWithoutWidth } = style;\n return React.cloneElement(element, {\n style: { ...styleWithoutWidth, ...element.props?.style }\n });\n }\n);\n\nconst TableVirtualizedBody = forwardRef(\n <T extends TableVirtualizedRow = TableVirtualizedRow>(\n {\n items,\n rowRenderer,\n onScroll,\n columns,\n headerRenderer,\n id,\n className,\n \"data-testid\": dataTestId,\n overscanCount = 1\n }: TableVirtualizedBodyProps<T>,\n ref: React.ForwardedRef<HTMLDivElement>\n ) => {\n const { size, virtualizedListRef, onVirtualizedListScroll, markTableAsVirtualized, dataState } = useTable();\n const { resetHoveredRow } = useTableRowMenu();\n const virtualizedWithHeader = !!columns && !!headerRenderer;\n const { isLoading } = dataState || {};\n\n const handleOuterScroll = useCallback(\n (e: Event) => {\n const target = e.target as HTMLDivElement;\n resetHoveredRow();\n onVirtualizedListScroll({\n target,\n currentTarget: target\n } as unknown as React.UIEvent<HTMLDivElement>);\n },\n [resetHoveredRow, onVirtualizedListScroll]\n );\n\n useEffect(() => {\n const scrollElement = virtualizedListRef.current;\n if (!scrollElement) return;\n\n scrollElement.addEventListener(\"scroll\", handleOuterScroll);\n\n return () => {\n scrollElement.removeEventListener(\"scroll\", handleOuterScroll);\n };\n }, [handleOuterScroll, virtualizedListRef]);\n\n const handleVirtualizedVerticalScroll = useCallback(\n ({\n scrollDirection,\n scrollOffset,\n scrollUpdateWasRequested\n }: {\n scrollDirection: ScrollDirection;\n scrollOffset: number;\n scrollUpdateWasRequested: boolean;\n }) => {\n if (virtualizedWithHeader) return;\n onScroll?.(scrollDirection, scrollOffset, scrollUpdateWasRequested);\n },\n [onScroll, virtualizedWithHeader]\n );\n\n const itemRenderer = useCallback<ComponentType<ListChildComponentProps<T>>>(\n ({ index, style }) => {\n if (virtualizedWithHeader && index === 0) {\n return null; //placeholder for virtualized with header\n }\n const currentIndex = virtualizedWithHeader ? index - 1 : index;\n const currentItem = items[currentIndex];\n\n return <MemoizedRow item={currentItem} rowRenderer={rowRenderer} style={style} />;\n },\n [items, rowRenderer, virtualizedWithHeader]\n );\n\n useEffect(() => {\n if (!virtualizedWithHeader) markTableAsVirtualized();\n }, [markTableAsVirtualized, virtualizedWithHeader]);\n\n const memoizedInnerElementType = useMemo(\n () =>\n virtualizedWithHeader\n ? forwardRef(({ children, ...rest }: any, ref: React.Ref<HTMLDivElement>) => (\n <div ref={ref} {...rest}>\n {headerRenderer!(columns!)}\n {children}\n </div>\n ))\n : undefined,\n [virtualizedWithHeader, headerRenderer, columns]\n );\n\n // When in loading state and we have a header renderer, render header separately\n if (isLoading && virtualizedWithHeader) {\n return (\n <div\n ref={ref}\n id={id}\n className={cx(styles.tableBody, styles.withHeader, className)}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.TABLE_VIRTUALIZED_BODY, id)}\n >\n {headerRenderer!(columns!)}\n <TableBody />\n </div>\n );\n }\n\n return (\n <TableBody\n className={cx(\n styles.tableBody,\n {\n [styles.withHeader]: virtualizedWithHeader\n },\n className\n )}\n id={id}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.TABLE_VIRTUALIZED_BODY, id)}\n ref={ref}\n >\n {items?.length && (\n <AutoSizer>\n {({ height, width }: AutoSizerSize) => (\n <List\n className={styles.tableBodyItems}\n itemSize={RowHeights[size]}\n height={height}\n itemCount={virtualizedWithHeader ? items.length + 1 : items.length}\n width={width}\n overscanCount={overscanCount}\n onScroll={handleVirtualizedVerticalScroll}\n outerRef={element => {\n virtualizedListRef.current = element;\n }}\n innerElementType={memoizedInnerElementType}\n >\n {itemRenderer}\n </List>\n )}\n </AutoSizer>\n )}\n </TableBody>\n );\n }\n);\n\nexport default TableVirtualizedBody;\n"],"names":["MemoizedRow","React","memo","_ref","style","element","rowRenderer","item","styleWithoutWidth","__rest","cloneElement","Object","assign","_a","props","TableVirtualizedBody","forwardRef","_ref2","ref","items","onScroll","columns","headerRenderer","id","className","dataTestId","_ref2$overscanCount","overscanCount","_useTable","useTable","size","virtualizedListRef","onVirtualizedListScroll","markTableAsVirtualized","dataState","resetHoveredRow","useTableRowMenu","virtualizedWithHeader","isLoading","handleOuterScroll","useCallback","e","target","currentTarget","useEffect","scrollElement","current","addEventListener","removeEventListener","handleVirtualizedVerticalScroll","_ref4","scrollDirection","scrollOffset","scrollUpdateWasRequested","itemRenderer","_ref5","index","createElement","memoizedInnerElementType","useMemo","children","rest","undefined","cx","styles","tableBody","withHeader","getTestId","ComponentDefaultTestId","TABLE_VIRTUALIZED_BODY","TableBody","_defineProperty","length","AutoSizer","_ref6","List","tableBodyItems","itemSize","RowHeights","height","itemCount","width","outerRef","innerElementType"],"mappings":"0vBA4CA,IAAMA,EAAcC,EAAMC,MACxB,SAAAC,GAQK,MALHC,EAAKD,E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AEjBJ,EAEJ,IAKX"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e={tableBody:"tableBody",tableBodyItems:"tableBodyItems",withHeader:"withHeader"};!function(e){const t="s_id-e63e6a70f113_4_5_27";if("undefined"!=typeof document){const d=document.head||document.getElementsByTagName("head")[0];if(d.querySelector("#"+t))return;const l=document.createElement("style");l.id=t,d.firstChild?d.insertBefore(l,d.firstChild):d.appendChild(l),l.appendChild(document.createTextNode(e))}else globalThis.injectedStyles&&(globalThis.injectedStyles[t]=e)}("/* stylelint-disable */\n/* stylelint-enable */\n.tableBody {\n height: calc(100% - var(--table-row-size));\n}\n.tableBody .tableBodyItems::-webkit-scrollbar {\n width: 6px;\n height: 6px;\n}\n.tableBody .tableBodyItems::-webkit-scrollbar-thumb {\n background-color: var(--ui-border-color);\n border-radius: 4px;\n}\n.tableBody.withHeader {\n height: 100%;\n overflow: hidden;\n}");export{e as default};
|
|
2
|
-
//# sourceMappingURL=TableVirtualizedBody.module.scss.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import r,{useContext as e,createContext as t}from"react";var n=t(void 0),i=function(e){return r.createElement(n.Provider,{value:e.value},e.children)},o=function(){var r=e(n);if(!r)throw Error("useTableContainer must be used within a TableContainerProvider");return r};export{i as TableContainerProvider,o as useTableContainer};
|
|
2
|
-
//# sourceMappingURL=TableContainerContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableContainerContext.js","sources":["../../../../../../../src/components/Table/context/TableContainerContext/TableContainerContext.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\";\nimport {\n type TableContainerContext as ITableContainerContext,\n type TableContainerProviderProps\n} from \"./TableContainerContext.types\";\n\nconst TableContainerContext = createContext<ITableContainerContext | undefined>(undefined);\n\nexport const TableContainerProvider = ({ value, children }: TableContainerProviderProps) => {\n return <TableContainerContext.Provider value={value}>{children}</TableContainerContext.Provider>;\n};\n\nexport const useTableContainer = () => {\n const context = useContext(TableContainerContext);\n if (!context) {\n throw new Error(\"useTableContainer must be used within a TableContainerProvider\");\n }\n return context;\n};\n"],"names":["TableContainerContext","createContext","undefined","TableContainerProvider","_ref","React","createElement","Provider","value","children","useTableContainer","context","useContext","Error"],"mappings":"yDAMA,IAAMA,EAAwBC,OAAkDC,GAEnEC,EAAyB,SAAHC,GACjC,OAAOC,EAAAC,cAACN,EAAsBO,SAAQ,CAACC,MADKJ,EAALI,OAAeJ,EAARK,SAEhD,EAEaC,EAAoB,WAC/B,IAAMC,EAAUC,EAAWZ,GAC3B,IAAKW,EACH,MAAUE,MAAM,kEAElB,OAAOF,CACT"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import r,{useRef as e,useCallback as t,useMemo as n,useContext as o,createContext as l}from"react";var u=l(void 0),c=function(o){var l=o.value,c=o.children,i=l.setIsScrolled,a=e(null),f=e(null),d=e(0),s=t((function(r,e){if(r!==d.current){"body"===e&&a.current&&(a.current.scrollLeft=r),"head"===e&&f.current&&(f.current.scrollLeft=r);var t=r>0;i((function(r){return r!==t?t:r})),d.current=r}}),[i]),v=t((function(r){s(r.target.scrollLeft,"head")}),[s]),b=t((function(r){s(r.target.scrollLeft,"body")}),[s]),h=n((function(){return Object.assign(Object.assign({},l),{headRef:a,onHeadScroll:v,virtualizedListRef:f,onVirtualizedListScroll:b})}),[l,v,b]);return r.createElement(u.Provider,{value:h},c)},i=function(){var r=o(u);if(void 0===r)throw Error("useTable must be used within a TableProvider");return r};export{c as TableProvider,i as useTable};
|
|
2
|
-
//# sourceMappingURL=TableContext.js.map
|
package/dist/mocked_classnames/src/components/Table/context/TableContext/TableContext.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableContext.js","sources":["../../../../../../../src/components/Table/context/TableContext/TableContext.tsx"],"sourcesContent":["import React, { createContext, type UIEventHandler, useCallback, useContext, useMemo, useRef } from \"react\";\nimport { type TableContext as ITableContext, type TableProviderProps } from \"./TableContext.types\";\n\nconst TableContext = createContext<ITableContext | undefined>(undefined);\n\nexport const TableProvider = ({ value, children }: TableProviderProps) => {\n const { setIsScrolled } = value;\n const headRef = useRef<HTMLDivElement>(null);\n const virtualizedListRef = useRef<HTMLDivElement>(null);\n const lastScrollLeft = useRef<number>(0);\n\n const syncScroll = useCallback(\n (newScrollLeft: number, source: \"head\" | \"body\") => {\n if (newScrollLeft === lastScrollLeft.current) return;\n\n if (source === \"body\" && headRef.current) {\n headRef.current.scrollLeft = newScrollLeft;\n }\n if (source === \"head\" && virtualizedListRef.current) {\n virtualizedListRef.current.scrollLeft = newScrollLeft;\n }\n\n const hasScroll = newScrollLeft > 0;\n setIsScrolled(prevScroll => (prevScroll !== hasScroll ? hasScroll : prevScroll));\n\n lastScrollLeft.current = newScrollLeft;\n },\n [setIsScrolled]\n );\n\n const onHeadScroll: UIEventHandler<HTMLDivElement> = useCallback(\n e => {\n const newLeft = (e.target as HTMLDivElement).scrollLeft;\n syncScroll(newLeft, \"head\");\n },\n [syncScroll]\n );\n\n const onVirtualizedListScroll = useCallback<UIEventHandler<HTMLDivElement>>(\n e => {\n const newLeft = (e.target as HTMLDivElement).scrollLeft;\n syncScroll(newLeft, \"body\");\n },\n [syncScroll]\n );\n\n const contextValue = useMemo<ITableContext>(\n () => ({\n ...value,\n headRef,\n onHeadScroll,\n virtualizedListRef,\n onVirtualizedListScroll\n }),\n [value, onHeadScroll, onVirtualizedListScroll]\n );\n\n return <TableContext.Provider value={contextValue}>{children}</TableContext.Provider>;\n};\n\nexport const useTable = () => {\n const context = useContext(TableContext);\n if (context === undefined) {\n throw new Error(\"useTable must be used within a TableProvider\");\n }\n return context;\n};\n"],"names":["TableContext","createContext","undefined","TableProvider","_ref","value","children","setIsScrolled","headRef","useRef","virtualizedListRef","lastScrollLeft","syncScroll","useCallback","newScrollLeft","source","current","scrollLeft","hasScroll","prevScroll","onHeadScroll","e","target","onVirtualizedListScroll","contextValue","useMemo","Object","assign","React","createElement","Provider","useTable","context","useContext","Error"],"mappings":"mGAGA,IAAMA,EAAeC,OAAyCC,GAEjDC,EAAgB,SAAHC,GAA+C,IAAzCC,EAAKD,EAALC,MAAOC,EAAQF,EAARE,SAC7BC,EAAkBF,EAAlBE,cACFC,EAAUC,EAAuB,MACjCC,EAAqBD,EAAuB,MAC5CE,EAAiBF,EAAe,GAEhCG,EAAaC,GACjB,SAACC,EAAuBC,GACtB,GAAID,IAAkBH,EAAeK,QAArC,CAEe,SAAXD,GAAqBP,EAAQQ,UAC/BR,EAAQQ,QAAQC,WAAaH,GAEhB,SAAXC,GAAqBL,EAAmBM,UAC1CN,EAAmBM,QAAQC,WAAaH,GAG1C,IAAMI,EAAYJ,EAAgB,EAClCP,GAAc,SAAAY,GAAU,OAAKA,IAAeD,EAAYA,EAAYC,CAAU,IAE9ER,EAAeK,QAAUF,CAZqB,CAahD,GACA,CAACP,IAGGa,EAA+CP,GACnD,SAAAQ,GAEET,EADiBS,EAAEC,OAA0BL,WACzB,OACtB,GACA,CAACL,IAGGW,EAA0BV,GAC9B,SAAAQ,GAEET,EADiBS,EAAEC,OAA0BL,WACzB,OACtB,GACA,CAACL,IAGGY,EAAeC,GACnB,WAAA,OAAMC,OAAAC,OAAAD,OAAAC,OAAA,CAAA,EACDtB,GAAK,CACRG,QAAAA,EACAY,aAAAA,EACAV,mBAAAA,EACAa,wBAAAA,GACA,GACF,CAAClB,EAAOe,EAAcG,IAGxB,OAAOK,EAAAC,cAAC7B,EAAa8B,SAAQ,CAACzB,MAAOmB,GAAelB,EACtD,EAEayB,EAAW,WACtB,IAAMC,EAAUC,EAAWjC,GAC3B,QAAgBE,IAAZ8B,EACF,MAAUE,MAAM,gDAElB,OAAOF,CACT"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{slicedToArray as e}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import n,{useState as o,useRef as r,useCallback as t,useMemo as u,useContext as i,createContext as l}from"react";var v=l(void 0),c=function(i){var l=i.value,c=i.children,a=l.tableRootRef,d=l.hoveredRowRef,s=l.isMenuOpen,R=l.resetHoveredRow,f=l.setHoveredRowRef,w=l.setIsMenuOpen,M=o(0),p=e(M,2),b=p[0],m=p[1],h=r(!1),g=t((function(e){if(!s){f(e);var n=a.current.getBoundingClientRect().top,o=e.current.getBoundingClientRect().top;m(o-n)}}),[s,f,a]),H=t((function(){s||h.current||f(null)}),[s,f]),T=t((function(){h.current=!0}),[]),B=t((function(){h.current=!1,s||(null==d?void 0:d.current)||f(null)}),[s,d,f]),O=t((function(){w(!0)}),[w]),P=t((function(){w(!1)}),[w]),C=u((function(){var e;return{hoveredRowId:null===(e=null==d?void 0:d.current)||void 0===e?void 0:e.id,resetHoveredRow:R,menuButtonPosition:b,onMouseOverRow:g,onMouseLeaveRow:H,onMouseOverRowMenu:T,onMouseLeaveRowMenu:B,setTableMenuShown:O,setTableMenuHidden:P}}),[d,R,b,H,B,g,T,O,P]);return n.createElement(v.Provider,{value:C},c)},a=function(){var e=i(v);if(!e)throw Error("useTableRowMenuContext must be used within a TableRowMenuProvider");return e};export{c as TableRowMenuProvider,a as useTableRowMenu};
|
|
2
|
-
//# sourceMappingURL=TableRowMenuContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableRowMenuContext.js","sources":["../../../../../../../src/components/Table/context/TableRowMenuContext/TableRowMenuContext.tsx"],"sourcesContent":["import React, { createContext, useCallback, useContext, useMemo, useRef, useState } from \"react\";\nimport {\n type TableRowMenuContext as ITableRowMenuContext,\n type TableRowMenuProviderProps\n} from \"./TableRowMenuContext.types\";\n\nconst TableRowMenuContext = createContext<ITableRowMenuContext | undefined>(undefined);\n\nexport const TableRowMenuProvider = ({ value, children }: TableRowMenuProviderProps) => {\n const { tableRootRef, hoveredRowRef, isMenuOpen, resetHoveredRow, setHoveredRowRef, setIsMenuOpen } = value;\n const [menuButtonPosition, setMenuButtonPosition] = useState(0);\n const isMenuHovered = useRef(false);\n\n const onMouseOverRow = useCallback(\n (rowRef: React.RefObject<HTMLDivElement>) => {\n if (isMenuOpen) return;\n\n setHoveredRowRef(rowRef);\n const tableRootTop = tableRootRef.current.getBoundingClientRect().top;\n const rowTop = rowRef.current.getBoundingClientRect().top;\n setMenuButtonPosition(rowTop - tableRootTop);\n },\n [isMenuOpen, setHoveredRowRef, tableRootRef]\n );\n\n const onMouseLeaveRow = useCallback(() => {\n if (isMenuOpen || isMenuHovered.current) return;\n setHoveredRowRef(null);\n }, [isMenuOpen, setHoveredRowRef]);\n\n const onMouseOverRowMenu = useCallback(() => {\n isMenuHovered.current = true;\n }, []);\n\n const onMouseLeaveRowMenu = useCallback(() => {\n isMenuHovered.current = false;\n if (isMenuOpen) return;\n\n if (!hoveredRowRef?.current) {\n setHoveredRowRef(null);\n }\n }, [isMenuOpen, hoveredRowRef, setHoveredRowRef]);\n\n const setTableMenuShown = useCallback(() => {\n setIsMenuOpen(true);\n }, [setIsMenuOpen]);\n\n const setTableMenuHidden = useCallback(() => {\n setIsMenuOpen(false);\n }, [setIsMenuOpen]);\n\n const contextValue = useMemo<ITableRowMenuContext>(\n () => ({\n hoveredRowId: hoveredRowRef?.current?.id,\n resetHoveredRow,\n menuButtonPosition,\n onMouseOverRow,\n onMouseLeaveRow,\n onMouseOverRowMenu,\n onMouseLeaveRowMenu,\n setTableMenuShown,\n setTableMenuHidden\n }),\n [\n hoveredRowRef,\n resetHoveredRow,\n menuButtonPosition,\n onMouseLeaveRow,\n onMouseLeaveRowMenu,\n onMouseOverRow,\n onMouseOverRowMenu,\n setTableMenuShown,\n setTableMenuHidden\n ]\n );\n\n return <TableRowMenuContext.Provider value={contextValue}>{children}</TableRowMenuContext.Provider>;\n};\n\nexport const useTableRowMenu = () => {\n const context = useContext(TableRowMenuContext);\n if (!context) {\n throw new Error(\"useTableRowMenuContext must be used within a TableRowMenuProvider\");\n }\n return context;\n};\n"],"names":["TableRowMenuContext","createContext","undefined","TableRowMenuProvider","_ref","value","children","tableRootRef","hoveredRowRef","isMenuOpen","resetHoveredRow","setHoveredRowRef","setIsMenuOpen","_useState","useState","_useState2","_slicedToArray","menuButtonPosition","setMenuButtonPosition","isMenuHovered","useRef","onMouseOverRow","useCallback","rowRef","tableRootTop","current","getBoundingClientRect","top","rowTop","onMouseLeaveRow","onMouseOverRowMenu","onMouseLeaveRowMenu","setTableMenuShown","setTableMenuHidden","contextValue","useMemo","hoveredRowId","_a","id","React","createElement","Provider","useTableRowMenu","context","useContext","Error"],"mappings":"sMAMA,IAAMA,EAAsBC,OAAgDC,GAE/DC,EAAuB,SAAHC,GAAsD,IAAhDC,EAAKD,EAALC,MAAOC,EAAQF,EAARE,SACpCC,EAA8FF,EAA9FE,aAAcC,EAAgFH,EAAhFG,cAAeC,EAAiEJ,EAAjEI,WAAYC,EAAqDL,EAArDK,gBAAiBC,EAAoCN,EAApCM,iBAAkBC,EAAkBP,EAAlBO,cACpFC,EAAoDC,EAAS,GAAEC,EAAAC,EAAAH,EAAA,GAAxDI,EAAkBF,EAAA,GAAEG,EAAqBH,EAAA,GAC1CI,EAAgBC,GAAO,GAEvBC,EAAiBC,GACrB,SAACC,GACC,IAAId,EAAJ,CAEAE,EAAiBY,GACjB,IAAMC,EAAejB,EAAakB,QAAQC,wBAAwBC,IAC5DC,EAASL,EAAOE,QAAQC,wBAAwBC,IACtDT,EAAsBU,EAASJ,EALf,CAMjB,GACD,CAACf,EAAYE,EAAkBJ,IAG3BsB,EAAkBP,GAAY,WAC9Bb,GAAcU,EAAcM,SAChCd,EAAiB,KACnB,GAAG,CAACF,EAAYE,IAEVmB,EAAqBR,GAAY,WACrCH,EAAcM,SAAU,CACzB,GAAE,IAEGM,EAAsBT,GAAY,WACtCH,EAAcM,SAAU,EACpBhB,IAECD,aAAA,EAAAA,EAAeiB,UAClBd,EAAiB,KAEpB,GAAE,CAACF,EAAYD,EAAeG,IAEzBqB,EAAoBV,GAAY,WACpCV,GAAc,EAChB,GAAG,CAACA,IAEEqB,EAAqBX,GAAY,WACrCV,GAAc,EAChB,GAAG,CAACA,IAEEsB,EAAeC,GACnB,iBAAM,MAAC,CACLC,aAAoC,QAAtBC,EAAA7B,eAAAA,EAAeiB,eAAO,IAAAY,OAAA,EAAAA,EAAEC,GACtC5B,gBAAAA,EACAO,mBAAAA,EACAI,eAAAA,EACAQ,gBAAAA,EACAC,mBAAAA,EACAC,oBAAAA,EACAC,kBAAAA,EACAC,mBAAAA,EACA,GACF,CACEzB,EACAE,EACAO,EACAY,EACAE,EACAV,EACAS,EACAE,EACAC,IAIJ,OAAOM,EAAAC,cAACxC,EAAoByC,SAAQ,CAACpC,MAAO6B,GAAe5B,EAC7D,EAEaoC,EAAkB,WAC7B,IAAMC,EAAUC,EAAW5C,GAC3B,IAAK2C,EACH,MAAUE,MAAM,qEAElB,OAAOF,CACT"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{slicedToArray as e}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{useState as t,useMemo as s,useCallback as o}from"react";import{useSetDefaultItemOnFocusEvent as i,useSupportArrowsKeyboardNavigation as n,useSupportPressItemKeyboardNavigation as u,useKeepFocusOnItemWhenListChanged as l,useCleanVisualFocusOnBlur as c}from"./useActiveDescendantListFocusHooks.js";var a;function r(r){var m=r.focusedElementRef,d=r.itemsIds,I=r.isItemSelectable,f=r.onItemClick,v=r.defaultVisualFocusFirstIndex,F=r.focusedElementRole,p=void 0===F?a.GROUP:F,x=r.isHorizontalList,b=void 0!==x&&x,g=r.isIgnoreSpaceAsItemSelection,O=void 0!==g&&g,E=r.useDocumentEventListeners,S=void 0!==E&&E,C=r.ignoreDocumentFallback,P=void 0!==C&&C,R=void 0!==v&&v?0:-1,V=d.length,A=t(-1),B=e(A,2),k=B[0],y=B[1],D=d[k],L=s((function(){return S?P?{ignoreDocumentFallback:P}:void 0:{ref:m,preventDefault:!0,stopPropagation:!0}}),[S,m,P]),T=i({focusedElementRef:m,isItemSelectable:I,visualFocusItemIndex:k,setVisualFocusItemIndex:y,itemsCount:V,defaultVisualFocusItemIndex:R}).triggeredByKeyboard,H=o((function(e,t){T.current=t;var s=d.indexOf(e);s>-1&&s!==k&&y(s)}),[d,T,k]);return n({itemsCount:V,focusedElementRef:m,visualFocusItemIndex:k,setVisualFocusItemIndex:y,triggeredByKeyboard:T,isHorizontalList:b,isItemSelectable:I,listenerOptions:L}),u({visualFocusItemIndex:k,itemsCount:V,focusedElementRef:m,setVisualFocusItemIndex:y,onItemClick:f,isItemSelectable:I,listenerOptions:L,isIgnoreSpaceAsItemSelection:O}),l({visualFocusItemIndex:k,itemsIds:d,isItemSelectable:I,setVisualFocusItemIndex:y}),c({focusedElementRef:m,visualFocusItemIndex:k,setVisualFocusItemIndex:y}),{visualFocusItemIndex:T.current?k:void 0,visualFocusItemId:T.current?D:void 0,focusedElementProps:{"aria-activedescendant":T.current?D:void 0,role:p},setVisualFocusItemId:H}}!function(e){e.APPLICATION="application",e.COMBOBOX="combobox",e.COMPOSITE="composite",e.GROUP="group",e.TEXTBOX="textbox",e.MENU="menu"}(a||(a={})),r.roles=a;export{r as default};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/hooks/useActiveDescendantListFocus/index.ts"],"sourcesContent":["import { type MutableRefObject } from \"react\";\nimport type React from \"react\";\nimport { useMemo, useState, useCallback } from \"react\";\nimport {\n useSupportArrowsKeyboardNavigation,\n useSupportPressItemKeyboardNavigation,\n useSetDefaultItemOnFocusEvent,\n useKeepFocusOnItemWhenListChanged,\n useCleanVisualFocusOnBlur\n} from \"./useActiveDescendantListFocusHooks\";\n\nenum Role {\n APPLICATION = \"application\",\n COMBOBOX = \"combobox\",\n COMPOSITE = \"composite\",\n GROUP = \"group\",\n TEXTBOX = \"textbox\",\n MENU = \"menu\"\n}\n\nfunction useActiveDescendantListFocus({\n focusedElementRef, // the reference for the component that listens to keyboard\n itemsIds,\n isItemSelectable,\n onItemClick,\n defaultVisualFocusFirstIndex = false,\n focusedElementRole = Role.GROUP,\n isHorizontalList = false,\n isIgnoreSpaceAsItemSelection = false,\n useDocumentEventListeners = false,\n ignoreDocumentFallback = false\n}: {\n focusedElementRef: MutableRefObject<HTMLElement>;\n itemsIds: string[];\n isItemSelectable: (index: number) => boolean;\n onItemClick: (event: React.KeyboardEvent | React.MouseEvent, index: number) => void;\n defaultVisualFocusFirstIndex?: boolean;\n focusedElementRole?: Role;\n isHorizontalList?: boolean;\n isIgnoreSpaceAsItemSelection?: boolean;\n useDocumentEventListeners?: boolean;\n ignoreDocumentFallback?: boolean;\n}) {\n const defaultVisualFocusItemIndex = defaultVisualFocusFirstIndex ? 0 : -1;\n const itemsCount = itemsIds.length;\n const [visualFocusItemIndex, setVisualFocusItemIndex] = useState<number>(-1);\n const visualFocusItemId = itemsIds[visualFocusItemIndex];\n\n const listenerOptions = useMemo(() => {\n if (useDocumentEventListeners) {\n return ignoreDocumentFallback ? { ignoreDocumentFallback } : undefined;\n }\n\n return {\n ref: focusedElementRef,\n preventDefault: true,\n stopPropagation: true\n };\n }, [useDocumentEventListeners, focusedElementRef, ignoreDocumentFallback]);\n\n const { triggeredByKeyboard } = useSetDefaultItemOnFocusEvent({\n focusedElementRef,\n isItemSelectable,\n visualFocusItemIndex,\n setVisualFocusItemIndex,\n itemsCount,\n defaultVisualFocusItemIndex\n });\n\n const setVisualFocusItemId = useCallback(\n (visualFocusItemId: string, isTriggeredByKeyboard: boolean) => {\n triggeredByKeyboard.current = isTriggeredByKeyboard;\n const itemIndex = itemsIds.indexOf(visualFocusItemId);\n if (itemIndex > -1 && itemIndex !== visualFocusItemIndex) {\n setVisualFocusItemIndex(itemIndex);\n }\n },\n [itemsIds, triggeredByKeyboard, visualFocusItemIndex]\n );\n\n useSupportArrowsKeyboardNavigation({\n itemsCount,\n focusedElementRef,\n visualFocusItemIndex,\n setVisualFocusItemIndex,\n triggeredByKeyboard,\n isHorizontalList,\n isItemSelectable,\n listenerOptions\n });\n\n useSupportPressItemKeyboardNavigation({\n visualFocusItemIndex,\n itemsCount,\n focusedElementRef,\n setVisualFocusItemIndex,\n onItemClick,\n isItemSelectable,\n listenerOptions,\n isIgnoreSpaceAsItemSelection\n });\n\n useKeepFocusOnItemWhenListChanged({\n visualFocusItemIndex,\n itemsIds,\n isItemSelectable,\n setVisualFocusItemIndex\n });\n\n useCleanVisualFocusOnBlur({ focusedElementRef, visualFocusItemIndex, setVisualFocusItemIndex });\n\n return {\n visualFocusItemIndex: triggeredByKeyboard.current ? visualFocusItemIndex : undefined,\n visualFocusItemId: triggeredByKeyboard.current ? visualFocusItemId : undefined,\n focusedElementProps: {\n \"aria-activedescendant\": triggeredByKeyboard.current ? visualFocusItemId : undefined,\n role: focusedElementRole\n },\n setVisualFocusItemId\n };\n}\n\nuseActiveDescendantListFocus.roles = Role;\n\nexport default useActiveDescendantListFocus;\n"],"names":["Role","useActiveDescendantListFocus","_ref","focusedElementRef","itemsIds","isItemSelectable","onItemClick","_ref$defaultVisualFoc","defaultVisualFocusFirstIndex","_ref$focusedElementRo","focusedElementRole","GROUP","_ref$isHorizontalList","isHorizontalList","_ref$isIgnoreSpaceAsI","isIgnoreSpaceAsItemSelection","_ref$useDocumentEvent","useDocumentEventListeners","_ref$ignoreDocumentFa","ignoreDocumentFallback","defaultVisualFocusItemIndex","itemsCount","length","_useState","useState","_useState2","_slicedToArray","visualFocusItemIndex","setVisualFocusItemIndex","visualFocusItemId","listenerOptions","useMemo","undefined","ref","preventDefault","stopPropagation","triggeredByKeyboard","useSetDefaultItemOnFocusEvent","setVisualFocusItemId","useCallback","isTriggeredByKeyboard","current","itemIndex","indexOf","useSupportArrowsKeyboardNavigation","useSupportPressItemKeyboardNavigation","useKeepFocusOnItemWhenListChanged","useCleanVisualFocusOnBlur","focusedElementProps","role","roles"],"mappings":"8XAWA,IAAKA,EASL,SAASC,EAA4BC,GAsBpC,IArBCC,EAAiBD,EAAjBC,kBACAC,EAAQF,EAARE,SACAC,EAAgBH,EAAhBG,iBACAC,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,gBAAAA,EACAf,6BAAAA,IAGF+B,EAAkC,CAChCnB,qBAAAA,EACAvB,SAAAA,EACAC,iBAAAA,EACAuB,wBAAAA,IAGFmB,EAA0B,CAAE5C,kBAAAA,EAAmBwB,qBAAAA,EAAsBC,wBAAAA,IAE9D,CACLD,qBAAsBS,EAAoBK,QAAUd,OAAuBK,EAC3EH,kBAAmBO,EAAoBK,QAAUZ,OAAoBG,EACrEgB,oBAAqB,CACnB,wBAAyBZ,EAAoBK,QAAUZ,OAAoBG,EAC3EiB,KAAMvC,GAER4B,qBAAAA,EAEJ,EA7GA,SAAKtC,GACHA,EAAA,YAAA,cACAA,EAAA,SAAA,WACAA,EAAA,UAAA,YACAA,EAAA,MAAA,QACAA,EAAA,QAAA,UACAA,EAAA,KAAA,MACD,CAPD,CAAKA,IAAAA,EAOJ,CAAA,IAwGDC,EAA6BiD,MAAQlD"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function e(e){var t=e.isItemSelectable,r=e.visualFocusItemIndex,i=e.itemsCount;if(i-1>=r)for(var n=1;i>=n;n++){var u=(r+n)%i;if(t(u))return u}}function t(e){for(var t=e.isItemSelectable,r=e.visualFocusItemIndex,i=e.itemsCount,n=1;i-1>=n;n++){var u=r-n;if(0>u&&(u=i+u),t(u))return u}}export{e as getNextSelectableIndex,t as getPreviousSelectableIndex};
|
|
2
|
-
//# sourceMappingURL=useActiveDescendantListFocusHelpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useActiveDescendantListFocusHelpers.js","sources":["../../../../../src/hooks/useActiveDescendantListFocus/useActiveDescendantListFocusHelpers.ts"],"sourcesContent":["type ActiveDependentHelper = {\n isItemSelectable: (index: number) => boolean;\n visualFocusItemIndex: number;\n itemsCount: number;\n};\n\nexport function getNextSelectableIndex({ isItemSelectable, visualFocusItemIndex, itemsCount }: ActiveDependentHelper) {\n if (visualFocusItemIndex > itemsCount - 1) return;\n // Go over all the next items until found one which is selectable\n for (let offset = 1; offset <= itemsCount; offset++) {\n const nextIndex = (visualFocusItemIndex + offset) % itemsCount;\n if (isItemSelectable(nextIndex)) {\n return nextIndex;\n }\n }\n}\nexport function getPreviousSelectableIndex({\n isItemSelectable,\n visualFocusItemIndex,\n itemsCount\n}: ActiveDependentHelper) {\n for (let offset = 1; offset <= itemsCount - 1; offset++) {\n let prevIndex = visualFocusItemIndex - offset;\n if (prevIndex < 0) {\n prevIndex = itemsCount + prevIndex;\n }\n if (isItemSelectable(prevIndex)) {\n return prevIndex;\n }\n }\n}\n"],"names":["getNextSelectableIndex","_ref","isItemSelectable","visualFocusItemIndex","itemsCount","offset","nextIndex","getPreviousSelectableIndex","_ref2","prevIndex"],"mappings":"AAMM,SAAUA,EAAsBC,GAA8E,IAA3EC,EAAgBD,EAAhBC,iBAAkBC,EAAoBF,EAApBE,qBAAsBC,EAAUH,EAAVG,WAC/E,GAA2BA,EAAa,GAApCD,EAEJ,IAAK,IAAIE,EAAS,EAAaD,GAAVC,EAAsBA,IAAU,CACnD,IAAMC,GAAaH,EAAuBE,GAAUD,EACpD,GAAIF,EAAiBI,GACnB,OAAOA,CAEX,CACF,CACM,SAAUC,EAA0BC,GAKxC,IADsB,IAHtBN,EAAgBM,EAAhBN,iBACAC,EAAoBK,EAApBL,qBACAC,EAAUI,EAAVJ,WAESC,EAAS,EAAaD,EAAa,GAAvBC,EAA0BA,IAAU,CACvD,IAAII,EAAYN,EAAuBE,EAIvC,GAHgB,EAAZI,IACFA,EAAYL,EAAaK,GAEvBP,EAAiBO,GACnB,OAAOA,CAEX,CACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useCallback as e,useMemo as t,useEffect as n,useRef as s}from"react";import{useKeyEvent as i,useEventListener as o}from"@vibe/shared";import{usePrevious as u}from"@vibe/hooks";import{getNextSelectableIndex as c,getPreviousSelectableIndex as r}from"./useActiveDescendantListFocusHelpers.js";import l from"../useListenFocusTriggers/index.js";var a;!function(e){e.UP="ArrowUp",e.DOWN="ArrowDown",e.RIGHT="ArrowRight",e.LEFT="ArrowLeft"}(a||(a={}));var m="Enter";function I(t){var n=t.itemsCount,s=t.focusedElementRef,o=t.visualFocusItemIndex,u=t.setVisualFocusItemIndex,l=t.isHorizontalList,m=t.isItemSelectable,I=t.listenerOptions,d=t.triggeredByKeyboard,f=l?a.RIGHT:a.DOWN,v=l?a.LEFT:a.UP,b=e((function(e){var t;document.activeElement===s.current&&(!d.current&&(d.current=!0,o>-1)||(e===f?t=c({isItemSelectable:m,visualFocusItemIndex:o,itemsCount:n}):e===v&&(t=r({isItemSelectable:m,visualFocusItemIndex:o,itemsCount:n})),t>-1&&t!==o&&u(t)))}),[s,d,f,v,o,u,m,n]),F=e((function(){b(v)}),[v,b]),x=e((function(){b(f)}),[f,b]);i(Object.assign({keys:[f],callback:x},I)),i(Object.assign({keys:[v],callback:F},I))}function d(n){var s=n.visualFocusItemIndex,o=n.focusedElementRef,u=n.itemsCount,c=n.setVisualFocusItemIndex,r=n.onItemClick,l=n.isItemSelectable,a=n.listenerOptions,I=void 0===a?void 0:a,d=n.isIgnoreSpaceAsItemSelection,f=void 0!==d&&d,v=t((function(){return f?[m]:[m," "]}),[f]),b=e((function(e,t){r&&(t>=0&&u>t)&&l(t)&&(s!==t&&c(t),r(e,t))}),[u,r,l,s,c]),F=e((function(e){o.current.contains(document.activeElement)&&b(e,s)}),[b,o,s]);i(Object.assign({keys:v,callback:F},I))}function f(t){var s=t.focusedElementRef,i=t.visualFocusItemIndex,c=t.setVisualFocusItemIndex,r=u(s),l=e((function(){-1!==i&&c(-1)}),[c,i]);n((function(){null===(null==s?void 0:s.current)&&null!==(null==r?void 0:r.current)&&l()}),[s.current,r,l]),o({eventName:"blur",ref:s,callback:l})}function v(t){var n=t.focusedElementRef,i=t.isItemSelectable,o=t.visualFocusItemIndex,u=t.setVisualFocusItemIndex,r=t.itemsCount,a=t.defaultVisualFocusItemIndex,m=void 0===a?-1:a,I=s(!1),d=e((function(){var e;(I.current=!0,o!==m)&&(e=i(m)?m:c({isItemSelectable:i,itemsCount:r,visualFocusItemIndex:m}),u(e))}),[m,i,r,u,I,o]),f=e((function(){I.current=!1}),[I]);return l({ref:n,onFocusByKeyboard:d,onFocusByMouse:f}),{triggeredByKeyboard:I}}function b(e){var t=e.visualFocusItemIndex,s=e.itemsIds,i=e.isItemSelectable,o=e.setVisualFocusItemIndex,r=u(s);n((function(){var e;void 0!==r&&r!==s&&void 0!==r&&-1!==t?e=s.indexOf(r[t]):e=t;if(e!==t)if(i(e))o(e);else{var n=c({isItemSelectable:i,visualFocusItemIndex:e,itemsCount:s.length});o(n)}}),[t,s,i,o,r])}export{f as useCleanVisualFocusOnBlur,b as useKeepFocusOnItemWhenListChanged,v as useSetDefaultItemOnFocusEvent,I as useSupportArrowsKeyboardNavigation,d as useSupportPressItemKeyboardNavigation};
|
|
2
|
-
//# sourceMappingURL=useActiveDescendantListFocusHooks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useActiveDescendantListFocusHooks.js","sources":["../../../../../src/hooks/useActiveDescendantListFocus/useActiveDescendantListFocusHooks.ts"],"sourcesContent":["import { type MutableRefObject } from \"react\";\nimport type React from \"react\";\nimport { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport useKeyEvent, { type UseKeyEventArgs } from \"../useKeyEvent\";\nimport useEventListener from \"../useEventListener\";\nimport { usePrevious } from \"@vibe/hooks\";\nimport { getNextSelectableIndex, getPreviousSelectableIndex } from \"./useActiveDescendantListFocusHelpers\";\nimport useListenFocusTriggers from \"../useListenFocusTriggers\";\n\nenum ArrowDirection {\n UP = \"ArrowUp\",\n DOWN = \"ArrowDown\",\n RIGHT = \"ArrowRight\",\n LEFT = \"ArrowLeft\"\n}\n\nconst ENTER_KEY = \"Enter\";\nconst SPACE_KEY = \" \";\n\nexport function useSupportArrowsKeyboardNavigation({\n itemsCount,\n focusedElementRef,\n visualFocusItemIndex,\n setVisualFocusItemIndex,\n isHorizontalList,\n isItemSelectable,\n listenerOptions,\n triggeredByKeyboard\n}: {\n itemsCount: number;\n focusedElementRef: MutableRefObject<HTMLElement>;\n visualFocusItemIndex: number;\n setVisualFocusItemIndex: (index: number) => void;\n isHorizontalList: boolean;\n isItemSelectable: (index: number) => boolean;\n triggeredByKeyboard: MutableRefObject<boolean>;\n listenerOptions: Omit<UseKeyEventArgs, \"keys\" | \"callback\">;\n}) {\n const nextArrow = isHorizontalList ? ArrowDirection.RIGHT : ArrowDirection.DOWN;\n const backArrow = isHorizontalList ? ArrowDirection.LEFT : ArrowDirection.UP;\n\n const onArrowKeyEvent = useCallback(\n (direction: ArrowDirection) => {\n // we desire to change the visual focus item only if the user pressed on the keyboard arrows keys while\n // the focusedElementRef is naturally focus\n if (document.activeElement !== focusedElementRef.current) {\n return;\n }\n\n // If the focusedElementRef is naturally focus but this is the first keyboard interaction of the user, we will mark future user interactions as trigger by keyboard (until the next mouse interaction)\n // that from now on the interactions are trigger by keyboard (until the next mouse interaction)\n if (!triggeredByKeyboard.current) {\n triggeredByKeyboard.current = true;\n\n // If the focusedElementRef is naturally focus but this is the first keyboard interaction of the user, we want only to display the item\n // which right now visually focus without changing it.\n if (visualFocusItemIndex > -1) {\n return;\n }\n }\n\n let newIndex;\n\n // We will change the visual focused item index according to the direction of the pressed arrow\n if (direction === nextArrow) {\n newIndex = getNextSelectableIndex({ isItemSelectable, visualFocusItemIndex, itemsCount });\n } else if (direction === backArrow) {\n newIndex = getPreviousSelectableIndex({ isItemSelectable, visualFocusItemIndex, itemsCount });\n }\n\n if (newIndex > -1 && newIndex !== visualFocusItemIndex) setVisualFocusItemIndex(newIndex);\n },\n [\n focusedElementRef,\n triggeredByKeyboard,\n nextArrow,\n backArrow,\n visualFocusItemIndex,\n setVisualFocusItemIndex,\n isItemSelectable,\n itemsCount\n ]\n );\n const onArrowBack = useCallback(() => {\n onArrowKeyEvent(backArrow);\n }, [backArrow, onArrowKeyEvent]);\n\n const onArrowNext = useCallback(() => {\n onArrowKeyEvent(nextArrow);\n }, [nextArrow, onArrowKeyEvent]);\n\n useKeyEvent({\n keys: [nextArrow],\n callback: onArrowNext,\n ...listenerOptions\n });\n\n useKeyEvent({\n keys: [backArrow],\n callback: onArrowBack,\n ...listenerOptions\n });\n}\n\nexport function useSupportPressItemKeyboardNavigation({\n visualFocusItemIndex,\n focusedElementRef,\n itemsCount,\n setVisualFocusItemIndex,\n onItemClick,\n isItemSelectable,\n listenerOptions = undefined,\n isIgnoreSpaceAsItemSelection = false\n}: {\n visualFocusItemIndex: number;\n focusedElementRef: MutableRefObject<HTMLElement>;\n itemsCount: number;\n setVisualFocusItemIndex: (index: number) => void;\n onItemClick: (event: React.MouseEvent | React.KeyboardEvent, index: number) => void;\n isItemSelectable: (index: number) => boolean;\n listenerOptions: Omit<UseKeyEventArgs, \"keys\" | \"callback\">;\n isIgnoreSpaceAsItemSelection: boolean;\n}) {\n const pressKeys = useMemo(\n () => (isIgnoreSpaceAsItemSelection ? [ENTER_KEY] : [ENTER_KEY, SPACE_KEY]),\n [isIgnoreSpaceAsItemSelection]\n );\n\n const baseOnClickCallback = useCallback(\n (event: React.KeyboardEvent, itemIndex: number) => {\n const hasValidIndex = itemIndex >= 0 && itemIndex < itemsCount;\n if (!onItemClick || !hasValidIndex || !isItemSelectable(itemIndex)) return;\n if (visualFocusItemIndex !== itemIndex) setVisualFocusItemIndex(itemIndex);\n onItemClick(event, itemIndex);\n },\n [itemsCount, onItemClick, isItemSelectable, visualFocusItemIndex, setVisualFocusItemIndex]\n );\n\n const keyboardOnSelectCallback = useCallback(\n (event: React.KeyboardEvent) => {\n // we desire to change the trigger the active item on click callback only if the user pressed on the keyboard arrows keys while\n // the focusedElementRef is naturally focus\n if (focusedElementRef.current.contains(document.activeElement)) {\n baseOnClickCallback(event, visualFocusItemIndex);\n }\n },\n [baseOnClickCallback, focusedElementRef, visualFocusItemIndex]\n );\n\n useKeyEvent({\n keys: pressKeys,\n callback: keyboardOnSelectCallback,\n ...listenerOptions\n });\n}\n\nexport function useCleanVisualFocusOnBlur({\n focusedElementRef,\n visualFocusItemIndex,\n setVisualFocusItemIndex\n}: {\n focusedElementRef: MutableRefObject<HTMLElement>;\n visualFocusItemIndex: number;\n setVisualFocusItemIndex: (index: number) => void;\n}) {\n const previousFocusedElementRef = usePrevious(focusedElementRef);\n\n const onBlurCallback = useCallback(() => {\n if (visualFocusItemIndex !== -1) {\n setVisualFocusItemIndex(-1);\n }\n }, [setVisualFocusItemIndex, visualFocusItemIndex]);\n\n // if element unmount act like element got blur event\n useEffect(() => {\n // if element unmount\n if (focusedElementRef?.current === null && previousFocusedElementRef?.current !== null) {\n onBlurCallback();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [focusedElementRef.current, previousFocusedElementRef, onBlurCallback]);\n\n useEventListener({\n eventName: \"blur\",\n ref: focusedElementRef,\n callback: onBlurCallback\n });\n}\n\nexport function useSetDefaultItemOnFocusEvent({\n focusedElementRef,\n isItemSelectable,\n visualFocusItemIndex,\n setVisualFocusItemIndex,\n itemsCount,\n defaultVisualFocusItemIndex = -1\n}: {\n focusedElementRef: MutableRefObject<HTMLElement>;\n isItemSelectable: (index: number) => boolean;\n visualFocusItemIndex: number;\n setVisualFocusItemIndex: (index: number) => void;\n itemsCount: number;\n defaultVisualFocusItemIndex: number;\n}) {\n const triggeredByKeyboard = useRef(false);\n\n const onFocusByKeyboard = useCallback(() => {\n triggeredByKeyboard.current = true;\n if (visualFocusItemIndex !== defaultVisualFocusItemIndex) {\n let newVisualFocusIndex;\n if (isItemSelectable(defaultVisualFocusItemIndex)) {\n newVisualFocusIndex = defaultVisualFocusItemIndex;\n } else {\n newVisualFocusIndex = getNextSelectableIndex({\n isItemSelectable,\n itemsCount,\n visualFocusItemIndex: defaultVisualFocusItemIndex\n });\n }\n setVisualFocusItemIndex(newVisualFocusIndex);\n }\n }, [\n defaultVisualFocusItemIndex,\n isItemSelectable,\n itemsCount,\n setVisualFocusItemIndex,\n triggeredByKeyboard,\n visualFocusItemIndex\n ]);\n const onFocusByMouse = useCallback(() => {\n triggeredByKeyboard.current = false;\n }, [triggeredByKeyboard]);\n useListenFocusTriggers({ ref: focusedElementRef, onFocusByKeyboard, onFocusByMouse });\n\n return { triggeredByKeyboard };\n}\n\nexport function useKeepFocusOnItemWhenListChanged({\n visualFocusItemIndex,\n itemsIds,\n isItemSelectable,\n setVisualFocusItemIndex\n}: {\n visualFocusItemIndex: number;\n itemsIds: string[];\n isItemSelectable: (index: number) => boolean;\n setVisualFocusItemIndex: (index: number) => void;\n}) {\n const prevItemIds = usePrevious(itemsIds);\n\n // When item list changed, keep the focus on the same item\n useEffect(() => {\n // When the list is changing the index of the focused item is point to a different item then before and\n // this is why we want to search for the new index of the item and change the index to point to it.\n let overrideIndexAfterListChanged;\n const isListChanged = prevItemIds !== undefined && prevItemIds !== itemsIds;\n if (isListChanged && prevItemIds !== undefined && visualFocusItemIndex !== -1) {\n const focusedItemId = prevItemIds[visualFocusItemIndex];\n overrideIndexAfterListChanged = itemsIds.indexOf(focusedItemId);\n } else {\n overrideIndexAfterListChanged = visualFocusItemIndex;\n }\n\n if (overrideIndexAfterListChanged !== visualFocusItemIndex) {\n if (isItemSelectable(overrideIndexAfterListChanged)) {\n setVisualFocusItemIndex(overrideIndexAfterListChanged);\n } else {\n const closestSelectableIndex = getNextSelectableIndex({\n isItemSelectable,\n visualFocusItemIndex: overrideIndexAfterListChanged,\n itemsCount: itemsIds.length\n });\n setVisualFocusItemIndex(closestSelectableIndex);\n }\n }\n }, [visualFocusItemIndex, itemsIds, isItemSelectable, setVisualFocusItemIndex, prevItemIds]);\n}\n"],"names":["ArrowDirection","ENTER_KEY","useSupportArrowsKeyboardNavigation","_ref","itemsCount","focusedElementRef","visualFocusItemIndex","setVisualFocusItemIndex","isHorizontalList","isItemSelectable","listenerOptions","triggeredByKeyboard","nextArrow","RIGHT","DOWN","backArrow","LEFT","UP","onArrowKeyEvent","useCallback","direction","newIndex","document","activeElement","current","getNextSelectableIndex","getPreviousSelectableIndex","onArrowBack","onArrowNext","useKeyEvent","Object","assign","keys","callback","useSupportPressItemKeyboardNavigation","_ref2","onItemClick","_ref2$listenerOptions","undefined","_ref2$isIgnoreSpaceAs","isIgnoreSpaceAsItemSelection","pressKeys","useMemo","baseOnClickCallback","event","itemIndex","keyboardOnSelectCallback","contains","useCleanVisualFocusOnBlur","_ref3","previousFocusedElementRef","usePrevious","onBlurCallback","useEffect","useEventListener","eventName","ref","useSetDefaultItemOnFocusEvent","_ref4","_ref4$defaultVisualFo","defaultVisualFocusItemIndex","useRef","onFocusByKeyboard","newVisualFocusIndex","onFocusByMouse","useListenFocusTriggers","useKeepFocusOnItemWhenListChanged","_ref5","itemsIds","prevItemIds","overrideIndexAfterListChanged","indexOf","closestSelectableIndex","length"],"mappings":"2VASA,IAAKA,GAAL,SAAKA,GACHA,EAAA,GAAA,UACAA,EAAA,KAAA,YACAA,EAAA,MAAA,aACAA,EAAA,KAAA,WACD,CALD,CAAKA,IAAAA,EAKJ,CAAA,IAED,IAAMC,EAAY,iBAGFC,EAAkCC,GAkBjD,IAjBCC,EAAUD,EAAVC,WACAC,EAAiBF,EAAjBE,kBACAC,EAAoBH,EAApBG,qBACAC,EAAuBJ,EAAvBI,wBACAC,EAAgBL,EAAhBK,iBACAC,EAAgBN,EAAhBM,iBACAC,EAAeP,EAAfO,gBACAC,EAAmBR,EAAnBQ,oBAWMC,EAAYJ,EAAmBR,EAAea,MAAQb,EAAec,KACrEC,EAAYP,EAAmBR,EAAegB,KAAOhB,EAAeiB,GAEpEC,EAAkBC,GACtB,SAACC,GAmBC,IAAIC,EAhBAC,SAASC,gBAAkBlB,EAAkBmB,WAM5Cb,EAAoBa,UACvBb,EAAoBa,SAAU,EAI1BlB,GAAwB,KAQ1Bc,IAAcR,EAChBS,EAAWI,EAAuB,CAAEhB,iBAAAA,EAAkBH,qBAAAA,EAAsBF,WAAAA,IACnEgB,IAAcL,IACvBM,EAAWK,EAA2B,CAAEjB,iBAAAA,EAAk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,OACkChC,IAAhB+B,GAA6BA,IAAgBD,QAC9B9B,IAAhB+B,IAAuD,IAA1B/D,EAEhDgE,EAAgCF,EAASG,QADnBF,EAAY/D,IAGlCgE,EAAgChE,EAGlC,GAAIgE,IAAkChE,EACpC,GAAIG,EAAiB6D,GACnB/D,EAAwB+D,OACnB,CACL,IAAME,EAAyB/C,EAAuB,CACpDhB,iBAAAA,EACAH,qBAAsBgE,EACtBlE,WAAYgE,EAASK,SAEvBlE,EAAwBiE,EAC1B,CAEJ,GAAG,CAAClE,EAAsB8D,EAAU3D,EAAkBF,EAAyB8D,GACjF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{useEventListener as e}from"@vibe/shared";import{useRef as n,useCallback as o}from"react";function r(r){var c=r.ref,u=r.onFocusByKeyboard,a=r.onFocusByMouse,t=n(!1),f=o((function(){t.current=!0}),[t]),l=o((function(e){t.current?null==a||a(e):null==u||u(e)}),[u,a]),m=o((function(){t.current=!1}),[t]);e({eventName:"mousedown",ref:c,callback:f}),e({eventName:"focus",ref:c,callback:l}),e({eventName:"mouseup",ref:c,callback:m})}export{r as default};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/hooks/useListenFocusTriggers/index.ts"],"sourcesContent":["import useEventListener from \"../useEventListener\";\nimport { type RefObject, useCallback, useRef } from \"react\";\n\nexport default function useListenFocusTriggers({\n ref,\n onFocusByKeyboard,\n onFocusByMouse\n}: {\n ref: RefObject<HTMLElement>;\n onFocusByKeyboard?: (event: FocusEvent) => void;\n onFocusByMouse?: (event: FocusEvent) => void;\n}) {\n const isElementMouseDown = useRef(false);\n\n const onMouseDown = useCallback(() => {\n isElementMouseDown.current = true;\n }, [isElementMouseDown]);\n\n const onFocus = useCallback(\n (e: FocusEvent) => {\n // if focus triggered by mouse down, call onFocusByMouse\n if (isElementMouseDown.current) {\n onFocusByMouse?.(e);\n } else {\n onFocusByKeyboard?.(e);\n }\n },\n [onFocusByKeyboard, onFocusByMouse]\n );\n const onMouseUp = useCallback(() => {\n isElementMouseDown.current = false;\n }, [isElementMouseDown]);\n\n useEventListener({\n eventName: \"mousedown\",\n ref,\n callback: onMouseDown\n });\n\n useEventListener({\n eventName: \"focus\",\n ref,\n callback: onFocus\n });\n\n useEventListener({\n eventName: \"mouseup\",\n ref,\n callback: onMouseUp\n });\n}\n"],"names":["useListenFocusTriggers","_ref","ref","onFocusByKeyboard","onFocusByMouse","isElementMouseDown","useRef","onMouseDown","useCallback","current","onFocus","e","onMouseUp","useEventListener","eventName","callback"],"mappings":"gGAGc,SAAUA,EAAsBC,GAQ7C,IAPCC,EAAGD,EAAHC,IACAC,EAAiBF,EAAjBE,kBACAC,EAAcH,EAAdG,eAMMC,EAAqBC,GAAO,GAE5BC,EAAcC,GAAY,WAC9BH,EAAmBI,SAAU,CAC/B,GAAG,CAACJ,IAEEK,EAAUF,GACd,SAACG,GAEKN,EAAmBI,QACrBL,SAAAA,EAAiBO,GAEjBR,SAAAA,EAAoBQ,EAExB,GACA,CAACR,EAAmBC,IAEhBQ,EAAYJ,GAAY,WAC5BH,EAAmBI,SAAU,CAC/B,GAAG,CAACJ,IAEJQ,EAAiB,CACfC,UAAW,YACXZ,IAAAA,EACAa,SAAUR,IAGZM,EAAiB,CACfC,UAAW,QACXZ,IAAAA,EACAa,SAAUL,IAGZG,EAAiB,CACfC,UAAW,UACXZ,IAAAA,EACAa,SAAUH,GAEd"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{slicedToArray as e,defineProperty as o}from"../../../_virtual/_rollupPluginBabelHelpers.js";import t from"classnames";import i,{forwardRef as s,useRef as r,useState as a,useCallback as n,useMemo as l}from"react";import{camelCase as d,noop as c,isFunction as m}from"es-toolkit";import{getTestId as p,ComponentDefaultTestId as u}from"../../tests/testIds.js";import{defaultFilter as v}from"./ComboboxService.js";import{ComboboxItems as b}from"./components/ComboboxItems/ComboboxItems.js";import{StickyCategoryHeader as f}from"./components/StickyCategoryHeader/StickyCategoryHeader.js";import{useItemsData as h,useKeyboardNavigation as C}from"./ComboboxHelpers/ComboboxHelpers.js";import{getOptionId as g}from"./helpers.js";import{COMBOBOX_LISTBOX_ID as x}from"./components/ComboboxConstants.js";import I from"./Combobox.module.scss.js";import{ComponentVibeId as y}from"../../tests/constants.js";import{useWarnDeprecated as O}from"../../../shared/dist/utils/warn-deprecated.js";import N from"../../../components/typography/dist/Text/Text.js";import j from"../../../components/search/dist/Search/Search.js";import R from"../../../components/button/dist/Button/Button.js";import{useMergeRef as S}from"../../../shared/dist/hooks/useMergeRef.js";import{getStyle as k}from"../../../shared/dist/utils/typesciptCssModulesHelper.js";var F=s((function(s,F){var H=s.className,A=void 0===H?"":H,E=s.optionClassName,L=void 0===E?"":E,w=s.searchWrapperClassName,M=s.stickyCategoryClassName,B=s.searchIcon,T=s.id,V=void 0===T?"":T,W=s.placeholder,z=void 0===W?"":W,D=s.size,P=void 0===D?"medium":D,X=s.defaultVisualFocusFirstIndex,_=s.optionLineHeight,q=void 0===_?32:_,G=s.optionsListHeight,J=s.autoFocus,K=void 0!==J&&J,Q=s.disabled,U=void 0!==Q&&Q,Y=s.options,Z=void 0===Y?[]:Y,$=s.categories,ee=s.withCategoriesDivider,oe=void 0!==ee&&ee,te=s.noResultsMessage,ie=void 0===te?"No results found":te,se=s.onAddNew,re=s.addNewLabel,ae=void 0===re?"Add new":re,ne=s.onClick,le=void 0===ne?function(e){}:ne,de=s.filter,ce=void 0===de?v:de,me=s.disableFilter,pe=void 0!==me&&me,ue=s.filterValue,ve=s.onFilterChanged,be=s.loading,fe=void 0!==be&&be,he=s.onOptionHover,Ce=void 0===he?c:he,ge=s.onOptionLeave,xe=void 0===ge?c:ge,Ie=s.shouldScrollToSelectedItem,ye=void 0===Ie||Ie,Oe=s.noResultsRenderer,Ne=s.stickyCategories,je=void 0!==Ne&&Ne,Re=s.optionRenderer,Se=void 0===Re?null:Re,ke=s.renderOnlyVisibleOptions,Fe=void 0!==ke&&ke,He=s.clearFilterOnSelection,Ae=void 0!==He&&He,Ee=s.maxOptionsWithoutScroll,Le=s.defaultFilter,we=void 0===Le?"":Le,Me=s.searchInputAriaLabel,Be=void 0===Me?"Search for content":Me,Te=s["data-testid"],Ve=s.debounceRate,We=s.searchInputRef,ze=s.renderAction,De=s.hideRenderActionOnInput;O({component:"Combobox",message:"This component is deprecated and will be removed in the next major version. Please use Dropdown box mode from @vibe/core instead."});var Pe=r(null),Xe=r(null),_e=S(F,Pe),qe=S(Xe,We),Ge=a(ue||we),Je=e(Ge,2),Ke=Je[0],Qe=Je[1];void 0!==ue&&ue!==Ke&&Qe(ue);var Ue=n((function(e){to(-1),ve&&ve(e),Qe(e)}),[Qe,ve]),Ye=n((function(e,o,t){Ce(e,o,t)}),[Ce]),Ze=l((function(){return pe?Z:ce(Ke,Z)}),[Z,Ke,ce,pe]),$e=a(-1),eo=e($e,2),oo=eo[0],to=eo[1],io=n((function(e){return void 0!==e&&Ze[e]&&!Ze[e].disabled}),[Ze]),so=n((function(){se&&se(Ke),Qe("")}),[se,Ke,Qe]),ro=Ze.length>0,ao=Ke.length>0;var no=a(),lo=e(no,2),co=lo[0],mo=lo[1],po=n((function(e){var o;(null===(o=null==e?void 0:e.category)||void 0===o?void 0:o.label)!==(null==co?void 0:co.label)&&mo(null==e?void 0:e.category)}),[co]),uo=h({categories:$,options:Ze,filterValue:Ke,withCategoriesDivider:oe,optionLineHeight:q}),vo=uo.items,bo=uo.itemsMap,fo=uo.selectableItems,ho=n((function(e,o){le(fo[o]),io(o)&&to(o),Ae&&Ue("")}),[le,fo,io,Ae,Ue]),Co=C({getOptionId:g,defaultVisualFocusFirstIndex:X,onClick:ho,isChildSelectable:io,options:fo,inputRef:qe}),go=Co.visualFocusItemIndex,xo=Co.visualFocusItemId,Io=Co.onOptionClick;return i.createElement(N,{type:"text2",ref:_e,className:t(I.combobox,A,k(I,d("size-"+P)),o(o({},I.empty,!ro),I.stickyCategory,je)),id:V,"data-testid":Te||p(u.COMBOBOX,V),ellipsis:!1,"data-vibe":y.COMBOBOX},i.createElement("div",{className:I.comboboxList,style:{maxHeight:G}},i.createElement(j,{ref:qe,value:Ke,className:t(I.comboboxSearchWrapper,w),inputAriaLabel:Be,currentAriaResultId:xo,id:"combobox-search",placeholder:z,size:P,disabled:U,onChange:Ue,autoFocus:K,loading:fe,searchIconName:B,"aria-expanded":ao||ro,"aria-haspopup":"listbox",searchResultsContainerId:V?"".concat(V,"-listbox"):x,debounceRate:Ve,renderAction:ze,hideRenderActionOnInput:De}),je&&i.createElement(f,{label:null==co?void 0:co.label,color:null==co?void 0:co.color,className:M}),ro&&i.createElement(b,{stickyCategories:je,categories:$,options:vo,itemsMap:bo,optionClassName:L,optionRenderer:Se,activeItemIndex:oo,onActiveCategoryChanged:po,onOptionClick:Io,onOptionEnter:Ye,onOptionLeave:xe,optionLineHeight:q,shouldScrollToSelectedItem:ye,renderOnlyVisibleOptions:Fe,maxOptionsWithoutScroll:Ee,visualFocusItemIndex:go,id:V?"".concat(V,"-listbox"):x})),ao&&!ro&&!fe&&(Oe?Oe():i.createElement("div",{className:I.comboboxNoResults},i.createElement("div",{className:I.comboboxMessageWrapper},i.createElement("span",{className:I.comboboxMessage},ie)),se&&!U&&i.createElement(R,{className:I.addNewButton,size:P,kind:"tertiary",onClick:so},i.createElement("span",{className:I.buttonLabel},m(ae)?ae(Ke):ae)))))}));export{F as default};
|
|
2
|
-
//# sourceMappingURL=Combobox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.js","sources":["../../../../src/components/Combobox/Combobox.tsx"],"sourcesContent":["import cx from \"classnames\";\nimport React, { useRef, useState, forwardRef, useMemo, useCallback } from \"react\";\nimport { isFunction } from \"es-toolkit\";\nimport { noop as NOOP, camelCase } from \"es-toolkit\";\nimport { getStyle, useMergeRef, useWarnDeprecated } from \"@vibe/shared\";\nimport { ComponentDefaultTestId, getTestId } from \"../../tests/test-ids-utils\";\n\nimport { Search } from \"@vibe/search\";\nimport { Button } from \"@vibe/button\";\nimport { Text } from \"@vibe/typography\";\n\nimport { defaultFilter } from \"./ComboboxService\";\nimport { ComboboxItems } from \"./components/ComboboxItems/ComboboxItems\";\nimport { StickyCategoryHeader } from \"./components/StickyCategoryHeader/StickyCategoryHeader\";\nimport { useItemsData, useKeyboardNavigation } from \"./ComboboxHelpers/ComboboxHelpers\";\nimport { getOptionId } from \"./helpers\";\nimport { type ElementContent, type VibeComponentProps } from \"../../types\";\nimport {\n type IComboboxCategoryMap,\n type IComboboxItem,\n type IComboboxOption,\n COMBOBOX_LISTBOX_ID,\n type IComboboxCategory\n} from \"./components/ComboboxConstants\";\nimport styles from \"./Combobox.module.scss\";\nimport { type ComboboxSizes } from \"./Combobox.types\";\nimport type { IconButton } from \"@vibe/icon-button\";\nimport { type MenuButton } from \"@vibe/menu-button\";\nimport { ComponentVibeId } from \"../../tests/constants\";\nimport { type SubIcon } from \"@vibe/icon\";\n\nexport interface ComboboxProps extends VibeComponentProps {\n /**\n * Class name applied to each option item.\n */\n optionClassName?: string;\n /**\n * Class name applied to the search wrapper.\n */\n searchWrapperClassName?: string;\n /**\n * Class name applied to the sticky category header.\n */\n stickyCategoryClassName?: string;\n /**\n * Placeholder text displayed in the search input.\n */\n placeholder?: string;\n /**\n * Message displayed when no results are found.\n */\n noResultsMessage?: string;\n /**\n * If true, the combobox is disabled.\n */\n disabled?: boolean;\n /**\n * The list of available options.\n */\n options?: IComboboxOption[];\n /**\n * The list of available categories.\n */\n categories?: IComboboxCategoryMap;\n /**\n * If true, displays a divider between category sections.\n */\n withCategoriesDivider?: boolean;\n /**\n * The size of the combobox.\n */\n size?: ComboboxSizes;\n /**\n * The height of each option item.\n */\n optionLineHeight?: number;\n /**\n * The height of the options list.\n */\n optionsListHeight?: number;\n /**\n * If true, the search input is focused when the component mounts.\n */\n autoFocus?: boolean;\n /**\n * Callback fired when the \"Add new\" button is clicked.\n */\n onAddNew?: (value: string) => void;\n /**\n * Label displayed for the \"Add new\" button.\n */\n addNewLabel?: ((label: string) => ElementContent) | string;\n /**\n * Custom filter function for searching options.\n */\n filter?: (filterValue: string, options: IComboboxOption[]) => IComboboxOption[];\n /**\n * The default search input\n */\n defaultFilter?: string;\n /**\n * If true, disables filtering.\n */\n disableFilter?: boolean;\n /**\n * Controlled search input value.\n */\n filterValue?: string;\n /**\n * Callback fired when the search input value changes.\n */\n onFilterChanged?: (value: string) => void;\n /**\n * If true, displays a loading state.\n */\n loading?: boolean;\n /**\n * Callback fired when an option is hovered.\n */\n onOptionHover?: (event: React.MouseEvent, index: number, option: IComboboxOption) => void;\n /**\n * Callback fired when the mouse leaves an option.\n */\n onOptionLeave?: () => void;\n /**\n * If true, automatically scrolls to the selected option.\n */\n shouldScrollToSelectedItem?: boolean;\n /**\n * Custom renderer for when no results are found.\n */\n noResultsRenderer?: () => JSX.Element;\n /**\n * If true, keeps categories visible when scrolling.\n */\n stickyCategories?: boolean;\n /**\n * If true, visually focuses the first item by default.\n */\n defaultVisualFocusFirstIndex?: boolean;\n /**\n * If true, clears the search input when an option is selected.\n */\n clearFilterOnSelection?: boolean;\n /**\n * Custom renderer for options.\n */\n optionRenderer?: (option: IComboboxOption) => JSX.Element;\n /**\n * Maximum number of options displayed before scrolling.\n */\n maxOptionsWithoutScroll?: number;\n /**\n * If true, renders only visible options for performance optimization.\n */\n renderOnlyVisibleOptions?: boolean;\n /**\n * Callback fired when an option is clicked.\n */\n onClick?: (optionData: IComboboxOption) => void;\n /**\n * Custom search icon.\n */\n searchIcon?: SubIcon;\n /**\n * ARIA label for the search input.\n */\n searchInputAriaLabel?: string;\n /**\n * The debounce rate for filtering.\n */\n debounceRate?: number;\n /**\n * Ref for the search input element.\n */\n searchInputRef?: React.RefObject<HTMLInputElement>;\n /**\n * Additional action button inside the search input.\n */\n renderAction?: React.ReactElement<typeof IconButton | typeof MenuButton>;\n /**\n * If true, hides the additional action when the user types in the search input.\n */\n hideRenderActionOnInput?: boolean;\n}\n\nconst Combobox = forwardRef(\n (\n {\n className = \"\",\n optionClassName = \"\",\n searchWrapperClassName,\n stickyCategoryClassName,\n searchIcon,\n id = \"\",\n placeholder = \"\",\n size = \"medium\",\n defaultVisualFocusFirstIndex,\n optionLineHeight = 32,\n optionsListHeight,\n autoFocus = false,\n disabled = false,\n options = [],\n categories,\n withCategoriesDivider = false,\n noResultsMessage = \"No results found\",\n onAddNew,\n addNewLabel = \"Add new\",\n onClick = (_optionData: IComboboxOption) => {},\n filter = defaultFilter,\n disableFilter = false,\n filterValue: filterValueProp,\n onFilterChanged,\n loading = false,\n onOptionHover = NOOP,\n onOptionLeave = NOOP,\n shouldScrollToSelectedItem = true,\n noResultsRenderer,\n stickyCategories = false,\n optionRenderer = null,\n renderOnlyVisibleOptions = false,\n clearFilterOnSelection = false,\n maxOptionsWithoutScroll,\n defaultFilter: defaultFilterValue = \"\",\n searchInputAriaLabel = \"Search for content\",\n \"data-testid\": dataTestId,\n debounceRate,\n searchInputRef,\n renderAction: RenderAction,\n hideRenderActionOnInput\n }: ComboboxProps,\n ref: React.ForwardedRef<HTMLElement>\n ) => {\n useWarnDeprecated({\n component: \"Combobox\",\n message:\n \"This component is deprecated and will be removed in the next major version. Please use Dropdown box mode from @vibe/core instead.\"\n });\n\n const componentRef = useRef(null);\n const inputRef = useRef(null);\n const mergedRef = useMergeRef(ref, componentRef);\n const mergedInputRef = useMergeRef(inputRef, searchInputRef);\n\n const [filterValue, setFilterValue] = useState(filterValueProp || defaultFilterValue);\n\n if (filterValueProp !== undefined && filterValueProp !== filterValue) {\n setFilterValue(filterValueProp);\n }\n\n const onChangeCallback = useCallback(\n (value: string) => {\n setActiveOptionIndex(-1);\n if (onFilterChanged) {\n onFilterChanged(value);\n }\n setFilterValue(value);\n },\n [setFilterValue, onFilterChanged]\n );\n\n const onOptionHoverCB = useCallback(\n (event: React.MouseEvent, index: number, option: IComboboxOption) => {\n onOptionHover(event, index, option);\n },\n [onOptionHover]\n );\n\n const filteredOptions: IComboboxOption[] = useMemo(() => {\n if (disableFilter) {\n return options;\n }\n return filter(filterValue, options);\n }, [options, filterValue, filter, disableFilter]);\n\n const [activeOptionIndex, setActiveOptionIndex] = useState(-1);\n\n const isChildSelectable = useCallback(\n (index: number) => {\n return index !== undefined && filteredOptions[index] && !filteredOptions[index].disabled;\n },\n [filteredOptions]\n );\n\n const onAddNewCallback = useCallback(() => {\n onAddNew && onAddNew(filterValue);\n // clear filter after adding\n setFilterValue(\"\");\n }, [onAddNew, filterValue, setFilterValue]);\n\n const hasResults = filteredOptions.length > 0;\n const hasFilter = filterValue.length > 0;\n\n function getAddNewLabel() {\n if (isFunction(addNewLabel)) {\n return addNewLabel(filterValue);\n }\n return addNewLabel;\n }\n\n function renderNoResults() {\n if (noResultsRenderer) {\n return noResultsRenderer();\n }\n\n return (\n <div className={styles.comboboxNoResults}>\n <div className={styles.comboboxMessageWrapper}>\n <span className={styles.comboboxMessage}>{noResultsMessage}</span>\n </div>\n {onAddNew && !disabled && (\n <Button className={styles.addNewButton} size={size} kind=\"tertiary\" onClick={onAddNewCallback}>\n <span className={styles.buttonLabel}>{getAddNewLabel()}</span>\n </Button>\n )}\n </div>\n );\n }\n\n const [activeCategory, setActiveCategory] = useState<IComboboxCategory>();\n\n const onActiveCategoryChanged = useCallback(\n (categoryData: IComboboxItem) => {\n if (categoryData?.category?.label !== activeCategory?.label) {\n setActiveCategory(categoryData?.category);\n }\n },\n [activeCategory]\n );\n\n const { items, itemsMap, selectableItems } = useItemsData({\n categories,\n options: filteredOptions,\n filterValue,\n withCategoriesDivider,\n optionLineHeight\n });\n\n const overrideOnClick = useCallback(\n (_event: React.MouseEvent | React.KeyboardEvent, itemIndex: number) => {\n onClick(selectableItems[itemIndex]);\n if (isChildSelectable(itemIndex)) {\n setActiveOptionIndex(itemIndex);\n }\n if (clearFilterOnSelection) {\n // clear filter after adding\n onChangeCallback(\"\");\n }\n },\n [onClick, selectableItems, isChildSelectable, clearFilterOnSelection, onChangeCallback]\n );\n\n const {\n visualFocusItemIndex,\n visualFocusItemId,\n onOptionClick: overrideOnOptionClick\n } = useKeyboardNavigation({\n getOptionId,\n defaultVisualFocusFirstIndex,\n onClick: overrideOnClick,\n isChildSelectable,\n options: selectableItems,\n inputRef: mergedInputRef\n });\n\n return (\n <Text\n type=\"text2\"\n ref={mergedRef}\n className={cx(styles.combobox, className, getStyle(styles, camelCase(\"size-\" + size)), {\n [styles.empty]: !hasResults,\n [styles.stickyCategory]: stickyCategories\n })}\n id={id}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.COMBOBOX, id)}\n ellipsis={false}\n data-vibe={ComponentVibeId.COMBOBOX}\n >\n <div className={styles.comboboxList} style={{ maxHeight: optionsListHeight }}>\n <Search\n ref={mergedInputRef}\n value={filterValue}\n className={cx(styles.comboboxSearchWrapper, searchWrapperClassName)}\n inputAriaLabel={searchInputAriaLabel}\n currentAriaResultId={visualFocusItemId}\n id=\"combobox-search\"\n placeholder={placeholder}\n size={size}\n disabled={disabled}\n onChange={onChangeCallback}\n autoFocus={autoFocus}\n loading={loading}\n searchIconName={searchIcon}\n aria-expanded={hasFilter || hasResults}\n aria-haspopup=\"listbox\"\n searchResultsContainerId={id ? `${id}-listbox` : COMBOBOX_LISTBOX_ID}\n debounceRate={debounceRate}\n renderAction={RenderAction}\n hideRenderActionOnInput={hideRenderActionOnInput}\n />\n {stickyCategories && (\n <StickyCategoryHeader\n label={activeCategory?.label}\n color={activeCategory?.color}\n className={stickyCategoryClassName}\n />\n )}\n {hasResults && (\n <ComboboxItems\n stickyCategories={stickyCategories}\n categories={categories}\n options={items}\n itemsMap={itemsMap}\n optionClassName={optionClassName}\n optionRenderer={optionRenderer}\n activeItemIndex={activeOptionIndex}\n onActiveCategoryChanged={onActiveCategoryChanged}\n onOptionClick={overrideOnOptionClick}\n onOptionEnter={onOptionHoverCB}\n onOptionLeave={onOptionLeave}\n optionLineHeight={optionLineHeight}\n shouldScrollToSelectedItem={shouldScrollToSelectedItem}\n renderOnlyVisibleOptions={renderOnlyVisibleOptions}\n maxOptionsWithoutScroll={maxOptionsWithoutScroll}\n visualFocusItemIndex={visualFocusItemIndex}\n id={id ? `${id}-listbox` : COMBOBOX_LISTBOX_ID}\n />\n )}\n </div>\n {hasFilter && !hasResults && !loading && renderNoResults()}\n </Text>\n );\n }\n);\n\n// Locate loading next to search icon\n// color it with --secondary-text-color\n// size it like the icon - we think it's 16px - make sure it's not fat\n\nexport default Combobox;\n"],"names":["Combobox","forwardRef","_ref","ref","_ref$className","className","_ref$optionClassName","optionClassName","searchWrapperClassName","stickyCategoryClassName","searchIcon","_ref$id","id","_ref$placeholder","placeholder","_ref$size","size","defaultVisualFocusFirstIndex","_ref$optionLineHeight","optionLineHeight","optionsListHeight","_ref$autoFocus","autoFocus","_ref$disabled","disabled","_ref$options","options","categories","_ref$withCategoriesDi","withCategoriesDivider","_ref$noResultsMessage","noResultsMessage","onAddNew","_ref$addNewLabel","addNewLabel","_ref$onClick","onClick","_optionData","_ref$filter","filter","defaultFilter","_ref$disableFilter","disableFilter","filterValueProp","filterValue","onFilterChanged","_ref$loading","loading","_ref$onOptionHover","onOptionHover","NOOP","_ref$onOptionLeave","onOptionLeave","_ref$shouldScrollToSe","shouldScrollToSelectedItem","noResultsRenderer","_ref$stickyCategories","stickyCategories","_ref$optionRenderer","optionRenderer","_ref$renderOnlyVisibl","renderOnlyVisibleOptions","_ref$clearFilterOnSel","clearFilterOnSelection","maxOptionsWithoutScroll","_ref$defaultFilter","defaultFilterValue","_ref$searchInputAriaL","searchInputAriaLabel","dataTestId","debounceRate","searchInputRef","RenderAction","renderAction","hideRenderActionOnInput","useWarnDeprecated","component","message","componentRef","useRef","inputRef","mergedRef","useMergeRef","mergedInputRef","_useState","useState","_useState2","_slicedToArray","setFilterValue","undefined","onChangeCallback","useCallback","value","setActiveOptionIndex","onOptionHoverCB","event","index","option","filteredOptions","useMemo","_useState3","_useState4","activeOptionIndex","isChildSelectable","onAddNewCallback","hasResults","length","hasFilter","_useState5","_useState6","activeCategory","setActiveCategory","onActiveCategoryChanged","categoryData","category","_a","label","_useItemsData","useItemsData","items","itemsMap","selectableItems","overrideOnClick","_event","itemIndex","_useKeyboardNavigatio","useKeyboardNavigation","getOptionId","visualFocusItemIndex","visualFocusItemId","overrideOnOptionClick","onOptionClick","React","createElement","Text","type","cx","styles","combobox","getStyle","camelCase","_defineProperty","empty","stickyCategory","getTestId","ComponentDefaultTestId","COMBOBOX","ellipsis","ComponentVibeId","comboboxList","style","maxHeight","Search","comboboxSearchWrapper","inputAriaLabel","currentAriaResultId","onChange","searchIconName","searchResultsContainerId","concat","COMBOBOX_LISTBOX_ID","StickyCategoryHeader","color","ComboboxItems","activeItemIndex","onOptionEnter","comboboxNoResults","comboboxMessageWrapper","comboboxMessage","Button","addNewButton","kind","buttonLabel","isFunction"],"mappings":"gzCA0LMA,IAAAA,EAAWC,GACf,SAAAC,EA4CEC,GACE,IAAAC,EAAAF,EA3CAG,UAAAA,OAAY,IAAHD,EAAG,GAAEA,EAAAE,EAAAJ,EACdK,gBAAAA,OAAkB,IAAHD,EAAG,GAAEA,EACpBE,EAAsBN,EAAtBM,uBACAC,EAAuBP,EAAvBO,wBACAC,EAAUR,EAAVQ,WAAUC,EAAAT,EACVU,GAAAA,OAAK,IAAHD,EAAG,GAAEA,EAAAE,EAAAX,EACPY,YAAAA,OAAc,IAAHD,EAAG,GAAEA,EAAAE,EAAAb,EAChBc,KAAAA,OAAO,IAAHD,EAAG,SAAQA,EACfE,EAA4Bf,EAA5Be,6BAA4BC,EAAAhB,EAC5BiB,iBAAAA,OAAmB,IAAHD,EAAG,GAAEA,EACrBE,EAAiBlB,EAAjBkB,kBAAiBC,EAAAnB,EACjBoB,UAAAA,OAAY,IAAHD,GAAQA,EAAAE,EAAArB,EACjBsB,SAAAA,OAAW,IAAHD,GAAQA,EAAAE,EAAAvB,EAChBwB,QAAAA,OAAU,IAAHD,EAAG,GAAEA,EACZE,EAAUz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oJ,EACjD1F,aAAcA,GACdG,aAAcD,GACdE,wBAAyBA,KAE1BjB,IACC2E,EAACC,cAAA4B,EACC,CAAA7C,MAAON,cAAA,EAAAA,GAAgBM,MACvB8C,MAAOpD,cAAA,EAAAA,GAAgBoD,MACvB7J,UAAWI,IAGdgG,IACC2B,EAAAC,cAAC8B,EACC,CAAA1G,iBAAkBA,GAClB9B,WAAYA,EACZD,QAAS6F,GACTC,SAAUA,GACVjH,gBAAiBA,EACjBoD,eAAgBA,GAChByG,gBAAiB9D,GACjBU,wBAAyBA,GACzBmB,cAAeD,GACfmC,cAAevE,GACf1C,cAAeA,GACfjC,iBAAkBA,EAClBmC,2BAA4BA,GAC5BO,yBAA0BA,GAC1BG,wBAAyBA,GACzBgE,qBAAsBA,GACtBpH,GAAIA,EAAE,GAAAmJ,OAAMnJ,EAAeoJ,YAAAA,KAIhCrD,KAAcF,KAAe1D,KAhI5BQ,GACKA,KAIP6E,EAAKC,cAAA,MAAA,CAAAhI,UAAWoI,EAAO6B,mBACrBlC,EAAAC,cAAA,MAAA,CAAKhI,UAAWoI,EAAO8B,wBACrBnC,EAAMC,cAAA,OAAA,CAAAhI,UAAWoI,EAAO+B,iBAAkBzI,KAE3CC,KAAaR,GACZ4G,gBAACqC,EAAM,CAACpK,UAAWoI,EAAOiC,aAAc1J,KAAMA,EAAM2J,KAAK,WAAWvI,QAASoE,IAC3E4B,EAAAC,cAAA,OAAA,CAAMhI,UAAWoI,EAAOmC,aAlB5BC,EAAW3I,IACNA,GAAYU,IAEdV,OAuIX"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var o={combobox:"combobox_2a6b58ac7b",stickyCategory:"stickyCategory_655c581b7d",comboboxCategory:"comboboxCategory_f52f869d99",sizeSmall:"sizeSmall_69e8df1fdd",sizeMedium:"sizeMedium_6e751c081a",sizeLarge:"sizeLarge_69e8df1fdd",empty:"empty_3fd622d649",comboboxSearchWrapper:"comboboxSearchWrapper_87a3a36527",comboboxNoResults:"comboboxNoResults_0380bb1708",comboboxMessageWrapper:"comboboxMessageWrapper_7558bb58d7",comboboxMessage:"comboboxMessage_8bd31f4821",addNewButton:"addNewButton_b333f04da6",buttonLabel:"buttonLabel_8bd31f4821",comboboxList:"comboboxList_654ea7e05d"};!function(o){const e="s_id-5bf292a5a8b0_4_5_27";if("undefined"!=typeof document){const n=document.head||document.getElementsByTagName("head")[0];if(n.querySelector("#"+e))return;const t=document.createElement("style");t.id=e,n.firstChild?n.insertBefore(t,n.firstChild):n.appendChild(t),t.appendChild(document.createTextNode(o))}else globalThis.injectedStyles&&(globalThis.injectedStyles[e]=o)}("/* stylelint-disable */\n/* stylelint-enable */\n/* stylelint-disable selector-class-pattern */\n.combobox_2a6b58ac7b {\n -webkit-font-smoothing: var(--font-smoothing-webkit);\n -moz-osx-font-smoothing: var(--font-smoothing-moz);\n height: 100%;\n display: flex;\n flex-direction: column;\n position: relative;\n margin-bottom: var(--space-8);\n}\n.combobox_2a6b58ac7b.stickyCategory_655c581b7d .comboboxCategory_f52f869d99 {\n z-index: 10;\n background-color: var(--secondary-background-color);\n}\n/* Relative to Search height */\n.combobox_2a6b58ac7b.stickyCategory_655c581b7d.sizeSmall_69e8df1fdd .comboboxCategory_f52f869d99 {\n top: 32px;\n}\n.combobox_2a6b58ac7b.stickyCategory_655c581b7d.sizeMedium_6e751c081a .comboboxCategory_f52f869d99 {\n top: 40px;\n}\n.combobox_2a6b58ac7b.stickyCategory_655c581b7d.sizeLarge_69e8df1fdd .comboboxCategory_f52f869d99 {\n top: 48px;\n}\n.combobox_2a6b58ac7b.empty_3fd622d649 {\n max-height: 200px;\n margin-bottom: 0;\n}\n.comboboxSearchWrapper_87a3a36527 {\n position: sticky;\n top: 0;\n z-index: 12;\n}\n.comboboxNoResults_0380bb1708 {\n margin-top: var(--space-8);\n flex: 1 1 auto;\n height: calc(100% - 20px);\n overflow: hidden;\n position: relative;\n padding: 0 16px;\n display: flex;\n flex-direction: column;\n}\n.comboboxNoResults_0380bb1708 .comboboxMessageWrapper_7558bb58d7 {\n flex: 1 0 auto;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.comboboxNoResults_0380bb1708 .comboboxMessageWrapper_7558bb58d7 .comboboxMessage_8bd31f4821 {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.comboboxNoResults_0380bb1708 .addNewButton_b333f04da6 {\n flex: 0 0 auto;\n width: 100% !important;\n margin-bottom: 8px;\n}\n.comboboxNoResults_0380bb1708 .addNewButton_b333f04da6 .buttonLabel_8bd31f4821 {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.comboboxList_654ea7e05d {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n padding: 0 4px;\n overflow: hidden;\n}");export{o as default};
|
|
2
|
-
//# sourceMappingURL=Combobox.module.scss.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{defineProperty as e}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import{__rest as t}from"../../../../_virtual/_tslib.js";import o,{useMemo as i}from"react";import n from"classnames";import r from"../components/ComboboxOption/ComboboxOption.js";import s from"../components/ComboboxCategory/ComboboxCategory.js";import{COMBOBOX_DIVIDER_ITEM as a,COMBOBOX_CATEGORY_ITEM as c,COMBOBOX_OPTION_ITEM as l}from"../components/ComboboxConstants.js";import m from"../../../hooks/useActiveDescendantListFocus/index.js";import{getOptionsByCategories as d}from"../ComboboxService.js";import p from"../components/ComboboxItems/ComboboxItems.module.scss.js";import u from"./ComboboxHelpers.module.scss.js";import g from"../../../../components/divider/dist/Divider/Divider.js";var h=17,v=32;function f(t){var o=t.categories,r=t.options,s=t.filterValue,a=t.withCategoriesDivider,c=t.optionLineHeight;return i((function(){var t=[],i=[],l=new Map;if(o){var m=d(r,o,s),u=0;Object.keys(m).forEach((function(r,s){var d=a&&0!==s;d&&t.push(I({categoryId:r}));var g=m[r].length>0,h=0===s,v=b({categoryId:r,categoryData:o[r],withDivider:d,className:n(e(e(e({},p.categoryWithOptions,g),p.categoryWithoutOptions,!g),p.firstCategory,h))});t.push(v),l.set(r,v),m[r].forEach((function(e){var o=C({height:c,option:e,index:u,categoryId:v.id});l.set(o.id,o),t.push(o),i.push(e),u++}))}))}else i=r,t=r.map((function(e,t){return C({height:c,option:e,index:t})}));return{items:t,itemsMap:l,selectableItems:i}}),[o,r,s,a,c])}function y(e){var t=e.defaultVisualFocusFirstIndex,o=e.inputRef,n=e.onClick,r=e.isChildSelectable,s=e.options,a=e.getOptionId,c=i((function(){return s.map((function(e,t){return a(null==e?void 0:e.id,t)}))}),[a,s]),l=m({defaultVisualFocusFirstIndex:t,focusedElementRef:o,focusedElementRole:m.roles.COMBOBOX,itemsIds:c,onItemClick:n,isItemSelectable:r,isIgnoreSpaceAsItemSelection:!0});return{visualFocusItemIndex:l.visualFocusItemIndex,visualFocusItemId:l.visualFocusItemId,onOptionClick:n}}function I(e){return{type:a,height:h,id:"".concat(e.categoryId,"-divider")}}function b(e){return{height:v,type:c,category:e.categoryData,id:e.categoryId,withDivider:e.withDivider,className:e.className}}function C(e){var t=e.option,o=e.index;return{type:l,height:e.height,belongToCategory:!0,index:o,option:t,id:t.id||""+o,optionRenderer:e.optionRenderer,isActive:e.isActive,optionLineHeight:e.optionLineHeight,shouldScrollToSelectedItem:e.shouldScrollToSelectedItem,categoryId:e.categoryId}}function x(e){var i,r,s=e.item,m=e.style,d=e.optionEvents,p=e.optionRenderData,g=e.isVirtualized,h=e.stickyCategories,v=s.type,f=t(s,["type"]);switch(v){case a:r=O({id:f.id,height:f.height});break;case c:r=k({id:f.id,category:f.category,className:f.className}),h&&!g&&(i=u.sticky);break;case l:r=j(Object.assign(Object.assign(Object.assign({},f),d),p))}return o.createElement("div",{key:f.id,className:n(u.comboboxItemContainer,i),style:m},r)}function O(e){return o.createElement("div",{className:u.dividerContainer,style:{height:e.height}},o.createElement(g,{className:u.divider,key:e.id}))}function k(e){return o.createElement(s,{key:e.id,category:e.category,className:e.className})}function j(e){var t=e.index,i=e.onOptionEnter;return o.createElement(r,{className:e.className,index:t,key:e.id,option:e.option,optionRenderer:e.optionRenderer,scrollRef:e.scrollRef,isActive:e.activeItemIndex===t,visualFocus:t===e.visualFocusItemIndex,onOptionClick:e.onOptionClick,onOptionHover:i,onOptionLeave:e.onOptionLeave,onOptionEnter:i,optionLineHeight:e.optionLineHeight,shouldScrollWhenActive:e.shouldScrollToSelectedItem})}export{k as categoryItemRenderer,x as comboboxItemRenderer,b as createCategoryItemObject,I as createDividerItemObject,C as createOptionItemObject,O as dividerItemRenderer,j as optionItemRenderer,f as useItemsData,y as useKeyboardNavigation};
|
|
2
|
-
//# sourceMappingURL=ComboboxHelpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxHelpers.js","sources":["../../../../../src/components/Combobox/ComboboxHelpers/ComboboxHelpers.tsx"],"sourcesContent":["import React, { type CSSProperties, type MutableRefObject, useMemo } from \"react\";\nimport cx from \"classnames\";\nimport ComboboxOption from \"../components/ComboboxOption/ComboboxOption\";\nimport ComboboxCategory from \"../components/ComboboxCategory/ComboboxCategory\";\nimport { Divider } from \"@vibe/divider\";\nimport {\n COMBOBOX_DIVIDER_ITEM,\n COMBOBOX_CATEGORY_ITEM,\n COMBOBOX_OPTION_ITEM,\n type IComboboxCategory,\n type IComboboxOption,\n type IComboboxCategoryMap,\n type IComboboxItem,\n type IOptionItemRendererArgs,\n type IComboboxOptionEvents\n} from \"../components/ComboboxConstants\";\nimport useActiveDescendantListFocus from \"../../../hooks/useActiveDescendantListFocus\";\nimport { getOptionsByCategories } from \"../ComboboxService\";\nimport comboboxItemsStyles from \"../components/ComboboxItems/ComboboxItems.module.scss\";\nimport styles from \"./ComboboxHelpers.module.scss\";\n\nconst DIVIDER_HEIGHT = 17;\nconst CATEGORY_HEIGHT = 32;\n\nexport function useItemsData({\n categories,\n options,\n filterValue,\n withCategoriesDivider,\n optionLineHeight\n}: {\n categories: IComboboxCategoryMap;\n options: IComboboxOption[];\n filterValue: string;\n withCategoriesDivider: boolean;\n optionLineHeight: number;\n}) {\n return useMemo(() => {\n let items: IComboboxItem[] = [];\n let selectableItems: IComboboxOption[] = [];\n const itemsMap = new Map();\n\n if (categories) {\n const optionsByCategories = getOptionsByCategories(options, categories, filterValue);\n let optionIndex = 0;\n Object.keys(optionsByCategories).forEach((categoryId, categoryIndex) => {\n const withDivider = withCategoriesDivider && categoryIndex !== 0;\n if (withDivider) {\n items.push(createDividerItemObject({ categoryId }));\n }\n\n const isCategoryWithOptions = optionsByCategories[categoryId].length > 0;\n const isFirstCategory = categoryIndex === 0;\n\n const categoryObject = createCategoryItemObject({\n categoryId,\n categoryData: categories[categoryId],\n withDivider,\n className: cx({\n [comboboxItemsStyles.categoryWithOptions]: isCategoryWithOptions,\n [comboboxItemsStyles.categoryWithoutOptions]: !isCategoryWithOptions,\n [comboboxItemsStyles.firstCategory]: isFirstCategory\n })\n });\n\n // save category object in both items array and categories map\n items.push(categoryObject);\n itemsMap.set(categoryId, categoryObject);\n\n optionsByCategories[categoryId].forEach((option: IComboboxOption) => {\n const itemObject = createOptionItemObject({\n height: optionLineHeight,\n option,\n index: optionIndex,\n categoryId: categoryObject.id\n });\n\n itemsMap.set(itemObject.id, itemObject);\n items.push(itemObject);\n selectableItems.push(option);\n optionIndex++;\n });\n });\n } else {\n selectableItems = options;\n items = options.map((option, index) => {\n return createOptionItemObject({\n height: optionLineHeight,\n option,\n index\n });\n });\n }\n return { items, itemsMap, selectableItems };\n }, [categories, options, filterValue, withCategoriesDivider, optionLineHeight]);\n}\n\nexport function useKeyboardNavigation({\n defaultVisualFocusFirstIndex,\n inputRef,\n onClick,\n isChildSelectable,\n options,\n getOptionId\n}: {\n defaultVisualFocusFirstIndex?: boolean;\n inputRef: MutableRefObject<HTMLElement>;\n onClick: (event: React.KeyboardEvent | React.MouseEvent, index: number) => void;\n isChildSelectable: (index: number) => boolean;\n options: IComboboxOption[];\n getOptionId: (optionId: string, index: number) => string;\n}) {\n const filteredOptionsIds = useMemo(\n () => options.map((option: IComboboxOption, index: number) => getOptionId(option?.id, index)),\n [getOptionId, options]\n );\n\n const { visualFocusItemIndex, visualFocusItemId } = useActiveDescendantListFocus({\n defaultVisualFocusFirstIndex,\n focusedElementRef: inputRef,\n focusedElementRole: useActiveDescendantListFocus.roles.COMBOBOX,\n itemsIds: filteredOptionsIds,\n onItemClick: onClick,\n isItemSelectable: isChildSelectable,\n isIgnoreSpaceAsItemSelection: true\n });\n\n return { visualFocusItemIndex, visualFocusItemId, onOptionClick: onClick };\n}\nexport function createDividerItemObject({ categoryId }: { categoryId: string }): IComboboxItem {\n return { type: COMBOBOX_DIVIDER_ITEM, height: DIVIDER_HEIGHT, id: `${categoryId}-divider` };\n}\n\nexport function createCategoryItemObject({\n withDivider,\n categoryId,\n categoryData,\n className\n}: {\n withDivider: boolean;\n categoryId: string;\n categoryData: IComboboxCategory;\n className: string;\n}): IComboboxItem {\n return {\n height: CATEGORY_HEIGHT,\n type: COMBOBOX_CATEGORY_ITEM,\n category: categoryData,\n id: categoryId,\n withDivider,\n className\n };\n}\n\nexport function createOptionItemObject({\n option,\n height,\n index,\n optionRenderer,\n isActive,\n optionLineHeight,\n shouldScrollToSelectedItem,\n categoryId\n}: {\n option?: IComboboxOption;\n height?: number;\n index?: number;\n optionRenderer?: (option: IComboboxOption) => JSX.Element;\n isActive?: boolean;\n optionLineHeight?: number;\n shouldScrollToSelectedItem?: boolean;\n categoryId?: string;\n}): IComboboxItem {\n return {\n type: COMBOBOX_OPTION_ITEM,\n height,\n belongToCategory: true,\n index,\n option,\n id: option.id || index.toString(),\n optionRenderer,\n isActive,\n optionLineHeight,\n shouldScrollToSelectedItem,\n categoryId\n };\n}\n\nexport function comboboxItemRenderer({\n item,\n style,\n optionEvents,\n optionRenderData,\n isVirtualized,\n stickyCategories\n}: {\n item: IComboboxItem;\n style: CSSProperties;\n optionEvents: IComboboxOptionEvents;\n optionRenderData: any;\n isVirtualized: boolean;\n stickyCategories?: boolean;\n}) {\n const { type, ...otherArgs } = item;\n let customClassNames;\n let innerElement;\n switch (type) {\n case COMBOBOX_DIVIDER_ITEM: {\n innerElement = dividerItemRenderer({ id: otherArgs.id, height: otherArgs.height });\n break;\n }\n case COMBOBOX_CATEGORY_ITEM: {\n innerElement = categoryItemRenderer({\n id: otherArgs.id,\n category: otherArgs.category,\n className: otherArgs.className\n });\n if (stickyCategories && !isVirtualized) {\n customClassNames = styles.sticky;\n }\n break;\n }\n case COMBOBOX_OPTION_ITEM: {\n innerElement = optionItemRenderer({\n ...otherArgs,\n ...optionEvents,\n ...optionRenderData\n });\n break;\n }\n }\n\n return (\n <div key={otherArgs.id} className={cx(styles.comboboxItemContainer, customClassNames)} style={style}>\n {innerElement}\n </div>\n );\n}\n\nexport function dividerItemRenderer({ id, height }: { id: string; height: number }) {\n return (\n <div className={styles.dividerContainer} style={{ height: height }}>\n <Divider className={styles.divider} key={id} />\n </div>\n );\n}\n\nexport function categoryItemRenderer({\n id,\n category,\n className\n}: {\n id: string;\n category: IComboboxCategory;\n className: string;\n}) {\n return <ComboboxCategory key={id} category={category} className={className} />;\n}\n\nexport function optionItemRenderer({\n id,\n index,\n option,\n className,\n onOptionClick,\n onOptionEnter,\n onOptionLeave,\n optionLineHeight,\n optionRenderer,\n scrollRef,\n shouldScrollToSelectedItem,\n activeItemIndex,\n visualFocusItemIndex\n}: IOptionItemRendererArgs) {\n return (\n <ComboboxOption\n className={className}\n index={index}\n key={id}\n option={option}\n optionRenderer={optionRenderer}\n scrollRef={scrollRef}\n isActive={activeItemIndex === index}\n visualFocus={index === visualFocusItemIndex}\n onOptionClick={onOptionClick}\n onOptionHover={onOptionEnter}\n onOptionLeave={onOptionLeave}\n onOptionEnter={onOptionEnter}\n optionLineHeight={optionLineHeight}\n shouldScrollWhenActive={shouldScrollToSelectedItem}\n />\n );\n}\n"],"names":["DIVIDER_HEIGHT","CATEGORY_HEIGHT","useItemsData","_ref","categories","options","filterValue","withCategoriesDivider","optionLineHeight","useMemo","items","selectableItems","itemsMap","Map","optionsByCategories","getOptionsByCategories","optionIndex","Object","keys","forEach","categoryId","categoryIndex","withDivider","push","createDividerItemObject","isCategoryWithOptions","length","isFirstCategory","categoryObject","createCategoryItemObject","categoryData","className","cx","_defineProperty","comboboxItemsStyles","categoryWithOptions","categoryWithoutOptions","firstCategory","set","option","itemObject","createOptionItemObject","height","index","id","map","useKeyboardNavigation","_ref2","defaultVisualFocusFirstIndex","inputRef","onClick","isChildSelectable","getOptionId","filteredOptionsIds","_useActiveDescendantL","useActiveDescendantListFocus","focusedElementRef","focusedElementRole","roles","COMBOBOX","itemsIds","onItemClick","isItemSelectable","isIgnoreSpaceAsItemSelection","visualFocusItemIndex","visualFocusItemId","onOptionClick","_ref3","type","COMBOBOX_DIVIDER_ITEM","concat","_ref4","COMBOBOX_CATEGORY_ITEM","category","_ref5","COMBOBOX_OPTION_ITEM","belongToCategory","optionRenderer","isActive","shouldScrollToSelectedItem","comboboxItemRenderer","_ref6","customClassNames","innerElement","item","style","optionEvents","optionRenderData","isVirtualized","stickyCategories","otherArgs","__rest","dividerItemRenderer","categoryItemRenderer","styles","sticky","optionItemRenderer","assign","React","createElement","key","comboboxItemContainer","_ref7","dividerContainer","Divider","divider","_ref8","ComboboxCategory","_ref9","onOptionEnter","ComboboxOption","scrollRef","activeItemIndex","visualFocus","onOptionHover","onOptionLeave","shouldScrollWhenActive"],"mappings":"0wBAqBA,IAAMA,EAAiB,GACjBC,EAAkB,GAER,SAAAC,EAAYC,GAY3B,IAXCC,EAAUD,EAAVC,WACAC,EAAOF,EAAPE,QACAC,EAAWH,EAAXG,YACAC,EAAqBJ,EAArBI,sBACAC,EAAgBL,EAAhBK,iBAQA,OAAOC,GAAQ,WACb,IAAIC,EAAyB,GACzBC,EAAqC,GACnCC,EAAW,IAAIC,IAEr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BI4G,uBAnBsBR,EAA1B7B,4BAsBF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e={comboboxItemContainer:"comboboxItemContainer_2e7662501a",dividerContainer:"dividerContainer_934132e060",divider:"divider_2076d4867d",sticky:"sticky_0d60b13207"};!function(e){const n="s_id-cfec7f62c06c_4_5_27";if("undefined"!=typeof document){const i=document.head||document.getElementsByTagName("head")[0];if(i.querySelector("#"+n))return;const t=document.createElement("style");t.id=n,i.firstChild?i.insertBefore(t,i.firstChild):i.appendChild(t),t.appendChild(document.createTextNode(e))}else globalThis.injectedStyles&&(globalThis.injectedStyles[n]=e)}(".comboboxItemContainer_2e7662501a {\n display: flex;\n flex: auto;\n width: 100%;\n background-color: var(--secondary-background-color);\n}\n\n.dividerContainer_934132e060 {\n position: relative;\n width: 95%;\n}\n\n.divider_2076d4867d {\n position: absolute;\n width: calc(100% + 16px);\n margin-inline-start: -12px;\n}\n\n.sticky_0d60b13207 {\n position: sticky;\n top: 0;\n z-index: 20;\n}");export{e as default};
|
|
2
|
-
//# sourceMappingURL=ComboboxHelpers.module.scss.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxHelpers.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e=function(e,r,n){var t=e.reduce((function(e,t){var o,u=t.categoryId;return u?((null===(o=r[u])||void 0===o?void 0:o.onlyShowOnSearch)&&!n||(e[u]?e[u].push(t):e[u]=[t]),e):e}),{});return Object.keys(r).reduce((function(e,r){return t[r]&&(e[r]=t[r]),e}),{})},r=function(e,r){return r.filter((function(r){return!e||r.label.toLowerCase().includes(e.toLowerCase())}))};export{r as defaultFilter,e as getOptionsByCategories};
|
|
2
|
-
//# sourceMappingURL=ComboboxService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxService.js","sources":["../../../../src/components/Combobox/ComboboxService.ts"],"sourcesContent":["import { type IComboboxCategoryMap, type IComboboxOption } from \"./components/ComboboxConstants\";\n\ntype OptionsByCategories = {\n [key: string]: Array<IComboboxOption>;\n};\n\nexport const getOptionsByCategories = (\n options: IComboboxOption[],\n categories: IComboboxCategoryMap,\n filterValue: string\n): OptionsByCategories => {\n const optionsByCategories = options.reduce((result: OptionsByCategories, option) => {\n const categoryId = option.categoryId;\n // skipping if the option doesn't have a category\n if (!categoryId) return result;\n if (categories[categoryId]?.onlyShowOnSearch && !filterValue) return result;\n\n if (result[categoryId]) {\n result[categoryId].push(option);\n } else {\n result[categoryId] = [option];\n }\n\n return result;\n }, {});\n\n // reorder the keys according to the categories order\n return Object.keys(categories).reduce((result: OptionsByCategories, categoryId) => {\n if (optionsByCategories[categoryId]) result[categoryId] = optionsByCategories[categoryId];\n\n return result;\n }, {});\n};\n\nexport const defaultFilter = (filterValue: string, options: IComboboxOption[]) =>\n options.filter(\n ({ label }: { label: string }) => !filterValue || label.toLowerCase().includes(filterValue.toLowerCase())\n );\n"],"names":["getOptionsByCategories","options","categories","filterValue","optionsByCategories","reduce","result","option","categoryId","_a","onlyShowOnSearch","push","Object","keys","defaultFilter","filter","_ref","label","toLowerCase","includes"],"mappings":"AAMO,IAAMA,EAAyB,SACpCC,EACAC,EACAC,GAEA,IAAMC,EAAsBH,EAAQI,QAAO,SAACC,EAA6BC,SACjEC,EAAaD,EAAOC,WAE1B,OAAKA,IACuB,QAAxBC,EAAAP,EAAWM,UAAa,IAAAC,OAAA,EAAAA,EAAAC,oBAAqBP,IAE7CG,EAAOE,GACTF,EAAOE,GAAYG,KAAKJ,GAExBD,EAAOE,GAAc,CAACD,IAL6CD,GAD7CA,CAUzB,GAAE,CAAE,GAGL,OAAOM,OAAOC,KAAKX,GAAYG,QAAO,SAACC,EAA6BE,GAGlE,OAFIJ,EAAoBI,KAAaF,EAAOE,GAAcJ,EAAoBI,IAEvEF,CACR,GAAE,CAAE,EACP,EAEaQ,EAAgB,SAACX,EAAqBF,GAA0B,OAC3EA,EAAQc,QACN,SAAAC,GAAQ,OAA2Bb,GAA3Ba,EAALC,MAAqDC,cAAcC,SAAShB,EAAYe,iBAC5F"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import o from"classnames";import a from"react";import r from"./ComboboxCategory.module.scss.js";import e from"../../Combobox.module.scss.js";var l=function(l){var m=l.category,t=l.className,c=m.label,s=m.id,b=m.color;return c?a.createElement("div",{key:s,role:"row","aria-level":1,"aria-label":m["aria-label"]||c,id:"combobox-category-".concat(s),style:b&&{color:b},className:o(r.comboboxCategory,e.comboboxCategory,t)},c):null};export{l as default};
|
|
2
|
-
//# sourceMappingURL=ComboboxCategory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxCategory.js","sources":["../../../../../../src/components/Combobox/components/ComboboxCategory/ComboboxCategory.tsx"],"sourcesContent":["import cx from \"classnames\";\nimport React, { type FC } from \"react\";\nimport { type IComboboxCategory } from \"../ComboboxConstants\";\nimport styles from \"./ComboboxCategory.module.scss\";\nimport comboboxStyles from \"../../Combobox.module.scss\";\n\nexport interface ComboboxCategoryProps {\n /**\n * The category data.\n */\n category: IComboboxCategory;\n /**\n * Class name applied to the category element.\n */\n className: string;\n}\n\nconst ComboboxCategory: FC<ComboboxCategoryProps> = ({ category, className }) => {\n const { label, id, \"aria-label\": ariaLabel, color } = category;\n\n if (!label) return null;\n\n return (\n <div\n key={id}\n role=\"row\"\n aria-level={1}\n aria-label={ariaLabel || label}\n id={`combobox-category-${id}`}\n style={color && { color }}\n className={cx(styles.comboboxCategory, comboboxStyles.comboboxCategory, className)}\n >\n {label}\n </div>\n );\n};\n\nexport default ComboboxCategory;\n"],"names":["ComboboxCategory","_ref","category","className","label","id","color","React","key","role","concat","style","cx","styles","comboboxCategory","comboboxStyles"],"mappings":"6IAiBA,IAAMA,EAA8C,SAA9BC,GAA0D,IAAzBC,EAAQD,EAARC,SAAUC,EAASF,EAATE,UACvDC,EAA8CF,EAA9CE,MAAOC,EAAuCH,EAAvCG,GAA6BC,EAAUJ,EAAVI,MAE5C,OAAKF,EAGHG,uBACEC,IAAKH,EACLI,KAAK,MACO,aAAA,eARsCP,EAAnC,eASUE,EACzBC,GAAEK,qBAAAA,OAAuBL,GACzBM,MAAOL,GAAS,CAAEA,MAAAA,GAClBH,UAAWS,EAAGC,EAAOC,iBAAkBC,EAAeD,iBAAkBX,IAEvEC,GAZc,IAerB"}
|
package/dist/src/components/Combobox/components/ComboboxCategory/ComboboxCategory.module.scss.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e={comboboxCategory:"comboboxCategory_297704ca84"};!function(e){const t="s_id-ddc89c066e12_4_5_27";if("undefined"!=typeof document){const n=document.head||document.getElementsByTagName("head")[0];if(n.querySelector("#"+t))return;const o=document.createElement("style");o.id=t,n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.appendChild(document.createTextNode(e))}else globalThis.injectedStyles&&(globalThis.injectedStyles[t]=e)}("/* stylelint-disable */\n/* stylelint-enable */\n/* stylelint-disable selector-class-pattern */\n.comboboxCategory_297704ca84 {\n color: var(--placeholder-color);\n display: flex;\n align-items: center;\n padding-top: var(--space-8);\n}");export{e as default};
|
|
2
|
-
//# sourceMappingURL=ComboboxCategory.module.scss.js.map
|
package/dist/src/components/Combobox/components/ComboboxCategory/ComboboxCategory.module.scss.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxCategory.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var o,b="combobox-divider",e="combobox-category",r="combobox-option",c="combobox-listbox";!function(o){o.DEFAULT="default",o.RENDERER="renderer"}(o||(o={}));export{e as COMBOBOX_CATEGORY_ITEM,b as COMBOBOX_DIVIDER_ITEM,c as COMBOBOX_LISTBOX_ID,r as COMBOBOX_OPTION_ITEM,o as ComboboxOptionIconType};
|
|
2
|
-
//# sourceMappingURL=ComboboxConstants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxConstants.js","sources":["../../../../../src/components/Combobox/components/ComboboxConstants.ts"],"sourcesContent":["import type React from \"react\";\nimport { type SubIcon } from \"@vibe/icon\";\nimport type { TooltipProps } from \"@vibe/tooltip\";\n\nexport const COMBOBOX_DIVIDER_ITEM = \"combobox-divider\";\nexport const COMBOBOX_CATEGORY_ITEM = \"combobox-category\";\nexport const COMBOBOX_OPTION_ITEM = \"combobox-option\";\nexport const COMBOBOX_LISTBOX_ID = \"combobox-listbox\";\n\n/**\n * @deprecated\n */\nexport enum ComboboxOptionIconType {\n DEFAULT = \"default\",\n RENDERER = \"renderer\"\n}\n\nexport interface IComboboxCategoryMap {\n /**\n * A mapping of category IDs to category details.\n */\n [key: string]: IComboboxCategory;\n}\n\nexport interface IComboboxCategory {\n /**\n * The display label of the category.\n */\n label: string;\n /**\n * The unique ID of the category.\n */\n id: string;\n /**\n * The ARIA label for accessibility.\n */\n \"aria-label\"?: string;\n /**\n * If true, the category is only shown when searching.\n */\n onlyShowOnSearch?: boolean;\n /**\n * The color associated with the category.\n */\n color?: string;\n}\n\nexport interface IComboboxOption {\n /**\n * The unique ID of the option.\n */\n id: string;\n /**\n * The ID of the category the option belongs to.\n */\n categoryId?: string;\n /**\n * The icon displayed on the left side.\n */\n leftIcon?: SubIcon | ((className: string) => JSX.Element);\n /**\n * The icon displayed on the right side.\n */\n rightIcon?: SubIcon | ((className: string) => JSX.Element);\n /**\n * The type of the left icon.\n */\n leftIconType?: ComboboxOptionIconType;\n /**\n * The type of the right icon.\n */\n rightIconType?: ComboboxOptionIconType;\n /**\n * The display label of the option.\n */\n label: string;\n /**\n * The size of the icons.\n */\n iconSize?: number;\n /**\n * If true, the option is disabled.\n */\n disabled?: boolean;\n /**\n * If true, the option is selected.\n */\n selected?: boolean;\n /**\n * The ARIA label for accessibility.\n */\n \"aria-label\"?: string;\n /**\n * If true, the option belongs to a category.\n */\n belongToCategory?: boolean;\n /**\n * The tooltip content displayed on hover.\n */\n tooltipContent?: string;\n /**\n * Props for the Tooltip component.\n * The \"Omit\" is here on purpose to avoid the content prop, in case tooltipProps would be expanded in the future.\n */\n tooltipProps?: Pick<Omit<TooltipProps, \"content\">, \"position\">;\n}\n\nexport interface IComboboxItem {\n /**\n * The height of the item.\n */\n height?: number;\n /**\n * The type of the item.\n */\n type?: string;\n /**\n * The category details if the item is a category.\n */\n category?: IComboboxCategory;\n /**\n * The ID of the category the item belongs to.\n */\n categoryId?: string;\n /**\n * The unique ID of the item.\n */\n id?: string;\n /**\n * The index of the item in the list.\n */\n index?: number;\n /**\n * If true, a divider is displayed before this item.\n */\n withDivider?: boolean;\n /**\n * Class name applied to the item.\n */\n className?: string;\n /**\n * If true, the item belongs to a category.\n */\n belongToCategory?: boolean;\n /**\n * The option details if the item is an option.\n */\n option?: IComboboxOption;\n /**\n * Custom renderer for the option.\n */\n optionRenderer?: (option: IComboboxOption) => JSX.Element;\n /**\n * If true, the item is currently active.\n */\n isActive?: boolean;\n /**\n * The height of the option item.\n */\n optionLineHeight?: number;\n /**\n * If true, the selected item is automatically scrolled into view.\n */\n shouldScrollToSelectedItem?: boolean;\n}\n\nexport interface IComboboxOptionEvents {\n /**\n * Callback fired when an option is clicked.\n */\n onOptionClick: (\n event: React.MouseEvent | React.KeyboardEvent,\n index: number,\n option: IComboboxOption,\n mouseTriggered: boolean\n ) => void;\n /**\n * Callback fired when the mouse leaves an option.\n */\n onOptionLeave: (event: React.MouseEvent, index: number, option: IComboboxOption, mouseTriggered: boolean) => void;\n /**\n * Callback fired when the mouse enters an option.\n */\n onOptionEnter: (event: React.MouseEvent, index: number, option: IComboboxOption, mouseTriggered: boolean) => void;\n /**\n * Callback fired when hovering over an option.\n */\n onOptionHover?: (event: React.MouseEvent, index: number, option: IComboboxOption, mouseTriggered: boolean) => void;\n}\n\nexport interface IOptionItemRendererArgs extends IComboboxOptionEvents {\n /**\n * The unique ID of the option item.\n */\n id?: string;\n /**\n * The index of the option item.\n */\n index?: number;\n /**\n * The option details.\n */\n option?: IComboboxOption;\n /**\n * Class name applied to the option item.\n */\n className?: string;\n /**\n * If true, the option is currently active.\n */\n isActive?: boolean;\n /**\n * If true, the option has visual focus.\n */\n visualFocus?: boolean;\n /**\n * A reference to the scroll container.\n */\n scrollRef?: React.MutableRefObject<HTMLElement>;\n /**\n * The amount of offset when scrolling to the active item.\n */\n scrollOffset?: number;\n /**\n * The height of the option item.\n */\n optionLineHeight?: number;\n /**\n * If true, the selected item is automatically scrolled into view.\n */\n shouldScrollToSelectedItem?: boolean;\n /**\n * If true, scrolls to the active option when it is selected.\n */\n shouldScrollWhenActive?: boolean;\n /**\n * If true, the option belongs to a category.\n */\n belongToCategory?: boolean;\n /**\n * The index of the item with visual focus.\n */\n visualFocusItemIndex?: number;\n /**\n * The index of the currently active item.\n */\n activeItemIndex?: number;\n /**\n * Custom renderer for the option content.\n */\n optionRenderer?: (option: IComboboxOption) => JSX.Element;\n}\n"],"names":["ComboboxOptionIconType","COMBOBOX_DIVIDER_ITEM","COMBOBOX_CATEGORY_ITEM","COMBOBOX_OPTION_ITEM","COMBOBOX_LISTBOX_ID"],"mappings":"AAIO,IAQKA,EARCC,EAAwB,mBACxBC,EAAyB,oBACzBC,EAAuB,kBACvBC,EAAsB,oBAKnC,SAAYJ,GACVA,EAAA,QAAA,UACAA,EAAA,SAAA,UACD,CAHD,CAAYA,IAAAA,EAGX,CAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import e,{forwardRef as t,useRef as o,useMemo as i,useCallback as n}from"react";import r from"classnames";import{comboboxItemRenderer as s}from"../../ComboboxHelpers/ComboboxHelpers.js";import{COMBOBOX_CATEGORY_ITEM as l,COMBOBOX_OPTION_ITEM as a}from"../ComboboxConstants.js";import m from"./ComboboxItems.module.scss.js";import c from"../../../../../components/virtualized-list/dist/VirtualizedList/VirtualizedList.js";var p=t((function(t,p){var d=t.className,u=t.optionClassName,f=t.categories,v=t.options,C=t.optionRenderer,I=t.activeItemIndex,b=t.visualFocusItemIndex,g=t.onOptionClick,y=t.onOptionEnter,x=t.onOptionLeave,h=t.optionLineHeight,O=t.shouldScrollToSelectedItem,L=t.renderOnlyVisibleOptions,N=t.onActiveCategoryChanged,R=t.maxOptionsWithoutScroll,j=t.itemsMap,k=t.stickyCategories,E=t.id,S=o(),z=i((function(){if(R)return{height:h*Math.min(v.length+Object.keys(null!=f?f:{}).length,R+.5)}}),[R,h,v,f]),H=n((function(e,t,o){return s({stickyCategories:k,item:e,style:o,optionEvents:{onOptionClick:g,onOptionEnter:y,onOptionLeave:x},optionRenderData:{className:u,optionLineHeight:h,optionRenderer:C,visualFocusItemIndex:b,scrollRef:L?null:p,activeItemIndex:I,shouldScrollToSelectedItem:O},isVirtualized:L})}),[g,y,x,u,h,C,b,L,p,I,O]),V=n((function(e){var t=e.firstItemId;window.requestAnimationFrame((function(){var e=j.get(t);if(e&&(e.type===l||e.type===a)){var o=e.type===a&&e.categoryId?e.categoryId:e.id;if(o!==S.current){S.current=o;var i=j.get(S.current);N(i)}}}))}),[j,N]);return L?e.createElement(c,{ref:p,className:r(m.optionsContainer,d),items:v,itemRenderer:H,role:"listbox",scrollableClassName:m.scrollableContainer,onItemsRendered:V,style:z,id:E}):e.createElement("div",{className:r(m.scrollableContainer,m.optionsContainer,d),role:"listbox",id:E,style:z,ref:p},v.map((function(e,t){return H(e,t,void 0)})))}));export{p as ComboboxItems};
|
|
2
|
-
//# sourceMappingURL=ComboboxItems.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxItems.js","sources":["../../../../../../src/components/Combobox/components/ComboboxItems/ComboboxItems.tsx"],"sourcesContent":["import React, { type CSSProperties, forwardRef, type RefObject, useCallback, useMemo, useRef } from \"react\";\nimport cx from \"classnames\";\nimport { comboboxItemRenderer } from \"../../ComboboxHelpers/ComboboxHelpers\";\nimport { VirtualizedList } from \"@vibe/virtualized-list\";\nimport {\n COMBOBOX_CATEGORY_ITEM,\n COMBOBOX_OPTION_ITEM,\n type IComboboxCategoryMap,\n type IComboboxItem,\n type IComboboxOption,\n type IComboboxOptionEvents\n} from \"../ComboboxConstants\";\nimport styles from \"./ComboboxItems.module.scss\";\n\nexport interface ComboboxItemsProps extends IComboboxOptionEvents {\n /**\n * Class name applied to the options container.\n */\n className?: string;\n /**\n * Class name applied to individual options.\n */\n optionClassName?: string;\n /**\n * The categories available in the combobox.\n */\n categories?: IComboboxCategoryMap;\n /**\n * The list of options displayed in the combobox.\n */\n options?: IComboboxItem[];\n /**\n * Custom renderer for an option.\n */\n optionRenderer?: (option: IComboboxOption) => JSX.Element;\n /**\n * The index of the currently active item.\n */\n activeItemIndex?: number;\n /**\n * The index of the item with visual focus.\n */\n visualFocusItemIndex?: number;\n /**\n * The height of each option item.\n */\n optionLineHeight?: number;\n /**\n * If true, the list scrolls to the selected item when opened.\n */\n shouldScrollToSelectedItem?: boolean;\n /**\n * If true, only renders visible options (optimization for large lists).\n */\n renderOnlyVisibleOptions?: boolean;\n /**\n * Callback fired when the active category changes.\n */\n onActiveCategoryChanged?: (category: IComboboxItem) => void;\n /**\n * The maximum number of options displayed without scrolling.\n */\n maxOptionsWithoutScroll?: number;\n /**\n * A map of item IDs to item data.\n */\n itemsMap?: Map<string, IComboboxItem>;\n /**\n * If true, categories remain visible when scrolling.\n */\n stickyCategories?: boolean;\n /**\n * The ID of the options container.\n */\n id?: string;\n}\n\nexport const ComboboxItems: React.FC<ComboboxItemsProps> = forwardRef(\n (\n {\n className,\n optionClassName,\n categories,\n options,\n optionRenderer,\n activeItemIndex,\n visualFocusItemIndex,\n onOptionClick,\n onOptionEnter,\n onOptionLeave,\n optionLineHeight,\n shouldScrollToSelectedItem,\n renderOnlyVisibleOptions,\n onActiveCategoryChanged,\n maxOptionsWithoutScroll,\n itemsMap,\n stickyCategories,\n id\n },\n ref: RefObject<HTMLDivElement>\n ) => {\n const activeCategoryId = useRef<string>();\n const style = useMemo(() => {\n if (maxOptionsWithoutScroll) {\n // Adding 0.5 to show next option to indicate scroll is available\n const maxCount = Math.min(options.length + Object.keys(categories ?? {}).length, maxOptionsWithoutScroll + 0.5);\n return { height: optionLineHeight * maxCount };\n }\n return undefined;\n }, [maxOptionsWithoutScroll, optionLineHeight, options, categories]);\n\n const createItemElementRenderer = useCallback(\n (item: IComboboxItem, index: number, style: CSSProperties) =>\n comboboxItemRenderer({\n stickyCategories,\n item,\n style,\n optionEvents: {\n onOptionClick,\n onOptionEnter,\n onOptionLeave\n },\n optionRenderData: {\n className: optionClassName,\n optionLineHeight,\n optionRenderer,\n visualFocusItemIndex,\n scrollRef: renderOnlyVisibleOptions ? null : ref,\n activeItemIndex,\n shouldScrollToSelectedItem\n },\n isVirtualized: renderOnlyVisibleOptions\n }),\n [\n onOptionClick,\n onOptionEnter,\n onOptionLeave,\n optionClassName,\n optionLineHeight,\n optionRenderer,\n visualFocusItemIndex,\n renderOnlyVisibleOptions,\n ref,\n activeItemIndex,\n shouldScrollToSelectedItem\n ]\n );\n\n const onItemsRender = useCallback(\n ({ firstItemId }: { firstItemId?: string }) => {\n window.requestAnimationFrame(() => {\n const itemData = itemsMap.get(firstItemId);\n if (itemData && (itemData.type === COMBOBOX_CATEGORY_ITEM || itemData.type === COMBOBOX_OPTION_ITEM)) {\n const newActiveCategoryId =\n itemData.type === COMBOBOX_OPTION_ITEM && itemData.categoryId ? itemData.categoryId : itemData.id;\n\n if (newActiveCategoryId !== activeCategoryId.current) {\n activeCategoryId.current = newActiveCategoryId;\n const categoryObject = itemsMap.get(activeCategoryId.current);\n onActiveCategoryChanged(categoryObject);\n }\n }\n });\n },\n [itemsMap, onActiveCategoryChanged]\n );\n\n let itemsElements;\n\n // If we request to render only the items which visible in a given moment (optimization for very large lists)\n if (renderOnlyVisibleOptions) {\n itemsElements = (\n <VirtualizedList\n ref={ref}\n className={cx(styles.optionsContainer, className)}\n items={options}\n itemRenderer={createItemElementRenderer}\n role=\"listbox\"\n scrollableClassName={styles.scrollableContainer}\n onItemsRendered={onItemsRender}\n style={style}\n id={id}\n />\n );\n } else {\n itemsElements = (\n <div\n className={cx(styles.scrollableContainer, styles.optionsContainer, className)}\n role=\"listbox\"\n id={id}\n style={style}\n ref={ref}\n >\n {options.map((itemData, index) => createItemElementRenderer(itemData, index, undefined))}\n </div>\n );\n }\n\n return itemsElements;\n }\n);\n"],"names":["ComboboxItems","forwardRef","_ref","ref","className","optionClassName","categories","options","optionRenderer","activeItemIndex","visualFocusItemIndex","onOptionClick","onOptionEnter","onOptionLeave","optionLineHeight","shouldScrollToSelectedItem","renderOnlyVisibleOptions","onActiveCategoryChanged","maxOptionsWithoutScroll","itemsMap","stickyCategories","id","activeCategoryId","useRef","style","useMemo","height","Math","min","length","Object","keys","createItemElementRenderer","useCallback","item","index","comboboxItemRenderer","optionEvents","optionRenderData","scrollRef","isVirtualized","onItemsRender","_ref2","firstItemId","window","requestAnimationFrame","itemData","get","type","COMBOBOX_CATEGORY_ITEM","COMBOBOX_OPTION_ITEM","newActiveCategoryId","categoryId","current","categoryObject","React","createElement","VirtualizedList","cx","styles","optionsContainer","items","itemRenderer","role","scrollableClassName","scrollableContainer","onItemsRendered","map","undefined"],"mappings":"qaA6EO,IAAMA,EAA8CC,GACzD,SAAAC,EAqBEC,GACE,IApBAC,EAASF,EAATE,UACAC,EAAeH,EAAfG,gBACAC,EAAUJ,EAAVI,WACAC,EAAOL,EAAPK,QACAC,EAAcN,EAAdM,eACAC,EAAeP,EAAfO,gBACAC,EAAoBR,EAApBQ,qBACAC,EAAaT,EAAbS,cACAC,EAAaV,EAAbU,cACAC,EAAaX,EAAbW,cACAC,EAAgBZ,EAAhBY,iBACAC,EAA0Bb,EAA1Ba,2BACAC,EAAwBd,EAAxBc,yBACAC,EAAuBf,EAAvBe,wBACAC,EAAuBhB,EAAvBgB,wBACAC,EAAQjB,EAARiB,SACAC,EAAgBlB,EAAhBkB,iBACAC,EAAEnB,EAAFmB,GAII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A,EACPH,GAAIA,IAKNkC,EAAAC,cAAA,MAAA,CACEpD,UAAWsD,EAAGC,EAAOM,oBAAqBN,EAAOC,iBAAkBxD,GACnE2D,KAAK,UACL1C,GAAIA,EACJG,MAAOA,EACPrB,IAAKA,GAEJI,EAAQ4D,KAAI,SAACrB,EAAUX,GAAK,OAAKH,EAA0Bc,EAAUX,OAAOiC,EAAU,IAM/F"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var t={scrollableContainer:"scrollableContainer_0d3294cdb7",optionsContainer:"optionsContainer_be43a08f18",categoryWithOptions:"categoryWithOptions_df96260561",firstCategory:"firstCategory_0df9af8ff7",categoryWithoutOptions:"categoryWithoutOptions_261f73cbec"};!function(t){const e="s_id-9dc0ac18aa3d_4_5_27";if("undefined"!=typeof document){const n=document.head||document.getElementsByTagName("head")[0];if(n.querySelector("#"+e))return;const o=document.createElement("style");o.id=e,n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.appendChild(document.createTextNode(t))}else globalThis.injectedStyles&&(globalThis.injectedStyles[e]=t)}("/* stylelint-disable */\n/* stylelint-enable */\n.scrollableContainer_0d3294cdb7::-webkit-scrollbar {\n width: 4px;\n height: 6px;\n}\n.scrollableContainer_0d3294cdb7::-webkit-scrollbar-thumb {\n background-color: var(--ui-border-color);\n border-radius: 4px;\n}\n.optionsContainer_be43a08f18 {\n overflow-x: visible;\n overflow-y: auto;\n margin-top: var(--space-8);\n}\n.categoryWithOptions_df96260561.firstCategory_0df9af8ff7,\n.categoryWithoutOptions_261f73cbec.firstCategory_0df9af8ff7 {\n padding-top: 0;\n}\n.categoryWithOptions_df96260561 {\n margin-bottom: var(--space-4);\n}\n.categoryWithoutOptions_261f73cbec {\n margin-bottom: 0;\n}");export{t as default};
|
|
2
|
-
//# sourceMappingURL=ComboboxItems.module.scss.js.map
|
package/dist/src/components/Combobox/components/ComboboxItems/ComboboxItems.module.scss.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxItems.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{defineProperty as e}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import o from"classnames";import t,{useRef as n,useEffect as i,useCallback as r,useMemo as l}from"react";import{keyCodes as s}from"../../../../constants/keyCodes.js";import"../../../../constants/sizes.js";import{getOptionId as c}from"../../helpers.js";import{getTestId as a,ComponentDefaultTestId as p}from"../../../../tests/testIds.js";import m from"./ComboboxOption.module.scss.js";import d from"../../../../../hooks/dist/useIsOverflowing/index.js";import u from"../../../../../components/tooltip/dist/Tooltip/Tooltip.js";import f from"../../../../../components/icon/dist/Icon/Icon.js";var v=function(v){var b=v.index,O=v.option,h=v.className,y=v.isActive,I=v.visualFocus,g=v.scrollRef,j=v.scrollOffset,E=void 0===j?100:j,T=v.onOptionClick,C=v.onOptionLeave,k=v.onOptionHover,N=v.optionLineHeight,x=v.shouldScrollWhenActive,P=void 0===x||x,H=v.optionRenderer,L=void 0===H?null:H,R=O.id,S=O.leftIcon,w=O.leftIconType,z=O.rightIcon,A=O.rightIconType,B=O.label,F=O.iconSize,M=void 0===F?18:F,_=O.disabled,W=O.selected,D=O["aria-label"],K=O.belongToCategory,V=void 0!==K&&K,X=O.tooltipContent,q=n(null),G=n(),J=d({ref:G});i((function(){var e,o=q.current;I&&o&&P&&((null==g?void 0:g.current)&&o?g.current.scrollTop=o.offsetTop-E:null===(e=null==o?void 0:o.scrollIntoView)||void 0===e||e.call(o,{behaviour:"smooth"}))}),[q,I,P,g,E,V]);var Q=function(e,n,i){return"renderer"===n?e(o(m.optionIcon,i)):t.createElement(f,{className:o(m.optionIcon,i),type:"font",icon:e,size:M,ignoreFocusStyle:!0})},U=r((function(e){_||T(e,b,O,!0)}),[b,O,T,_]),Y=r((function(e){_||C(e,b,O,!0)}),[b,O,C,_]),Z=r((function(e){_||k(e,b,O,!0)}),[b,O,k,_]),$=r((function(e){e.key!==s.ENTER&&e.key!==s.SPACE||T(e,b,O,!1)}),[T,b,O]);X||(X=J?B:null);var ee=l((function(){return L&&L(O)}),[L,O]),oe=t.createElement(t.Fragment,null,S&&Q(S,w,m.left),t.createElement("div",{ref:G,className:o(m.optionLabel)},B),z&&Q(z,A,""));return t.createElement(u,Object.assign({},O.tooltipProps,{content:X,hideWhenReferenceHidden:!0}),t.createElement("div",{ref:q,key:R||B,"aria-level":V?2:1,"aria-selected":y,"aria-label":D||B,id:c(R,b),"data-testid":a(p.COMBOBOX_OPTION,b),onMouseEnter:Z,onClick:U,onKeyDown:$,onMouseLeave:Y,className:o(m.comboboxOption,h,e(e(e(e({},m.disabled,_),m.selected,W),m.active,y),m.activeOutline,I)),style:{height:N}},ee||oe))};export{v as default};
|
|
2
|
-
//# sourceMappingURL=ComboboxOption.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxOption.js","sources":["../../../../../../src/components/Combobox/components/ComboboxOption/ComboboxOption.tsx"],"sourcesContent":["import cx from \"classnames\";\nimport React, { type RefObject, useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { Icon, type SubIcon } from \"@vibe/icon\";\nimport { Tooltip } from \"@vibe/tooltip\";\nimport { useIsOverflowing } from \"@vibe/hooks\";\nimport { keyCodes } from \"../../../../constants\";\nimport { getOptionId } from \"../../helpers\";\nimport { type IComboboxOption, type IComboboxOptionEvents } from \"../ComboboxConstants\";\nimport { type ComboboxOptionIconType } from \"../../Combobox.types\";\nimport { ComponentDefaultTestId, getTestId } from \"../../../../tests/test-ids-utils\";\nimport styles from \"./ComboboxOption.module.scss\";\n\nexport interface ComboboxOptionProps extends IComboboxOptionEvents {\n /**\n * The index of the option in the list.\n */\n index?: number;\n /**\n * The option data containing label, icons, and other properties.\n */\n option?: IComboboxOption;\n /**\n * Class name applied to the option element.\n */\n className?: string;\n /**\n * If true, the option is currently active.\n */\n isActive?: boolean;\n /**\n * If true, the option has visual focus.\n */\n visualFocus?: boolean;\n /**\n * A reference to the scroll container.\n */\n scrollRef?: RefObject<HTMLElement>;\n /**\n * The amount of offset when scrolling to the active item.\n */\n scrollOffset?: number;\n /**\n * The height of each option.\n */\n optionLineHeight?: number;\n /**\n * If true, scrolls to the active option when it is selected.\n */\n shouldScrollWhenActive?: boolean;\n /**\n * Custom renderer for the option content.\n */\n optionRenderer?: (option: IComboboxOption) => JSX.Element;\n}\n\nconst ComboboxOption = ({\n index,\n option,\n className,\n isActive,\n visualFocus,\n scrollRef,\n scrollOffset = 100,\n onOptionClick,\n onOptionLeave,\n onOptionHover,\n optionLineHeight,\n shouldScrollWhenActive = true,\n optionRenderer = null\n}: ComboboxOptionProps) => {\n const {\n id,\n leftIcon,\n leftIconType,\n rightIcon,\n rightIconType,\n label,\n iconSize = 18,\n disabled,\n selected,\n \"aria-label\": ariaLabel,\n belongToCategory = false\n } = option;\n let { tooltipContent } = option;\n\n const ref = useRef(null);\n const labelRef = useRef();\n\n const isOptionOverflowing = useIsOverflowing({ ref: labelRef });\n\n useEffect(() => {\n const element = ref.current;\n if (visualFocus && element && shouldScrollWhenActive) {\n if (scrollRef?.current && element) {\n // not supported with virtualized atm, need their scrollRef (element with overflow-y auto that has the scroll)\n scrollRef.current.scrollTop = element.offsetTop - scrollOffset;\n } else {\n element?.scrollIntoView?.({ behaviour: \"smooth\" });\n }\n }\n }, [ref, visualFocus, shouldScrollWhenActive, scrollRef, scrollOffset, belongToCategory]);\n\n const renderIcon = (\n icon: SubIcon | ((className: string) => JSX.Element),\n iconType: ComboboxOptionIconType,\n className: string\n ) => {\n if (iconType === \"renderer\") {\n return (icon as (className: string) => JSX.Element)(cx(styles.optionIcon, className));\n }\n\n return (\n <Icon\n className={cx(styles.optionIcon, className)}\n type=\"font\"\n icon={icon as SubIcon}\n size={iconSize}\n ignoreFocusStyle\n />\n );\n };\n\n const onClick = useCallback(\n (event: React.MouseEvent) => {\n if (disabled) return;\n onOptionClick(event, index, option, true);\n },\n [index, option, onOptionClick, disabled]\n );\n\n const onMouseLeave = useCallback(\n (event: React.MouseEvent) => {\n if (disabled) return;\n onOptionLeave(event, index, option, true);\n },\n [index, option, onOptionLeave, disabled]\n );\n\n const onMouseEnter = useCallback(\n (event: React.MouseEvent) => {\n if (disabled) return;\n onOptionHover(event, index, option, true);\n },\n [index, option, onOptionHover, disabled]\n );\n\n const onKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === keyCodes.ENTER || event.key === keyCodes.SPACE) {\n onOptionClick(event, index, option, false);\n }\n },\n [onOptionClick, index, option]\n );\n if (!tooltipContent) {\n tooltipContent = isOptionOverflowing ? label : null;\n }\n\n const optionRendererValue = useMemo(() => optionRenderer && optionRenderer(option), [optionRenderer, option]);\n\n const optionValue = (\n <>\n {leftIcon && renderIcon(leftIcon, leftIconType, styles.left)}\n <div ref={labelRef} className={cx(styles.optionLabel)}>\n {label}\n </div>\n {rightIcon && renderIcon(rightIcon, rightIconType, \"\")}\n </>\n );\n\n return (\n <Tooltip {...option.tooltipProps} content={tooltipContent} hideWhenReferenceHidden>\n <div\n ref={ref}\n key={id || label}\n aria-level={belongToCategory ? 2 : 1}\n aria-selected={isActive}\n aria-label={ariaLabel || label}\n id={getOptionId(id, index)}\n data-testid={getTestId(ComponentDefaultTestId.COMBOBOX_OPTION, index)}\n onMouseEnter={onMouseEnter}\n onClick={onClick}\n onKeyDown={onKeyDown}\n onMouseLeave={onMouseLeave}\n className={cx(styles.comboboxOption, className, {\n [styles.disabled]: disabled,\n [styles.selected]: selected,\n [styles.active]: isActive,\n [styles.activeOutline]: visualFocus\n })}\n style={{ height: optionLineHeight }}\n >\n {optionRendererValue || optionValue}\n </div>\n </Tooltip>\n );\n};\n\nexport default ComboboxOption;\n"],"names":["ComboboxOption","_ref","index","option","className","isActive","visualFocus","scrollRef","_ref$scrollOffset","scrollOffset","onOptionClick","onOptionLeave","onOptionHover","optionLineHeight","_ref$shouldScrollWhen","shouldScrollWhenActive","_ref$optionRenderer","optionRenderer","id","leftIcon","leftIconType","rightIcon","rightIconType","label","_option$iconSize","iconSize","disabled","selected","ariaLabel","_option$belongToCateg","belongToCategory","tooltipContent","ref","useRef","labelRef","isOptionOverflowing","useIsOverflowing","useEffect","element","current","scrollTop","offsetTop","_a","scrollIntoView","call","behaviour","renderIcon","icon","iconType","cx","styles","optionIcon","React","createElement","Icon","type","size","ignoreFocusStyle","onClick","useCallback","event","onMouseLeave","onMouseEnter","onKeyDown","key","keyCodes","ENTER","SPACE","optionRendererValue","useMemo","optionValue","Fragment","left","optionLabel","Tooltip","Object","assign","tooltipProps","content","hideWhenReferenceHidden","getOptionId","getTestId","ComponentDefaultTestId","COMBOBOX_OPTION","comboboxOption","_defineProperty","active","activeOutline","style","height"],"mappings":"kqBAuDA,IAAMA,EAAiB,SAAHC,GAcM,IAbxBC,EAAKD,EAALC,MACAC,EAAMF,EAANE,OACAC,EAASH,EAATG,UACAC,EAAQJ,EAARI,SACAC,EAAWL,EAAXK,YACAC,EAASN,EAATM,UAASC,EAAAP,EACTQ,aAAAA,OAAe,IAAHD,EAAG,IAAGA,EAClBE,EAAaT,EAAbS,cACAC,EAAaV,EAAbU,cACAC,EAAaX,EAAbW,cACAC,EAAgBZ,EAAhBY,iBAAgBC,EAAAb,EAChBc,uBAAAA,OAAyB,IAAHD,GAAOA,EAAAE,EAAAf,EAC7BgB,eAAAA,OAAiB,IAAHD,EAAG,KAAIA,EAGnBE,EAWEf,EAXFe,GACAC,EAUEhB,EAVFgB,SACAC,EASEjB,EATFiB,aACAC,EAQElB,EARFkB,UACAC,EAOEnB,EAPFmB,cACAC,EAMEpB,EANFoB,MAAKC,EAMHrB,EALFsB,SAAAA,OAAW,IAAHD,EAAG,GAAEA,EACbE,EAIEvB,EAJFuB,SACAC,EAGExB,EAHFwB,SACcC,EAEZzB,EAFF,cAAY0B,EAEV1B,EADF2B,iBAAAA,OAAmB,IAAHD,GAAQA,EAEpBE,EAAmB5B,EAAnB4B,eAEAC,EAAMC,EAAO,MACbC,E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GpD,GAAY2B,EAAW3B,EAAUC,EAAc8B,EAAOsB,MACvDpB,EAAAC,cAAA,MAAA,CAAKrB,IAAKE,EAAU9B,UAAW6C,EAAGC,EAAOuB,cACtClD,GAEFF,GAAayB,EAAWzB,EAAWC,EAAe,KAIvD,OACE8B,EAAAC,cAACqB,EAAOC,OAAAC,OAAA,CAAA,EAAKzE,EAAO0E,aAAY,CAAEC,QAAS/C,EAAgBgD,yBAAuB,IAChF3B,EAAAC,cAAA,MAAA,CACErB,IAAKA,EACLgC,IAAK9C,GAAMK,EACC,aAAAO,EAAmB,EAAI,EAAC,gBACrBzB,EAAQ,aACXuB,GAAaL,EACzBL,GAAI8D,EAAY9D,EAAIhB,GACP,cAAA+E,EAAUC,EAAuBC,gBAAiBjF,GAC/D4D,aAAcA,EACdJ,QAASA,EACTK,UAAWA,EACXF,aAAcA,EACdzD,UAAW6C,EAAGC,EAAOkC,eAAgBhF,EAASiF,EAAAA,EAAAA,EAAAA,EAAA,CAAA,EAC3CnC,EAAOxB,SAAWA,GAClBwB,EAAOvB,SAAWA,GAClBuB,EAAOoC,OAASjF,GAChB6C,EAAOqC,cAAgBjF,IAE1BkF,MAAO,CAAEC,OAAQ5E,IAEhBuD,IAAuBE,IAIhC"}
|
package/dist/src/components/Combobox/components/ComboboxOption/ComboboxOption.module.scss.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var o={comboboxOption:"comboboxOption_87da57aa3c",disabled:"disabled_84db6df2f7",selected:"selected_e9c35760ad",active:"active_3b18e84945",activeOutline:"activeOutline_41ce339450",optionLabel:"optionLabel_4343b77d23",optionIcon:"optionIcon_8f6c6f6a64",left:"left_61b5af3d2e"};!function(o){const e="s_id-3db504899945_4_5_27";if("undefined"!=typeof document){const n=document.head||document.getElementsByTagName("head")[0];if(n.querySelector("#"+e))return;const a=document.createElement("style");a.id=e,n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.appendChild(document.createTextNode(o))}else globalThis.injectedStyles&&(globalThis.injectedStyles[e]=o)}("/* stylelint-disable */\n/* stylelint-enable */\n/* stylelint-disable selector-class-pattern */\n.comboboxOption_87da57aa3c {\n padding: 8px;\n width: 100%;\n border-radius: 4px;\n display: flex;\n align-items: center;\n overflow: hidden;\n cursor: pointer;\n user-select: none;\n}\n.comboboxOption_87da57aa3c.disabled_84db6df2f7 {\n cursor: not-allowed;\n border-color: var(--disabled-background-color);\n color: var(--disabled-text-color);\n cursor: not-allowed;\n}\n.comboboxOption_87da57aa3c.disabled_84db6df2f7:hover {\n background-color: transparent;\n}\n.comboboxOption_87da57aa3c.selected_e9c35760ad {\n background-color: var(--primary-selected-color);\n}\n.comboboxOption_87da57aa3c:hover:not(.disabled_84db6df2f7):not(.selected_e9c35760ad),\n.comboboxOption_87da57aa3c.active_3b18e84945 {\n color: var(--primary-text-color);\n background-color: var(--primary-background-hover-color);\n position: relative;\n}\n.comboboxOption_87da57aa3c.activeOutline_41ce339450 {\n outline: none;\n z-index: 11;\n border-radius: 4px;\n box-shadow: 0 0 0 3px hsla(209, 100%, 50%, 0.5) inset, 0 0 0 1px var(--primary-hover-color) inset;\n background-color: var(--secondary-background-color);\n}\n.comboboxOption_87da57aa3c .optionLabel_4343b77d23 {\n flex: 1 1 auto;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.comboboxOption_87da57aa3c .optionIcon_8f6c6f6a64 {\n flex: 0 0 auto;\n}\n.comboboxOption_87da57aa3c .optionIcon_8f6c6f6a64.left_61b5af3d2e {\n margin-inline-end: 4px;\n}");export{o as default};
|
|
2
|
-
//# sourceMappingURL=ComboboxOption.module.scss.js.map
|
package/dist/src/components/Combobox/components/ComboboxOption/ComboboxOption.module.scss.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxOption.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/src/components/Combobox/components/StickyCategoryHeader/StickyCategoryHeader.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import o from"react";import r from"classnames";import e from"./StickyCategoryHeader.module.scss.js";import m from"../../Combobox.module.scss.js";import a from"../ComboboxCategory/ComboboxCategory.module.scss.js";var s=function(s){var t=s.label,c=s.color;return void 0===t?null:o.createElement("div",{className:r(e.stickyCategoryHeader,m.comboboxCategory,a.comboboxCategory,s.className),style:c&&{color:c},"aria-hidden":!0},t)};export{s as StickyCategoryHeader};
|
|
2
|
-
//# sourceMappingURL=StickyCategoryHeader.js.map
|
package/dist/src/components/Combobox/components/StickyCategoryHeader/StickyCategoryHeader.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StickyCategoryHeader.js","sources":["../../../../../../src/components/Combobox/components/StickyCategoryHeader/StickyCategoryHeader.tsx"],"sourcesContent":["import React from \"react\";\nimport cx from \"classnames\";\nimport styles from \"./StickyCategoryHeader.module.scss\";\nimport comboboxStyles from \"../../Combobox.module.scss\";\nimport comboboxCategoryStyles from \"../ComboboxCategory/ComboboxCategory.module.scss\";\n\nexport const StickyCategoryHeader = ({\n label,\n color,\n className\n}: {\n label: string;\n color?: string;\n className?: string;\n}) => {\n return label === undefined ? null : (\n <div\n className={cx(\n styles.stickyCategoryHeader,\n comboboxStyles.comboboxCategory,\n comboboxCategoryStyles.comboboxCategory,\n className\n )}\n style={color && { color }}\n aria-hidden\n >\n {label}\n </div>\n );\n};\n"],"names":["StickyCategoryHeader","_ref","label","color","undefined","React","createElement","className","cx","styles","stickyCategoryHeader","comboboxStyles","comboboxCategory","comboboxCategoryStyles","style"],"mappings":"wNAMaA,EAAuB,SAAHC,GAQ5B,IAPHC,EAAKD,EAALC,MACAC,EAAKF,EAALE,MAOA,YAAiBC,IAAVF,EAAsB,KAC3BG,EAAAC,cAAA,MAAA,CACEC,UAAWC,EACTC,EAAOC,qBACPC,EAAeC,iBACfC,EAAuBD,iBAXpBX,EAATM,WAcIO,MAAOX,GAAS,CAAEA,MAAAA,qBAGjBD,EAGP"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var e={stickyCategoryHeader:"stickyCategoryHeader_6ef0e903b0"};!function(e){const t="s_id-c981e92fbca0_4_5_27";if("undefined"!=typeof document){const n=document.head||document.getElementsByTagName("head")[0];if(n.querySelector("#"+t))return;const a=document.createElement("style");a.id=t,n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.appendChild(document.createTextNode(e))}else globalThis.injectedStyles&&(globalThis.injectedStyles[t]=e)}(".stickyCategoryHeader_6ef0e903b0 {\n position: absolute;\n z-index: 10;\n width: calc(100% - 12px);\n background-color: var(--primary-background-color);\n padding-block: 10px var(--space-4);\n display: flex;\n align-items: center;\n}");export{e as default};
|
|
2
|
-
//# sourceMappingURL=StickyCategoryHeader.module.scss.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StickyCategoryHeader.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../../src/components/Combobox/helpers.ts"],"sourcesContent":["export function getOptionId(id: string, index: number) {\n return id !== undefined ? `combobox-item-${id}` : `combobox-item-${index}`;\n}\n"],"names":["getOptionId","id","index","concat","undefined"],"mappings":"AAAgB,SAAAA,EAAYC,EAAYC,GACtC,MAAuBC,iBAAAA,YAATC,IAAPH,EAAoCA,EAAwBC,EACrE"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{slicedToArray as e,defineProperty as t}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import r,{forwardRef as o,useRef as a,useState as s,useCallback as l,useMemo as n}from"react";import i from"classnames";import{getTableRowLayoutStyles as u}from"./tableHelpers.js";import{getTestId as m}from"../../../tests/testIds.js";import{ComponentDefaultTestId as c,ComponentVibeId as d}from"../../../tests/constants.js";import{RowHeights as f}from"./TableConsts.js";import p from"./Table.module.scss.js";import{TableProvider as b}from"../context/TableContext/TableContext.js";import{TableRowMenuProvider as v}from"../context/TableRowMenuContext/TableRowMenuContext.js";import{useMergeRef as R}from"../../../../shared/dist/hooks/useMergeRef.js";var T=o((function(o,T){var j=o.id,S=o.className,x=o["data-testid"],w=o.columns,g=o.errorState,h=o.emptyState,y=o.dataState,z=o.style,C=o.children,E=o.size,M=void 0===E?"medium":E,A=o.withoutBorder,B=a(null),H=R(T,B),I=s(!1),L=e(I,2),O=L[0],k=L[1],N=s(null),P=e(N,2),V=P[0],_=P[1],q=l((function(){k(!1),_(null)}),[]),D=s(!1),F=e(D,2),G=F[0],J=F[1],K=l((function(){J(!0)}),[]),Q=s(!1),U=e(Q,2),W=U[0],X=U[1],Y=l((function(e){if(q(),!G){var t=e.target.scrollLeft>0;X((function(e){return e!==t?t:e}))}}),[q,G]),Z=u(w),$=Object.assign({"--table-grid-template-columns":Z.gridTemplateColumns,"--table-row-size":"".concat(f[M],"px")},z),ee=n((function(){return{columns:w,dataState:y,emptyState:h,errorState:g,size:M,tableRootRef:B,isVirtualized:G,markTableAsVirtualized:K,isScrolled:W,setIsScrolled:function(e){return X(e)}}}),[w,y,h,g,G,K,W,M]),te=n((function(){return{tableRootRef:B,hoveredRowRef:V,isMenuOpen:O,resetHoveredRow:q,setHoveredRowRef:function(e){return _(e)},setIsMenuOpen:function(e){return k(e)}}}),[V,O,q,_]);return r.createElement(b,{value:ee},r.createElement(v,{value:te},r.createElement("div",{ref:H,id:j,className:i(p.table,t(t(t({},p.border,!A),p.virtualized,G),p.hasScroll,W),S),"data-testid":x||m(c.TABLE,j),"data-vibe":d.TABLE,role:"table",style:$,onScroll:Y},C)))}));export{T as default};
|
|
2
|
-
//# sourceMappingURL=Table.js.map
|