@dmsi/wedgekit-react 0.0.1242 → 1.0.0
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/README.md +4 -32
- package/dist/classNames.d.ts +41 -0
- package/dist/classNames.d.ts.map +1 -0
- package/dist/components/AccessCard.d.ts +14 -0
- package/dist/components/AccessCard.d.ts.map +1 -0
- package/dist/components/AccessCardGroup.d.ts +15 -0
- package/dist/components/AccessCardGroup.d.ts.map +1 -0
- package/dist/components/AccessChangerTabItem.d.ts +11 -0
- package/dist/components/AccessChangerTabItem.d.ts.map +1 -0
- package/dist/components/Accordion.d.ts +15 -0
- package/dist/components/Accordion.d.ts.map +1 -0
- package/dist/components/Alert.d.ts +13 -0
- package/dist/components/Alert.d.ts.map +1 -0
- package/dist/components/Breadcrumbs.d.ts +19 -0
- package/dist/components/Breadcrumbs.d.ts.map +1 -0
- package/dist/components/Button.d.ts +46 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/CalendarRange.d.ts +28 -0
- package/dist/components/CalendarRange.d.ts.map +1 -0
- package/dist/components/Caption.d.ts +15 -0
- package/dist/components/Caption.d.ts.map +1 -0
- package/dist/components/Card.d.ts +28 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Checkbox.d.ts +12 -0
- package/dist/components/Checkbox.d.ts.map +1 -0
- package/dist/components/CompactImagesPreview.d.ts +25 -0
- package/dist/components/CompactImagesPreview.d.ts.map +1 -0
- package/dist/components/ContentTab.d.ts +12 -0
- package/dist/components/ContentTab.d.ts.map +1 -0
- package/dist/components/ContentTabs.d.ts +23 -0
- package/dist/components/ContentTabs.d.ts.map +1 -0
- package/dist/components/DMSiLogo.d.ts +2 -0
- package/dist/components/DMSiLogo.d.ts.map +1 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.d.ts +8 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.d.ts.map +1 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.d.ts +9 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.d.ts.map +1 -0
- package/dist/components/DataGrid/PinnedColumns.d.ts +26 -0
- package/dist/components/DataGrid/PinnedColumns.d.ts.map +1 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.d.ts +7 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.d.ts.map +1 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.d.ts +22 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.d.ts.map +1 -0
- package/dist/components/DataGrid/TableBody/index.d.ts +26 -0
- package/dist/components/DataGrid/TableBody/index.d.ts.map +1 -0
- package/dist/components/DataGrid/index.d.ts +5 -0
- package/dist/components/DataGrid/index.d.ts.map +1 -0
- package/dist/components/DataGrid/types.d.ts +74 -0
- package/dist/components/DataGrid/types.d.ts.map +1 -0
- package/dist/components/DataGrid/utils.d.ts +3 -0
- package/dist/components/DataGrid/utils.d.ts.map +1 -0
- package/dist/components/DataGridCell.d.ts +46 -0
- package/dist/components/DataGridCell.d.ts.map +1 -0
- package/dist/components/DataTable.d.ts +36 -0
- package/dist/components/DataTable.d.ts.map +1 -0
- package/dist/components/DateInput.d.ts +38 -0
- package/dist/components/DateInput.d.ts.map +1 -0
- package/dist/components/DateRangeInput.d.ts +36 -0
- package/dist/components/DateRangeInput.d.ts.map +1 -0
- package/dist/components/DebugJson.d.ts +5 -0
- package/dist/components/DebugJson.d.ts.map +1 -0
- package/dist/components/Display.d.ts +14 -0
- package/dist/components/Display.d.ts.map +1 -0
- package/dist/components/EditingContext.d.ts +14 -0
- package/dist/components/EditingContext.d.ts.map +1 -0
- package/dist/components/EmblaCarousel/ArrowButtons.d.ts +9 -0
- package/dist/components/EmblaCarousel/ArrowButtons.d.ts.map +1 -0
- package/dist/components/EmblaCarousel/SelectedSnapDisplay.d.ts +7 -0
- package/dist/components/EmblaCarousel/SelectedSnapDisplay.d.ts.map +1 -0
- package/dist/components/EmblaCarousel/index.d.ts +20 -0
- package/dist/components/EmblaCarousel/index.d.ts.map +1 -0
- package/dist/components/EmblaCarousel/usePrevNextButtons.d.ts +10 -0
- package/dist/components/EmblaCarousel/usePrevNextButtons.d.ts.map +1 -0
- package/dist/components/EmblaCarousel/useSelectedSnapDisplay.d.ts +8 -0
- package/dist/components/EmblaCarousel/useSelectedSnapDisplay.d.ts.map +1 -0
- package/dist/components/EmptyCartIcon.d.ts +2 -0
- package/dist/components/EmptyCartIcon.d.ts.map +1 -0
- package/dist/components/FilterGroup.d.ts +29 -0
- package/dist/components/FilterGroup.d.ts.map +1 -0
- package/dist/components/FullViewportBox.d.ts +6 -0
- package/dist/components/FullViewportBox.d.ts.map +1 -0
- package/dist/components/Grid.d.ts +22 -0
- package/dist/components/Grid.d.ts.map +1 -0
- package/dist/components/Heading.d.ts +15 -0
- package/dist/components/Heading.d.ts.map +1 -0
- package/dist/components/HorizontalDivider.d.ts +8 -0
- package/dist/components/HorizontalDivider.d.ts.map +1 -0
- package/dist/components/Icon.d.ts +11 -0
- package/dist/components/Icon.d.ts.map +1 -0
- package/dist/components/ImagePlaceholder.d.ts +3 -0
- package/dist/components/ImagePlaceholder.d.ts.map +1 -0
- package/dist/components/Input.d.ts +50 -0
- package/dist/components/Input.d.ts.map +1 -0
- package/dist/components/InputGroup.d.ts +12 -0
- package/dist/components/InputGroup.d.ts.map +1 -0
- package/dist/components/Label.d.ts +10 -0
- package/dist/components/Label.d.ts.map +1 -0
- package/dist/components/Link.d.ts +16 -0
- package/dist/components/Link.d.ts.map +1 -0
- package/dist/components/List.d.ts +7 -0
- package/dist/components/List.d.ts.map +1 -0
- package/dist/components/ListGroup.d.ts +26 -0
- package/dist/components/ListGroup.d.ts.map +1 -0
- package/dist/components/LiveChatComponent.d.ts +17 -0
- package/dist/components/LiveChatComponent.d.ts.map +1 -0
- package/dist/components/LoadingScrim.d.ts +14 -0
- package/dist/components/LoadingScrim.d.ts.map +1 -0
- package/dist/components/LogoAgilityTopBar.d.ts +2 -0
- package/dist/components/LogoAgilityTopBar.d.ts.map +1 -0
- package/dist/components/LogoDMSiTopBar.d.ts +2 -0
- package/dist/components/LogoDMSiTopBar.d.ts.map +1 -0
- package/dist/components/LogoMillworkTopBar.d.ts +2 -0
- package/dist/components/LogoMillworkTopBar.d.ts.map +1 -0
- package/dist/components/MainBar.d.ts +14 -0
- package/dist/components/MainBar.d.ts.map +1 -0
- package/dist/components/MaxViewportBox.d.ts +6 -0
- package/dist/components/MaxViewportBox.d.ts.map +1 -0
- package/dist/components/Menu.d.ts +23 -0
- package/dist/components/Menu.d.ts.map +1 -0
- package/dist/components/MenuOption.d.ts +65 -0
- package/dist/components/MenuOption.d.ts.map +1 -0
- package/dist/components/MobileDataGrid/ColumnList.d.ts +13 -0
- package/dist/components/MobileDataGrid/ColumnList.d.ts.map +1 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.d.ts +2 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.d.ts.map +1 -0
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.d.ts +24 -0
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.d.ts.map +1 -0
- package/dist/components/MobileDataGrid/GridContextProvider/index.d.ts +15 -0
- package/dist/components/MobileDataGrid/GridContextProvider/index.d.ts.map +1 -0
- package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.d.ts +3 -0
- package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.d.ts.map +1 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.d.ts +6 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.d.ts.map +1 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.d.ts +10 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.d.ts.map +1 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.d.ts +7 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.d.ts.map +1 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.d.ts +2 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.d.ts.map +1 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.d.ts +2 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.d.ts.map +1 -0
- package/dist/components/MobileDataGrid/dataGridReducer.d.ts +21 -0
- package/dist/components/MobileDataGrid/dataGridReducer.d.ts.map +1 -0
- package/dist/components/MobileDataGrid/index.d.ts +26 -0
- package/dist/components/MobileDataGrid/index.d.ts.map +1 -0
- package/dist/components/MobileDataGrid/types.d.ts +4 -0
- package/dist/components/MobileDataGrid/types.d.ts.map +1 -0
- package/dist/components/MobileNavMenu.d.ts +36 -0
- package/dist/components/MobileNavMenu.d.ts.map +1 -0
- package/dist/components/Modal.d.ts +30 -0
- package/dist/components/Modal.d.ts.map +1 -0
- package/dist/components/ModalButtons.d.ts +13 -0
- package/dist/components/ModalButtons.d.ts.map +1 -0
- package/dist/components/ModalContent.d.ts +7 -0
- package/dist/components/ModalContent.d.ts.map +1 -0
- package/dist/components/ModalHeader.d.ts +17 -0
- package/dist/components/ModalHeader.d.ts.map +1 -0
- package/dist/components/ModalScrim.d.ts +13 -0
- package/dist/components/ModalScrim.d.ts.map +1 -0
- package/dist/components/NavigationTab.d.ts +13 -0
- package/dist/components/NavigationTab.d.ts.map +1 -0
- package/dist/components/NavigationTabs.d.ts +18 -0
- package/dist/components/NavigationTabs.d.ts.map +1 -0
- package/dist/components/NestedMenu.d.ts +35 -0
- package/dist/components/NestedMenu.d.ts.map +1 -0
- package/dist/components/Notification.d.ts +17 -0
- package/dist/components/Notification.d.ts.map +1 -0
- package/dist/components/OptionPill.d.ts +14 -0
- package/dist/components/OptionPill.d.ts.map +1 -0
- package/dist/components/OrderCheckIcon.d.ts +5 -0
- package/dist/components/OrderCheckIcon.d.ts.map +1 -0
- package/dist/components/PDFViewer/DownloadIcon.d.ts +7 -0
- package/dist/components/PDFViewer/DownloadIcon.d.ts.map +1 -0
- package/dist/components/PDFViewer/PDFElement.d.ts +7 -0
- package/dist/components/PDFViewer/PDFElement.d.ts.map +1 -0
- package/dist/components/PDFViewer/PDFNavigation.d.ts +12 -0
- package/dist/components/PDFViewer/PDFNavigation.d.ts.map +1 -0
- package/dist/components/PDFViewer/PDFPage.d.ts +7 -0
- package/dist/components/PDFViewer/PDFPage.d.ts.map +1 -0
- package/dist/components/PDFViewer/index.d.ts +20 -0
- package/dist/components/PDFViewer/index.d.ts.map +1 -0
- package/dist/components/Pagination.d.ts +14 -0
- package/dist/components/Pagination.d.ts.map +1 -0
- package/dist/components/Paragraph.d.ts +10 -0
- package/dist/components/Paragraph.d.ts.map +1 -0
- package/dist/components/Password.d.ts +4 -0
- package/dist/components/Password.d.ts.map +1 -0
- package/dist/components/ProductImagePreview/CarouselPagination.d.ts +9 -0
- package/dist/components/ProductImagePreview/CarouselPagination.d.ts.map +1 -0
- package/dist/components/ProductImagePreview/MobileImageCarousel.d.ts +11 -0
- package/dist/components/ProductImagePreview/MobileImageCarousel.d.ts.map +1 -0
- package/dist/components/ProductImagePreview/ProductPrimaryImage.d.ts +22 -0
- package/dist/components/ProductImagePreview/ProductPrimaryImage.d.ts.map +1 -0
- package/dist/components/ProductImagePreview/Thumbnail.d.ts +11 -0
- package/dist/components/ProductImagePreview/Thumbnail.d.ts.map +1 -0
- package/dist/components/ProductImagePreview/ZoomWindow.d.ts +22 -0
- package/dist/components/ProductImagePreview/ZoomWindow.d.ts.map +1 -0
- package/dist/components/ProductImagePreview/index.d.ts +23 -0
- package/dist/components/ProductImagePreview/index.d.ts.map +1 -0
- package/dist/components/ProductImagePreview/useProductImagePreview.d.ts +42 -0
- package/dist/components/ProductImagePreview/useProductImagePreview.d.ts.map +1 -0
- package/dist/components/ProjectBar.d.ts +12 -0
- package/dist/components/ProjectBar.d.ts.map +1 -0
- package/dist/components/Radio.d.ts +10 -0
- package/dist/components/Radio.d.ts.map +1 -0
- package/dist/components/Search.d.ts +20 -0
- package/dist/components/Search.d.ts.map +1 -0
- package/dist/components/SearchResultImage/index.d.ts +9 -0
- package/dist/components/SearchResultImage/index.d.ts.map +1 -0
- package/dist/components/Select.d.ts +22 -0
- package/dist/components/Select.d.ts.map +1 -0
- package/dist/components/SideMenu.d.ts +9 -0
- package/dist/components/SideMenu.d.ts.map +1 -0
- package/dist/components/SideMenuGroup.d.ts +11 -0
- package/dist/components/SideMenuGroup.d.ts.map +1 -0
- package/dist/components/SideMenuItem.d.ts +15 -0
- package/dist/components/SideMenuItem.d.ts.map +1 -0
- package/dist/components/SimpleTable.d.ts +11 -0
- package/dist/components/SimpleTable.d.ts.map +1 -0
- package/dist/components/SkeletonParagraph.d.ts +16 -0
- package/dist/components/SkeletonParagraph.d.ts.map +1 -0
- package/dist/components/Spinner.d.ts +7 -0
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/Stack.d.ts +64 -0
- package/dist/components/Stack.d.ts.map +1 -0
- package/dist/components/StatusPill.d.ts +10 -0
- package/dist/components/StatusPill.d.ts.map +1 -0
- package/dist/components/Stepper.d.ts +26 -0
- package/dist/components/Stepper.d.ts.map +1 -0
- package/dist/components/Subheader.d.ts +10 -0
- package/dist/components/Subheader.d.ts.map +1 -0
- package/dist/components/Surface.d.ts +9 -0
- package/dist/components/Surface.d.ts.map +1 -0
- package/dist/components/Swatch.d.ts +13 -0
- package/dist/components/Swatch.d.ts.map +1 -0
- package/dist/components/Textarea.d.ts +12 -0
- package/dist/components/Textarea.d.ts.map +1 -0
- package/dist/components/Theme.d.ts +8 -0
- package/dist/components/Theme.d.ts.map +1 -0
- package/dist/components/Time.d.ts +13 -0
- package/dist/components/Time.d.ts.map +1 -0
- package/dist/components/Toast.d.ts +20 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/Tooltip.d.ts +13 -0
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/components/TopBar.d.ts +20 -0
- package/dist/components/TopBar.d.ts.map +1 -0
- package/dist/components/Upload.d.ts +10 -0
- package/dist/components/Upload.d.ts.map +1 -0
- package/dist/components/WorldpayIframe.d.ts +5 -0
- package/dist/components/WorldpayIframe.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +9 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useEditCell.d.ts +9 -0
- package/dist/hooks/useEditCell.d.ts.map +1 -0
- package/dist/hooks/useInfiniteScroll.d.ts +9 -0
- package/dist/hooks/useInfiniteScroll.d.ts.map +1 -0
- package/dist/hooks/useKeydown.d.ts +4 -0
- package/dist/hooks/useKeydown.d.ts.map +1 -0
- package/dist/hooks/useMatchesMedia.d.ts +3 -0
- package/dist/hooks/useMatchesMedia.d.ts.map +1 -0
- package/dist/hooks/useMenuSystem.d.ts +44 -0
- package/dist/hooks/useMenuSystem.d.ts.map +1 -0
- package/dist/hooks/useMounted.d.ts +2 -0
- package/dist/hooks/useMounted.d.ts.map +1 -0
- package/dist/hooks/useTableLayout/computeColumns.d.ts +49 -0
- package/dist/hooks/useTableLayout/computeColumns.d.ts.map +1 -0
- package/dist/hooks/useTableLayout/index.d.ts +3 -0
- package/dist/hooks/useTableLayout/index.d.ts.map +1 -0
- package/dist/hooks/useTableLayout/storage.d.ts +41 -0
- package/dist/hooks/useTableLayout/storage.d.ts.map +1 -0
- package/dist/hooks/useTableLayout/types.d.ts +56 -0
- package/dist/hooks/useTableLayout/types.d.ts.map +1 -0
- package/dist/hooks/useTableLayout/useTableLayout.d.ts +23 -0
- package/dist/hooks/useTableLayout/useTableLayout.d.ts.map +1 -0
- package/dist/index.d.ts +94 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52855 -0
- package/dist/lib/design-system.d.ts +3 -0
- package/dist/lib/design-system.d.ts.map +1 -0
- package/dist/pdf-l6QfMa5e.js +17649 -0
- package/dist/styles.css +1 -0
- package/dist/types.d.ts +33 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/date-patch-dashes.d.ts +17 -0
- package/dist/utils/date-patch-dashes.d.ts.map +1 -0
- package/dist/utils/date.d.ts +60 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/formatting.d.ts +36 -0
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/mergeObjectArrays.d.ts +12 -0
- package/dist/utils/mergeObjectArrays.d.ts.map +1 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +17 -83
- package/dist/chunk-3JUIYULW.js +0 -231
- package/dist/chunk-3PIDINTF.js +0 -52
- package/dist/chunk-3UPUZBP5.js +0 -149
- package/dist/chunk-4RJKB7LC.js +0 -14
- package/dist/chunk-4UGMSWWA.js +0 -57
- package/dist/chunk-5IFPG6TS.js +0 -17
- package/dist/chunk-5N32SQ3R.js +0 -99
- package/dist/chunk-5UH6QUFB.js +0 -38
- package/dist/chunk-5UPADXVU.js +0 -2376
- package/dist/chunk-6YUQCRMX.js +0 -32
- package/dist/chunk-75USUR3I.js +0 -27
- package/dist/chunk-7IPESTQS.js +0 -93
- package/dist/chunk-7MBRCM3M.js +0 -66
- package/dist/chunk-7WDYXRMW.js +0 -110
- package/dist/chunk-7YA3TF73.js +0 -32
- package/dist/chunk-7Z3WINQ3.js +0 -59
- package/dist/chunk-7ZJIGTFN.js +0 -78
- package/dist/chunk-AJ5M6MVX.js +0 -7
- package/dist/chunk-AT4AWD6B.js +0 -44
- package/dist/chunk-BQNPOGD5.js +0 -105
- package/dist/chunk-BWPNXY7T.js +0 -78
- package/dist/chunk-CIYLALYO.js +0 -72
- package/dist/chunk-DNNX5EYX.js +0 -274
- package/dist/chunk-E3FOCECQ.js +0 -61
- package/dist/chunk-E7LGUC2B.js +0 -35
- package/dist/chunk-EA6Y4HXQ.js +0 -112
- package/dist/chunk-EWGHVZL5.js +0 -27
- package/dist/chunk-F4VE3THQ.js +0 -71
- package/dist/chunk-FXXRXLOL.js +0 -329
- package/dist/chunk-G242RHWI.js +0 -139
- package/dist/chunk-GOGNV5TF.js +0 -68
- package/dist/chunk-GYT5CL7R.js +0 -159
- package/dist/chunk-I3W5K76C.js +0 -142
- package/dist/chunk-J3HNYUSG.js +0 -34
- package/dist/chunk-J4IMVWT5.js +0 -183
- package/dist/chunk-K6RPFIMB.js +0 -77
- package/dist/chunk-KBIEWFQS.js +0 -27
- package/dist/chunk-KESCXOG3.js +0 -82
- package/dist/chunk-MAEVKATN.js +0 -110
- package/dist/chunk-MBZ55T2D.js +0 -51
- package/dist/chunk-MOBFZ672.js +0 -134
- package/dist/chunk-MVDGHWKO.js +0 -238
- package/dist/chunk-NAWP246H.js +0 -65
- package/dist/chunk-NKUETCDA.js +0 -44
- package/dist/chunk-NSZTJ5R4.js +0 -38
- package/dist/chunk-NT26ZKSI.js +0 -82
- package/dist/chunk-NW75QACN.js +0 -91
- package/dist/chunk-OG2PGA3X.js +0 -154
- package/dist/chunk-OM7QLLI2.js +0 -277
- package/dist/chunk-ORMEWXMH.js +0 -37
- package/dist/chunk-PABII472.js +0 -579
- package/dist/chunk-PBJ2MEHM.js +0 -483
- package/dist/chunk-PE3EZP56.js +0 -373
- package/dist/chunk-QBIEU25R.js +0 -61
- package/dist/chunk-QG6NWMGA.js +0 -138
- package/dist/chunk-QVWYTQKL.js +0 -29
- package/dist/chunk-SATCWGO7.js +0 -166
- package/dist/chunk-SBRRNFOP.js +0 -33
- package/dist/chunk-SJZNVG4N.js +0 -47
- package/dist/chunk-TBZ243DS.js +0 -173
- package/dist/chunk-UARCWLMD.js +0 -66
- package/dist/chunk-UFX5XIJL.js +0 -178
- package/dist/chunk-UZHBKSXJ.js +0 -87
- package/dist/chunk-VEEZ7VRJ.js +0 -137
- package/dist/chunk-VJVY6NPF.js +0 -32
- package/dist/chunk-VUKYIERA.js +0 -89
- package/dist/chunk-VXWSAIB5.js +0 -26
- package/dist/chunk-W5NXOJ4L.js +0 -104
- package/dist/chunk-WVGXD7HT.js +0 -19
- package/dist/chunk-WVUIIBRR.js +0 -51
- package/dist/chunk-X4OKKRN5.js +0 -140
- package/dist/chunk-X7BKBBIH.js +0 -114
- package/dist/chunk-XB2S2QMB.js +0 -67
- package/dist/chunk-Y5GD2FJA.js +0 -32
- package/dist/chunk-YKEPPS2I.js +0 -192
- package/dist/chunk-YULGJORA.js +0 -259
- package/dist/chunk-Z2HPSFEQ.js +0 -14
- package/dist/chunk-Z5YP2GI6.js +0 -142
- package/dist/chunk-ZRFXUER3.js +0 -468
- package/dist/components/AccessCard.cjs +0 -661
- package/dist/components/AccessCard.js +0 -13
- package/dist/components/AccessCardGroup.cjs +0 -365
- package/dist/components/AccessCardGroup.js +0 -11
- package/dist/components/AccessChangerTabItem.cjs +0 -352
- package/dist/components/AccessChangerTabItem.js +0 -75
- package/dist/components/Accordion.cjs +0 -680
- package/dist/components/Accordion.js +0 -13
- package/dist/components/Alert.cjs +0 -850
- package/dist/components/Alert.js +0 -14
- package/dist/components/Breadcrumbs.cjs +0 -456
- package/dist/components/Breadcrumbs.js +0 -125
- package/dist/components/Button.cjs +0 -401
- package/dist/components/Button.js +0 -9
- package/dist/components/CalendarRange.cjs +0 -6569
- package/dist/components/CalendarRange.css +0 -5546
- package/dist/components/CalendarRange.js +0 -78
- package/dist/components/Caption.cjs +0 -365
- package/dist/components/Caption.js +0 -9
- package/dist/components/Card.cjs +0 -128
- package/dist/components/Card.js +0 -7
- package/dist/components/Checkbox.cjs +0 -421
- package/dist/components/Checkbox.js +0 -11
- package/dist/components/CompactImagesPreview.cjs +0 -604
- package/dist/components/CompactImagesPreview.js +0 -14
- package/dist/components/ContentTab.cjs +0 -483
- package/dist/components/ContentTab.js +0 -11
- package/dist/components/ContentTabs.cjs +0 -599
- package/dist/components/ContentTabs.js +0 -125
- package/dist/components/DMSiLogo.cjs +0 -97
- package/dist/components/DMSiLogo.js +0 -60
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +0 -6558
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +0 -5546
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +0 -74
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +0 -6558
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +0 -5546
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +0 -74
- package/dist/components/DataGrid/PinnedColumns.cjs +0 -6558
- package/dist/components/DataGrid/PinnedColumns.css +0 -5546
- package/dist/components/DataGrid/PinnedColumns.js +0 -74
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +0 -6560
- package/dist/components/DataGrid/TableBody/LoadingCell.css +0 -5546
- package/dist/components/DataGrid/TableBody/LoadingCell.js +0 -74
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +0 -6560
- package/dist/components/DataGrid/TableBody/TableBodyRow.css +0 -5546
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +0 -74
- package/dist/components/DataGrid/TableBody/index.cjs +0 -6560
- package/dist/components/DataGrid/TableBody/index.css +0 -5546
- package/dist/components/DataGrid/TableBody/index.js +0 -74
- package/dist/components/DataGrid/index.cjs +0 -6563
- package/dist/components/DataGrid/index.css +0 -5546
- package/dist/components/DataGrid/index.js +0 -77
- package/dist/components/DataGrid/utils.cjs +0 -6558
- package/dist/components/DataGrid/utils.css +0 -5546
- package/dist/components/DataGrid/utils.js +0 -74
- package/dist/components/DataGridCell.cjs +0 -2531
- package/dist/components/DataGridCell.js +0 -30
- package/dist/components/DataTable.cjs +0 -847
- package/dist/components/DataTable.js +0 -775
- package/dist/components/DateInput.cjs +0 -6560
- package/dist/components/DateInput.css +0 -5546
- package/dist/components/DateInput.js +0 -74
- package/dist/components/DateRangeInput.cjs +0 -7151
- package/dist/components/DateRangeInput.css +0 -5546
- package/dist/components/DateRangeInput.js +0 -652
- package/dist/components/DebugJson.cjs +0 -58
- package/dist/components/DebugJson.js +0 -35
- package/dist/components/Display.cjs +0 -263
- package/dist/components/Display.js +0 -12
- package/dist/components/EditingContext.cjs +0 -86
- package/dist/components/EditingContext.js +0 -12
- package/dist/components/EmblaCarousel/ArrowButtons.cjs +0 -151
- package/dist/components/EmblaCarousel/ArrowButtons.js +0 -9
- package/dist/components/EmblaCarousel/SelectedSnapDisplay.cjs +0 -38
- package/dist/components/EmblaCarousel/SelectedSnapDisplay.js +0 -7
- package/dist/components/EmblaCarousel/index.cjs +0 -420
- package/dist/components/EmblaCarousel/index.js +0 -12
- package/dist/components/EmptyCartIcon.cjs +0 -51
- package/dist/components/EmptyCartIcon.js +0 -7
- package/dist/components/FilterGroup.cjs +0 -1801
- package/dist/components/FilterGroup.js +0 -267
- package/dist/components/FooterBar.cjs +0 -64
- package/dist/components/FooterBar.js +0 -31
- package/dist/components/FullViewportBox.cjs +0 -60
- package/dist/components/FullViewportBox.js +0 -27
- package/dist/components/Grid.cjs +0 -135
- package/dist/components/Grid.js +0 -7
- package/dist/components/Heading.cjs +0 -267
- package/dist/components/Heading.js +0 -14
- package/dist/components/HorizontalDivider.cjs +0 -82
- package/dist/components/HorizontalDivider.js +0 -26
- package/dist/components/Icon.cjs +0 -101
- package/dist/components/Icon.js +0 -7
- package/dist/components/ImagePlaceholder.cjs +0 -65
- package/dist/components/ImagePlaceholder.js +0 -7
- package/dist/components/Input.cjs +0 -923
- package/dist/components/Input.js +0 -23
- package/dist/components/InputGroup.cjs +0 -307
- package/dist/components/InputGroup.js +0 -68
- package/dist/components/Label.cjs +0 -252
- package/dist/components/Label.js +0 -8
- package/dist/components/Link.cjs +0 -304
- package/dist/components/Link.js +0 -8
- package/dist/components/List.cjs +0 -39
- package/dist/components/List.js +0 -16
- package/dist/components/ListGroup.cjs +0 -568
- package/dist/components/ListGroup.js +0 -11
- package/dist/components/LiveChatComponent.cjs +0 -63
- package/dist/components/LiveChatComponent.js +0 -40
- package/dist/components/LoadingScrim.cjs +0 -90
- package/dist/components/LoadingScrim.js +0 -28
- package/dist/components/LogoAgilityTopBar.cjs +0 -133
- package/dist/components/LogoAgilityTopBar.js +0 -96
- package/dist/components/LogoDMSiTopBar.cjs +0 -97
- package/dist/components/LogoDMSiTopBar.js +0 -7
- package/dist/components/LogoMillworkTopBar.cjs +0 -239
- package/dist/components/LogoMillworkTopBar.js +0 -202
- package/dist/components/MainBar.cjs +0 -234
- package/dist/components/MainBar.js +0 -66
- package/dist/components/MaxViewportBox.cjs +0 -45
- package/dist/components/MaxViewportBox.js +0 -22
- package/dist/components/Menu.cjs +0 -505
- package/dist/components/Menu.js +0 -14
- package/dist/components/MenuOption.cjs +0 -695
- package/dist/components/MenuOption.js +0 -18
- package/dist/components/MobileDataGrid/ColumnList.cjs +0 -991
- package/dist/components/MobileDataGrid/ColumnList.css +0 -5546
- package/dist/components/MobileDataGrid/ColumnList.js +0 -20
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +0 -6668
- package/dist/components/MobileDataGrid/ColumnSelector/index.css +0 -5546
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +0 -74
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.cjs +0 -31
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.js +0 -7
- package/dist/components/MobileDataGrid/GridContextProvider/index.cjs +0 -186
- package/dist/components/MobileDataGrid/GridContextProvider/index.js +0 -8
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.cjs +0 -333
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +0 -12
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +0 -907
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +0 -19
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +0 -6978
- package/dist/components/MobileDataGrid/MobileDataGridHeader.css +0 -5546
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +0 -74
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.cjs +0 -620
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +0 -16
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +0 -1457
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +0 -29
- package/dist/components/MobileDataGrid/index.cjs +0 -7489
- package/dist/components/MobileDataGrid/index.css +0 -5546
- package/dist/components/MobileDataGrid/index.js +0 -74
- package/dist/components/Modal.cjs +0 -995
- package/dist/components/Modal.js +0 -23
- package/dist/components/ModalButtons.cjs +0 -491
- package/dist/components/ModalButtons.js +0 -11
- package/dist/components/ModalContent.cjs +0 -204
- package/dist/components/ModalContent.js +0 -8
- package/dist/components/ModalHeader.cjs +0 -563
- package/dist/components/ModalHeader.js +0 -12
- package/dist/components/ModalScrim.cjs +0 -69
- package/dist/components/ModalScrim.js +0 -7
- package/dist/components/NavigationTab.cjs +0 -522
- package/dist/components/NavigationTab.js +0 -11
- package/dist/components/NavigationTabs.cjs +0 -572
- package/dist/components/NavigationTabs.js +0 -61
- package/dist/components/NestedMenu.cjs +0 -1275
- package/dist/components/NestedMenu.js +0 -164
- package/dist/components/Notification.cjs +0 -871
- package/dist/components/Notification.js +0 -126
- package/dist/components/OptionPill.cjs +0 -597
- package/dist/components/OptionPill.js +0 -12
- package/dist/components/OrderCheckIcon.cjs +0 -85
- package/dist/components/OrderCheckIcon.js +0 -7
- package/dist/components/PDFViewer/DownloadIcon.cjs +0 -618
- package/dist/components/PDFViewer/DownloadIcon.js +0 -17
- package/dist/components/PDFViewer/PDFElement.cjs +0 -571
- package/dist/components/PDFViewer/PDFElement.js +0 -11
- package/dist/components/PDFViewer/PDFNavigation.cjs +0 -828
- package/dist/components/PDFViewer/PDFNavigation.js +0 -14
- package/dist/components/PDFViewer/PDFPage.cjs +0 -56
- package/dist/components/PDFViewer/PDFPage.js +0 -7
- package/dist/components/PDFViewer/index.cjs +0 -1941
- package/dist/components/PDFViewer/index.js +0 -182
- package/dist/components/Pagination.cjs +0 -436
- package/dist/components/Pagination.js +0 -10
- package/dist/components/Paragraph.cjs +0 -261
- package/dist/components/Paragraph.js +0 -8
- package/dist/components/Password.cjs +0 -1123
- package/dist/components/Password.js +0 -75
- package/dist/components/ProductImagePreview/CarouselPagination.cjs +0 -75
- package/dist/components/ProductImagePreview/CarouselPagination.js +0 -7
- package/dist/components/ProductImagePreview/MobileImageCarousel.cjs +0 -216
- package/dist/components/ProductImagePreview/MobileImageCarousel.js +0 -7
- package/dist/components/ProductImagePreview/ProductPrimaryImage.cjs +0 -214
- package/dist/components/ProductImagePreview/ProductPrimaryImage.js +0 -7
- package/dist/components/ProductImagePreview/Thumbnail.cjs +0 -112
- package/dist/components/ProductImagePreview/Thumbnail.js +0 -8
- package/dist/components/ProductImagePreview/ZoomWindow.cjs +0 -198
- package/dist/components/ProductImagePreview/ZoomWindow.js +0 -8
- package/dist/components/ProductImagePreview/index.cjs +0 -1447
- package/dist/components/ProductImagePreview/index.js +0 -22
- package/dist/components/ProjectBar.cjs +0 -279
- package/dist/components/ProjectBar.js +0 -71
- package/dist/components/Radio.cjs +0 -386
- package/dist/components/Radio.js +0 -10
- package/dist/components/Search.cjs +0 -1033
- package/dist/components/Search.js +0 -14
- package/dist/components/SearchResultImage/index.cjs +0 -92
- package/dist/components/SearchResultImage/index.js +0 -8
- package/dist/components/Select.cjs +0 -1012
- package/dist/components/Select.js +0 -14
- package/dist/components/SideMenu.cjs +0 -61
- package/dist/components/SideMenu.js +0 -28
- package/dist/components/SideMenuGroup.cjs +0 -593
- package/dist/components/SideMenuGroup.js +0 -97
- package/dist/components/SideMenuItem.cjs +0 -568
- package/dist/components/SideMenuItem.js +0 -95
- package/dist/components/SimpleTable.cjs +0 -547
- package/dist/components/SimpleTable.js +0 -10
- package/dist/components/SkeletonParagraph.cjs +0 -51
- package/dist/components/SkeletonParagraph.js +0 -7
- package/dist/components/Spinner.cjs +0 -57
- package/dist/components/Spinner.js +0 -7
- package/dist/components/Stack.cjs +0 -434
- package/dist/components/Stack.js +0 -8
- package/dist/components/StatusPill.cjs +0 -303
- package/dist/components/StatusPill.js +0 -64
- package/dist/components/Stepper.cjs +0 -1478
- package/dist/components/Stepper.js +0 -239
- package/dist/components/Subheader.cjs +0 -255
- package/dist/components/Subheader.js +0 -8
- package/dist/components/Surface.cjs +0 -101
- package/dist/components/Surface.js +0 -7
- package/dist/components/Swatch.cjs +0 -2089
- package/dist/components/Swatch.js +0 -1513
- package/dist/components/Textarea.cjs +0 -330
- package/dist/components/Textarea.js +0 -136
- package/dist/components/Theme.cjs +0 -51
- package/dist/components/Theme.js +0 -7
- package/dist/components/Time.cjs +0 -1511
- package/dist/components/Time.js +0 -373
- package/dist/components/Toast.cjs +0 -764
- package/dist/components/Toast.js +0 -243
- package/dist/components/Tooltip.cjs +0 -337
- package/dist/components/Tooltip.js +0 -14
- package/dist/components/TopBar.cjs +0 -392
- package/dist/components/TopBar.js +0 -148
- package/dist/components/Upload.cjs +0 -823
- package/dist/components/Upload.js +0 -132
- package/dist/components/WorldpayIframe.cjs +0 -45
- package/dist/components/WorldpayIframe.js +0 -22
- package/dist/components/index.cjs +0 -9454
- package/dist/components/index.css +0 -5546
- package/dist/components/index.js +0 -174
- package/dist/components/useMenuSystem.cjs +0 -442
- package/dist/components/useMenuSystem.js +0 -15
- package/dist/components/useMounted.cjs +0 -39
- package/dist/components/useMounted.js +0 -8
- package/dist/fonts.css +0 -21
- package/dist/hooks/index.cjs +0 -523
- package/dist/hooks/index.js +0 -22
- package/dist/icons-light[FILL]-PPZXOLWS.woff2 +0 -0
- package/dist/icons-normal[FILL]-PPZXOLWS.woff2 +0 -0
- package/dist/index.css +0 -5524
- package/dist/open-sans-55T6A4JE.woff2 +0 -0
- package/dist/types.cjs +0 -18
- package/dist/types.js +0 -0
- package/dist/utils/index.cjs +0 -264
- package/dist/utils/index.js +0 -43
|
@@ -1,2531 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __defProps = Object.defineProperties;
|
|
6
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
8
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
10
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
13
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
14
|
-
var __spreadValues = (a, b) => {
|
|
15
|
-
for (var prop in b || (b = {}))
|
|
16
|
-
if (__hasOwnProp.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
if (__getOwnPropSymbols)
|
|
19
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
20
|
-
if (__propIsEnum.call(b, prop))
|
|
21
|
-
__defNormalProp(a, prop, b[prop]);
|
|
22
|
-
}
|
|
23
|
-
return a;
|
|
24
|
-
};
|
|
25
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
26
|
-
var __objRest = (source, exclude) => {
|
|
27
|
-
var target = {};
|
|
28
|
-
for (var prop in source)
|
|
29
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
30
|
-
target[prop] = source[prop];
|
|
31
|
-
if (source != null && __getOwnPropSymbols)
|
|
32
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
33
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
34
|
-
target[prop] = source[prop];
|
|
35
|
-
}
|
|
36
|
-
return target;
|
|
37
|
-
};
|
|
38
|
-
var __export = (target, all) => {
|
|
39
|
-
for (var name in all)
|
|
40
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
41
|
-
};
|
|
42
|
-
var __copyProps = (to, from, except, desc) => {
|
|
43
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
44
|
-
for (let key of __getOwnPropNames(from))
|
|
45
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
46
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
47
|
-
}
|
|
48
|
-
return to;
|
|
49
|
-
};
|
|
50
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
51
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
52
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
53
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
54
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
55
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
56
|
-
mod
|
|
57
|
-
));
|
|
58
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
59
|
-
|
|
60
|
-
// src/components/DataGridCell.tsx
|
|
61
|
-
var DataGridCell_exports = {};
|
|
62
|
-
__export(DataGridCell_exports, {
|
|
63
|
-
DataCellHeader: () => DataCellHeader,
|
|
64
|
-
DataGridCell: () => DataGridCell,
|
|
65
|
-
DragAlongCell: () => DragAlongCell,
|
|
66
|
-
DraggableCellHeader: () => DraggableCellHeader
|
|
67
|
-
});
|
|
68
|
-
module.exports = __toCommonJS(DataGridCell_exports);
|
|
69
|
-
var import_sortable = require("@dnd-kit/sortable");
|
|
70
|
-
|
|
71
|
-
// ../../node_modules/@dnd-kit/utilities/dist/utilities.esm.js
|
|
72
|
-
var import_react = require("react");
|
|
73
|
-
var canUseDOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
74
|
-
var CSS = /* @__PURE__ */ Object.freeze({
|
|
75
|
-
Translate: {
|
|
76
|
-
toString(transform) {
|
|
77
|
-
if (!transform) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const {
|
|
81
|
-
x,
|
|
82
|
-
y
|
|
83
|
-
} = transform;
|
|
84
|
-
return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)";
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
Scale: {
|
|
88
|
-
toString(transform) {
|
|
89
|
-
if (!transform) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
const {
|
|
93
|
-
scaleX,
|
|
94
|
-
scaleY
|
|
95
|
-
} = transform;
|
|
96
|
-
return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")";
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
Transform: {
|
|
100
|
-
toString(transform) {
|
|
101
|
-
if (!transform) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(" ");
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
Transition: {
|
|
108
|
-
toString(_ref) {
|
|
109
|
-
let {
|
|
110
|
-
property,
|
|
111
|
-
duration,
|
|
112
|
-
easing
|
|
113
|
-
} = _ref;
|
|
114
|
-
return property + " " + duration + "ms " + easing;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
// src/components/DataGridCell.tsx
|
|
120
|
-
var import_clsx9 = __toESM(require("clsx"), 1);
|
|
121
|
-
var import_react12 = require("react");
|
|
122
|
-
|
|
123
|
-
// src/classNames.ts
|
|
124
|
-
var import_clsx = __toESM(require("clsx"), 1);
|
|
125
|
-
var typography = {
|
|
126
|
-
display1: (0, import_clsx.default)(
|
|
127
|
-
"font-sans font-semibold",
|
|
128
|
-
"text-display-1-mobile desktop:text-display-1-desktop compact:text-display-1-desktop-compact",
|
|
129
|
-
"leading-display-1-mobile desktop:leading-display-1-desktop"
|
|
130
|
-
),
|
|
131
|
-
display2: (0, import_clsx.default)(
|
|
132
|
-
"font-sans font-bold",
|
|
133
|
-
"text-display-2-mobile desktop:text-display-2-desktop compact:text-display-2-desktop-compact",
|
|
134
|
-
"leading-display-2-mobile desktop:leading-display-2-desktop"
|
|
135
|
-
),
|
|
136
|
-
heading1: (0, import_clsx.default)(
|
|
137
|
-
"font-sans font-semibold",
|
|
138
|
-
"text-heading-1-mobile desktop:text-heading-1-desktop compact:text-heading-1-desktop-compact",
|
|
139
|
-
"leading-heading-1-mobile desktop:leading-heading-1-desktop"
|
|
140
|
-
),
|
|
141
|
-
heading2: (0, import_clsx.default)(
|
|
142
|
-
"font-sans font-normal",
|
|
143
|
-
"text-heading-2-mobile desktop:text-heading-2-desktop compact:text-heading-2-desktop-compact",
|
|
144
|
-
"leading-heading-2-mobile desktop:leading-heading-2-desktop"
|
|
145
|
-
),
|
|
146
|
-
heading3: (0, import_clsx.default)(
|
|
147
|
-
"font-sans font-semibold",
|
|
148
|
-
"text-heading-3-mobile desktop:text-heading-3-desktop compact:text-heading-3-desktop-compact",
|
|
149
|
-
"leading-heading-3-mobile desktop:leading-heading-3-desktop"
|
|
150
|
-
),
|
|
151
|
-
subheader: (0, import_clsx.default)(
|
|
152
|
-
"font-sans font-semibold",
|
|
153
|
-
"text-subheader-mobile desktop:text-subheader-desktop compact:text-subheader-desktop-compact",
|
|
154
|
-
"leading-subheader-mobile desktop:leading-subheader-desktop"
|
|
155
|
-
),
|
|
156
|
-
link: (0, import_clsx.default)(
|
|
157
|
-
"font-sans font-normal",
|
|
158
|
-
"text-link-mobile desktop:text-link-desktop compact:text-link-desktop-compact",
|
|
159
|
-
"leading-link-mobile desktop:leading-link-desktop"
|
|
160
|
-
),
|
|
161
|
-
buttonLabel: (0, import_clsx.default)(
|
|
162
|
-
"font-sans font-semibold",
|
|
163
|
-
"text-label-mobile desktop:text-label-desktop compact:text-label-desktop-compact",
|
|
164
|
-
"leading-label-mobile desktop:leading-label-desktop"
|
|
165
|
-
),
|
|
166
|
-
label: (0, import_clsx.default)(
|
|
167
|
-
"font-sans font-semibold",
|
|
168
|
-
"text-label-mobile desktop:text-label-desktop compact:text-label-desktop-compact",
|
|
169
|
-
"leading-label-mobile desktop:leading-label-desktop"
|
|
170
|
-
),
|
|
171
|
-
paragraph: (0, import_clsx.default)(
|
|
172
|
-
"font-sans font-normal",
|
|
173
|
-
"text-paragraph-mobile desktop:text-paragraph-desktop compact:text-paragraph-desktop-compact",
|
|
174
|
-
"leading-paragraph-mobile desktop:leading-paragraph-desktop"
|
|
175
|
-
),
|
|
176
|
-
caption: (0, import_clsx.default)(
|
|
177
|
-
"font-sans font-normal",
|
|
178
|
-
"text-caption-mobile desktop:text-caption-desktop compact:text-caption-desktop-compact",
|
|
179
|
-
"leading-caption-mobile desktop:leading-caption-desktop"
|
|
180
|
-
),
|
|
181
|
-
breadcrumb: (0, import_clsx.default)(
|
|
182
|
-
"font-sans font-normal",
|
|
183
|
-
"text-paragraph-mobile desktop:text-paragraph-desktop compact:text-paragraph-desktop-compact",
|
|
184
|
-
"leading-mobile-breadcrumb desktop:leading-desktop-breadcrumb"
|
|
185
|
-
)
|
|
186
|
-
};
|
|
187
|
-
var baseTransition = (0, import_clsx.default)(
|
|
188
|
-
"transition-colors duration-100 ease-in-out"
|
|
189
|
-
);
|
|
190
|
-
var componentGap = (0, import_clsx.default)(
|
|
191
|
-
"gap-mobile-component-gap desktop:gap-desktop-component-gap compact:gap-desktop-compact-component-gap"
|
|
192
|
-
);
|
|
193
|
-
var paddingUsingComponentGap = (0, import_clsx.default)(
|
|
194
|
-
"p-mobile-component-gap desktop:p-desktop-component-gap compact:p-desktop-compact-component-gap"
|
|
195
|
-
);
|
|
196
|
-
var paddingXUsingLayoutGroupGap = (0, import_clsx.default)(
|
|
197
|
-
"px-mobile-layout-group-gap desktop:px-desktop-layout-group-gap compact:px-desktop-compact-layout-group-gap"
|
|
198
|
-
);
|
|
199
|
-
var paddingYUsingLayoutGroupGap = (0, import_clsx.default)(
|
|
200
|
-
"py-mobile-layout-group-gap desktop:py-desktop-layout-group-gap compact:py-desktop-compact-layout-group-gap"
|
|
201
|
-
);
|
|
202
|
-
var componentPadding = (0, import_clsx.default)(
|
|
203
|
-
"p-mobile-component-padding desktop:p-desktop-component-padding compact:p-desktop-compact-component-padding"
|
|
204
|
-
);
|
|
205
|
-
var componentPaddingBottom = (0, import_clsx.default)(
|
|
206
|
-
"pb-mobile-component-padding desktop:pb-desktop-component-padding compact:pb-desktop-compact-component-padding"
|
|
207
|
-
);
|
|
208
|
-
var componentPaddingX = (0, import_clsx.default)(
|
|
209
|
-
"px-mobile-component-padding desktop:px-desktop-component-padding compact:px-desktop-compact-component-padding"
|
|
210
|
-
);
|
|
211
|
-
var componentPaddingY = (0, import_clsx.default)(
|
|
212
|
-
"py-mobile-component-padding desktop:py-desktop-component-padding compact:py-desktop-compact-component-padding"
|
|
213
|
-
);
|
|
214
|
-
var componentPaddingXUsingComponentGap = (0, import_clsx.default)(
|
|
215
|
-
"px-mobile-component-gap desktop:px-desktop-component-gap compact:px-desktop-compact-component-gap"
|
|
216
|
-
);
|
|
217
|
-
var componentPaddingYUsingComponentGap = (0, import_clsx.default)(
|
|
218
|
-
"py-mobile-component-gap desktop:py-desktop-component-gap compact:py-desktop-compact-component-gap"
|
|
219
|
-
);
|
|
220
|
-
var componentPaddingYUsingComponentGap2xMobile = (0, import_clsx.default)(
|
|
221
|
-
"py-[calc(var(--spacing-mobile-component-gap)_+_8px)] desktop:py-desktop-component-gap compact:py-desktop-compact-component-gap"
|
|
222
|
-
);
|
|
223
|
-
var componentPaddingMinusBorder = (0, import_clsx.default)(
|
|
224
|
-
"p-[calc(var(--spacing-mobile-component-padding)_-_1px)] desktop:p-[calc(var(--spacing-desktop-component-padding)_-_1px)] compact:p-[calc(var(--spacing-desktop-compact-component-padding)_-_1px)]"
|
|
225
|
-
);
|
|
226
|
-
var componentPaddingMinus2pxBorder = (0, import_clsx.default)(
|
|
227
|
-
"p-[calc(var(--spacing-mobile-component-padding)_-_2px)] desktop:p-[calc(var(--spacing-desktop-component-padding)_-_2px)] compact:p-[calc(var(--spacing-desktop-compact-component-padding)_-_2px)]"
|
|
228
|
-
);
|
|
229
|
-
var componentPaddingMinusBorderDesktop = (0, import_clsx.default)(
|
|
230
|
-
"p-[calc(var(--spacing-desktop-component-padding)_-_1px)]"
|
|
231
|
-
);
|
|
232
|
-
var layoutPaddding = (0, import_clsx.default)(
|
|
233
|
-
"p-mobile-layout-padding desktop:p-desktop-layout-padding compact:p-desktop-compact-layout-padding"
|
|
234
|
-
);
|
|
235
|
-
var layoutPaddingBottom = (0, import_clsx.default)(
|
|
236
|
-
"pb-mobile-layout-padding desktop:pb-desktop-layout-padding compact:pb-desktop-compact-layout-padding"
|
|
237
|
-
);
|
|
238
|
-
var layoutPaddingY = (0, import_clsx.default)(
|
|
239
|
-
"py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding"
|
|
240
|
-
);
|
|
241
|
-
var layoutPaddingX = (0, import_clsx.default)(
|
|
242
|
-
"px-mobile-layout-padding desktop:px-desktop-layout-padding compact:px-desktop-compact-layout-padding"
|
|
243
|
-
);
|
|
244
|
-
var containerPaddingX = (0, import_clsx.default)(
|
|
245
|
-
"px-mobile-container-padding desktop:px-desktop-container-padding compact:px-desktop-compact-container-padding"
|
|
246
|
-
);
|
|
247
|
-
var containerPaddingY = (0, import_clsx.default)(
|
|
248
|
-
"py-mobile-container-padding desktop:py-desktop-container-padding compact:py-desktop-compact-container-padding"
|
|
249
|
-
);
|
|
250
|
-
var layoutGroupGapPaddingY = (0, import_clsx.default)(
|
|
251
|
-
"py-mobile-layout-group-gap desktop:py-desktop-layout-group-gap compact:py-desktop-compact-layout-group-gap"
|
|
252
|
-
);
|
|
253
|
-
var layoutGroupGap = (0, import_clsx.default)(
|
|
254
|
-
"gap-mobile-layout-group-gap desktop:gap-desktop-layout-group-gap compact:gap-desktop-compact-layout-group-gap"
|
|
255
|
-
);
|
|
256
|
-
var layoutGap = (0, import_clsx.default)(
|
|
257
|
-
"gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-desktop-compact-layout-gap"
|
|
258
|
-
);
|
|
259
|
-
var gapUsingContainerPadding = (0, import_clsx.default)(
|
|
260
|
-
"gap-mobile-container-padding desktop:gap-desktop-container-padding compact:gap-desktop-compact-container-padding"
|
|
261
|
-
);
|
|
262
|
-
|
|
263
|
-
// src/components/MenuOption.tsx
|
|
264
|
-
var import_clsx6 = __toESM(require("clsx"), 1);
|
|
265
|
-
var import_react7 = require("react");
|
|
266
|
-
|
|
267
|
-
// src/components/Label.tsx
|
|
268
|
-
var import_clsx2 = __toESM(require("clsx"), 1);
|
|
269
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
270
|
-
var Label = (_a) => {
|
|
271
|
-
var _b = _a, {
|
|
272
|
-
as = "span",
|
|
273
|
-
padded,
|
|
274
|
-
className,
|
|
275
|
-
color,
|
|
276
|
-
align,
|
|
277
|
-
id,
|
|
278
|
-
testid
|
|
279
|
-
} = _b, props = __objRest(_b, [
|
|
280
|
-
"as",
|
|
281
|
-
"padded",
|
|
282
|
-
"className",
|
|
283
|
-
"color",
|
|
284
|
-
"align",
|
|
285
|
-
"id",
|
|
286
|
-
"testid"
|
|
287
|
-
]);
|
|
288
|
-
const Element = as;
|
|
289
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
290
|
-
Element,
|
|
291
|
-
__spreadProps(__spreadValues({
|
|
292
|
-
id,
|
|
293
|
-
"data-testid": testid,
|
|
294
|
-
className: (0, import_clsx2.default)(
|
|
295
|
-
typography.label,
|
|
296
|
-
align === "left" && "text-left",
|
|
297
|
-
align === "center" && "text-center",
|
|
298
|
-
align === "right" && "text-right",
|
|
299
|
-
className,
|
|
300
|
-
padded && componentPaddingXUsingComponentGap
|
|
301
|
-
)
|
|
302
|
-
}, props), {
|
|
303
|
-
style: __spreadProps(__spreadValues({}, props.style), {
|
|
304
|
-
color: color ? `var(--color-${color})` : void 0
|
|
305
|
-
})
|
|
306
|
-
})
|
|
307
|
-
);
|
|
308
|
-
};
|
|
309
|
-
Label.displayName = "Label";
|
|
310
|
-
|
|
311
|
-
// src/components/Paragraph.tsx
|
|
312
|
-
var import_clsx3 = __toESM(require("clsx"), 1);
|
|
313
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
314
|
-
var Paragraph = (_a) => {
|
|
315
|
-
var _b = _a, {
|
|
316
|
-
className,
|
|
317
|
-
color,
|
|
318
|
-
padded,
|
|
319
|
-
align = "left",
|
|
320
|
-
tall,
|
|
321
|
-
addOverflow,
|
|
322
|
-
children,
|
|
323
|
-
as = "p",
|
|
324
|
-
id,
|
|
325
|
-
testid
|
|
326
|
-
} = _b, props = __objRest(_b, [
|
|
327
|
-
"className",
|
|
328
|
-
"color",
|
|
329
|
-
"padded",
|
|
330
|
-
"align",
|
|
331
|
-
"tall",
|
|
332
|
-
"addOverflow",
|
|
333
|
-
"children",
|
|
334
|
-
"as",
|
|
335
|
-
"id",
|
|
336
|
-
"testid"
|
|
337
|
-
]);
|
|
338
|
-
const Element = as;
|
|
339
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
340
|
-
Element,
|
|
341
|
-
__spreadProps(__spreadValues({
|
|
342
|
-
id,
|
|
343
|
-
"data-testid": testid
|
|
344
|
-
}, props), {
|
|
345
|
-
className: (0, import_clsx3.default)(
|
|
346
|
-
typography.paragraph,
|
|
347
|
-
className,
|
|
348
|
-
padded && componentPaddingXUsingComponentGap,
|
|
349
|
-
align === "left" && "text-left",
|
|
350
|
-
align === "center" && "text-center",
|
|
351
|
-
align === "right" && "text-right",
|
|
352
|
-
tall && "!leading-6",
|
|
353
|
-
addOverflow && "whitespace-nowrap text-ellipsis overflow-hidden"
|
|
354
|
-
),
|
|
355
|
-
style: __spreadProps(__spreadValues({}, props.style), {
|
|
356
|
-
color: color ? `var(--color-${color})` : void 0
|
|
357
|
-
}),
|
|
358
|
-
children
|
|
359
|
-
})
|
|
360
|
-
);
|
|
361
|
-
};
|
|
362
|
-
Paragraph.displayName = "Paragraph";
|
|
363
|
-
|
|
364
|
-
// src/components/Icon.tsx
|
|
365
|
-
var import_clsx4 = __toESM(require("clsx"), 1);
|
|
366
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
367
|
-
function Icon(_a) {
|
|
368
|
-
var _b = _a, {
|
|
369
|
-
name,
|
|
370
|
-
size = 24,
|
|
371
|
-
variant = "outline",
|
|
372
|
-
testid
|
|
373
|
-
} = _b, props = __objRest(_b, [
|
|
374
|
-
"name",
|
|
375
|
-
"size",
|
|
376
|
-
"variant",
|
|
377
|
-
"testid"
|
|
378
|
-
]);
|
|
379
|
-
const variantStyle = variant === "filled" ? '"FILL" 1' : '"FILL" 0';
|
|
380
|
-
const weightStyle = size === 16 ? '"wght" 400' : '"wght" 300';
|
|
381
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
382
|
-
"span",
|
|
383
|
-
__spreadProps(__spreadValues({}, props), {
|
|
384
|
-
"data-testid": testid,
|
|
385
|
-
className: (0, import_clsx4.default)(
|
|
386
|
-
"icon",
|
|
387
|
-
`icon-${size}`,
|
|
388
|
-
// size === 16 ? "font-normal" : "font-light", // size 16 font weight is not working as normal from before
|
|
389
|
-
props.className
|
|
390
|
-
),
|
|
391
|
-
style: __spreadValues({
|
|
392
|
-
fontVariationSettings: variantStyle + `, ${weightStyle}`
|
|
393
|
-
}, props.style),
|
|
394
|
-
children: name
|
|
395
|
-
})
|
|
396
|
-
);
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
// src/hooks/useKeydown.ts
|
|
400
|
-
var import_react2 = require("react");
|
|
401
|
-
|
|
402
|
-
// src/hooks/useInfiniteScroll.tsx
|
|
403
|
-
var import_react3 = require("react");
|
|
404
|
-
|
|
405
|
-
// src/hooks/useMatchesMedia.ts
|
|
406
|
-
var import_react4 = require("react");
|
|
407
|
-
var useMatchesMedia = (query) => {
|
|
408
|
-
const [matches, setMatches] = (0, import_react4.useState)();
|
|
409
|
-
(0, import_react4.useLayoutEffect)(() => {
|
|
410
|
-
const mediaQueryList = window.matchMedia(query);
|
|
411
|
-
const listener = () => setMatches(mediaQueryList.matches);
|
|
412
|
-
listener();
|
|
413
|
-
mediaQueryList.addEventListener("change", listener);
|
|
414
|
-
return () => mediaQueryList.removeEventListener("change", listener);
|
|
415
|
-
}, [query]);
|
|
416
|
-
return matches;
|
|
417
|
-
};
|
|
418
|
-
var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
|
|
419
|
-
|
|
420
|
-
// src/hooks/useTableLayout/useTableLayout.ts
|
|
421
|
-
var import_react5 = require("react");
|
|
422
|
-
|
|
423
|
-
// src/utils/formatting.tsx
|
|
424
|
-
function getDecimalPlaceholder(decimals) {
|
|
425
|
-
if (!decimals || decimals <= 0) {
|
|
426
|
-
return {};
|
|
427
|
-
}
|
|
428
|
-
return {
|
|
429
|
-
placeholder: `0.${"0".repeat(decimals)}`
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
function formatDecimalValue(value, decimals) {
|
|
433
|
-
if (!value || value === "") {
|
|
434
|
-
return "";
|
|
435
|
-
}
|
|
436
|
-
const numValue = typeof value === "string" ? parseFloat(value) : value;
|
|
437
|
-
if (isNaN(numValue)) {
|
|
438
|
-
return "";
|
|
439
|
-
}
|
|
440
|
-
if (!decimals || decimals <= 0) {
|
|
441
|
-
return String(Math.round(numValue));
|
|
442
|
-
}
|
|
443
|
-
return numValue.toFixed(decimals);
|
|
444
|
-
}
|
|
445
|
-
function formatCurrencyDisplay(value) {
|
|
446
|
-
if (!value || value === "") {
|
|
447
|
-
return "";
|
|
448
|
-
}
|
|
449
|
-
const parts = value.split(".");
|
|
450
|
-
const integerPart = parts[0];
|
|
451
|
-
const decimalPart = parts[1];
|
|
452
|
-
const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
453
|
-
return decimalPart !== void 0 ? `${formattedInteger}.${decimalPart}` : formattedInteger;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
// src/utils/index.ts
|
|
457
|
-
var LocalStoragePrefixVersion = `dmsi-acc-v1.1.5`;
|
|
458
|
-
|
|
459
|
-
// src/utils.ts
|
|
460
|
-
function findDocumentRoot(element) {
|
|
461
|
-
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
462
|
-
throw new Error(
|
|
463
|
-
"findDocumentRoot can only be used in a browser environment."
|
|
464
|
-
);
|
|
465
|
-
}
|
|
466
|
-
if (!element || !(element instanceof Node)) {
|
|
467
|
-
return window.document.body;
|
|
468
|
-
}
|
|
469
|
-
let currentElement = element;
|
|
470
|
-
while (currentElement && currentElement.parentNode) {
|
|
471
|
-
if (currentElement.parentNode === document) {
|
|
472
|
-
return document.body;
|
|
473
|
-
} else if (currentElement.parentNode instanceof DocumentFragment) {
|
|
474
|
-
return currentElement.parentNode;
|
|
475
|
-
} else {
|
|
476
|
-
currentElement = currentElement.parentNode;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
return window.document.body;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
// src/hooks/useTableLayout/storage.ts
|
|
483
|
-
var STORAGE_PREFIX = `${LocalStoragePrefixVersion}-tablePrefs`;
|
|
484
|
-
var LEGACY_STORAGE_PREFIX = `${LocalStoragePrefixVersion}-tableLayout`;
|
|
485
|
-
|
|
486
|
-
// src/hooks/useEditCell.tsx
|
|
487
|
-
var import_react6 = require("react");
|
|
488
|
-
|
|
489
|
-
// src/components/Caption.tsx
|
|
490
|
-
var import_clsx5 = __toESM(require("clsx"), 1);
|
|
491
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
492
|
-
var Caption = (_a) => {
|
|
493
|
-
var _b = _a, {
|
|
494
|
-
className,
|
|
495
|
-
children,
|
|
496
|
-
as = "span",
|
|
497
|
-
style = "default",
|
|
498
|
-
color,
|
|
499
|
-
align,
|
|
500
|
-
id,
|
|
501
|
-
testid,
|
|
502
|
-
marginTopDesktop
|
|
503
|
-
} = _b, props = __objRest(_b, [
|
|
504
|
-
"className",
|
|
505
|
-
"children",
|
|
506
|
-
"as",
|
|
507
|
-
"style",
|
|
508
|
-
"color",
|
|
509
|
-
"align",
|
|
510
|
-
"id",
|
|
511
|
-
"testid",
|
|
512
|
-
"marginTopDesktop"
|
|
513
|
-
]);
|
|
514
|
-
const Element = as;
|
|
515
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { id, "data-testid": testid, className: "flex gap-1", children: [
|
|
516
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
517
|
-
WhichIcon,
|
|
518
|
-
{
|
|
519
|
-
id,
|
|
520
|
-
testid,
|
|
521
|
-
style,
|
|
522
|
-
size: 16,
|
|
523
|
-
className: "mt-[3px] desktop:mt-0"
|
|
524
|
-
}
|
|
525
|
-
),
|
|
526
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
527
|
-
Element,
|
|
528
|
-
__spreadProps(__spreadValues({
|
|
529
|
-
id: id ? `${id}-text` : void 0,
|
|
530
|
-
"data-testid": testid ? `${testid}-text` : void 0,
|
|
531
|
-
className: (0, import_clsx5.default)(
|
|
532
|
-
typography.caption.replace("text-text-primary-normal", ""),
|
|
533
|
-
(style === "default" || style === "info") && "text-text-secondary-normal",
|
|
534
|
-
style === "success" && "text-text-success-normal",
|
|
535
|
-
style === "warning" && "text-text-warning-normal",
|
|
536
|
-
style === "error" && "text-text-critical-normal",
|
|
537
|
-
align === "left" && "text-left",
|
|
538
|
-
align === "center" && "text-center",
|
|
539
|
-
align === "right" && "text-right",
|
|
540
|
-
className,
|
|
541
|
-
marginTopDesktop && `desktop:mt-px`
|
|
542
|
-
)
|
|
543
|
-
}, props), {
|
|
544
|
-
style: {
|
|
545
|
-
color: color ? `var(--color-${color})` : void 0
|
|
546
|
-
},
|
|
547
|
-
children
|
|
548
|
-
})
|
|
549
|
-
)
|
|
550
|
-
] });
|
|
551
|
-
};
|
|
552
|
-
var WhichIcon = ({
|
|
553
|
-
style,
|
|
554
|
-
size,
|
|
555
|
-
className,
|
|
556
|
-
id,
|
|
557
|
-
testid
|
|
558
|
-
}) => {
|
|
559
|
-
if (style === "success") {
|
|
560
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-success-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
561
|
-
Icon,
|
|
562
|
-
{
|
|
563
|
-
id: id ? `${id}-icon` : void 0,
|
|
564
|
-
testid: testid ? `${testid}-icon` : void 0,
|
|
565
|
-
className,
|
|
566
|
-
name: "check_circle",
|
|
567
|
-
size
|
|
568
|
-
}
|
|
569
|
-
) });
|
|
570
|
-
}
|
|
571
|
-
if (style === "warning") {
|
|
572
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-warning-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
573
|
-
Icon,
|
|
574
|
-
{
|
|
575
|
-
id: id ? `${id}-icon` : void 0,
|
|
576
|
-
testid: testid ? `${testid}-icon` : void 0,
|
|
577
|
-
className,
|
|
578
|
-
name: "warning",
|
|
579
|
-
size
|
|
580
|
-
}
|
|
581
|
-
) });
|
|
582
|
-
}
|
|
583
|
-
if (style === "error") {
|
|
584
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-critical-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
585
|
-
Icon,
|
|
586
|
-
{
|
|
587
|
-
id: id ? `${id}-icon` : void 0,
|
|
588
|
-
testid: testid ? `${testid}-icon` : void 0,
|
|
589
|
-
className,
|
|
590
|
-
name: "info",
|
|
591
|
-
size
|
|
592
|
-
}
|
|
593
|
-
) });
|
|
594
|
-
}
|
|
595
|
-
if (style === "info") {
|
|
596
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
597
|
-
Icon,
|
|
598
|
-
{
|
|
599
|
-
id: id ? `${id}-icon` : void 0,
|
|
600
|
-
testid: testid ? `${testid}-icon` : void 0,
|
|
601
|
-
className,
|
|
602
|
-
name: "info",
|
|
603
|
-
size
|
|
604
|
-
}
|
|
605
|
-
) });
|
|
606
|
-
}
|
|
607
|
-
return null;
|
|
608
|
-
};
|
|
609
|
-
Caption.displayName = "Caption";
|
|
610
|
-
|
|
611
|
-
// src/components/MenuOption.tsx
|
|
612
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
613
|
-
var MenuOption = ({
|
|
614
|
-
id,
|
|
615
|
-
testid,
|
|
616
|
-
children,
|
|
617
|
-
disabled = false,
|
|
618
|
-
variant = "normal",
|
|
619
|
-
value,
|
|
620
|
-
before,
|
|
621
|
-
after,
|
|
622
|
-
subMenu,
|
|
623
|
-
onClick,
|
|
624
|
-
selected,
|
|
625
|
-
ref,
|
|
626
|
-
onSubMenuHover,
|
|
627
|
-
onSubMenuLeave,
|
|
628
|
-
onSubMenuEnter,
|
|
629
|
-
toggleMenu,
|
|
630
|
-
subMenuLevel = 1,
|
|
631
|
-
currentSubMenuLevel,
|
|
632
|
-
closeSubMenuLevel,
|
|
633
|
-
activeMenu,
|
|
634
|
-
mobilePositionTo,
|
|
635
|
-
highlightMatchingText = false,
|
|
636
|
-
menuValue,
|
|
637
|
-
onMouseMove,
|
|
638
|
-
onMouseEnter,
|
|
639
|
-
onMouseLeave,
|
|
640
|
-
small = false
|
|
641
|
-
}) => {
|
|
642
|
-
const uniqueId = (0, import_react7.useId)();
|
|
643
|
-
const internalRef = (0, import_react7.useRef)(null);
|
|
644
|
-
const actualRef = ref || internalRef;
|
|
645
|
-
const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
|
|
646
|
-
const isMobile = useMatchesMobile();
|
|
647
|
-
const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react7.useState)(false);
|
|
648
|
-
const handleMouseEnter = () => {
|
|
649
|
-
if (subMenu && onSubMenuHover && !disabled) {
|
|
650
|
-
onSubMenuHover(menuId.current, subMenuLevel);
|
|
651
|
-
}
|
|
652
|
-
onMouseEnter == null ? void 0 : onMouseEnter();
|
|
653
|
-
};
|
|
654
|
-
const handleMouseLeave = () => {
|
|
655
|
-
if (subMenu && onSubMenuLeave && !disabled) {
|
|
656
|
-
onSubMenuLeave(subMenuLevel);
|
|
657
|
-
}
|
|
658
|
-
setIsSubMenuHovered(false);
|
|
659
|
-
onMouseLeave == null ? void 0 : onMouseLeave();
|
|
660
|
-
};
|
|
661
|
-
const handleMouseMove = () => {
|
|
662
|
-
if (subMenu && onMouseMove && !disabled) {
|
|
663
|
-
onMouseMove();
|
|
664
|
-
}
|
|
665
|
-
};
|
|
666
|
-
const handleSubMenuEnter = () => {
|
|
667
|
-
if (onSubMenuEnter) {
|
|
668
|
-
onSubMenuEnter();
|
|
669
|
-
}
|
|
670
|
-
setIsSubMenuHovered(true);
|
|
671
|
-
};
|
|
672
|
-
const additionalAttributes = {
|
|
673
|
-
"data-selected": selected || null,
|
|
674
|
-
"data-submenu-hovered": isSubMenuHovered || null
|
|
675
|
-
};
|
|
676
|
-
const svgStyles = (0, import_clsx6.default)(
|
|
677
|
-
"[&>svg]:shrink-0 [&>svg]:fill-icon-action-primary-normal"
|
|
678
|
-
);
|
|
679
|
-
const textLabelStyles = (0, import_clsx6.default)("w-full whitespace-nowrap !leading-6");
|
|
680
|
-
const normalStyles = variant === "normal" && !disabled && (0, import_clsx6.default)(
|
|
681
|
-
"bg-transparent text-text-primary-normal",
|
|
682
|
-
"hover:bg-background-action-secondary-hover",
|
|
683
|
-
"focus-visible:bg-background-action-secondary-hover",
|
|
684
|
-
"data-selected:bg-background-action-secondary-hover",
|
|
685
|
-
"data-submenu-hovered:bg-background-action-secondary-hover",
|
|
686
|
-
"active:bg-background-action-secondary-active"
|
|
687
|
-
);
|
|
688
|
-
const normalDisabledStyles = variant === "normal" && disabled && (0, import_clsx6.default)("text-text-primary-disabled");
|
|
689
|
-
const actionStyles = variant === "action" && !disabled && (0, import_clsx6.default)(
|
|
690
|
-
"text-action-400 bg-transparent",
|
|
691
|
-
"hover:bg-background-action-secondary-hover hover:text-text-action-hover",
|
|
692
|
-
"focus-visible:bg-background-action-secondary-hover focus-visible:text-text-action-hover",
|
|
693
|
-
"data-selected:bg-background-action-secondary-active data-selected:text-text-action-active",
|
|
694
|
-
"data-submenu-hovered:bg-background-action-secondary-active data-submenu-hovered:text-text-action-active",
|
|
695
|
-
"active:bg-background-action-secondary-active active:text-text-action-active"
|
|
696
|
-
);
|
|
697
|
-
const actionDisabledStyles = variant === "action" && disabled && (0, import_clsx6.default)("text-text-action-disabled");
|
|
698
|
-
const disabledStyles = disabled && (0, import_clsx6.default)("bg-transparent cursor-default pointer-events-none");
|
|
699
|
-
const processChildren = typeof children === "string" && highlightMatchingText ? highlightMatch(children, menuValue) : children;
|
|
700
|
-
const renderChildren = typeof children === "object" ? children : variant === "action" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Label, { padded: true, className: textLabelStyles, children: processChildren }) : !small ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Paragraph, { padded: true, className: textLabelStyles, children: processChildren }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Caption, { padded: true, className: textLabelStyles, children: processChildren });
|
|
701
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
702
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
703
|
-
"div",
|
|
704
|
-
__spreadProps(__spreadValues({
|
|
705
|
-
id,
|
|
706
|
-
"data-testid": testid,
|
|
707
|
-
ref: actualRef,
|
|
708
|
-
className: (0, import_clsx6.default)(
|
|
709
|
-
"flex cursor-pointer w-full text-left relative outline-none",
|
|
710
|
-
svgStyles,
|
|
711
|
-
small ? layoutGroupGap : componentGap,
|
|
712
|
-
componentPadding,
|
|
713
|
-
baseTransition,
|
|
714
|
-
normalStyles,
|
|
715
|
-
normalDisabledStyles,
|
|
716
|
-
actionStyles,
|
|
717
|
-
actionDisabledStyles,
|
|
718
|
-
disabledStyles,
|
|
719
|
-
{ "items-center": !small }
|
|
720
|
-
),
|
|
721
|
-
"data-value": value || children,
|
|
722
|
-
onClick: () => {
|
|
723
|
-
onClick == null ? void 0 : onClick(menuId.current, value || children);
|
|
724
|
-
if (subMenu) {
|
|
725
|
-
toggleMenu(menuId.current, subMenuLevel);
|
|
726
|
-
}
|
|
727
|
-
},
|
|
728
|
-
onMouseEnter: handleMouseEnter,
|
|
729
|
-
onMouseLeave: handleMouseLeave,
|
|
730
|
-
onMouseMove: handleMouseMove
|
|
731
|
-
}, additionalAttributes), {
|
|
732
|
-
tabIndex: -1,
|
|
733
|
-
role: "menuitem",
|
|
734
|
-
"aria-haspopup": subMenu ? "menu" : void 0,
|
|
735
|
-
children: [
|
|
736
|
-
before && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_clsx6.default)("shrink-0", { "items-center flex": !small }), children: before }),
|
|
737
|
-
renderChildren,
|
|
738
|
-
renderAfterProp()
|
|
739
|
-
]
|
|
740
|
-
})
|
|
741
|
-
),
|
|
742
|
-
subMenu && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
743
|
-
"div",
|
|
744
|
-
{
|
|
745
|
-
onMouseEnter: handleSubMenuEnter,
|
|
746
|
-
onMouseLeave: () => {
|
|
747
|
-
handleMouseLeave();
|
|
748
|
-
setIsSubMenuHovered(false);
|
|
749
|
-
},
|
|
750
|
-
"data-submenu-parent": menuId.current,
|
|
751
|
-
"data-menu-level": subMenuLevel + 1,
|
|
752
|
-
children: subMenu({
|
|
753
|
-
menuId: menuId.current,
|
|
754
|
-
positionTo: actualRef,
|
|
755
|
-
mobilePositionTo,
|
|
756
|
-
position: "right",
|
|
757
|
-
subMenuLevel,
|
|
758
|
-
mobileBackMenuOption,
|
|
759
|
-
mobileHide: isMobile && activeMenu !== menuId.current,
|
|
760
|
-
autoFocusOff: true
|
|
761
|
-
})
|
|
762
|
-
}
|
|
763
|
-
)
|
|
764
|
-
] });
|
|
765
|
-
function renderAfterProp() {
|
|
766
|
-
if (after) {
|
|
767
|
-
return after;
|
|
768
|
-
}
|
|
769
|
-
if (subMenu && after !== null) {
|
|
770
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "chevron_right" });
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
function mobileBackMenuOption() {
|
|
774
|
-
if (!isMobile) {
|
|
775
|
-
return;
|
|
776
|
-
}
|
|
777
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
778
|
-
MenuOption,
|
|
779
|
-
{
|
|
780
|
-
id: id ? `${id}-back` : void 0,
|
|
781
|
-
testid: testid ? `${testid}-back` : void 0,
|
|
782
|
-
onClick: () => {
|
|
783
|
-
closeSubMenuLevel == null ? void 0 : closeSubMenuLevel(currentSubMenuLevel != null ? currentSubMenuLevel : 0);
|
|
784
|
-
},
|
|
785
|
-
variant: "action",
|
|
786
|
-
before: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "chevron_left" }),
|
|
787
|
-
children: "Back"
|
|
788
|
-
}
|
|
789
|
-
);
|
|
790
|
-
}
|
|
791
|
-
};
|
|
792
|
-
MenuOption.displayName = "MenuOption";
|
|
793
|
-
function highlightMatch(text, searchValue) {
|
|
794
|
-
if (!searchValue || !searchValue.trim()) {
|
|
795
|
-
return text;
|
|
796
|
-
}
|
|
797
|
-
const regex = new RegExp(
|
|
798
|
-
`(${searchValue.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`,
|
|
799
|
-
"gi"
|
|
800
|
-
);
|
|
801
|
-
const parts = text.split(regex);
|
|
802
|
-
return parts.map(
|
|
803
|
-
(part, index) => regex.test(part) ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "font-bold", children: part }, index) : part
|
|
804
|
-
);
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
// src/components/Menu.tsx
|
|
808
|
-
var import_clsx7 = __toESM(require("clsx"), 1);
|
|
809
|
-
var import_react9 = require("react");
|
|
810
|
-
var import_react_dom = require("react-dom");
|
|
811
|
-
|
|
812
|
-
// src/components/useMenuSystem.tsx
|
|
813
|
-
var import_react8 = require("react");
|
|
814
|
-
function useSubMenuSystem(mobilePositionTo) {
|
|
815
|
-
const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
|
|
816
|
-
{}
|
|
817
|
-
);
|
|
818
|
-
const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
|
|
819
|
-
const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
|
|
820
|
-
null
|
|
821
|
-
);
|
|
822
|
-
const menuRootRef = (0, import_react8.useRef)(null);
|
|
823
|
-
const subMenuRefs = (0, import_react8.useRef)({});
|
|
824
|
-
const hoverTimeoutRef = (0, import_react8.useRef)(null);
|
|
825
|
-
const closeTimeoutRef = (0, import_react8.useRef)(null);
|
|
826
|
-
const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
|
|
827
|
-
const isMouseMovingRef = (0, import_react8.useRef)(false);
|
|
828
|
-
const pendingOpenActionRef = (0, import_react8.useRef)(null);
|
|
829
|
-
const pendingCloseActionRef = (0, import_react8.useRef)(null);
|
|
830
|
-
const isMobile = useMatchesMobile();
|
|
831
|
-
const toggleMenu = (menuId, level) => {
|
|
832
|
-
if (closeTimeoutRef.current) {
|
|
833
|
-
clearTimeout(closeTimeoutRef.current);
|
|
834
|
-
closeTimeoutRef.current = null;
|
|
835
|
-
}
|
|
836
|
-
setActiveMenu(menuId);
|
|
837
|
-
setCurrentSubMenuLevel(level);
|
|
838
|
-
setActiveMenus((prev) => {
|
|
839
|
-
const newActiveMenus = __spreadValues({}, prev);
|
|
840
|
-
if (newActiveMenus[level] === menuId) {
|
|
841
|
-
delete newActiveMenus[level];
|
|
842
|
-
} else {
|
|
843
|
-
newActiveMenus[level] = menuId;
|
|
844
|
-
}
|
|
845
|
-
Object.keys(newActiveMenus).forEach((key) => {
|
|
846
|
-
if (Number(key) > level) {
|
|
847
|
-
delete newActiveMenus[Number(key)];
|
|
848
|
-
}
|
|
849
|
-
});
|
|
850
|
-
return newActiveMenus;
|
|
851
|
-
});
|
|
852
|
-
};
|
|
853
|
-
const openMenu = (menuId, level) => {
|
|
854
|
-
if (closeTimeoutRef.current) {
|
|
855
|
-
clearTimeout(closeTimeoutRef.current);
|
|
856
|
-
closeTimeoutRef.current = null;
|
|
857
|
-
}
|
|
858
|
-
setActiveMenus((prev) => {
|
|
859
|
-
const newActiveMenus = __spreadValues({}, prev);
|
|
860
|
-
newActiveMenus[level] = menuId;
|
|
861
|
-
Object.keys(newActiveMenus).forEach((key) => {
|
|
862
|
-
if (Number(key) > level) {
|
|
863
|
-
delete newActiveMenus[Number(key)];
|
|
864
|
-
}
|
|
865
|
-
});
|
|
866
|
-
return newActiveMenus;
|
|
867
|
-
});
|
|
868
|
-
};
|
|
869
|
-
const executePendingActions = (0, import_react8.useCallback)(() => {
|
|
870
|
-
if (pendingCloseActionRef.current) {
|
|
871
|
-
pendingCloseActionRef.current();
|
|
872
|
-
pendingCloseActionRef.current = null;
|
|
873
|
-
}
|
|
874
|
-
if (pendingOpenActionRef.current) {
|
|
875
|
-
pendingOpenActionRef.current();
|
|
876
|
-
pendingOpenActionRef.current = null;
|
|
877
|
-
}
|
|
878
|
-
}, []);
|
|
879
|
-
const openMenuWithDelay = (menuId, level, delay = 150) => {
|
|
880
|
-
if (isMobile) {
|
|
881
|
-
return;
|
|
882
|
-
}
|
|
883
|
-
pendingOpenActionRef.current = () => {
|
|
884
|
-
if (hoverTimeoutRef.current) {
|
|
885
|
-
clearTimeout(hoverTimeoutRef.current);
|
|
886
|
-
}
|
|
887
|
-
hoverTimeoutRef.current = setTimeout(() => {
|
|
888
|
-
openMenu(menuId, level);
|
|
889
|
-
}, delay);
|
|
890
|
-
};
|
|
891
|
-
if (!isMouseMovingRef.current) {
|
|
892
|
-
executePendingActions();
|
|
893
|
-
}
|
|
894
|
-
};
|
|
895
|
-
const closeMenuWithDelay = (level, delay = 500) => {
|
|
896
|
-
if (isMobile) {
|
|
897
|
-
return;
|
|
898
|
-
}
|
|
899
|
-
pendingCloseActionRef.current = () => {
|
|
900
|
-
if (hoverTimeoutRef.current) {
|
|
901
|
-
clearTimeout(hoverTimeoutRef.current);
|
|
902
|
-
hoverTimeoutRef.current = null;
|
|
903
|
-
}
|
|
904
|
-
closeTimeoutRef.current = setTimeout(() => {
|
|
905
|
-
closeSubMenuLevel(level);
|
|
906
|
-
}, delay);
|
|
907
|
-
};
|
|
908
|
-
if (!isMouseMovingRef.current) {
|
|
909
|
-
executePendingActions();
|
|
910
|
-
}
|
|
911
|
-
};
|
|
912
|
-
const handleMouseMove = () => {
|
|
913
|
-
isMouseMovingRef.current = true;
|
|
914
|
-
if (mouseStopTimeoutRef.current) {
|
|
915
|
-
clearTimeout(mouseStopTimeoutRef.current);
|
|
916
|
-
}
|
|
917
|
-
mouseStopTimeoutRef.current = setTimeout(() => {
|
|
918
|
-
isMouseMovingRef.current = false;
|
|
919
|
-
executePendingActions();
|
|
920
|
-
}, 200);
|
|
921
|
-
};
|
|
922
|
-
const cancelCloseTimeout = () => {
|
|
923
|
-
if (isMobile) {
|
|
924
|
-
return;
|
|
925
|
-
}
|
|
926
|
-
if (mouseStopTimeoutRef.current) {
|
|
927
|
-
clearTimeout(mouseStopTimeoutRef.current);
|
|
928
|
-
mouseStopTimeoutRef.current = null;
|
|
929
|
-
isMouseMovingRef.current = false;
|
|
930
|
-
}
|
|
931
|
-
};
|
|
932
|
-
const closeSubMenuLevel = (level) => {
|
|
933
|
-
setActiveMenus((prev) => {
|
|
934
|
-
const newActiveMenus = __spreadValues({}, prev);
|
|
935
|
-
delete newActiveMenus[level];
|
|
936
|
-
Object.keys(newActiveMenus).forEach((key) => {
|
|
937
|
-
if (Number(key) >= level) {
|
|
938
|
-
delete newActiveMenus[Number(key)];
|
|
939
|
-
}
|
|
940
|
-
});
|
|
941
|
-
if (isMobile) {
|
|
942
|
-
const newSubMenuLevel = level - 1;
|
|
943
|
-
setCurrentSubMenuLevel(newSubMenuLevel);
|
|
944
|
-
const newActiveMenu = newActiveMenus[newSubMenuLevel];
|
|
945
|
-
if (Object.keys(newActiveMenus).length > 0 && newActiveMenu) {
|
|
946
|
-
setActiveMenu(newActiveMenu);
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
return newActiveMenus;
|
|
950
|
-
});
|
|
951
|
-
};
|
|
952
|
-
const registerSubMenu = (id, element) => {
|
|
953
|
-
subMenuRefs.current[id] = element;
|
|
954
|
-
};
|
|
955
|
-
const isMenuActive = (menuId, level) => {
|
|
956
|
-
return activeMenus[level] === menuId;
|
|
957
|
-
};
|
|
958
|
-
(0, import_react8.useEffect)(() => {
|
|
959
|
-
const handleClickOutside = (event) => {
|
|
960
|
-
var _a;
|
|
961
|
-
if (Object.keys(activeMenus).length === 0) return;
|
|
962
|
-
const target = event.target;
|
|
963
|
-
if ((_a = menuRootRef.current) == null ? void 0 : _a.contains(target)) return;
|
|
964
|
-
const isInsideActiveSubmenu = Object.values(activeMenus).some((id) => {
|
|
965
|
-
const submenuEl = subMenuRefs.current[id];
|
|
966
|
-
return submenuEl == null ? void 0 : submenuEl.contains(target);
|
|
967
|
-
});
|
|
968
|
-
if (!isInsideActiveSubmenu) {
|
|
969
|
-
setActiveMenus({});
|
|
970
|
-
}
|
|
971
|
-
};
|
|
972
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
973
|
-
return () => {
|
|
974
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
975
|
-
};
|
|
976
|
-
}, [activeMenus]);
|
|
977
|
-
(0, import_react8.useEffect)(() => {
|
|
978
|
-
return () => {
|
|
979
|
-
if (hoverTimeoutRef.current) {
|
|
980
|
-
clearTimeout(hoverTimeoutRef.current);
|
|
981
|
-
}
|
|
982
|
-
if (closeTimeoutRef.current) {
|
|
983
|
-
clearTimeout(closeTimeoutRef.current);
|
|
984
|
-
}
|
|
985
|
-
};
|
|
986
|
-
}, []);
|
|
987
|
-
const getAllFocusableMenuElements = () => {
|
|
988
|
-
const elements = [];
|
|
989
|
-
if (menuRootRef.current) {
|
|
990
|
-
elements.push(
|
|
991
|
-
...Array.from(menuRootRef.current.children)
|
|
992
|
-
);
|
|
993
|
-
}
|
|
994
|
-
Object.values(activeMenus).forEach((menuId) => {
|
|
995
|
-
const submenuEl = subMenuRefs.current[menuId];
|
|
996
|
-
if (submenuEl) {
|
|
997
|
-
elements.push(...Array.from(submenuEl.children));
|
|
998
|
-
}
|
|
999
|
-
});
|
|
1000
|
-
return elements;
|
|
1001
|
-
};
|
|
1002
|
-
const findCurrentMenuLevel = (element) => {
|
|
1003
|
-
let current = element.parentElement;
|
|
1004
|
-
while (current) {
|
|
1005
|
-
const level = current.getAttribute("data-menu-level");
|
|
1006
|
-
if (level !== null) {
|
|
1007
|
-
return parseInt(level, 10);
|
|
1008
|
-
}
|
|
1009
|
-
current = current.parentElement;
|
|
1010
|
-
}
|
|
1011
|
-
return 0;
|
|
1012
|
-
};
|
|
1013
|
-
const getMenuElementsAtLevel = (level) => {
|
|
1014
|
-
var _a;
|
|
1015
|
-
if (level === 0 && menuRootRef.current) {
|
|
1016
|
-
return Array.from(menuRootRef.current.children);
|
|
1017
|
-
}
|
|
1018
|
-
const menuId = (_a = Object.entries(activeMenus).find(([, id]) => {
|
|
1019
|
-
const submenuEl = subMenuRefs.current[id];
|
|
1020
|
-
return submenuEl && submenuEl.getAttribute("data-menu-level") === level.toString();
|
|
1021
|
-
})) == null ? void 0 : _a[1];
|
|
1022
|
-
if (menuId) {
|
|
1023
|
-
const submenuEl = subMenuRefs.current[menuId];
|
|
1024
|
-
if (submenuEl) {
|
|
1025
|
-
return Array.from(submenuEl.children);
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
return [];
|
|
1029
|
-
};
|
|
1030
|
-
return {
|
|
1031
|
-
menuRootRef,
|
|
1032
|
-
activeMenus,
|
|
1033
|
-
openMenu,
|
|
1034
|
-
isMenuActive,
|
|
1035
|
-
registerSubMenu,
|
|
1036
|
-
closeSubMenuLevel,
|
|
1037
|
-
getAllFocusableMenuElements,
|
|
1038
|
-
findCurrentMenuLevel,
|
|
1039
|
-
getMenuElementsAtLevel,
|
|
1040
|
-
mobileHide: isMobile && Object.keys(activeMenus).length > 0,
|
|
1041
|
-
listeners: {
|
|
1042
|
-
onSubMenuHover: openMenuWithDelay,
|
|
1043
|
-
onSubMenuLeave: closeMenuWithDelay,
|
|
1044
|
-
onSubMenuEnter: cancelCloseTimeout,
|
|
1045
|
-
onMouseMove: handleMouseMove,
|
|
1046
|
-
toggleMenu,
|
|
1047
|
-
mobilePositionTo,
|
|
1048
|
-
activeMenu,
|
|
1049
|
-
currentSubMenuLevel,
|
|
1050
|
-
closeSubMenuLevel
|
|
1051
|
-
}
|
|
1052
|
-
};
|
|
1053
|
-
}
|
|
1054
|
-
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
1055
|
-
const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
|
|
1056
|
-
top: 0,
|
|
1057
|
-
left: 0,
|
|
1058
|
-
minWidth: 0
|
|
1059
|
-
});
|
|
1060
|
-
const isMobile = options == null ? void 0 : options.isMobile;
|
|
1061
|
-
const updatePosition = (0, import_react8.useCallback)(() => {
|
|
1062
|
-
var _a, _b, _c;
|
|
1063
|
-
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
1064
|
-
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
1065
|
-
const menuRect = (_b = (_a = options == null ? void 0 : options.menuRef) == null ? void 0 : _a.current) == null ? void 0 : _b.getBoundingClientRect();
|
|
1066
|
-
const viewportWidth = window.innerWidth;
|
|
1067
|
-
const menuWidth = (menuRect == null ? void 0 : menuRect.width) || triggerRect.width;
|
|
1068
|
-
const topOffset = (_c = options == null ? void 0 : options.topOffset) != null ? _c : 4;
|
|
1069
|
-
let top = 0;
|
|
1070
|
-
let left = 0;
|
|
1071
|
-
if (position === "bottom" || position === "bottom-right") {
|
|
1072
|
-
top = triggerRect.top + triggerRect.height + topOffset;
|
|
1073
|
-
} else {
|
|
1074
|
-
top = triggerRect.top;
|
|
1075
|
-
}
|
|
1076
|
-
if (position === "bottom") {
|
|
1077
|
-
left = triggerRect.left + window.scrollX;
|
|
1078
|
-
} else if (position === "bottom-right") {
|
|
1079
|
-
left = triggerRect.right + window.scrollX - menuWidth;
|
|
1080
|
-
} else if (position === "right") {
|
|
1081
|
-
if (isMobile) {
|
|
1082
|
-
left = triggerRect.left + window.scrollX;
|
|
1083
|
-
} else {
|
|
1084
|
-
left = triggerRect.right + window.scrollX;
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1087
|
-
const overflowsRightViewport = left + menuWidth > viewportWidth;
|
|
1088
|
-
if (overflowsRightViewport) {
|
|
1089
|
-
const newLeft = triggerRect.left - menuWidth;
|
|
1090
|
-
const overflowsLeftViewport = newLeft < 0;
|
|
1091
|
-
if (overflowsLeftViewport) {
|
|
1092
|
-
left = (viewportWidth - menuWidth) / 2;
|
|
1093
|
-
} else {
|
|
1094
|
-
left = newLeft;
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
if (isMobile && position === "right") {
|
|
1098
|
-
top = triggerRect.top + triggerRect.height + topOffset;
|
|
1099
|
-
}
|
|
1100
|
-
if (isMobile && menuWidth > viewportWidth) {
|
|
1101
|
-
left = 0;
|
|
1102
|
-
}
|
|
1103
|
-
setMenuPosition({
|
|
1104
|
-
top,
|
|
1105
|
-
left,
|
|
1106
|
-
minWidth: triggerRect.width
|
|
1107
|
-
});
|
|
1108
|
-
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
|
|
1109
|
-
(0, import_react8.useEffect)(() => {
|
|
1110
|
-
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
1111
|
-
const handleClickOutside = (event) => {
|
|
1112
|
-
var _a, _b, _c, _d, _e;
|
|
1113
|
-
const target = event.target;
|
|
1114
|
-
if ((_a = elementRef.current) == null ? void 0 : _a.contains(target)) return;
|
|
1115
|
-
if ((_c = (_b = options.menuRef) == null ? void 0 : _b.current) == null ? void 0 : _c.contains(target)) return;
|
|
1116
|
-
if ((_d = options.additionalRefs) == null ? void 0 : _d.some((ref) => {
|
|
1117
|
-
var _a2;
|
|
1118
|
-
return (_a2 = ref.current) == null ? void 0 : _a2.contains(target);
|
|
1119
|
-
}))
|
|
1120
|
-
return;
|
|
1121
|
-
(_e = options.setIsOpen) == null ? void 0 : _e.call(options, false);
|
|
1122
|
-
};
|
|
1123
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
1124
|
-
return () => {
|
|
1125
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
1126
|
-
};
|
|
1127
|
-
}, [
|
|
1128
|
-
options,
|
|
1129
|
-
elementRef,
|
|
1130
|
-
options == null ? void 0 : options.isOpen,
|
|
1131
|
-
options == null ? void 0 : options.setIsOpen,
|
|
1132
|
-
options == null ? void 0 : options.menuRef,
|
|
1133
|
-
options == null ? void 0 : options.additionalRefs
|
|
1134
|
-
]);
|
|
1135
|
-
(0, import_react8.useEffect)(() => {
|
|
1136
|
-
updatePosition();
|
|
1137
|
-
const resizeObserver = new ResizeObserver(updatePosition);
|
|
1138
|
-
if (elementRef == null ? void 0 : elementRef.current) {
|
|
1139
|
-
resizeObserver.observe(elementRef.current);
|
|
1140
|
-
}
|
|
1141
|
-
window.addEventListener("scroll", updatePosition);
|
|
1142
|
-
const hideMenuWhenParentIsScrolled = () => {
|
|
1143
|
-
var _a;
|
|
1144
|
-
(_a = options == null ? void 0 : options.setIsOpen) == null ? void 0 : _a.call(options, false);
|
|
1145
|
-
};
|
|
1146
|
-
const scrollableAncestors = getScrollableAncestors(elementRef.current);
|
|
1147
|
-
scrollableAncestors.forEach((ancestor) => ancestor.addEventListener("scroll", hideMenuWhenParentIsScrolled));
|
|
1148
|
-
window.addEventListener("resize", updatePosition);
|
|
1149
|
-
return () => {
|
|
1150
|
-
resizeObserver.disconnect();
|
|
1151
|
-
window.removeEventListener("scroll", updatePosition);
|
|
1152
|
-
scrollableAncestors.forEach((ancestor) => ancestor.removeEventListener("scroll", hideMenuWhenParentIsScrolled));
|
|
1153
|
-
window.removeEventListener("resize", updatePosition);
|
|
1154
|
-
};
|
|
1155
|
-
}, [elementRef, updatePosition]);
|
|
1156
|
-
return { menuPosition, updatePosition };
|
|
1157
|
-
}
|
|
1158
|
-
function getScrollableAncestors(element) {
|
|
1159
|
-
if (!element) {
|
|
1160
|
-
return [];
|
|
1161
|
-
}
|
|
1162
|
-
const scrollables = [];
|
|
1163
|
-
let parent = element.parentElement;
|
|
1164
|
-
while (parent) {
|
|
1165
|
-
const overflowY = window.getComputedStyle(parent).overflowY;
|
|
1166
|
-
if (overflowY === "auto" || overflowY === "scroll") {
|
|
1167
|
-
scrollables.push(parent);
|
|
1168
|
-
}
|
|
1169
|
-
parent = parent.parentElement;
|
|
1170
|
-
}
|
|
1171
|
-
return scrollables;
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
// src/components/Menu.tsx
|
|
1175
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1176
|
-
var Menu = (_a) => {
|
|
1177
|
-
var _b = _a, {
|
|
1178
|
-
id,
|
|
1179
|
-
testid,
|
|
1180
|
-
children,
|
|
1181
|
-
className,
|
|
1182
|
-
ref,
|
|
1183
|
-
positionTo,
|
|
1184
|
-
mobilePositionTo,
|
|
1185
|
-
show,
|
|
1186
|
-
setShow,
|
|
1187
|
-
position = "bottom",
|
|
1188
|
-
maxHeight: customMaxHeight,
|
|
1189
|
-
topOffset,
|
|
1190
|
-
mobileBackMenuOption,
|
|
1191
|
-
mobileHide,
|
|
1192
|
-
useDefaultMinWidth,
|
|
1193
|
-
autoFocusOff,
|
|
1194
|
-
menuName,
|
|
1195
|
-
calculateMinMaxHeight
|
|
1196
|
-
} = _b, props = __objRest(_b, [
|
|
1197
|
-
"id",
|
|
1198
|
-
"testid",
|
|
1199
|
-
"children",
|
|
1200
|
-
"className",
|
|
1201
|
-
"ref",
|
|
1202
|
-
"positionTo",
|
|
1203
|
-
"mobilePositionTo",
|
|
1204
|
-
"show",
|
|
1205
|
-
"setShow",
|
|
1206
|
-
"position",
|
|
1207
|
-
"maxHeight",
|
|
1208
|
-
"topOffset",
|
|
1209
|
-
"mobileBackMenuOption",
|
|
1210
|
-
"mobileHide",
|
|
1211
|
-
"useDefaultMinWidth",
|
|
1212
|
-
"autoFocusOff",
|
|
1213
|
-
"menuName",
|
|
1214
|
-
"calculateMinMaxHeight"
|
|
1215
|
-
]);
|
|
1216
|
-
const internalRef = (0, import_react9.useRef)(null);
|
|
1217
|
-
const actualRef = ref || internalRef;
|
|
1218
|
-
const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
|
|
1219
|
-
const isMobile = useMatchesMobile();
|
|
1220
|
-
const { menuPosition, updatePosition } = useMenuPosition(
|
|
1221
|
-
isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
|
|
1222
|
-
position,
|
|
1223
|
-
{
|
|
1224
|
-
isOpen: show,
|
|
1225
|
-
setIsOpen: setShow,
|
|
1226
|
-
menuRef: internalRef,
|
|
1227
|
-
topOffset,
|
|
1228
|
-
isMobile: !!(isMobile && mobilePositionTo)
|
|
1229
|
-
}
|
|
1230
|
-
);
|
|
1231
|
-
(0, import_react9.useEffect)(() => {
|
|
1232
|
-
if (calculateMinMaxHeight) {
|
|
1233
|
-
return;
|
|
1234
|
-
}
|
|
1235
|
-
const raf = requestAnimationFrame(() => {
|
|
1236
|
-
if (!actualRef.current || customMaxHeight) {
|
|
1237
|
-
return;
|
|
1238
|
-
}
|
|
1239
|
-
if (actualRef.current.childElementCount > 4) {
|
|
1240
|
-
let accumulatedHeight = 0;
|
|
1241
|
-
Array.from(actualRef.current.children).forEach((child, index) => {
|
|
1242
|
-
if (index >= 5) {
|
|
1243
|
-
return;
|
|
1244
|
-
}
|
|
1245
|
-
accumulatedHeight += child.clientHeight;
|
|
1246
|
-
});
|
|
1247
|
-
accumulatedHeight = accumulatedHeight / 5 * 4.5;
|
|
1248
|
-
setMaxHeight(`${accumulatedHeight}px`);
|
|
1249
|
-
}
|
|
1250
|
-
});
|
|
1251
|
-
return () => {
|
|
1252
|
-
cancelAnimationFrame(raf);
|
|
1253
|
-
};
|
|
1254
|
-
}, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
|
|
1255
|
-
(0, import_react9.useEffect)(() => {
|
|
1256
|
-
if (!calculateMinMaxHeight) {
|
|
1257
|
-
return;
|
|
1258
|
-
}
|
|
1259
|
-
if ((positionTo == null ? void 0 : positionTo.current) && actualRef.current) {
|
|
1260
|
-
const positionToRect = positionTo.current.getBoundingClientRect();
|
|
1261
|
-
const offsetInPx = 16;
|
|
1262
|
-
const calculatedMaxHeight = window.innerHeight - positionToRect.bottom - offsetInPx;
|
|
1263
|
-
setMaxHeight(`${calculatedMaxHeight}px`);
|
|
1264
|
-
}
|
|
1265
|
-
}, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
|
|
1266
|
-
(0, import_react9.useEffect)(() => {
|
|
1267
|
-
if (!show) {
|
|
1268
|
-
return;
|
|
1269
|
-
}
|
|
1270
|
-
initializeMenuFocus();
|
|
1271
|
-
updatePosition();
|
|
1272
|
-
}, [show, updatePosition]);
|
|
1273
|
-
(0, import_react9.useEffect)(() => {
|
|
1274
|
-
if (!show || !setShow) {
|
|
1275
|
-
return;
|
|
1276
|
-
}
|
|
1277
|
-
const handleEscapeKey = (event) => {
|
|
1278
|
-
var _a2;
|
|
1279
|
-
if (event.key !== "Escape") {
|
|
1280
|
-
return;
|
|
1281
|
-
}
|
|
1282
|
-
setShow(false);
|
|
1283
|
-
(_a2 = positionTo == null ? void 0 : positionTo.current) == null ? void 0 : _a2.focus();
|
|
1284
|
-
};
|
|
1285
|
-
document.addEventListener("keydown", handleEscapeKey);
|
|
1286
|
-
return () => {
|
|
1287
|
-
document.removeEventListener("keydown", handleEscapeKey);
|
|
1288
|
-
};
|
|
1289
|
-
}, [show, setShow, positionTo]);
|
|
1290
|
-
return show && (0, import_react_dom.createPortal)(
|
|
1291
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1292
|
-
"div",
|
|
1293
|
-
__spreadProps(__spreadValues({
|
|
1294
|
-
id,
|
|
1295
|
-
"data-testid": testid,
|
|
1296
|
-
ref: setRefs,
|
|
1297
|
-
className: (0, import_clsx7.default)(
|
|
1298
|
-
"shadow-4 rounded-base bg-background-grouped-primary-normal overflow-x-hidden overflow-y-auto flex flex-col outline-0",
|
|
1299
|
-
"fixed",
|
|
1300
|
-
"z-50",
|
|
1301
|
-
"max-w-screen",
|
|
1302
|
-
mobileHide && "opacity-0 pointer-events-none",
|
|
1303
|
-
className
|
|
1304
|
-
)
|
|
1305
|
-
}, props), {
|
|
1306
|
-
style: __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props.style), {
|
|
1307
|
-
maxHeight: customMaxHeight || maxHeight
|
|
1308
|
-
}), menuPosition), {
|
|
1309
|
-
minWidth: useDefaultMinWidth ? "212px" : menuPosition.minWidth
|
|
1310
|
-
}),
|
|
1311
|
-
onKeyDown: handleKeydown,
|
|
1312
|
-
onMouseDown: stopPropagation,
|
|
1313
|
-
onMouseUp: stopPropagation,
|
|
1314
|
-
onTouchStart: stopPropagation,
|
|
1315
|
-
onTouchEnd: stopPropagation,
|
|
1316
|
-
tabIndex: -1,
|
|
1317
|
-
"data-menu": menuName != null ? menuName : "",
|
|
1318
|
-
children: [
|
|
1319
|
-
mobileBackMenuOption == null ? void 0 : mobileBackMenuOption(),
|
|
1320
|
-
children
|
|
1321
|
-
]
|
|
1322
|
-
})
|
|
1323
|
-
),
|
|
1324
|
-
findDocumentRoot(internalRef.current)
|
|
1325
|
-
);
|
|
1326
|
-
function handleKeydown(e) {
|
|
1327
|
-
var _a2, _b2;
|
|
1328
|
-
if (!internalRef.current) {
|
|
1329
|
-
return;
|
|
1330
|
-
}
|
|
1331
|
-
if (e.key !== "Escape") {
|
|
1332
|
-
e.stopPropagation();
|
|
1333
|
-
}
|
|
1334
|
-
const menuOptions = Array.from(
|
|
1335
|
-
internalRef.current.querySelectorAll('[role="menuitem"]')
|
|
1336
|
-
);
|
|
1337
|
-
if (menuOptions.length === 0) {
|
|
1338
|
-
return;
|
|
1339
|
-
}
|
|
1340
|
-
let currentIndex = -1;
|
|
1341
|
-
const focusedElement = document.activeElement;
|
|
1342
|
-
for (let i = 0; i < menuOptions.length; i++) {
|
|
1343
|
-
if (menuOptions[i] === focusedElement) {
|
|
1344
|
-
currentIndex = i;
|
|
1345
|
-
break;
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
switch (e.key) {
|
|
1349
|
-
case "ArrowDown": {
|
|
1350
|
-
e.preventDefault();
|
|
1351
|
-
const nextIndex = currentIndex < menuOptions.length - 1 ? currentIndex + 1 : 0;
|
|
1352
|
-
menuOptions[nextIndex].focus();
|
|
1353
|
-
break;
|
|
1354
|
-
}
|
|
1355
|
-
case "ArrowUp": {
|
|
1356
|
-
e.preventDefault();
|
|
1357
|
-
const prevIndex = currentIndex > 0 ? currentIndex - 1 : menuOptions.length - 1;
|
|
1358
|
-
menuOptions[prevIndex].focus();
|
|
1359
|
-
break;
|
|
1360
|
-
}
|
|
1361
|
-
case "Home":
|
|
1362
|
-
e.preventDefault();
|
|
1363
|
-
menuOptions[0].focus();
|
|
1364
|
-
break;
|
|
1365
|
-
case "End":
|
|
1366
|
-
e.preventDefault();
|
|
1367
|
-
menuOptions[menuOptions.length - 1].focus();
|
|
1368
|
-
break;
|
|
1369
|
-
case "Enter":
|
|
1370
|
-
case " ":
|
|
1371
|
-
case "ArrowRight":
|
|
1372
|
-
e.preventDefault();
|
|
1373
|
-
if (currentIndex >= 0) {
|
|
1374
|
-
menuOptions[currentIndex].click();
|
|
1375
|
-
}
|
|
1376
|
-
break;
|
|
1377
|
-
case "ArrowLeft":
|
|
1378
|
-
e.preventDefault();
|
|
1379
|
-
(_a2 = positionTo == null ? void 0 : positionTo.current) == null ? void 0 : _a2.click();
|
|
1380
|
-
(_b2 = positionTo == null ? void 0 : positionTo.current) == null ? void 0 : _b2.focus();
|
|
1381
|
-
break;
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
function initializeMenuFocus() {
|
|
1385
|
-
var _a2, _b2, _c;
|
|
1386
|
-
if (!autoFocusOff) {
|
|
1387
|
-
(_a2 = internalRef.current) == null ? void 0 : _a2.focus();
|
|
1388
|
-
}
|
|
1389
|
-
const selectedOption = (_b2 = internalRef.current) == null ? void 0 : _b2.querySelector(
|
|
1390
|
-
"[data-selected]"
|
|
1391
|
-
);
|
|
1392
|
-
const firstMenuItem = (_c = internalRef.current) == null ? void 0 : _c.querySelector(
|
|
1393
|
-
'[role="menuitem"]'
|
|
1394
|
-
);
|
|
1395
|
-
const targetElement = selectedOption || firstMenuItem;
|
|
1396
|
-
if (!targetElement) {
|
|
1397
|
-
return;
|
|
1398
|
-
}
|
|
1399
|
-
targetElement.scrollIntoView({
|
|
1400
|
-
block: "nearest",
|
|
1401
|
-
behavior: "instant"
|
|
1402
|
-
});
|
|
1403
|
-
if (autoFocusOff) {
|
|
1404
|
-
return;
|
|
1405
|
-
}
|
|
1406
|
-
requestAnimationFrame(() => {
|
|
1407
|
-
targetElement.focus();
|
|
1408
|
-
});
|
|
1409
|
-
}
|
|
1410
|
-
function setRefs(node) {
|
|
1411
|
-
internalRef.current = node;
|
|
1412
|
-
if (ref) {
|
|
1413
|
-
if (typeof ref === "function") {
|
|
1414
|
-
ref(node);
|
|
1415
|
-
} else {
|
|
1416
|
-
ref.current = node;
|
|
1417
|
-
}
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
function stopPropagation(e) {
|
|
1421
|
-
e.stopPropagation();
|
|
1422
|
-
}
|
|
1423
|
-
};
|
|
1424
|
-
Menu.displayName = "Menu";
|
|
1425
|
-
|
|
1426
|
-
// src/components/Search.tsx
|
|
1427
|
-
var import_react11 = require("react");
|
|
1428
|
-
|
|
1429
|
-
// src/components/Input.tsx
|
|
1430
|
-
var import_react10 = require("react");
|
|
1431
|
-
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1432
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1433
|
-
var InputBase = (_a) => {
|
|
1434
|
-
var _b = _a, {
|
|
1435
|
-
id,
|
|
1436
|
-
testid,
|
|
1437
|
-
before,
|
|
1438
|
-
after,
|
|
1439
|
-
rightAdornment,
|
|
1440
|
-
type,
|
|
1441
|
-
label,
|
|
1442
|
-
error,
|
|
1443
|
-
className,
|
|
1444
|
-
align = "left",
|
|
1445
|
-
caption,
|
|
1446
|
-
required,
|
|
1447
|
-
selectOnFocus,
|
|
1448
|
-
removeRoundness,
|
|
1449
|
-
inputContainerRef,
|
|
1450
|
-
removeBorder,
|
|
1451
|
-
wrapperClassName,
|
|
1452
|
-
focus,
|
|
1453
|
-
secondaryIconColor,
|
|
1454
|
-
fullWidth = true,
|
|
1455
|
-
width,
|
|
1456
|
-
wrapperRef,
|
|
1457
|
-
autocompletePadding = false
|
|
1458
|
-
} = _b, props = __objRest(_b, [
|
|
1459
|
-
"id",
|
|
1460
|
-
"testid",
|
|
1461
|
-
"before",
|
|
1462
|
-
"after",
|
|
1463
|
-
"rightAdornment",
|
|
1464
|
-
"type",
|
|
1465
|
-
"label",
|
|
1466
|
-
"error",
|
|
1467
|
-
"className",
|
|
1468
|
-
"align",
|
|
1469
|
-
"caption",
|
|
1470
|
-
"required",
|
|
1471
|
-
"selectOnFocus",
|
|
1472
|
-
"removeRoundness",
|
|
1473
|
-
"inputContainerRef",
|
|
1474
|
-
"removeBorder",
|
|
1475
|
-
"wrapperClassName",
|
|
1476
|
-
"focus",
|
|
1477
|
-
"secondaryIconColor",
|
|
1478
|
-
"fullWidth",
|
|
1479
|
-
"width",
|
|
1480
|
-
"wrapperRef",
|
|
1481
|
-
"autocompletePadding"
|
|
1482
|
-
]);
|
|
1483
|
-
const attributes = {
|
|
1484
|
-
"data-error": error && !focus || null,
|
|
1485
|
-
"data-focus": focus || null
|
|
1486
|
-
};
|
|
1487
|
-
const inputRef = (0, import_react10.useRef)(null);
|
|
1488
|
-
const inputId = id ? `${id}-input` : void 0;
|
|
1489
|
-
(0, import_react10.useEffect)(() => {
|
|
1490
|
-
var _a2;
|
|
1491
|
-
const input = inputRef.current;
|
|
1492
|
-
const focusHandler = () => {
|
|
1493
|
-
input == null ? void 0 : input.select();
|
|
1494
|
-
};
|
|
1495
|
-
if (selectOnFocus) {
|
|
1496
|
-
(_a2 = inputRef.current) == null ? void 0 : _a2.addEventListener("focus", focusHandler);
|
|
1497
|
-
return () => {
|
|
1498
|
-
input == null ? void 0 : input.removeEventListener("focus", focusHandler);
|
|
1499
|
-
};
|
|
1500
|
-
}
|
|
1501
|
-
}, [selectOnFocus]);
|
|
1502
|
-
const inputBaseClass = (0, import_clsx8.default)(
|
|
1503
|
-
fullWidth ? "w-full" : "w-fit",
|
|
1504
|
-
"flex flex-row items-center",
|
|
1505
|
-
"bg-background-action-secondary-normal caret-icon-on-action-secondary-normal",
|
|
1506
|
-
componentGap,
|
|
1507
|
-
baseTransition,
|
|
1508
|
-
"outline-transparent outline-2 -outline-offset-2",
|
|
1509
|
-
!autocompletePadding && componentPaddingMinusBorder,
|
|
1510
|
-
autocompletePadding && componentPaddingMinusBorderDesktop,
|
|
1511
|
-
!removeRoundness && "rounded-base",
|
|
1512
|
-
!removeBorder && "border border-border-primary-normal",
|
|
1513
|
-
"relative"
|
|
1514
|
-
);
|
|
1515
|
-
const inputFocusClass = (0, import_clsx8.default)(
|
|
1516
|
-
"has-[[data-focus]]:border-transparent has-[[data-focus]]:outline-border-primary-focus focus-within:border-transparent focus-within:outline-border-primary-focus"
|
|
1517
|
-
);
|
|
1518
|
-
const inputDisabledClass = (0, import_clsx8.default)(
|
|
1519
|
-
"has-disabled:bg-background-action-secondary-disabled"
|
|
1520
|
-
);
|
|
1521
|
-
const inputReadOnlyClass = (0, import_clsx8.default)(
|
|
1522
|
-
"has-[input:not(:disabled):read-only]:outline-none has-[input:not(:disabled):read-only]:bg-transparent has-[input:not(:disabled):read-only]:border-transparent has-[input:not(:disabled):read-only]:pl-0"
|
|
1523
|
-
);
|
|
1524
|
-
const inputInvalidClass = (0, import_clsx8.default)(
|
|
1525
|
-
"has-[[data-error]]:border-transparent has-[[data-error]]:not-focus-within:outline-border-primary-error has-[[data-error]]:not-focus-within:outline-1"
|
|
1526
|
-
);
|
|
1527
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1528
|
-
"label",
|
|
1529
|
-
{
|
|
1530
|
-
id,
|
|
1531
|
-
"data-testid": testid,
|
|
1532
|
-
htmlFor: inputId,
|
|
1533
|
-
ref: inputContainerRef,
|
|
1534
|
-
className: (0, import_clsx8.default)(
|
|
1535
|
-
"w-full flex flex-col",
|
|
1536
|
-
"block",
|
|
1537
|
-
"text-text-primary-normal has-disabled:text-text-primary-disabled",
|
|
1538
|
-
componentGap
|
|
1539
|
-
),
|
|
1540
|
-
style: __spreadValues({}, props.style),
|
|
1541
|
-
children: [
|
|
1542
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: (0, import_clsx8.default)("flex items-center", componentGap), children: [
|
|
1543
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1544
|
-
Label,
|
|
1545
|
-
{
|
|
1546
|
-
id: id ? `${id}-label` : void 0,
|
|
1547
|
-
color: error ? "text-primary-error" : void 0,
|
|
1548
|
-
className: (0, import_clsx8.default)(
|
|
1549
|
-
props.disabled || props.readOnly ? "cursor-default" : "cursor-pointer"
|
|
1550
|
-
),
|
|
1551
|
-
children: label
|
|
1552
|
-
}
|
|
1553
|
-
),
|
|
1554
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1555
|
-
"span",
|
|
1556
|
-
{
|
|
1557
|
-
className: (0, import_clsx8.default)(typography.label, "text-text-critical-normal"),
|
|
1558
|
-
children: "*"
|
|
1559
|
-
}
|
|
1560
|
-
)
|
|
1561
|
-
] }),
|
|
1562
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1563
|
-
"div",
|
|
1564
|
-
{
|
|
1565
|
-
className: (0, import_clsx8.default)(
|
|
1566
|
-
inputBaseClass,
|
|
1567
|
-
!props.disabled && inputInvalidClass,
|
|
1568
|
-
inputFocusClass,
|
|
1569
|
-
inputDisabledClass,
|
|
1570
|
-
inputReadOnlyClass,
|
|
1571
|
-
wrapperClassName
|
|
1572
|
-
),
|
|
1573
|
-
ref: (el) => {
|
|
1574
|
-
if (wrapperRef) {
|
|
1575
|
-
wrapperRef.current = el;
|
|
1576
|
-
}
|
|
1577
|
-
},
|
|
1578
|
-
children: [
|
|
1579
|
-
before,
|
|
1580
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1581
|
-
"input",
|
|
1582
|
-
__spreadProps(__spreadValues(__spreadValues({
|
|
1583
|
-
ref: (el) => {
|
|
1584
|
-
inputRef.current = el;
|
|
1585
|
-
},
|
|
1586
|
-
type,
|
|
1587
|
-
required
|
|
1588
|
-
}, props), attributes), {
|
|
1589
|
-
id: inputId,
|
|
1590
|
-
"data-testid": testid ? `${testid}-input` : void 0,
|
|
1591
|
-
className: (0, import_clsx8.default)(
|
|
1592
|
-
"flex-1 outline-none w-full max-w-full min-h-6 min-w-0",
|
|
1593
|
-
"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
|
|
1594
|
-
"placeholder:text-text-secondary-normal disabled:text-text-secondary-disabled",
|
|
1595
|
-
align === "right" && "text-right",
|
|
1596
|
-
align === "center" && "text-center",
|
|
1597
|
-
componentPaddingXUsingComponentGap,
|
|
1598
|
-
typography.paragraph,
|
|
1599
|
-
className,
|
|
1600
|
-
props.readOnly && !props.disabled && "!px-0"
|
|
1601
|
-
),
|
|
1602
|
-
style: __spreadProps(__spreadValues({}, props.style), { width })
|
|
1603
|
-
})
|
|
1604
|
-
),
|
|
1605
|
-
secondaryIconColor ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "contents text-text-secondary-normal", children: after }) : after,
|
|
1606
|
-
rightAdornment
|
|
1607
|
-
]
|
|
1608
|
-
}
|
|
1609
|
-
),
|
|
1610
|
-
caption && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1611
|
-
"div",
|
|
1612
|
-
{
|
|
1613
|
-
id: id ? `${id}-caption` : void 0,
|
|
1614
|
-
"data-testid": testid ? `${testid}-caption` : void 0,
|
|
1615
|
-
children: caption
|
|
1616
|
-
}
|
|
1617
|
-
)
|
|
1618
|
-
]
|
|
1619
|
-
}
|
|
1620
|
-
);
|
|
1621
|
-
};
|
|
1622
|
-
var Input = (_a) => {
|
|
1623
|
-
var _b = _a, {
|
|
1624
|
-
variant = "default",
|
|
1625
|
-
decimals,
|
|
1626
|
-
uom,
|
|
1627
|
-
currencyFormat = false,
|
|
1628
|
-
formatOnBlur = false,
|
|
1629
|
-
removeSearchIcon,
|
|
1630
|
-
value: propValue,
|
|
1631
|
-
onChange,
|
|
1632
|
-
onBlur,
|
|
1633
|
-
onClear,
|
|
1634
|
-
id,
|
|
1635
|
-
testid,
|
|
1636
|
-
rightAdornment
|
|
1637
|
-
} = _b, props = __objRest(_b, [
|
|
1638
|
-
"variant",
|
|
1639
|
-
"decimals",
|
|
1640
|
-
"uom",
|
|
1641
|
-
"currencyFormat",
|
|
1642
|
-
"formatOnBlur",
|
|
1643
|
-
"removeSearchIcon",
|
|
1644
|
-
"value",
|
|
1645
|
-
"onChange",
|
|
1646
|
-
"onBlur",
|
|
1647
|
-
"onClear",
|
|
1648
|
-
"id",
|
|
1649
|
-
"testid",
|
|
1650
|
-
"rightAdornment"
|
|
1651
|
-
]);
|
|
1652
|
-
const [internalValue, setInternalValue] = (0, import_react10.useState)("");
|
|
1653
|
-
const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
|
|
1654
|
-
const [isFocused, setIsFocused] = (0, import_react10.useState)(false);
|
|
1655
|
-
(0, import_react10.useEffect)(() => {
|
|
1656
|
-
var _a2;
|
|
1657
|
-
const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
|
|
1658
|
-
const shouldUseThousandsFormatting = variant === "currency" || variant === "uom" && currencyFormat;
|
|
1659
|
-
if (!stringValue) {
|
|
1660
|
-
setInternalValue("");
|
|
1661
|
-
setDisplayValue("");
|
|
1662
|
-
return;
|
|
1663
|
-
}
|
|
1664
|
-
if (!shouldUseThousandsFormatting) {
|
|
1665
|
-
setInternalValue(stringValue);
|
|
1666
|
-
setDisplayValue(stringValue);
|
|
1667
|
-
return;
|
|
1668
|
-
}
|
|
1669
|
-
const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
|
|
1670
|
-
if (formatOnBlur && isFocused) {
|
|
1671
|
-
setInternalValue(stringValue);
|
|
1672
|
-
setDisplayValue(stringValue);
|
|
1673
|
-
return;
|
|
1674
|
-
}
|
|
1675
|
-
setInternalValue(formatted);
|
|
1676
|
-
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
1677
|
-
}, [propValue, variant, currencyFormat, decimals, formatOnBlur, isFocused]);
|
|
1678
|
-
const getInputProps = () => {
|
|
1679
|
-
var _a2;
|
|
1680
|
-
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
1681
|
-
id
|
|
1682
|
-
}), getDecimalPlaceholder(decimals)), {
|
|
1683
|
-
value: propValue
|
|
1684
|
-
});
|
|
1685
|
-
switch (variant) {
|
|
1686
|
-
case "search":
|
|
1687
|
-
return __spreadProps(__spreadValues({}, baseProps), {
|
|
1688
|
-
placeholder: (_a2 = props.placeholder) != null ? _a2 : "Search",
|
|
1689
|
-
className: "!mr-6",
|
|
1690
|
-
value: displayValue
|
|
1691
|
-
});
|
|
1692
|
-
case "finder":
|
|
1693
|
-
return baseProps;
|
|
1694
|
-
case "currency":
|
|
1695
|
-
return __spreadProps(__spreadValues({}, baseProps), {
|
|
1696
|
-
align: "right",
|
|
1697
|
-
type: "text",
|
|
1698
|
-
value: displayValue
|
|
1699
|
-
});
|
|
1700
|
-
case "percentage":
|
|
1701
|
-
case "uom":
|
|
1702
|
-
return __spreadProps(__spreadValues({}, baseProps), {
|
|
1703
|
-
type: currencyFormat ? "text" : "number",
|
|
1704
|
-
align: "right",
|
|
1705
|
-
value: currencyFormat ? displayValue : propValue
|
|
1706
|
-
});
|
|
1707
|
-
default:
|
|
1708
|
-
return baseProps;
|
|
1709
|
-
}
|
|
1710
|
-
};
|
|
1711
|
-
const getBeforeElement = () => {
|
|
1712
|
-
if (props.before) return props.before;
|
|
1713
|
-
switch (variant) {
|
|
1714
|
-
case "search":
|
|
1715
|
-
return !removeSearchIcon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "search" }) }) : null;
|
|
1716
|
-
case "currency":
|
|
1717
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "attach_money" }) });
|
|
1718
|
-
case "uom":
|
|
1719
|
-
return currencyFormat ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "attach_money" }) }) : null;
|
|
1720
|
-
default:
|
|
1721
|
-
return null;
|
|
1722
|
-
}
|
|
1723
|
-
};
|
|
1724
|
-
const getAfterElement = () => {
|
|
1725
|
-
if (props.after) return props.after;
|
|
1726
|
-
switch (variant) {
|
|
1727
|
-
case "search": {
|
|
1728
|
-
const hasValue = displayValue.length > 0;
|
|
1729
|
-
return hasValue && !props.readOnly ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1730
|
-
Icon,
|
|
1731
|
-
{
|
|
1732
|
-
id: id ? `${id}-clear-button` : void 0,
|
|
1733
|
-
testid: testid ? `${testid}-clear-button` : void 0,
|
|
1734
|
-
name: "close",
|
|
1735
|
-
onClick: handleSearchReset,
|
|
1736
|
-
className: "cursor-pointer absolute right-2 bottom-2/4 translate-y-2/4"
|
|
1737
|
-
}
|
|
1738
|
-
) : null;
|
|
1739
|
-
}
|
|
1740
|
-
case "finder":
|
|
1741
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "search" });
|
|
1742
|
-
case "uom":
|
|
1743
|
-
return uom ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Paragraph, { color: "text-secondary-normal", children: uom.toUpperCase() }) : null;
|
|
1744
|
-
case "percentage":
|
|
1745
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "percent" }) });
|
|
1746
|
-
default:
|
|
1747
|
-
return null;
|
|
1748
|
-
}
|
|
1749
|
-
};
|
|
1750
|
-
const handleSearchReset = () => {
|
|
1751
|
-
setInternalValue("");
|
|
1752
|
-
setDisplayValue("");
|
|
1753
|
-
if (onChange) {
|
|
1754
|
-
const syntheticEvent = {
|
|
1755
|
-
target: { value: "" }
|
|
1756
|
-
};
|
|
1757
|
-
if (typeof onChange === "function") {
|
|
1758
|
-
onChange(syntheticEvent);
|
|
1759
|
-
}
|
|
1760
|
-
}
|
|
1761
|
-
onClear == null ? void 0 : onClear();
|
|
1762
|
-
};
|
|
1763
|
-
const handleChange = (e) => {
|
|
1764
|
-
const rawValue = e.target.value;
|
|
1765
|
-
const maxNumber = props.max != null ? Number(String(props.max).replace(/,/g, "")) : void 0;
|
|
1766
|
-
if (variant === "currency") {
|
|
1767
|
-
const raw = rawValue.replace(/,/g, "");
|
|
1768
|
-
if (raw === "") {
|
|
1769
|
-
setInternalValue("");
|
|
1770
|
-
setDisplayValue("");
|
|
1771
|
-
if (onChange) {
|
|
1772
|
-
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
1773
|
-
target: __spreadProps(__spreadValues({}, e.target), { value: "" })
|
|
1774
|
-
});
|
|
1775
|
-
onChange(syntheticEvent);
|
|
1776
|
-
}
|
|
1777
|
-
return;
|
|
1778
|
-
}
|
|
1779
|
-
const regex = /^\d*\.?\d*$/;
|
|
1780
|
-
if (!regex.test(raw)) return;
|
|
1781
|
-
const parts = raw.split(".");
|
|
1782
|
-
const currentDecimals = decimals != null ? decimals : 2;
|
|
1783
|
-
if (parts.length === 2 && parts[1].length > currentDecimals) return;
|
|
1784
|
-
const asNumber = Number(raw);
|
|
1785
|
-
if (!isNaN(asNumber) && maxNumber != null && asNumber > maxNumber) {
|
|
1786
|
-
const clamped = maxNumber;
|
|
1787
|
-
const formattedClamped = formatDecimalValue(
|
|
1788
|
-
clamped.toString(),
|
|
1789
|
-
currentDecimals
|
|
1790
|
-
);
|
|
1791
|
-
setInternalValue(formattedClamped);
|
|
1792
|
-
setDisplayValue(
|
|
1793
|
-
formatOnBlur ? formattedClamped : formatCurrencyDisplay(formattedClamped)
|
|
1794
|
-
);
|
|
1795
|
-
if (onChange) {
|
|
1796
|
-
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
1797
|
-
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
1798
|
-
});
|
|
1799
|
-
onChange(syntheticEvent);
|
|
1800
|
-
}
|
|
1801
|
-
return;
|
|
1802
|
-
}
|
|
1803
|
-
setInternalValue(raw);
|
|
1804
|
-
setDisplayValue(formatOnBlur ? raw : formatCurrencyDisplay(raw));
|
|
1805
|
-
if (!isNaN(asNumber) && onChange) {
|
|
1806
|
-
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
1807
|
-
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
1808
|
-
});
|
|
1809
|
-
onChange(syntheticEvent);
|
|
1810
|
-
}
|
|
1811
|
-
return;
|
|
1812
|
-
}
|
|
1813
|
-
if (variant === "uom" && currencyFormat) {
|
|
1814
|
-
const raw = rawValue.replace(/,/g, "");
|
|
1815
|
-
if (raw === "") {
|
|
1816
|
-
setInternalValue("");
|
|
1817
|
-
setDisplayValue("");
|
|
1818
|
-
if (onChange) {
|
|
1819
|
-
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
1820
|
-
target: __spreadProps(__spreadValues({}, e.target), { value: "" })
|
|
1821
|
-
});
|
|
1822
|
-
onChange(syntheticEvent);
|
|
1823
|
-
}
|
|
1824
|
-
return;
|
|
1825
|
-
}
|
|
1826
|
-
const regex = /^\d*\.?\d*$/;
|
|
1827
|
-
if (!regex.test(raw)) return;
|
|
1828
|
-
const parts = raw.split(".");
|
|
1829
|
-
const currentDecimals = decimals != null ? decimals : 2;
|
|
1830
|
-
if (parts.length === 2 && parts[1].length > currentDecimals) return;
|
|
1831
|
-
const asNumber = Number(raw);
|
|
1832
|
-
if (!isNaN(asNumber) && maxNumber != null && asNumber > maxNumber) {
|
|
1833
|
-
const clamped = maxNumber;
|
|
1834
|
-
const formattedClamped = formatDecimalValue(
|
|
1835
|
-
clamped.toString(),
|
|
1836
|
-
currentDecimals
|
|
1837
|
-
);
|
|
1838
|
-
setInternalValue(formattedClamped);
|
|
1839
|
-
setDisplayValue(formatCurrencyDisplay(formattedClamped));
|
|
1840
|
-
if (onChange) {
|
|
1841
|
-
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
1842
|
-
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
1843
|
-
});
|
|
1844
|
-
onChange(syntheticEvent);
|
|
1845
|
-
}
|
|
1846
|
-
return;
|
|
1847
|
-
}
|
|
1848
|
-
setInternalValue(raw);
|
|
1849
|
-
setDisplayValue(formatCurrencyDisplay(raw));
|
|
1850
|
-
if (!isNaN(asNumber) && onChange) {
|
|
1851
|
-
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
1852
|
-
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
1853
|
-
});
|
|
1854
|
-
onChange(syntheticEvent);
|
|
1855
|
-
}
|
|
1856
|
-
return;
|
|
1857
|
-
}
|
|
1858
|
-
if (variant === "uom" && e.target.type === "number") {
|
|
1859
|
-
const numeric = Number(rawValue);
|
|
1860
|
-
if (!isNaN(numeric) && maxNumber != null && numeric > maxNumber) {
|
|
1861
|
-
const clamped = maxNumber;
|
|
1862
|
-
const formattedClamped = formatDecimalValue(
|
|
1863
|
-
clamped.toString(),
|
|
1864
|
-
decimals != null ? decimals : 0
|
|
1865
|
-
);
|
|
1866
|
-
setInternalValue(formattedClamped);
|
|
1867
|
-
setDisplayValue(formattedClamped);
|
|
1868
|
-
if (typeof onChange === "function") {
|
|
1869
|
-
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
1870
|
-
target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
|
|
1871
|
-
});
|
|
1872
|
-
onChange(syntheticEvent);
|
|
1873
|
-
}
|
|
1874
|
-
return;
|
|
1875
|
-
}
|
|
1876
|
-
setInternalValue(rawValue);
|
|
1877
|
-
setDisplayValue(rawValue);
|
|
1878
|
-
if (typeof onChange === "function") {
|
|
1879
|
-
onChange(e);
|
|
1880
|
-
}
|
|
1881
|
-
return;
|
|
1882
|
-
}
|
|
1883
|
-
setInternalValue(rawValue);
|
|
1884
|
-
setDisplayValue(rawValue);
|
|
1885
|
-
if (typeof onChange === "function") {
|
|
1886
|
-
onChange(e);
|
|
1887
|
-
}
|
|
1888
|
-
};
|
|
1889
|
-
const handleBlur = (e) => {
|
|
1890
|
-
setIsFocused(false);
|
|
1891
|
-
if (!internalValue) {
|
|
1892
|
-
onBlur == null ? void 0 : onBlur(e);
|
|
1893
|
-
return;
|
|
1894
|
-
}
|
|
1895
|
-
if (variant === "currency") {
|
|
1896
|
-
const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
|
|
1897
|
-
setInternalValue(formatted);
|
|
1898
|
-
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
1899
|
-
const asNumber = Number(formatted);
|
|
1900
|
-
if (!isNaN(asNumber) && onChange) {
|
|
1901
|
-
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
1902
|
-
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
1903
|
-
});
|
|
1904
|
-
onChange(syntheticEvent);
|
|
1905
|
-
}
|
|
1906
|
-
} else if (variant === "uom") {
|
|
1907
|
-
if (currencyFormat) {
|
|
1908
|
-
const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
|
|
1909
|
-
setInternalValue(formatted);
|
|
1910
|
-
setDisplayValue(formatCurrencyDisplay(formatted));
|
|
1911
|
-
const asNumber = Number(formatted);
|
|
1912
|
-
if (!isNaN(asNumber) && onChange) {
|
|
1913
|
-
const syntheticEvent = __spreadProps(__spreadValues({}, e), {
|
|
1914
|
-
target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
|
|
1915
|
-
});
|
|
1916
|
-
onChange(syntheticEvent);
|
|
1917
|
-
}
|
|
1918
|
-
} else {
|
|
1919
|
-
const formattedValue = formatDecimalValue(e.target.value, decimals);
|
|
1920
|
-
e.target.value = formattedValue;
|
|
1921
|
-
}
|
|
1922
|
-
}
|
|
1923
|
-
onBlur == null ? void 0 : onBlur(e);
|
|
1924
|
-
};
|
|
1925
|
-
const handleFocus = (e) => {
|
|
1926
|
-
var _a2;
|
|
1927
|
-
setIsFocused(true);
|
|
1928
|
-
(_a2 = props.onFocus) == null ? void 0 : _a2.call(props, e);
|
|
1929
|
-
};
|
|
1930
|
-
const inputProps = getInputProps();
|
|
1931
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1932
|
-
InputBase,
|
|
1933
|
-
__spreadProps(__spreadValues({}, inputProps), {
|
|
1934
|
-
before: getBeforeElement(),
|
|
1935
|
-
after: getAfterElement(),
|
|
1936
|
-
onFocus: handleFocus,
|
|
1937
|
-
onChange: handleChange,
|
|
1938
|
-
onBlur: handleBlur,
|
|
1939
|
-
testid,
|
|
1940
|
-
rightAdornment
|
|
1941
|
-
})
|
|
1942
|
-
);
|
|
1943
|
-
};
|
|
1944
|
-
Input.displayName = "Input";
|
|
1945
|
-
var Finder = (props) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Input, __spreadProps(__spreadValues({}, props), { variant: "finder" }));
|
|
1946
|
-
var UOM = (props) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Input, __spreadProps(__spreadValues({}, props), { variant: "uom" }));
|
|
1947
|
-
var Currency = (props) => {
|
|
1948
|
-
var _a;
|
|
1949
|
-
const handleCurrencyChange = (e) => {
|
|
1950
|
-
var _a2;
|
|
1951
|
-
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, e);
|
|
1952
|
-
};
|
|
1953
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1954
|
-
Input,
|
|
1955
|
-
__spreadProps(__spreadValues({}, props), {
|
|
1956
|
-
variant: "currency",
|
|
1957
|
-
decimals: (_a = props.decimals) != null ? _a : 2,
|
|
1958
|
-
onChange: handleCurrencyChange
|
|
1959
|
-
})
|
|
1960
|
-
);
|
|
1961
|
-
};
|
|
1962
|
-
var Percentage = (props) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Input, __spreadProps(__spreadValues({}, props), { variant: "percentage" }));
|
|
1963
|
-
Finder.displayName = "Finder";
|
|
1964
|
-
UOM.displayName = "UOM";
|
|
1965
|
-
Currency.displayName = "Currency";
|
|
1966
|
-
Percentage.displayName = "Percentage";
|
|
1967
|
-
|
|
1968
|
-
// src/components/Search.tsx
|
|
1969
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1970
|
-
var Search = (_a) => {
|
|
1971
|
-
var _b = _a, {
|
|
1972
|
-
id,
|
|
1973
|
-
testid,
|
|
1974
|
-
label,
|
|
1975
|
-
error,
|
|
1976
|
-
children,
|
|
1977
|
-
readOnly,
|
|
1978
|
-
renderMenu,
|
|
1979
|
-
onClick,
|
|
1980
|
-
wrapperClassName,
|
|
1981
|
-
removeRoundness,
|
|
1982
|
-
autocompletePadding = false
|
|
1983
|
-
} = _b, props = __objRest(_b, [
|
|
1984
|
-
"id",
|
|
1985
|
-
"testid",
|
|
1986
|
-
"label",
|
|
1987
|
-
"error",
|
|
1988
|
-
"children",
|
|
1989
|
-
"readOnly",
|
|
1990
|
-
"renderMenu",
|
|
1991
|
-
"onClick",
|
|
1992
|
-
"wrapperClassName",
|
|
1993
|
-
"removeRoundness",
|
|
1994
|
-
"autocompletePadding"
|
|
1995
|
-
]);
|
|
1996
|
-
const inputRef = (0, import_react11.useRef)(null);
|
|
1997
|
-
const inputContainerRef = (0, import_react11.useRef)(null);
|
|
1998
|
-
const preventFocusOnInitialRender = (0, import_react11.useRef)(true);
|
|
1999
|
-
const [show, setShow] = (0, import_react11.useState)(false);
|
|
2000
|
-
const [clearing, setClearing] = (0, import_react11.useState)(false);
|
|
2001
|
-
const uniqueId = (0, import_react11.useId)();
|
|
2002
|
-
const searchMenuName = `search-menu-${uniqueId}`;
|
|
2003
|
-
(0, import_react11.useEffect)(() => {
|
|
2004
|
-
var _a2;
|
|
2005
|
-
if (preventFocusOnInitialRender.current) {
|
|
2006
|
-
preventFocusOnInitialRender.current = false;
|
|
2007
|
-
return;
|
|
2008
|
-
}
|
|
2009
|
-
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
2010
|
-
}, [props.value]);
|
|
2011
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
2012
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2013
|
-
Input,
|
|
2014
|
-
__spreadValues({
|
|
2015
|
-
id,
|
|
2016
|
-
testid,
|
|
2017
|
-
variant: "search",
|
|
2018
|
-
inputContainerRef,
|
|
2019
|
-
ref: inputRef,
|
|
2020
|
-
label,
|
|
2021
|
-
wrapperClassName,
|
|
2022
|
-
autocompletePadding,
|
|
2023
|
-
onClick: (e) => {
|
|
2024
|
-
if (props.disabled || readOnly) {
|
|
2025
|
-
return;
|
|
2026
|
-
}
|
|
2027
|
-
if (clearing) {
|
|
2028
|
-
setClearing(false);
|
|
2029
|
-
return;
|
|
2030
|
-
}
|
|
2031
|
-
onClick == null ? void 0 : onClick(e);
|
|
2032
|
-
setShow(!show);
|
|
2033
|
-
},
|
|
2034
|
-
onClear: () => {
|
|
2035
|
-
setClearing(true);
|
|
2036
|
-
},
|
|
2037
|
-
onKeyDown: (e) => {
|
|
2038
|
-
setShow(true);
|
|
2039
|
-
if (["ArrowUp", "ArrowDown"].includes(e.key)) {
|
|
2040
|
-
e.preventDefault();
|
|
2041
|
-
const menu = document.querySelector(
|
|
2042
|
-
`[data-menu="${searchMenuName}"]`
|
|
2043
|
-
);
|
|
2044
|
-
const selectedMenuOption = menu == null ? void 0 : menu.querySelector("[data-selected]");
|
|
2045
|
-
if (selectedMenuOption) {
|
|
2046
|
-
const allMenuOptions = Array.from(
|
|
2047
|
-
(menu == null ? void 0 : menu.querySelectorAll('[role="menuitem"]')) || []
|
|
2048
|
-
);
|
|
2049
|
-
const currentIndex = allMenuOptions.indexOf(selectedMenuOption);
|
|
2050
|
-
let targetOption;
|
|
2051
|
-
if (e.key === "ArrowDown") {
|
|
2052
|
-
targetOption = allMenuOptions[currentIndex + 1] || allMenuOptions[0];
|
|
2053
|
-
} else {
|
|
2054
|
-
targetOption = allMenuOptions[currentIndex - 1] || allMenuOptions[allMenuOptions.length - 1];
|
|
2055
|
-
}
|
|
2056
|
-
targetOption == null ? void 0 : targetOption.focus();
|
|
2057
|
-
} else {
|
|
2058
|
-
const toFocusMenuOption = e.key === "ArrowDown" ? menu == null ? void 0 : menu.querySelector('[role="menuitem"]') : menu == null ? void 0 : menu.querySelector(
|
|
2059
|
-
'[role="menuitem"]:last-child'
|
|
2060
|
-
);
|
|
2061
|
-
toFocusMenuOption == null ? void 0 : toFocusMenuOption.focus();
|
|
2062
|
-
}
|
|
2063
|
-
}
|
|
2064
|
-
},
|
|
2065
|
-
error,
|
|
2066
|
-
readOnly,
|
|
2067
|
-
removeRoundness,
|
|
2068
|
-
focus: renderMenu && show
|
|
2069
|
-
}, props)
|
|
2070
|
-
),
|
|
2071
|
-
renderMenu ? renderMenu({
|
|
2072
|
-
id: id ? `${id}-menu` : void 0,
|
|
2073
|
-
testid: testid ? `${testid}-menu` : void 0,
|
|
2074
|
-
positionTo: inputContainerRef,
|
|
2075
|
-
show,
|
|
2076
|
-
setShow,
|
|
2077
|
-
topOffset: props.caption ? -16 : null,
|
|
2078
|
-
autoFocusOff: true,
|
|
2079
|
-
menuName: searchMenuName
|
|
2080
|
-
}) : children
|
|
2081
|
-
] });
|
|
2082
|
-
};
|
|
2083
|
-
Search.displayName = "Search";
|
|
2084
|
-
|
|
2085
|
-
// src/components/DataGridCell.tsx
|
|
2086
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2087
|
-
var DataGridCell = (0, import_react12.memo)(
|
|
2088
|
-
(_a) => {
|
|
2089
|
-
var _b = _a, {
|
|
2090
|
-
id,
|
|
2091
|
-
type = "default",
|
|
2092
|
-
component = "static",
|
|
2093
|
-
children,
|
|
2094
|
-
className,
|
|
2095
|
-
locked = false,
|
|
2096
|
-
noPadding = false,
|
|
2097
|
-
paddedLeft = false,
|
|
2098
|
-
style,
|
|
2099
|
-
onClick,
|
|
2100
|
-
onRightClick,
|
|
2101
|
-
error,
|
|
2102
|
-
warning,
|
|
2103
|
-
center,
|
|
2104
|
-
width,
|
|
2105
|
-
minWidth,
|
|
2106
|
-
disabled,
|
|
2107
|
-
testid
|
|
2108
|
-
} = _b, props = __objRest(_b, [
|
|
2109
|
-
"id",
|
|
2110
|
-
"type",
|
|
2111
|
-
"component",
|
|
2112
|
-
"children",
|
|
2113
|
-
"className",
|
|
2114
|
-
"locked",
|
|
2115
|
-
"noPadding",
|
|
2116
|
-
"paddedLeft",
|
|
2117
|
-
"style",
|
|
2118
|
-
"onClick",
|
|
2119
|
-
"onRightClick",
|
|
2120
|
-
"error",
|
|
2121
|
-
"warning",
|
|
2122
|
-
"center",
|
|
2123
|
-
"width",
|
|
2124
|
-
"minWidth",
|
|
2125
|
-
"disabled",
|
|
2126
|
-
"testid"
|
|
2127
|
-
]);
|
|
2128
|
-
const Element = type === "header" ? "th" : "td";
|
|
2129
|
-
const timerRef = (0, import_react12.useRef)(null);
|
|
2130
|
-
const [isGrabbing, setIsGrabbing] = (0, import_react12.useState)(false);
|
|
2131
|
-
const [isPointerPressed, setIsPointerPressed] = (0, import_react12.useState)(false);
|
|
2132
|
-
(0, import_react12.useEffect)(() => {
|
|
2133
|
-
return () => {
|
|
2134
|
-
if (timerRef.current) {
|
|
2135
|
-
clearTimeout(timerRef.current);
|
|
2136
|
-
timerRef.current = null;
|
|
2137
|
-
}
|
|
2138
|
-
};
|
|
2139
|
-
}, []);
|
|
2140
|
-
const handlePointerDown = (_event) => {
|
|
2141
|
-
setIsPointerPressed(true);
|
|
2142
|
-
timerRef.current = window.setTimeout(() => {
|
|
2143
|
-
setIsGrabbing(true);
|
|
2144
|
-
}, 500);
|
|
2145
|
-
};
|
|
2146
|
-
const handlePointerUp = (event) => {
|
|
2147
|
-
if (timerRef.current) {
|
|
2148
|
-
clearTimeout(timerRef.current);
|
|
2149
|
-
timerRef.current = null;
|
|
2150
|
-
}
|
|
2151
|
-
const rightClick = event.nativeEvent instanceof MouseEvent && event.nativeEvent.button === 2;
|
|
2152
|
-
if (!isGrabbing && onClick && !rightClick && isPointerPressed) {
|
|
2153
|
-
onClick(event);
|
|
2154
|
-
}
|
|
2155
|
-
if (rightClick && onRightClick) {
|
|
2156
|
-
onRightClick();
|
|
2157
|
-
}
|
|
2158
|
-
setIsGrabbing(false);
|
|
2159
|
-
setIsPointerPressed(false);
|
|
2160
|
-
};
|
|
2161
|
-
const handlePointerLeave = () => {
|
|
2162
|
-
if (timerRef.current) {
|
|
2163
|
-
clearTimeout(timerRef.current);
|
|
2164
|
-
timerRef.current = null;
|
|
2165
|
-
}
|
|
2166
|
-
};
|
|
2167
|
-
const headerBgStyles = type === "header" && !locked && !["button"].includes(component) && "bg-brand-400 border-brand-200";
|
|
2168
|
-
const lockedHeaderBgStyles = locked && !["button"].includes(component) && "bg-neutral-400 border-neutral-300";
|
|
2169
|
-
const headerTypeStyles = type === "header" && component !== "button" && component !== "icon" && (0, import_clsx9.default)("border-r");
|
|
2170
|
-
const buttonComponentStyles = component === "button" && (0, import_clsx9.default)("border-r border-b border-border-primary-normal");
|
|
2171
|
-
const iconComponentStyles = component === "icon" && (0, import_clsx9.default)("border-l");
|
|
2172
|
-
const cellClasses = (0, import_clsx9.default)(
|
|
2173
|
-
headerTypeStyles,
|
|
2174
|
-
buttonComponentStyles,
|
|
2175
|
-
headerBgStyles,
|
|
2176
|
-
lockedHeaderBgStyles,
|
|
2177
|
-
iconComponentStyles,
|
|
2178
|
-
className,
|
|
2179
|
-
"flex flex-1 items-center gap-1 whitespace-nowrap h-10 relative text-text-primary-normal",
|
|
2180
|
-
"focus-within:!z-10",
|
|
2181
|
-
"overflow-x-hidden",
|
|
2182
|
-
"overflow-y-hidden",
|
|
2183
|
-
component === "input" && "border",
|
|
2184
|
-
component === "input" && !error && !warning && "border-border-primary-normal",
|
|
2185
|
-
component === "input" && error && "border-border-primary-error",
|
|
2186
|
-
component === "input" && warning && "border-background-warning-normal",
|
|
2187
|
-
!["button", "icon"].includes(component) && !noPadding && componentPadding,
|
|
2188
|
-
paddedLeft && "pl-2",
|
|
2189
|
-
component === "icon" && "border-l",
|
|
2190
|
-
isGrabbing && "!cursor-grabbing",
|
|
2191
|
-
component === "checkbox" || center && "justify-center",
|
|
2192
|
-
disabled && "!text-text-primary-disabled"
|
|
2193
|
-
);
|
|
2194
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2195
|
-
Element,
|
|
2196
|
-
__spreadProps(__spreadValues({
|
|
2197
|
-
id,
|
|
2198
|
-
"data-testid": testid,
|
|
2199
|
-
className: (0, import_clsx9.default)("flex h-10", !width && "flex-1"),
|
|
2200
|
-
style: { width, minWidth }
|
|
2201
|
-
}, props), {
|
|
2202
|
-
"data-theme": type === "header" && !locked ? "brand" : void 0,
|
|
2203
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2204
|
-
"div",
|
|
2205
|
-
{
|
|
2206
|
-
className: cellClasses,
|
|
2207
|
-
style: __spreadValues({}, style),
|
|
2208
|
-
onMouseDown: handlePointerDown,
|
|
2209
|
-
onMouseUp: handlePointerUp,
|
|
2210
|
-
onMouseLeave: handlePointerLeave,
|
|
2211
|
-
onTouchStart: handlePointerDown,
|
|
2212
|
-
onTouchEnd: handlePointerUp,
|
|
2213
|
-
onTouchCancel: handlePointerLeave,
|
|
2214
|
-
onContextMenu: (e) => e.preventDefault(),
|
|
2215
|
-
children
|
|
2216
|
-
}
|
|
2217
|
-
)
|
|
2218
|
-
})
|
|
2219
|
-
);
|
|
2220
|
-
}
|
|
2221
|
-
);
|
|
2222
|
-
DataGridCell.displayName = "DataGridCell";
|
|
2223
|
-
function DataCellHeader(_a) {
|
|
2224
|
-
var _b = _a, {
|
|
2225
|
-
header,
|
|
2226
|
-
children,
|
|
2227
|
-
setNodeRef,
|
|
2228
|
-
node,
|
|
2229
|
-
id,
|
|
2230
|
-
testid,
|
|
2231
|
-
useMenuDefaultMinWidth
|
|
2232
|
-
} = _b, props = __objRest(_b, [
|
|
2233
|
-
"header",
|
|
2234
|
-
"children",
|
|
2235
|
-
"setNodeRef",
|
|
2236
|
-
"node",
|
|
2237
|
-
"id",
|
|
2238
|
-
"testid",
|
|
2239
|
-
"useMenuDefaultMinWidth"
|
|
2240
|
-
]);
|
|
2241
|
-
var _a2;
|
|
2242
|
-
const [showMenu, setShowMenu] = (0, import_react12.useState)(false);
|
|
2243
|
-
const [filter, setFilter] = (0, import_react12.useState)(
|
|
2244
|
-
(_a2 = header.column.getFilterValue()) != null ? _a2 : ""
|
|
2245
|
-
);
|
|
2246
|
-
const ref = (0, import_react12.useRef)(null);
|
|
2247
|
-
const predeterminedPinned = (0, import_react12.useRef)(false);
|
|
2248
|
-
const { column, getContext } = header;
|
|
2249
|
-
const { id: columnId, setFilterValue } = column;
|
|
2250
|
-
const {
|
|
2251
|
-
menuRootRef,
|
|
2252
|
-
isMenuActive,
|
|
2253
|
-
registerSubMenu,
|
|
2254
|
-
listeners: subMenuListeners,
|
|
2255
|
-
mobileHide
|
|
2256
|
-
} = useSubMenuSystem(node ? node : ref);
|
|
2257
|
-
(0, import_react12.useEffect)(() => {
|
|
2258
|
-
var _a3, _b2, _c;
|
|
2259
|
-
const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
|
|
2260
|
-
const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
|
|
2261
|
-
const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
|
|
2262
|
-
predeterminedPinned.current = [...left, ...right].includes(columnId);
|
|
2263
|
-
}, [columnId, getContext]);
|
|
2264
|
-
(0, import_react12.useEffect)(() => {
|
|
2265
|
-
const handler = setTimeout(() => {
|
|
2266
|
-
setFilterValue(filter);
|
|
2267
|
-
}, 500);
|
|
2268
|
-
return () => {
|
|
2269
|
-
clearTimeout(handler);
|
|
2270
|
-
};
|
|
2271
|
-
}, [filter, setFilterValue]);
|
|
2272
|
-
const style = __spreadValues({
|
|
2273
|
-
position: "relative",
|
|
2274
|
-
whiteSpace: "nowrap",
|
|
2275
|
-
minWidth: header.column.getSize(),
|
|
2276
|
-
"--color-text-primary-normal": "var(--color-text-brand-primary-normal)",
|
|
2277
|
-
"--color-icon-on-action-primary-normal": "var(--color-text-brand-primary-normal)",
|
|
2278
|
-
"--background-action-secondary-normal": "var(--color-text-brand-primary-normal)"
|
|
2279
|
-
}, props.style);
|
|
2280
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2281
|
-
DataGridCell,
|
|
2282
|
-
__spreadProps(__spreadValues({
|
|
2283
|
-
id,
|
|
2284
|
-
testid,
|
|
2285
|
-
ref: setNodeRef ? setNodeRef : ref,
|
|
2286
|
-
type: "header",
|
|
2287
|
-
component: "header",
|
|
2288
|
-
style,
|
|
2289
|
-
minWidth: `${header.column.getSize()}px`,
|
|
2290
|
-
onClick: header.column.getToggleSortingHandler(),
|
|
2291
|
-
onRightClick: () => setShowMenu(!showMenu)
|
|
2292
|
-
}, props), {
|
|
2293
|
-
children: [
|
|
2294
|
-
children,
|
|
2295
|
-
header.column.getCanFilter() && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2296
|
-
Menu,
|
|
2297
|
-
{
|
|
2298
|
-
id: id ? `${id}-menu` : void 0,
|
|
2299
|
-
testid: testid ? `${testid}-menu` : void 0,
|
|
2300
|
-
ref: menuRootRef,
|
|
2301
|
-
positionTo: node ? node : ref,
|
|
2302
|
-
show: showMenu,
|
|
2303
|
-
setShow: setShowMenu,
|
|
2304
|
-
mobileHide,
|
|
2305
|
-
useDefaultMinWidth: useMenuDefaultMinWidth,
|
|
2306
|
-
children: [
|
|
2307
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2308
|
-
MenuOption,
|
|
2309
|
-
__spreadProps(__spreadValues({
|
|
2310
|
-
id: id ? `${id}-filter-option` : void 0,
|
|
2311
|
-
testid: testid ? `${testid}-filter-option` : void 0
|
|
2312
|
-
}, subMenuListeners), {
|
|
2313
|
-
subMenu: (_b2) => {
|
|
2314
|
-
var _c = _b2, { menuId, subMenuLevel } = _c, props2 = __objRest(_c, ["menuId", "subMenuLevel"]);
|
|
2315
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2316
|
-
Menu,
|
|
2317
|
-
__spreadProps(__spreadValues({
|
|
2318
|
-
id: id ? `${id}-filter-submenu` : void 0,
|
|
2319
|
-
testid: testid ? `${testid}-filter-submenu` : void 0
|
|
2320
|
-
}, props2), {
|
|
2321
|
-
show: isMenuActive(menuId, subMenuLevel),
|
|
2322
|
-
ref: (el) => {
|
|
2323
|
-
registerSubMenu(menuId, el);
|
|
2324
|
-
},
|
|
2325
|
-
useDefaultMinWidth: useMenuDefaultMinWidth,
|
|
2326
|
-
children: [
|
|
2327
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: (0, import_clsx9.default)(paddingUsingComponentGap), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2328
|
-
Search,
|
|
2329
|
-
{
|
|
2330
|
-
id: id ? `${id}-filter-search` : void 0,
|
|
2331
|
-
testid: testid ? `${testid}-filter-search` : void 0,
|
|
2332
|
-
onChange: (event) => {
|
|
2333
|
-
setFilter(event.target.value);
|
|
2334
|
-
},
|
|
2335
|
-
onKeyDown: (event) => {
|
|
2336
|
-
if ([" ", "Space"].includes(event.key)) {
|
|
2337
|
-
event.stopPropagation();
|
|
2338
|
-
}
|
|
2339
|
-
},
|
|
2340
|
-
value: filter != null ? filter : ""
|
|
2341
|
-
}
|
|
2342
|
-
) }),
|
|
2343
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2344
|
-
MenuOption,
|
|
2345
|
-
{
|
|
2346
|
-
id: id ? `${id}-filter-contains` : void 0,
|
|
2347
|
-
testid: testid ? `${testid}-filter-contains` : void 0,
|
|
2348
|
-
onClick: handleFilterFnChange,
|
|
2349
|
-
before: menuOptionIcon("includesString"),
|
|
2350
|
-
children: "Contains"
|
|
2351
|
-
}
|
|
2352
|
-
),
|
|
2353
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2354
|
-
MenuOption,
|
|
2355
|
-
{
|
|
2356
|
-
id: id ? `${id}-filter-startswith` : void 0,
|
|
2357
|
-
testid: testid ? `${testid}-filter-startswith` : void 0,
|
|
2358
|
-
onClick: handleFilterFnChange,
|
|
2359
|
-
before: menuOptionIcon("startsWith"),
|
|
2360
|
-
children: "Starts with"
|
|
2361
|
-
}
|
|
2362
|
-
),
|
|
2363
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2364
|
-
MenuOption,
|
|
2365
|
-
{
|
|
2366
|
-
id: id ? `${id}-filter-endswith` : void 0,
|
|
2367
|
-
testid: testid ? `${testid}-filter-endswith` : void 0,
|
|
2368
|
-
onClick: handleFilterFnChange,
|
|
2369
|
-
before: menuOptionIcon("endsWith"),
|
|
2370
|
-
children: "Ends with"
|
|
2371
|
-
}
|
|
2372
|
-
)
|
|
2373
|
-
]
|
|
2374
|
-
})
|
|
2375
|
-
);
|
|
2376
|
-
},
|
|
2377
|
-
children: "Filter"
|
|
2378
|
-
})
|
|
2379
|
-
),
|
|
2380
|
-
!predeterminedPinned.current && header.column.getCanPin() && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2381
|
-
MenuOption,
|
|
2382
|
-
__spreadProps(__spreadValues({
|
|
2383
|
-
onClick: () => {
|
|
2384
|
-
setShowMenu(!showMenu);
|
|
2385
|
-
}
|
|
2386
|
-
}, subMenuListeners), {
|
|
2387
|
-
subMenu: (_d) => {
|
|
2388
|
-
var _e = _d, { menuId, subMenuLevel } = _e, props2 = __objRest(_e, ["menuId", "subMenuLevel"]);
|
|
2389
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2390
|
-
Menu,
|
|
2391
|
-
__spreadProps(__spreadValues({}, props2), {
|
|
2392
|
-
show: isMenuActive(menuId, subMenuLevel),
|
|
2393
|
-
ref: (el) => {
|
|
2394
|
-
registerSubMenu(menuId, el);
|
|
2395
|
-
},
|
|
2396
|
-
children: [
|
|
2397
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2398
|
-
MenuOption,
|
|
2399
|
-
{
|
|
2400
|
-
selected: header.column.getIsPinned() === "left",
|
|
2401
|
-
onClick: () => {
|
|
2402
|
-
if (header.column.getIsPinned() === "left") {
|
|
2403
|
-
header.column.pin(false);
|
|
2404
|
-
} else {
|
|
2405
|
-
header.column.pin("left");
|
|
2406
|
-
}
|
|
2407
|
-
},
|
|
2408
|
-
after: header.column.getIsPinned() === "left" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { name: "check" }),
|
|
2409
|
-
children: "Left"
|
|
2410
|
-
}
|
|
2411
|
-
),
|
|
2412
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2413
|
-
MenuOption,
|
|
2414
|
-
{
|
|
2415
|
-
selected: header.column.getIsPinned() === "right",
|
|
2416
|
-
onClick: () => {
|
|
2417
|
-
if (header.column.getIsPinned() === "right") {
|
|
2418
|
-
header.column.pin(false);
|
|
2419
|
-
} else {
|
|
2420
|
-
header.column.pin("right");
|
|
2421
|
-
}
|
|
2422
|
-
},
|
|
2423
|
-
after: header.column.getIsPinned() === "right" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { name: "check" }),
|
|
2424
|
-
children: "Right"
|
|
2425
|
-
}
|
|
2426
|
-
)
|
|
2427
|
-
]
|
|
2428
|
-
})
|
|
2429
|
-
);
|
|
2430
|
-
},
|
|
2431
|
-
children: `Freeze [${header.column.columnDef.header}]`
|
|
2432
|
-
})
|
|
2433
|
-
)
|
|
2434
|
-
]
|
|
2435
|
-
}
|
|
2436
|
-
)
|
|
2437
|
-
]
|
|
2438
|
-
})
|
|
2439
|
-
);
|
|
2440
|
-
function menuOptionIcon(value) {
|
|
2441
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2442
|
-
Icon,
|
|
2443
|
-
{
|
|
2444
|
-
name: "check",
|
|
2445
|
-
className: (0, import_clsx9.default)(
|
|
2446
|
-
header.column.columnDef.filterFn !== value && "text-transparent"
|
|
2447
|
-
)
|
|
2448
|
-
}
|
|
2449
|
-
);
|
|
2450
|
-
}
|
|
2451
|
-
function handleFilterFnChange(_id, value) {
|
|
2452
|
-
let filterFn = "includesString";
|
|
2453
|
-
const currentFilterFn = header.column.columnDef.filterFn;
|
|
2454
|
-
if ((value == null ? void 0 : value.toLowerCase()) === "starts with") {
|
|
2455
|
-
filterFn = currentFilterFn === "startsWith" ? "auto" : "startsWith";
|
|
2456
|
-
}
|
|
2457
|
-
if ((value == null ? void 0 : value.toLowerCase()) === "ends with") {
|
|
2458
|
-
filterFn = currentFilterFn === "endsWith" ? "auto" : "endsWith";
|
|
2459
|
-
}
|
|
2460
|
-
if ((value == null ? void 0 : value.toLowerCase()) === "contains") {
|
|
2461
|
-
filterFn = currentFilterFn === "includesString" ? "auto" : "includesString";
|
|
2462
|
-
}
|
|
2463
|
-
header.column.columnDef.filterFn = filterFn;
|
|
2464
|
-
header.column.setFilterValue(filter);
|
|
2465
|
-
}
|
|
2466
|
-
}
|
|
2467
|
-
DataCellHeader.displayName = "DataCellHeader";
|
|
2468
|
-
function DraggableCellHeader(_a) {
|
|
2469
|
-
var _b = _a, {
|
|
2470
|
-
header,
|
|
2471
|
-
children
|
|
2472
|
-
} = _b, props = __objRest(_b, [
|
|
2473
|
-
"header",
|
|
2474
|
-
"children"
|
|
2475
|
-
]);
|
|
2476
|
-
const { attributes, isDragging, listeners, setNodeRef, transform, node } = (0, import_sortable.useSortable)({
|
|
2477
|
-
id: header.column.id
|
|
2478
|
-
});
|
|
2479
|
-
const style = {
|
|
2480
|
-
opacity: isDragging ? 0.8 : 1,
|
|
2481
|
-
position: "relative",
|
|
2482
|
-
transform: CSS.Translate.toString(transform),
|
|
2483
|
-
transition: "width transform 0.2s ease-in-out",
|
|
2484
|
-
whiteSpace: "nowrap",
|
|
2485
|
-
zIndex: isDragging ? 1 : 0,
|
|
2486
|
-
"--color-text-primary-normal": "var(--color-action-000)",
|
|
2487
|
-
"--color-icon-on-action-primary-normal": "var(--color-action-000)",
|
|
2488
|
-
userSelect: "none"
|
|
2489
|
-
};
|
|
2490
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2491
|
-
DataCellHeader,
|
|
2492
|
-
__spreadProps(__spreadValues(__spreadValues(__spreadValues({
|
|
2493
|
-
header,
|
|
2494
|
-
setNodeRef,
|
|
2495
|
-
node,
|
|
2496
|
-
style
|
|
2497
|
-
}, props), attributes), listeners), {
|
|
2498
|
-
children
|
|
2499
|
-
})
|
|
2500
|
-
);
|
|
2501
|
-
}
|
|
2502
|
-
DraggableCellHeader.displayName = "DraggableCellHeader";
|
|
2503
|
-
function DragAlongCell(_a) {
|
|
2504
|
-
var _b = _a, {
|
|
2505
|
-
cell,
|
|
2506
|
-
children
|
|
2507
|
-
} = _b, props = __objRest(_b, [
|
|
2508
|
-
"cell",
|
|
2509
|
-
"children"
|
|
2510
|
-
]);
|
|
2511
|
-
const { isDragging, setNodeRef, transform } = (0, import_sortable.useSortable)({
|
|
2512
|
-
id: cell.column.id
|
|
2513
|
-
});
|
|
2514
|
-
const style = {
|
|
2515
|
-
opacity: isDragging ? 0.8 : 1,
|
|
2516
|
-
position: "relative",
|
|
2517
|
-
transform: CSS.Translate.toString(transform),
|
|
2518
|
-
transition: "width transform 0.2s ease-in-out",
|
|
2519
|
-
minWidth: cell.column.getSize(),
|
|
2520
|
-
zIndex: isDragging ? 1 : 0
|
|
2521
|
-
};
|
|
2522
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DataGridCell, __spreadProps(__spreadValues({ style, ref: setNodeRef }, props), { children }));
|
|
2523
|
-
}
|
|
2524
|
-
DragAlongCell.displayName = "DragAlongCell";
|
|
2525
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
2526
|
-
0 && (module.exports = {
|
|
2527
|
-
DataCellHeader,
|
|
2528
|
-
DataGridCell,
|
|
2529
|
-
DragAlongCell,
|
|
2530
|
-
DraggableCellHeader
|
|
2531
|
-
});
|