@12-apps/ui 6.38.0 → 6.39.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/components/data-display/DataGrid/DataGrid.body.js +3 -2
- package/dist/_internal/components/data-display/DataGrid/DataGrid.cells.js +2 -1
- package/dist/_internal/components/data-display/DataGrid/DataGrid.js +4 -4
- package/dist/_internal/components/data-display/DataGrid/DataGrid.model.js +2 -1
- package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +19 -19
- package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +26 -26
- package/dist/_internal/components/data-display/DataViews/SaveViewModal.js +5 -5
- package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +4 -4
- package/dist/_internal/components/data-display/DataViews/base-list-card-slots.js +3 -3
- package/dist/_internal/components/data-display/DataViews/base-list-card.js +5 -5
- package/dist/_internal/components/data-display/DataViews/data-views-columns.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-display-panel.js +3 -3
- package/dist/_internal/components/data-display/DataViews/data-views-display-tabs.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +8 -8
- package/dist/_internal/components/data-display/DataViews/data-views-grid-helpers.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +16 -16
- package/dist/_internal/components/data-display/DataViews/data-views-layout-context.js +1 -1
- package/dist/_internal/components/data-display/DataViews/data-views-overflow-costs.js +4 -3
- package/dist/_internal/components/data-display/DataViews/data-views-overflow.js +3 -2
- package/dist/_internal/components/data-display/DataViews/data-views-scope-tabs.js +2 -2
- package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +6 -6
- package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +5 -5
- package/dist/_internal/components/data-display/DataViews/list-card-rails.js +2 -2
- package/dist/_internal/components/data-display/DataViews/use-data-views-state.js +3 -3
- package/dist/_internal/components/data-display/FleetMap/FleetBody.js +9 -9
- package/dist/_internal/components/data-display/FleetMap/FleetCanvas.js +8 -8
- package/dist/_internal/components/data-display/FleetMap/FleetMap.js +10 -10
- package/dist/_internal/components/data-display/LazyImage/LazyImage.js +1 -1
- package/dist/_internal/components/data-display/MapPreview/MapDecorations.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/MapPreview.hooks.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/MapPreview.js +7 -7
- package/dist/_internal/components/data-display/MapPreview/MapTiles.js +2 -2
- package/dist/_internal/components/data-display/MapPreview/StaticMapView.js +4 -4
- package/dist/_internal/components/data-display/MapPreview/mapProjection.js +3 -3
- package/dist/_internal/components/data-display/MapPreview/useMapPreview.js +3 -3
- package/dist/_internal/components/data-display/Table/Table.helpers.js +5 -3
- package/dist/_internal/components/data-display/Table/Table.hooks.js +2 -1
- package/dist/_internal/components/data-display/Table/Table.js +4 -4
- package/dist/_internal/components/data-display/Table/TableParts.hooks.js +4 -2
- package/dist/_internal/components/data-display/Table/TableParts.js +4 -2
- package/dist/_internal/components/data-display/index.js +19 -19
- package/dist/_internal/components/form/Calendar/Calendar.js +5 -4
- package/dist/_internal/components/form/Calendar/CalendarDay.js +2 -1
- package/dist/_internal/components/form/Calendar/CalendarDayCell.js +3 -2
- package/dist/_internal/components/form/Calendar/CalendarMonth.js +4 -3
- package/dist/_internal/components/form/DateRangePicker/DateRangePicker.js +5 -5
- package/dist/_internal/components/form/Switch/Switch.js +4 -4
- package/dist/_internal/components/form/Switch/Switch.metrics.js +5 -1
- package/dist/_internal/components/form/Switch/Switch.parts.js +3 -3
- package/dist/_internal/components/form/Switch/Switch.styles.js +2 -2
- package/dist/_internal/components/form/index.js +9 -9
- package/dist/_internal/components/index.js +38 -38
- package/dist/_internal/components/layout/CardGrid/CardGrid.js +2 -1
- package/dist/_internal/components/layout/Resizable/Resizable.helpers.js +8 -3
- package/dist/_internal/components/layout/Resizable/Resizable.hooks.js +3 -2
- package/dist/_internal/components/layout/Resizable/Resizable.js +4 -3
- package/dist/_internal/components/layout/ScrollArea/ScrollArea.helpers.js +1 -1
- package/dist/_internal/components/layout/ScrollArea/ScrollArea.js +2 -2
- package/dist/_internal/components/layout/index.js +5 -5
- package/dist/_internal/components/utility/InfiniteScroll/InfiniteScroll.hooks.js +1 -1
- package/dist/_internal/components/utility/InfiniteScroll/InfiniteScroll.js +4 -3
- package/dist/_internal/components/utility/InfiniteScroll/InfiniteScroll.parts.js +2 -1
- package/dist/_internal/components/utility/VirtualList/VirtualList.hooks.js +6 -3
- package/dist/_internal/components/utility/VirtualList/VirtualList.js +3 -2
- package/dist/_internal/components/utility/index.js +5 -5
- package/dist/{chunk-J2DAQQQH.js → chunk-222HN7GK.js} +33 -64
- package/dist/chunk-222HN7GK.js.map +1 -0
- package/dist/{chunk-MR2HKBHS.js → chunk-27LOJVR3.js} +2 -2
- package/dist/{chunk-S3D5VBHW.js → chunk-3YOXVNO4.js} +7 -7
- package/dist/{chunk-CZIX4BW2.js → chunk-4ALF5PB5.js} +3 -3
- package/dist/{chunk-XJPJ6ESI.js → chunk-4OAKGKK5.js} +3 -3
- package/dist/{chunk-4CHROSWR.js → chunk-5ETBB2DG.js} +2 -2
- package/dist/{chunk-ATSHKSSD.js → chunk-5KNDAC24.js} +20 -7
- package/dist/chunk-5KNDAC24.js.map +1 -0
- package/dist/{chunk-ULTOQ6ZV.js → chunk-5LWB4BYX.js} +80 -89
- package/dist/chunk-5LWB4BYX.js.map +1 -0
- package/dist/{chunk-46UPILLK.js → chunk-5NT2M2JI.js} +2 -2
- package/dist/{chunk-H5BEWPEY.js → chunk-6N2EDWMG.js} +2 -2
- package/dist/{chunk-GJQYM3PM.js → chunk-6PU3JYVY.js} +2 -2
- package/dist/{chunk-PUBPZOQJ.js → chunk-AG3DY5TH.js} +8 -5
- package/dist/chunk-AG3DY5TH.js.map +1 -0
- package/dist/{chunk-PPRV4LTM.js → chunk-BWHOCNGW.js} +4 -4
- package/dist/chunk-BWHOCNGW.js.map +1 -0
- package/dist/{chunk-TUBCN4DJ.js → chunk-CB6DTWD5.js} +7 -7
- package/dist/chunk-CB6DTWD5.js.map +1 -0
- package/dist/{chunk-ZAY6OA6F.js → chunk-D4FZ3ANG.js} +15 -5
- package/dist/chunk-D4FZ3ANG.js.map +1 -0
- package/dist/{chunk-Y7F5JBAT.js → chunk-DDRKYNPB.js} +2 -2
- package/dist/{chunk-DLJGBJZW.js → chunk-DGMDQHMI.js} +16 -9
- package/dist/chunk-DGMDQHMI.js.map +1 -0
- package/dist/{chunk-IAGOUTI6.js → chunk-DNT5PZLF.js} +21 -12
- package/dist/chunk-DNT5PZLF.js.map +1 -0
- package/dist/{chunk-DZA7RSLX.js → chunk-DVSO3EG6.js} +19 -11
- package/dist/chunk-DVSO3EG6.js.map +1 -0
- package/dist/{chunk-OS6KPL4D.js → chunk-EHYI2WCJ.js} +4 -4
- package/dist/{chunk-NB3FGWU4.js → chunk-EQXIW5MQ.js} +2 -2
- package/dist/{chunk-C66RGVAS.js → chunk-ERY6D2OV.js} +6 -4
- package/dist/chunk-ERY6D2OV.js.map +1 -0
- package/dist/{chunk-M2JTIH5M.js → chunk-F44R7US6.js} +2 -2
- package/dist/{chunk-AROBXRC5.js → chunk-F7JTIHV5.js} +18 -7
- package/dist/chunk-F7JTIHV5.js.map +1 -0
- package/dist/{chunk-T7DE44SP.js → chunk-FF2D7V7T.js} +6 -4
- package/dist/chunk-FF2D7V7T.js.map +1 -0
- package/dist/{chunk-XJJXBUPN.js → chunk-FX26DAFF.js} +2 -2
- package/dist/{chunk-R6SN73RX.js → chunk-GLHNMTP6.js} +7 -7
- package/dist/{chunk-YU26GBNX.js → chunk-H3AQQOTI.js} +9 -4
- package/dist/chunk-H3AQQOTI.js.map +1 -0
- package/dist/{chunk-HTZNB6IV.js → chunk-H5ZTIELC.js} +23 -8
- package/dist/chunk-H5ZTIELC.js.map +1 -0
- package/dist/{chunk-GSFNH4C5.js → chunk-HBP2OU4Q.js} +15 -8
- package/dist/chunk-HBP2OU4Q.js.map +1 -0
- package/dist/{chunk-I4QA2F4L.js → chunk-HBRQPG7H.js} +5 -5
- package/dist/{chunk-HGMBY5LP.js → chunk-HQWJUHR4.js} +18 -11
- package/dist/chunk-HQWJUHR4.js.map +1 -0
- package/dist/{chunk-CNQUCNEA.js → chunk-I3F4C5SS.js} +3 -3
- package/dist/{chunk-UFJYJHQI.js → chunk-J5VWGQSR.js} +2 -2
- package/dist/{chunk-MTFCPPZ5.js → chunk-JWZJSXI5.js} +3 -2
- package/dist/chunk-JWZJSXI5.js.map +1 -0
- package/dist/{chunk-4JFL62K3.js → chunk-K7FSTB2K.js} +3 -3
- package/dist/{chunk-FFCJ7NR2.js → chunk-KRQUPE4K.js} +4 -4
- package/dist/{chunk-2OYFTSG4.js → chunk-KXLUMEDX.js} +2 -2
- package/dist/{chunk-DVAAUWTC.js → chunk-LCHCE2G5.js} +2 -2
- package/dist/{chunk-G4HBNILE.js → chunk-LEHMWJNZ.js} +3 -3
- package/dist/{chunk-P6TNXBDA.js → chunk-MYKWJCR7.js} +9 -9
- package/dist/chunk-MYKWJCR7.js.map +1 -0
- package/dist/{chunk-TQ6FPOPD.js → chunk-ODW2D5PN.js} +39 -30
- package/dist/chunk-ODW2D5PN.js.map +1 -0
- package/dist/{chunk-RZYSKQTS.js → chunk-PCBZYORN.js} +3 -3
- package/dist/{chunk-5OBXEMQO.js → chunk-PRIBOWX4.js} +3 -3
- package/dist/{chunk-F42MJOHM.js → chunk-PVM7XTLZ.js} +64 -62
- package/dist/chunk-PVM7XTLZ.js.map +1 -0
- package/dist/{chunk-3TDVGZZN.js → chunk-QBTBRJ2Q.js} +37 -13
- package/dist/chunk-QBTBRJ2Q.js.map +1 -0
- package/dist/{chunk-2WFDHFK4.js → chunk-QNCWSDXE.js} +26 -11
- package/dist/chunk-QNCWSDXE.js.map +1 -0
- package/dist/{chunk-PQECNGDE.js → chunk-QSRZOXQI.js} +2 -2
- package/dist/{chunk-RHIDWUK7.js → chunk-QUWK7SYN.js} +1 -2
- package/dist/chunk-QUWK7SYN.js.map +1 -0
- package/dist/{chunk-UN5INW6K.js → chunk-R53ZOW4B.js} +8 -4
- package/dist/chunk-R53ZOW4B.js.map +1 -0
- package/dist/{chunk-DCJSHYE5.js → chunk-RSDYS5B3.js} +4 -4
- package/dist/{chunk-N5GVW6RO.js → chunk-S6IWKDWT.js} +2 -2
- package/dist/{chunk-TKC6WHGB.js → chunk-SBIZXZPP.js} +2 -2
- package/dist/{chunk-D5SZXH7Q.js → chunk-TNBJ4DK4.js} +7 -3
- package/dist/chunk-TNBJ4DK4.js.map +1 -0
- package/dist/{chunk-PMOEG36E.js → chunk-XZJM6EPC.js} +8 -6
- package/dist/chunk-XZJM6EPC.js.map +1 -0
- package/dist/{chunk-QF6LTUCE.js → chunk-Y2X7LYIN.js} +4 -4
- package/dist/chunk-Y2X7LYIN.js.map +1 -0
- package/dist/{chunk-UEVHI62V.js → chunk-YCCY77W5.js} +2 -2
- package/dist/{chunk-DF4K5XVW.js → chunk-YZVR5ROE.js} +14 -6
- package/dist/chunk-YZVR5ROE.js.map +1 -0
- package/dist/{chunk-AUSUCZYR.js → chunk-ZBVU2YWV.js} +5 -5
- package/dist/chunk-ZBVU2YWV.js.map +1 -0
- package/dist/{chunk-VZIB5W5L.js → chunk-ZGCPDA3F.js} +2 -2
- package/dist/data-display/DataGrid.js +4 -4
- package/dist/data-display/DataViews.js +29 -29
- package/dist/data-display/FleetMap.js +10 -10
- package/dist/data-display/LazyImage.js +1 -1
- package/dist/data-display/MapPreview.js +7 -7
- package/dist/data-display/Table.js +4 -4
- package/dist/form/Calendar.js +5 -4
- package/dist/form/DateRangePicker.js +5 -5
- package/dist/form/Switch.js +4 -4
- package/dist/layout/CardGrid.js +2 -1
- package/dist/layout/Resizable.js +4 -3
- package/dist/layout/ScrollArea.js +2 -2
- package/dist/native/form/Switch.js +3 -1
- package/dist/native/form/Switch.js.map +1 -1
- package/dist/types/components/data-display/DataGrid/DataGrid.body.d.ts.map +1 -1
- package/dist/types/components/data-display/DataGrid/DataGrid.cells.d.ts +4 -2
- package/dist/types/components/data-display/DataGrid/DataGrid.cells.d.ts.map +1 -1
- package/dist/types/components/data-display/DataGrid/DataGrid.model.d.ts +7 -1
- package/dist/types/components/data-display/DataGrid/DataGrid.model.d.ts.map +1 -1
- package/dist/types/components/data-display/DataGrid/DataGrid.types.d.ts +10 -4
- package/dist/types/components/data-display/DataGrid/DataGrid.types.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-columns.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-grid-helpers.d.ts +2 -0
- package/dist/types/components/data-display/DataViews/data-views-grid-helpers.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-layout-context.d.ts +7 -3
- package/dist/types/components/data-display/DataViews/data-views-layout-context.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-overflow-costs.d.ts +19 -9
- package/dist/types/components/data-display/DataViews/data-views-overflow-costs.d.ts.map +1 -1
- package/dist/types/components/data-display/DataViews/data-views-overflow.d.ts.map +1 -1
- package/dist/types/components/data-display/LazyImage/LazyImage.d.ts.map +1 -1
- package/dist/types/components/data-display/LazyImage/LazyImage.types.d.ts +3 -1
- package/dist/types/components/data-display/LazyImage/LazyImage.types.d.ts.map +1 -1
- package/dist/types/components/data-display/MapPreview/MapTiles.d.ts.map +1 -1
- package/dist/types/components/data-display/MapPreview/mapProjection.d.ts +6 -1
- package/dist/types/components/data-display/MapPreview/mapProjection.d.ts.map +1 -1
- package/dist/types/components/data-display/Table/Table.helpers.d.ts +6 -0
- package/dist/types/components/data-display/Table/Table.helpers.d.ts.map +1 -1
- package/dist/types/components/data-display/Table/Table.hooks.d.ts +9 -1
- package/dist/types/components/data-display/Table/Table.hooks.d.ts.map +1 -1
- package/dist/types/components/data-display/Table/Table.types.d.ts +6 -2
- package/dist/types/components/data-display/Table/Table.types.d.ts.map +1 -1
- package/dist/types/components/data-display/Table/TableParts.d.ts +2 -0
- package/dist/types/components/data-display/Table/TableParts.d.ts.map +1 -1
- package/dist/types/components/form/Calendar/Calendar.d.ts.map +1 -1
- package/dist/types/components/form/Calendar/CalendarDay.d.ts.map +1 -1
- package/dist/types/components/form/Calendar/CalendarMonth.d.ts.map +1 -1
- package/dist/types/components/form/Switch/Switch.metrics.d.ts +13 -3
- package/dist/types/components/form/Switch/Switch.metrics.d.ts.map +1 -1
- package/dist/types/components/form/Switch/Switch.styles.d.ts.map +1 -1
- package/dist/types/components/layout/CardGrid/CardGrid.d.ts +9 -7
- package/dist/types/components/layout/CardGrid/CardGrid.d.ts.map +1 -1
- package/dist/types/components/layout/Resizable/Resizable.d.ts.map +1 -1
- package/dist/types/components/layout/Resizable/Resizable.helpers.d.ts +21 -9
- package/dist/types/components/layout/Resizable/Resizable.helpers.d.ts.map +1 -1
- package/dist/types/components/layout/Resizable/Resizable.hooks.d.ts +13 -3
- package/dist/types/components/layout/Resizable/Resizable.hooks.d.ts.map +1 -1
- package/dist/types/components/layout/Resizable/Resizable.types.d.ts +10 -0
- package/dist/types/components/layout/Resizable/Resizable.types.d.ts.map +1 -1
- package/dist/types/components/layout/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/components/layout/ScrollArea/ScrollArea.helpers.d.ts +1 -1
- package/dist/types/components/layout/ScrollArea/ScrollArea.helpers.d.ts.map +1 -1
- package/dist/types/components/layout/ScrollArea/ScrollArea.types.d.ts +4 -1
- package/dist/types/components/layout/ScrollArea/ScrollArea.types.d.ts.map +1 -1
- package/dist/types/components/utility/InfiniteScroll/InfiniteScroll.d.ts.map +1 -1
- package/dist/types/components/utility/InfiniteScroll/InfiniteScroll.hooks.d.ts +3 -2
- package/dist/types/components/utility/InfiniteScroll/InfiniteScroll.hooks.d.ts.map +1 -1
- package/dist/types/components/utility/InfiniteScroll/InfiniteScroll.parts.d.ts +3 -2
- package/dist/types/components/utility/InfiniteScroll/InfiniteScroll.parts.d.ts.map +1 -1
- package/dist/types/components/utility/InfiniteScroll/InfiniteScroll.types.d.ts +9 -0
- package/dist/types/components/utility/InfiniteScroll/InfiniteScroll.types.d.ts.map +1 -1
- package/dist/types/components/utility/VirtualList/VirtualList.d.ts.map +1 -1
- package/dist/types/components/utility/VirtualList/VirtualList.hooks.d.ts +24 -28
- package/dist/types/components/utility/VirtualList/VirtualList.hooks.d.ts.map +1 -1
- package/dist/types/components/utility/VirtualList/VirtualList.types.d.ts +17 -0
- package/dist/types/components/utility/VirtualList/VirtualList.types.d.ts.map +1 -1
- package/dist/types-native/components/form/Switch/Switch.metrics.d.ts +13 -3
- package/dist/types-native/components/form/Switch/Switch.metrics.d.ts.map +1 -1
- package/dist/utility/InfiniteScroll.js +4 -3
- package/dist/utility/VirtualList.js +3 -2
- package/package.json +1 -1
- package/src/components/data-display/DataGrid/DataGrid.body.tsx +27 -7
- package/src/components/data-display/DataGrid/DataGrid.cells.tsx +33 -9
- package/src/components/data-display/DataGrid/DataGrid.model.ts +24 -11
- package/src/components/data-display/DataGrid/DataGrid.types.ts +12 -6
- package/src/components/data-display/DataViews/data-views-columns.ts +14 -3
- package/src/components/data-display/DataViews/data-views-grid-helpers.tsx +5 -3
- package/src/components/data-display/DataViews/data-views-layout-context.tsx +12 -9
- package/src/components/data-display/DataViews/data-views-overflow-costs.ts +32 -14
- package/src/components/data-display/DataViews/data-views-overflow.ts +40 -26
- package/src/components/data-display/LazyImage/LazyImage.tsx +5 -3
- package/src/components/data-display/LazyImage/LazyImage.types.ts +3 -1
- package/src/components/data-display/MapPreview/MapTiles.tsx +16 -9
- package/src/components/data-display/MapPreview/mapProjection.ts +10 -5
- package/src/components/data-display/Table/Table.helpers.ts +7 -1
- package/src/components/data-display/Table/Table.hooks.ts +16 -5
- package/src/components/data-display/Table/Table.types.ts +6 -2
- package/src/components/data-display/Table/TableParts.tsx +38 -42
- package/src/components/form/Calendar/Calendar.tsx +4 -2
- package/src/components/form/Calendar/CalendarDay.tsx +6 -3
- package/src/components/form/Calendar/CalendarMonth.tsx +6 -3
- package/src/components/form/Switch/Switch.metrics.ts +19 -5
- package/src/components/form/Switch/Switch.styles.ts +5 -3
- package/src/components/layout/CardGrid/CardGrid.tsx +37 -24
- package/src/components/layout/Resizable/Resizable.helpers.ts +43 -21
- package/src/components/layout/Resizable/Resizable.hooks.ts +17 -9
- package/src/components/layout/Resizable/Resizable.md +9 -5
- package/src/components/layout/Resizable/Resizable.tsx +20 -8
- package/src/components/layout/Resizable/Resizable.types.ts +10 -0
- package/src/components/layout/ScrollArea/ScrollArea.helpers.ts +0 -2
- package/src/components/layout/ScrollArea/ScrollArea.tsx +5 -3
- package/src/components/layout/ScrollArea/ScrollArea.types.ts +4 -1
- package/src/components/utility/InfiniteScroll/InfiniteScroll.hooks.ts +5 -4
- package/src/components/utility/InfiniteScroll/InfiniteScroll.parts.tsx +29 -12
- package/src/components/utility/InfiniteScroll/InfiniteScroll.tsx +11 -5
- package/src/components/utility/InfiniteScroll/InfiniteScroll.types.ts +10 -2
- package/src/components/utility/VirtualList/VirtualList.hooks.ts +101 -112
- package/src/components/utility/VirtualList/VirtualList.tsx +36 -65
- package/src/components/utility/VirtualList/VirtualList.types.ts +20 -3
- package/dist/chunk-2WFDHFK4.js.map +0 -1
- package/dist/chunk-3TDVGZZN.js.map +0 -1
- package/dist/chunk-AROBXRC5.js.map +0 -1
- package/dist/chunk-ATSHKSSD.js.map +0 -1
- package/dist/chunk-AUSUCZYR.js.map +0 -1
- package/dist/chunk-C66RGVAS.js.map +0 -1
- package/dist/chunk-D5SZXH7Q.js.map +0 -1
- package/dist/chunk-DF4K5XVW.js.map +0 -1
- package/dist/chunk-DLJGBJZW.js.map +0 -1
- package/dist/chunk-DZA7RSLX.js.map +0 -1
- package/dist/chunk-F42MJOHM.js.map +0 -1
- package/dist/chunk-GSFNH4C5.js.map +0 -1
- package/dist/chunk-HGMBY5LP.js.map +0 -1
- package/dist/chunk-HTZNB6IV.js.map +0 -1
- package/dist/chunk-IAGOUTI6.js.map +0 -1
- package/dist/chunk-J2DAQQQH.js.map +0 -1
- package/dist/chunk-MTFCPPZ5.js.map +0 -1
- package/dist/chunk-P6TNXBDA.js.map +0 -1
- package/dist/chunk-PMOEG36E.js.map +0 -1
- package/dist/chunk-PPRV4LTM.js.map +0 -1
- package/dist/chunk-PUBPZOQJ.js.map +0 -1
- package/dist/chunk-QF6LTUCE.js.map +0 -1
- package/dist/chunk-RHIDWUK7.js.map +0 -1
- package/dist/chunk-T7DE44SP.js.map +0 -1
- package/dist/chunk-TQ6FPOPD.js.map +0 -1
- package/dist/chunk-TUBCN4DJ.js.map +0 -1
- package/dist/chunk-ULTOQ6ZV.js.map +0 -1
- package/dist/chunk-UN5INW6K.js.map +0 -1
- package/dist/chunk-YU26GBNX.js.map +0 -1
- package/dist/chunk-ZAY6OA6F.js.map +0 -1
- /package/dist/{chunk-MR2HKBHS.js.map → chunk-27LOJVR3.js.map} +0 -0
- /package/dist/{chunk-S3D5VBHW.js.map → chunk-3YOXVNO4.js.map} +0 -0
- /package/dist/{chunk-CZIX4BW2.js.map → chunk-4ALF5PB5.js.map} +0 -0
- /package/dist/{chunk-XJPJ6ESI.js.map → chunk-4OAKGKK5.js.map} +0 -0
- /package/dist/{chunk-4CHROSWR.js.map → chunk-5ETBB2DG.js.map} +0 -0
- /package/dist/{chunk-46UPILLK.js.map → chunk-5NT2M2JI.js.map} +0 -0
- /package/dist/{chunk-H5BEWPEY.js.map → chunk-6N2EDWMG.js.map} +0 -0
- /package/dist/{chunk-GJQYM3PM.js.map → chunk-6PU3JYVY.js.map} +0 -0
- /package/dist/{chunk-Y7F5JBAT.js.map → chunk-DDRKYNPB.js.map} +0 -0
- /package/dist/{chunk-OS6KPL4D.js.map → chunk-EHYI2WCJ.js.map} +0 -0
- /package/dist/{chunk-NB3FGWU4.js.map → chunk-EQXIW5MQ.js.map} +0 -0
- /package/dist/{chunk-M2JTIH5M.js.map → chunk-F44R7US6.js.map} +0 -0
- /package/dist/{chunk-XJJXBUPN.js.map → chunk-FX26DAFF.js.map} +0 -0
- /package/dist/{chunk-R6SN73RX.js.map → chunk-GLHNMTP6.js.map} +0 -0
- /package/dist/{chunk-I4QA2F4L.js.map → chunk-HBRQPG7H.js.map} +0 -0
- /package/dist/{chunk-CNQUCNEA.js.map → chunk-I3F4C5SS.js.map} +0 -0
- /package/dist/{chunk-UFJYJHQI.js.map → chunk-J5VWGQSR.js.map} +0 -0
- /package/dist/{chunk-4JFL62K3.js.map → chunk-K7FSTB2K.js.map} +0 -0
- /package/dist/{chunk-FFCJ7NR2.js.map → chunk-KRQUPE4K.js.map} +0 -0
- /package/dist/{chunk-2OYFTSG4.js.map → chunk-KXLUMEDX.js.map} +0 -0
- /package/dist/{chunk-DVAAUWTC.js.map → chunk-LCHCE2G5.js.map} +0 -0
- /package/dist/{chunk-G4HBNILE.js.map → chunk-LEHMWJNZ.js.map} +0 -0
- /package/dist/{chunk-RZYSKQTS.js.map → chunk-PCBZYORN.js.map} +0 -0
- /package/dist/{chunk-5OBXEMQO.js.map → chunk-PRIBOWX4.js.map} +0 -0
- /package/dist/{chunk-PQECNGDE.js.map → chunk-QSRZOXQI.js.map} +0 -0
- /package/dist/{chunk-DCJSHYE5.js.map → chunk-RSDYS5B3.js.map} +0 -0
- /package/dist/{chunk-N5GVW6RO.js.map → chunk-S6IWKDWT.js.map} +0 -0
- /package/dist/{chunk-TKC6WHGB.js.map → chunk-SBIZXZPP.js.map} +0 -0
- /package/dist/{chunk-UEVHI62V.js.map → chunk-YCCY77W5.js.map} +0 -0
- /package/dist/{chunk-VZIB5W5L.js.map → chunk-ZGCPDA3F.js.map} +0 -0
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import { useTheme, type Theme } from "@mui/material/styles/index.js";
|
|
3
4
|
import { useRef } from "react";
|
|
4
5
|
|
|
6
|
+
import { remPx } from "../../../tokens/relative";
|
|
5
7
|
import { splitToFit, useMeasuredWidth } from "../../utility/Overflow";
|
|
6
8
|
import {
|
|
7
9
|
estimateWidth,
|
|
8
10
|
furnitureCost,
|
|
9
|
-
GAP,
|
|
10
11
|
isRangeSet,
|
|
11
12
|
pillText,
|
|
13
|
+
pricesFor,
|
|
12
14
|
RESERVED,
|
|
13
15
|
rightClusterCost,
|
|
16
|
+
type Prices,
|
|
14
17
|
} from "./data-views-overflow-costs";
|
|
15
18
|
import type { FilterFieldConfig, RangeFieldConfig, RangeValue } from "./data-views-types";
|
|
16
19
|
|
|
@@ -118,15 +121,16 @@ function isActiveField<T extends Record<string, unknown>>(
|
|
|
118
121
|
: isRangeSet(ranges[field.id]);
|
|
119
122
|
}
|
|
120
123
|
|
|
121
|
-
/** Estimated rendered width of one control at its CURRENT value. */
|
|
124
|
+
/** Estimated rendered width of one control at its CURRENT value, in px at `theme`'s scale. */
|
|
122
125
|
function fieldWidth<T extends Record<string, unknown>>(
|
|
126
|
+
theme: Theme,
|
|
123
127
|
field: OverflowField<T>,
|
|
124
128
|
pills: Record<string, string[]>,
|
|
125
129
|
ranges: Record<string, RangeValue>,
|
|
126
130
|
): number {
|
|
127
|
-
if (field.group === "pill") return estimateWidth(pillText(field, pills[field.id] ?? []), 0);
|
|
128
|
-
// A bounded range renders two number inputs beside its label.
|
|
129
|
-
return estimateWidth(field.label, isRangeSet(ranges[field.id]) ? 100 : 0);
|
|
131
|
+
if (field.group === "pill") return estimateWidth(theme, pillText(field, pills[field.id] ?? []), 0);
|
|
132
|
+
// A bounded range renders two number inputs (100 design px) beside its label.
|
|
133
|
+
return estimateWidth(theme, field.label, isRangeSet(ranges[field.id]) ? 100 : 0);
|
|
130
134
|
}
|
|
131
135
|
|
|
132
136
|
/** What one split costs on the bar, so the ladder below can price the next step. */
|
|
@@ -147,12 +151,16 @@ function splitFilters<T extends Record<string, unknown>>(
|
|
|
147
151
|
furniture: number,
|
|
148
152
|
/** Is the bar already down to icons? "Mais" shrinks with everything else. */
|
|
149
153
|
compact: boolean,
|
|
154
|
+
/** Whose type scale every price is read at — the bar's own. */
|
|
155
|
+
theme: Theme,
|
|
150
156
|
): Split<T> {
|
|
151
157
|
const active = all.filter((field) => isActiveField(field, pills, ranges));
|
|
152
158
|
const idle = all.filter((field) => !isActiveField(field, pills, ranges));
|
|
159
|
+
const price = pricesFor(theme);
|
|
160
|
+
const gap = remPx(theme, RESERVED.betweenControls);
|
|
153
161
|
|
|
154
162
|
// "Limpar" rides the end of the cluster whenever anything is applied.
|
|
155
|
-
const clearCost = active.length > 0 ?
|
|
163
|
+
const clearCost = active.length > 0 ? price.clearAll + gap : 0;
|
|
156
164
|
// APPLIED FIRST, BUT NOT EXEMPT.
|
|
157
165
|
//
|
|
158
166
|
// Applied controls take the visible slots ahead of idle ones — that part was
|
|
@@ -170,13 +178,13 @@ function splitFilters<T extends Record<string, unknown>>(
|
|
|
170
178
|
// one part of this that is not filter-shaped, and the part a second cluster
|
|
171
179
|
// in the design system would otherwise have had to reimplement.
|
|
172
180
|
const split = splitToFit(all, {
|
|
173
|
-
widthOf: (field) => fieldWidth(field, pills, ranges),
|
|
181
|
+
widthOf: (field) => fieldWidth(theme, field, pills, ranges),
|
|
174
182
|
keyOf: (field) => field.id,
|
|
175
|
-
gap
|
|
183
|
+
gap,
|
|
176
184
|
available: width - furniture - clearCost,
|
|
177
185
|
// The overflow button at the width it will actually have, which on a phone
|
|
178
186
|
// is the icon-and-badge one.
|
|
179
|
-
overflowCost: compact ?
|
|
187
|
+
overflowCost: compact ? price.overflowButtonCompact : price.overflowButton,
|
|
180
188
|
priority: [...active, ...idle],
|
|
181
189
|
});
|
|
182
190
|
return { ...split, used: split.used + clearCost };
|
|
@@ -206,6 +214,7 @@ function computeSplit<T extends Record<string, unknown>>(
|
|
|
206
214
|
width: number,
|
|
207
215
|
/** Does the host render "Exportar" beside "Exibir"? Half the cluster if not. */
|
|
208
216
|
hasExport: boolean,
|
|
217
|
+
theme: Theme,
|
|
209
218
|
): Omit<OverflowSplit<T>, "barRef"> {
|
|
210
219
|
// Unmeasured (SSR, or jsdom without a ResizeObserver) ⇒ degrade nothing.
|
|
211
220
|
if (width === 0) {
|
|
@@ -219,9 +228,11 @@ function computeSplit<T extends Record<string, unknown>>(
|
|
|
219
228
|
searchTakeover: false,
|
|
220
229
|
};
|
|
221
230
|
}
|
|
231
|
+
const price = pricesFor(theme);
|
|
222
232
|
// Pass 1 prices the furniture at its widest — no rung has been taken yet.
|
|
223
|
-
let
|
|
224
|
-
let
|
|
233
|
+
let budget = furnitureCost(price, UNCOLLAPSED, hasExport);
|
|
234
|
+
let split = splitFilters(all, pills, ranges, width, budget, false, theme);
|
|
235
|
+
let flags = ladderFlags(split, width, hasExport, price);
|
|
225
236
|
// RE-SPEND WHAT THE LATER RUNGS FREED.
|
|
226
237
|
//
|
|
227
238
|
// Rungs 2/4/5 turn 200 + 96 + 216 of furniture into 44 + 0 + 140, and until
|
|
@@ -234,13 +245,12 @@ function computeSplit<T extends Record<string, unknown>>(
|
|
|
234
245
|
// ladder FURTHER down, and a further rung can only make the furniture
|
|
235
246
|
// cheaper again — so the budget decreases monotonically and the loop exits
|
|
236
247
|
// the moment it stops moving. The bound is a backstop, not the exit.
|
|
237
|
-
let budget = furnitureCost(UNCOLLAPSED, hasExport);
|
|
238
248
|
for (let pass = 0; pass < 3; pass += 1) {
|
|
239
|
-
const freed = furnitureCost(flags, hasExport);
|
|
249
|
+
const freed = furnitureCost(price, flags, hasExport);
|
|
240
250
|
if (freed >= budget) break;
|
|
241
251
|
budget = freed;
|
|
242
|
-
split = splitFilters(all, pills, ranges, width, budget, flags.compactControls);
|
|
243
|
-
flags = ladderFlags(split, width, hasExport);
|
|
252
|
+
split = splitFilters(all, pills, ranges, width, budget, flags.compactControls, theme);
|
|
253
|
+
flags = ladderFlags(split, width, hasExport, price);
|
|
244
254
|
}
|
|
245
255
|
return { inline: split.inline, overflow: split.overflow, ...flags };
|
|
246
256
|
}
|
|
@@ -253,21 +263,22 @@ function ladderFlags<T extends Record<string, unknown>>(
|
|
|
253
263
|
split: Split<T>,
|
|
254
264
|
width: number,
|
|
255
265
|
hasExport: boolean,
|
|
266
|
+
price: Prices,
|
|
256
267
|
): Omit<OverflowSplit<T>, "barRef" | "inline" | "overflow"> {
|
|
257
268
|
const { overflow, used } = split;
|
|
258
|
-
const base = width - used -
|
|
269
|
+
const base = width - used - price.chrome;
|
|
259
270
|
|
|
260
271
|
// Would the search still make its minimum with the labels on?
|
|
261
|
-
const compactControls = base -
|
|
262
|
-
const rightCost = rightClusterCost(hasExport, compactControls);
|
|
272
|
+
const compactControls = base - price.counter - rightClusterCost(price, hasExport, false) < price.search;
|
|
273
|
+
const rightCost = rightClusterCost(price, hasExport, compactControls);
|
|
263
274
|
// …and with them off?
|
|
264
|
-
const searchCollapsed = base -
|
|
275
|
+
const searchCollapsed = base - price.counter - rightCost < price.search;
|
|
265
276
|
// Everything has collapsed and the row STILL overflows. The controls cannot
|
|
266
277
|
// shrink further — they are `flexShrink: 0` precisely so an over-packed row
|
|
267
278
|
// sheds rather than squeezes — so without this last rung they simply paint
|
|
268
279
|
// outside the toolbar, which is what a narrow phone was doing.
|
|
269
280
|
const counterHidden =
|
|
270
|
-
searchCollapsed && base -
|
|
281
|
+
searchCollapsed && base - price.counter - rightCost < price.searchIcon;
|
|
271
282
|
// Step 6 — below even that, "Limpar" leaves the bar. It is the ONLY control
|
|
272
283
|
// here with a second home: the overflow panel's footer carries "Limpar todos
|
|
273
284
|
// os filtros", so nothing is lost, which is exactly why it goes before the
|
|
@@ -288,14 +299,14 @@ function ladderFlags<T extends Record<string, unknown>>(
|
|
|
288
299
|
// pushed the box under `usableSearch`, and tipped a row that had ample space
|
|
289
300
|
// to share into a full takeover.
|
|
290
301
|
const overflowButton = compactControls
|
|
291
|
-
?
|
|
292
|
-
:
|
|
293
|
-
const shedRoom = width -
|
|
294
|
-
const searchBoxRoom = shedRoom - (counterHidden ? 0 :
|
|
302
|
+
? price.overflowButtonCompact
|
|
303
|
+
: price.overflowButton;
|
|
304
|
+
const shedRoom = width - price.chrome - (overflow.length > 0 ? overflowButton : 0);
|
|
305
|
+
const searchBoxRoom = shedRoom - (counterHidden ? 0 : price.counter) - rightCost;
|
|
295
306
|
// Below this a box is too narrow to read what you typed into it, and shrinking
|
|
296
307
|
// further buys nothing; that is the only point at which taking the whole
|
|
297
308
|
// cluster is worth losing the filters.
|
|
298
|
-
const searchTakeover = searchCollapsed && searchBoxRoom <
|
|
309
|
+
const searchTakeover = searchCollapsed && searchBoxRoom < price.usableSearch;
|
|
299
310
|
|
|
300
311
|
return { compactControls, counterHidden, searchCollapsed, clearAllHidden, searchTakeover };
|
|
301
312
|
}
|
|
@@ -336,16 +347,19 @@ export function useFilterOverflow<T extends Record<string, unknown>>(
|
|
|
336
347
|
// first measurement lands (and forever under SSR or jsdom), which
|
|
337
348
|
// `computeSplit` reads as "degrade nothing".
|
|
338
349
|
const { ref: barRef, width } = useMeasuredWidth<HTMLDivElement>();
|
|
350
|
+
// The prices follow the theme's type scale, so the answer does too.
|
|
351
|
+
const theme = useTheme();
|
|
339
352
|
const signature = JSON.stringify({
|
|
340
353
|
ids: all.map((field) => field.id),
|
|
341
354
|
pills,
|
|
342
355
|
ranges,
|
|
343
356
|
width,
|
|
344
357
|
hasExport,
|
|
358
|
+
scale: remPx(theme, 1),
|
|
345
359
|
});
|
|
346
360
|
const cache = useRef<{ signature: string; split: ReturnType<typeof computeSplit<T>> } | null>(null);
|
|
347
361
|
if (cache.current === null || (!frozen && cache.current.signature !== signature)) {
|
|
348
|
-
cache.current = { signature, split: computeSplit(all, pills, ranges, width, hasExport) };
|
|
362
|
+
cache.current = { signature, split: computeSplit(all, pills, ranges, width, hasExport, theme) };
|
|
349
363
|
}
|
|
350
364
|
return { ...cache.current.split, barRef };
|
|
351
365
|
}
|
|
@@ -91,7 +91,7 @@ const SkeletonIndicator: React.FC<IndicatorProps> = ({ props }) => {
|
|
|
91
91
|
height={styleLength(theme, props.height || 200)}
|
|
92
92
|
animation={props.skeletonProps.animation || 'pulse'}
|
|
93
93
|
intensity={props.skeletonProps.intensity}
|
|
94
|
-
borderRadius={props.borderRadius}
|
|
94
|
+
borderRadius={styleLength(theme, props.borderRadius)}
|
|
95
95
|
data-testid={`${props['data-testid']}-skeleton`}
|
|
96
96
|
/>
|
|
97
97
|
);
|
|
@@ -169,7 +169,7 @@ const ErrorFallback: React.FC<IndicatorProps> = ({ props, metrics }) => {
|
|
|
169
169
|
|
|
170
170
|
return (
|
|
171
171
|
<FallbackContainer
|
|
172
|
-
sx={{ width: sxLength(theme, width), height: sxLength(theme, height), borderRadius }}
|
|
172
|
+
sx={{ width: sxLength(theme, width), height: sxLength(theme, height), borderRadius: styleLength(theme, borderRadius) }}
|
|
173
173
|
data-testid={`${testId}-fallback`}
|
|
174
174
|
>
|
|
175
175
|
{fallback}
|
|
@@ -211,7 +211,9 @@ export const LazyImage = React.memo<LazyImageProps>(function LazyImage(rawProps)
|
|
|
211
211
|
sx={{
|
|
212
212
|
width: sxLength(theme, width || 'auto'),
|
|
213
213
|
height: sxLength(theme, height || 'auto'),
|
|
214
|
-
|
|
214
|
+
// The same px length the image gets (`metrics`): in `sx` a bare number
|
|
215
|
+
// would be a multiple of `shape.borderRadius`, and this box clips (FUT-2656).
|
|
216
|
+
borderRadius: metrics.borderRadius,
|
|
215
217
|
}}
|
|
216
218
|
data-testid={testId}
|
|
217
219
|
>
|
|
@@ -63,7 +63,9 @@ export interface LazyImageProps extends React.ImgHTMLAttributes<HTMLImageElement
|
|
|
63
63
|
objectPosition?: string;
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
|
-
* Border radius
|
|
66
|
+
* Border radius: a number is design px, scaled with the theme's type scale,
|
|
67
|
+
* and rounds the image, its clipping box, its skeleton and its fallback alike;
|
|
68
|
+
* a string is any CSS length and passes through untouched.
|
|
67
69
|
*/
|
|
68
70
|
borderRadius?: number | string;
|
|
69
71
|
|
|
@@ -2,12 +2,14 @@ import { alpha, useTheme } from '@mui/material/styles/index.js';
|
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { rem } from '../../../tokens/relative';
|
|
6
|
+
|
|
7
|
+
import { TILE_WORLD_UNITS } from './mapProjection';
|
|
6
8
|
import { tileBackground } from './mapSurface';
|
|
7
9
|
import type { MapType } from './MapPreview.types';
|
|
8
10
|
|
|
9
11
|
// Two extra rows and columns so panning does not expose an edge.
|
|
10
|
-
const VISIBLE_TILES = Math.ceil(800 /
|
|
12
|
+
const VISIBLE_TILES = Math.ceil(800 / TILE_WORLD_UNITS) + 2;
|
|
11
13
|
// Tile coordinates are only legible once the grid is reasonably fine.
|
|
12
14
|
const LABEL_MIN_ZOOM = 10;
|
|
13
15
|
|
|
@@ -23,6 +25,9 @@ export const MapTiles: FC<MapTilesProps> = ({ origin, zoom, mapType, panOffset }
|
|
|
23
25
|
const borderOpacity = theme.palette.mode === 'dark' ? 0.15 : 0.1;
|
|
24
26
|
const background = tileBackground(mapType, theme);
|
|
25
27
|
const half = Math.floor(VISIBLE_TILES / 2);
|
|
28
|
+
// A tile is drawn at one design px per world unit, through the type scale.
|
|
29
|
+
const tile = rem(theme, TILE_WORLD_UNITS);
|
|
30
|
+
const grid = rem(theme, TILE_WORLD_UNITS * VISIBLE_TILES);
|
|
26
31
|
|
|
27
32
|
return (
|
|
28
33
|
<div
|
|
@@ -30,12 +35,14 @@ export const MapTiles: FC<MapTilesProps> = ({ origin, zoom, mapType, panOffset }
|
|
|
30
35
|
position: 'absolute',
|
|
31
36
|
top: '50%',
|
|
32
37
|
left: '50%',
|
|
38
|
+
// The pan is pointer pixels dragged, so it stays px: the grid follows
|
|
39
|
+
// the cursor exactly, whatever the type scale.
|
|
33
40
|
transform: `translate(calc(-50% + ${panOffset.x}px), calc(-50% + ${panOffset.y}px))`,
|
|
34
|
-
width:
|
|
35
|
-
height:
|
|
41
|
+
width: grid,
|
|
42
|
+
height: grid,
|
|
36
43
|
display: 'grid',
|
|
37
|
-
gridTemplateColumns: `repeat(${VISIBLE_TILES}, ${
|
|
38
|
-
gridTemplateRows: `repeat(${VISIBLE_TILES}, ${
|
|
44
|
+
gridTemplateColumns: `repeat(${VISIBLE_TILES}, ${tile})`,
|
|
45
|
+
gridTemplateRows: `repeat(${VISIBLE_TILES}, ${tile})`,
|
|
39
46
|
transition: 'transform 0.1s ease-out',
|
|
40
47
|
}}
|
|
41
48
|
>
|
|
@@ -48,14 +55,14 @@ export const MapTiles: FC<MapTilesProps> = ({ origin, zoom, mapType, panOffset }
|
|
|
48
55
|
<div
|
|
49
56
|
key={`tile-${tileX}-${tileY}`}
|
|
50
57
|
style={{
|
|
51
|
-
width:
|
|
52
|
-
height:
|
|
58
|
+
width: tile,
|
|
59
|
+
height: tile,
|
|
53
60
|
border: `1px solid ${alpha(theme.palette.divider, borderOpacity)}`,
|
|
54
61
|
background,
|
|
55
62
|
display: 'flex',
|
|
56
63
|
alignItems: 'center',
|
|
57
64
|
justifyContent: 'center',
|
|
58
|
-
fontSize:
|
|
65
|
+
fontSize: rem(theme, 10),
|
|
59
66
|
color: alpha(theme.palette.text.secondary, 0.3),
|
|
60
67
|
fontFamily: 'monospace',
|
|
61
68
|
userSelect: 'none',
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* One tile's extent in Web Mercator's world units at zoom 0 — the projection's
|
|
3
|
+
* own coordinate space, not a drawn length: the tile index it yields is the
|
|
4
|
+
* same at any drawn size. `MapTiles` draws one world unit as one design px.
|
|
5
|
+
*/
|
|
6
|
+
export const TILE_WORLD_UNITS = 256;
|
|
2
7
|
|
|
3
8
|
// Metres covered by one pixel at zoom 0 on the equator; each zoom level halves it.
|
|
4
9
|
const EQUATOR_METRES_PER_PIXEL = 156543.03392;
|
|
@@ -12,8 +17,8 @@ const project = (lat: number, lng: number) => {
|
|
|
12
17
|
const boundedSiny = Math.max(-0.9999, Math.min(0.9999, siny));
|
|
13
18
|
|
|
14
19
|
return {
|
|
15
|
-
x:
|
|
16
|
-
y:
|
|
20
|
+
x: TILE_WORLD_UNITS * (0.5 + lng / 360),
|
|
21
|
+
y: TILE_WORLD_UNITS * (0.5 - Math.log((1 + boundedSiny) / (1 - boundedSiny)) / (4 * Math.PI)),
|
|
17
22
|
};
|
|
18
23
|
};
|
|
19
24
|
|
|
@@ -22,8 +27,8 @@ export const getTileCoordinates = (lat: number, lng: number, zoom: number) => {
|
|
|
22
27
|
const world = project(lat, lng);
|
|
23
28
|
|
|
24
29
|
return {
|
|
25
|
-
x: Math.floor(Math.floor(world.x * scale) /
|
|
26
|
-
y: Math.floor(Math.floor(world.y * scale) /
|
|
30
|
+
x: Math.floor(Math.floor(world.x * scale) / TILE_WORLD_UNITS),
|
|
31
|
+
y: Math.floor(Math.floor(world.y * scale) / TILE_WORLD_UNITS),
|
|
27
32
|
};
|
|
28
33
|
};
|
|
29
34
|
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { TableProps } from './Table.types';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* A virtualised row's height in design px: the caller's `rowHeight`, else 52.
|
|
5
|
+
* Resolved here rather than in {@link TABLE_DEFAULTS} so the one number is read
|
|
6
|
+
* where it is drawn (`rem`) and where the window is positioned with it (`remPx`).
|
|
7
|
+
*/
|
|
8
|
+
export const tableRowHeight = (rowHeight: number | undefined): number => rowHeight ?? 52;
|
|
9
|
+
|
|
3
10
|
export const TABLE_DEFAULTS: Partial<TableProps> = {
|
|
4
11
|
variant: 'default',
|
|
5
12
|
stripeColor: 'neutral',
|
|
@@ -13,7 +20,6 @@ export const TABLE_DEFAULTS: Partial<TableProps> = {
|
|
|
13
20
|
selectedRows: [],
|
|
14
21
|
sortable: false,
|
|
15
22
|
virtualScrolling: false,
|
|
16
|
-
rowHeight: 52,
|
|
17
23
|
overscan: 5,
|
|
18
24
|
responsive: false,
|
|
19
25
|
showColumnToggle: true,
|
|
@@ -2,22 +2,31 @@ import { useTheme } from '@mui/material/styles/index.js';
|
|
|
2
2
|
import useMediaQuery from '@mui/material/useMediaQuery/index.js';
|
|
3
3
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
4
|
|
|
5
|
+
import { rem, remPx } from '../../../tokens/relative';
|
|
6
|
+
|
|
5
7
|
import type { ColumnConfig, TableProps } from './Table.types';
|
|
6
8
|
|
|
9
|
+
/**
|
|
10
|
+
* The virtual window. `rowHeight` and `containerHeight` are design px: the
|
|
11
|
+
* window is computed in the px `scrollTop` is measured in (`remPx`), and what it
|
|
12
|
+
* hands back to draw with stays in design px (`offsetY`) or is CSS already
|
|
13
|
+
* (`totalHeight`), so the rows and the window share one pitch at any type scale.
|
|
14
|
+
*/
|
|
7
15
|
export const useVirtualScrolling = (
|
|
8
16
|
data: Record<string, unknown>[],
|
|
9
17
|
rowHeight: number,
|
|
10
18
|
containerHeight: number,
|
|
11
19
|
overscan: number = 5
|
|
12
20
|
) => {
|
|
21
|
+
const theme = useTheme();
|
|
13
22
|
const [scrollTop, setScrollTop] = useState(0);
|
|
14
23
|
|
|
15
24
|
const visibleItems = useMemo(() => {
|
|
16
|
-
const
|
|
17
|
-
const startIndex = Math.floor(scrollTop /
|
|
25
|
+
const pitch = remPx(theme, rowHeight);
|
|
26
|
+
const startIndex = Math.floor(scrollTop / pitch);
|
|
18
27
|
const endIndex = Math.min(
|
|
19
28
|
data.length,
|
|
20
|
-
Math.ceil((scrollTop +
|
|
29
|
+
Math.ceil((scrollTop + remPx(theme, containerHeight)) / pitch)
|
|
21
30
|
);
|
|
22
31
|
|
|
23
32
|
const start = Math.max(0, startIndex - overscan);
|
|
@@ -27,10 +36,12 @@ export const useVirtualScrolling = (
|
|
|
27
36
|
startIndex: start,
|
|
28
37
|
endIndex: end,
|
|
29
38
|
items: data.slice(start, end),
|
|
30
|
-
|
|
39
|
+
/** Every row at the scaled pitch, as CSS. */
|
|
40
|
+
totalHeight: rem(theme, data.length * rowHeight),
|
|
41
|
+
/** Where the first mounted row sits, in design px. */
|
|
31
42
|
offsetY: start * rowHeight,
|
|
32
43
|
};
|
|
33
|
-
}, [data, rowHeight, containerHeight, scrollTop, overscan]);
|
|
44
|
+
}, [data, rowHeight, containerHeight, scrollTop, overscan, theme]);
|
|
34
45
|
|
|
35
46
|
const handleScroll = useCallback((e: React.UIEvent<HTMLDivElement>) => {
|
|
36
47
|
setScrollTop(e.currentTarget.scrollTop);
|
|
@@ -22,7 +22,9 @@ export interface ColumnConfig {
|
|
|
22
22
|
label: string;
|
|
23
23
|
sortable?: boolean;
|
|
24
24
|
filterable?: boolean;
|
|
25
|
+
/** A number is design px, scaled with the theme's type scale; a string is used as given. */
|
|
25
26
|
width?: number | string;
|
|
27
|
+
/** Design px, scaled with the theme's type scale. */
|
|
26
28
|
minWidth?: number;
|
|
27
29
|
priority?: number; // 1 = highest priority, higher numbers = lower priority
|
|
28
30
|
align?: 'left' | 'center' | 'right';
|
|
@@ -191,7 +193,8 @@ export interface TableProps extends Omit<MuiTableProps, 'variant'> {
|
|
|
191
193
|
virtualScrolling?: boolean;
|
|
192
194
|
|
|
193
195
|
/**
|
|
194
|
-
* Height of each row for virtual scrolling (
|
|
196
|
+
* Height of each row for virtual scrolling (default 52) — design px, scaled
|
|
197
|
+
* with the theme's type scale.
|
|
195
198
|
*/
|
|
196
199
|
rowHeight?: number;
|
|
197
200
|
|
|
@@ -226,7 +229,8 @@ export interface TableProps extends Omit<MuiTableProps, 'variant'> {
|
|
|
226
229
|
showColumnToggle?: boolean;
|
|
227
230
|
|
|
228
231
|
/**
|
|
229
|
-
* Container height for virtual scrolling
|
|
232
|
+
* Container height for virtual scrolling (default 400). A number is design
|
|
233
|
+
* px, scaled with the theme's type scale; a string is used as given.
|
|
230
234
|
*/
|
|
231
235
|
containerHeight?: number | string;
|
|
232
236
|
|
|
@@ -5,8 +5,12 @@ import TableCell from '@mui/material/TableCell/index.js';
|
|
|
5
5
|
import TableHead from '@mui/material/TableHead/index.js';
|
|
6
6
|
import TableRow from '@mui/material/TableRow/index.js';
|
|
7
7
|
import TableSortLabel from '@mui/material/TableSortLabel/index.js';
|
|
8
|
+
import { useTheme, type Theme } from '@mui/material/styles/index.js';
|
|
8
9
|
import React, { useCallback } from 'react';
|
|
9
10
|
|
|
11
|
+
import { rem } from '../../../tokens/relative';
|
|
12
|
+
|
|
13
|
+
import { tableRowHeight } from './Table.helpers';
|
|
10
14
|
import { useVirtualScrolling } from './Table.hooks';
|
|
11
15
|
import { useTableRowRenderer } from './TableParts.hooks';
|
|
12
16
|
import type { ColumnConfig, TableBodyProps, TableHeaderProps } from './Table.types';
|
|
@@ -23,6 +27,10 @@ const ariaSortFor = (
|
|
|
23
27
|
return direction === 'asc' ? 'ascending' : 'descending';
|
|
24
28
|
};
|
|
25
29
|
|
|
30
|
+
/** A column's `width`/`minWidth` as CSS: a number is design px, a string as given. */
|
|
31
|
+
const columnLength = (theme: Theme, value: number | string | undefined): string | undefined =>
|
|
32
|
+
typeof value === 'number' ? rem(theme, value) : value;
|
|
33
|
+
|
|
26
34
|
// One header cell. Sorting is offered when the table is sortable and the column
|
|
27
35
|
// has not opted out; aria-sort mirrors the visible indicator.
|
|
28
36
|
const HeaderCell: React.FC<{
|
|
@@ -31,13 +39,17 @@ const HeaderCell: React.FC<{
|
|
|
31
39
|
sortConfig?: { key: string; direction: 'asc' | 'desc' };
|
|
32
40
|
onSort: (columnKey: string) => void;
|
|
33
41
|
}> = ({ column, sortable, sortConfig, onSort }) => {
|
|
42
|
+
const theme = useTheme();
|
|
34
43
|
const canSort = Boolean(sortable) && column.sortable !== false;
|
|
35
44
|
const isSorted = sortConfig?.key === column.key;
|
|
36
45
|
|
|
37
46
|
return (
|
|
38
47
|
<TableCell
|
|
39
48
|
align={column.align || 'left'}
|
|
40
|
-
style={{
|
|
49
|
+
style={{
|
|
50
|
+
minWidth: columnLength(theme, column.minWidth),
|
|
51
|
+
width: columnLength(theme, column.width),
|
|
52
|
+
}}
|
|
41
53
|
aria-sort={ariaSortFor(canSort, isSorted, sortConfig?.direction)}
|
|
42
54
|
>
|
|
43
55
|
{canSort ? (
|
|
@@ -120,10 +132,12 @@ export const TableDataRow: React.FC<{
|
|
|
120
132
|
rowData: Record<string, unknown>;
|
|
121
133
|
rowKey: string | number;
|
|
122
134
|
index: number;
|
|
135
|
+
/** Where a virtualised row sits, in design px — drawn through `rem`, like its height. */
|
|
123
136
|
offsetY: number;
|
|
124
137
|
columns: ColumnConfig[];
|
|
125
138
|
selected: boolean;
|
|
126
139
|
selectable?: boolean;
|
|
140
|
+
/** Design px; 52 when unset (`tableRowHeight`). */
|
|
127
141
|
rowHeight?: number;
|
|
128
142
|
onRowClick?: TableBodyProps['onRowClick'];
|
|
129
143
|
onRowFocus?: TableBodyProps['onRowFocus'];
|
|
@@ -145,8 +159,9 @@ export const TableDataRow: React.FC<{
|
|
|
145
159
|
onRowBlur,
|
|
146
160
|
onSelect,
|
|
147
161
|
virtualScrolling,
|
|
148
|
-
renderCell }) =>
|
|
149
|
-
|
|
162
|
+
renderCell }) => {
|
|
163
|
+
const theme = useTheme();
|
|
164
|
+
return (
|
|
150
165
|
<TableRow
|
|
151
166
|
key={String(rowKey)}
|
|
152
167
|
selected={selected}
|
|
@@ -155,12 +170,12 @@ export const TableDataRow: React.FC<{
|
|
|
155
170
|
onFocus={(event: React.FocusEvent<globalThis.HTMLTableRowElement>) => onRowFocus?.(event, rowData)}
|
|
156
171
|
onBlur={(event: React.FocusEvent<globalThis.HTMLTableRowElement>) => onRowBlur?.(event, rowData)}
|
|
157
172
|
style={virtualScrolling ? {
|
|
158
|
-
transform: `translateY(${offsetY}
|
|
173
|
+
transform: `translateY(${rem(theme, offsetY)})`,
|
|
159
174
|
position: 'absolute',
|
|
160
175
|
top: 0,
|
|
161
176
|
left: 0,
|
|
162
177
|
right: 0,
|
|
163
|
-
height: rowHeight } : undefined}
|
|
178
|
+
height: rem(theme, tableRowHeight(rowHeight)) } : undefined}
|
|
164
179
|
>
|
|
165
180
|
{selectable && (
|
|
166
181
|
<TableCell padding="checkbox">
|
|
@@ -186,16 +201,19 @@ export const TableDataRow: React.FC<{
|
|
|
186
201
|
);
|
|
187
202
|
})}
|
|
188
203
|
</TableRow>
|
|
189
|
-
);
|
|
204
|
+
);
|
|
205
|
+
};
|
|
190
206
|
|
|
191
207
|
// Only the rows in view are rendered, positioned by absolute offset inside a
|
|
192
|
-
// spacer sized to the full data set.
|
|
208
|
+
// spacer sized to the full data set. `rowHeight`, `containerHeight` and every
|
|
209
|
+
// offset are design px, drawn through `rem`.
|
|
193
210
|
const VirtualisedBody: React.FC<{
|
|
194
211
|
visibleItems: {
|
|
195
212
|
items: Record<string, unknown>[];
|
|
196
213
|
startIndex: number;
|
|
197
214
|
offsetY: number;
|
|
198
|
-
|
|
215
|
+
/** As CSS. */
|
|
216
|
+
totalHeight: string;
|
|
199
217
|
};
|
|
200
218
|
rowHeight: number;
|
|
201
219
|
containerHeight: number;
|
|
@@ -205,12 +223,13 @@ const VirtualisedBody: React.FC<{
|
|
|
205
223
|
index: number,
|
|
206
224
|
offsetY?: number,
|
|
207
225
|
) => React.ReactNode;
|
|
208
|
-
}> = ({ visibleItems, rowHeight, containerHeight, onScroll, renderTableRow }) =>
|
|
209
|
-
|
|
226
|
+
}> = ({ visibleItems, rowHeight, containerHeight, onScroll, renderTableRow }) => {
|
|
227
|
+
const theme = useTheme();
|
|
228
|
+
return (
|
|
210
229
|
<Box
|
|
211
230
|
onScroll={onScroll}
|
|
212
231
|
style={{
|
|
213
|
-
height: containerHeight,
|
|
232
|
+
height: rem(theme, containerHeight),
|
|
214
233
|
overflow: 'auto',
|
|
215
234
|
position: 'relative' }}
|
|
216
235
|
>
|
|
@@ -224,8 +243,8 @@ const VirtualisedBody: React.FC<{
|
|
|
224
243
|
)}
|
|
225
244
|
</TableBody>
|
|
226
245
|
</Box>
|
|
227
|
-
|
|
228
|
-
|
|
246
|
+
);
|
|
247
|
+
};
|
|
229
248
|
|
|
230
249
|
const PlainBody: React.FC<{
|
|
231
250
|
data: TableBodyProps['data'];
|
|
@@ -238,35 +257,12 @@ const PlainBody: React.FC<{
|
|
|
238
257
|
);
|
|
239
258
|
|
|
240
259
|
// Enhanced Table Body Component
|
|
241
|
-
export const EnhancedTableBody: React.FC<TableBodyProps> = React.memo(({
|
|
242
|
-
data,
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
onRowBlur,
|
|
248
|
-
onSelectionChange,
|
|
249
|
-
rowKeyExtractor,
|
|
250
|
-
selectable,
|
|
251
|
-
renderRow,
|
|
252
|
-
renderCell,
|
|
253
|
-
virtualScrolling,
|
|
254
|
-
containerHeight,
|
|
255
|
-
rowHeight,
|
|
256
|
-
overscan = 5 }) => {
|
|
257
|
-
const renderTableRow = useTableRowRenderer({
|
|
258
|
-
columns,
|
|
259
|
-
selectedRows,
|
|
260
|
-
onRowClick,
|
|
261
|
-
onRowFocus,
|
|
262
|
-
onRowBlur,
|
|
263
|
-
onSelectionChange,
|
|
264
|
-
rowKeyExtractor,
|
|
265
|
-
selectable,
|
|
266
|
-
renderRow,
|
|
267
|
-
renderCell,
|
|
268
|
-
virtualScrolling,
|
|
269
|
-
rowHeight });
|
|
260
|
+
export const EnhancedTableBody: React.FC<TableBodyProps> = React.memo((props) => {
|
|
261
|
+
const { data, virtualScrolling, containerHeight, overscan = 5 } = props;
|
|
262
|
+
// The row renderer takes the body's own props; its `rowHeight` stays the
|
|
263
|
+
// caller's design px, and the row resolves the default where it draws it.
|
|
264
|
+
const renderTableRow = useTableRowRenderer({ ...props, selectedRows: props.selectedRows ?? [] });
|
|
265
|
+
const rowHeight = tableRowHeight(props.rowHeight);
|
|
270
266
|
|
|
271
267
|
const { visibleItems, handleScroll } = useVirtualScrolling(
|
|
272
268
|
data,
|
|
@@ -3,6 +3,8 @@ import Box from '@mui/material/Box/index.js';
|
|
|
3
3
|
import Paper from '@mui/material/Paper/index.js';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
|
+
import { rem, sxRem } from '../../../tokens/relative';
|
|
7
|
+
|
|
6
8
|
import { resolveCalendarProps } from './Calendar.helpers';
|
|
7
9
|
import { useCalendar } from './Calendar.hooks';
|
|
8
10
|
import type { CalendarProps } from './Calendar.types';
|
|
@@ -16,9 +18,9 @@ const containerSx = (monthsToShow: number): SxProps<Theme> => ({
|
|
|
16
18
|
gap: 3,
|
|
17
19
|
outline: 'none',
|
|
18
20
|
'&:focus-within': {
|
|
19
|
-
outline:
|
|
21
|
+
outline: (theme: Theme) => `${rem(theme, 2)} solid`,
|
|
20
22
|
outlineColor: 'primary.main',
|
|
21
|
-
outlineOffset: 2,
|
|
23
|
+
outlineOffset: sxRem(2),
|
|
22
24
|
},
|
|
23
25
|
});
|
|
24
26
|
|
|
@@ -3,9 +3,12 @@ import Box from '@mui/material/Box/index.js';
|
|
|
3
3
|
import type { FC } from 'react';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
|
+
import { rem, sxRem } from '../../../tokens/relative';
|
|
7
|
+
|
|
6
8
|
import type { DayRenderArgs } from './Calendar.types';
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
/** A day cell's edge, 40 design px through the theme's type scale. */
|
|
11
|
+
const CELL_SIZE = sxRem(40);
|
|
9
12
|
|
|
10
13
|
interface DayState extends DayRenderArgs {
|
|
11
14
|
outside: boolean;
|
|
@@ -72,9 +75,9 @@ const dayCellSx = (day: DayRenderArgs, visible: boolean): SxProps<Theme> => ({
|
|
|
72
75
|
backgroundColor: hoverBackgroundFor(day),
|
|
73
76
|
},
|
|
74
77
|
'&:focus': {
|
|
75
|
-
outline:
|
|
78
|
+
outline: (theme: Theme) => `${rem(theme, 2)} solid`,
|
|
76
79
|
outlineColor: 'primary.main',
|
|
77
|
-
outlineOffset: 1,
|
|
80
|
+
outlineOffset: sxRem(1),
|
|
78
81
|
},
|
|
79
82
|
});
|
|
80
83
|
|