@expcat/tigercat-vue 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/README.md +6 -0
- package/dist/{chunk-RRLE7QRH.mjs → chunk-2GYERJBM.mjs} +100 -66
- package/dist/{chunk-3MO7A4GU.mjs → chunk-2HP6DX7Q.mjs} +21 -15
- package/dist/{chunk-BC74Z6IG.mjs → chunk-2J6F4OVC.mjs} +4 -16
- package/dist/{chunk-IFASMNTU.mjs → chunk-2SC2HIVS.mjs} +608 -518
- package/dist/{chunk-SPFL55TF.mjs → chunk-2XITUFL6.mjs} +34 -30
- package/dist/{chunk-QZRSFGZZ.mjs → chunk-35JLHFUT.mjs} +19 -18
- package/dist/chunk-36CRSIXF.mjs +122 -0
- package/dist/{chunk-A5QYJSHK.mjs → chunk-3DFYNKHA.mjs} +86 -21
- package/dist/chunk-3VUEZQOO.mjs +287 -0
- package/dist/chunk-3VZRHFXF.mjs +337 -0
- package/dist/chunk-45DXSHX6.mjs +140 -0
- package/dist/{chunk-UOJOJBEU.mjs → chunk-4GOTWNOO.mjs} +63 -51
- package/dist/chunk-4H3PX46K.mjs +287 -0
- package/dist/{chunk-PFIV5MXD.mjs → chunk-4INCDD5K.mjs} +16 -0
- package/dist/chunk-4KIZXFFG.mjs +155 -0
- package/dist/chunk-4KOKMAMY.mjs +133 -0
- package/dist/{chunk-Z2ZECCGD.mjs → chunk-4QMHNTUU.mjs} +9 -1
- package/dist/chunk-4SGEY2EB.mjs +236 -0
- package/dist/chunk-4VJB4XFH.mjs +316 -0
- package/dist/chunk-55BVZU4O.mjs +417 -0
- package/dist/{chunk-6GR5U4UB.mjs → chunk-56QJDQQF.mjs} +42 -10
- package/dist/chunk-5DBHUGYU.mjs +668 -0
- package/dist/chunk-5G5CROE3.mjs +480 -0
- package/dist/{chunk-H2SX7D23.mjs → chunk-5RJDVHNT.mjs} +48 -57
- package/dist/chunk-5T5QNVKL.mjs +137 -0
- package/dist/chunk-5TASA6W6.mjs +743 -0
- package/dist/{chunk-2TNZ4JNT.mjs → chunk-5VSSB4QF.mjs} +2 -21
- package/dist/chunk-5YYI73DZ.mjs +570 -0
- package/dist/chunk-63I4VHHU.mjs +161 -0
- package/dist/{chunk-WE4DGU2T.mjs → chunk-63QGROKA.mjs} +41 -15
- package/dist/chunk-64WXJ662.mjs +213 -0
- package/dist/{chunk-SNNT64HK.mjs → chunk-6K5BLE4Q.mjs} +48 -20
- package/dist/chunk-6QMYRKPV.mjs +262 -0
- package/dist/{chunk-XFNHZ7SV.mjs → chunk-6RSCF4DV.mjs} +71 -51
- package/dist/{chunk-7LUATGJU.mjs → chunk-6XQGWPZJ.mjs} +97 -62
- package/dist/chunk-76VWECLZ.mjs +372 -0
- package/dist/{chunk-JIU5UEOU.mjs → chunk-7B6XJBIJ.mjs} +174 -146
- package/dist/{chunk-HWL36OCD.mjs → chunk-7G6YBK6O.mjs} +138 -92
- package/dist/{chunk-342DH5CF.mjs → chunk-7PLYHGMY.mjs} +35 -16
- package/dist/chunk-7SUS7OIH.mjs +316 -0
- package/dist/chunk-A5XTNVXI.mjs +281 -0
- package/dist/chunk-AFNJO6KJ.mjs +201 -0
- package/dist/chunk-AGZARRL3.mjs +109 -0
- package/dist/chunk-AI6X2WFK.mjs +124 -0
- package/dist/{chunk-BGGHSTMP.mjs → chunk-AJTD3TMG.mjs} +38 -31
- package/dist/{chunk-67VS6QHJ.mjs → chunk-APWDXCWD.mjs} +143 -90
- package/dist/chunk-B4RZHDOU.mjs +565 -0
- package/dist/chunk-B5FXTGBV.mjs +81 -0
- package/dist/{chunk-46DEQQMB.mjs → chunk-BFIYTA3E.mjs} +9 -13
- package/dist/chunk-BKSYSJTM.mjs +586 -0
- package/dist/{chunk-IPGPLFUZ.mjs → chunk-BLTPZIJN.mjs} +163 -92
- package/dist/chunk-C5WYGY6Z.mjs +921 -0
- package/dist/{chunk-VFS5XAZ3.mjs → chunk-CGNBG7NB.mjs} +69 -30
- package/dist/chunk-CMYPAPF2.mjs +94 -0
- package/dist/chunk-CSRUF7G6.mjs +291 -0
- package/dist/{chunk-POWDTOMF.mjs → chunk-DU5F2EE7.mjs} +160 -127
- package/dist/chunk-DXL3YHRP.mjs +92 -0
- package/dist/{chunk-H4DEIGEG.mjs → chunk-ETJ4QD6U.mjs} +195 -78
- package/dist/chunk-F2LUNHMK.mjs +611 -0
- package/dist/chunk-FEVDV3I6.mjs +22 -0
- package/dist/chunk-FGQ7VMHF.mjs +499 -0
- package/dist/chunk-G6PIOE4B.mjs +528 -0
- package/dist/{chunk-6GR3XC5V.mjs → chunk-G6R2CQRS.mjs} +158 -49
- package/dist/chunk-GGSM7VKL.mjs +348 -0
- package/dist/chunk-GHY4XGDM.mjs +446 -0
- package/dist/{chunk-P62TYR3M.mjs → chunk-H6EOA6Q6.mjs} +79 -44
- package/dist/{chunk-3ONCXHE5.mjs → chunk-H7IBRMXU.mjs} +48 -14
- package/dist/chunk-HFGELYYC.mjs +295 -0
- package/dist/{chunk-5OILGUNU.mjs → chunk-HNMVYUUZ.mjs} +138 -49
- package/dist/{chunk-GBPMQJJJ.mjs → chunk-HSKBYNCP.mjs} +57 -20
- package/dist/chunk-HZJH4DNQ.mjs +307 -0
- package/dist/{chunk-NN6AINLG.mjs → chunk-I77GUQV4.mjs} +6 -4
- package/dist/chunk-IEYMYVIN.mjs +528 -0
- package/dist/chunk-IO6I54M3.mjs +298 -0
- package/dist/{chunk-OYU47A57.mjs → chunk-IOSUZR6Z.mjs} +93 -56
- package/dist/chunk-IWGC7M62.mjs +428 -0
- package/dist/chunk-IX3VRRYB.mjs +60 -0
- package/dist/{chunk-VIIGYWUY.mjs → chunk-J4HGCSOE.mjs} +16 -15
- package/dist/chunk-JBSMLUJJ.mjs +500 -0
- package/dist/chunk-JKMKCW57.mjs +96 -0
- package/dist/chunk-JL4IFWYN.mjs +818 -0
- package/dist/chunk-JOZYNAU6.mjs +131 -0
- package/dist/{chunk-JQSIWPNM.mjs → chunk-K46SNCCE.mjs} +36 -53
- package/dist/{chunk-YLO73TDM.mjs → chunk-KFWSS65S.mjs} +124 -44
- package/dist/chunk-KO7NA3F6.mjs +765 -0
- package/dist/chunk-KPWSO25U.mjs +139 -0
- package/dist/{chunk-FISKCPTN.mjs → chunk-L5ZHCFHX.mjs} +87 -46
- package/dist/{chunk-BOHE5URZ.mjs → chunk-LAT52FFS.mjs} +186 -155
- package/dist/{chunk-UXJRH72H.mjs → chunk-LMVNBPQP.mjs} +157 -158
- package/dist/chunk-LNKOYOX2.mjs +80 -0
- package/dist/chunk-LSODMFHX.mjs +297 -0
- package/dist/{chunk-6NYC7EY2.mjs → chunk-LY64PCAS.mjs} +171 -134
- package/dist/{chunk-B4MDHE3L.mjs → chunk-LYCCTNID.mjs} +131 -103
- package/dist/chunk-M3H5WDQB.mjs +114 -0
- package/dist/chunk-M5ULTISP.mjs +142 -0
- package/dist/{chunk-UNQO7EVG.mjs → chunk-MNVDK2BL.mjs} +29 -34
- package/dist/chunk-MPYKNKZU.mjs +420 -0
- package/dist/chunk-MTOGCPOV.mjs +369 -0
- package/dist/{chunk-M4FWWEMX.mjs → chunk-MVG5DA7S.mjs} +120 -103
- package/dist/{chunk-7XDNHGDA.mjs → chunk-OGKNRXUA.mjs} +24 -28
- package/dist/chunk-OGXSLKXD.mjs +182 -0
- package/dist/chunk-OKVAKVTR.mjs +8 -0
- package/dist/{chunk-BBNCP55O.mjs → chunk-ONMBVAXK.mjs} +85 -24
- package/dist/chunk-ONSDH4KJ.mjs +286 -0
- package/dist/chunk-OO27UB75.mjs +222 -0
- package/dist/{chunk-PWWWACHC.mjs → chunk-OY5PZMFI.mjs} +50 -100
- package/dist/{chunk-GSB4MNEX.mjs → chunk-PFE3YML2.mjs} +15 -1
- package/dist/chunk-PJHLYJD5.mjs +64 -0
- package/dist/{chunk-JHFM6IFO.mjs → chunk-PVJDEAOW.mjs} +26 -12
- package/dist/chunk-QFASGPNS.mjs +576 -0
- package/dist/chunk-QGESVML4.mjs +444 -0
- package/dist/chunk-QIEFLYF3.mjs +193 -0
- package/dist/{chunk-VL7GENWD.mjs → chunk-QNULT27U.mjs} +14 -20
- package/dist/chunk-QUUCZPN5.mjs +405 -0
- package/dist/{chunk-7PY6OQVE.mjs → chunk-QVVRQZUT.mjs} +24 -23
- package/dist/chunk-RF6WUEZE.mjs +588 -0
- package/dist/chunk-RLII7QEJ.mjs +474 -0
- package/dist/chunk-S3A7X7PP.mjs +123 -0
- package/dist/chunk-SBRQ3OFZ.mjs +379 -0
- package/dist/chunk-SC4MACIG.mjs +520 -0
- package/dist/{chunk-626VUZ2Q.mjs → chunk-SG7V5ROT.mjs} +52 -41
- package/dist/{chunk-DRLQCY7R.mjs → chunk-SJ6Z7IMD.mjs} +184 -157
- package/dist/{chunk-HS4YQGZQ.mjs → chunk-SZO4WL42.mjs} +82 -26
- package/dist/{chunk-TBOXTAIA.mjs → chunk-T2ESVQNC.mjs} +31 -14
- package/dist/{chunk-M7EBWJZ5.mjs → chunk-T5UGCVQW.mjs} +26 -10
- package/dist/{chunk-Q3PELK37.mjs → chunk-TMOWIIJQ.mjs} +17 -1
- package/dist/chunk-TQEN6GDE.mjs +348 -0
- package/dist/{chunk-AY7CGLMO.mjs → chunk-TWZHKFFE.mjs} +76 -50
- package/dist/chunk-TYJBLP5U.mjs +67 -0
- package/dist/chunk-UDYEWEBD.mjs +351 -0
- package/dist/{chunk-IK2WHKDA.mjs → chunk-UFQRKWKG.mjs} +181 -163
- package/dist/chunk-UUY7X4DY.mjs +47 -0
- package/dist/{chunk-V443QIJM.mjs → chunk-V4H2Z5ZO.mjs} +50 -30
- package/dist/chunk-V5AH52TD.mjs +374 -0
- package/dist/chunk-V5BSH3EF.mjs +241 -0
- package/dist/chunk-VA5YVPHW.mjs +31 -0
- package/dist/chunk-VCXYK54V.mjs +281 -0
- package/dist/chunk-VDBAGIPC.mjs +87 -0
- package/dist/chunk-VJ5OA6JN.mjs +116 -0
- package/dist/{chunk-B67RJSXR.mjs → chunk-VJR5UFDE.mjs} +72 -33
- package/dist/{chunk-TCV6YPH5.mjs → chunk-VMM2KJAS.mjs} +149 -106
- package/dist/chunk-W4A6L2TC.mjs +161 -0
- package/dist/{chunk-PJQTRDIG.mjs → chunk-WUIS6PLE.mjs} +136 -113
- package/dist/{chunk-ASOJXXU6.mjs → chunk-WULBKPDO.mjs} +54 -14
- package/dist/chunk-X2FGWVNP.mjs +276 -0
- package/dist/{chunk-SJINC5NF.mjs → chunk-X7UK3A6Z.mjs} +46 -32
- package/dist/chunk-XCIQNTJN.mjs +418 -0
- package/dist/chunk-XHNQITBG.mjs +398 -0
- package/dist/chunk-XNBR5ETD.mjs +380 -0
- package/dist/{chunk-RRNQL6MJ.mjs → chunk-XWL3IP7Z.mjs} +77 -73
- package/dist/chunk-XXREA57H.mjs +203 -0
- package/dist/chunk-XY2NDPX7.mjs +713 -0
- package/dist/{chunk-Q7Y22OFX.mjs → chunk-Y63TRXZO.mjs} +147 -57
- package/dist/chunk-YPONYV6R.mjs +366 -0
- package/dist/chunk-ZBNUL3I3.mjs +180 -0
- package/dist/chunk-ZIGSSG3J.mjs +408 -0
- package/dist/chunk-ZO2SVLGC.mjs +233 -0
- package/dist/chunk-ZQCKZXQI.mjs +317 -0
- package/dist/{chunk-AECXFT7D.mjs → chunk-ZT64YHUT.mjs} +34 -6
- package/dist/chunk-ZTALXP6T.mjs +62 -0
- package/dist/chunk-ZW2VXGO3.mjs +186 -0
- package/dist/{chunk-PMQSXEMT.mjs → chunk-ZWKDK6AF.mjs} +24 -18
- package/dist/components/ActivityFeed.d.mts +1 -1
- package/dist/components/ActivityFeed.mjs +14 -12
- package/dist/components/Affix.d.mts +8 -6
- package/dist/components/Affix.mjs +1 -1
- package/dist/components/Alert.d.mts +42 -11
- package/dist/components/Alert.mjs +3 -2
- package/dist/components/Anchor.d.mts +34 -90
- package/dist/components/Anchor.mjs +3 -1
- package/dist/components/AreaChart.d.mts +19 -11
- package/dist/components/AreaChart.mjs +11 -9
- package/dist/components/AutoComplete.d.mts +125 -35
- package/dist/components/AutoComplete.mjs +5 -4
- package/dist/components/Avatar.d.mts +72 -67
- package/dist/components/Avatar.mjs +4 -4
- package/dist/components/AvatarGroup.d.mts +12 -5
- package/dist/components/AvatarGroup.mjs +3 -3
- package/dist/components/BackTop.d.mts +31 -34
- package/dist/components/BackTop.mjs +2 -1
- package/dist/components/Badge.d.mts +2 -4
- package/dist/components/Badge.mjs +1 -3
- package/dist/components/BarChart.d.mts +27 -16
- package/dist/components/BarChart.mjs +11 -9
- package/dist/components/Breadcrumb.d.mts +42 -95
- package/dist/components/Breadcrumb.mjs +5 -3
- package/dist/components/Button.d.mts +13 -57
- package/dist/components/Button.mjs +2 -2
- package/dist/components/ButtonGroup.mjs +1 -1
- package/dist/components/Calendar.d.mts +56 -14
- package/dist/components/Calendar.mjs +2 -3
- package/dist/components/Card.d.mts +11 -67
- package/dist/components/Card.mjs +1 -1
- package/dist/components/Carousel.d.mts +9 -112
- package/dist/components/Carousel.mjs +3 -3
- package/dist/components/Cascader.d.mts +119 -60
- package/dist/components/Cascader.mjs +7 -8
- package/dist/components/ChartAxis.mjs +1 -1
- package/dist/components/ChartCanvas.d.mts +12 -2
- package/dist/components/ChartCanvas.mjs +1 -1
- package/dist/components/ChartGrid.d.mts +24 -0
- package/dist/components/ChartGrid.mjs +1 -1
- package/dist/components/ChartLegend.d.mts +9 -18
- package/dist/components/ChartLegend.mjs +2 -1
- package/dist/components/ChartSeries.d.mts +3 -3
- package/dist/components/ChartSeries.mjs +1 -1
- package/dist/components/ChartTooltip.d.mts +6 -5
- package/dist/components/ChartTooltip.mjs +2 -1
- package/dist/components/ChatWindow.d.mts +8 -10
- package/dist/components/ChatWindow.mjs +13 -12
- package/dist/components/Checkbox.d.mts +14 -65
- package/dist/components/Checkbox.mjs +3 -2
- package/dist/components/CheckboxGroup.d.mts +18 -49
- package/dist/components/CheckboxGroup.mjs +2 -1
- package/dist/components/Code.d.mts +1 -1
- package/dist/components/Code.mjs +2 -3
- package/dist/components/CodeEditor.d.mts +64 -16
- package/dist/components/CodeEditor.mjs +3 -1
- package/dist/components/Col.d.mts +10 -8
- package/dist/components/Col.mjs +1 -2
- package/dist/components/Collapse.d.mts +17 -8
- package/dist/components/Collapse.mjs +5 -3
- package/dist/components/CollapsePanel.d.mts +7 -6
- package/dist/components/CollapsePanel.mjs +2 -2
- package/dist/components/ColorPicker.d.mts +100 -19
- package/dist/components/ColorPicker.mjs +5 -4
- package/dist/components/ColorSwatch.d.mts +65 -5
- package/dist/components/ColorSwatch.mjs +3 -1
- package/dist/components/CommentThread.d.mts +14 -4
- package/dist/components/CommentThread.mjs +12 -11
- package/dist/components/ConfigProvider.d.mts +4 -10
- package/dist/components/ConfigProvider.mjs +1 -2
- package/dist/components/Container.d.mts +10 -32
- package/dist/components/Container.mjs +1 -1
- package/dist/components/Content.d.mts +11 -21
- package/dist/components/Content.mjs +2 -1
- package/dist/components/ContextMenu.d.mts +28 -9
- package/dist/components/ContextMenu.mjs +3 -2
- package/dist/components/Countdown.d.mts +33 -2
- package/dist/components/Countdown.mjs +1 -1
- package/dist/components/CronEditor.d.mts +23 -5
- package/dist/components/CronEditor.mjs +3 -3
- package/dist/components/CropUpload.d.mts +3 -2
- package/dist/components/CropUpload.mjs +9 -8
- package/dist/components/DataExport.d.mts +16 -5
- package/dist/components/DataExport.mjs +5 -5
- package/dist/components/DataTableWithToolbar.d.mts +255 -318
- package/dist/components/DataTableWithToolbar.mjs +20 -18
- package/dist/components/DatePicker.d.mts +140 -212
- package/dist/components/DatePicker.mjs +6 -5
- package/dist/components/Descriptions.d.mts +20 -82
- package/dist/components/Descriptions.mjs +2 -1
- package/dist/components/Divider.d.mts +20 -0
- package/dist/components/Divider.mjs +1 -1
- package/dist/components/DonutChart.d.mts +4 -291
- package/dist/components/DonutChart.mjs +9 -7
- package/dist/components/Drawer.d.mts +34 -47
- package/dist/components/Drawer.mjs +3 -4
- package/dist/components/Dropdown.d.mts +37 -133
- package/dist/components/Dropdown.mjs +3 -2
- package/dist/components/Empty.d.mts +1 -1
- package/dist/components/Empty.mjs +2 -3
- package/dist/components/FileManager.d.mts +41 -14
- package/dist/components/FileManager.mjs +3 -3
- package/dist/components/FloatButton.d.mts +43 -10
- package/dist/components/FloatButton.mjs +3 -1
- package/dist/components/Footer.d.mts +13 -23
- package/dist/components/Footer.mjs +1 -1
- package/dist/components/Form.d.mts +30 -98
- package/dist/components/Form.mjs +6 -5
- package/dist/components/FormItem.d.mts +5 -61
- package/dist/components/FormItem.mjs +4 -5
- package/dist/components/FormItemContext.d.mts +10 -2
- package/dist/components/FormWizard.d.mts +6 -21
- package/dist/components/FormWizard.mjs +8 -6
- package/dist/components/FunnelChart.d.mts +29 -3
- package/dist/components/FunnelChart.mjs +8 -6
- package/dist/components/Gantt.d.mts +34 -7
- package/dist/components/Gantt.mjs +3 -2
- package/dist/components/GaugeChart.d.mts +23 -4
- package/dist/components/GaugeChart.mjs +5 -3
- package/dist/components/Header.d.mts +3 -31
- package/dist/components/Header.mjs +1 -1
- package/dist/components/HeatmapChart.d.mts +34 -5
- package/dist/components/HeatmapChart.mjs +7 -4
- package/dist/components/Highlight.d.mts +3 -3
- package/dist/components/Highlight.mjs +1 -1
- package/dist/components/Icon.d.mts +6 -8
- package/dist/components/Icon.mjs +1 -1
- package/dist/components/Image.d.mts +67 -4
- package/dist/components/Image.mjs +6 -8
- package/dist/components/ImageAnnotation.d.mts +7 -4
- package/dist/components/ImageAnnotation.mjs +2 -3
- package/dist/components/ImageCompare.d.mts +5 -5
- package/dist/components/ImageCompare.mjs +2 -1
- package/dist/components/ImageCropper.d.mts +36 -6
- package/dist/components/ImageCropper.mjs +2 -3
- package/dist/components/ImageGroup.d.mts +17 -4
- package/dist/components/ImageGroup.mjs +4 -4
- package/dist/components/ImagePreview.d.mts +61 -19
- package/dist/components/ImagePreview.mjs +3 -3
- package/dist/components/ImageViewer.d.mts +92 -34
- package/dist/components/ImageViewer.mjs +4 -3
- package/dist/components/InfiniteScroll.d.mts +22 -14
- package/dist/components/InfiniteScroll.mjs +2 -3
- package/dist/components/Input.d.mts +2 -124
- package/dist/components/Input.mjs +4 -2
- package/dist/components/InputGroup.d.mts +0 -10
- package/dist/components/InputGroup.mjs +1 -1
- package/dist/components/InputNumber.d.mts +18 -42
- package/dist/components/InputNumber.mjs +4 -2
- package/dist/components/InputOTP.d.mts +6 -113
- package/dist/components/InputOTP.mjs +2 -3
- package/dist/components/Kanban.d.mts +5 -174
- package/dist/components/Kanban.mjs +3 -4
- package/dist/components/Kbd.d.mts +3 -3
- package/dist/components/Kbd.mjs +1 -1
- package/dist/components/Layout.d.mts +34 -15
- package/dist/components/Layout.mjs +3 -1
- package/dist/components/LineChart.d.mts +19 -11
- package/dist/components/LineChart.mjs +11 -9
- package/dist/components/Link.d.mts +4 -4
- package/dist/components/Link.mjs +1 -1
- package/dist/components/List.d.mts +24 -173
- package/dist/components/List.mjs +8 -5
- package/dist/components/Loading.d.mts +14 -12
- package/dist/components/Loading.mjs +3 -4
- package/dist/components/LoadingBar.d.mts +2 -3
- package/dist/components/LoadingBar.mjs +56 -67
- package/dist/components/LoadingBarContainer.d.mts +6 -5
- package/dist/components/LoadingBarContainer.mjs +2 -1
- package/dist/components/LoadingBarRoot.d.mts +1 -0
- package/dist/components/LoadingBarRoot.mjs +1 -1
- package/dist/components/MarkdownEditor.d.mts +49 -9
- package/dist/components/MarkdownEditor.mjs +3 -3
- package/dist/components/Marquee.d.mts +51 -11
- package/dist/components/Marquee.mjs +1 -1
- package/dist/components/MaskInput.d.mts +9 -86
- package/dist/components/MaskInput.mjs +4 -3
- package/dist/components/Masonry.d.mts +4 -8
- package/dist/components/Masonry.mjs +2 -1
- package/dist/components/Mentions.d.mts +133 -19
- package/dist/components/Mentions.mjs +5 -2
- package/dist/components/Menu.d.mts +75 -163
- package/dist/components/Menu.mjs +11 -4
- package/dist/components/Message.d.mts +1 -2
- package/dist/components/Message.mjs +53 -100
- package/dist/components/MessageContainer.d.mts +22 -7
- package/dist/components/MessageContainer.mjs +4 -2
- package/dist/components/MessageRoot.d.mts +1 -0
- package/dist/components/MessageRoot.mjs +1 -1
- package/dist/components/Modal.d.mts +40 -20
- package/dist/components/Modal.mjs +5 -6
- package/dist/components/NavigationMenu.d.mts +37 -25
- package/dist/components/NavigationMenu.mjs +6 -4
- package/dist/components/Notification.d.mts +1 -2
- package/dist/components/Notification.mjs +67 -162
- package/dist/components/NotificationCenter.d.mts +2 -2
- package/dist/components/NotificationCenter.mjs +15 -13
- package/dist/components/NotificationContainer.d.mts +31 -7
- package/dist/components/NotificationContainer.mjs +4 -2
- package/dist/components/NotificationRoot.d.mts +1 -0
- package/dist/components/NotificationRoot.mjs +1 -1
- package/dist/components/NumberKeyboard.d.mts +70 -11
- package/dist/components/NumberKeyboard.mjs +4 -3
- package/dist/components/OrgChart.d.mts +13 -8
- package/dist/components/OrgChart.mjs +3 -2
- package/dist/components/PageHeader.d.mts +33 -3
- package/dist/components/PageHeader.mjs +5 -4
- package/dist/components/Pagination.d.mts +5 -4
- package/dist/components/Pagination.mjs +2 -3
- package/dist/components/PieChart.d.mts +42 -11
- package/dist/components/PieChart.mjs +8 -6
- package/dist/components/Popconfirm.d.mts +33 -36
- package/dist/components/Popconfirm.mjs +7 -3
- package/dist/components/Popover.d.mts +26 -25
- package/dist/components/Popover.mjs +4 -3
- package/dist/components/PrintLayout.d.mts +60 -12
- package/dist/components/PrintLayout.mjs +2 -1
- package/dist/components/Progress.d.mts +3 -1
- package/dist/components/Progress.mjs +2 -1
- package/dist/components/QRCode.d.mts +2 -3
- package/dist/components/QRCode.mjs +2 -3
- package/dist/components/RadarChart.d.mts +34 -14
- package/dist/components/RadarChart.mjs +8 -6
- package/dist/components/Radio.d.mts +15 -66
- package/dist/components/Radio.mjs +3 -2
- package/dist/components/RadioGroup.d.mts +18 -53
- package/dist/components/RadioGroup.mjs +2 -1
- package/dist/components/Rate.d.mts +27 -0
- package/dist/components/Rate.mjs +2 -3
- package/dist/components/Resizable.d.mts +24 -2
- package/dist/components/Resizable.mjs +2 -1
- package/dist/components/Result.d.mts +12 -2
- package/dist/components/Result.mjs +2 -2
- package/dist/components/RichTextEditor.d.mts +49 -11
- package/dist/components/RichTextEditor.mjs +3 -3
- package/dist/components/Row.d.mts +12 -38
- package/dist/components/Row.mjs +3 -5
- package/dist/components/ScatterChart.d.mts +41 -5
- package/dist/components/ScatterChart.mjs +11 -11
- package/dist/components/ScrollArea.d.mts +15 -15
- package/dist/components/ScrollArea.mjs +2 -1
- package/dist/components/ScrollSpy.d.mts +21 -11
- package/dist/components/ScrollSpy.mjs +2 -1
- package/dist/components/Segmented.d.mts +18 -0
- package/dist/components/Segmented.mjs +2 -1
- package/dist/components/Select.d.mts +108 -140
- package/dist/components/Select.mjs +5 -4
- package/dist/components/Sidebar.d.mts +14 -41
- package/dist/components/Sidebar.mjs +3 -1
- package/dist/components/Signature.d.mts +70 -10
- package/dist/components/Signature.mjs +3 -3
- package/dist/components/Skeleton.d.mts +1 -1
- package/dist/components/Skeleton.mjs +1 -1
- package/dist/components/Slider.d.mts +13 -116
- package/dist/components/Slider.mjs +3 -1
- package/dist/components/Space.d.mts +18 -0
- package/dist/components/Space.mjs +1 -1
- package/dist/components/SplitButton.d.mts +17 -128
- package/dist/components/SplitButton.mjs +8 -5
- package/dist/components/Splitter.d.mts +1 -1
- package/dist/components/Splitter.mjs +3 -1
- package/dist/components/Spotlight.d.mts +18 -17
- package/dist/components/Spotlight.mjs +3 -4
- package/dist/components/Statistic.d.mts +11 -2
- package/dist/components/Statistic.mjs +2 -1
- package/dist/components/Stepper.d.mts +13 -7
- package/dist/components/Stepper.mjs +3 -1
- package/dist/components/Steps.d.mts +38 -6
- package/dist/components/Steps.mjs +7 -3
- package/dist/components/SunburstChart.d.mts +20 -3
- package/dist/components/SunburstChart.mjs +8 -6
- package/dist/components/Switch.d.mts +31 -43
- package/dist/components/Switch.mjs +2 -1
- package/dist/components/Table.d.mts +16 -87
- package/dist/components/Table.mjs +17 -11
- package/dist/components/Tabs.d.mts +7 -147
- package/dist/components/Tabs.mjs +7 -5
- package/dist/components/Tag.d.mts +51 -6
- package/dist/components/Tag.mjs +2 -3
- package/dist/components/TagsInput.d.mts +8 -79
- package/dist/components/TagsInput.mjs +5 -4
- package/dist/components/TaskBoard.d.mts +11 -17
- package/dist/components/TaskBoard.mjs +2 -3
- package/dist/components/Text.d.mts +5 -5
- package/dist/components/Text.mjs +1 -1
- package/dist/components/Textarea.d.mts +24 -130
- package/dist/components/Textarea.mjs +3 -2
- package/dist/components/TimePicker.d.mts +131 -228
- package/dist/components/TimePicker.mjs +5 -5
- package/dist/components/Timeline.d.mts +12 -37
- package/dist/components/Timeline.mjs +2 -3
- package/dist/components/Tooltip.d.mts +24 -21
- package/dist/components/Tooltip.mjs +4 -3
- package/dist/components/Tour.d.mts +38 -3
- package/dist/components/Tour.mjs +6 -5
- package/dist/components/Transfer.d.mts +73 -21
- package/dist/components/Transfer.mjs +6 -3
- package/dist/components/Tree.d.mts +110 -250
- package/dist/components/Tree.mjs +7 -4
- package/dist/components/TreeMapChart.d.mts +29 -3
- package/dist/components/TreeMapChart.mjs +8 -6
- package/dist/components/TreeSelect.d.mts +188 -81
- package/dist/components/TreeSelect.mjs +7 -9
- package/dist/components/Upload.d.mts +107 -145
- package/dist/components/Upload.mjs +8 -3
- package/dist/components/VirtualList.d.mts +31 -4
- package/dist/components/VirtualList.mjs +1 -1
- package/dist/components/VirtualTable.d.mts +21 -8
- package/dist/components/VirtualTable.mjs +2 -3
- package/dist/components/Watermark.d.mts +5 -5
- package/dist/components/Watermark.mjs +1 -1
- package/dist/composables/useChartInteraction.d.mts +14 -63
- package/dist/composables/useChartInteraction.mjs +1 -1
- package/dist/composables/useDrag.d.mts +5 -23
- package/dist/composables/useDrag.mjs +1 -1
- package/dist/composables/useFormController.d.mts +3 -15
- package/dist/composables/useFormController.mjs +1 -1
- package/dist/composables/useResponsiveChartSize.d.mts +16 -0
- package/dist/composables/useResponsiveChartSize.mjs +6 -0
- package/dist/index.d.mts +84 -81
- package/dist/index.mjs +1389 -207
- package/dist/props-QAuP2pUi.d.mts +61 -0
- package/package.json +18 -8
- package/dist/chunk-22NIOTDQ.mjs +0 -145
- package/dist/chunk-26QCTL2E.mjs +0 -180
- package/dist/chunk-2ZUEXCVJ.mjs +0 -58
- package/dist/chunk-36ZFDXKU.mjs +0 -307
- package/dist/chunk-3FPS7XVB.mjs +0 -164
- package/dist/chunk-3KAHJF7D.mjs +0 -268
- package/dist/chunk-3OCHBGPF.mjs +0 -835
- package/dist/chunk-42P6ZQ3J.mjs +0 -387
- package/dist/chunk-5C32WCQY.mjs +0 -325
- package/dist/chunk-6JAAXPBW.mjs +0 -254
- package/dist/chunk-6TTICJR4.mjs +0 -155
- package/dist/chunk-73Z7N7VG.mjs +0 -204
- package/dist/chunk-7C7SG3SS.mjs +0 -269
- package/dist/chunk-7FWNN6PO.mjs +0 -296
- package/dist/chunk-7TJE7OYH.mjs +0 -427
- package/dist/chunk-7VHXZX7Y.mjs +0 -997
- package/dist/chunk-AOLRZG4E.mjs +0 -347
- package/dist/chunk-BCU7GYF6.mjs +0 -476
- package/dist/chunk-BQK7LH2L.mjs +0 -441
- package/dist/chunk-BSOLH6R5.mjs +0 -129
- package/dist/chunk-CCC3S6LK.mjs +0 -345
- package/dist/chunk-CLTRADS7.mjs +0 -115
- package/dist/chunk-DP25XFAH.mjs +0 -45
- package/dist/chunk-E523VGZP.mjs +0 -279
- package/dist/chunk-EC62TY2Y.mjs +0 -300
- package/dist/chunk-FEQ7PZXI.mjs +0 -160
- package/dist/chunk-FHUGOSEY.mjs +0 -144
- package/dist/chunk-FIEECAJV.mjs +0 -312
- package/dist/chunk-FWO7RNGI.mjs +0 -892
- package/dist/chunk-GQOPDD44.mjs +0 -519
- package/dist/chunk-HAUG3OP5.mjs +0 -476
- package/dist/chunk-I7ZMDGAR.mjs +0 -95
- package/dist/chunk-JBS3AESR.mjs +0 -255
- package/dist/chunk-K3WTQBE4.mjs +0 -394
- package/dist/chunk-K5MHUMKR.mjs +0 -296
- package/dist/chunk-K5RYFPOQ.mjs +0 -852
- package/dist/chunk-KIPTVKU2.mjs +0 -104
- package/dist/chunk-KIUGJNQO.mjs +0 -783
- package/dist/chunk-LH2V2JMZ.mjs +0 -168
- package/dist/chunk-LRFKHJDU.mjs +0 -342
- package/dist/chunk-M3G6LJKZ.mjs +0 -76
- package/dist/chunk-MI6TL3CQ.mjs +0 -128
- package/dist/chunk-MYKKKVGK.mjs +0 -164
- package/dist/chunk-N2XV37BL.mjs +0 -783
- package/dist/chunk-NMAJD353.mjs +0 -851
- package/dist/chunk-P3VAY2IQ.mjs +0 -112
- package/dist/chunk-P7X46BAW.mjs +0 -308
- package/dist/chunk-PD2PKYJE.mjs +0 -213
- package/dist/chunk-PGF7HLLR.mjs +0 -145
- package/dist/chunk-PSGVG4TN.mjs +0 -229
- package/dist/chunk-PVPLDEC5.mjs +0 -39
- package/dist/chunk-QMECRLHW.mjs +0 -122
- package/dist/chunk-QWLD5FMJ.mjs +0 -67
- package/dist/chunk-QZLOF36M.mjs +0 -354
- package/dist/chunk-RANRYFUI.mjs +0 -461
- package/dist/chunk-RHQWQJ4I.mjs +0 -244
- package/dist/chunk-S4BKVFQ7.mjs +0 -192
- package/dist/chunk-S5RTMAQN.mjs +0 -230
- package/dist/chunk-SAC4PAG3.mjs +0 -426
- package/dist/chunk-SL5KAVZK.mjs +0 -47
- package/dist/chunk-SWCK7TM7.mjs +0 -124
- package/dist/chunk-SWMYIORV.mjs +0 -115
- package/dist/chunk-SX3NAN4M.mjs +0 -328
- package/dist/chunk-TC6ZPQFT.mjs +0 -150
- package/dist/chunk-TDBMAKTJ.mjs +0 -348
- package/dist/chunk-TGXBCKOU.mjs +0 -35
- package/dist/chunk-TPESRDUG.mjs +0 -207
- package/dist/chunk-TQDN67YN.mjs +0 -165
- package/dist/chunk-TSF5O3MA.mjs +0 -291
- package/dist/chunk-U6OGGZBY.mjs +0 -594
- package/dist/chunk-UGHLEKEZ.mjs +0 -370
- package/dist/chunk-UNTTADHL.mjs +0 -73
- package/dist/chunk-UR5F74ZB.mjs +0 -601
- package/dist/chunk-URPXBKK4.mjs +0 -392
- package/dist/chunk-UUWPSRNV.mjs +0 -337
- package/dist/chunk-VY6FVIOZ.mjs +0 -344
- package/dist/chunk-W2ICYZVU.mjs +0 -286
- package/dist/chunk-W3QOMJKQ.mjs +0 -322
- package/dist/chunk-WM4ESIHG.mjs +0 -83
- package/dist/chunk-WV25G4M3.mjs +0 -194
- package/dist/chunk-X5LJT76O.mjs +0 -255
- package/dist/chunk-XH63C62K.mjs +0 -434
- package/dist/chunk-Y2HO4IBQ.mjs +0 -150
- package/dist/chunk-YEHKQ3JZ.mjs +0 -114
- package/dist/chunk-YNXP34KO.mjs +0 -761
- package/dist/chunk-YVDTXHQ6.mjs +0 -156
- package/dist/chunk-YZBQ6IR7.mjs +0 -143
- package/dist/chunk-ZFJNCAZX.mjs +0 -758
- package/dist/chunk-ZFTRR3KW.mjs +0 -158
- package/dist/chunk-ZOP7PEKY.mjs +0 -234
- package/dist/chunk-ZWVA7HT3.mjs +0 -159
- /package/dist/{chunk-UEGNXN5B.mjs → chunk-W2FOU4XH.mjs} +0 -0
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Select
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KO7NA3F6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Radio
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AFNJO6KJ.mjs";
|
|
7
7
|
import {
|
|
8
8
|
Pagination
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-IOSUZR6Z.mjs";
|
|
10
|
+
import {
|
|
11
|
+
Input
|
|
12
|
+
} from "./chunk-DU5F2EE7.mjs";
|
|
10
13
|
import {
|
|
11
14
|
Empty
|
|
12
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-X7UK3A6Z.mjs";
|
|
13
16
|
import {
|
|
14
17
|
Checkbox
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-V5BSH3EF.mjs";
|
|
19
|
+
import {
|
|
20
|
+
Loading
|
|
21
|
+
} from "./chunk-OO27UB75.mjs";
|
|
22
|
+
import {
|
|
23
|
+
Button
|
|
24
|
+
} from "./chunk-4KIZXFFG.mjs";
|
|
16
25
|
import {
|
|
17
26
|
useTigerConfig
|
|
18
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-4GOTWNOO.mjs";
|
|
19
28
|
|
|
20
29
|
// src/components/Table.ts
|
|
21
30
|
import {
|
|
@@ -26,24 +35,34 @@ import {
|
|
|
26
35
|
onBeforeUnmount,
|
|
27
36
|
onMounted,
|
|
28
37
|
ref as ref2,
|
|
38
|
+
useId,
|
|
29
39
|
watch as watch2
|
|
30
40
|
} from "vue";
|
|
31
41
|
import {
|
|
32
42
|
classNames as classNames3,
|
|
43
|
+
canUseTableVirtualWindow,
|
|
33
44
|
createTableResizeObserverController,
|
|
34
|
-
formatTableSelectRowAriaLabel,
|
|
45
|
+
formatTableSelectRowAriaLabel as formatTableSelectRowAriaLabel2,
|
|
35
46
|
formatTableSortByText as formatTableSortByText2,
|
|
36
47
|
getCardColumns,
|
|
37
48
|
getCardGridInfo,
|
|
38
49
|
getTableColgroup,
|
|
50
|
+
hasTableSelectionColumn as hasTableSelectionColumn4,
|
|
51
|
+
resolveTableExpandSlot as resolveTableExpandSlot4,
|
|
52
|
+
tableExportBarClasses,
|
|
39
53
|
getImmediateTigerLocale,
|
|
40
54
|
getTableLabels,
|
|
41
55
|
getTableWrapperClasses,
|
|
42
56
|
getTableResponsiveCardClasses,
|
|
43
|
-
getTableResponsiveCardListClasses,
|
|
44
57
|
getTableResponsiveTableClasses,
|
|
45
58
|
getTableVirtualRecommendation,
|
|
46
59
|
getTableVirtualWindow,
|
|
60
|
+
getTableCardSortValue,
|
|
61
|
+
parseTableCardSortValue,
|
|
62
|
+
subscribeTableCardViewport,
|
|
63
|
+
TABLE_CARD_SORT_NONE,
|
|
64
|
+
tableCardListVisibleClasses,
|
|
65
|
+
isActivationKey as isActivationKey2,
|
|
47
66
|
isLazyTigerLocale,
|
|
48
67
|
mergeTigerLocale,
|
|
49
68
|
resolveTigerLocale,
|
|
@@ -54,7 +73,6 @@ import {
|
|
|
54
73
|
tableResponsiveCardValueClasses,
|
|
55
74
|
tableLoadingOverlayClasses
|
|
56
75
|
} from "@expcat/tigercat-core";
|
|
57
|
-
import { tableExportButtonClasses } from "@expcat/tigercat-core";
|
|
58
76
|
|
|
59
77
|
// src/components/Table/props.ts
|
|
60
78
|
var tableProps = {
|
|
@@ -68,7 +86,7 @@ var tableProps = {
|
|
|
68
86
|
},
|
|
69
87
|
dataSource: {
|
|
70
88
|
type: Array,
|
|
71
|
-
default:
|
|
89
|
+
default: void 0
|
|
72
90
|
},
|
|
73
91
|
hiddenColumnKeys: {
|
|
74
92
|
type: Array,
|
|
@@ -127,14 +145,7 @@ var tableProps = {
|
|
|
127
145
|
},
|
|
128
146
|
pagination: {
|
|
129
147
|
type: [Object, Boolean],
|
|
130
|
-
default:
|
|
131
|
-
defaultCurrent: 1,
|
|
132
|
-
defaultPageSize: 10,
|
|
133
|
-
total: 0,
|
|
134
|
-
pageSizeOptions: [10, 20, 50, 100],
|
|
135
|
-
showSizeChanger: true,
|
|
136
|
-
showTotal: true
|
|
137
|
-
})
|
|
148
|
+
default: void 0
|
|
138
149
|
},
|
|
139
150
|
rowSelection: {
|
|
140
151
|
type: Object
|
|
@@ -188,14 +199,14 @@ var tableProps = {
|
|
|
188
199
|
},
|
|
189
200
|
// --- v0.6.0 props ---
|
|
190
201
|
virtual: { type: Boolean, default: false },
|
|
191
|
-
autoVirtual: { type: Boolean, default:
|
|
202
|
+
autoVirtual: { type: Boolean, default: false },
|
|
192
203
|
virtualHeight: { type: Number, default: 400 },
|
|
193
204
|
virtualItemHeight: { type: Number, default: 40 },
|
|
194
205
|
virtualThreshold: { type: Number, default: 1e3 },
|
|
195
206
|
editable: { type: Boolean, default: false },
|
|
196
207
|
editableCells: { type: Object },
|
|
197
208
|
filterMode: { type: String, default: "basic" },
|
|
198
|
-
advancedFilterRules: { type: Array, default:
|
|
209
|
+
advancedFilterRules: { type: Array, default: void 0 },
|
|
199
210
|
columnDraggable: { type: Boolean, default: false },
|
|
200
211
|
rowDraggable: { type: Boolean, default: false },
|
|
201
212
|
summaryRow: { type: Object },
|
|
@@ -220,6 +231,7 @@ var tableEmits = [
|
|
|
220
231
|
"expand-change",
|
|
221
232
|
"cell-change",
|
|
222
233
|
"column-order-change",
|
|
234
|
+
"column-fixed-change",
|
|
223
235
|
"row-order-change",
|
|
224
236
|
"export"
|
|
225
237
|
];
|
|
@@ -227,36 +239,63 @@ var tableEmits = [
|
|
|
227
239
|
// src/components/Table/state.ts
|
|
228
240
|
import { computed, ref, watch } from "vue";
|
|
229
241
|
import {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
242
|
+
DEFAULT_TABLE_SORT,
|
|
243
|
+
EMPTY_TABLE_FILTER_RULES,
|
|
244
|
+
EMPTY_TABLE_FILTERS,
|
|
245
|
+
EMPTY_TABLE_HIDDEN_KEYS,
|
|
246
|
+
EMPTY_TABLE_RECORDS,
|
|
247
|
+
applyTableColumnOrder,
|
|
248
|
+
commitTableCellEdit,
|
|
249
|
+
downloadTableExport,
|
|
250
|
+
exportTableData,
|
|
239
251
|
freezeTableColumnWidths,
|
|
240
|
-
|
|
252
|
+
getNextTableColumnFixed,
|
|
253
|
+
getNextTableExpandKeys,
|
|
241
254
|
getNextTableSelectAllKeys,
|
|
242
|
-
|
|
243
|
-
|
|
255
|
+
getNextTableSelectRowKeys,
|
|
256
|
+
getNextTableSortState,
|
|
257
|
+
mergeTableFilterValue,
|
|
258
|
+
mergeTablePagination,
|
|
259
|
+
reorderTableColumnsByKey,
|
|
260
|
+
reorderTableRowsByKey,
|
|
261
|
+
resolveTableKeyList,
|
|
262
|
+
resolveTableRecordKey,
|
|
263
|
+
resolveTableView,
|
|
264
|
+
shouldWarnControlledPageReset
|
|
244
265
|
} from "@expcat/tigercat-core";
|
|
245
|
-
import {
|
|
246
|
-
function useTableState(props, emit, measuredColumnWidths) {
|
|
266
|
+
import { devWarn } from "@expcat/tigercat-core";
|
|
267
|
+
function useTableState(props, emit, measuredColumnWidths, containerSize) {
|
|
268
|
+
const paginationMerged = computed(() => mergeTablePagination(props.pagination));
|
|
247
269
|
const paginationConfig = computed(() => {
|
|
248
|
-
|
|
270
|
+
const merged = paginationMerged.value;
|
|
271
|
+
return merged === false ? null : merged;
|
|
249
272
|
});
|
|
250
273
|
const isSortControlled = computed(() => props.sort !== void 0);
|
|
251
274
|
const isHiddenColumnsControlled = computed(() => props.hiddenColumnKeys !== void 0);
|
|
252
275
|
const isFiltersControlled = computed(() => props.filters !== void 0);
|
|
253
|
-
const
|
|
254
|
-
const
|
|
255
|
-
const
|
|
276
|
+
const isCurrentPageControlled = computed(() => paginationConfig.value?.current !== void 0);
|
|
277
|
+
const isPageSizeControlled = computed(() => paginationConfig.value?.pageSize !== void 0);
|
|
278
|
+
const selectionControl = computed(
|
|
279
|
+
() => resolveTableKeyList(props.rowSelection?.selectedRowKeys, "rowSelection.selectedRowKeys")
|
|
280
|
+
);
|
|
281
|
+
const expandControl = computed(
|
|
282
|
+
() => resolveTableKeyList(props.expandable?.expandedRowKeys, "expandable.expandedRowKeys")
|
|
283
|
+
);
|
|
284
|
+
const internalData = ref(null);
|
|
285
|
+
watch(
|
|
286
|
+
() => props.dataSource,
|
|
287
|
+
() => {
|
|
288
|
+
internalData.value = null;
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
const effectiveData = computed(
|
|
292
|
+
() => internalData.value ?? props.dataSource ?? EMPTY_TABLE_RECORDS
|
|
293
|
+
);
|
|
294
|
+
const uncontrolledSortState = ref(props.defaultSort ?? DEFAULT_TABLE_SORT);
|
|
256
295
|
const uncontrolledHiddenColumnKeys = ref(
|
|
257
|
-
props.defaultHiddenColumnKeys ?? props.hiddenColumnKeys ??
|
|
296
|
+
props.defaultHiddenColumnKeys ?? props.hiddenColumnKeys ?? EMPTY_TABLE_HIDDEN_KEYS
|
|
258
297
|
);
|
|
259
|
-
const uncontrolledFilterState = ref(props.defaultFilters ??
|
|
298
|
+
const uncontrolledFilterState = ref(props.defaultFilters ?? EMPTY_TABLE_FILTERS);
|
|
260
299
|
const uncontrolledCurrentPage = ref(
|
|
261
300
|
paginationConfig.value?.defaultCurrent ?? paginationConfig.value?.current ?? 1
|
|
262
301
|
);
|
|
@@ -264,97 +303,79 @@ function useTableState(props, emit, measuredColumnWidths) {
|
|
|
264
303
|
paginationConfig.value?.defaultPageSize ?? paginationConfig.value?.pageSize ?? 10
|
|
265
304
|
);
|
|
266
305
|
const uncontrolledSelectedRowKeys = ref(
|
|
267
|
-
props.rowSelection?.defaultSelectedRowKeys ??
|
|
306
|
+
props.rowSelection?.defaultSelectedRowKeys ?? []
|
|
268
307
|
);
|
|
269
308
|
const uncontrolledExpandedRowKeys = ref(
|
|
270
|
-
props.expandable?.defaultExpandedRowKeys ??
|
|
309
|
+
props.expandable?.defaultExpandedRowKeys ?? []
|
|
310
|
+
);
|
|
311
|
+
const columnOrder = ref(null);
|
|
312
|
+
const fixedOverrides = ref({});
|
|
313
|
+
watch(
|
|
314
|
+
() => props.columns.map((column) => column.key).join("\0"),
|
|
315
|
+
() => {
|
|
316
|
+
columnOrder.value = null;
|
|
317
|
+
}
|
|
271
318
|
);
|
|
272
319
|
const sortState = computed(() => props.sort ?? uncontrolledSortState.value);
|
|
273
320
|
const hiddenColumnKeys = computed(
|
|
274
321
|
() => props.hiddenColumnKeys ?? uncontrolledHiddenColumnKeys.value
|
|
275
322
|
);
|
|
276
323
|
const filterState = computed(() => props.filters ?? uncontrolledFilterState.value);
|
|
277
|
-
const currentPage = computed(
|
|
278
|
-
|
|
279
|
-
});
|
|
280
|
-
const currentPageSize = computed(() => {
|
|
281
|
-
return paginationConfig.value?.pageSize ?? uncontrolledCurrentPageSize.value;
|
|
282
|
-
});
|
|
283
|
-
const selectedRowKeys = computed(() => {
|
|
284
|
-
return props.rowSelection?.selectedRowKeys ?? uncontrolledSelectedRowKeys.value;
|
|
285
|
-
});
|
|
286
|
-
const expandedRowKeys = computed(() => {
|
|
287
|
-
return props.expandable?.expandedRowKeys ?? uncontrolledExpandedRowKeys.value;
|
|
288
|
-
});
|
|
289
|
-
watch(
|
|
290
|
-
() => props.sort,
|
|
291
|
-
(next) => {
|
|
292
|
-
if (next !== void 0) {
|
|
293
|
-
uncontrolledSortState.value = next;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
324
|
+
const currentPage = computed(
|
|
325
|
+
() => paginationConfig.value?.current ?? uncontrolledCurrentPage.value
|
|
296
326
|
);
|
|
297
|
-
|
|
298
|
-
() =>
|
|
299
|
-
(next) => {
|
|
300
|
-
if (next !== void 0) {
|
|
301
|
-
uncontrolledFilterState.value = next;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
327
|
+
const currentPageSize = computed(
|
|
328
|
+
() => paginationConfig.value?.pageSize ?? uncontrolledCurrentPageSize.value
|
|
304
329
|
);
|
|
305
|
-
|
|
306
|
-
() =>
|
|
307
|
-
(next) => {
|
|
308
|
-
if (next !== void 0) {
|
|
309
|
-
uncontrolledHiddenColumnKeys.value = next;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
330
|
+
const selectedRowKeys = computed(
|
|
331
|
+
() => selectionControl.value.controlled ? selectionControl.value.keys : uncontrolledSelectedRowKeys.value
|
|
312
332
|
);
|
|
313
|
-
|
|
314
|
-
() =>
|
|
315
|
-
(next) => {
|
|
316
|
-
if (next !== void 0) {
|
|
317
|
-
uncontrolledCurrentPage.value = next;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
333
|
+
const expandedRowKeys = computed(
|
|
334
|
+
() => expandControl.value.controlled ? expandControl.value.keys : uncontrolledExpandedRowKeys.value
|
|
320
335
|
);
|
|
321
|
-
|
|
322
|
-
() =>
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
+
const view = computed(
|
|
337
|
+
() => resolveTableView({
|
|
338
|
+
columns: props.columns,
|
|
339
|
+
dataSource: effectiveData.value,
|
|
340
|
+
hiddenColumnKeys: hiddenColumnKeys.value,
|
|
341
|
+
columnOrder: columnOrder.value ?? void 0,
|
|
342
|
+
fixedOverrides: fixedOverrides.value,
|
|
343
|
+
filters: filterState.value,
|
|
344
|
+
sort: sortState.value,
|
|
345
|
+
filterMode: props.filterMode,
|
|
346
|
+
advancedFilterRules: props.advancedFilterRules ?? EMPTY_TABLE_FILTER_RULES,
|
|
347
|
+
groupBy: props.groupBy,
|
|
348
|
+
pagination: paginationMerged.value,
|
|
349
|
+
currentPage: currentPage.value,
|
|
350
|
+
currentPageSize: currentPageSize.value,
|
|
351
|
+
rowKey: props.rowKey,
|
|
352
|
+
getRowKey: props.rowSelection?.getRowKey,
|
|
353
|
+
rowSelection: props.rowSelection,
|
|
354
|
+
expandable: props.expandable,
|
|
355
|
+
selectedRowKeys: selectedRowKeys.value,
|
|
356
|
+
measuredColumnWidths: measuredColumnWidths.value,
|
|
357
|
+
containerWidth: containerSize?.value.width
|
|
358
|
+
})
|
|
336
359
|
);
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
360
|
+
const displayColumns = computed(() => view.value.displayColumns);
|
|
361
|
+
const fixedColumnsInfo = computed(() => view.value.fixedColumnsInfo);
|
|
362
|
+
const processedData = computed(() => view.value.processedData);
|
|
363
|
+
const paginatedData = computed(() => view.value.paginatedData);
|
|
364
|
+
const paginatedRowKeys = computed(() => view.value.pageRowKeys);
|
|
365
|
+
const pageSourceIndices = computed(() => view.value.pageSourceIndices);
|
|
366
|
+
const groupedData = computed(() => view.value.groupedData);
|
|
367
|
+
const paginationInfo = computed(() => view.value.paginationInfo);
|
|
368
|
+
const totalColumnCount = computed(() => view.value.totalColumnCount);
|
|
369
|
+
const allSelected = computed(() => view.value.allSelected);
|
|
370
|
+
const someSelected = computed(() => view.value.someSelected);
|
|
371
|
+
const selectedRowKeySet = computed(() => new Set(selectedRowKeys.value));
|
|
372
|
+
const expandedRowKeySet = computed(() => new Set(expandedRowKeys.value));
|
|
373
|
+
const columnByKey = computed(() => {
|
|
374
|
+
const map = {};
|
|
375
|
+
for (const column of displayColumns.value) {
|
|
376
|
+
map[column.key] = column;
|
|
343
377
|
}
|
|
344
|
-
|
|
345
|
-
const fixedOverrides = ref({});
|
|
346
|
-
const displayColumns = computed(() => {
|
|
347
|
-
const mapped = props.columns.map((column) => {
|
|
348
|
-
const hasOverride = column.key in fixedOverrides.value;
|
|
349
|
-
return {
|
|
350
|
-
...column,
|
|
351
|
-
fixed: hasOverride ? fixedOverrides.value[column.key] : column.fixed
|
|
352
|
-
};
|
|
353
|
-
});
|
|
354
|
-
return orderTableFixedColumns(filterHiddenColumns(mapped, hiddenColumnKeys.value));
|
|
355
|
-
});
|
|
356
|
-
const fixedColumnsInfo = computed(() => {
|
|
357
|
-
return getFixedColumnOffsets(displayColumns.value, measuredColumnWidths.value);
|
|
378
|
+
return map;
|
|
358
379
|
});
|
|
359
380
|
const frozenColumnWidths = ref({});
|
|
360
381
|
watch(
|
|
@@ -368,13 +389,13 @@ function useTableState(props, emit, measuredColumnWidths) {
|
|
|
368
389
|
},
|
|
369
390
|
{ immediate: true }
|
|
370
391
|
);
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}
|
|
392
|
+
function emitChange(next) {
|
|
393
|
+
emit("change", {
|
|
394
|
+
sort: next.sort ?? sortState.value,
|
|
395
|
+
filters: next.filters ?? filterState.value,
|
|
396
|
+
pagination: next.pagination !== void 0 ? next.pagination : paginationMerged.value !== false ? { current: currentPage.value, pageSize: currentPageSize.value } : null
|
|
397
|
+
});
|
|
398
|
+
}
|
|
378
399
|
function handleSetHiddenColumns(hiddenKeys) {
|
|
379
400
|
if (!isHiddenColumnsControlled.value) {
|
|
380
401
|
uncontrolledHiddenColumnKeys.value = hiddenKeys;
|
|
@@ -383,147 +404,72 @@ function useTableState(props, emit, measuredColumnWidths) {
|
|
|
383
404
|
emit("hidden-column-keys-change", hiddenKeys);
|
|
384
405
|
}
|
|
385
406
|
function toggleColumnLock(columnKey) {
|
|
386
|
-
const original = props.columns.find((
|
|
387
|
-
const
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
const processedData = computed(() => {
|
|
393
|
-
let data = props.dataSource ?? [];
|
|
394
|
-
if (props.filterMode === "advanced" && (props.advancedFilterRules?.length ?? 0) > 0) {
|
|
395
|
-
data = filterDataAdvanced(data, props.advancedFilterRules ?? []);
|
|
396
|
-
} else {
|
|
397
|
-
data = filterTableData(data, props.columns, filterState.value);
|
|
398
|
-
}
|
|
399
|
-
if (sortState.value.key && sortState.value.direction) {
|
|
400
|
-
const column = columnByKey.value[sortState.value.key];
|
|
401
|
-
data = sortData(
|
|
402
|
-
data,
|
|
403
|
-
sortState.value.key,
|
|
404
|
-
sortState.value.direction,
|
|
405
|
-
column?.sortFn,
|
|
406
|
-
props.columns
|
|
407
|
-
);
|
|
408
|
-
}
|
|
409
|
-
return data;
|
|
410
|
-
});
|
|
411
|
-
const paginatedData = computed(() => {
|
|
412
|
-
if (props.pagination === false) {
|
|
413
|
-
return processedData.value;
|
|
414
|
-
}
|
|
415
|
-
if (paginationConfig.value?.remote) {
|
|
416
|
-
return processedData.value;
|
|
417
|
-
}
|
|
418
|
-
return paginateData(processedData.value, currentPage.value, currentPageSize.value);
|
|
419
|
-
});
|
|
420
|
-
const paginatedRowKeys = computed(() => {
|
|
421
|
-
return createTableRowKeyCache(props.rowKey).getMany(
|
|
422
|
-
paginatedData.value
|
|
407
|
+
const original = props.columns.find((column) => column.key === columnKey)?.fixed;
|
|
408
|
+
const current = Object.prototype.hasOwnProperty.call(fixedOverrides.value, columnKey) ? fixedOverrides.value[columnKey] : original;
|
|
409
|
+
const nextFixed = getNextTableColumnFixed(current, original);
|
|
410
|
+
fixedOverrides.value = { ...fixedOverrides.value, [columnKey]: nextFixed };
|
|
411
|
+
const fullColumns = applyTableColumnOrder(props.columns, columnOrder.value ?? void 0).map(
|
|
412
|
+
(column) => column.key === columnKey ? { ...column, fixed: nextFixed } : column
|
|
423
413
|
);
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
return new Set(selectedRowKeys.value);
|
|
427
|
-
});
|
|
428
|
-
const expandedRowKeySet = computed(() => {
|
|
429
|
-
return new Set(expandedRowKeys.value);
|
|
430
|
-
});
|
|
431
|
-
const totalColumnCount = computed(() => {
|
|
432
|
-
let count = displayColumns.value.length;
|
|
433
|
-
if (hasTableSelectionColumn(props.rowSelection)) count += 1;
|
|
434
|
-
if (props.expandable) count += 1;
|
|
435
|
-
return count;
|
|
436
|
-
});
|
|
437
|
-
const paginationInfo = computed(() => {
|
|
438
|
-
if (props.pagination === false) {
|
|
439
|
-
return null;
|
|
440
|
-
}
|
|
441
|
-
const total = paginationConfig.value?.total !== void 0 && paginationConfig.value.total > 0 ? paginationConfig.value.total : processedData.value.length;
|
|
442
|
-
return calculatePagination(total, currentPage.value, currentPageSize.value);
|
|
443
|
-
});
|
|
414
|
+
emit("column-fixed-change", columnKey, nextFixed, fullColumns);
|
|
415
|
+
}
|
|
444
416
|
function handleSetSort(nextSortState) {
|
|
445
417
|
if (!isSortControlled.value) {
|
|
446
418
|
uncontrolledSortState.value = nextSortState;
|
|
447
419
|
}
|
|
448
420
|
emit("sort-change", nextSortState);
|
|
449
|
-
|
|
450
|
-
sort: nextSortState,
|
|
451
|
-
filters: filterState.value,
|
|
452
|
-
pagination: props.pagination !== false ? {
|
|
453
|
-
current: currentPage.value,
|
|
454
|
-
pageSize: currentPageSize.value
|
|
455
|
-
} : null
|
|
456
|
-
});
|
|
421
|
+
emitChange({ sort: nextSortState });
|
|
457
422
|
}
|
|
458
423
|
function handleSort(columnKey) {
|
|
459
|
-
const column = displayColumns.value.find((
|
|
460
|
-
if (!column || !column.sortable)
|
|
461
|
-
|
|
462
|
-
}
|
|
463
|
-
let newDirection = "asc";
|
|
464
|
-
if (sortState.value.key === columnKey) {
|
|
465
|
-
if (sortState.value.direction === "asc") {
|
|
466
|
-
newDirection = "desc";
|
|
467
|
-
} else if (sortState.value.direction === "desc") {
|
|
468
|
-
newDirection = null;
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
handleSetSort({
|
|
472
|
-
key: newDirection ? columnKey : null,
|
|
473
|
-
direction: newDirection
|
|
474
|
-
});
|
|
424
|
+
const column = displayColumns.value.find((item) => item.key === columnKey);
|
|
425
|
+
if (!column || !column.sortable) return;
|
|
426
|
+
handleSetSort(getNextTableSortState(sortState.value, columnKey));
|
|
475
427
|
}
|
|
476
428
|
function handleFilter(columnKey, value) {
|
|
477
|
-
const nextFilterState =
|
|
478
|
-
...filterState.value,
|
|
479
|
-
[columnKey]: value
|
|
480
|
-
};
|
|
429
|
+
const nextFilterState = mergeTableFilterValue(filterState.value, columnKey, value);
|
|
481
430
|
if (!isFiltersControlled.value) {
|
|
482
431
|
uncontrolledFilterState.value = nextFilterState;
|
|
483
432
|
}
|
|
484
|
-
|
|
433
|
+
if (!isCurrentPageControlled.value) {
|
|
434
|
+
uncontrolledCurrentPage.value = 1;
|
|
435
|
+
} else if (shouldWarnControlledPageReset(true, currentPage.value)) {
|
|
436
|
+
devWarn(
|
|
437
|
+
"Table.filter.page",
|
|
438
|
+
"Table filter reset pagination.current to 1; the controlled current page was not written back"
|
|
439
|
+
);
|
|
440
|
+
}
|
|
485
441
|
emit("filter-change", nextFilterState);
|
|
486
|
-
|
|
487
|
-
|
|
442
|
+
if (paginationMerged.value !== false) {
|
|
443
|
+
emit("page-change", { current: 1, pageSize: currentPageSize.value });
|
|
444
|
+
}
|
|
445
|
+
emitChange({
|
|
488
446
|
filters: nextFilterState,
|
|
489
|
-
pagination:
|
|
490
|
-
current: 1,
|
|
491
|
-
pageSize: currentPageSize.value
|
|
492
|
-
} : null
|
|
447
|
+
pagination: paginationMerged.value !== false ? { current: 1, pageSize: currentPageSize.value } : null
|
|
493
448
|
});
|
|
494
449
|
}
|
|
495
450
|
function handlePageChange(page) {
|
|
496
|
-
|
|
451
|
+
if (!isCurrentPageControlled.value) {
|
|
452
|
+
uncontrolledCurrentPage.value = page;
|
|
453
|
+
}
|
|
497
454
|
emit("page-change", { current: page, pageSize: currentPageSize.value });
|
|
498
|
-
|
|
499
|
-
sort: sortState.value,
|
|
500
|
-
filters: filterState.value,
|
|
501
|
-
pagination: {
|
|
502
|
-
current: page,
|
|
503
|
-
pageSize: currentPageSize.value
|
|
504
|
-
}
|
|
505
|
-
});
|
|
455
|
+
emitChange({ pagination: { current: page, pageSize: currentPageSize.value } });
|
|
506
456
|
}
|
|
507
457
|
function handlePageSizeChange(pageSize) {
|
|
508
|
-
|
|
509
|
-
|
|
458
|
+
if (!isPageSizeControlled.value) {
|
|
459
|
+
uncontrolledCurrentPageSize.value = pageSize;
|
|
460
|
+
}
|
|
461
|
+
if (!isCurrentPageControlled.value) {
|
|
462
|
+
uncontrolledCurrentPage.value = 1;
|
|
463
|
+
}
|
|
510
464
|
emit("page-change", { current: 1, pageSize });
|
|
511
|
-
|
|
512
|
-
sort: sortState.value,
|
|
513
|
-
filters: filterState.value,
|
|
514
|
-
pagination: {
|
|
515
|
-
current: 1,
|
|
516
|
-
pageSize
|
|
517
|
-
}
|
|
518
|
-
});
|
|
465
|
+
emitChange({ pagination: { current: 1, pageSize } });
|
|
519
466
|
}
|
|
520
467
|
function handleToggleExpand(key, record) {
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
uncontrolledExpandedRowKeys.value = newKeys;
|
|
468
|
+
const next = getNextTableExpandKeys(expandedRowKeys.value, key);
|
|
469
|
+
if (!expandControl.value.controlled) {
|
|
470
|
+
uncontrolledExpandedRowKeys.value = next.keys;
|
|
525
471
|
}
|
|
526
|
-
emit("expand-change",
|
|
472
|
+
emit("expand-change", next.keys, record, next.expanded);
|
|
527
473
|
}
|
|
528
474
|
function handleRowClick(record, index, key) {
|
|
529
475
|
emit("row-click", record, index);
|
|
@@ -535,70 +481,58 @@ function useTableState(props, emit, measuredColumnWidths) {
|
|
|
535
481
|
}
|
|
536
482
|
}
|
|
537
483
|
function handleSelectRow(key, checked) {
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
newKeys = selectedRowKeys.value.filter((k) => k !== key);
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
if (!isSelectionControlled.value) {
|
|
484
|
+
const newKeys = getNextTableSelectRowKeys({
|
|
485
|
+
selectedRowKeys: selectedRowKeys.value,
|
|
486
|
+
key,
|
|
487
|
+
checked,
|
|
488
|
+
type: props.rowSelection?.type
|
|
489
|
+
});
|
|
490
|
+
if (!selectionControl.value.controlled) {
|
|
549
491
|
uncontrolledSelectedRowKeys.value = newKeys;
|
|
550
492
|
}
|
|
551
493
|
emit("selection-change", newKeys);
|
|
552
494
|
}
|
|
553
|
-
const selectionState = computed(
|
|
554
|
-
() => getTableSelectionState({
|
|
555
|
-
records: paginatedData.value,
|
|
556
|
-
rowKeys: paginatedRowKeys.value,
|
|
557
|
-
selectedRowKeys: selectedRowKeys.value,
|
|
558
|
-
getCheckboxProps: props.rowSelection?.getCheckboxProps
|
|
559
|
-
})
|
|
560
|
-
);
|
|
561
495
|
function handleSelectAll(checked) {
|
|
562
496
|
const nextKeys = getNextTableSelectAllKeys(
|
|
563
497
|
selectedRowKeys.value,
|
|
564
|
-
|
|
498
|
+
view.value.selectableRowKeys,
|
|
565
499
|
checked
|
|
566
500
|
);
|
|
567
|
-
if (!
|
|
501
|
+
if (!selectionControl.value.controlled) {
|
|
568
502
|
uncontrolledSelectedRowKeys.value = nextKeys;
|
|
569
503
|
}
|
|
570
504
|
emit("selection-change", nextKeys);
|
|
571
505
|
}
|
|
572
|
-
const allSelected = computed(() => selectionState.value.allSelected);
|
|
573
|
-
const someSelected = computed(() => selectionState.value.someSelected);
|
|
574
506
|
const editingCell = ref(null);
|
|
575
507
|
const editingValue = ref("");
|
|
576
508
|
function isCellEditable(columnKey, rowIndex) {
|
|
577
509
|
if (!props.editable) return false;
|
|
578
510
|
if (!props.editableCells) return true;
|
|
579
|
-
return
|
|
511
|
+
return props.editableCells[columnKey]?.includes(rowIndex) === true;
|
|
580
512
|
}
|
|
581
513
|
function startEditing(rowIndex, columnKey, currentValue) {
|
|
582
514
|
editingCell.value = { rowIndex, columnKey };
|
|
583
515
|
editingValue.value = String(currentValue ?? "");
|
|
584
516
|
}
|
|
585
517
|
function commitEdit() {
|
|
586
|
-
if (editingCell.value)
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
518
|
+
if (!editingCell.value) return;
|
|
519
|
+
const column = props.columns.find((item) => item.key === editingCell.value?.columnKey);
|
|
520
|
+
const nextData = commitTableCellEdit(
|
|
521
|
+
effectiveData.value,
|
|
522
|
+
editingCell.value.rowIndex,
|
|
523
|
+
column,
|
|
524
|
+
editingValue.value
|
|
525
|
+
);
|
|
526
|
+
internalData.value = nextData;
|
|
527
|
+
emit("cell-change", editingCell.value.rowIndex, editingCell.value.columnKey, editingValue.value);
|
|
528
|
+
editingCell.value = null;
|
|
595
529
|
}
|
|
596
530
|
function cancelEdit() {
|
|
597
531
|
editingCell.value = null;
|
|
598
532
|
}
|
|
599
533
|
function handleExport() {
|
|
600
|
-
const content = exportTableData(displayColumns.value, processedData.value
|
|
601
|
-
downloadTableExport(content, props.exportFilename
|
|
534
|
+
const content = exportTableData(displayColumns.value, processedData.value);
|
|
535
|
+
downloadTableExport(content, props.exportFilename);
|
|
602
536
|
emit("export", content);
|
|
603
537
|
}
|
|
604
538
|
const dragColumnKey = ref(null);
|
|
@@ -607,14 +541,10 @@ function useTableState(props, emit, measuredColumnWidths) {
|
|
|
607
541
|
}
|
|
608
542
|
function handleDrop(targetKey) {
|
|
609
543
|
if (!dragColumnKey.value || dragColumnKey.value === targetKey) return;
|
|
610
|
-
const
|
|
611
|
-
const
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
const [moved] = cols.splice(fromIdx, 1);
|
|
615
|
-
cols.splice(toIdx, 0, moved);
|
|
616
|
-
emit("column-order-change", cols);
|
|
617
|
-
}
|
|
544
|
+
const fullColumns = applyTableColumnOrder(props.columns, columnOrder.value ?? void 0);
|
|
545
|
+
const nextColumns = reorderTableColumnsByKey(fullColumns, dragColumnKey.value, targetKey);
|
|
546
|
+
columnOrder.value = nextColumns.map((column) => column.key);
|
|
547
|
+
emit("column-order-change", nextColumns);
|
|
618
548
|
dragColumnKey.value = null;
|
|
619
549
|
}
|
|
620
550
|
const dragRowKey = ref(null);
|
|
@@ -623,21 +553,17 @@ function useTableState(props, emit, measuredColumnWidths) {
|
|
|
623
553
|
}
|
|
624
554
|
function handleRowDrop(targetKey) {
|
|
625
555
|
if (dragRowKey.value === null || dragRowKey.value === targetKey) return;
|
|
626
|
-
const
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
556
|
+
const nextRows = reorderTableRowsByKey(
|
|
557
|
+
effectiveData.value,
|
|
558
|
+
dragRowKey.value,
|
|
559
|
+
targetKey,
|
|
560
|
+
(record, sourceIndex) => resolveTableRecordKey(record, sourceIndex, props.rowKey, props.rowSelection?.getRowKey)
|
|
561
|
+
);
|
|
562
|
+
internalData.value = nextRows;
|
|
563
|
+
emit("row-order-change", nextRows);
|
|
634
564
|
dragRowKey.value = null;
|
|
635
565
|
}
|
|
636
566
|
const virtualScrollTop = ref(0);
|
|
637
|
-
const groupedData = computed(() => {
|
|
638
|
-
if (!props.groupBy) return null;
|
|
639
|
-
return groupDataByColumn(paginatedData.value, props.groupBy);
|
|
640
|
-
});
|
|
641
567
|
return {
|
|
642
568
|
paginationConfig,
|
|
643
569
|
displayColumns,
|
|
@@ -647,6 +573,7 @@ function useTableState(props, emit, measuredColumnWidths) {
|
|
|
647
573
|
processedData,
|
|
648
574
|
paginatedData,
|
|
649
575
|
paginatedRowKeys,
|
|
576
|
+
pageSourceIndices,
|
|
650
577
|
selectedRowKeySet,
|
|
651
578
|
expandedRowKeySet,
|
|
652
579
|
totalColumnCount,
|
|
@@ -687,14 +614,30 @@ function useTableState(props, emit, measuredColumnWidths) {
|
|
|
687
614
|
};
|
|
688
615
|
}
|
|
689
616
|
|
|
617
|
+
// src/components/Table/render-header.ts
|
|
618
|
+
import { h as h2 } from "vue";
|
|
619
|
+
import {
|
|
620
|
+
classNames,
|
|
621
|
+
formatTableFilterColumnAriaLabel,
|
|
622
|
+
formatTableSortByText,
|
|
623
|
+
getCheckboxCellClasses,
|
|
624
|
+
getExpandIconCellClasses,
|
|
625
|
+
getFixedColumnStyle,
|
|
626
|
+
getInputClasses,
|
|
627
|
+
getTableChromeSlots,
|
|
628
|
+
getTableFixedHeaderCellClasses,
|
|
629
|
+
getTableHeaderCellClasses,
|
|
630
|
+
getTableHeaderClasses,
|
|
631
|
+
hasTableSelectionColumn,
|
|
632
|
+
resolveTableExpandSlot,
|
|
633
|
+
tableSortButtonClasses
|
|
634
|
+
} from "@expcat/tigercat-core";
|
|
635
|
+
|
|
690
636
|
// src/components/Table/icons.ts
|
|
691
637
|
import { h } from "vue";
|
|
692
638
|
import {
|
|
693
639
|
getSortIconClasses,
|
|
694
640
|
getExpandIconClasses,
|
|
695
|
-
getSpinnerSVG,
|
|
696
|
-
normalizeSvgAttrs,
|
|
697
|
-
getLoadingOverlaySpinnerClasses,
|
|
698
641
|
icon16ViewBox,
|
|
699
642
|
icon24ViewBox,
|
|
700
643
|
sortAscIcon16PathD,
|
|
@@ -704,7 +647,6 @@ import {
|
|
|
704
647
|
lockClosedIcon24PathD,
|
|
705
648
|
lockOpenIcon24PathD
|
|
706
649
|
} from "@expcat/tigercat-core";
|
|
707
|
-
var spinnerSvg = getSpinnerSVG("spinner");
|
|
708
650
|
var SortIcon = (direction) => {
|
|
709
651
|
const active = direction !== null;
|
|
710
652
|
const pathD = direction === "asc" ? sortAscIcon16PathD : direction === "desc" ? sortDescIcon16PathD : sortBothIcon16PathD;
|
|
@@ -715,7 +657,8 @@ var SortIcon = (direction) => {
|
|
|
715
657
|
width: "16",
|
|
716
658
|
height: "16",
|
|
717
659
|
viewBox: icon16ViewBox,
|
|
718
|
-
fill: "currentColor"
|
|
660
|
+
fill: "currentColor",
|
|
661
|
+
"aria-hidden": "true"
|
|
719
662
|
},
|
|
720
663
|
[h("path", { d: pathD })]
|
|
721
664
|
);
|
|
@@ -747,62 +690,34 @@ var ExpandIcon = (expanded) => {
|
|
|
747
690
|
[h("path", { d: expandChevronIcon16PathD })]
|
|
748
691
|
);
|
|
749
692
|
};
|
|
750
|
-
var LoadingSpinner = () => {
|
|
751
|
-
return h(
|
|
752
|
-
"svg",
|
|
753
|
-
{
|
|
754
|
-
class: getLoadingOverlaySpinnerClasses(),
|
|
755
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
756
|
-
fill: "none",
|
|
757
|
-
viewBox: spinnerSvg.viewBox
|
|
758
|
-
},
|
|
759
|
-
spinnerSvg.elements.map((el) => h(el.type, normalizeSvgAttrs(el.attrs)))
|
|
760
|
-
);
|
|
761
|
-
};
|
|
762
693
|
|
|
763
694
|
// src/components/Table/render-header.ts
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
getTableHeaderCellClasses,
|
|
769
|
-
getTableFixedHeaderCellClasses,
|
|
770
|
-
getFixedColumnStyle,
|
|
771
|
-
getCheckboxCellClasses,
|
|
772
|
-
getExpandIconCellClasses,
|
|
773
|
-
formatTableSortByText,
|
|
774
|
-
tableSortButtonClasses
|
|
775
|
-
} from "@expcat/tigercat-core";
|
|
695
|
+
function isHeaderSortClickTarget(target) {
|
|
696
|
+
if (!(target instanceof Element)) return false;
|
|
697
|
+
return Boolean(target.closest("[data-tiger-table-filter], button:not([data-tiger-table-sort])"));
|
|
698
|
+
}
|
|
776
699
|
function renderTableHeader(ctx, props, slots, labels) {
|
|
777
|
-
const
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
700
|
+
const chrome = getTableChromeSlots({
|
|
701
|
+
hasSelectionColumn: hasTableSelectionColumn(props.rowSelection),
|
|
702
|
+
expand: resolveTableExpandSlot(props.expandable)
|
|
703
|
+
});
|
|
704
|
+
const expandHeaderTh = h2("th", {
|
|
781
705
|
class: getExpandIconCellClasses(props.size),
|
|
782
|
-
"aria-
|
|
783
|
-
})
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
h2("input", {
|
|
796
|
-
type: "checkbox",
|
|
797
|
-
class: "rounded border-gray-300 text-[var(--tiger-primary,#2563eb)] focus:ring-[var(--tiger-primary,#2563eb)]",
|
|
798
|
-
checked: ctx.allSelected.value,
|
|
799
|
-
indeterminate: ctx.someSelected.value,
|
|
800
|
-
onChange: (e) => ctx.handleSelectAll(e.target.checked)
|
|
801
|
-
})
|
|
802
|
-
]
|
|
803
|
-
)
|
|
804
|
-
);
|
|
706
|
+
"aria-hidden": "true"
|
|
707
|
+
});
|
|
708
|
+
const selectionHeaderTh = props.rowSelection?.type === "radio" ? h2("th", { class: getCheckboxCellClasses(props.size), "aria-hidden": "true" }) : h2("th", { class: getCheckboxCellClasses(props.size) }, [
|
|
709
|
+
h2(Checkbox, {
|
|
710
|
+
size: "sm",
|
|
711
|
+
modelValue: ctx.allSelected.value,
|
|
712
|
+
indeterminate: ctx.someSelected.value,
|
|
713
|
+
"aria-label": labels.selectAllText,
|
|
714
|
+
onChange: (checked) => ctx.handleSelectAll(checked)
|
|
715
|
+
})
|
|
716
|
+
]);
|
|
717
|
+
function chromeTh(slot) {
|
|
718
|
+
return slot === "expand" ? expandHeaderTh : selectionHeaderTh;
|
|
805
719
|
}
|
|
720
|
+
const headerCells = chrome.leading.map((slot) => chromeTh(slot));
|
|
806
721
|
ctx.displayColumns.value.forEach((column) => {
|
|
807
722
|
const isSorted = ctx.sortState.value.key === column.key;
|
|
808
723
|
const sortDirection = isSorted ? ctx.sortState.value.direction : null;
|
|
@@ -830,7 +745,11 @@ function renderTableHeader(ctx, props, slots, labels) {
|
|
|
830
745
|
type: "button",
|
|
831
746
|
"data-tiger-table-sort": "",
|
|
832
747
|
class: tableSortButtonClasses,
|
|
833
|
-
|
|
748
|
+
"aria-label": formatTableSortByText(labels.sortByText, String(column.title)),
|
|
749
|
+
onClick: (event) => {
|
|
750
|
+
event.stopPropagation();
|
|
751
|
+
ctx.handleSort(column.key);
|
|
752
|
+
}
|
|
834
753
|
},
|
|
835
754
|
[...titleContent, SortIcon(sortDirection)]
|
|
836
755
|
)
|
|
@@ -846,7 +765,7 @@ function renderTableHeader(ctx, props, slots, labels) {
|
|
|
846
765
|
type: "button",
|
|
847
766
|
class: classNames(
|
|
848
767
|
"inline-flex items-center",
|
|
849
|
-
column.fixed === "left" || column.fixed === "right" ? "text-[var(--tiger-primary,#2563eb)]" : "text-
|
|
768
|
+
column.fixed === "left" || column.fixed === "right" ? "text-[var(--tiger-primary,#2563eb)]" : "text-[var(--tiger-text-muted,#6b7280)] hover:text-[var(--tiger-text,#111827)]"
|
|
850
769
|
),
|
|
851
770
|
"aria-label": formatTableSortByText(
|
|
852
771
|
column.fixed === "left" || column.fixed === "right" ? labels.unlockColumnAriaLabel : labels.lockColumnAriaLabel,
|
|
@@ -861,11 +780,14 @@ function renderTableHeader(ctx, props, slots, labels) {
|
|
|
861
780
|
)
|
|
862
781
|
);
|
|
863
782
|
}
|
|
783
|
+
const filterValue = ctx.filterState.value[column.key];
|
|
784
|
+
const filterText = filterValue == null ? "" : String(filterValue);
|
|
864
785
|
headerCells.push(
|
|
865
786
|
h2(
|
|
866
787
|
"th",
|
|
867
788
|
{
|
|
868
789
|
key: column.key,
|
|
790
|
+
scope: "col",
|
|
869
791
|
"data-tiger-table-column-key": column.key,
|
|
870
792
|
"aria-sort": ariaSort,
|
|
871
793
|
class: classNames(
|
|
@@ -884,6 +806,10 @@ function renderTableHeader(ctx, props, slots, labels) {
|
|
|
884
806
|
),
|
|
885
807
|
style,
|
|
886
808
|
draggable: props.columnDraggable ? "true" : void 0,
|
|
809
|
+
onClick: column.sortable ? (event) => {
|
|
810
|
+
if (isHeaderSortClickTarget(event.target)) return;
|
|
811
|
+
ctx.handleSort(column.key);
|
|
812
|
+
} : void 0,
|
|
887
813
|
onDragstart: props.columnDraggable ? () => ctx.handleDragStart(column.key) : void 0,
|
|
888
814
|
onDragover: props.columnDraggable ? (e) => e.preventDefault() : void 0,
|
|
889
815
|
onDrop: props.columnDraggable ? () => ctx.handleDrop(column.key) : void 0
|
|
@@ -891,36 +817,56 @@ function renderTableHeader(ctx, props, slots, labels) {
|
|
|
891
817
|
[
|
|
892
818
|
h2("div", { class: "flex items-center gap-2" }, headerContent),
|
|
893
819
|
...column.filter ? [
|
|
894
|
-
h2(
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
820
|
+
h2(
|
|
821
|
+
"div",
|
|
822
|
+
{
|
|
823
|
+
class: "mt-2",
|
|
824
|
+
"data-tiger-table-filter": "",
|
|
825
|
+
draggable: false,
|
|
826
|
+
onClick: (e) => e.stopPropagation(),
|
|
827
|
+
onDragstart: (e) => {
|
|
828
|
+
e.preventDefault();
|
|
829
|
+
e.stopPropagation();
|
|
830
|
+
}
|
|
831
|
+
},
|
|
832
|
+
[
|
|
833
|
+
column.filter.type === "select" && column.filter.options ? h2(
|
|
834
|
+
"select",
|
|
835
|
+
{
|
|
836
|
+
class: getInputClasses({ size: "sm" }),
|
|
837
|
+
"aria-label": formatTableFilterColumnAriaLabel(
|
|
838
|
+
labels.filterColumnAriaLabel,
|
|
839
|
+
String(column.title)
|
|
840
|
+
),
|
|
841
|
+
value: filterText,
|
|
842
|
+
draggable: false,
|
|
843
|
+
onChange: (e) => ctx.handleFilter(column.key, e.target.value)
|
|
844
|
+
},
|
|
845
|
+
[
|
|
846
|
+
h2("option", { value: "" }, labels.allText),
|
|
847
|
+
...column.filter.options.map(
|
|
848
|
+
(opt) => h2("option", { value: opt.value }, opt.label)
|
|
849
|
+
)
|
|
850
|
+
]
|
|
851
|
+
) : h2(Input, {
|
|
852
|
+
size: "sm",
|
|
853
|
+
modelValue: filterText,
|
|
854
|
+
"aria-label": formatTableFilterColumnAriaLabel(
|
|
855
|
+
labels.filterColumnAriaLabel,
|
|
856
|
+
String(column.title)
|
|
857
|
+
),
|
|
858
|
+
placeholder: column.filter.placeholder || labels.filterPlaceholder,
|
|
859
|
+
draggable: false,
|
|
860
|
+
"onUpdate:modelValue": (value) => ctx.handleFilter(column.key, value ?? "")
|
|
861
|
+
})
|
|
862
|
+
]
|
|
863
|
+
)
|
|
916
864
|
] : []
|
|
917
865
|
]
|
|
918
866
|
)
|
|
919
867
|
);
|
|
920
868
|
});
|
|
921
|
-
|
|
922
|
-
headerCells.push(expandHeaderTh);
|
|
923
|
-
}
|
|
869
|
+
headerCells.push(...chrome.trailing.map((slot) => chromeTh(slot)));
|
|
924
870
|
return h2("thead", { class: getTableHeaderClasses(props.stickyHeader) }, [h2("tr", headerCells)]);
|
|
925
871
|
}
|
|
926
872
|
|
|
@@ -941,9 +887,20 @@ import {
|
|
|
941
887
|
getEditableCellClasses,
|
|
942
888
|
editableCellInputClasses,
|
|
943
889
|
tableGroupHeaderClasses,
|
|
944
|
-
getGroupHeaderCellClasses
|
|
890
|
+
getGroupHeaderCellClasses,
|
|
891
|
+
getTableChromeSlots as getTableChromeSlots2,
|
|
892
|
+
hasTableSelectionColumn as hasTableSelectionColumn2,
|
|
893
|
+
resolveTableExpandSlot as resolveTableExpandSlot2,
|
|
894
|
+
formatTableSelectRowAriaLabel,
|
|
895
|
+
formatTableGroupHeaderText,
|
|
896
|
+
tableVirtualSpacerCellClasses
|
|
945
897
|
} from "@expcat/tigercat-core";
|
|
946
898
|
function renderTableBody(ctx, props, slots, labels) {
|
|
899
|
+
const hasRowControls = hasTableSelectionColumn2(props.rowSelection) || Boolean(props.expandable);
|
|
900
|
+
const chrome = getTableChromeSlots2({
|
|
901
|
+
hasSelectionColumn: hasTableSelectionColumn2(props.rowSelection),
|
|
902
|
+
expand: resolveTableExpandSlot2(props.expandable)
|
|
903
|
+
});
|
|
947
904
|
if (props.loading) {
|
|
948
905
|
return null;
|
|
949
906
|
}
|
|
@@ -975,12 +932,14 @@ function renderTableBody(ctx, props, slots, labels) {
|
|
|
975
932
|
"tr[data-tiger-table-row-index]"
|
|
976
933
|
);
|
|
977
934
|
if (!row) return null;
|
|
978
|
-
const
|
|
979
|
-
if (!Number.isInteger(
|
|
980
|
-
const
|
|
981
|
-
|
|
935
|
+
const sourceIndex = Number(row.dataset.tigerTableRowIndex);
|
|
936
|
+
if (!Number.isInteger(sourceIndex)) return null;
|
|
937
|
+
const pageIndex = ctx.pageSourceIndices.value.indexOf(sourceIndex);
|
|
938
|
+
if (pageIndex < 0) return null;
|
|
939
|
+
const record = ctx.paginatedData.value[pageIndex];
|
|
940
|
+
const key = ctx.paginatedRowKeys.value[pageIndex];
|
|
982
941
|
if (!record || key === void 0) return null;
|
|
983
|
-
return { key, record, index };
|
|
942
|
+
return { key, record, index: sourceIndex };
|
|
984
943
|
}
|
|
985
944
|
function handleBodyClick(event) {
|
|
986
945
|
const row = getDelegatedRow(event);
|
|
@@ -1010,14 +969,15 @@ function renderTableBody(ctx, props, slots, labels) {
|
|
|
1010
969
|
onDrop: props.rowDraggable ? handleBodyDrop : void 0
|
|
1011
970
|
};
|
|
1012
971
|
function renderDataRow(record, index) {
|
|
972
|
+
const sourceIndex = ctx.pageSourceIndices.value[index] ?? index;
|
|
1013
973
|
const key = ctx.paginatedRowKeys.value[index];
|
|
1014
974
|
const isSelected = ctx.selectedRowKeySet.value.has(key);
|
|
1015
975
|
const isExpanded = ctx.expandedRowKeySet.value.has(key);
|
|
1016
976
|
const isRowExpandable = props.expandable ? props.expandable.rowExpandable ? props.expandable.rowExpandable(record) : true : false;
|
|
1017
|
-
const rowClass = typeof props.rowClassName === "function" ? props.rowClassName(record,
|
|
977
|
+
const rowClass = typeof props.rowClassName === "function" ? props.rowClassName(record, sourceIndex) : props.rowClassName;
|
|
1018
978
|
const cells = [];
|
|
1019
|
-
const
|
|
1020
|
-
const expandToggleCell =
|
|
979
|
+
const checkboxProps = props.rowSelection?.getCheckboxProps?.(record) || {};
|
|
980
|
+
const expandToggleCell = h3(
|
|
1021
981
|
"td",
|
|
1022
982
|
{
|
|
1023
983
|
class: getExpandIconCellClasses2(props.size)
|
|
@@ -1038,31 +998,43 @@ function renderTableBody(ctx, props, slots, labels) {
|
|
|
1038
998
|
[ExpandIcon(isExpanded)]
|
|
1039
999
|
)
|
|
1040
1000
|
] : []
|
|
1041
|
-
)
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1001
|
+
);
|
|
1002
|
+
const selectionCell = h3(
|
|
1003
|
+
"td",
|
|
1004
|
+
{
|
|
1005
|
+
class: getCheckboxCellClasses2(props.size),
|
|
1006
|
+
onClick: (e) => e.stopPropagation()
|
|
1007
|
+
},
|
|
1008
|
+
[
|
|
1009
|
+
props.rowSelection?.type === "radio" ? h3(Radio, {
|
|
1010
|
+
size: "sm",
|
|
1011
|
+
name: props.selectionName,
|
|
1012
|
+
value: key,
|
|
1013
|
+
modelValue: isSelected,
|
|
1014
|
+
disabled: checkboxProps.disabled,
|
|
1015
|
+
"aria-label": formatTableSelectRowAriaLabel(
|
|
1016
|
+
labels.selectRowAriaLabel,
|
|
1017
|
+
sourceIndex + 1
|
|
1018
|
+
),
|
|
1019
|
+
onChange: (checked) => {
|
|
1020
|
+
if (checked) ctx.handleSelectRow(key, true);
|
|
1021
|
+
}
|
|
1022
|
+
}) : h3(Checkbox, {
|
|
1023
|
+
size: "sm",
|
|
1024
|
+
modelValue: isSelected,
|
|
1025
|
+
disabled: checkboxProps.disabled,
|
|
1026
|
+
"aria-label": formatTableSelectRowAriaLabel(
|
|
1027
|
+
labels.selectRowAriaLabel,
|
|
1028
|
+
sourceIndex + 1
|
|
1029
|
+
),
|
|
1030
|
+
onChange: (checked) => ctx.handleSelectRow(key, checked)
|
|
1031
|
+
})
|
|
1032
|
+
]
|
|
1033
|
+
);
|
|
1034
|
+
function chromeTd(slot) {
|
|
1035
|
+
return slot === "expand" ? expandToggleCell : selectionCell;
|
|
1065
1036
|
}
|
|
1037
|
+
cells.push(...chrome.leading.map((slot) => chromeTd(slot)));
|
|
1066
1038
|
ctx.displayColumns.value.forEach((column) => {
|
|
1067
1039
|
const dataKey = column.dataKey || column.key;
|
|
1068
1040
|
const cellValue = record[dataKey];
|
|
@@ -1075,15 +1047,15 @@ function renderTableBody(ctx, props, slots, labels) {
|
|
|
1075
1047
|
view: "table",
|
|
1076
1048
|
column,
|
|
1077
1049
|
record,
|
|
1078
|
-
rowIndex:
|
|
1050
|
+
rowIndex: sourceIndex,
|
|
1079
1051
|
striped: props.striped,
|
|
1080
1052
|
stripedActive: props.striped && index % 2 === 0,
|
|
1081
1053
|
selected: isSelected,
|
|
1082
1054
|
hoverable: props.hoverable,
|
|
1083
1055
|
fixedInfo: ctx.fixedColumnsInfo.value
|
|
1084
1056
|
});
|
|
1085
|
-
const isEditing = ctx.editingCell.value?.rowIndex ===
|
|
1086
|
-
const isEditableCell = ctx.isCellEditable(column.key,
|
|
1057
|
+
const isEditing = ctx.editingCell.value?.rowIndex === sourceIndex && ctx.editingCell.value?.columnKey === column.key;
|
|
1058
|
+
const isEditableCell = ctx.isCellEditable(column.key, sourceIndex);
|
|
1087
1059
|
const cellContent = isEditing ? h3("input", {
|
|
1088
1060
|
type: "text",
|
|
1089
1061
|
class: editableCellInputClasses,
|
|
@@ -1097,7 +1069,7 @@ function renderTableBody(ctx, props, slots, labels) {
|
|
|
1097
1069
|
if (e.key === "Enter") ctx.commitEdit();
|
|
1098
1070
|
if (e.key === "Escape") ctx.cancelEdit();
|
|
1099
1071
|
}
|
|
1100
|
-
}) : slots[`cell-${column.key}`]?.({ record, index }) ?? (column.render ? column.render(record,
|
|
1072
|
+
}) : slots[`cell-${column.key}`]?.({ record, index: sourceIndex }) ?? (column.render ? column.render(record, sourceIndex) : cellValue);
|
|
1101
1073
|
cells.push(
|
|
1102
1074
|
h3(
|
|
1103
1075
|
"td",
|
|
@@ -1109,32 +1081,29 @@ function renderTableBody(ctx, props, slots, labels) {
|
|
|
1109
1081
|
isEditableCell && !isEditing && getEditableCellClasses(false)
|
|
1110
1082
|
),
|
|
1111
1083
|
style,
|
|
1112
|
-
onDblclick: isEditableCell && !isEditing ? () => ctx.startEditing(
|
|
1084
|
+
onDblclick: isEditableCell && !isEditing ? () => ctx.startEditing(sourceIndex, column.key, cellValue) : void 0
|
|
1113
1085
|
},
|
|
1114
1086
|
[cellContent]
|
|
1115
1087
|
)
|
|
1116
1088
|
);
|
|
1117
1089
|
});
|
|
1118
|
-
|
|
1119
|
-
cells.push(expandToggleCell);
|
|
1120
|
-
}
|
|
1090
|
+
cells.push(...chrome.trailing.map((slot) => chromeTd(slot)));
|
|
1121
1091
|
const rowNode = h3(
|
|
1122
1092
|
"tr",
|
|
1123
1093
|
{
|
|
1124
1094
|
key,
|
|
1125
|
-
"data-tiger-table-row-index":
|
|
1095
|
+
"data-tiger-table-row-index": sourceIndex,
|
|
1126
1096
|
class: classNames2(
|
|
1127
1097
|
getTableRowClasses(props.hoverable, props.striped, index % 2 === 0, rowClass),
|
|
1128
1098
|
ctx.fixedColumnsInfo.value.hasFixedColumns && "group"
|
|
1129
1099
|
),
|
|
1130
1100
|
"aria-selected": props.rowSelection ? isSelected : void 0,
|
|
1131
|
-
tabindex: props.interactiveRows ? 0 : void 0,
|
|
1132
|
-
|
|
1133
|
-
onKeydown: props.interactiveRows ? (e) => {
|
|
1101
|
+
tabindex: props.interactiveRows && !hasRowControls ? 0 : void 0,
|
|
1102
|
+
onKeydown: props.interactiveRows && !hasRowControls ? (e) => {
|
|
1134
1103
|
if (e.target !== e.currentTarget) return;
|
|
1135
1104
|
if (isActivationKey(e)) {
|
|
1136
1105
|
e.preventDefault();
|
|
1137
|
-
ctx.handleRowClick(record,
|
|
1106
|
+
ctx.handleRowClick(record, sourceIndex, key);
|
|
1138
1107
|
}
|
|
1139
1108
|
} : void 0,
|
|
1140
1109
|
draggable: props.rowDraggable ? "true" : void 0
|
|
@@ -1142,7 +1111,7 @@ function renderTableBody(ctx, props, slots, labels) {
|
|
|
1142
1111
|
cells
|
|
1143
1112
|
);
|
|
1144
1113
|
if (props.expandable && isExpanded && isRowExpandable) {
|
|
1145
|
-
const expandedContent = slots["expanded-row"]?.({ record, index }) || (props.expandable.expandedRowRender ? props.expandable.expandedRowRender(record,
|
|
1114
|
+
const expandedContent = slots["expanded-row"]?.({ record, index: sourceIndex }) || (props.expandable.expandedRowRender ? props.expandable.expandedRowRender(record, sourceIndex) : null);
|
|
1146
1115
|
const expandedRow = h3(
|
|
1147
1116
|
"tr",
|
|
1148
1117
|
{
|
|
@@ -1175,7 +1144,7 @@ function renderTableBody(ctx, props, slots, labels) {
|
|
|
1175
1144
|
colspan: ctx.totalColumnCount.value,
|
|
1176
1145
|
class: getGroupHeaderCellClasses(props.size)
|
|
1177
1146
|
},
|
|
1178
|
-
|
|
1147
|
+
formatTableGroupHeaderText(labels.groupHeaderText, groupKey, groupItems.length)
|
|
1179
1148
|
)
|
|
1180
1149
|
])
|
|
1181
1150
|
);
|
|
@@ -1192,31 +1161,47 @@ function renderTableBody(ctx, props, slots, labels) {
|
|
|
1192
1161
|
return h3("tbody", delegatedBodyHandlers, groupRows);
|
|
1193
1162
|
}
|
|
1194
1163
|
const vw = props.virtualWindow;
|
|
1195
|
-
if (vw
|
|
1164
|
+
if (vw) {
|
|
1196
1165
|
const windowed = [];
|
|
1197
1166
|
if (vw.topPad > 0) {
|
|
1198
1167
|
windowed.push(
|
|
1199
|
-
h3(
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1168
|
+
h3(
|
|
1169
|
+
"tr",
|
|
1170
|
+
{ key: "virtual-top", "aria-hidden": "true", "data-tiger-table-virtual-spacer": "" },
|
|
1171
|
+
[
|
|
1172
|
+
h3("td", {
|
|
1173
|
+
colspan: ctx.totalColumnCount.value,
|
|
1174
|
+
class: tableVirtualSpacerCellClasses,
|
|
1175
|
+
style: { height: `${vw.topPad}px` }
|
|
1176
|
+
})
|
|
1177
|
+
]
|
|
1178
|
+
)
|
|
1205
1179
|
);
|
|
1206
1180
|
}
|
|
1207
1181
|
for (let index = vw.startIndex; index <= vw.endIndex; index++) {
|
|
1208
|
-
const
|
|
1182
|
+
const record = ctx.paginatedData.value[index];
|
|
1183
|
+
if (record === void 0) continue;
|
|
1184
|
+
const result = renderDataRow(record, index);
|
|
1209
1185
|
if (Array.isArray(result)) windowed.push(...result);
|
|
1210
1186
|
else windowed.push(result);
|
|
1211
1187
|
}
|
|
1212
1188
|
if (vw.bottomPad > 0) {
|
|
1213
1189
|
windowed.push(
|
|
1214
|
-
h3(
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1190
|
+
h3(
|
|
1191
|
+
"tr",
|
|
1192
|
+
{
|
|
1193
|
+
key: "virtual-bottom",
|
|
1194
|
+
"aria-hidden": "true",
|
|
1195
|
+
"data-tiger-table-virtual-spacer": ""
|
|
1196
|
+
},
|
|
1197
|
+
[
|
|
1198
|
+
h3("td", {
|
|
1199
|
+
colspan: ctx.totalColumnCount.value,
|
|
1200
|
+
class: tableVirtualSpacerCellClasses,
|
|
1201
|
+
style: { height: `${vw.bottomPad}px` }
|
|
1202
|
+
})
|
|
1203
|
+
]
|
|
1204
|
+
)
|
|
1220
1205
|
);
|
|
1221
1206
|
}
|
|
1222
1207
|
return h3("tbody", delegatedBodyHandlers, windowed);
|
|
@@ -1227,16 +1212,22 @@ function renderTableBody(ctx, props, slots, labels) {
|
|
|
1227
1212
|
|
|
1228
1213
|
// src/components/Table/render-summary.ts
|
|
1229
1214
|
import { h as h4 } from "vue";
|
|
1230
|
-
import {
|
|
1215
|
+
import {
|
|
1216
|
+
getTableCellClasses as getTableCellClasses2,
|
|
1217
|
+
getTableChromeSlots as getTableChromeSlots3,
|
|
1218
|
+
hasTableSelectionColumn as hasTableSelectionColumn3,
|
|
1219
|
+
resolveTableExpandSlot as resolveTableExpandSlot3,
|
|
1220
|
+
tableSummaryRowClasses
|
|
1221
|
+
} from "@expcat/tigercat-core";
|
|
1231
1222
|
function renderSummaryRow(ctx, props) {
|
|
1232
1223
|
if (!props.summaryRow?.show) return null;
|
|
1233
|
-
const
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1224
|
+
const chrome = getTableChromeSlots3({
|
|
1225
|
+
hasSelectionColumn: hasTableSelectionColumn3(props.rowSelection),
|
|
1226
|
+
expand: resolveTableExpandSlot3(props.expandable)
|
|
1227
|
+
});
|
|
1228
|
+
const emptyCell = () => h4("td", { class: getTableCellClasses2(props.size, "left") });
|
|
1229
|
+
const leading = chrome.leading.map(() => emptyCell());
|
|
1230
|
+
const trailing = chrome.trailing.map(() => emptyCell());
|
|
1240
1231
|
const dataCells = ctx.displayColumns.value.map((col) => {
|
|
1241
1232
|
const dataKey = col.dataKey || col.key;
|
|
1242
1233
|
const val = props.summaryRow.data[dataKey];
|
|
@@ -1246,34 +1237,34 @@ function renderSummaryRow(ctx, props) {
|
|
|
1246
1237
|
key: col.key,
|
|
1247
1238
|
class: getTableCellClasses2(props.size, col.align || "left", col.className)
|
|
1248
1239
|
},
|
|
1249
|
-
val
|
|
1240
|
+
val ?? void 0
|
|
1250
1241
|
);
|
|
1251
1242
|
});
|
|
1252
|
-
return h4("tfoot", [
|
|
1243
|
+
return h4("tfoot", [
|
|
1244
|
+
h4("tr", { class: tableSummaryRowClasses }, [...leading, ...dataCells, ...trailing])
|
|
1245
|
+
]);
|
|
1253
1246
|
}
|
|
1254
1247
|
|
|
1255
1248
|
// src/components/Table/render-pagination.ts
|
|
1256
1249
|
import { h as h5 } from "vue";
|
|
1257
1250
|
import {
|
|
1258
|
-
formatPaginationPageIndicator,
|
|
1259
1251
|
formatPaginationTotal,
|
|
1260
1252
|
getBuiltInPaginationContainerClasses,
|
|
1261
1253
|
getPaginationLabels,
|
|
1262
1254
|
resolvePaginationDisplayMode
|
|
1263
1255
|
} from "@expcat/tigercat-core";
|
|
1264
1256
|
function renderPagination(ctx, props, view) {
|
|
1265
|
-
|
|
1257
|
+
const paginationConfig = ctx.paginationConfig.value;
|
|
1258
|
+
if (props.pagination === false || !ctx.paginationInfo.value || !paginationConfig) {
|
|
1266
1259
|
return null;
|
|
1267
1260
|
}
|
|
1268
|
-
const { totalPages } = ctx.paginationInfo.value;
|
|
1269
|
-
const paginationConfig = props.pagination;
|
|
1270
|
-
const total = paginationConfig.total !== void 0 && paginationConfig.total > 0 ? paginationConfig.total : ctx.processedData.value.length;
|
|
1261
|
+
const { totalPages, total } = ctx.paginationInfo.value;
|
|
1271
1262
|
const locale = view?.disableI18n ? void 0 : view?.locale;
|
|
1272
1263
|
const labels = getPaginationLabels(locale);
|
|
1273
1264
|
const localeCode = locale?.locale;
|
|
1274
1265
|
const { simple, showQuickJumper } = resolvePaginationDisplayMode(totalPages, paginationConfig);
|
|
1275
1266
|
const totalText = paginationConfig.totalText ?? ((value, range) => formatPaginationTotal(labels.totalText, value, range, localeCode));
|
|
1276
|
-
const pageIndicatorText = paginationConfig.pageIndicatorText
|
|
1267
|
+
const pageIndicatorText = paginationConfig.pageIndicatorText;
|
|
1277
1268
|
const overrides = view?.disableI18n ? { ...labels } : {};
|
|
1278
1269
|
if (paginationConfig.prevText) overrides.prevPageAriaLabel = paginationConfig.prevText;
|
|
1279
1270
|
if (paginationConfig.nextText) overrides.nextPageAriaLabel = paginationConfig.nextText;
|
|
@@ -1324,8 +1315,17 @@ var Table = defineComponent({
|
|
|
1324
1315
|
const wrapperRef = ref2(null);
|
|
1325
1316
|
const tableRef = ref2(null);
|
|
1326
1317
|
const measuredColumnWidths = ref2({});
|
|
1327
|
-
const measuredRowHeights = ref2(
|
|
1328
|
-
const
|
|
1318
|
+
const measuredRowHeights = ref2({});
|
|
1319
|
+
const measuredContainerSize = ref2({ width: 0, height: 0 });
|
|
1320
|
+
const isCardViewport = ref2(false);
|
|
1321
|
+
const selectionGroupName = useId();
|
|
1322
|
+
let stopCardViewport;
|
|
1323
|
+
const ctx = useTableState(
|
|
1324
|
+
props,
|
|
1325
|
+
emit,
|
|
1326
|
+
measuredColumnWidths,
|
|
1327
|
+
measuredContainerSize
|
|
1328
|
+
);
|
|
1329
1329
|
const resolvedPaginationLocale = ref2();
|
|
1330
1330
|
const resolvedTableLocale = ref2();
|
|
1331
1331
|
let paginationLocaleResolveId = 0;
|
|
@@ -1408,33 +1408,83 @@ var Table = defineComponent({
|
|
|
1408
1408
|
if (!areNumberRecordsEqual(measuredColumnWidths.value, snapshot.columnWidths)) {
|
|
1409
1409
|
measuredColumnWidths.value = snapshot.columnWidths;
|
|
1410
1410
|
}
|
|
1411
|
-
if (!
|
|
1411
|
+
if (!areNumberRecordsEqual(measuredRowHeights.value, snapshot.rowHeights)) {
|
|
1412
1412
|
measuredRowHeights.value = snapshot.rowHeights;
|
|
1413
1413
|
}
|
|
1414
|
+
const nextSize = { width: snapshot.containerWidth, height: snapshot.containerHeight };
|
|
1415
|
+
if (measuredContainerSize.value.width !== nextSize.width || measuredContainerSize.value.height !== nextSize.height) {
|
|
1416
|
+
measuredContainerSize.value = nextSize;
|
|
1417
|
+
}
|
|
1414
1418
|
}
|
|
1415
1419
|
});
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
+
const shouldObserveGeometry = computed2(() => {
|
|
1421
|
+
const resolvedProps = props;
|
|
1422
|
+
const virtualRecommendation = getTableVirtualRecommendation({
|
|
1423
|
+
virtual: resolvedProps.virtual,
|
|
1424
|
+
autoVirtual: resolvedProps.autoVirtual,
|
|
1425
|
+
dataLength: ctx.processedData.value.length,
|
|
1426
|
+
threshold: resolvedProps.virtualThreshold
|
|
1427
|
+
});
|
|
1428
|
+
return virtualRecommendation.enabled || resolvedProps.columnLockable || ctx.displayColumns.value.some(
|
|
1429
|
+
(column) => column.fixed === "left" || column.fixed === "right"
|
|
1430
|
+
);
|
|
1431
|
+
});
|
|
1432
|
+
function attachResizeObserver() {
|
|
1433
|
+
resizeController.disconnect();
|
|
1434
|
+
if (!shouldObserveGeometry.value || !wrapperRef.value) return;
|
|
1435
|
+
resizeController.observe(wrapperRef.value, tableRef.value);
|
|
1436
|
+
}
|
|
1437
|
+
watch2(
|
|
1438
|
+
[
|
|
1439
|
+
shouldObserveGeometry,
|
|
1440
|
+
() => ctx.displayColumns.value.length,
|
|
1441
|
+
() => ctx.paginatedData.value.length
|
|
1442
|
+
],
|
|
1443
|
+
() => attachResizeObserver()
|
|
1444
|
+
);
|
|
1445
|
+
onMounted(() => attachResizeObserver());
|
|
1446
|
+
watch2(
|
|
1447
|
+
() => [props.responsiveMode, props.cardBreakpoint],
|
|
1448
|
+
([mode, breakpoint]) => {
|
|
1449
|
+
stopCardViewport?.();
|
|
1450
|
+
if (mode !== "card") {
|
|
1451
|
+
isCardViewport.value = false;
|
|
1452
|
+
stopCardViewport = void 0;
|
|
1453
|
+
return;
|
|
1454
|
+
}
|
|
1455
|
+
stopCardViewport = subscribeTableCardViewport(breakpoint, (next) => {
|
|
1456
|
+
isCardViewport.value = next;
|
|
1457
|
+
});
|
|
1458
|
+
},
|
|
1459
|
+
{ immediate: true }
|
|
1460
|
+
);
|
|
1461
|
+
onBeforeUnmount(() => {
|
|
1462
|
+
stopCardViewport?.();
|
|
1463
|
+
resizeController.disconnect();
|
|
1420
1464
|
});
|
|
1421
|
-
onBeforeUnmount(() => resizeController.disconnect());
|
|
1422
1465
|
return () => {
|
|
1423
1466
|
const resolvedProps = props;
|
|
1424
1467
|
const virtualRecommendation = getTableVirtualRecommendation({
|
|
1425
1468
|
virtual: resolvedProps.virtual,
|
|
1426
1469
|
autoVirtual: resolvedProps.autoVirtual,
|
|
1427
|
-
dataLength:
|
|
1470
|
+
dataLength: ctx.processedData.value.length,
|
|
1428
1471
|
threshold: resolvedProps.virtualThreshold
|
|
1429
1472
|
});
|
|
1430
|
-
const
|
|
1473
|
+
const virtualAllowed = canUseTableVirtualWindow({
|
|
1474
|
+
expandable: resolvedProps.expandable,
|
|
1475
|
+
groupBy: resolvedProps.groupBy
|
|
1476
|
+
});
|
|
1477
|
+
const effectiveVirtual = virtualRecommendation.enabled && virtualAllowed;
|
|
1478
|
+
const showCardTree = resolvedProps.responsiveMode === "card" && isCardViewport.value;
|
|
1479
|
+
const showTableTree = !showCardTree;
|
|
1431
1480
|
const wrapperStyle = resolvedProps.maxHeight ? {
|
|
1432
1481
|
maxHeight: typeof resolvedProps.maxHeight === "number" ? `${resolvedProps.maxHeight}px` : resolvedProps.maxHeight
|
|
1433
1482
|
} : void 0;
|
|
1483
|
+
const measuredItemHeight = Object.values(measuredRowHeights.value)[0];
|
|
1434
1484
|
const virtualWindow = effectiveVirtual ? getTableVirtualWindow(
|
|
1435
1485
|
ctx.virtualScrollTop.value,
|
|
1436
|
-
typeof resolvedProps.virtualHeight === "number" ? resolvedProps.virtualHeight : 400,
|
|
1437
|
-
resolvedProps.virtualItemHeight,
|
|
1486
|
+
measuredContainerSize.value.height > 0 ? measuredContainerSize.value.height : typeof resolvedProps.virtualHeight === "number" ? resolvedProps.virtualHeight : 400,
|
|
1487
|
+
measuredItemHeight > 0 ? measuredItemHeight : resolvedProps.virtualItemHeight,
|
|
1438
1488
|
ctx.paginatedData.value.length
|
|
1439
1489
|
) : void 0;
|
|
1440
1490
|
const renderProps = {
|
|
@@ -1443,7 +1493,8 @@ var Table = defineComponent({
|
|
|
1443
1493
|
// Rows become keyboard-activable when a row-click listener is bound or
|
|
1444
1494
|
// row selection is enabled (mirrors React's onRowClick/rowSelection).
|
|
1445
1495
|
interactiveRows: !!resolvedProps.rowSelection || typeof instance?.vnode.props?.onRowClick === "function",
|
|
1446
|
-
virtualWindow
|
|
1496
|
+
virtualWindow,
|
|
1497
|
+
selectionName: selectionGroupName
|
|
1447
1498
|
};
|
|
1448
1499
|
const shouldPinColumns = resolvedProps.columnLockable || ctx.fixedColumnsInfo.value.hasFixedColumns;
|
|
1449
1500
|
const colgroup = shouldPinColumns ? h6(
|
|
@@ -1452,8 +1503,8 @@ var Table = defineComponent({
|
|
|
1452
1503
|
columns: ctx.displayColumns.value,
|
|
1453
1504
|
frozenWidths: ctx.frozenColumnWidths.value,
|
|
1454
1505
|
size: resolvedProps.size,
|
|
1455
|
-
hasSelectionColumn:
|
|
1456
|
-
expand: resolvedProps.expandable
|
|
1506
|
+
hasSelectionColumn: hasTableSelectionColumn4(resolvedProps.rowSelection),
|
|
1507
|
+
expand: resolveTableExpandSlot4(resolvedProps.expandable)
|
|
1457
1508
|
}).map(
|
|
1458
1509
|
(entry, index) => h6("col", {
|
|
1459
1510
|
key: `${entry.key}-${index}`,
|
|
@@ -1473,31 +1524,36 @@ var Table = defineComponent({
|
|
|
1473
1524
|
ref: tableRef,
|
|
1474
1525
|
class: classNames3(
|
|
1475
1526
|
tableBaseClasses,
|
|
1476
|
-
getTableResponsiveTableClasses(
|
|
1527
|
+
resolvedProps.responsiveMode === "scroll" ? getTableResponsiveTableClasses(
|
|
1477
1528
|
resolvedProps.responsiveMode,
|
|
1478
1529
|
resolvedProps.cardBreakpoint
|
|
1479
|
-
),
|
|
1530
|
+
) : void 0,
|
|
1480
1531
|
resolvedProps.tableLayout === "fixed" ? "table-fixed" : "table-auto"
|
|
1481
1532
|
),
|
|
1482
1533
|
style: ctx.fixedColumnsInfo.value.hasFixedColumns && ctx.fixedColumnsInfo.value.minTableWidth ? { minWidth: `${ctx.fixedColumnsInfo.value.minTableWidth}px` } : void 0
|
|
1483
1534
|
},
|
|
1484
1535
|
tableChildren
|
|
1485
1536
|
);
|
|
1486
|
-
const
|
|
1537
|
+
const virtualScrollerStyle = {
|
|
1538
|
+
height: typeof resolvedProps.virtualHeight === "number" ? `${resolvedProps.virtualHeight}px` : resolvedProps.virtualHeight,
|
|
1539
|
+
overflow: "auto"
|
|
1540
|
+
};
|
|
1541
|
+
const onVirtualScroll = (e) => {
|
|
1542
|
+
ctx.virtualScrollTop.value = e.target.scrollTop;
|
|
1543
|
+
};
|
|
1544
|
+
const tableContent = showTableTree && (effectiveVirtual ? h6(
|
|
1487
1545
|
"div",
|
|
1488
1546
|
{
|
|
1489
|
-
style:
|
|
1490
|
-
onScroll:
|
|
1491
|
-
ctx.virtualScrollTop.value = e.target.scrollTop;
|
|
1492
|
-
}
|
|
1547
|
+
style: virtualScrollerStyle,
|
|
1548
|
+
onScroll: onVirtualScroll
|
|
1493
1549
|
},
|
|
1494
1550
|
[tableInner]
|
|
1495
|
-
) : tableInner;
|
|
1551
|
+
) : tableInner);
|
|
1496
1552
|
const cardContent = (() => {
|
|
1497
|
-
if (
|
|
1553
|
+
if (!showCardTree) return null;
|
|
1498
1554
|
const cardChildren = [];
|
|
1499
1555
|
const sortableColumns = ctx.displayColumns.value.filter((column) => column.sortable);
|
|
1500
|
-
if (resolvedProps.rowSelection && resolvedProps.rowSelection.type !== "radio" && resolvedProps.rowSelection.showCheckbox !== false && ctx.paginatedData.value.length > 0) {
|
|
1556
|
+
if (resolvedProps.rowSelection && resolvedProps.rowSelection.type !== "radio" && resolvedProps.rowSelection.showCheckbox !== false && !resolvedProps.loading && ctx.paginatedData.value.length > 0) {
|
|
1501
1557
|
cardChildren.push(
|
|
1502
1558
|
h6(
|
|
1503
1559
|
"div",
|
|
@@ -1529,9 +1585,10 @@ var Table = defineComponent({
|
|
|
1529
1585
|
[
|
|
1530
1586
|
h6(Select, {
|
|
1531
1587
|
size: "sm",
|
|
1532
|
-
|
|
1588
|
+
"aria-label": tableLabels.value.sortMenuAriaLabel,
|
|
1589
|
+
modelValue: getTableCardSortValue(ctx.sortState.value),
|
|
1533
1590
|
options: [
|
|
1534
|
-
{ label: tableLabels.value.clearSortText, value:
|
|
1591
|
+
{ label: tableLabels.value.clearSortText, value: TABLE_CARD_SORT_NONE },
|
|
1535
1592
|
...sortableColumns.flatMap((column) => [
|
|
1536
1593
|
{
|
|
1537
1594
|
label: `${formatTableSortByText2(tableLabels.value.sortByText, column.title)} \u2191`,
|
|
@@ -1545,30 +1602,35 @@ var Table = defineComponent({
|
|
|
1545
1602
|
],
|
|
1546
1603
|
clearable: false,
|
|
1547
1604
|
"onUpdate:modelValue": (value) => {
|
|
1548
|
-
|
|
1549
|
-
if (!nextValue) {
|
|
1550
|
-
ctx.handleSetSort({ key: null, direction: null });
|
|
1551
|
-
return;
|
|
1552
|
-
}
|
|
1553
|
-
const separatorIndex = nextValue.lastIndexOf(":");
|
|
1554
|
-
const key = nextValue.slice(0, separatorIndex);
|
|
1555
|
-
const direction = nextValue.slice(separatorIndex + 1);
|
|
1556
|
-
ctx.handleSetSort({ key, direction });
|
|
1605
|
+
ctx.handleSetSort(parseTableCardSortValue(value));
|
|
1557
1606
|
}
|
|
1558
1607
|
})
|
|
1559
1608
|
]
|
|
1560
1609
|
)
|
|
1561
1610
|
);
|
|
1562
1611
|
}
|
|
1563
|
-
if (
|
|
1612
|
+
if (resolvedProps.loading) {
|
|
1613
|
+
} else if (ctx.paginatedData.value.length === 0) {
|
|
1564
1614
|
cardChildren.push(
|
|
1565
1615
|
h6("div", { class: getTableResponsiveCardClasses(resolvedProps.cardPadding) }, [
|
|
1566
1616
|
h6(Empty, { showImage: false, description: tableLabels.value.emptyText })
|
|
1567
1617
|
])
|
|
1568
1618
|
);
|
|
1569
1619
|
} else {
|
|
1620
|
+
const cardStart = effectiveVirtual && virtualWindow ? virtualWindow.startIndex : 0;
|
|
1621
|
+
const cardEnd = effectiveVirtual && virtualWindow ? virtualWindow.endIndex + 1 : ctx.paginatedData.value.length;
|
|
1622
|
+
if (effectiveVirtual && virtualWindow && virtualWindow.topPad > 0) {
|
|
1623
|
+
cardChildren.push(
|
|
1624
|
+
h6("div", {
|
|
1625
|
+
"aria-hidden": "true",
|
|
1626
|
+
style: { height: `${virtualWindow.topPad}px` }
|
|
1627
|
+
})
|
|
1628
|
+
);
|
|
1629
|
+
}
|
|
1570
1630
|
cardChildren.push(
|
|
1571
|
-
...ctx.paginatedData.value.map((record,
|
|
1631
|
+
...ctx.paginatedData.value.slice(cardStart, cardEnd).map((record, offset) => {
|
|
1632
|
+
const index = cardStart + offset;
|
|
1633
|
+
const sourceIndex = ctx.pageSourceIndices.value[index] ?? index;
|
|
1572
1634
|
const key = ctx.paginatedRowKeys.value[index];
|
|
1573
1635
|
const isExpanded = ctx.expandedRowKeySet.value.has(key);
|
|
1574
1636
|
const isSelected = ctx.selectedRowKeySet.value.has(key);
|
|
@@ -1576,7 +1638,7 @@ var Table = defineComponent({
|
|
|
1576
1638
|
const { titleColumn, bodyColumns } = getCardColumns(ctx.displayColumns.value);
|
|
1577
1639
|
const renderCardCellContent = (column) => {
|
|
1578
1640
|
const dataKey = column.dataKey || column.key;
|
|
1579
|
-
return slots[`cell-${column.key}`]?.({ record, index }) ?? (column.render ? column.render(record,
|
|
1641
|
+
return slots[`cell-${column.key}`]?.({ record, index: sourceIndex }) ?? (column.render ? column.render(record, sourceIndex) : record[dataKey]);
|
|
1580
1642
|
};
|
|
1581
1643
|
const titleNode = titleColumn ? h6("div", { class: tableResponsiveCardTitleClasses }, [
|
|
1582
1644
|
renderCardCellContent(titleColumn)
|
|
@@ -1689,12 +1751,13 @@ var Table = defineComponent({
|
|
|
1689
1751
|
controls.push(
|
|
1690
1752
|
h6("span", { onClick: (event) => event.stopPropagation() }, [
|
|
1691
1753
|
resolvedProps.rowSelection.type === "radio" ? h6(Radio, {
|
|
1754
|
+
name: selectionGroupName,
|
|
1692
1755
|
value: key,
|
|
1693
|
-
|
|
1756
|
+
modelValue: isSelected,
|
|
1694
1757
|
disabled: checkboxProps.disabled,
|
|
1695
|
-
"aria-label":
|
|
1758
|
+
"aria-label": formatTableSelectRowAriaLabel2(
|
|
1696
1759
|
tableLabels.value.selectRowAriaLabel,
|
|
1697
|
-
|
|
1760
|
+
sourceIndex + 1,
|
|
1698
1761
|
tableLocale.value?.locale
|
|
1699
1762
|
),
|
|
1700
1763
|
onChange: () => ctx.handleSelectRow(key, true)
|
|
@@ -1702,9 +1765,9 @@ var Table = defineComponent({
|
|
|
1702
1765
|
size: "sm",
|
|
1703
1766
|
modelValue: isSelected,
|
|
1704
1767
|
disabled: checkboxProps.disabled,
|
|
1705
|
-
"aria-label":
|
|
1768
|
+
"aria-label": formatTableSelectRowAriaLabel2(
|
|
1706
1769
|
tableLabels.value.selectRowAriaLabel,
|
|
1707
|
-
|
|
1770
|
+
sourceIndex + 1,
|
|
1708
1771
|
tableLocale.value?.locale
|
|
1709
1772
|
),
|
|
1710
1773
|
onChange: (checked) => ctx.handleSelectRow(key, checked)
|
|
@@ -1744,10 +1807,10 @@ var Table = defineComponent({
|
|
|
1744
1807
|
])
|
|
1745
1808
|
]
|
|
1746
1809
|
) : titleNode;
|
|
1747
|
-
const expandedContent = resolvedProps.expandable && isExpanded && isRowExpandable ? slots["expanded-row"]?.({ record, index }) ?? resolvedProps.expandable.expandedRowRender?.(record,
|
|
1810
|
+
const expandedContent = resolvedProps.expandable && isExpanded && isRowExpandable ? slots["expanded-row"]?.({ record, index: sourceIndex }) ?? resolvedProps.expandable.expandedRowRender?.(record, sourceIndex) : null;
|
|
1748
1811
|
const cardContext = {
|
|
1749
1812
|
record,
|
|
1750
|
-
index,
|
|
1813
|
+
index: sourceIndex,
|
|
1751
1814
|
columns: ctx.displayColumns.value,
|
|
1752
1815
|
selected: isSelected,
|
|
1753
1816
|
expanded: isExpanded,
|
|
@@ -1755,7 +1818,9 @@ var Table = defineComponent({
|
|
|
1755
1818
|
selectRow: (checked) => ctx.handleSelectRow(key, checked)
|
|
1756
1819
|
};
|
|
1757
1820
|
const customCard = slots.card?.(cardContext) ?? resolvedProps.renderCard?.(cardContext);
|
|
1758
|
-
const resolvedCardClassName = typeof resolvedProps.cardClassName === "function" ? resolvedProps.cardClassName(record,
|
|
1821
|
+
const resolvedCardClassName = typeof resolvedProps.cardClassName === "function" ? resolvedProps.cardClassName(record, sourceIndex) : resolvedProps.cardClassName;
|
|
1822
|
+
const hasCardControls = controls.length > 0;
|
|
1823
|
+
const cardInteractive = !!resolvedProps.rowSelection || typeof instance?.vnode.props?.onRowClick === "function";
|
|
1759
1824
|
return h6(
|
|
1760
1825
|
"div",
|
|
1761
1826
|
{
|
|
@@ -1764,7 +1829,15 @@ var Table = defineComponent({
|
|
|
1764
1829
|
getTableResponsiveCardClasses(resolvedProps.cardPadding),
|
|
1765
1830
|
resolvedCardClassName
|
|
1766
1831
|
),
|
|
1767
|
-
|
|
1832
|
+
tabindex: cardInteractive && !hasCardControls ? 0 : void 0,
|
|
1833
|
+
onClick: () => ctx.handleRowClick(record, sourceIndex, key),
|
|
1834
|
+
onKeydown: cardInteractive && !hasCardControls ? (event) => {
|
|
1835
|
+
if (event.target !== event.currentTarget) return;
|
|
1836
|
+
if (isActivationKey2(event)) {
|
|
1837
|
+
event.preventDefault();
|
|
1838
|
+
ctx.handleRowClick(record, sourceIndex, key);
|
|
1839
|
+
}
|
|
1840
|
+
} : void 0
|
|
1768
1841
|
},
|
|
1769
1842
|
customCard !== void 0 && customCard !== null ? [customCard] : [
|
|
1770
1843
|
controls.length && (!titleNode || resolvedProps.cardSelectionPosition !== "title-inline") ? h6("div", { class: "mb-2 flex items-center gap-3" }, controls) : null,
|
|
@@ -1781,12 +1854,22 @@ var Table = defineComponent({
|
|
|
1781
1854
|
);
|
|
1782
1855
|
})
|
|
1783
1856
|
);
|
|
1857
|
+
if (effectiveVirtual && virtualWindow && virtualWindow.bottomPad > 0) {
|
|
1858
|
+
cardChildren.push(
|
|
1859
|
+
h6("div", {
|
|
1860
|
+
"aria-hidden": "true",
|
|
1861
|
+
style: { height: `${virtualWindow.bottomPad}px` }
|
|
1862
|
+
})
|
|
1863
|
+
);
|
|
1864
|
+
}
|
|
1784
1865
|
}
|
|
1785
1866
|
return h6(
|
|
1786
1867
|
"div",
|
|
1787
1868
|
{
|
|
1788
|
-
class:
|
|
1789
|
-
"data-tiger-table-mobile": "card"
|
|
1869
|
+
class: tableCardListVisibleClasses,
|
|
1870
|
+
"data-tiger-table-mobile": "card",
|
|
1871
|
+
style: effectiveVirtual ? virtualScrollerStyle : void 0,
|
|
1872
|
+
onScroll: effectiveVirtual ? onVirtualScroll : void 0
|
|
1790
1873
|
},
|
|
1791
1874
|
cardChildren
|
|
1792
1875
|
);
|
|
@@ -1795,25 +1878,31 @@ var Table = defineComponent({
|
|
|
1795
1878
|
"div",
|
|
1796
1879
|
{
|
|
1797
1880
|
ref: wrapperRef,
|
|
1798
|
-
class: getTableWrapperClasses(
|
|
1881
|
+
class: getTableWrapperClasses(
|
|
1882
|
+
resolvedProps.bordered,
|
|
1883
|
+
resolvedProps.maxHeight,
|
|
1884
|
+
!effectiveVirtual
|
|
1885
|
+
),
|
|
1799
1886
|
style: wrapperStyle,
|
|
1800
|
-
"data-tiger-virtual":
|
|
1887
|
+
"data-tiger-virtual": effectiveVirtual ? "enabled" : void 0,
|
|
1801
1888
|
"data-tiger-virtual-recommended": virtualRecommendation.recommended ? "true" : void 0,
|
|
1802
1889
|
"data-tiger-virtual-threshold": virtualRecommendation.recommended ? virtualRecommendation.threshold : void 0,
|
|
1803
|
-
"data-tiger-measured-row-height": measuredRowHeights.value[0] || void 0,
|
|
1890
|
+
"data-tiger-measured-row-height": Object.values(measuredRowHeights.value)[0] || void 0,
|
|
1891
|
+
"data-tiger-table-layout": showCardTree ? "card" : "table",
|
|
1804
1892
|
"aria-busy": resolvedProps.loading
|
|
1805
1893
|
},
|
|
1806
1894
|
[
|
|
1807
|
-
resolvedProps.exportable && h6("div", { class:
|
|
1895
|
+
resolvedProps.exportable && h6("div", { class: tableExportBarClasses }, [
|
|
1808
1896
|
h6(
|
|
1809
|
-
|
|
1897
|
+
Button,
|
|
1810
1898
|
{
|
|
1811
1899
|
type: "button",
|
|
1812
|
-
|
|
1900
|
+
variant: "secondary",
|
|
1901
|
+
size: "sm",
|
|
1813
1902
|
onClick: ctx.handleExport,
|
|
1814
|
-
"aria-label":
|
|
1903
|
+
"aria-label": tableLabels.value.exportCsvAriaLabel
|
|
1815
1904
|
},
|
|
1816
|
-
|
|
1905
|
+
{ default: () => tableLabels.value.exportCsvText }
|
|
1817
1906
|
)
|
|
1818
1907
|
]),
|
|
1819
1908
|
tableContent,
|
|
@@ -1826,7 +1915,10 @@ var Table = defineComponent({
|
|
|
1826
1915
|
"aria-live": "polite",
|
|
1827
1916
|
"aria-label": tableLabels.value.loadingText
|
|
1828
1917
|
},
|
|
1829
|
-
[
|
|
1918
|
+
[
|
|
1919
|
+
h6(Loading, { "aria-hidden": true, role: "presentation" }),
|
|
1920
|
+
h6("span", { class: "sr-only" }, tableLabels.value.loadingText)
|
|
1921
|
+
]
|
|
1830
1922
|
),
|
|
1831
1923
|
renderPagination(ctx, renderProps, {
|
|
1832
1924
|
locale: paginationLocale.value,
|
|
@@ -1843,11 +1935,9 @@ function areNumberRecordsEqual(current, next) {
|
|
|
1843
1935
|
const nextKeys = Object.keys(next);
|
|
1844
1936
|
return currentKeys.length === nextKeys.length && nextKeys.every((key) => current[key] === next[key]);
|
|
1845
1937
|
}
|
|
1846
|
-
function areNumberArraysEqual(current, next) {
|
|
1847
|
-
return current.length === next.length && next.every((value, index) => current[index] === value);
|
|
1848
|
-
}
|
|
1849
1938
|
|
|
1850
1939
|
export {
|
|
1940
|
+
tableProps,
|
|
1851
1941
|
Table,
|
|
1852
1942
|
Table_default
|
|
1853
1943
|
};
|