@expcat/tigercat-react 2.1.2 → 2.1.3
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/{chunk-4C2X5PZO.mjs → chunk-25BKSXTX.mjs} +209 -98
- package/dist/{chunk-IGBQGR6G.mjs → chunk-2AVHOPKK.mjs} +112 -54
- package/dist/{chunk-34VGG7AK.mjs → chunk-2AVQQGL2.mjs} +6 -5
- package/dist/{chunk-Y6557RWE.mjs → chunk-2BRMZBQ2.mjs} +43 -15
- package/dist/{chunk-X4L3W7RQ.mjs → chunk-2FFAUB47.mjs} +34 -21
- package/dist/chunk-2N6WZ5Z5.mjs +427 -0
- package/dist/chunk-2PC625DX.mjs +88 -0
- package/dist/chunk-2QJGXENY.mjs +85 -0
- package/dist/chunk-2SN5JTST.mjs +99 -0
- package/dist/chunk-2STETY2J.mjs +160 -0
- package/dist/{chunk-GR3Y3XWP.mjs → chunk-34BU3D7L.mjs} +21 -3
- package/dist/chunk-3J2AUNWT.mjs +326 -0
- package/dist/chunk-3KBFOO2E.mjs +139 -0
- package/dist/{chunk-2YBLMVDT.mjs → chunk-3QSO6YK5.mjs} +40 -47
- package/dist/{chunk-YJ5T4XZN.mjs → chunk-3WP4PGHF.mjs} +24 -25
- package/dist/chunk-4BJCH6FI.mjs +454 -0
- package/dist/{chunk-QB5472NM.mjs → chunk-4DFN6RZ4.mjs} +25 -26
- package/dist/{chunk-YNDPQVEK.mjs → chunk-4ED2QCE6.mjs} +69 -36
- package/dist/{chunk-N2D7NPEW.mjs → chunk-4JVXADTJ.mjs} +30 -22
- package/dist/chunk-4KZETZUH.mjs +143 -0
- package/dist/chunk-4ZFZCNX5.mjs +96 -0
- package/dist/chunk-53RDSFKZ.mjs +320 -0
- package/dist/{chunk-TQ6RIFWR.mjs → chunk-57IHCV62.mjs} +30 -14
- package/dist/chunk-5D6BOIZB.mjs +104 -0
- package/dist/chunk-5I7FKHZO.mjs +768 -0
- package/dist/chunk-5J7EDMS7.mjs +13 -0
- package/dist/chunk-5P3OFNH3.mjs +290 -0
- package/dist/{chunk-2YOP55OF.mjs → chunk-5QTYD4XG.mjs} +244 -229
- package/dist/chunk-5XI3Q6A6.mjs +279 -0
- package/dist/{chunk-NT7GW2FD.mjs → chunk-635ACZQW.mjs} +3 -2
- package/dist/chunk-65CDWNRJ.mjs +314 -0
- package/dist/chunk-6D2VLITE.mjs +431 -0
- package/dist/chunk-6IJFLGCN.mjs +274 -0
- package/dist/chunk-6NCG4SLX.mjs +158 -0
- package/dist/chunk-6NJMDDL6.mjs +244 -0
- package/dist/chunk-6R66IQ5V.mjs +214 -0
- package/dist/chunk-7H7EKANG.mjs +145 -0
- package/dist/chunk-7KVHHNUI.mjs +297 -0
- package/dist/chunk-7VPMOGN3.mjs +205 -0
- package/dist/{chunk-F2ITBDUS.mjs → chunk-A4JRK5SM.mjs} +43 -22
- package/dist/chunk-A6PNUVY6.mjs +236 -0
- package/dist/chunk-ACV7IV3W.mjs +339 -0
- package/dist/{chunk-EW43YBPV.mjs → chunk-AFVKH2Z3.mjs} +66 -31
- package/dist/chunk-B2IFWWM5.mjs +352 -0
- package/dist/chunk-BKIINKEY.mjs +138 -0
- package/dist/{chunk-OKYMTHFQ.mjs → chunk-BKSYS4D6.mjs} +74 -77
- package/dist/chunk-BNCUJLRV.mjs +152 -0
- package/dist/chunk-BP24PM37.mjs +397 -0
- package/dist/{chunk-AYFKHWJS.mjs → chunk-C4UZFBFV.mjs} +127 -111
- package/dist/chunk-C6FS67EL.mjs +260 -0
- package/dist/chunk-CCTBNDCX.mjs +637 -0
- package/dist/chunk-CJSB5NOK.mjs +348 -0
- package/dist/chunk-CKKOBWER.mjs +182 -0
- package/dist/chunk-CMOSTUC3.mjs +296 -0
- package/dist/chunk-CQQRB4QZ.mjs +364 -0
- package/dist/chunk-CX7QZXU5.mjs +41 -0
- package/dist/chunk-DNDJAR2I.mjs +38 -0
- package/dist/chunk-E7OUCJ3U.mjs +34 -0
- package/dist/{chunk-FLYJVZED.mjs → chunk-ED7QR6PJ.mjs} +2 -2
- package/dist/chunk-EFZDKSTJ.mjs +279 -0
- package/dist/chunk-EJY3Y2XU.mjs +550 -0
- package/dist/{chunk-7EXOY7GD.mjs → chunk-FVA5VKN2.mjs} +25 -15
- package/dist/{chunk-ZJWUBR2X.mjs → chunk-G5NPND2T.mjs} +18 -2
- package/dist/chunk-GJRGMIB3.mjs +863 -0
- package/dist/{chunk-2XZHYYZ2.mjs → chunk-GMHJWSQB.mjs} +770 -661
- package/dist/{chunk-U4M3DC2P.mjs → chunk-GOIJNJ5D.mjs} +17 -1
- package/dist/chunk-GRB667BG.mjs +442 -0
- package/dist/chunk-HAG7TGPS.mjs +157 -0
- package/dist/{chunk-L5KAXWQI.mjs → chunk-HHRU7TK3.mjs} +18 -2
- package/dist/chunk-HZGTQGSM.mjs +943 -0
- package/dist/chunk-I4P4T6LL.mjs +287 -0
- package/dist/{chunk-FPQMJFFM.mjs → chunk-IELUUOM4.mjs} +15 -7
- package/dist/chunk-IPI45RUK.mjs +80 -0
- package/dist/chunk-IR45LOEZ.mjs +376 -0
- package/dist/chunk-ITC2NU25.mjs +35 -0
- package/dist/chunk-IZC77KAN.mjs +497 -0
- package/dist/chunk-J3BDVC5F.mjs +107 -0
- package/dist/chunk-JML6CK44.mjs +483 -0
- package/dist/chunk-JVLLOOEE.mjs +248 -0
- package/dist/chunk-KDO5PUMV.mjs +368 -0
- package/dist/{chunk-QU3QXUTC.mjs → chunk-KJB2OIG7.mjs} +89 -70
- package/dist/chunk-KJSNUS45.mjs +23 -0
- package/dist/chunk-KTBAJ3TL.mjs +408 -0
- package/dist/chunk-KVXGNUIE.mjs +101 -0
- package/dist/{chunk-XJ7U2W7S.mjs → chunk-LHHRNRND.mjs} +7 -3
- package/dist/{chunk-2JMI7TCM.mjs → chunk-LMSEOGKK.mjs} +2 -11
- package/dist/{chunk-VJWSKJLJ.mjs → chunk-LPVE2LX3.mjs} +34 -21
- package/dist/chunk-LTIICOWN.mjs +115 -0
- package/dist/chunk-M7TSPEXC.mjs +826 -0
- package/dist/chunk-MADQ6KHD.mjs +116 -0
- package/dist/{chunk-FNK2VWPP.mjs → chunk-N53N6H54.mjs} +59 -25
- package/dist/chunk-NFDR7KTS.mjs +597 -0
- package/dist/chunk-NNDEPQJG.mjs +172 -0
- package/dist/{chunk-HKAZXG74.mjs → chunk-NPGU6VYD.mjs} +109 -22
- package/dist/chunk-NRLES2YZ.mjs +174 -0
- package/dist/chunk-NTCVAVYZ.mjs +182 -0
- package/dist/chunk-O3O5GBBY.mjs +181 -0
- package/dist/chunk-O7DJWXII.mjs +112 -0
- package/dist/{chunk-54HN5BXW.mjs → chunk-OES5DL3S.mjs} +148 -97
- package/dist/chunk-OIMP63RE.mjs +967 -0
- package/dist/{chunk-CUAXRBKO.mjs → chunk-OP77MPGN.mjs} +22 -12
- package/dist/chunk-OTABJT7Z.mjs +61 -0
- package/dist/chunk-OYQ6HTLQ.mjs +457 -0
- package/dist/chunk-PLEAZRIC.mjs +315 -0
- package/dist/chunk-PTKNRNH6.mjs +34 -0
- package/dist/{chunk-DECUASRW.mjs → chunk-PTKQJPLM.mjs} +134 -102
- package/dist/chunk-PV237GAZ.mjs +226 -0
- package/dist/chunk-PZ4LAI6G.mjs +365 -0
- package/dist/chunk-Q4TGJNVU.mjs +857 -0
- package/dist/{chunk-XT43B7ZI.mjs → chunk-QIGZOYBF.mjs} +28 -13
- package/dist/chunk-QUF2UX52.mjs +343 -0
- package/dist/chunk-R2VBVZIH.mjs +20 -0
- package/dist/chunk-R45ZPU5J.mjs +19 -0
- package/dist/{chunk-AUD3VOLO.mjs → chunk-R7J37DKJ.mjs} +115 -76
- package/dist/chunk-REJVXLW5.mjs +97 -0
- package/dist/chunk-RLUBTLOT.mjs +80 -0
- package/dist/chunk-RNH2I23I.mjs +341 -0
- package/dist/chunk-RNKUEEIX.mjs +350 -0
- package/dist/chunk-RTKPLZ5A.mjs +545 -0
- package/dist/chunk-RUIFGSVN.mjs +141 -0
- package/dist/chunk-S3B5QPUA.mjs +76 -0
- package/dist/{chunk-SDLMB34Y.mjs → chunk-ST4NN6XV.mjs} +5 -3
- package/dist/{chunk-ZATZRXMW.mjs → chunk-T5VXIYWF.mjs} +68 -62
- package/dist/chunk-TTYKX6G4.mjs +355 -0
- package/dist/chunk-TVVLCER6.mjs +540 -0
- package/dist/chunk-U7V7ZWJ6.mjs +256 -0
- package/dist/chunk-UAFA5GOL.mjs +160 -0
- package/dist/chunk-UJTAHHQT.mjs +41 -0
- package/dist/chunk-UK5NGPTQ.mjs +62 -0
- package/dist/chunk-UMJIDEXI.mjs +261 -0
- package/dist/chunk-UOF324U6.mjs +80 -0
- package/dist/chunk-UTVZUCKK.mjs +61 -0
- package/dist/chunk-UWQBY3CL.mjs +331 -0
- package/dist/chunk-V6FJYERX.mjs +501 -0
- package/dist/chunk-VDBLI5Y3.mjs +33 -0
- package/dist/chunk-WBESWSTS.mjs +121 -0
- package/dist/chunk-WCIUNNIN.mjs +108 -0
- package/dist/chunk-WFLXJOFU.mjs +124 -0
- package/dist/chunk-WKZZ4IQK.mjs +403 -0
- package/dist/{chunk-CN3QXWK3.mjs → chunk-WLCRBIZO.mjs} +53 -44
- package/dist/chunk-WN6ZHQTI.mjs +129 -0
- package/dist/chunk-WPRXOO6N.mjs +90 -0
- package/dist/{chunk-XZVQ3PJS.mjs → chunk-WQMOFDAY.mjs} +9 -18
- package/dist/{chunk-CC7IOSNI.mjs → chunk-WSN4Z4MC.mjs} +101 -76
- package/dist/{chunk-YH7FKFRM.mjs → chunk-WW6MFKTJ.mjs} +173 -189
- package/dist/chunk-WWZZRB7H.mjs +121 -0
- package/dist/chunk-X3KXJKLM.mjs +297 -0
- package/dist/chunk-X7NF2HZV.mjs +551 -0
- package/dist/{chunk-M6ZPTGBV.mjs → chunk-XAYOEQGB.mjs} +69 -46
- package/dist/chunk-XBDLXTF7.mjs +21 -0
- package/dist/chunk-XE34TOCS.mjs +294 -0
- package/dist/chunk-XI6KQAHW.mjs +256 -0
- package/dist/{chunk-Y3SGFGN6.mjs → chunk-XJHC6JEC.mjs} +16 -2
- package/dist/{chunk-WTHWLCRL.mjs → chunk-XKB7ECPU.mjs} +39 -28
- package/dist/{chunk-R7YZ6FKP.mjs → chunk-XXU5VQV5.mjs} +231 -207
- package/dist/chunk-XYW6RTRB.mjs +217 -0
- package/dist/chunk-XZFHPHV5.mjs +75 -0
- package/dist/{chunk-3HHEVMHE.mjs → chunk-YCVORYEO.mjs} +71 -66
- package/dist/chunk-YDO3V3SK.mjs +70 -0
- package/dist/{chunk-OTBXERJD.mjs → chunk-YLXEMZVI.mjs} +35 -32
- package/dist/chunk-ZATZSMQY.mjs +620 -0
- package/dist/chunk-ZG6WST55.mjs +188 -0
- package/dist/chunk-ZGXC47M5.mjs +361 -0
- package/dist/components/ActivityFeed.d.mts +2 -0
- package/dist/components/ActivityFeed.mjs +13 -12
- package/dist/components/Affix.d.mts +1 -2
- package/dist/components/Affix.mjs +1 -1
- package/dist/components/Alert.d.mts +5 -5
- package/dist/components/Alert.mjs +3 -2
- package/dist/components/Anchor.d.mts +11 -38
- package/dist/components/Anchor.mjs +3 -1
- package/dist/components/AreaChart.mjs +11 -9
- package/dist/components/AspectRatio.mjs +1 -1
- package/dist/components/AutoComplete.d.mts +11 -10
- package/dist/components/AutoComplete.mjs +6 -4
- package/dist/components/Avatar.d.mts +5 -6
- package/dist/components/Avatar.mjs +3 -4
- package/dist/components/AvatarGroup.d.mts +2 -3
- package/dist/components/AvatarGroup.mjs +2 -3
- package/dist/components/BackTop.d.mts +4 -13
- package/dist/components/BackTop.mjs +2 -1
- package/dist/components/Badge.d.mts +3 -1
- package/dist/components/Badge.mjs +1 -3
- package/dist/components/BarChart.mjs +11 -9
- package/dist/components/Breadcrumb.d.mts +11 -18
- package/dist/components/Breadcrumb.mjs +2 -1
- package/dist/components/Button.d.mts +3 -2
- package/dist/components/Button.mjs +2 -2
- package/dist/components/ButtonGroup.mjs +1 -1
- package/dist/components/Calendar.d.mts +3 -2
- package/dist/components/Calendar.mjs +3 -3
- package/dist/components/Card.d.mts +6 -22
- package/dist/components/Card.mjs +1 -1
- package/dist/components/Carousel.d.mts +1 -24
- package/dist/components/Carousel.mjs +3 -4
- package/dist/components/Cascader.d.mts +19 -13
- package/dist/components/Cascader.mjs +6 -4
- package/dist/components/ChartAxis.mjs +1 -1
- package/dist/components/ChartCanvas.d.mts +3 -2
- package/dist/components/ChartCanvas.mjs +1 -1
- package/dist/components/ChartGrid.d.mts +1 -1
- package/dist/components/ChartGrid.mjs +1 -1
- package/dist/components/ChartLegend.d.mts +3 -10
- package/dist/components/ChartLegend.mjs +2 -1
- package/dist/components/ChartSeries.d.mts +2 -2
- package/dist/components/ChartSeries.mjs +1 -1
- package/dist/components/ChartTooltip.d.mts +2 -1
- package/dist/components/ChartTooltip.mjs +2 -1
- package/dist/components/ChatWindow.d.mts +6 -4
- package/dist/components/ChatWindow.mjs +13 -13
- package/dist/components/Checkbox.d.mts +3 -40
- package/dist/components/Checkbox.mjs +4 -3
- package/dist/components/CheckboxGroup.d.mts +3 -19
- package/dist/components/CheckboxGroup.mjs +3 -2
- package/dist/components/Code.d.mts +3 -1
- package/dist/components/Code.mjs +2 -3
- package/dist/components/CodeEditor.d.mts +10 -7
- package/dist/components/CodeEditor.mjs +4 -1
- package/dist/components/Col.d.mts +1 -1
- package/dist/components/Col.mjs +1 -2
- package/dist/components/Collapse.d.mts +7 -10
- package/dist/components/Collapse.mjs +1 -1
- package/dist/components/CollapsePanel.d.mts +1 -13
- package/dist/components/CollapsePanel.mjs +2 -2
- package/dist/components/ColorPicker.d.mts +11 -7
- package/dist/components/ColorPicker.mjs +10 -6
- package/dist/components/ColorSwatch.d.mts +8 -1
- package/dist/components/ColorSwatch.mjs +4 -1
- package/dist/components/CommentThread.mjs +12 -12
- package/dist/components/ConfigProvider.d.mts +4 -14
- package/dist/components/ConfigProvider.mjs +1 -2
- package/dist/components/Container.d.mts +2 -2
- package/dist/components/Container.mjs +1 -1
- package/dist/components/Content.d.mts +2 -1
- package/dist/components/Content.mjs +2 -1
- package/dist/components/ContextMenu.d.mts +3 -2
- package/dist/components/ContextMenu.mjs +3 -2
- package/dist/components/Countdown.d.mts +7 -1
- package/dist/components/Countdown.mjs +1 -1
- package/dist/components/CronEditor.d.mts +4 -6
- package/dist/components/CronEditor.mjs +4 -3
- package/dist/components/CropUpload.d.mts +6 -39
- package/dist/components/CropUpload.mjs +11 -8
- package/dist/components/DataExport.d.mts +8 -4
- package/dist/components/DataExport.mjs +6 -5
- package/dist/components/DataTableWithToolbar.d.mts +20 -20
- package/dist/components/DataTableWithToolbar.mjs +21 -19
- package/dist/components/DatePicker.d.mts +11 -5
- package/dist/components/DatePicker.mjs +7 -5
- package/dist/components/Descriptions.d.mts +5 -43
- package/dist/components/Descriptions.mjs +2 -1
- package/dist/components/Divider.d.mts +3 -3
- package/dist/components/Divider.mjs +1 -1
- package/dist/components/DonutChart.d.mts +0 -6
- package/dist/components/DonutChart.mjs +9 -6
- package/dist/components/Drawer.d.mts +1 -6
- package/dist/components/Drawer.mjs +4 -4
- package/dist/components/Dropdown.d.mts +4 -18
- package/dist/components/Dropdown.mjs +4 -2
- package/dist/components/Empty.d.mts +1 -1
- package/dist/components/Empty.mjs +2 -3
- package/dist/components/FileManager.d.mts +2 -1
- package/dist/components/FileManager.mjs +4 -4
- package/dist/components/FloatButton.d.mts +5 -9
- package/dist/components/FloatButton.mjs +9 -3
- package/dist/components/Footer.d.mts +2 -1
- package/dist/components/Footer.mjs +1 -1
- package/dist/components/Form.d.mts +15 -64
- package/dist/components/Form.mjs +2 -3
- package/dist/components/FormItem.d.mts +1 -6
- package/dist/components/FormItem.mjs +4 -5
- package/dist/components/FormItemContext.d.mts +9 -1
- package/dist/components/FormWizard.d.mts +9 -2
- package/dist/components/FormWizard.mjs +8 -6
- package/dist/components/FunnelChart.d.mts +1 -2
- package/dist/components/FunnelChart.mjs +12 -7
- package/dist/components/Gantt.d.mts +1 -1
- package/dist/components/Gantt.mjs +3 -2
- package/dist/components/GaugeChart.d.mts +1 -1
- package/dist/components/GaugeChart.mjs +9 -5
- package/dist/components/Header.d.mts +1 -1
- package/dist/components/Header.mjs +1 -1
- package/dist/components/HeatmapChart.d.mts +2 -2
- package/dist/components/HeatmapChart.mjs +11 -6
- package/dist/components/Highlight.mjs +1 -1
- package/dist/components/Icon.d.mts +1 -1
- package/dist/components/Icon.mjs +1 -1
- package/dist/components/Image.d.mts +4 -2
- package/dist/components/Image.mjs +7 -7
- package/dist/components/ImageAnnotation.d.mts +3 -2
- package/dist/components/ImageAnnotation.mjs +3 -3
- package/dist/components/ImageCompare.mjs +3 -1
- package/dist/components/ImageCropper.d.mts +2 -7
- package/dist/components/ImageCropper.mjs +3 -3
- package/dist/components/ImageGroup.d.mts +6 -12
- package/dist/components/ImageGroup.mjs +4 -5
- package/dist/components/ImagePreview.d.mts +2 -12
- package/dist/components/ImagePreview.mjs +3 -4
- package/dist/components/ImageViewer.d.mts +5 -0
- package/dist/components/ImageViewer.mjs +4 -3
- package/dist/components/InfiniteScroll.d.mts +2 -12
- package/dist/components/InfiniteScroll.mjs +2 -3
- package/dist/components/Input.d.mts +3 -30
- package/dist/components/Input.mjs +5 -3
- package/dist/components/InputGroup.d.mts +0 -1
- package/dist/components/InputGroup.mjs +1 -1
- package/dist/components/InputNumber.d.mts +4 -13
- package/dist/components/InputNumber.mjs +5 -3
- package/dist/components/InputOTP.d.mts +4 -22
- package/dist/components/InputOTP.mjs +3 -4
- package/dist/components/Kanban.d.mts +13 -46
- package/dist/components/Kanban.mjs +4 -4
- package/dist/components/Kbd.mjs +1 -1
- package/dist/components/Layout.d.mts +1 -1
- package/dist/components/Layout.mjs +2 -1
- package/dist/components/LineChart.mjs +11 -9
- package/dist/components/Link.d.mts +1 -1
- package/dist/components/Link.mjs +1 -1
- package/dist/components/List.d.mts +8 -111
- package/dist/components/List.mjs +12 -7
- package/dist/components/Loading.d.mts +1 -0
- package/dist/components/Loading.mjs +3 -4
- package/dist/components/LoadingBar.d.mts +2 -3
- package/dist/components/LoadingBar.mjs +56 -83
- package/dist/components/LoadingBarContainer.d.mts +1 -1
- package/dist/components/LoadingBarContainer.mjs +2 -1
- package/dist/components/LoadingBarRoot.d.mts +3 -3
- package/dist/components/LoadingBarRoot.mjs +1 -1
- package/dist/components/MarkdownEditor.d.mts +7 -4
- package/dist/components/MarkdownEditor.mjs +4 -4
- package/dist/components/Marquee.mjs +1 -1
- package/dist/components/MaskInput.d.mts +3 -23
- package/dist/components/MaskInput.mjs +5 -2
- package/dist/components/Masonry.d.mts +0 -1
- package/dist/components/Masonry.mjs +1 -1
- package/dist/components/Mentions.d.mts +10 -10
- package/dist/components/Mentions.mjs +6 -2
- package/dist/components/Menu.d.mts +16 -59
- package/dist/components/Menu.mjs +6 -2
- package/dist/components/Message.d.mts +1 -2
- package/dist/components/Message.mjs +55 -120
- package/dist/components/MessageContainer.d.mts +6 -0
- package/dist/components/MessageContainer.mjs +4 -2
- package/dist/components/MessageRoot.d.mts +2 -2
- package/dist/components/MessageRoot.mjs +1 -1
- package/dist/components/Modal.d.mts +7 -23
- package/dist/components/Modal.mjs +6 -6
- package/dist/components/NavigationMenu.d.mts +11 -7
- package/dist/components/NavigationMenu.mjs +3 -2
- package/dist/components/Notification.d.mts +1 -2
- package/dist/components/Notification.mjs +72 -163
- package/dist/components/NotificationCenter.mjs +14 -13
- package/dist/components/NotificationContainer.d.mts +6 -0
- package/dist/components/NotificationContainer.mjs +4 -2
- package/dist/components/NotificationRoot.d.mts +3 -3
- package/dist/components/NotificationRoot.mjs +1 -1
- package/dist/components/NumberKeyboard.d.mts +4 -4
- package/dist/components/NumberKeyboard.mjs +5 -3
- package/dist/components/OrgChart.mjs +3 -2
- package/dist/components/PageHeader.d.mts +3 -1
- package/dist/components/PageHeader.mjs +5 -4
- package/dist/components/Pagination.mjs +2 -3
- package/dist/components/PieChart.mjs +8 -5
- package/dist/components/Popconfirm.d.mts +18 -7
- package/dist/components/Popconfirm.mjs +8 -3
- package/dist/components/Popover.d.mts +14 -5
- package/dist/components/Popover.mjs +5 -3
- package/dist/components/PrintLayout.d.mts +7 -12
- package/dist/components/PrintLayout.mjs +2 -1
- package/dist/components/Progress.mjs +2 -1
- package/dist/components/QRCode.d.mts +3 -11
- package/dist/components/QRCode.mjs +2 -3
- package/dist/components/RadarChart.d.mts +0 -16
- package/dist/components/RadarChart.mjs +8 -6
- package/dist/components/Radio.d.mts +2 -11
- package/dist/components/Radio.mjs +4 -3
- package/dist/components/RadioGroup.d.mts +3 -11
- package/dist/components/RadioGroup.mjs +3 -2
- package/dist/components/Rate.d.mts +4 -7
- package/dist/components/Rate.mjs +3 -3
- package/dist/components/Resizable.d.mts +6 -2
- package/dist/components/Resizable.mjs +3 -1
- package/dist/components/Result.d.mts +6 -2
- package/dist/components/Result.mjs +2 -2
- package/dist/components/RichTextEditor.d.mts +6 -16
- package/dist/components/RichTextEditor.mjs +4 -4
- package/dist/components/Row.d.mts +2 -6
- package/dist/components/Row.mjs +3 -5
- package/dist/components/ScatterChart.mjs +11 -11
- package/dist/components/ScrollArea.d.mts +3 -2
- package/dist/components/ScrollArea.mjs +2 -1
- package/dist/components/ScrollSpy.d.mts +5 -4
- package/dist/components/ScrollSpy.mjs +3 -1
- package/dist/components/Segmented.d.mts +2 -3
- package/dist/components/Segmented.mjs +3 -1
- package/dist/components/Select.d.mts +18 -5
- package/dist/components/Select.mjs +6 -4
- package/dist/components/Sidebar.d.mts +1 -1
- package/dist/components/Sidebar.mjs +3 -1
- package/dist/components/Signature.d.mts +5 -2
- package/dist/components/Signature.mjs +4 -3
- package/dist/components/Skeleton.d.mts +1 -1
- package/dist/components/Skeleton.mjs +1 -1
- package/dist/components/Slider.d.mts +3 -5
- package/dist/components/Slider.mjs +4 -1
- package/dist/components/Space.d.mts +5 -1
- package/dist/components/Space.mjs +1 -1
- package/dist/components/SplitButton.d.mts +1 -21
- package/dist/components/SplitButton.mjs +8 -5
- package/dist/components/Splitter.d.mts +2 -2
- package/dist/components/Splitter.mjs +2 -1
- package/dist/components/Spotlight.d.mts +4 -3
- package/dist/components/Spotlight.mjs +4 -5
- package/dist/components/Statistic.d.mts +5 -2
- package/dist/components/Statistic.mjs +2 -1
- package/dist/components/Stepper.d.mts +3 -5
- package/dist/components/Stepper.mjs +4 -2
- package/dist/components/Steps.d.mts +4 -1
- package/dist/components/Steps.mjs +2 -1
- package/dist/components/SunburstChart.d.mts +1 -2
- package/dist/components/SunburstChart.mjs +12 -7
- package/dist/components/Switch.d.mts +3 -8
- package/dist/components/Switch.mjs +3 -2
- package/dist/components/Table.d.mts +2 -2
- package/dist/components/Table.mjs +18 -12
- package/dist/components/Tabs.d.mts +6 -94
- package/dist/components/Tabs.mjs +2 -3
- package/dist/components/Tag.d.mts +13 -2
- package/dist/components/Tag.mjs +2 -3
- package/dist/components/TagsInput.d.mts +3 -26
- package/dist/components/TagsInput.mjs +6 -5
- package/dist/components/TaskBoard.d.mts +1 -3
- package/dist/components/TaskBoard.mjs +3 -3
- package/dist/components/Text.d.mts +4 -2
- package/dist/components/Text.mjs +1 -1
- package/dist/components/Textarea.d.mts +3 -0
- package/dist/components/Textarea.mjs +4 -3
- package/dist/components/TimePicker.d.mts +22 -19
- package/dist/components/TimePicker.mjs +6 -5
- package/dist/components/Timeline.d.mts +7 -27
- package/dist/components/Timeline.mjs +2 -3
- package/dist/components/Tooltip.d.mts +12 -2
- package/dist/components/Tooltip.mjs +5 -3
- package/dist/components/Tour.d.mts +8 -4
- package/dist/components/Tour.mjs +7 -5
- package/dist/components/Transfer.d.mts +8 -10
- package/dist/components/Transfer.mjs +7 -3
- package/dist/components/Tree.d.mts +30 -175
- package/dist/components/Tree.mjs +8 -4
- package/dist/components/TreeMapChart.d.mts +1 -2
- package/dist/components/TreeMapChart.mjs +12 -7
- package/dist/components/TreeSelect.d.mts +18 -9
- package/dist/components/TreeSelect.mjs +7 -5
- package/dist/components/Upload.d.mts +9 -9
- package/dist/components/Upload.mjs +9 -4
- package/dist/components/VirtualList.d.mts +7 -4
- package/dist/components/VirtualList.mjs +1 -1
- package/dist/components/VirtualTable.d.mts +8 -6
- package/dist/components/VirtualTable.mjs +2 -3
- package/dist/components/Watermark.d.mts +1 -1
- package/dist/components/Watermark.mjs +1 -1
- package/dist/hooks/useChartInteraction.d.mts +5 -56
- package/dist/hooks/useChartInteraction.mjs +1 -1
- package/dist/hooks/useControlledState.d.mts +25 -22
- package/dist/hooks/useControlledState.mjs +1 -1
- package/dist/hooks/useDrag.d.mts +3 -21
- package/dist/hooks/useDrag.mjs +1 -1
- package/dist/hooks/useFormController.d.mts +3 -16
- package/dist/hooks/useFormController.mjs +1 -1
- package/dist/hooks/useResponsiveChartSize.d.mts +15 -0
- package/dist/hooks/useResponsiveChartSize.mjs +6 -0
- package/dist/index.d.mts +20 -17
- package/dist/index.mjs +1381 -200
- package/dist/types-C11UWmeK.d.mts +10 -0
- package/package.json +23 -8
- package/dist/chunk-246DAUEF.mjs +0 -181
- package/dist/chunk-2HKFQ74Z.mjs +0 -127
- package/dist/chunk-2JYJPNW3.mjs +0 -280
- package/dist/chunk-32MCQMBJ.mjs +0 -332
- package/dist/chunk-3G5EJRD4.mjs +0 -152
- package/dist/chunk-3GPGSNOQ.mjs +0 -258
- package/dist/chunk-3LACOSJQ.mjs +0 -65
- package/dist/chunk-3LDDXHW2.mjs +0 -217
- package/dist/chunk-3O3AQLNS.mjs +0 -172
- package/dist/chunk-3QNIFKVF.mjs +0 -232
- package/dist/chunk-5P5M656V.mjs +0 -81
- package/dist/chunk-5SEMRHBD.mjs +0 -327
- package/dist/chunk-5TE7KLE5.mjs +0 -92
- package/dist/chunk-5ZYZQXEM.mjs +0 -188
- package/dist/chunk-677VSTPW.mjs +0 -72
- package/dist/chunk-6H5Y7Y6E.mjs +0 -148
- package/dist/chunk-6RMBUZZE.mjs +0 -240
- package/dist/chunk-6SEPT4C5.mjs +0 -57
- package/dist/chunk-6UIVNRAR.mjs +0 -188
- package/dist/chunk-72CJNKDY.mjs +0 -222
- package/dist/chunk-AKNWUI7K.mjs +0 -82
- package/dist/chunk-ALSOPYM5.mjs +0 -705
- package/dist/chunk-AYHP2OAX.mjs +0 -14
- package/dist/chunk-BBK37UMR.mjs +0 -134
- package/dist/chunk-BUXHI6UK.mjs +0 -701
- package/dist/chunk-BXAH2GH3.mjs +0 -64
- package/dist/chunk-BYD7EAWK.mjs +0 -211
- package/dist/chunk-CFQKUMZV.mjs +0 -26
- package/dist/chunk-CRIEUKMD.mjs +0 -322
- package/dist/chunk-CT36XD5I.mjs +0 -412
- package/dist/chunk-CVYA3MI2.mjs +0 -653
- package/dist/chunk-D3KP72UC.mjs +0 -802
- package/dist/chunk-EAAWB3CK.mjs +0 -142
- package/dist/chunk-EG7EMDKK.mjs +0 -108
- package/dist/chunk-EPWAROC2.mjs +0 -73
- package/dist/chunk-FDKWHP2K.mjs +0 -352
- package/dist/chunk-FQS24AUH.mjs +0 -241
- package/dist/chunk-GBEDWXLL.mjs +0 -127
- package/dist/chunk-GOQ6ZG7H.mjs +0 -67
- package/dist/chunk-GV4F6X3C.mjs +0 -266
- package/dist/chunk-HAXRHSCN.mjs +0 -291
- package/dist/chunk-HLS4CHWX.mjs +0 -30
- package/dist/chunk-HS6KUPTI.mjs +0 -177
- package/dist/chunk-I2BENK5X.mjs +0 -149
- package/dist/chunk-I5TELDUV.mjs +0 -78
- package/dist/chunk-IIWUQK2P.mjs +0 -109
- package/dist/chunk-IXV5YBCZ.mjs +0 -65
- package/dist/chunk-J76R2S62.mjs +0 -161
- package/dist/chunk-JZZPLKTW.mjs +0 -173
- package/dist/chunk-KCPGFO5R.mjs +0 -51
- package/dist/chunk-KDURW5AS.mjs +0 -231
- package/dist/chunk-KKN7KLTB.mjs +0 -84
- package/dist/chunk-KQ4ZKXXN.mjs +0 -118
- package/dist/chunk-KRDHM5KB.mjs +0 -259
- package/dist/chunk-MEFARVQI.mjs +0 -25
- package/dist/chunk-MFPVVGNA.mjs +0 -248
- package/dist/chunk-MJVSZ2UJ.mjs +0 -276
- package/dist/chunk-MOWK7CND.mjs +0 -120
- package/dist/chunk-MYI3FPG4.mjs +0 -251
- package/dist/chunk-NADODEZX.mjs +0 -285
- package/dist/chunk-NJWTZ5MO.mjs +0 -688
- package/dist/chunk-NLGLBTSM.mjs +0 -138
- package/dist/chunk-NXJMVH26.mjs +0 -194
- package/dist/chunk-O6VYD4E4.mjs +0 -508
- package/dist/chunk-O7TV5OKS.mjs +0 -143
- package/dist/chunk-OJ6SHHOZ.mjs +0 -234
- package/dist/chunk-OL3RXYMG.mjs +0 -46
- package/dist/chunk-OO562MFD.mjs +0 -80
- package/dist/chunk-OPHYFC5W.mjs +0 -52
- package/dist/chunk-OQ6Z6U7R.mjs +0 -135
- package/dist/chunk-OQLP452R.mjs +0 -468
- package/dist/chunk-OXGAZPPS.mjs +0 -147
- package/dist/chunk-OZ5XLR22.mjs +0 -182
- package/dist/chunk-PAS347EX.mjs +0 -109
- package/dist/chunk-PD6Q36OO.mjs +0 -471
- package/dist/chunk-PMQJ6AYT.mjs +0 -100
- package/dist/chunk-PY2VUNEJ.mjs +0 -494
- package/dist/chunk-Q5JTIICP.mjs +0 -108
- package/dist/chunk-QOAOOD53.mjs +0 -318
- package/dist/chunk-RE5ZLA5D.mjs +0 -268
- package/dist/chunk-RGVU4EMA.mjs +0 -531
- package/dist/chunk-RQSQXQN6.mjs +0 -100
- package/dist/chunk-RRGPDFDI.mjs +0 -255
- package/dist/chunk-RUQ3F3MV.mjs +0 -333
- package/dist/chunk-S2V3HGLZ.mjs +0 -733
- package/dist/chunk-SEOG5AGS.mjs +0 -72
- package/dist/chunk-SHT4TU3T.mjs +0 -32
- package/dist/chunk-SJ5RFU2O.mjs +0 -21
- package/dist/chunk-SPIPFOGD.mjs +0 -322
- package/dist/chunk-SVIJ2UZA.mjs +0 -186
- package/dist/chunk-SXWEFZOF.mjs +0 -766
- package/dist/chunk-TDFLUDRM.mjs +0 -283
- package/dist/chunk-TEVEXDY2.mjs +0 -570
- package/dist/chunk-TGXBCKOU.mjs +0 -35
- package/dist/chunk-TO6MZFNQ.mjs +0 -186
- package/dist/chunk-TULQETJ5.mjs +0 -45
- package/dist/chunk-U2ZXZ2KQ.mjs +0 -213
- package/dist/chunk-U7RLVY67.mjs +0 -303
- package/dist/chunk-UHK2ISKR.mjs +0 -282
- package/dist/chunk-UYQBXVFE.mjs +0 -72
- package/dist/chunk-V7HJ5HLC.mjs +0 -412
- package/dist/chunk-VSFDT2RS.mjs +0 -46
- package/dist/chunk-W7BC4I2Y.mjs +0 -68
- package/dist/chunk-WK45IRP7.mjs +0 -93
- package/dist/chunk-WX5VUIGT.mjs +0 -22
- package/dist/chunk-X6C6MNG5.mjs +0 -240
- package/dist/chunk-XVHTJQ4T.mjs +0 -140
- package/dist/chunk-Y5X3G2LD.mjs +0 -115
- package/dist/chunk-Y6UH3EKE.mjs +0 -328
- package/dist/chunk-YN5ZIWCE.mjs +0 -19
- package/dist/chunk-YORCCCQX.mjs +0 -83
- package/dist/chunk-YSIXURBW.mjs +0 -116
- package/dist/chunk-Z23KOLNU.mjs +0 -326
- package/dist/chunk-Z3CRHC5F.mjs +0 -430
- package/dist/types-0oVwMXtR.d.mts +0 -33
- /package/dist/{chunk-5JETWHLJ.mjs → chunk-7P4R3NVO.mjs} +0 -0
|
@@ -1,39 +1,57 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Select
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M7TSPEXC.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Radio
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4KZETZUH.mjs";
|
|
7
7
|
import {
|
|
8
8
|
Pagination
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XAYOEQGB.mjs";
|
|
10
|
+
import {
|
|
11
|
+
Input
|
|
12
|
+
} from "./chunk-XE34TOCS.mjs";
|
|
10
13
|
import {
|
|
11
14
|
Empty
|
|
12
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-RLUBTLOT.mjs";
|
|
13
16
|
import {
|
|
14
17
|
Checkbox
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-HAG7TGPS.mjs";
|
|
19
|
+
import {
|
|
20
|
+
Loading
|
|
21
|
+
} from "./chunk-BNCUJLRV.mjs";
|
|
22
|
+
import {
|
|
23
|
+
Button
|
|
24
|
+
} from "./chunk-WFLXJOFU.mjs";
|
|
16
25
|
import {
|
|
17
26
|
useTigerConfig
|
|
18
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-RUIFGSVN.mjs";
|
|
19
28
|
|
|
20
29
|
// src/components/Table.tsx
|
|
21
|
-
import { useEffect as useEffect2, useMemo as useMemo2, useRef, useState as useState2 } from "react";
|
|
30
|
+
import { useEffect as useEffect2, useId, useMemo as useMemo2, useRef as useRef2, useState as useState2 } from "react";
|
|
22
31
|
import {
|
|
23
32
|
classNames as classNames3,
|
|
33
|
+
canUseTableVirtualWindow,
|
|
24
34
|
createTableResizeObserverController,
|
|
25
35
|
getTableWrapperClasses,
|
|
26
36
|
getCardColumns,
|
|
27
37
|
getCardGridInfo,
|
|
28
38
|
getTableColgroup,
|
|
39
|
+
hasTableSelectionColumn as hasTableSelectionColumn4,
|
|
40
|
+
resolveTableExpandSlot as resolveTableExpandSlot4,
|
|
41
|
+
tableExportBarClasses,
|
|
29
42
|
getTableResponsiveCardClasses,
|
|
30
|
-
getTableResponsiveCardListClasses,
|
|
31
43
|
getTableResponsiveTableClasses,
|
|
32
44
|
getTableVirtualRecommendation,
|
|
33
45
|
getTableVirtualWindow,
|
|
34
|
-
|
|
46
|
+
getTableCardSortValue,
|
|
47
|
+
parseTableCardSortValue,
|
|
48
|
+
subscribeTableCardViewport,
|
|
49
|
+
TABLE_CARD_SORT_NONE,
|
|
50
|
+
tableCardListVisibleClasses,
|
|
51
|
+
formatTableSelectRowAriaLabel as formatTableSelectRowAriaLabel2,
|
|
35
52
|
formatTableSortByText as formatTableSortByText2,
|
|
36
53
|
getTableLabels,
|
|
54
|
+
isActivationKey as isActivationKey2,
|
|
37
55
|
tableBaseClasses,
|
|
38
56
|
tableResponsiveCardLabelClasses,
|
|
39
57
|
tableResponsiveCardRowClasses,
|
|
@@ -45,91 +63,35 @@ import {
|
|
|
45
63
|
mergeTigerLocale,
|
|
46
64
|
resolveTigerLocale
|
|
47
65
|
} from "@expcat/tigercat-core";
|
|
48
|
-
import { tableExportButtonClasses } from "@expcat/tigercat-core";
|
|
49
|
-
|
|
50
|
-
// src/components/Table/icons.tsx
|
|
51
|
-
import {
|
|
52
|
-
getSortIconClasses,
|
|
53
|
-
getExpandIconClasses,
|
|
54
|
-
getSpinnerSVG,
|
|
55
|
-
getLoadingOverlaySpinnerClasses,
|
|
56
|
-
icon16ViewBox,
|
|
57
|
-
icon24ViewBox,
|
|
58
|
-
sortAscIcon16PathD,
|
|
59
|
-
sortDescIcon16PathD,
|
|
60
|
-
sortBothIcon16PathD,
|
|
61
|
-
expandChevronIcon16PathD,
|
|
62
|
-
lockClosedIcon24PathD,
|
|
63
|
-
lockOpenIcon24PathD
|
|
64
|
-
} from "@expcat/tigercat-core";
|
|
65
|
-
import { jsx } from "react/jsx-runtime";
|
|
66
|
-
var spinnerSvg = getSpinnerSVG("spinner");
|
|
67
|
-
var SortIcon = ({ direction }) => {
|
|
68
|
-
const active = direction !== null;
|
|
69
|
-
const pathD = direction === "asc" ? sortAscIcon16PathD : direction === "desc" ? sortDescIcon16PathD : sortBothIcon16PathD;
|
|
70
|
-
return /* @__PURE__ */ jsx(
|
|
71
|
-
"svg",
|
|
72
|
-
{
|
|
73
|
-
className: getSortIconClasses(active),
|
|
74
|
-
width: "16",
|
|
75
|
-
height: "16",
|
|
76
|
-
viewBox: icon16ViewBox,
|
|
77
|
-
fill: "currentColor",
|
|
78
|
-
children: /* @__PURE__ */ jsx("path", { d: pathD })
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
};
|
|
82
|
-
var LockIcon = ({ locked }) => {
|
|
83
|
-
return /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: icon24ViewBox, fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: locked ? lockClosedIcon24PathD : lockOpenIcon24PathD }) });
|
|
84
|
-
};
|
|
85
|
-
var ExpandIcon = ({ expanded }) => {
|
|
86
|
-
return /* @__PURE__ */ jsx(
|
|
87
|
-
"svg",
|
|
88
|
-
{
|
|
89
|
-
className: getExpandIconClasses(expanded),
|
|
90
|
-
width: "16",
|
|
91
|
-
height: "16",
|
|
92
|
-
viewBox: icon16ViewBox,
|
|
93
|
-
fill: "currentColor",
|
|
94
|
-
"aria-hidden": "true",
|
|
95
|
-
children: /* @__PURE__ */ jsx("path", { d: expandChevronIcon16PathD })
|
|
96
|
-
}
|
|
97
|
-
);
|
|
98
|
-
};
|
|
99
|
-
var LoadingSpinner = () => /* @__PURE__ */ jsx(
|
|
100
|
-
"svg",
|
|
101
|
-
{
|
|
102
|
-
className: getLoadingOverlaySpinnerClasses(),
|
|
103
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
104
|
-
fill: "none",
|
|
105
|
-
viewBox: spinnerSvg.viewBox,
|
|
106
|
-
children: spinnerSvg.elements.map((el, index) => {
|
|
107
|
-
if (el.type === "circle") return /* @__PURE__ */ jsx("circle", { ...el.attrs }, index);
|
|
108
|
-
if (el.type === "path") return /* @__PURE__ */ jsx("path", { ...el.attrs }, index);
|
|
109
|
-
return null;
|
|
110
|
-
})
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
66
|
|
|
114
67
|
// src/components/Table/state.ts
|
|
115
|
-
import { useEffect, useMemo, useState } from "react";
|
|
68
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
116
69
|
import {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
70
|
+
DEFAULT_TABLE_SORT,
|
|
71
|
+
EMPTY_TABLE_FILTER_RULES,
|
|
72
|
+
EMPTY_TABLE_FILTERS,
|
|
73
|
+
EMPTY_TABLE_HIDDEN_KEYS,
|
|
74
|
+
EMPTY_TABLE_RECORDS,
|
|
75
|
+
applyTableColumnOrder,
|
|
76
|
+
commitTableCellEdit,
|
|
77
|
+
downloadTableExport,
|
|
78
|
+
exportTableData,
|
|
125
79
|
freezeTableColumnWidths,
|
|
126
|
-
|
|
127
|
-
|
|
80
|
+
getNextTableColumnFixed,
|
|
81
|
+
getNextTableExpandKeys,
|
|
128
82
|
getNextTableSelectAllKeys,
|
|
129
|
-
|
|
130
|
-
|
|
83
|
+
getNextTableSelectRowKeys,
|
|
84
|
+
getNextTableSortState,
|
|
85
|
+
mergeTableFilterValue,
|
|
86
|
+
mergeTablePagination,
|
|
87
|
+
reorderTableColumnsByKey,
|
|
88
|
+
reorderTableRowsByKey,
|
|
89
|
+
resolveTableKeyList,
|
|
90
|
+
resolveTableRecordKey,
|
|
91
|
+
resolveTableView,
|
|
92
|
+
shouldWarnControlledPageReset
|
|
131
93
|
} from "@expcat/tigercat-core";
|
|
132
|
-
import {
|
|
94
|
+
import { devWarn } from "@expcat/tigercat-core";
|
|
133
95
|
function useTableState(input) {
|
|
134
96
|
const {
|
|
135
97
|
columns,
|
|
@@ -149,9 +111,9 @@ function useTableState(input) {
|
|
|
149
111
|
filterMode,
|
|
150
112
|
advancedFilterRules,
|
|
151
113
|
groupBy,
|
|
152
|
-
exportFormat,
|
|
153
114
|
exportFilename,
|
|
154
115
|
measuredColumnWidths,
|
|
116
|
+
containerWidth,
|
|
155
117
|
onChange,
|
|
156
118
|
onRowClick,
|
|
157
119
|
onSelectionChange,
|
|
@@ -162,25 +124,43 @@ function useTableState(input) {
|
|
|
162
124
|
onExpandChange,
|
|
163
125
|
onCellChange,
|
|
164
126
|
onColumnOrderChange,
|
|
127
|
+
onColumnFixedChange,
|
|
165
128
|
onRowOrderChange,
|
|
166
129
|
onExport
|
|
167
130
|
} = input;
|
|
131
|
+
const sourceData = dataSource ?? EMPTY_TABLE_RECORDS;
|
|
132
|
+
const [internalData, setInternalData] = useState(null);
|
|
133
|
+
const prevSourceData = useRef(sourceData);
|
|
134
|
+
if (prevSourceData.current !== sourceData) {
|
|
135
|
+
prevSourceData.current = sourceData;
|
|
136
|
+
if (internalData !== null) {
|
|
137
|
+
setInternalData(null);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
const effectiveData = internalData ?? sourceData;
|
|
168
141
|
const isSortControlled = sort !== void 0;
|
|
169
142
|
const isFiltersControlled = filters !== void 0;
|
|
170
143
|
const isHiddenColumnsControlled = hiddenColumnKeys !== void 0;
|
|
171
|
-
const
|
|
144
|
+
const paginationMerged = mergeTablePagination(pagination);
|
|
145
|
+
const paginationConfig = paginationMerged === false ? null : paginationMerged;
|
|
172
146
|
const isCurrentPageControlled = paginationConfig?.current !== void 0;
|
|
173
147
|
const isPageSizeControlled = paginationConfig?.pageSize !== void 0;
|
|
174
|
-
const
|
|
175
|
-
|
|
148
|
+
const selectionControl = resolveTableKeyList(
|
|
149
|
+
rowSelection?.selectedRowKeys,
|
|
150
|
+
"rowSelection.selectedRowKeys"
|
|
151
|
+
);
|
|
152
|
+
const expandControl = resolveTableKeyList(
|
|
153
|
+
expandable?.expandedRowKeys,
|
|
154
|
+
"expandable.expandedRowKeys"
|
|
155
|
+
);
|
|
176
156
|
const [uncontrolledSortState, setUncontrolledSortState] = useState(
|
|
177
|
-
defaultSort ??
|
|
157
|
+
defaultSort ?? DEFAULT_TABLE_SORT
|
|
178
158
|
);
|
|
179
159
|
const [uncontrolledHiddenColumnKeys, setUncontrolledHiddenColumnKeys] = useState(
|
|
180
|
-
defaultHiddenColumnKeys ?? hiddenColumnKeys ??
|
|
160
|
+
defaultHiddenColumnKeys ?? hiddenColumnKeys ?? EMPTY_TABLE_HIDDEN_KEYS
|
|
181
161
|
);
|
|
182
162
|
const [uncontrolledFilterState, setUncontrolledFilterState] = useState(
|
|
183
|
-
defaultFilters ??
|
|
163
|
+
defaultFilters ?? EMPTY_TABLE_FILTERS
|
|
184
164
|
);
|
|
185
165
|
const [uncontrolledCurrentPage, setUncontrolledCurrentPage] = useState(
|
|
186
166
|
() => paginationConfig?.defaultCurrent ?? paginationConfig?.current ?? 1
|
|
@@ -188,84 +168,93 @@ function useTableState(input) {
|
|
|
188
168
|
const [uncontrolledCurrentPageSize, setUncontrolledCurrentPageSize] = useState(
|
|
189
169
|
() => paginationConfig?.defaultPageSize ?? paginationConfig?.pageSize ?? 10
|
|
190
170
|
);
|
|
191
|
-
const [uncontrolledSelectedRowKeys, setUncontrolledSelectedRowKeys] = useState(rowSelection?.defaultSelectedRowKeys ??
|
|
192
|
-
const [uncontrolledExpandedRowKeys, setUncontrolledExpandedRowKeys] = useState(expandable?.defaultExpandedRowKeys ??
|
|
171
|
+
const [uncontrolledSelectedRowKeys, setUncontrolledSelectedRowKeys] = useState(rowSelection?.defaultSelectedRowKeys ?? []);
|
|
172
|
+
const [uncontrolledExpandedRowKeys, setUncontrolledExpandedRowKeys] = useState(expandable?.defaultExpandedRowKeys ?? []);
|
|
173
|
+
const [columnOrder, setColumnOrder] = useState(null);
|
|
174
|
+
const [fixedOverrides, setFixedOverrides] = useState(
|
|
175
|
+
{}
|
|
176
|
+
);
|
|
193
177
|
const sortState = isSortControlled ? sort : uncontrolledSortState;
|
|
194
178
|
const effectiveHiddenColumnKeys = isHiddenColumnsControlled ? hiddenColumnKeys : uncontrolledHiddenColumnKeys;
|
|
195
179
|
const filterState = isFiltersControlled ? filters : uncontrolledFilterState;
|
|
196
180
|
const currentPage = isCurrentPageControlled ? paginationConfig.current : uncontrolledCurrentPage;
|
|
197
181
|
const currentPageSize = isPageSizeControlled ? paginationConfig.pageSize : uncontrolledCurrentPageSize;
|
|
198
|
-
const selectedRowKeys =
|
|
199
|
-
const expandedRowKeys =
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
182
|
+
const selectedRowKeys = selectionControl.controlled ? selectionControl.keys : uncontrolledSelectedRowKeys;
|
|
183
|
+
const expandedRowKeys = expandControl.controlled ? expandControl.keys : uncontrolledExpandedRowKeys;
|
|
184
|
+
const prevColumnKeys = useRef(columns.map((column) => column.key).join("\0"));
|
|
185
|
+
const columnKeysSignature = columns.map((column) => column.key).join("\0");
|
|
186
|
+
if (prevColumnKeys.current !== columnKeysSignature) {
|
|
187
|
+
prevColumnKeys.current = columnKeysSignature;
|
|
188
|
+
if (columnOrder !== null) {
|
|
189
|
+
setColumnOrder(null);
|
|
203
190
|
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
return map;
|
|
258
|
-
}, [displayColumns]);
|
|
259
|
-
const fixedColumnsInfo = useMemo(
|
|
260
|
-
() => getFixedColumnOffsets(displayColumns, measuredColumnWidths),
|
|
261
|
-
[displayColumns, measuredColumnWidths]
|
|
191
|
+
}
|
|
192
|
+
const view = useMemo(
|
|
193
|
+
() => resolveTableView({
|
|
194
|
+
columns,
|
|
195
|
+
dataSource: effectiveData,
|
|
196
|
+
hiddenColumnKeys: effectiveHiddenColumnKeys,
|
|
197
|
+
columnOrder: columnOrder ?? void 0,
|
|
198
|
+
fixedOverrides,
|
|
199
|
+
filters: filterState,
|
|
200
|
+
sort: sortState,
|
|
201
|
+
filterMode,
|
|
202
|
+
advancedFilterRules: advancedFilterRules ?? EMPTY_TABLE_FILTER_RULES,
|
|
203
|
+
groupBy,
|
|
204
|
+
pagination: paginationMerged,
|
|
205
|
+
currentPage,
|
|
206
|
+
currentPageSize,
|
|
207
|
+
rowKey,
|
|
208
|
+
getRowKey: rowSelection?.getRowKey,
|
|
209
|
+
rowSelection,
|
|
210
|
+
expandable,
|
|
211
|
+
selectedRowKeys,
|
|
212
|
+
measuredColumnWidths,
|
|
213
|
+
containerWidth
|
|
214
|
+
}),
|
|
215
|
+
[
|
|
216
|
+
columns,
|
|
217
|
+
effectiveData,
|
|
218
|
+
effectiveHiddenColumnKeys,
|
|
219
|
+
columnOrder,
|
|
220
|
+
fixedOverrides,
|
|
221
|
+
filterState,
|
|
222
|
+
sortState,
|
|
223
|
+
filterMode,
|
|
224
|
+
advancedFilterRules,
|
|
225
|
+
groupBy,
|
|
226
|
+
paginationMerged,
|
|
227
|
+
currentPage,
|
|
228
|
+
currentPageSize,
|
|
229
|
+
rowKey,
|
|
230
|
+
rowSelection,
|
|
231
|
+
expandable,
|
|
232
|
+
selectedRowKeys,
|
|
233
|
+
measuredColumnWidths,
|
|
234
|
+
containerWidth
|
|
235
|
+
]
|
|
236
|
+
);
|
|
237
|
+
const selectedRowKeySet = useMemo(
|
|
238
|
+
() => new Set(selectedRowKeys),
|
|
239
|
+
[selectedRowKeys]
|
|
240
|
+
);
|
|
241
|
+
const expandedRowKeySet = useMemo(
|
|
242
|
+
() => new Set(expandedRowKeys),
|
|
243
|
+
[expandedRowKeys]
|
|
262
244
|
);
|
|
263
245
|
const [frozenColumnWidths, setFrozenColumnWidths] = useState({});
|
|
264
246
|
useEffect(() => {
|
|
265
247
|
setFrozenColumnWidths(
|
|
266
|
-
(prev) => freezeTableColumnWidths(displayColumns, measuredColumnWidths ?? {}, prev)
|
|
248
|
+
(prev) => freezeTableColumnWidths(view.displayColumns, measuredColumnWidths ?? {}, prev)
|
|
267
249
|
);
|
|
268
|
-
}, [displayColumns, measuredColumnWidths]);
|
|
250
|
+
}, [view.displayColumns, measuredColumnWidths]);
|
|
251
|
+
function emitChange(next) {
|
|
252
|
+
onChange?.({
|
|
253
|
+
sort: next.sort ?? sortState,
|
|
254
|
+
filters: next.filters ?? filterState,
|
|
255
|
+
pagination: next.pagination !== void 0 ? next.pagination : paginationMerged !== false ? { current: currentPage, pageSize: currentPageSize } : null
|
|
256
|
+
});
|
|
257
|
+
}
|
|
269
258
|
function handleSetHiddenColumns(hiddenKeys) {
|
|
270
259
|
if (!isHiddenColumnsControlled) {
|
|
271
260
|
setUncontrolledHiddenColumnKeys(hiddenKeys);
|
|
@@ -273,123 +262,73 @@ function useTableState(input) {
|
|
|
273
262
|
onHiddenColumnKeysChange?.(hiddenKeys);
|
|
274
263
|
}
|
|
275
264
|
function toggleColumnLock(columnKey) {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
265
|
+
const original = columns.find((column) => column.key === columnKey)?.fixed;
|
|
266
|
+
const current = Object.prototype.hasOwnProperty.call(fixedOverrides, columnKey) ? fixedOverrides[columnKey] : original;
|
|
267
|
+
const nextFixed = getNextTableColumnFixed(current, original);
|
|
268
|
+
const nextOverrides = { ...fixedOverrides, [columnKey]: nextFixed };
|
|
269
|
+
setFixedOverrides(nextOverrides);
|
|
270
|
+
const fullColumns = applyTableColumnOrder(columns, columnOrder ?? void 0).map(
|
|
271
|
+
(column) => column.key === columnKey ? { ...column, fixed: nextFixed } : column
|
|
272
|
+
);
|
|
273
|
+
onColumnFixedChange?.(columnKey, nextFixed, fullColumns);
|
|
285
274
|
}
|
|
286
|
-
const processedData = useMemo(() => {
|
|
287
|
-
let data = dataSource;
|
|
288
|
-
if (filterMode === "advanced" && advancedFilterRules.length > 0) {
|
|
289
|
-
data = filterDataAdvanced(data, advancedFilterRules);
|
|
290
|
-
} else {
|
|
291
|
-
data = filterTableData(data, columns, filterState);
|
|
292
|
-
}
|
|
293
|
-
if (sortState.key && sortState.direction) {
|
|
294
|
-
const column = columnByKey[sortState.key];
|
|
295
|
-
data = sortData(data, sortState.key, sortState.direction, column?.sortFn, columns);
|
|
296
|
-
}
|
|
297
|
-
return data;
|
|
298
|
-
}, [dataSource, columns, filterState, sortState, columnByKey, filterMode, advancedFilterRules]);
|
|
299
|
-
const paginatedData = useMemo(() => {
|
|
300
|
-
if (pagination === false) {
|
|
301
|
-
return processedData;
|
|
302
|
-
}
|
|
303
|
-
if (paginationConfig?.remote) {
|
|
304
|
-
return processedData;
|
|
305
|
-
}
|
|
306
|
-
return paginateData(processedData, currentPage, currentPageSize);
|
|
307
|
-
}, [processedData, currentPage, currentPageSize, pagination, paginationConfig?.remote]);
|
|
308
|
-
const pageRowKeys = useMemo(
|
|
309
|
-
() => createTableRowKeyCache(rowKey).getMany(paginatedData),
|
|
310
|
-
[paginatedData, rowKey]
|
|
311
|
-
);
|
|
312
|
-
const selectedRowKeySet = useMemo(
|
|
313
|
-
() => new Set(selectedRowKeys),
|
|
314
|
-
[selectedRowKeys]
|
|
315
|
-
);
|
|
316
|
-
const expandedRowKeySet = useMemo(
|
|
317
|
-
() => new Set(expandedRowKeys),
|
|
318
|
-
[expandedRowKeys]
|
|
319
|
-
);
|
|
320
|
-
const paginationInfo = useMemo(() => {
|
|
321
|
-
if (pagination === false) {
|
|
322
|
-
return null;
|
|
323
|
-
}
|
|
324
|
-
const total = paginationConfig?.total !== void 0 && paginationConfig.total > 0 ? paginationConfig.total : processedData.length;
|
|
325
|
-
return calculatePagination(total, currentPage, currentPageSize);
|
|
326
|
-
}, [processedData.length, currentPage, currentPageSize, pagination, paginationConfig?.total]);
|
|
327
275
|
function handleSetSort(newSortState) {
|
|
328
276
|
if (!isSortControlled) {
|
|
329
277
|
setUncontrolledSortState(newSortState);
|
|
330
278
|
}
|
|
331
279
|
onSortChange?.(newSortState);
|
|
332
|
-
|
|
333
|
-
sort: newSortState,
|
|
334
|
-
filters: filterState,
|
|
335
|
-
pagination: pagination !== false ? { current: currentPage, pageSize: currentPageSize } : null
|
|
336
|
-
});
|
|
280
|
+
emitChange({ sort: newSortState });
|
|
337
281
|
}
|
|
338
282
|
function handleSort(columnKey) {
|
|
339
|
-
const column =
|
|
283
|
+
const column = view.displayColumns.find((item) => item.key === columnKey);
|
|
340
284
|
if (!column || !column.sortable) return;
|
|
341
|
-
|
|
342
|
-
if (sortState.key === columnKey) {
|
|
343
|
-
if (sortState.direction === "asc") {
|
|
344
|
-
newDirection = "desc";
|
|
345
|
-
} else if (sortState.direction === "desc") {
|
|
346
|
-
newDirection = null;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
handleSetSort({
|
|
350
|
-
key: newDirection ? columnKey : null,
|
|
351
|
-
direction: newDirection
|
|
352
|
-
});
|
|
285
|
+
handleSetSort(getNextTableSortState(sortState, columnKey));
|
|
353
286
|
}
|
|
354
287
|
function handleFilter(columnKey, value) {
|
|
355
|
-
const newFilterState =
|
|
288
|
+
const newFilterState = mergeTableFilterValue(filterState, columnKey, value);
|
|
356
289
|
if (!isFiltersControlled) {
|
|
357
290
|
setUncontrolledFilterState(newFilterState);
|
|
358
291
|
}
|
|
359
|
-
|
|
292
|
+
if (!isCurrentPageControlled) {
|
|
293
|
+
setUncontrolledCurrentPage(1);
|
|
294
|
+
} else if (shouldWarnControlledPageReset(true, currentPage)) {
|
|
295
|
+
devWarn(
|
|
296
|
+
"Table.filter.page",
|
|
297
|
+
"Table filter reset pagination.current to 1; the controlled current page was not written back"
|
|
298
|
+
);
|
|
299
|
+
}
|
|
360
300
|
onFilterChange?.(newFilterState);
|
|
361
|
-
|
|
362
|
-
|
|
301
|
+
if (paginationMerged !== false) {
|
|
302
|
+
onPageChange?.({ current: 1, pageSize: currentPageSize });
|
|
303
|
+
}
|
|
304
|
+
emitChange({
|
|
363
305
|
filters: newFilterState,
|
|
364
|
-
pagination:
|
|
306
|
+
pagination: paginationMerged !== false ? { current: 1, pageSize: currentPageSize } : null
|
|
365
307
|
});
|
|
366
308
|
}
|
|
367
309
|
function handlePageChange(page) {
|
|
368
|
-
|
|
310
|
+
if (!isCurrentPageControlled) {
|
|
311
|
+
setUncontrolledCurrentPage(page);
|
|
312
|
+
}
|
|
369
313
|
onPageChange?.({ current: page, pageSize: currentPageSize });
|
|
370
|
-
|
|
371
|
-
sort: sortState,
|
|
372
|
-
filters: filterState,
|
|
373
|
-
pagination: { current: page, pageSize: currentPageSize }
|
|
374
|
-
});
|
|
314
|
+
emitChange({ pagination: { current: page, pageSize: currentPageSize } });
|
|
375
315
|
}
|
|
376
316
|
function handlePageSizeChange(pageSize) {
|
|
377
|
-
|
|
378
|
-
|
|
317
|
+
if (!isPageSizeControlled) {
|
|
318
|
+
setUncontrolledCurrentPageSize(pageSize);
|
|
319
|
+
}
|
|
320
|
+
if (!isCurrentPageControlled) {
|
|
321
|
+
setUncontrolledCurrentPage(1);
|
|
322
|
+
}
|
|
379
323
|
onPageChange?.({ current: 1, pageSize });
|
|
380
|
-
|
|
381
|
-
sort: sortState,
|
|
382
|
-
filters: filterState,
|
|
383
|
-
pagination: { current: 1, pageSize }
|
|
384
|
-
});
|
|
324
|
+
emitChange({ pagination: { current: 1, pageSize } });
|
|
385
325
|
}
|
|
386
326
|
function handleToggleExpand(key, record) {
|
|
387
|
-
const
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
setUncontrolledExpandedRowKeys(newKeys);
|
|
327
|
+
const next = getNextTableExpandKeys(expandedRowKeys, key);
|
|
328
|
+
if (!expandControl.controlled) {
|
|
329
|
+
setUncontrolledExpandedRowKeys(next.keys);
|
|
391
330
|
}
|
|
392
|
-
onExpandChange?.(
|
|
331
|
+
onExpandChange?.(next.keys, record, next.expanded);
|
|
393
332
|
}
|
|
394
333
|
function handleRowClick(record, index, key) {
|
|
395
334
|
onRowClick?.(record, index);
|
|
@@ -401,43 +340,24 @@ function useTableState(input) {
|
|
|
401
340
|
}
|
|
402
341
|
}
|
|
403
342
|
function handleSelectRow(key, checked) {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
newKeys = selectedRowKeys.filter((k) => k !== key);
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
if (!isSelectionControlled) {
|
|
343
|
+
const newKeys = getNextTableSelectRowKeys({
|
|
344
|
+
selectedRowKeys,
|
|
345
|
+
key,
|
|
346
|
+
checked,
|
|
347
|
+
type: rowSelection?.type
|
|
348
|
+
});
|
|
349
|
+
if (!selectionControl.controlled) {
|
|
415
350
|
setUncontrolledSelectedRowKeys(newKeys);
|
|
416
351
|
}
|
|
417
352
|
onSelectionChange?.(newKeys);
|
|
418
353
|
}
|
|
419
|
-
const selectionState = useMemo(
|
|
420
|
-
() => getTableSelectionState({
|
|
421
|
-
records: paginatedData,
|
|
422
|
-
rowKeys: pageRowKeys,
|
|
423
|
-
selectedRowKeys,
|
|
424
|
-
getCheckboxProps: rowSelection?.getCheckboxProps
|
|
425
|
-
}),
|
|
426
|
-
[paginatedData, pageRowKeys, selectedRowKeys, rowSelection]
|
|
427
|
-
);
|
|
428
354
|
function handleSelectAll(checked) {
|
|
429
|
-
const newKeys = getNextTableSelectAllKeys(
|
|
430
|
-
|
|
431
|
-
selectionState.selectableRowKeys,
|
|
432
|
-
checked
|
|
433
|
-
);
|
|
434
|
-
if (!isSelectionControlled) {
|
|
355
|
+
const newKeys = getNextTableSelectAllKeys(selectedRowKeys, view.selectableRowKeys, checked);
|
|
356
|
+
if (!selectionControl.controlled) {
|
|
435
357
|
setUncontrolledSelectedRowKeys(newKeys);
|
|
436
358
|
}
|
|
437
359
|
onSelectionChange?.(newKeys);
|
|
438
360
|
}
|
|
439
|
-
const allSelected = selectionState.allSelected;
|
|
440
|
-
const someSelected = selectionState.someSelected;
|
|
441
361
|
const [editingCell, setEditingCell] = useState(
|
|
442
362
|
null
|
|
443
363
|
);
|
|
@@ -445,24 +365,26 @@ function useTableState(input) {
|
|
|
445
365
|
function isCellEditable(columnKey, rowIndex) {
|
|
446
366
|
if (!editable) return false;
|
|
447
367
|
if (!editableCells) return true;
|
|
448
|
-
return
|
|
368
|
+
return editableCells[columnKey]?.includes(rowIndex) === true;
|
|
449
369
|
}
|
|
450
370
|
function startEditing(rowIndex, columnKey, currentValue) {
|
|
451
371
|
setEditingCell({ rowIndex, columnKey });
|
|
452
372
|
setEditingValue(String(currentValue ?? ""));
|
|
453
373
|
}
|
|
454
374
|
function commitEdit() {
|
|
455
|
-
if (editingCell)
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
375
|
+
if (!editingCell) return;
|
|
376
|
+
const column = columns.find((item) => item.key === editingCell.columnKey);
|
|
377
|
+
const nextData = commitTableCellEdit(effectiveData, editingCell.rowIndex, column, editingValue);
|
|
378
|
+
setInternalData(nextData);
|
|
379
|
+
onCellChange?.(editingCell.rowIndex, editingCell.columnKey, editingValue);
|
|
380
|
+
setEditingCell(null);
|
|
459
381
|
}
|
|
460
382
|
function cancelEdit() {
|
|
461
383
|
setEditingCell(null);
|
|
462
384
|
}
|
|
463
385
|
function handleExport() {
|
|
464
|
-
const content = exportTableData(displayColumns, processedData
|
|
465
|
-
downloadTableExport(content, exportFilename
|
|
386
|
+
const content = exportTableData(view.displayColumns, view.processedData);
|
|
387
|
+
downloadTableExport(content, exportFilename);
|
|
466
388
|
onExport?.(content);
|
|
467
389
|
}
|
|
468
390
|
const [dragColumnKey, setDragColumnKey] = useState(null);
|
|
@@ -471,14 +393,10 @@ function useTableState(input) {
|
|
|
471
393
|
}
|
|
472
394
|
function handleDrop(targetKey) {
|
|
473
395
|
if (!dragColumnKey || dragColumnKey === targetKey) return;
|
|
474
|
-
const
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
const [moved] = cols.splice(fromIdx, 1);
|
|
479
|
-
cols.splice(toIdx, 0, moved);
|
|
480
|
-
onColumnOrderChange?.(cols);
|
|
481
|
-
}
|
|
396
|
+
const fullColumns = applyTableColumnOrder(columns, columnOrder ?? void 0);
|
|
397
|
+
const nextColumns = reorderTableColumnsByKey(fullColumns, dragColumnKey, targetKey);
|
|
398
|
+
setColumnOrder(nextColumns.map((column) => column.key));
|
|
399
|
+
onColumnOrderChange?.(nextColumns);
|
|
482
400
|
setDragColumnKey(null);
|
|
483
401
|
}
|
|
484
402
|
const [dragRowKey, setDragRowKey] = useState(null);
|
|
@@ -487,36 +405,34 @@ function useTableState(input) {
|
|
|
487
405
|
}
|
|
488
406
|
function handleRowDrop(targetKey) {
|
|
489
407
|
if (dragRowKey === null || dragRowKey === targetKey) return;
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
408
|
+
const nextRows = reorderTableRowsByKey(
|
|
409
|
+
effectiveData,
|
|
410
|
+
dragRowKey,
|
|
411
|
+
targetKey,
|
|
412
|
+
(record, sourceIndex) => resolveTableRecordKey(record, sourceIndex, rowKey, rowSelection?.getRowKey)
|
|
413
|
+
);
|
|
414
|
+
setInternalData(nextRows);
|
|
415
|
+
onRowOrderChange?.(nextRows);
|
|
498
416
|
setDragRowKey(null);
|
|
499
417
|
}
|
|
500
|
-
const groupedData = useMemo(() => {
|
|
501
|
-
if (!groupBy) return null;
|
|
502
|
-
return groupDataByColumn(paginatedData, groupBy);
|
|
503
|
-
}, [groupBy, paginatedData]);
|
|
504
418
|
return {
|
|
505
|
-
paginationConfig,
|
|
506
|
-
displayColumns,
|
|
507
|
-
fixedColumnsInfo,
|
|
419
|
+
paginationConfig: view.paginationConfig ?? paginationConfig,
|
|
420
|
+
displayColumns: view.displayColumns,
|
|
421
|
+
fixedColumnsInfo: view.fixedColumnsInfo,
|
|
508
422
|
frozenColumnWidths,
|
|
509
|
-
processedData,
|
|
510
|
-
paginatedData,
|
|
511
|
-
pageRowKeys,
|
|
423
|
+
processedData: view.processedData,
|
|
424
|
+
paginatedData: view.paginatedData,
|
|
425
|
+
pageRowKeys: view.pageRowKeys,
|
|
426
|
+
pageSourceIndices: view.pageSourceIndices,
|
|
512
427
|
selectedRowKeySet,
|
|
513
428
|
expandedRowKeySet,
|
|
514
|
-
totalColumnCount,
|
|
515
|
-
paginationInfo,
|
|
516
|
-
allSelected,
|
|
517
|
-
someSelected,
|
|
518
|
-
groupedData,
|
|
429
|
+
totalColumnCount: view.totalColumnCount,
|
|
430
|
+
paginationInfo: view.paginationInfo,
|
|
431
|
+
allSelected: view.allSelected,
|
|
432
|
+
someSelected: view.someSelected,
|
|
433
|
+
groupedData: view.groupedData,
|
|
519
434
|
sortState,
|
|
435
|
+
filterState,
|
|
520
436
|
currentPage,
|
|
521
437
|
currentPageSize,
|
|
522
438
|
hiddenColumnKeys: effectiveHiddenColumnKeys,
|
|
@@ -547,18 +463,78 @@ function useTableState(input) {
|
|
|
547
463
|
}
|
|
548
464
|
|
|
549
465
|
// src/components/Table/render-header.tsx
|
|
466
|
+
import React from "react";
|
|
550
467
|
import {
|
|
551
468
|
classNames,
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
getTableFixedHeaderCellClasses,
|
|
555
|
-
getFixedColumnStyle,
|
|
469
|
+
formatTableFilterColumnAriaLabel,
|
|
470
|
+
formatTableSortByText,
|
|
556
471
|
getCheckboxCellClasses,
|
|
557
472
|
getExpandIconCellClasses,
|
|
558
|
-
|
|
473
|
+
getFixedColumnStyle,
|
|
474
|
+
getInputClasses,
|
|
475
|
+
getTableChromeSlots,
|
|
476
|
+
getTableFixedHeaderCellClasses,
|
|
477
|
+
getTableHeaderCellClasses,
|
|
478
|
+
getTableHeaderClasses,
|
|
479
|
+
hasTableSelectionColumn,
|
|
480
|
+
resolveTableExpandSlot,
|
|
559
481
|
tableSortButtonClasses
|
|
560
482
|
} from "@expcat/tigercat-core";
|
|
483
|
+
|
|
484
|
+
// src/components/Table/icons.tsx
|
|
485
|
+
import {
|
|
486
|
+
getSortIconClasses,
|
|
487
|
+
getExpandIconClasses,
|
|
488
|
+
icon16ViewBox,
|
|
489
|
+
icon24ViewBox,
|
|
490
|
+
sortAscIcon16PathD,
|
|
491
|
+
sortDescIcon16PathD,
|
|
492
|
+
sortBothIcon16PathD,
|
|
493
|
+
expandChevronIcon16PathD,
|
|
494
|
+
lockClosedIcon24PathD,
|
|
495
|
+
lockOpenIcon24PathD
|
|
496
|
+
} from "@expcat/tigercat-core";
|
|
497
|
+
import { jsx } from "react/jsx-runtime";
|
|
498
|
+
var SortIcon = ({ direction }) => {
|
|
499
|
+
const active = direction !== null;
|
|
500
|
+
const pathD = direction === "asc" ? sortAscIcon16PathD : direction === "desc" ? sortDescIcon16PathD : sortBothIcon16PathD;
|
|
501
|
+
return /* @__PURE__ */ jsx(
|
|
502
|
+
"svg",
|
|
503
|
+
{
|
|
504
|
+
className: getSortIconClasses(active),
|
|
505
|
+
width: "16",
|
|
506
|
+
height: "16",
|
|
507
|
+
viewBox: icon16ViewBox,
|
|
508
|
+
fill: "currentColor",
|
|
509
|
+
"aria-hidden": "true",
|
|
510
|
+
children: /* @__PURE__ */ jsx("path", { d: pathD })
|
|
511
|
+
}
|
|
512
|
+
);
|
|
513
|
+
};
|
|
514
|
+
var LockIcon = ({ locked }) => {
|
|
515
|
+
return /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: icon24ViewBox, fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: locked ? lockClosedIcon24PathD : lockOpenIcon24PathD }) });
|
|
516
|
+
};
|
|
517
|
+
var ExpandIcon = ({ expanded }) => {
|
|
518
|
+
return /* @__PURE__ */ jsx(
|
|
519
|
+
"svg",
|
|
520
|
+
{
|
|
521
|
+
className: getExpandIconClasses(expanded),
|
|
522
|
+
width: "16",
|
|
523
|
+
height: "16",
|
|
524
|
+
viewBox: icon16ViewBox,
|
|
525
|
+
fill: "currentColor",
|
|
526
|
+
"aria-hidden": "true",
|
|
527
|
+
children: /* @__PURE__ */ jsx("path", { d: expandChevronIcon16PathD })
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
// src/components/Table/render-header.tsx
|
|
561
533
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
534
|
+
function isHeaderSortClickTarget(target) {
|
|
535
|
+
if (!(target instanceof Element)) return false;
|
|
536
|
+
return Boolean(target.closest("[data-tiger-table-filter], button:not([data-tiger-table-sort])"));
|
|
537
|
+
}
|
|
562
538
|
function renderTableHeader(ctx, view) {
|
|
563
539
|
const {
|
|
564
540
|
size,
|
|
@@ -571,22 +547,26 @@ function renderTableHeader(ctx, view) {
|
|
|
571
547
|
unlockColumnAriaLabel,
|
|
572
548
|
labels
|
|
573
549
|
} = view;
|
|
574
|
-
const
|
|
575
|
-
|
|
550
|
+
const chrome = getTableChromeSlots({
|
|
551
|
+
hasSelectionColumn: hasTableSelectionColumn(rowSelection),
|
|
552
|
+
expand: resolveTableExpandSlot(expandable)
|
|
553
|
+
});
|
|
554
|
+
const expandHeaderTh = /* @__PURE__ */ jsx2("th", { className: getExpandIconCellClasses(size), "aria-hidden": "true" });
|
|
555
|
+
const selectionHeaderTh = rowSelection?.type === "radio" ? /* @__PURE__ */ jsx2("th", { className: getCheckboxCellClasses(size), "aria-hidden": "true" }) : /* @__PURE__ */ jsx2("th", { className: getCheckboxCellClasses(size), children: /* @__PURE__ */ jsx2(
|
|
556
|
+
Checkbox,
|
|
557
|
+
{
|
|
558
|
+
size: "sm",
|
|
559
|
+
checked: ctx.allSelected,
|
|
560
|
+
indeterminate: ctx.someSelected,
|
|
561
|
+
"aria-label": labels.selectAllText,
|
|
562
|
+
onChange: (checked) => ctx.handleSelectAll(checked)
|
|
563
|
+
}
|
|
564
|
+
) });
|
|
565
|
+
function renderChromeTh(slot) {
|
|
566
|
+
return slot === "expand" ? expandHeaderTh : selectionHeaderTh;
|
|
567
|
+
}
|
|
576
568
|
return /* @__PURE__ */ jsx2("thead", { className: getTableHeaderClasses(stickyHeader), children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
577
|
-
|
|
578
|
-
rowSelection && rowSelection.showCheckbox !== false && rowSelection.type !== "radio" && /* @__PURE__ */ jsx2("th", { className: getCheckboxCellClasses(size), children: /* @__PURE__ */ jsx2(
|
|
579
|
-
"input",
|
|
580
|
-
{
|
|
581
|
-
type: "checkbox",
|
|
582
|
-
className: "rounded border-gray-300 text-[var(--tiger-primary,#2563eb)] focus:ring-[var(--tiger-primary,#2563eb)]",
|
|
583
|
-
checked: ctx.allSelected,
|
|
584
|
-
ref: (el) => {
|
|
585
|
-
if (el) el.indeterminate = ctx.someSelected;
|
|
586
|
-
},
|
|
587
|
-
onChange: (e) => ctx.handleSelectAll(e.target.checked)
|
|
588
|
-
}
|
|
589
|
-
) }),
|
|
569
|
+
chrome.leading.map((slot) => /* @__PURE__ */ jsx2(React.Fragment, { children: renderChromeTh(slot) }, slot)),
|
|
590
570
|
ctx.displayColumns.map((column) => {
|
|
591
571
|
const isSorted = ctx.sortState.key === column.key;
|
|
592
572
|
const sortDirection = isSorted ? ctx.sortState.direction : null;
|
|
@@ -597,9 +577,12 @@ function renderTableHeader(ctx, view) {
|
|
|
597
577
|
} : void 0;
|
|
598
578
|
const style = fixedStyle ? { ...widthStyle, ...fixedStyle } : widthStyle;
|
|
599
579
|
const titleNode = column.renderHeader ? column.renderHeader() : column.title;
|
|
580
|
+
const filterValue = ctx.filterState[column.key];
|
|
581
|
+
const filterText = filterValue == null ? "" : String(filterValue);
|
|
600
582
|
return /* @__PURE__ */ jsxs(
|
|
601
583
|
"th",
|
|
602
584
|
{
|
|
585
|
+
scope: "col",
|
|
603
586
|
"data-tiger-table-column-key": column.key,
|
|
604
587
|
"aria-sort": ariaSort,
|
|
605
588
|
className: classNames(
|
|
@@ -618,6 +601,10 @@ function renderTableHeader(ctx, view) {
|
|
|
618
601
|
),
|
|
619
602
|
style,
|
|
620
603
|
draggable: columnDraggable ? true : void 0,
|
|
604
|
+
onClick: column.sortable ? (event) => {
|
|
605
|
+
if (isHeaderSortClickTarget(event.target)) return;
|
|
606
|
+
ctx.handleSort(column.key);
|
|
607
|
+
} : void 0,
|
|
621
608
|
onDragStart: columnDraggable ? () => ctx.handleDragStart(column.key) : void 0,
|
|
622
609
|
onDragOver: columnDraggable ? (e) => e.preventDefault() : void 0,
|
|
623
610
|
onDrop: columnDraggable ? () => ctx.handleDrop(column.key) : void 0,
|
|
@@ -629,7 +616,11 @@ function renderTableHeader(ctx, view) {
|
|
|
629
616
|
type: "button",
|
|
630
617
|
"data-tiger-table-sort": "",
|
|
631
618
|
className: tableSortButtonClasses,
|
|
632
|
-
|
|
619
|
+
"aria-label": formatTableSortByText(labels.sortByText, String(column.title)),
|
|
620
|
+
onClick: (event) => {
|
|
621
|
+
event.stopPropagation();
|
|
622
|
+
ctx.handleSort(column.key);
|
|
623
|
+
},
|
|
633
624
|
children: [
|
|
634
625
|
titleNode,
|
|
635
626
|
/* @__PURE__ */ jsx2(SortIcon, { direction: sortDirection })
|
|
@@ -646,7 +637,7 @@ function renderTableHeader(ctx, view) {
|
|
|
646
637
|
),
|
|
647
638
|
className: classNames(
|
|
648
639
|
"inline-flex items-center",
|
|
649
|
-
column.fixed === "left" || column.fixed === "right" ? "text-[var(--tiger-primary,#2563eb)]" : "text-
|
|
640
|
+
column.fixed === "left" || column.fixed === "right" ? "text-[var(--tiger-primary,#2563eb)]" : "text-[var(--tiger-text-muted,#6b7280)] hover:text-[var(--tiger-text,#111827)]"
|
|
650
641
|
),
|
|
651
642
|
onClick: (e) => {
|
|
652
643
|
e.stopPropagation();
|
|
@@ -656,38 +647,60 @@ function renderTableHeader(ctx, view) {
|
|
|
656
647
|
}
|
|
657
648
|
)
|
|
658
649
|
] }),
|
|
659
|
-
column.filter && /* @__PURE__ */ jsx2(
|
|
660
|
-
"
|
|
650
|
+
column.filter && /* @__PURE__ */ jsx2(
|
|
651
|
+
"div",
|
|
661
652
|
{
|
|
662
|
-
className: "
|
|
663
|
-
|
|
653
|
+
className: "mt-2",
|
|
654
|
+
"data-tiger-table-filter": "",
|
|
655
|
+
draggable: false,
|
|
664
656
|
onClick: (e) => e.stopPropagation(),
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
657
|
+
onDragStart: (e) => {
|
|
658
|
+
e.preventDefault();
|
|
659
|
+
e.stopPropagation();
|
|
660
|
+
},
|
|
661
|
+
children: column.filter.type === "select" && column.filter.options ? /* @__PURE__ */ jsxs(
|
|
662
|
+
"select",
|
|
663
|
+
{
|
|
664
|
+
className: getInputClasses({ size: "sm" }),
|
|
665
|
+
"aria-label": formatTableFilterColumnAriaLabel(
|
|
666
|
+
labels.filterColumnAriaLabel,
|
|
667
|
+
String(column.title)
|
|
668
|
+
),
|
|
669
|
+
value: filterText,
|
|
670
|
+
draggable: false,
|
|
671
|
+
onChange: (e) => ctx.handleFilter(column.key, e.target.value),
|
|
672
|
+
children: [
|
|
673
|
+
/* @__PURE__ */ jsx2("option", { value: "", children: labels.allText }),
|
|
674
|
+
column.filter.options.map((opt) => /* @__PURE__ */ jsx2("option", { value: opt.value, children: opt.label }, String(opt.value)))
|
|
675
|
+
]
|
|
676
|
+
}
|
|
677
|
+
) : /* @__PURE__ */ jsx2(
|
|
678
|
+
Input,
|
|
679
|
+
{
|
|
680
|
+
size: "sm",
|
|
681
|
+
value: filterText,
|
|
682
|
+
"aria-label": formatTableFilterColumnAriaLabel(
|
|
683
|
+
labels.filterColumnAriaLabel,
|
|
684
|
+
String(column.title)
|
|
685
|
+
),
|
|
686
|
+
placeholder: column.filter.placeholder || labels.filterPlaceholder,
|
|
687
|
+
draggable: false,
|
|
688
|
+
onChange: (e) => ctx.handleFilter(column.key, e.target.value)
|
|
689
|
+
}
|
|
690
|
+
)
|
|
678
691
|
}
|
|
679
|
-
)
|
|
692
|
+
)
|
|
680
693
|
]
|
|
681
694
|
},
|
|
682
695
|
column.key
|
|
683
696
|
);
|
|
684
697
|
}),
|
|
685
|
-
|
|
698
|
+
chrome.trailing.map((slot) => /* @__PURE__ */ jsx2(React.Fragment, { children: renderChromeTh(slot) }, slot))
|
|
686
699
|
] }) });
|
|
687
700
|
}
|
|
688
701
|
|
|
689
702
|
// src/components/Table/render-body.tsx
|
|
690
|
-
import
|
|
703
|
+
import React2 from "react";
|
|
691
704
|
import {
|
|
692
705
|
classNames as classNames2,
|
|
693
706
|
isActivationKey,
|
|
@@ -703,7 +716,13 @@ import {
|
|
|
703
716
|
getEditableCellClasses,
|
|
704
717
|
editableCellInputClasses,
|
|
705
718
|
tableGroupHeaderClasses,
|
|
706
|
-
getGroupHeaderCellClasses
|
|
719
|
+
getGroupHeaderCellClasses,
|
|
720
|
+
getTableChromeSlots as getTableChromeSlots2,
|
|
721
|
+
hasTableSelectionColumn as hasTableSelectionColumn2,
|
|
722
|
+
resolveTableExpandSlot as resolveTableExpandSlot2,
|
|
723
|
+
formatTableSelectRowAriaLabel,
|
|
724
|
+
formatTableGroupHeaderText,
|
|
725
|
+
tableVirtualSpacerCellClasses
|
|
707
726
|
} from "@expcat/tigercat-core";
|
|
708
727
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
709
728
|
function renderTableBody(ctx, view) {
|
|
@@ -719,8 +738,14 @@ function renderTableBody(ctx, view) {
|
|
|
719
738
|
rowClassName,
|
|
720
739
|
rowDraggable,
|
|
721
740
|
interactiveRows,
|
|
722
|
-
virtualWindow
|
|
741
|
+
virtualWindow,
|
|
742
|
+
selectionName
|
|
723
743
|
} = view;
|
|
744
|
+
const hasRowControls = hasTableSelectionColumn2(rowSelection) || Boolean(expandable);
|
|
745
|
+
const chrome = getTableChromeSlots2({
|
|
746
|
+
hasSelectionColumn: hasTableSelectionColumn2(rowSelection),
|
|
747
|
+
expand: resolveTableExpandSlot2(expandable)
|
|
748
|
+
});
|
|
724
749
|
if (loading) {
|
|
725
750
|
return null;
|
|
726
751
|
}
|
|
@@ -732,12 +757,14 @@ function renderTableBody(ctx, view) {
|
|
|
732
757
|
"tr[data-tiger-table-row-index]"
|
|
733
758
|
);
|
|
734
759
|
if (!row) return null;
|
|
735
|
-
const
|
|
736
|
-
if (!Number.isInteger(
|
|
737
|
-
const
|
|
738
|
-
|
|
760
|
+
const sourceIndex = Number(row.dataset.tigerTableRowIndex);
|
|
761
|
+
if (!Number.isInteger(sourceIndex)) return null;
|
|
762
|
+
const pageIndex = ctx.pageSourceIndices.indexOf(sourceIndex);
|
|
763
|
+
if (pageIndex < 0) return null;
|
|
764
|
+
const record = ctx.paginatedData[pageIndex];
|
|
765
|
+
const key = ctx.pageRowKeys[pageIndex];
|
|
739
766
|
if (!record || key === void 0) return null;
|
|
740
|
-
return { key, record, index };
|
|
767
|
+
return { key, record, index: sourceIndex };
|
|
741
768
|
}
|
|
742
769
|
function handleBodyClick(event) {
|
|
743
770
|
const row = getDelegatedRow(event);
|
|
@@ -761,12 +788,13 @@ function renderTableBody(ctx, view) {
|
|
|
761
788
|
ctx.handleRowDrop(row.key);
|
|
762
789
|
}
|
|
763
790
|
function renderDataRow(record, index) {
|
|
791
|
+
const sourceIndex = ctx.pageSourceIndices[index] ?? index;
|
|
764
792
|
const key = ctx.pageRowKeys[index];
|
|
765
793
|
const isSelected = ctx.selectedRowKeySet.has(key);
|
|
766
794
|
const isExpanded = ctx.expandedRowKeySet.has(key);
|
|
767
795
|
const isRowExpandable = expandable ? expandable.rowExpandable ? expandable.rowExpandable(record) : true : false;
|
|
768
|
-
const rowClass = typeof rowClassName === "function" ? rowClassName(record,
|
|
769
|
-
const expandToggleCell =
|
|
796
|
+
const rowClass = typeof rowClassName === "function" ? rowClassName(record, sourceIndex) : rowClassName;
|
|
797
|
+
const expandToggleCell = /* @__PURE__ */ jsx3("td", { className: getExpandIconCellClasses2(size), children: isRowExpandable && /* @__PURE__ */ jsx3(
|
|
770
798
|
"button",
|
|
771
799
|
{
|
|
772
800
|
type: "button",
|
|
@@ -779,39 +807,53 @@ function renderTableBody(ctx, view) {
|
|
|
779
807
|
},
|
|
780
808
|
children: /* @__PURE__ */ jsx3(ExpandIcon, { expanded: isExpanded })
|
|
781
809
|
}
|
|
782
|
-
) })
|
|
783
|
-
const
|
|
810
|
+
) });
|
|
811
|
+
const selectionCell = /* @__PURE__ */ jsx3("td", { className: getCheckboxCellClasses2(size), onClick: (e) => e.stopPropagation(), children: rowSelection?.type === "radio" ? /* @__PURE__ */ jsx3(
|
|
812
|
+
Radio,
|
|
813
|
+
{
|
|
814
|
+
size: "sm",
|
|
815
|
+
name: selectionName,
|
|
816
|
+
value: key,
|
|
817
|
+
checked: isSelected,
|
|
818
|
+
disabled: rowSelection?.getCheckboxProps?.(record)?.disabled,
|
|
819
|
+
"aria-label": formatTableSelectRowAriaLabel(labels.selectRowAriaLabel, sourceIndex + 1),
|
|
820
|
+
onChange: (checked) => {
|
|
821
|
+
if (checked) ctx.handleSelectRow(key, true);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
) : /* @__PURE__ */ jsx3(
|
|
825
|
+
Checkbox,
|
|
826
|
+
{
|
|
827
|
+
size: "sm",
|
|
828
|
+
checked: isSelected,
|
|
829
|
+
disabled: rowSelection?.getCheckboxProps?.(record)?.disabled,
|
|
830
|
+
"aria-label": formatTableSelectRowAriaLabel(labels.selectRowAriaLabel, sourceIndex + 1),
|
|
831
|
+
onChange: (checked) => ctx.handleSelectRow(key, checked)
|
|
832
|
+
}
|
|
833
|
+
) });
|
|
834
|
+
function renderChromeTd(slot) {
|
|
835
|
+
return slot === "expand" ? expandToggleCell : selectionCell;
|
|
836
|
+
}
|
|
784
837
|
const rowNode = /* @__PURE__ */ jsxs2(
|
|
785
838
|
"tr",
|
|
786
839
|
{
|
|
787
|
-
"data-tiger-table-row-index":
|
|
840
|
+
"data-tiger-table-row-index": sourceIndex,
|
|
788
841
|
className: classNames2(
|
|
789
842
|
getTableRowClasses(hoverable, striped, index % 2 === 0, rowClass),
|
|
790
843
|
ctx.fixedColumnsInfo.hasFixedColumns && "group"
|
|
791
844
|
),
|
|
792
845
|
"aria-selected": rowSelection ? isSelected : void 0,
|
|
793
|
-
tabIndex: interactiveRows ? 0 : void 0,
|
|
794
|
-
onKeyDown: interactiveRows ? (e) => {
|
|
846
|
+
tabIndex: interactiveRows && !hasRowControls ? 0 : void 0,
|
|
847
|
+
onKeyDown: interactiveRows && !hasRowControls ? (e) => {
|
|
795
848
|
if (e.target !== e.currentTarget) return;
|
|
796
849
|
if (isActivationKey(e)) {
|
|
797
850
|
e.preventDefault();
|
|
798
|
-
ctx.handleRowClick(record,
|
|
851
|
+
ctx.handleRowClick(record, sourceIndex, key);
|
|
799
852
|
}
|
|
800
853
|
} : void 0,
|
|
801
854
|
draggable: rowDraggable ? true : void 0,
|
|
802
855
|
children: [
|
|
803
|
-
|
|
804
|
-
rowSelection && rowSelection.showCheckbox !== false && /* @__PURE__ */ jsx3("td", { className: getCheckboxCellClasses2(size), children: /* @__PURE__ */ jsx3(
|
|
805
|
-
"input",
|
|
806
|
-
{
|
|
807
|
-
type: rowSelection?.type === "radio" ? "radio" : "checkbox",
|
|
808
|
-
className: rowSelection?.type === "radio" ? "border-gray-300 text-[var(--tiger-primary,#2563eb)] focus:ring-[var(--tiger-primary,#2563eb)]" : "rounded border-gray-300 text-[var(--tiger-primary,#2563eb)] focus:ring-[var(--tiger-primary,#2563eb)]",
|
|
809
|
-
checked: isSelected,
|
|
810
|
-
disabled: rowSelection?.getCheckboxProps?.(record)?.disabled,
|
|
811
|
-
onChange: (e) => ctx.handleSelectRow(key, e.target.checked),
|
|
812
|
-
onClick: (e) => e.stopPropagation()
|
|
813
|
-
}
|
|
814
|
-
) }),
|
|
856
|
+
chrome.leading.map((slot) => /* @__PURE__ */ jsx3(React2.Fragment, { children: renderChromeTd(slot) }, slot)),
|
|
815
857
|
ctx.displayColumns.map((column) => {
|
|
816
858
|
const dataKey = column.dataKey || column.key;
|
|
817
859
|
const cellValue = record[dataKey];
|
|
@@ -824,15 +866,15 @@ function renderTableBody(ctx, view) {
|
|
|
824
866
|
view: "table",
|
|
825
867
|
column,
|
|
826
868
|
record,
|
|
827
|
-
rowIndex:
|
|
869
|
+
rowIndex: sourceIndex,
|
|
828
870
|
striped,
|
|
829
871
|
stripedActive: striped && index % 2 === 0,
|
|
830
872
|
selected: isSelected,
|
|
831
873
|
hoverable,
|
|
832
874
|
fixedInfo: ctx.fixedColumnsInfo
|
|
833
875
|
});
|
|
834
|
-
const isEditing = ctx.editingCell?.rowIndex ===
|
|
835
|
-
const cellEditable = ctx.isCellEditable(column.key,
|
|
876
|
+
const isEditing = ctx.editingCell?.rowIndex === sourceIndex && ctx.editingCell?.columnKey === column.key;
|
|
877
|
+
const cellEditable = ctx.isCellEditable(column.key, sourceIndex);
|
|
836
878
|
return /* @__PURE__ */ jsx3(
|
|
837
879
|
"td",
|
|
838
880
|
{
|
|
@@ -842,7 +884,7 @@ function renderTableBody(ctx, view) {
|
|
|
842
884
|
cellEditable && getEditableCellClasses(!!isEditing)
|
|
843
885
|
),
|
|
844
886
|
style,
|
|
845
|
-
onDoubleClick: cellEditable ? () => ctx.startEditing(
|
|
887
|
+
onDoubleClick: cellEditable ? () => ctx.startEditing(sourceIndex, column.key, cellValue) : void 0,
|
|
846
888
|
children: isEditing ? /* @__PURE__ */ jsx3(
|
|
847
889
|
"input",
|
|
848
890
|
{
|
|
@@ -856,19 +898,19 @@ function renderTableBody(ctx, view) {
|
|
|
856
898
|
},
|
|
857
899
|
autoFocus: true
|
|
858
900
|
}
|
|
859
|
-
) : column.render ? column.render(record,
|
|
901
|
+
) : column.render ? column.render(record, sourceIndex) : cellValue
|
|
860
902
|
},
|
|
861
903
|
column.key
|
|
862
904
|
);
|
|
863
905
|
}),
|
|
864
|
-
|
|
906
|
+
chrome.trailing.map((slot) => /* @__PURE__ */ jsx3(React2.Fragment, { children: renderChromeTd(slot) }, slot))
|
|
865
907
|
]
|
|
866
908
|
},
|
|
867
909
|
key
|
|
868
910
|
);
|
|
869
911
|
if (expandable && isExpanded && isRowExpandable) {
|
|
870
|
-
const expandedContent = expandable.expandedRowRender ? expandable.expandedRowRender(record,
|
|
871
|
-
return /* @__PURE__ */ jsxs2(
|
|
912
|
+
const expandedContent = expandable.expandedRowRender ? expandable.expandedRowRender(record, sourceIndex) : null;
|
|
913
|
+
return /* @__PURE__ */ jsxs2(React2.Fragment, { children: [
|
|
872
914
|
rowNode,
|
|
873
915
|
/* @__PURE__ */ jsx3("tr", { className: getExpandedRowClasses(), children: /* @__PURE__ */ jsx3("td", { colSpan: ctx.totalColumnCount, className: getExpandedRowContentClasses(size), children: expandedContent }) }, `${key}-expanded`)
|
|
874
916
|
] }, key);
|
|
@@ -883,13 +925,8 @@ function renderTableBody(ctx, view) {
|
|
|
883
925
|
onDragStart: rowDraggable ? handleBodyDragStart : void 0,
|
|
884
926
|
onDragOver: rowDraggable ? handleBodyDragOver : void 0,
|
|
885
927
|
onDrop: rowDraggable ? handleBodyDrop : void 0,
|
|
886
|
-
children: Array.from(ctx.groupedData.entries()).map(([groupKey, groupItems]) => /* @__PURE__ */ jsxs2(
|
|
887
|
-
/* @__PURE__ */ jsx3("tr", { className: tableGroupHeaderClasses, children: /* @__PURE__ */
|
|
888
|
-
groupKey,
|
|
889
|
-
" (",
|
|
890
|
-
groupItems.length,
|
|
891
|
-
")"
|
|
892
|
-
] }) }),
|
|
928
|
+
children: Array.from(ctx.groupedData.entries()).map(([groupKey, groupItems]) => /* @__PURE__ */ jsxs2(React2.Fragment, { children: [
|
|
929
|
+
/* @__PURE__ */ jsx3("tr", { className: tableGroupHeaderClasses, children: /* @__PURE__ */ jsx3("td", { colSpan: ctx.totalColumnCount, className: getGroupHeaderCellClasses(size), children: formatTableGroupHeaderText(labels.groupHeaderText, groupKey, groupItems.length) }) }),
|
|
893
930
|
groupItems.map((record, idx) => {
|
|
894
931
|
const globalIndex = ctx.paginatedData.indexOf(record);
|
|
895
932
|
return renderDataRow(record, globalIndex >= 0 ? globalIndex : idx);
|
|
@@ -898,20 +935,36 @@ function renderTableBody(ctx, view) {
|
|
|
898
935
|
}
|
|
899
936
|
);
|
|
900
937
|
}
|
|
901
|
-
if (virtualWindow
|
|
938
|
+
if (virtualWindow) {
|
|
902
939
|
const { startIndex, endIndex, topPad, bottomPad } = virtualWindow;
|
|
903
940
|
const windowed = [];
|
|
904
941
|
if (topPad > 0) {
|
|
905
942
|
windowed.push(
|
|
906
|
-
/* @__PURE__ */ jsx3("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx3(
|
|
943
|
+
/* @__PURE__ */ jsx3("tr", { "data-tiger-table-virtual-spacer": "", "aria-hidden": "true", children: /* @__PURE__ */ jsx3(
|
|
944
|
+
"td",
|
|
945
|
+
{
|
|
946
|
+
colSpan: ctx.totalColumnCount,
|
|
947
|
+
className: tableVirtualSpacerCellClasses,
|
|
948
|
+
style: { height: `${topPad}px` }
|
|
949
|
+
}
|
|
950
|
+
) }, "virtual-top")
|
|
907
951
|
);
|
|
908
952
|
}
|
|
909
953
|
for (let index = startIndex; index <= endIndex; index++) {
|
|
910
|
-
|
|
954
|
+
const record = ctx.paginatedData[index];
|
|
955
|
+
if (record === void 0) continue;
|
|
956
|
+
windowed.push(renderDataRow(record, index));
|
|
911
957
|
}
|
|
912
958
|
if (bottomPad > 0) {
|
|
913
959
|
windowed.push(
|
|
914
|
-
/* @__PURE__ */ jsx3("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx3(
|
|
960
|
+
/* @__PURE__ */ jsx3("tr", { "data-tiger-table-virtual-spacer": "", "aria-hidden": "true", children: /* @__PURE__ */ jsx3(
|
|
961
|
+
"td",
|
|
962
|
+
{
|
|
963
|
+
colSpan: ctx.totalColumnCount,
|
|
964
|
+
className: tableVirtualSpacerCellClasses,
|
|
965
|
+
style: { height: `${bottomPad}px` }
|
|
966
|
+
}
|
|
967
|
+
) }, "virtual-bottom")
|
|
915
968
|
);
|
|
916
969
|
}
|
|
917
970
|
return /* @__PURE__ */ jsx3(
|
|
@@ -940,22 +993,36 @@ function renderTableBody(ctx, view) {
|
|
|
940
993
|
// src/components/Table/render-summary.tsx
|
|
941
994
|
import {
|
|
942
995
|
getTableCellClasses as getTableCellClasses2,
|
|
996
|
+
getTableChromeSlots as getTableChromeSlots3,
|
|
997
|
+
hasTableSelectionColumn as hasTableSelectionColumn3,
|
|
998
|
+
resolveTableExpandSlot as resolveTableExpandSlot3,
|
|
943
999
|
tableSummaryRowClasses
|
|
944
1000
|
} from "@expcat/tigercat-core";
|
|
945
1001
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
946
1002
|
function renderSummaryRow(ctx, view) {
|
|
947
1003
|
const { size, rowSelection, expandable, summaryRow } = view;
|
|
948
1004
|
if (!summaryRow?.show) return null;
|
|
1005
|
+
const chrome = getTableChromeSlots3({
|
|
1006
|
+
hasSelectionColumn: hasTableSelectionColumn3(rowSelection),
|
|
1007
|
+
expand: resolveTableExpandSlot3(expandable)
|
|
1008
|
+
});
|
|
1009
|
+
const emptyCell = (key) => /* @__PURE__ */ jsx4("td", { className: getTableCellClasses2(size, "left") }, key);
|
|
949
1010
|
return /* @__PURE__ */ jsx4("tfoot", { children: /* @__PURE__ */ jsxs3("tr", { className: tableSummaryRowClasses, children: [
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1011
|
+
chrome.leading.map((slot) => emptyCell(slot)),
|
|
1012
|
+
ctx.displayColumns.map((column) => /* @__PURE__ */ jsx4(
|
|
1013
|
+
"td",
|
|
1014
|
+
{
|
|
1015
|
+
className: getTableCellClasses2(size, column.align || "left", column.className),
|
|
1016
|
+
children: summaryRow.data[column.dataKey || column.key] ?? ""
|
|
1017
|
+
},
|
|
1018
|
+
column.key
|
|
1019
|
+
)),
|
|
1020
|
+
chrome.trailing.map((slot) => emptyCell(`end-${slot}`))
|
|
953
1021
|
] }) });
|
|
954
1022
|
}
|
|
955
1023
|
|
|
956
1024
|
// src/components/Table/render-pagination.tsx
|
|
957
1025
|
import {
|
|
958
|
-
formatPaginationPageIndicator,
|
|
959
1026
|
formatPaginationTotal,
|
|
960
1027
|
getBuiltInPaginationContainerClasses,
|
|
961
1028
|
getPaginationLabels,
|
|
@@ -964,18 +1031,17 @@ import {
|
|
|
964
1031
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
965
1032
|
function renderPagination(ctx, view) {
|
|
966
1033
|
const { pagination } = view;
|
|
967
|
-
|
|
1034
|
+
const paginationConfig = ctx.paginationConfig;
|
|
1035
|
+
if (pagination === false || !ctx.paginationInfo || !paginationConfig) {
|
|
968
1036
|
return null;
|
|
969
1037
|
}
|
|
970
|
-
const { totalPages } = ctx.paginationInfo;
|
|
971
|
-
const paginationConfig = pagination;
|
|
972
|
-
const total = paginationConfig.total !== void 0 && paginationConfig.total > 0 ? paginationConfig.total : ctx.processedData.length;
|
|
1038
|
+
const { totalPages, total } = ctx.paginationInfo;
|
|
973
1039
|
const locale = view.disableI18n ? void 0 : view.locale;
|
|
974
1040
|
const labels = getPaginationLabels(locale);
|
|
975
1041
|
const localeCode = locale?.locale;
|
|
976
1042
|
const { simple, showQuickJumper } = resolvePaginationDisplayMode(totalPages, paginationConfig);
|
|
977
1043
|
const totalText = paginationConfig.totalText ?? ((value, range) => formatPaginationTotal(labels.totalText, value, range, localeCode));
|
|
978
|
-
const pageIndicatorText = paginationConfig.pageIndicatorText
|
|
1044
|
+
const pageIndicatorText = paginationConfig.pageIndicatorText;
|
|
979
1045
|
const overrides = view.disableI18n ? { ...labels } : {};
|
|
980
1046
|
if (paginationConfig.prevText) overrides.prevPageAriaLabel = paginationConfig.prevText;
|
|
981
1047
|
if (paginationConfig.nextText) overrides.nextPageAriaLabel = paginationConfig.nextText;
|
|
@@ -1018,18 +1084,10 @@ function renderPagination(ctx, view) {
|
|
|
1018
1084
|
|
|
1019
1085
|
// src/components/Table.tsx
|
|
1020
1086
|
import { Fragment, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1021
|
-
var DEFAULT_TABLE_PAGINATION = {
|
|
1022
|
-
defaultCurrent: 1,
|
|
1023
|
-
defaultPageSize: 10,
|
|
1024
|
-
total: 0,
|
|
1025
|
-
pageSizeOptions: [10, 20, 50, 100],
|
|
1026
|
-
showSizeChanger: true,
|
|
1027
|
-
showTotal: true
|
|
1028
|
-
};
|
|
1029
1087
|
function Table({
|
|
1030
1088
|
columns,
|
|
1031
1089
|
columnLockable = false,
|
|
1032
|
-
dataSource
|
|
1090
|
+
dataSource,
|
|
1033
1091
|
hiddenColumnKeys,
|
|
1034
1092
|
defaultHiddenColumnKeys,
|
|
1035
1093
|
sort,
|
|
@@ -1044,7 +1102,7 @@ function Table({
|
|
|
1044
1102
|
locale,
|
|
1045
1103
|
labels,
|
|
1046
1104
|
emptyText,
|
|
1047
|
-
pagination
|
|
1105
|
+
pagination,
|
|
1048
1106
|
rowSelection,
|
|
1049
1107
|
expandable,
|
|
1050
1108
|
rowKey = "id",
|
|
@@ -1062,14 +1120,14 @@ function Table({
|
|
|
1062
1120
|
cardFieldGap = "gap-3",
|
|
1063
1121
|
// v0.6.0 props
|
|
1064
1122
|
virtual = false,
|
|
1065
|
-
autoVirtual =
|
|
1123
|
+
autoVirtual = false,
|
|
1066
1124
|
virtualHeight = 400,
|
|
1067
1125
|
virtualItemHeight = 40,
|
|
1068
1126
|
virtualThreshold = 1e3,
|
|
1069
1127
|
editable = false,
|
|
1070
1128
|
editableCells,
|
|
1071
1129
|
filterMode = "basic",
|
|
1072
|
-
advancedFilterRules
|
|
1130
|
+
advancedFilterRules,
|
|
1073
1131
|
columnDraggable = false,
|
|
1074
1132
|
rowDraggable = false,
|
|
1075
1133
|
summaryRow,
|
|
@@ -1087,16 +1145,20 @@ function Table({
|
|
|
1087
1145
|
onExpandChange,
|
|
1088
1146
|
onCellChange,
|
|
1089
1147
|
onColumnOrderChange,
|
|
1148
|
+
onColumnFixedChange,
|
|
1090
1149
|
onRowOrderChange,
|
|
1091
1150
|
onExport,
|
|
1092
1151
|
className,
|
|
1093
1152
|
...props
|
|
1094
1153
|
}) {
|
|
1095
1154
|
const config = useTigerConfig();
|
|
1096
|
-
const wrapperRef =
|
|
1097
|
-
const tableRef =
|
|
1155
|
+
const wrapperRef = useRef2(null);
|
|
1156
|
+
const tableRef = useRef2(null);
|
|
1098
1157
|
const [measuredColumnWidths, setMeasuredColumnWidths] = useState2({});
|
|
1099
|
-
const [measuredRowHeights, setMeasuredRowHeights] = useState2(
|
|
1158
|
+
const [measuredRowHeights, setMeasuredRowHeights] = useState2({});
|
|
1159
|
+
const [measuredContainerSize, setMeasuredContainerSize] = useState2({ width: 0, height: 0 });
|
|
1160
|
+
const [isCardViewport, setIsCardViewport] = useState2(false);
|
|
1161
|
+
const selectionGroupName = useId();
|
|
1100
1162
|
const internalRowSelection = rowSelection;
|
|
1101
1163
|
const internalExpandable = expandable;
|
|
1102
1164
|
const internalRowClassName = rowClassName;
|
|
@@ -1180,6 +1242,7 @@ function Table({
|
|
|
1180
1242
|
exportFormat,
|
|
1181
1243
|
exportFilename,
|
|
1182
1244
|
measuredColumnWidths,
|
|
1245
|
+
containerWidth: measuredContainerSize.width,
|
|
1183
1246
|
onChange,
|
|
1184
1247
|
onRowClick,
|
|
1185
1248
|
onSelectionChange,
|
|
@@ -1190,6 +1253,7 @@ function Table({
|
|
|
1190
1253
|
onExpandChange,
|
|
1191
1254
|
onCellChange,
|
|
1192
1255
|
onColumnOrderChange,
|
|
1256
|
+
onColumnFixedChange,
|
|
1193
1257
|
onRowOrderChange,
|
|
1194
1258
|
onExport
|
|
1195
1259
|
});
|
|
@@ -1209,22 +1273,41 @@ function Table({
|
|
|
1209
1273
|
() => getTableVirtualRecommendation({
|
|
1210
1274
|
virtual,
|
|
1211
1275
|
autoVirtual,
|
|
1212
|
-
dataLength:
|
|
1276
|
+
dataLength: ctx.processedData.length,
|
|
1213
1277
|
threshold: virtualThreshold
|
|
1214
1278
|
}),
|
|
1215
|
-
[autoVirtual,
|
|
1279
|
+
[autoVirtual, ctx.processedData.length, virtual, virtualThreshold]
|
|
1216
1280
|
);
|
|
1217
|
-
const
|
|
1281
|
+
const virtualAllowed = canUseTableVirtualWindow({ expandable: internalExpandable, groupBy });
|
|
1282
|
+
const effectiveVirtual = virtualRecommendation.enabled && virtualAllowed;
|
|
1283
|
+
const showCardTree = responsiveMode === "card" && isCardViewport;
|
|
1284
|
+
const showTableTree = !showCardTree;
|
|
1285
|
+
useEffect2(() => {
|
|
1286
|
+
if (responsiveMode !== "card") {
|
|
1287
|
+
setIsCardViewport(false);
|
|
1288
|
+
return void 0;
|
|
1289
|
+
}
|
|
1290
|
+
return subscribeTableCardViewport(cardBreakpoint, setIsCardViewport);
|
|
1291
|
+
}, [responsiveMode, cardBreakpoint]);
|
|
1218
1292
|
const shouldObserveGeometry = effectiveVirtual || columnLockable || ctx.displayColumns.some((column) => column.fixed === "left" || column.fixed === "right");
|
|
1219
1293
|
const [virtualScrollTop, setVirtualScrollTop] = useState2(0);
|
|
1294
|
+
const measuredItemHeight = Object.values(measuredRowHeights)[0];
|
|
1220
1295
|
const virtualWindow = useMemo2(
|
|
1221
1296
|
() => effectiveVirtual ? getTableVirtualWindow(
|
|
1222
1297
|
virtualScrollTop,
|
|
1223
|
-
typeof virtualHeight === "number" ? virtualHeight : 400,
|
|
1224
|
-
virtualItemHeight,
|
|
1298
|
+
measuredContainerSize.height > 0 ? measuredContainerSize.height : typeof virtualHeight === "number" ? virtualHeight : 400,
|
|
1299
|
+
measuredItemHeight > 0 ? measuredItemHeight : virtualItemHeight,
|
|
1225
1300
|
ctx.paginatedData.length
|
|
1226
1301
|
) : void 0,
|
|
1227
|
-
[
|
|
1302
|
+
[
|
|
1303
|
+
effectiveVirtual,
|
|
1304
|
+
virtualScrollTop,
|
|
1305
|
+
virtualHeight,
|
|
1306
|
+
virtualItemHeight,
|
|
1307
|
+
ctx.paginatedData.length,
|
|
1308
|
+
measuredContainerSize.height,
|
|
1309
|
+
measuredItemHeight
|
|
1310
|
+
]
|
|
1228
1311
|
);
|
|
1229
1312
|
const wrapperStyle = useMemo2(() => {
|
|
1230
1313
|
return maxHeight ? {
|
|
@@ -1245,7 +1328,10 @@ function Table({
|
|
|
1245
1328
|
(prev) => areNumberRecordsEqual(prev, snapshot.columnWidths) ? prev : snapshot.columnWidths
|
|
1246
1329
|
);
|
|
1247
1330
|
setMeasuredRowHeights(
|
|
1248
|
-
(prev) =>
|
|
1331
|
+
(prev) => areNumberRecordsEqual(prev, snapshot.rowHeights) ? prev : snapshot.rowHeights
|
|
1332
|
+
);
|
|
1333
|
+
setMeasuredContainerSize(
|
|
1334
|
+
(prev) => prev.width === snapshot.containerWidth && prev.height === snapshot.containerHeight ? prev : { width: snapshot.containerWidth, height: snapshot.containerHeight }
|
|
1249
1335
|
);
|
|
1250
1336
|
}
|
|
1251
1337
|
});
|
|
@@ -1258,7 +1344,7 @@ function Table({
|
|
|
1258
1344
|
ref: tableRef,
|
|
1259
1345
|
className: classNames3(
|
|
1260
1346
|
tableBaseClasses,
|
|
1261
|
-
getTableResponsiveTableClasses(responsiveMode, cardBreakpoint),
|
|
1347
|
+
responsiveMode === "scroll" ? getTableResponsiveTableClasses(responsiveMode, cardBreakpoint) : void 0,
|
|
1262
1348
|
tableLayout === "fixed" ? "table-fixed" : "table-auto",
|
|
1263
1349
|
className
|
|
1264
1350
|
),
|
|
@@ -1272,8 +1358,8 @@ function Table({
|
|
|
1272
1358
|
columns: ctx.displayColumns,
|
|
1273
1359
|
frozenWidths: ctx.frozenColumnWidths,
|
|
1274
1360
|
size,
|
|
1275
|
-
hasSelectionColumn:
|
|
1276
|
-
expand: internalExpandable
|
|
1361
|
+
hasSelectionColumn: hasTableSelectionColumn4(internalRowSelection),
|
|
1362
|
+
expand: resolveTableExpandSlot4(internalExpandable)
|
|
1277
1363
|
}).map((entry, index) => /* @__PURE__ */ jsx6(
|
|
1278
1364
|
"col",
|
|
1279
1365
|
{
|
|
@@ -1290,7 +1376,8 @@ function Table({
|
|
|
1290
1376
|
columnDraggable,
|
|
1291
1377
|
lockColumnAriaLabel: tableLabels.lockColumnAriaLabel,
|
|
1292
1378
|
unlockColumnAriaLabel: tableLabels.unlockColumnAriaLabel,
|
|
1293
|
-
labels: tableLabels
|
|
1379
|
+
labels: tableLabels,
|
|
1380
|
+
selectionName: selectionGroupName
|
|
1294
1381
|
}),
|
|
1295
1382
|
renderTableBody(ctx, {
|
|
1296
1383
|
size,
|
|
@@ -1304,7 +1391,8 @@ function Table({
|
|
|
1304
1391
|
rowClassName: internalRowClassName,
|
|
1305
1392
|
rowDraggable,
|
|
1306
1393
|
interactiveRows: !!onRowClick || !!internalRowSelection,
|
|
1307
|
-
virtualWindow
|
|
1394
|
+
virtualWindow,
|
|
1395
|
+
selectionName: selectionGroupName
|
|
1308
1396
|
}),
|
|
1309
1397
|
renderSummaryRow(ctx, {
|
|
1310
1398
|
size,
|
|
@@ -1315,47 +1403,52 @@ function Table({
|
|
|
1315
1403
|
]
|
|
1316
1404
|
}
|
|
1317
1405
|
);
|
|
1318
|
-
const
|
|
1406
|
+
const virtualScrollerStyle = {
|
|
1407
|
+
height: typeof virtualHeight === "number" ? `${virtualHeight}px` : virtualHeight,
|
|
1408
|
+
overflow: "auto"
|
|
1409
|
+
};
|
|
1410
|
+
const tableContent = showTableTree && (effectiveVirtual ? /* @__PURE__ */ jsx6(
|
|
1319
1411
|
"div",
|
|
1320
1412
|
{
|
|
1321
|
-
style:
|
|
1322
|
-
height: typeof virtualHeight === "number" ? `${virtualHeight}px` : virtualHeight,
|
|
1323
|
-
overflow: "auto"
|
|
1324
|
-
},
|
|
1413
|
+
style: virtualScrollerStyle,
|
|
1325
1414
|
onScroll: (e) => setVirtualScrollTop(e.target.scrollTop),
|
|
1326
1415
|
children: tableInner
|
|
1327
1416
|
}
|
|
1328
|
-
) : tableInner;
|
|
1417
|
+
) : tableInner);
|
|
1329
1418
|
return /* @__PURE__ */ jsxs4(
|
|
1330
1419
|
"div",
|
|
1331
1420
|
{
|
|
1332
1421
|
ref: wrapperRef,
|
|
1333
|
-
className: getTableWrapperClasses(bordered, maxHeight),
|
|
1422
|
+
className: getTableWrapperClasses(bordered, maxHeight, !effectiveVirtual),
|
|
1334
1423
|
style: wrapperStyle,
|
|
1335
|
-
"data-tiger-virtual":
|
|
1424
|
+
"data-tiger-virtual": effectiveVirtual ? "enabled" : void 0,
|
|
1336
1425
|
"data-tiger-virtual-recommended": virtualRecommendation.recommended ? "true" : void 0,
|
|
1337
1426
|
"data-tiger-virtual-threshold": virtualRecommendation.recommended ? virtualRecommendation.threshold : void 0,
|
|
1338
|
-
"data-tiger-measured-row-height":
|
|
1427
|
+
"data-tiger-measured-row-height": measuredItemHeight || void 0,
|
|
1428
|
+
"data-tiger-table-layout": showCardTree ? "card" : "table",
|
|
1339
1429
|
"aria-busy": loading,
|
|
1340
1430
|
children: [
|
|
1341
|
-
exportable && /* @__PURE__ */ jsx6("div", { className:
|
|
1342
|
-
|
|
1431
|
+
exportable && /* @__PURE__ */ jsx6("div", { className: tableExportBarClasses, children: /* @__PURE__ */ jsx6(
|
|
1432
|
+
Button,
|
|
1343
1433
|
{
|
|
1344
1434
|
type: "button",
|
|
1345
|
-
|
|
1346
|
-
|
|
1435
|
+
variant: "secondary",
|
|
1436
|
+
size: "sm",
|
|
1437
|
+
"aria-label": tableLabels.exportCsvAriaLabel,
|
|
1347
1438
|
onClick: ctx.handleExport,
|
|
1348
|
-
children:
|
|
1439
|
+
children: tableLabels.exportCsvText
|
|
1349
1440
|
}
|
|
1350
1441
|
) }),
|
|
1351
1442
|
tableContent,
|
|
1352
|
-
|
|
1443
|
+
showCardTree && /* @__PURE__ */ jsxs4(
|
|
1353
1444
|
"div",
|
|
1354
1445
|
{
|
|
1355
|
-
className:
|
|
1446
|
+
className: tableCardListVisibleClasses,
|
|
1356
1447
|
"data-tiger-table-mobile": "card",
|
|
1448
|
+
style: effectiveVirtual ? virtualScrollerStyle : void 0,
|
|
1449
|
+
onScroll: effectiveVirtual ? (e) => setVirtualScrollTop(e.target.scrollTop) : void 0,
|
|
1357
1450
|
children: [
|
|
1358
|
-
internalRowSelection?.type !== "radio" && internalRowSelection?.showCheckbox !== false && internalRowSelection && ctx.paginatedData.length > 0 ? /* @__PURE__ */ jsx6("div", { className: "flex items-center justify-between rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] px-3 py-2", children: /* @__PURE__ */ jsx6(
|
|
1451
|
+
internalRowSelection?.type !== "radio" && internalRowSelection?.showCheckbox !== false && internalRowSelection && !loading && ctx.paginatedData.length > 0 ? /* @__PURE__ */ jsx6("div", { className: "flex items-center justify-between rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] px-3 py-2", children: /* @__PURE__ */ jsx6(
|
|
1359
1452
|
Checkbox,
|
|
1360
1453
|
{
|
|
1361
1454
|
size: "sm",
|
|
@@ -1369,9 +1462,10 @@ function Table({
|
|
|
1369
1462
|
Select,
|
|
1370
1463
|
{
|
|
1371
1464
|
size: "sm",
|
|
1372
|
-
|
|
1465
|
+
"aria-label": tableLabels.sortMenuAriaLabel,
|
|
1466
|
+
value: getTableCardSortValue(ctx.sortState),
|
|
1373
1467
|
options: [
|
|
1374
|
-
{ label: tableLabels.clearSortText, value:
|
|
1468
|
+
{ label: tableLabels.clearSortText, value: TABLE_CARD_SORT_NONE },
|
|
1375
1469
|
...ctx.displayColumns.filter((column) => column.sortable).flatMap((column) => [
|
|
1376
1470
|
{
|
|
1377
1471
|
label: `${formatTableSortByText2(tableLabels.sortByText, column.title)} \u2191`,
|
|
@@ -1385,94 +1479,211 @@ function Table({
|
|
|
1385
1479
|
],
|
|
1386
1480
|
clearable: false,
|
|
1387
1481
|
onChange: (value) => {
|
|
1388
|
-
|
|
1389
|
-
if (!nextValue) {
|
|
1390
|
-
ctx.handleSetSort({ key: null, direction: null });
|
|
1391
|
-
return;
|
|
1392
|
-
}
|
|
1393
|
-
const separatorIndex = nextValue.lastIndexOf(":");
|
|
1394
|
-
const key = nextValue.slice(0, separatorIndex);
|
|
1395
|
-
const direction = nextValue.slice(separatorIndex + 1);
|
|
1396
|
-
ctx.handleSetSort({ key, direction });
|
|
1482
|
+
ctx.handleSetSort(parseTableCardSortValue(value));
|
|
1397
1483
|
}
|
|
1398
1484
|
}
|
|
1399
1485
|
) }) : null,
|
|
1400
|
-
ctx.paginatedData.length === 0 ? /* @__PURE__ */ jsx6("div", { className: getTableResponsiveCardClasses(cardPadding), children: /* @__PURE__ */ jsx6(Empty, { showImage: false, description: tableLabels.emptyText }) }) :
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1486
|
+
loading ? null : ctx.paginatedData.length === 0 ? /* @__PURE__ */ jsx6("div", { className: getTableResponsiveCardClasses(cardPadding), children: /* @__PURE__ */ jsx6(Empty, { showImage: false, description: tableLabels.emptyText }) }) : /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1487
|
+
effectiveVirtual && virtualWindow && virtualWindow.topPad > 0 ? /* @__PURE__ */ jsx6("div", { "aria-hidden": "true", style: { height: `${virtualWindow.topPad}px` } }) : null,
|
|
1488
|
+
ctx.paginatedData.slice(
|
|
1489
|
+
effectiveVirtual && virtualWindow ? virtualWindow.startIndex : 0,
|
|
1490
|
+
effectiveVirtual && virtualWindow ? virtualWindow.endIndex + 1 : ctx.paginatedData.length
|
|
1491
|
+
).map((record, offset) => {
|
|
1492
|
+
const index = (effectiveVirtual && virtualWindow ? virtualWindow.startIndex : 0) + offset;
|
|
1493
|
+
const sourceIndex = ctx.pageSourceIndices[index] ?? index;
|
|
1494
|
+
const key = ctx.pageRowKeys[index];
|
|
1495
|
+
const isExpanded = ctx.expandedRowKeySet.has(key);
|
|
1496
|
+
const isSelected = ctx.selectedRowKeySet.has(key);
|
|
1497
|
+
const isRowExpandable = internalExpandable ? internalExpandable.rowExpandable ? internalExpandable.rowExpandable(record) : true : false;
|
|
1498
|
+
const expandedContent = internalExpandable && isExpanded && isRowExpandable ? internalExpandable.expandedRowRender?.(record, sourceIndex) : null;
|
|
1499
|
+
const expandedNode = expandedContent;
|
|
1500
|
+
const renderContext = {
|
|
1501
|
+
record,
|
|
1502
|
+
index: sourceIndex,
|
|
1503
|
+
columns: ctx.displayColumns,
|
|
1504
|
+
selected: isSelected,
|
|
1505
|
+
expanded: isExpanded,
|
|
1506
|
+
toggleExpand: () => ctx.handleToggleExpand(key, record),
|
|
1507
|
+
selectRow: (checked) => ctx.handleSelectRow(key, checked)
|
|
1508
|
+
};
|
|
1509
|
+
const customCard = renderCard?.(renderContext);
|
|
1510
|
+
const resolvedCardClassName = typeof cardClassName === "function" ? cardClassName(record, sourceIndex) : cardClassName;
|
|
1511
|
+
const controlsNode = internalRowSelection?.showCheckbox !== false && internalRowSelection || internalExpandable && isRowExpandable ? /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1512
|
+
internalRowSelection && internalRowSelection.showCheckbox !== false && /* @__PURE__ */ jsx6("span", { onClick: (event) => event.stopPropagation(), children: internalRowSelection.type === "radio" ? /* @__PURE__ */ jsx6(
|
|
1513
|
+
Radio,
|
|
1514
|
+
{
|
|
1515
|
+
name: selectionGroupName,
|
|
1516
|
+
value: key,
|
|
1517
|
+
checked: isSelected,
|
|
1518
|
+
disabled: internalRowSelection.getCheckboxProps?.(record)?.disabled,
|
|
1519
|
+
"aria-label": formatTableSelectRowAriaLabel2(
|
|
1520
|
+
tableLabels.selectRowAriaLabel,
|
|
1521
|
+
sourceIndex + 1,
|
|
1522
|
+
tableLocale?.locale
|
|
1523
|
+
),
|
|
1524
|
+
onChange: () => ctx.handleSelectRow(key, true)
|
|
1525
|
+
}
|
|
1526
|
+
) : /* @__PURE__ */ jsx6(
|
|
1527
|
+
Checkbox,
|
|
1528
|
+
{
|
|
1529
|
+
size: "sm",
|
|
1530
|
+
checked: isSelected,
|
|
1531
|
+
disabled: internalRowSelection.getCheckboxProps?.(record)?.disabled,
|
|
1532
|
+
"aria-label": formatTableSelectRowAriaLabel2(
|
|
1533
|
+
tableLabels.selectRowAriaLabel,
|
|
1534
|
+
sourceIndex + 1,
|
|
1535
|
+
tableLocale?.locale
|
|
1536
|
+
),
|
|
1537
|
+
onChange: (checked) => ctx.handleSelectRow(key, checked)
|
|
1538
|
+
}
|
|
1539
|
+
) }),
|
|
1540
|
+
internalExpandable && isRowExpandable && /* @__PURE__ */ jsx6(
|
|
1541
|
+
"button",
|
|
1542
|
+
{
|
|
1543
|
+
type: "button",
|
|
1544
|
+
className: "text-sm text-[var(--tiger-primary,#2563eb)]",
|
|
1545
|
+
"aria-expanded": isExpanded,
|
|
1546
|
+
onClick: (event) => {
|
|
1547
|
+
event.stopPropagation();
|
|
1548
|
+
ctx.handleToggleExpand(key, record);
|
|
1549
|
+
},
|
|
1550
|
+
children: isExpanded ? tableLabels.collapseText : tableLabels.expandText
|
|
1551
|
+
}
|
|
1552
|
+
)
|
|
1553
|
+
] }) : null;
|
|
1554
|
+
const hasCardControls = Boolean(controlsNode);
|
|
1555
|
+
const cardInteractive = Boolean(onRowClick || internalRowSelection);
|
|
1556
|
+
return /* @__PURE__ */ jsx6(
|
|
1557
|
+
"div",
|
|
1434
1558
|
{
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
"aria-label": formatTableSelectRowAriaLabel(
|
|
1439
|
-
tableLabels.selectRowAriaLabel,
|
|
1440
|
-
index + 1,
|
|
1441
|
-
tableLocale?.locale
|
|
1559
|
+
className: classNames3(
|
|
1560
|
+
getTableResponsiveCardClasses(cardPadding),
|
|
1561
|
+
resolvedCardClassName
|
|
1442
1562
|
),
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1563
|
+
tabIndex: cardInteractive && !hasCardControls ? 0 : void 0,
|
|
1564
|
+
onClick: () => ctx.handleRowClick(record, sourceIndex, key),
|
|
1565
|
+
onKeyDown: cardInteractive && !hasCardControls ? (event) => {
|
|
1566
|
+
if (event.target !== event.currentTarget) return;
|
|
1567
|
+
if (isActivationKey2(event)) {
|
|
1568
|
+
event.preventDefault();
|
|
1569
|
+
ctx.handleRowClick(record, sourceIndex, key);
|
|
1570
|
+
}
|
|
1571
|
+
} : void 0,
|
|
1572
|
+
children: customCard !== void 0 && customCard !== null ? customCard : /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1573
|
+
(() => {
|
|
1574
|
+
const { titleColumn, bodyColumns } = getCardColumns(ctx.displayColumns);
|
|
1575
|
+
const renderCellContent = (column) => {
|
|
1576
|
+
const dataKey = column.dataKey || column.key;
|
|
1577
|
+
return column.render ? column.render(record, sourceIndex) : record[dataKey];
|
|
1578
|
+
};
|
|
1579
|
+
if (hasCustomCardLayout) {
|
|
1580
|
+
return /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1581
|
+
titleColumn && /* @__PURE__ */ jsxs4(
|
|
1582
|
+
"div",
|
|
1583
|
+
{
|
|
1584
|
+
className: classNames3(
|
|
1585
|
+
tableResponsiveCardTitleClasses,
|
|
1586
|
+
cardSelectionPosition === "title-inline" && controlsNode && "flex items-center gap-3"
|
|
1587
|
+
),
|
|
1588
|
+
children: [
|
|
1589
|
+
cardSelectionPosition === "title-inline" && controlsNode,
|
|
1590
|
+
/* @__PURE__ */ jsx6("span", { className: "min-w-0 flex-1", children: renderCellContent(titleColumn) })
|
|
1591
|
+
]
|
|
1592
|
+
}
|
|
1593
|
+
),
|
|
1594
|
+
(!titleColumn || cardSelectionPosition !== "title-inline") && controlsNode && /* @__PURE__ */ jsx6("div", { className: "mb-2 flex items-center gap-3", children: controlsNode }),
|
|
1595
|
+
/* @__PURE__ */ jsx6(
|
|
1596
|
+
"div",
|
|
1597
|
+
{
|
|
1598
|
+
className: classNames3("grid grid-cols-12 mt-2", cardFieldGap),
|
|
1599
|
+
children: bodyColumns.map((column) => {
|
|
1600
|
+
const layoutItem = cardLayoutMap.get(column.key);
|
|
1601
|
+
const gridInfo = getCardGridInfo(column, layoutItem);
|
|
1602
|
+
if (gridInfo.hideLabel) {
|
|
1603
|
+
return /* @__PURE__ */ jsx6(
|
|
1604
|
+
"div",
|
|
1605
|
+
{
|
|
1606
|
+
className: classNames3(
|
|
1607
|
+
gridInfo.className,
|
|
1608
|
+
gridInfo.divider && "border-t border-[var(--tiger-border,#e5e7eb)] pt-3"
|
|
1609
|
+
),
|
|
1610
|
+
children: renderCellContent(column)
|
|
1611
|
+
},
|
|
1612
|
+
column.key
|
|
1613
|
+
);
|
|
1614
|
+
}
|
|
1615
|
+
if (gridInfo.labelPosition === "top") {
|
|
1616
|
+
return /* @__PURE__ */ jsxs4(
|
|
1617
|
+
"div",
|
|
1618
|
+
{
|
|
1619
|
+
className: classNames3(
|
|
1620
|
+
gridInfo.className,
|
|
1621
|
+
gridInfo.divider && "border-t border-[var(--tiger-border,#e5e7eb)] pt-3"
|
|
1622
|
+
),
|
|
1623
|
+
children: [
|
|
1624
|
+
/* @__PURE__ */ jsx6(
|
|
1625
|
+
"div",
|
|
1626
|
+
{
|
|
1627
|
+
className: classNames3(
|
|
1628
|
+
"text-xs font-medium uppercase tracking-wider text-[var(--tiger-text-muted,#6b7280)] mb-1",
|
|
1629
|
+
gridInfo.labelClassName
|
|
1630
|
+
),
|
|
1631
|
+
children: column.title
|
|
1632
|
+
}
|
|
1633
|
+
),
|
|
1634
|
+
/* @__PURE__ */ jsx6(
|
|
1635
|
+
"div",
|
|
1636
|
+
{
|
|
1637
|
+
className: classNames3(
|
|
1638
|
+
"min-w-0 text-sm text-[var(--tiger-text,#111827)] break-words",
|
|
1639
|
+
gridInfo.valueClassName
|
|
1640
|
+
),
|
|
1641
|
+
children: renderCellContent(column)
|
|
1642
|
+
}
|
|
1643
|
+
)
|
|
1644
|
+
]
|
|
1645
|
+
},
|
|
1646
|
+
column.key
|
|
1647
|
+
);
|
|
1648
|
+
}
|
|
1649
|
+
return /* @__PURE__ */ jsxs4(
|
|
1650
|
+
"div",
|
|
1651
|
+
{
|
|
1652
|
+
className: classNames3(
|
|
1653
|
+
gridInfo.className,
|
|
1654
|
+
"grid grid-cols-[auto_1fr] gap-2 items-baseline",
|
|
1655
|
+
gridInfo.divider && "border-t border-[var(--tiger-border,#e5e7eb)] pt-3"
|
|
1656
|
+
),
|
|
1657
|
+
children: [
|
|
1658
|
+
/* @__PURE__ */ jsx6(
|
|
1659
|
+
"div",
|
|
1660
|
+
{
|
|
1661
|
+
className: classNames3(
|
|
1662
|
+
"text-xs font-medium uppercase tracking-wider text-[var(--tiger-text-muted,#6b7280)] shrink-0",
|
|
1663
|
+
gridInfo.labelClassName
|
|
1664
|
+
),
|
|
1665
|
+
children: column.title
|
|
1666
|
+
}
|
|
1667
|
+
),
|
|
1668
|
+
/* @__PURE__ */ jsx6(
|
|
1669
|
+
"div",
|
|
1670
|
+
{
|
|
1671
|
+
className: classNames3(
|
|
1672
|
+
"min-w-0 text-sm text-[var(--tiger-text,#111827)] break-words",
|
|
1673
|
+
gridInfo.valueClassName
|
|
1674
|
+
),
|
|
1675
|
+
children: renderCellContent(column)
|
|
1676
|
+
}
|
|
1677
|
+
)
|
|
1678
|
+
]
|
|
1679
|
+
},
|
|
1680
|
+
column.key
|
|
1681
|
+
);
|
|
1682
|
+
})
|
|
1683
|
+
}
|
|
1684
|
+
)
|
|
1685
|
+
] });
|
|
1686
|
+
}
|
|
1476
1687
|
return /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1477
1688
|
titleColumn && /* @__PURE__ */ jsxs4(
|
|
1478
1689
|
"div",
|
|
@@ -1488,119 +1699,20 @@ function Table({
|
|
|
1488
1699
|
}
|
|
1489
1700
|
),
|
|
1490
1701
|
(!titleColumn || cardSelectionPosition !== "title-inline") && controlsNode && /* @__PURE__ */ jsx6("div", { className: "mb-2 flex items-center gap-3", children: controlsNode }),
|
|
1491
|
-
/* @__PURE__ */
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
return /* @__PURE__ */ jsx6(
|
|
1496
|
-
"div",
|
|
1497
|
-
{
|
|
1498
|
-
className: classNames3(
|
|
1499
|
-
gridInfo.className,
|
|
1500
|
-
gridInfo.divider && "border-t border-[var(--tiger-border,#e5e7eb)] pt-3"
|
|
1501
|
-
),
|
|
1502
|
-
children: renderCellContent(column)
|
|
1503
|
-
},
|
|
1504
|
-
column.key
|
|
1505
|
-
);
|
|
1506
|
-
}
|
|
1507
|
-
if (gridInfo.labelPosition === "top") {
|
|
1508
|
-
return /* @__PURE__ */ jsxs4(
|
|
1509
|
-
"div",
|
|
1510
|
-
{
|
|
1511
|
-
className: classNames3(
|
|
1512
|
-
gridInfo.className,
|
|
1513
|
-
gridInfo.divider && "border-t border-[var(--tiger-border,#e5e7eb)] pt-3"
|
|
1514
|
-
),
|
|
1515
|
-
children: [
|
|
1516
|
-
/* @__PURE__ */ jsx6(
|
|
1517
|
-
"div",
|
|
1518
|
-
{
|
|
1519
|
-
className: classNames3(
|
|
1520
|
-
"text-xs font-medium uppercase tracking-wider text-[var(--tiger-text-muted,#6b7280)] mb-1",
|
|
1521
|
-
gridInfo.labelClassName
|
|
1522
|
-
),
|
|
1523
|
-
children: column.title
|
|
1524
|
-
}
|
|
1525
|
-
),
|
|
1526
|
-
/* @__PURE__ */ jsx6(
|
|
1527
|
-
"div",
|
|
1528
|
-
{
|
|
1529
|
-
className: classNames3(
|
|
1530
|
-
"min-w-0 text-sm text-[var(--tiger-text,#111827)] break-words",
|
|
1531
|
-
gridInfo.valueClassName
|
|
1532
|
-
),
|
|
1533
|
-
children: renderCellContent(column)
|
|
1534
|
-
}
|
|
1535
|
-
)
|
|
1536
|
-
]
|
|
1537
|
-
},
|
|
1538
|
-
column.key
|
|
1539
|
-
);
|
|
1540
|
-
}
|
|
1541
|
-
return /* @__PURE__ */ jsxs4(
|
|
1542
|
-
"div",
|
|
1543
|
-
{
|
|
1544
|
-
className: classNames3(
|
|
1545
|
-
gridInfo.className,
|
|
1546
|
-
"grid grid-cols-[auto_1fr] gap-2 items-baseline",
|
|
1547
|
-
gridInfo.divider && "border-t border-[var(--tiger-border,#e5e7eb)] pt-3"
|
|
1548
|
-
),
|
|
1549
|
-
children: [
|
|
1550
|
-
/* @__PURE__ */ jsx6(
|
|
1551
|
-
"div",
|
|
1552
|
-
{
|
|
1553
|
-
className: classNames3(
|
|
1554
|
-
"text-xs font-medium uppercase tracking-wider text-[var(--tiger-text-muted,#6b7280)] shrink-0",
|
|
1555
|
-
gridInfo.labelClassName
|
|
1556
|
-
),
|
|
1557
|
-
children: column.title
|
|
1558
|
-
}
|
|
1559
|
-
),
|
|
1560
|
-
/* @__PURE__ */ jsx6(
|
|
1561
|
-
"div",
|
|
1562
|
-
{
|
|
1563
|
-
className: classNames3(
|
|
1564
|
-
"min-w-0 text-sm text-[var(--tiger-text,#111827)] break-words",
|
|
1565
|
-
gridInfo.valueClassName
|
|
1566
|
-
),
|
|
1567
|
-
children: renderCellContent(column)
|
|
1568
|
-
}
|
|
1569
|
-
)
|
|
1570
|
-
]
|
|
1571
|
-
},
|
|
1572
|
-
column.key
|
|
1573
|
-
);
|
|
1574
|
-
}) })
|
|
1702
|
+
bodyColumns.map((column) => /* @__PURE__ */ jsxs4("div", { className: tableResponsiveCardRowClasses, children: [
|
|
1703
|
+
/* @__PURE__ */ jsx6("div", { className: tableResponsiveCardLabelClasses, children: column.title }),
|
|
1704
|
+
/* @__PURE__ */ jsx6("div", { className: tableResponsiveCardValueClasses, children: renderCellContent(column) })
|
|
1705
|
+
] }, column.key))
|
|
1575
1706
|
] });
|
|
1576
|
-
}
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
children: [
|
|
1586
|
-
cardSelectionPosition === "title-inline" && controlsNode,
|
|
1587
|
-
/* @__PURE__ */ jsx6("span", { className: "min-w-0 flex-1", children: renderCellContent(titleColumn) })
|
|
1588
|
-
]
|
|
1589
|
-
}
|
|
1590
|
-
),
|
|
1591
|
-
(!titleColumn || cardSelectionPosition !== "title-inline") && controlsNode && /* @__PURE__ */ jsx6("div", { className: "mb-2 flex items-center gap-3", children: controlsNode }),
|
|
1592
|
-
bodyColumns.map((column) => /* @__PURE__ */ jsxs4("div", { className: tableResponsiveCardRowClasses, children: [
|
|
1593
|
-
/* @__PURE__ */ jsx6("div", { className: tableResponsiveCardLabelClasses, children: column.title }),
|
|
1594
|
-
/* @__PURE__ */ jsx6("div", { className: tableResponsiveCardValueClasses, children: renderCellContent(column) })
|
|
1595
|
-
] }, column.key))
|
|
1596
|
-
] });
|
|
1597
|
-
})(),
|
|
1598
|
-
expandedNode && /* @__PURE__ */ jsx6("div", { className: "mt-3 border-t border-[var(--tiger-border,#e5e7eb)] pt-3", children: expandedNode })
|
|
1599
|
-
] })
|
|
1600
|
-
},
|
|
1601
|
-
key
|
|
1602
|
-
);
|
|
1603
|
-
})
|
|
1707
|
+
})(),
|
|
1708
|
+
expandedNode && /* @__PURE__ */ jsx6("div", { className: "mt-3 border-t border-[var(--tiger-border,#e5e7eb)] pt-3", children: expandedNode })
|
|
1709
|
+
] })
|
|
1710
|
+
},
|
|
1711
|
+
key
|
|
1712
|
+
);
|
|
1713
|
+
}),
|
|
1714
|
+
effectiveVirtual && virtualWindow && virtualWindow.bottomPad > 0 ? /* @__PURE__ */ jsx6("div", { "aria-hidden": "true", style: { height: `${virtualWindow.bottomPad}px` } }) : null
|
|
1715
|
+
] })
|
|
1604
1716
|
]
|
|
1605
1717
|
}
|
|
1606
1718
|
),
|
|
@@ -1612,7 +1724,7 @@ function Table({
|
|
|
1612
1724
|
"aria-live": "polite",
|
|
1613
1725
|
"aria-label": tableLabels.loadingText,
|
|
1614
1726
|
children: [
|
|
1615
|
-
/* @__PURE__ */ jsx6(
|
|
1727
|
+
/* @__PURE__ */ jsx6(Loading, { "aria-hidden": true, role: "presentation" }),
|
|
1616
1728
|
/* @__PURE__ */ jsx6("span", { className: "sr-only", children: tableLabels.loadingText })
|
|
1617
1729
|
]
|
|
1618
1730
|
}
|
|
@@ -1631,9 +1743,6 @@ function areNumberRecordsEqual(current, next) {
|
|
|
1631
1743
|
const nextKeys = Object.keys(next);
|
|
1632
1744
|
return currentKeys.length === nextKeys.length && nextKeys.every((key) => current[key] === next[key]);
|
|
1633
1745
|
}
|
|
1634
|
-
function areNumberArraysEqual(current, next) {
|
|
1635
|
-
return current.length === next.length && next.every((value, index) => current[index] === value);
|
|
1636
|
-
}
|
|
1637
1746
|
|
|
1638
1747
|
export {
|
|
1639
1748
|
Table
|