@expcat/tigercat-react 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/chunk-2GQCFTD7.mjs +101 -0
- package/dist/chunk-2HKFQ74Z.mjs +127 -0
- package/dist/chunk-2JUPXEWX.js +236 -0
- package/dist/chunk-2PCALG7V.js +178 -0
- package/dist/{chunk-PSYDHEXN.mjs → chunk-2WBFUUVP.mjs} +23 -12
- package/dist/{chunk-DAMJCFFS.mjs → chunk-2Y5NIPHB.mjs} +48 -11
- package/dist/chunk-32PAZTVF.mjs +18 -5
- package/dist/chunk-34VGG7AK.mjs +13 -5
- package/dist/chunk-36WZNVQ5.mjs +19 -5
- package/dist/chunk-3E76U2RG.js +43 -37
- package/dist/chunk-3EB42WFR.mjs +21 -5
- package/dist/chunk-3HPDLIX3.mjs +16 -5
- package/dist/chunk-3MRP3XYI.js +137 -0
- package/dist/chunk-3QFHVAZT.js +23 -19
- package/dist/{chunk-TR4DGL3U.mjs → chunk-3QPCQH62.mjs} +15 -5
- package/dist/chunk-3SV6J7I5.mjs +271 -0
- package/dist/{chunk-WT6CULN3.mjs → chunk-3ZNZLGQO.mjs} +129 -33
- package/dist/chunk-4DTMFQCY.js +167 -0
- package/dist/chunk-4LIDROT4.js +29 -21
- package/dist/chunk-4PPTEEDI.js +18 -14
- package/dist/chunk-4R5YXNU4.mjs +14 -5
- package/dist/chunk-4SO4LANY.js +626 -0
- package/dist/chunk-4TEILQSN.js +13 -11
- package/dist/chunk-4U5HSR2H.js +351 -0
- package/dist/{chunk-WFIQIBLC.mjs → chunk-4XOWNEZA.mjs} +14 -4
- package/dist/chunk-5EVHVZG5.js +51 -39
- package/dist/chunk-5EZWYEGJ.js +1171 -0
- package/dist/chunk-5HFHHFQS.mjs +28 -5
- package/dist/{chunk-4G74P6YD.mjs → chunk-5OHVTGHS.mjs} +210 -32
- package/dist/chunk-5P5M656V.mjs +10 -4
- package/dist/chunk-5ZYZQXEM.mjs +26 -5
- package/dist/chunk-677VSTPW.mjs +12 -5
- package/dist/{chunk-IXJMMM26.mjs → chunk-6GIJ7NFV.mjs} +35 -12
- package/dist/chunk-6GU5NH5F.mjs +18 -5
- package/dist/{chunk-WNX4TH7U.mjs → chunk-6GYT3EZD.mjs} +82 -8
- package/dist/{chunk-JFOSDCCG.js → chunk-6HELKWFN.js} +28 -20
- package/dist/{chunk-A7DZX5X5.mjs → chunk-6KQYWZ6J.mjs} +23 -10
- package/dist/chunk-6OOGL43U.mjs +28 -9
- package/dist/chunk-6QML6T3Y.mjs +9 -4
- package/dist/chunk-6QQBMZQ6.mjs +16 -5
- package/dist/chunk-6Z4LLPZA.js +564 -0
- package/dist/{chunk-CPQS3IFF.mjs → chunk-73OAHAPC.mjs} +13 -5
- package/dist/chunk-77F5YT4E.js +128 -0
- package/dist/{chunk-SXNHXUUF.mjs → chunk-7DUHHRAU.mjs} +15 -6
- package/dist/chunk-7ISEWLA3.js +202 -0
- package/dist/chunk-7P4MIU6I.js +82 -66
- package/dist/chunk-7QZ4XT2P.mjs +14 -5
- package/dist/{chunk-V5557VIB.mjs → chunk-7U6VWD4H.mjs} +37 -10
- package/dist/chunk-7Z64GEMN.js +49 -40
- package/dist/{chunk-LY2OTQ4E.mjs → chunk-A42OLED6.mjs} +39 -6
- package/dist/{chunk-DUZM2SKR.js → chunk-A54CDNCF.js} +124 -96
- package/dist/{chunk-OUARQFZ7.mjs → chunk-AG4HRAW2.mjs} +56 -15
- package/dist/chunk-AKZY7QYA.js +238 -0
- package/dist/chunk-AOZLBASY.mjs +9 -5
- package/dist/chunk-AUW7DCXL.js +24 -18
- package/dist/chunk-AX5XRD2Q.js +9 -8
- package/dist/{chunk-7O2OQKVY.mjs → chunk-AYHP2OAX.mjs} +8 -4
- package/dist/chunk-AZDNGGV7.mjs +31 -6
- package/dist/chunk-B5TUTAVX.js +96 -73
- package/dist/{chunk-WDRYAP7T.mjs → chunk-BBAYDH2M.mjs} +25 -7
- package/dist/chunk-BCQQYERG.js +278 -0
- package/dist/chunk-BFAZZUD6.js +236 -0
- package/dist/{chunk-ME5BLIFX.mjs → chunk-BJQIYELW.mjs} +51 -10
- package/dist/{chunk-DBGPINKE.js → chunk-BO45CU4Q.js} +92 -63
- package/dist/chunk-C3NKZZQQ.js +50 -0
- package/dist/chunk-CB4SK5AU.mjs +235 -0
- package/dist/chunk-CBYJXDW4.js +68 -49
- package/dist/{chunk-LE5VFMRR.mjs → chunk-CDRQSKXT.mjs} +15 -5
- package/dist/{chunk-472D2S4R.mjs → chunk-CFQKUMZV.mjs} +7 -4
- package/dist/chunk-CFZJOGGH.js +273 -0
- package/dist/chunk-CGIBGSNE.js +185 -0
- package/dist/{chunk-SRNBEFJO.mjs → chunk-CHBUNQIJ.mjs} +31 -7
- package/dist/chunk-CHPJPIW6.js +33 -27
- package/dist/chunk-CI2WHAT2.js +26 -18
- package/dist/chunk-CSH2QOOH.js +28 -0
- package/dist/chunk-D6TKXVEB.js +14 -0
- package/dist/{chunk-7KNOOFRA.js → chunk-DCKBVRLI.js} +154 -114
- package/dist/chunk-DKNVSQSV.mjs +13 -5
- package/dist/chunk-DKT2EYVM.mjs +10 -4
- package/dist/{chunk-GYQJJUJP.mjs → chunk-DLLLDGXD.mjs} +104 -82
- package/dist/chunk-E5GD3H7L.js +22 -16
- package/dist/chunk-EEF26RBA.mjs +17 -5
- package/dist/chunk-EF5ZTNHX.js +61 -43
- package/dist/chunk-EHIXCFD7.js +367 -0
- package/dist/{chunk-JSUDEK2D.mjs → chunk-ELRZ2ZHM.mjs} +101 -9
- package/dist/{chunk-GOGLPCUH.js → chunk-EOU6WZTS.js} +162 -128
- package/dist/chunk-EPN7QWP6.mjs +21 -5
- package/dist/{chunk-TLJD4GFY.js → chunk-EQD2U4KM.js} +146 -107
- package/dist/chunk-EV6KRX6F.mjs +28 -5
- package/dist/chunk-F2OF6XZ6.js +58 -37
- package/dist/chunk-F7H4ALKN.js +26 -19
- package/dist/chunk-FBFCJCON.js +129 -0
- package/dist/chunk-FE7PEZTI.mjs +15 -5
- package/dist/{chunk-K64M7IMP.js → chunk-FI53LYZ6.js} +92 -67
- package/dist/chunk-FLYJVZED.mjs +12 -4
- package/dist/{chunk-Z5B7VNEG.mjs → chunk-FNJDBFKM.mjs} +24 -5
- package/dist/chunk-FUE7IBTJ.mjs +129 -0
- package/dist/chunk-G3PBQ4B4.mjs +12 -4
- package/dist/chunk-G5USITWF.js +101 -0
- package/dist/{chunk-HTXUF4RH.mjs → chunk-G6MD6ZVN.mjs} +93 -6
- package/dist/chunk-GG72T6JK.js +125 -0
- package/dist/chunk-GKJNQUTW.mjs +14 -5
- package/dist/chunk-GOQ6ZG7H.mjs +16 -5
- package/dist/chunk-GRXBGL6Q.js +24 -21
- package/dist/{chunk-FQW26554.mjs → chunk-GYQ2DN6Z.mjs} +26 -13
- package/dist/{chunk-KPRUZCKN.js → chunk-H6NC6SBX.js} +59 -47
- package/dist/chunk-HLS4CHWX.mjs +5 -4
- package/dist/chunk-HQ3QOT7H.js +19 -14
- package/dist/chunk-HR5GBE3P.js +68 -48
- package/dist/chunk-HU7AMIOC.js +317 -0
- package/dist/chunk-HUMGEP7S.mjs +8 -4
- package/dist/{chunk-2PLPUM5J.mjs → chunk-HWG4HNQH.mjs} +98 -7
- package/dist/chunk-I3CDTF4U.js +23 -20
- package/dist/chunk-IAONLOJN.js +88 -0
- package/dist/{chunk-PN33UCWB.mjs → chunk-IG75YSX3.mjs} +12 -6
- package/dist/chunk-IHH2O7YK.js +28 -21
- package/dist/chunk-ILYL3KSJ.js +242 -0
- package/dist/chunk-ITVLIR7T.mjs +26 -5
- package/dist/chunk-IUT6A4FC.js +297 -0
- package/dist/chunk-IUTPGKU5.js +169 -0
- package/dist/chunk-IXQAECFP.mjs +26 -5
- package/dist/chunk-J3N24I7A.mjs +14 -5
- package/dist/chunk-J4OQ2VRH.mjs +22 -5
- package/dist/chunk-J4SNBXJM.js +127 -0
- package/dist/{chunk-FW3O54GP.mjs → chunk-J5N5OQWB.mjs} +53 -14
- package/dist/chunk-JB33A4S6.js +46 -35
- package/dist/chunk-JLRRXRZO.js +14 -11
- package/dist/chunk-JNRUOQNT.js +222 -0
- package/dist/chunk-JVTAKNRO.mjs +18 -5
- package/dist/{chunk-Z52PUIAH.js → chunk-K2TXT5HQ.js} +30 -23
- package/dist/chunk-K6F6P66I.js +163 -0
- package/dist/chunk-KEF2PEP4.js +319 -0
- package/dist/chunk-KPACLRQH.mjs +12 -5
- package/dist/chunk-KQ5I7PRM.js +193 -0
- package/dist/chunk-KRFD27WA.js +64 -0
- package/dist/{chunk-2LER76UK.mjs → chunk-KY5MMT7Q.mjs} +27 -9
- package/dist/chunk-KYP7U6FK.js +271 -0
- package/dist/{chunk-GDONQIOK.mjs → chunk-L2NMDYYQ.mjs} +110 -9
- package/dist/chunk-L6CL63GI.js +35 -33
- package/dist/chunk-LA3CJOWA.js +63 -42
- package/dist/{chunk-DVL53XDJ.mjs → chunk-LKKZLYCA.mjs} +9 -3
- package/dist/{chunk-OIUIR5ZR.js → chunk-LMTUM3J3.js} +64 -45
- package/dist/chunk-LODDAS62.js +62 -47
- package/dist/chunk-LQT6ZGME.mjs +25 -5
- package/dist/{chunk-TYCRDHE6.mjs → chunk-LRPPXU74.mjs} +68 -18
- package/dist/chunk-M5GSLKUX.mjs +26 -5
- package/dist/chunk-M73NMNZX.js +31 -24
- package/dist/chunk-MB3QU3US.js +30 -21
- package/dist/chunk-MB6U72CI.js +65 -0
- package/dist/chunk-MSHCPJIJ.mjs +14 -5
- package/dist/chunk-N2D7NPEW.mjs +85 -0
- package/dist/chunk-N2JYU4JI.js +21 -15
- package/dist/{chunk-2IUTFPQQ.mjs → chunk-NASC6XHN.mjs} +9 -7
- package/dist/{chunk-KGWPSVEQ.mjs → chunk-NF3OF7S5.mjs} +44 -14
- package/dist/chunk-NKKIJQMV.mjs +16 -5
- package/dist/{chunk-DVUND2QM.mjs → chunk-NKSYX4R7.mjs} +34 -10
- package/dist/{chunk-2QV56L36.js → chunk-NMKFR435.js} +102 -66
- package/dist/{chunk-6KKUJT6B.mjs → chunk-NPTXXUXF.mjs} +17 -5
- package/dist/{chunk-CVXDKGNX.mjs → chunk-NQNHM4OL.mjs} +26 -8
- package/dist/chunk-NRLGZRK2.js +227 -0
- package/dist/chunk-NSEO2B74.mjs +16 -5
- package/dist/{chunk-AAI6EZZA.mjs → chunk-O4UDB6ZE.mjs} +21 -6
- package/dist/chunk-OFCKGWTS.js +8 -6
- package/dist/chunk-OFTLPYYC.mjs +15 -5
- package/dist/chunk-ONTRGV5T.js +64 -46
- package/dist/chunk-OPHYFC5W.mjs +18 -5
- package/dist/chunk-OQTPXPAP.mjs +8 -4
- package/dist/{chunk-QYLNPHKG.mjs → chunk-OTEM4FVX.mjs} +18 -7
- package/dist/chunk-P36GX65N.js +79 -0
- package/dist/chunk-P3XVLJYD.js +53 -40
- package/dist/chunk-P6E3DILH.mjs +17 -5
- package/dist/chunk-PFYK2V3E.js +40 -32
- package/dist/chunk-PLUE64IS.js +168 -0
- package/dist/chunk-PNAWOJ32.js +26 -20
- package/dist/chunk-PR3PQUKM.js +45 -34
- package/dist/chunk-PTEDJ6MA.js +9 -7
- package/dist/{chunk-V3P4ZAGL.mjs → chunk-PXO2F2CS.mjs} +49 -34
- package/dist/chunk-Q2GPRAF4.js +24 -20
- package/dist/chunk-Q4JMAQXJ.js +20 -15
- package/dist/{chunk-VBZE77VM.mjs → chunk-QAIBQHIO.mjs} +42 -6
- package/dist/chunk-QIKR5EFI.js +230 -0
- package/dist/chunk-QIXQYLH5.js +12 -14
- package/dist/chunk-QMK4OFC5.js +235 -0
- package/dist/chunk-QOEE2PW5.mjs +34 -5
- package/dist/chunk-QQFLRNI3.mjs +202 -0
- package/dist/chunk-QQKP437L.js +27 -16
- package/dist/chunk-QWOE4FGJ.mjs +227 -0
- package/dist/chunk-QYYAXM5F.js +23 -17
- package/dist/{chunk-D45GM4YH.mjs → chunk-R2KUNFDN.mjs} +34 -10
- package/dist/{chunk-7Y5XUZJ4.mjs → chunk-R4OVIDAY.mjs} +21 -9
- package/dist/chunk-RFHPG4KN.js +413 -0
- package/dist/{chunk-VHW7NWXM.mjs → chunk-RPKF4S2Q.mjs} +45 -29
- package/dist/chunk-RPSHILHD.mjs +8 -4
- package/dist/chunk-RQSQXQN6.mjs +14 -5
- package/dist/chunk-RTHC4KWM.js +20 -16
- package/dist/chunk-RYIYE2PY.js +139 -0
- package/dist/chunk-S5Y6UHAK.mjs +20 -5
- package/dist/{chunk-W7UGU2O6.mjs → chunk-S7RUTD3X.mjs} +26 -7
- package/dist/chunk-SDLMB34Y.mjs +8 -4
- package/dist/{chunk-XTSG362L.mjs → chunk-SEWNVIHH.mjs} +21 -6
- package/dist/chunk-SHT4TU3T.mjs +10 -4
- package/dist/chunk-SIDDYP3O.mjs +167 -0
- package/dist/chunk-SJ5RFU2O.mjs +8 -4
- package/dist/chunk-SKMZTW3K.js +76 -57
- package/dist/chunk-SQGFNVYT.js +74 -62
- package/dist/chunk-STTQ5LXX.js +153 -0
- package/dist/{chunk-CCDZLSOL.mjs → chunk-SY23FAXK.mjs} +32 -5
- package/dist/chunk-SY4P2AXW.js +571 -0
- package/dist/{chunk-UJ5NMLZN.mjs → chunk-T4OVGM4X.mjs} +139 -55
- package/dist/{chunk-CBWRSICK.mjs → chunk-T7ACOL7K.mjs} +323 -81
- package/dist/chunk-T7KO6EVK.js +174 -0
- package/dist/chunk-TB2UHDOZ.js +8 -6
- package/dist/{chunk-3RRYDYVB.js → chunk-TC6JLEGZ.js} +91 -69
- package/dist/chunk-TDODFBBO.js +101 -0
- package/dist/chunk-TGKNEMD4.mjs +18 -5
- package/dist/chunk-TMON4MPO.js +107 -0
- package/dist/chunk-TQOWIDQT.js +22 -20
- package/dist/chunk-TSJYAEFZ.js +696 -0
- package/dist/chunk-TUA5PDRX.mjs +18 -5
- package/dist/chunk-TULQETJ5.mjs +13 -5
- package/dist/chunk-U356F7GU.js +55 -40
- package/dist/chunk-U3M24RPH.js +85 -0
- package/dist/{chunk-XISZACMA.mjs → chunk-U5244LHL.mjs} +36 -5
- package/dist/chunk-UBP7HZSU.mjs +7 -5
- package/dist/chunk-UF3DXKCI.js +9 -14
- package/dist/chunk-UHFHOTNI.js +498 -0
- package/dist/{chunk-RFB4M3WM.mjs → chunk-UHRZKZVU.mjs} +38 -9
- package/dist/{chunk-F7VY6ATM.js → chunk-UIIOZEUP.js} +64 -42
- package/dist/chunk-UIO6O4MI.js +29 -23
- package/dist/{chunk-4V2HSSQN.mjs → chunk-UKBVJWP3.mjs} +19 -6
- package/dist/chunk-UKGQ7256.js +5 -6
- package/dist/chunk-UKLVOR4E.js +27 -22
- package/dist/chunk-UPPHGL64.js +454 -0
- package/dist/chunk-UPQGB5NQ.mjs +13 -5
- package/dist/chunk-UQMPEMY7.mjs +4 -3
- package/dist/{chunk-36ATCHP4.js → chunk-UVMQJOTX.js} +18 -19
- package/dist/chunk-UXUYCWQC.js +290 -0
- package/dist/chunk-V4JIZN3E.mjs +26 -5
- package/dist/chunk-VCULFIZ5.js +34 -23
- package/dist/{chunk-O4JI4FC6.mjs → chunk-VE2YEFG2.mjs} +33 -6
- package/dist/chunk-VE3SYUMH.js +22 -17
- package/dist/chunk-VHGCWZ6V.mjs +367 -0
- package/dist/chunk-VJJ76I7U.js +8 -6
- package/dist/{chunk-MO3V34YL.mjs → chunk-VM4ZQHT5.mjs} +57 -14
- package/dist/{chunk-KR3EVG7G.mjs → chunk-VNVGSPBI.mjs} +92 -9
- package/dist/{chunk-NQV2H4SC.mjs → chunk-VVNFXJMN.mjs} +30 -9
- package/dist/chunk-W3VLCSJL.js +26 -0
- package/dist/chunk-W6AWN7BC.js +366 -0
- package/dist/chunk-WG3YS2QV.js +329 -0
- package/dist/chunk-WI4N5DD3.mjs +15 -5
- package/dist/chunk-WIWTY74F.mjs +15 -5
- package/dist/chunk-WK45IRP7.mjs +13 -5
- package/dist/chunk-WN3ZI7FN.js +144 -0
- package/dist/chunk-WNLUUD5N.mjs +18 -5
- package/dist/chunk-WV5XHYW6.js +21 -22
- package/dist/{chunk-C745DPLU.mjs → chunk-WVTUGFWO.mjs} +39 -6
- package/dist/chunk-WVVXZKNI.js +26 -19
- package/dist/{chunk-VTOMFVSF.js → chunk-X7JAYXPY.js} +62 -44
- package/dist/chunk-X7XFQCDD.mjs +168 -0
- package/dist/chunk-XATXFVKR.mjs +14 -5
- package/dist/{chunk-UPO4LLNK.mjs → chunk-XBM76P27.mjs} +42 -10
- package/dist/chunk-XFPJYKBQ.js +98 -0
- package/dist/{chunk-MOSVX52I.js → chunk-XHT2VIDR.js} +126 -105
- package/dist/chunk-XJ7U2W7S.mjs +8 -4
- package/dist/{chunk-XHF3L4ET.mjs → chunk-XMTEMBQV.mjs} +13 -6
- package/dist/chunk-XPA2YCQO.js +48 -42
- package/dist/chunk-XRNKHQTL.js +39 -33
- package/dist/chunk-XTV5JLLC.js +37 -34
- package/dist/chunk-XZVQ3PJS.mjs +13 -5
- package/dist/{chunk-IZTNHCIO.mjs → chunk-Y5E4XH6H.mjs} +137 -19
- package/dist/chunk-Y6557RWE.mjs +13 -5
- package/dist/chunk-YID7J6ZK.js +33 -19
- package/dist/chunk-YMKA4L3Z.js +15 -16
- package/dist/chunk-YOAYDEWW.mjs +236 -0
- package/dist/chunk-YWTZALG5.js +13 -9
- package/dist/{chunk-5OMSQ5PV.mjs → chunk-ZB55SAGI.mjs} +44 -16
- package/dist/chunk-ZDXIP33Y.js +29 -20
- package/dist/chunk-ZFMMAYSX.js +84 -0
- package/dist/{chunk-GUHNLUZ3.mjs → chunk-ZITBUGBH.mjs} +56 -14
- package/dist/chunk-ZJWUBR2X.mjs +8 -5
- package/dist/chunk-ZRHDNGWO.js +23 -15
- package/dist/chunk-ZYJTHGQW.js +46 -35
- package/dist/components/ActivityFeed.js +5 -13
- package/dist/components/ActivityFeed.mjs +16 -9
- package/dist/components/Affix.js +3 -7
- package/dist/components/Affix.mjs +6 -1
- package/dist/components/Alert.js +3 -7
- package/dist/components/Alert.mjs +7 -2
- package/dist/components/Anchor.js +12 -24
- package/dist/components/Anchor.mjs +12 -1
- package/dist/components/AnchorLink.js +3 -12
- package/dist/components/AnchorLink.mjs +7 -1
- package/dist/components/AreaChart.js +4 -12
- package/dist/components/AreaChart.mjs +15 -8
- package/dist/components/AutoComplete.js +3 -7
- package/dist/components/AutoComplete.mjs +6 -1
- package/dist/components/Avatar.js +3 -7
- package/dist/components/Avatar.mjs +6 -1
- package/dist/components/AvatarGroup.js +4 -10
- package/dist/components/AvatarGroup.mjs +8 -1
- package/dist/components/BackTop.js +3 -11
- package/dist/components/BackTop.mjs +8 -1
- package/dist/components/Badge.js +3 -7
- package/dist/components/Badge.mjs +6 -1
- package/dist/components/BarChart.js +4 -12
- package/dist/components/BarChart.mjs +15 -8
- package/dist/components/Breadcrumb.js +6 -14
- package/dist/components/Breadcrumb.mjs +10 -1
- package/dist/components/BreadcrumbItem.js +3 -7
- package/dist/components/BreadcrumbItem.mjs +6 -1
- package/dist/components/Button.js +3 -7
- package/dist/components/Button.mjs +6 -1
- package/dist/components/ButtonGroup.js +6 -14
- package/dist/components/ButtonGroup.mjs +10 -1
- package/dist/components/Calendar.js +3 -11
- package/dist/components/Calendar.mjs +8 -1
- package/dist/components/Card.js +3 -7
- package/dist/components/Card.mjs +6 -1
- package/dist/components/Carousel.js +3 -7
- package/dist/components/Carousel.mjs +6 -1
- package/dist/components/Cascader.js +3 -7
- package/dist/components/Cascader.mjs +6 -1
- package/dist/components/ChartAxis.js +3 -11
- package/dist/components/ChartAxis.mjs +8 -1
- package/dist/components/ChartCanvas.js +3 -11
- package/dist/components/ChartCanvas.mjs +8 -1
- package/dist/components/ChartGrid.js +3 -11
- package/dist/components/ChartGrid.mjs +8 -1
- package/dist/components/ChartLegend.js +3 -11
- package/dist/components/ChartLegend.mjs +8 -1
- package/dist/components/ChartSeries.js +3 -11
- package/dist/components/ChartSeries.mjs +8 -1
- package/dist/components/ChartTooltip.js +3 -11
- package/dist/components/ChartTooltip.mjs +8 -1
- package/dist/components/ChatWindow.js +4 -12
- package/dist/components/ChatWindow.mjs +14 -7
- package/dist/components/Checkbox.js +3 -7
- package/dist/components/Checkbox.mjs +8 -3
- package/dist/components/CheckboxGroup.js +4 -10
- package/dist/components/CheckboxGroup.mjs +9 -2
- package/dist/components/Code.js +3 -11
- package/dist/components/Code.mjs +8 -1
- package/dist/components/CodeEditor.js +3 -11
- package/dist/components/CodeEditor.mjs +8 -1
- package/dist/components/Col.js +3 -7
- package/dist/components/Col.mjs +7 -2
- package/dist/components/Collapse.js +5 -15
- package/dist/components/Collapse.mjs +10 -1
- package/dist/components/CollapsePanel.js +3 -11
- package/dist/components/CollapsePanel.mjs +9 -2
- package/dist/components/ColorPicker.js +3 -7
- package/dist/components/ColorPicker.mjs +6 -1
- package/dist/components/ColorSwatch.d.mts +11 -0
- package/dist/components/ColorSwatch.d.ts +11 -0
- package/dist/components/ColorSwatch.js +8 -0
- package/dist/components/ColorSwatch.mjs +8 -0
- package/dist/components/CommentThread.js +3 -11
- package/dist/components/CommentThread.mjs +14 -7
- package/dist/components/ConfigProvider.d.mts +3 -1
- package/dist/components/ConfigProvider.d.ts +3 -1
- package/dist/components/ConfigProvider.js +4 -10
- package/dist/components/ConfigProvider.mjs +8 -1
- package/dist/components/Container.js +3 -7
- package/dist/components/Container.mjs +6 -1
- package/dist/components/Content.js +3 -7
- package/dist/components/Content.mjs +6 -1
- package/dist/components/Countdown.d.mts +12 -0
- package/dist/components/Countdown.d.ts +12 -0
- package/dist/components/Countdown.js +8 -0
- package/dist/components/Countdown.mjs +8 -0
- package/dist/components/CronEditor.d.mts +12 -0
- package/dist/components/CronEditor.d.ts +12 -0
- package/dist/components/CronEditor.js +8 -0
- package/dist/components/CronEditor.mjs +8 -0
- package/dist/components/CropUpload.js +6 -10
- package/dist/components/CropUpload.mjs +10 -5
- package/dist/components/DataTableWithToolbar.d.mts +1 -1
- package/dist/components/DataTableWithToolbar.d.ts +1 -1
- package/dist/components/DataTableWithToolbar.js +5 -13
- package/dist/components/DataTableWithToolbar.mjs +12 -5
- package/dist/components/DatePicker.js +3 -7
- package/dist/components/DatePicker.mjs +6 -1
- package/dist/components/Descriptions.js +3 -11
- package/dist/components/Descriptions.mjs +8 -1
- package/dist/components/Divider.js +3 -7
- package/dist/components/Divider.mjs +6 -1
- package/dist/components/DonutChart.js +5 -13
- package/dist/components/DonutChart.mjs +13 -6
- package/dist/components/Drawer.d.mts +1 -0
- package/dist/components/Drawer.d.ts +1 -0
- package/dist/components/Drawer.js +4 -8
- package/dist/components/Drawer.mjs +7 -2
- package/dist/components/Dropdown.js +7 -15
- package/dist/components/Dropdown.mjs +11 -2
- package/dist/components/DropdownItem.js +5 -9
- package/dist/components/DropdownItem.mjs +8 -3
- package/dist/components/DropdownMenu.js +4 -13
- package/dist/components/DropdownMenu.mjs +8 -2
- package/dist/components/Empty.js +3 -7
- package/dist/components/Empty.mjs +6 -1
- package/dist/components/FileManager.js +3 -11
- package/dist/components/FileManager.mjs +8 -1
- package/dist/components/FloatButton.js +4 -10
- package/dist/components/FloatButton.mjs +8 -1
- package/dist/components/Footer.js +3 -7
- package/dist/components/Footer.mjs +6 -1
- package/dist/components/Form.d.mts +11 -1
- package/dist/components/Form.d.ts +11 -1
- package/dist/components/Form.js +4 -10
- package/dist/components/Form.mjs +8 -1
- package/dist/components/FormItem.js +4 -8
- package/dist/components/FormItem.mjs +7 -2
- package/dist/components/FormWizard.js +4 -12
- package/dist/components/FormWizard.mjs +11 -4
- package/dist/components/FunnelChart.js +4 -8
- package/dist/components/FunnelChart.mjs +10 -5
- package/dist/components/Gantt.d.mts +16 -0
- package/dist/components/Gantt.d.ts +16 -0
- package/dist/components/Gantt.js +7 -0
- package/dist/components/Gantt.mjs +7 -0
- package/dist/components/GaugeChart.js +3 -7
- package/dist/components/GaugeChart.mjs +7 -2
- package/dist/components/Header.js +3 -7
- package/dist/components/Header.mjs +6 -1
- package/dist/components/HeatmapChart.js +4 -8
- package/dist/components/HeatmapChart.mjs +9 -4
- package/dist/components/Icon.js +3 -7
- package/dist/components/Icon.mjs +6 -1
- package/dist/components/Image.d.mts +0 -4
- package/dist/components/Image.d.ts +0 -4
- package/dist/components/Image.js +6 -10
- package/dist/components/Image.mjs +9 -4
- package/dist/components/ImageAnnotation.d.mts +19 -0
- package/dist/components/ImageAnnotation.d.ts +19 -0
- package/dist/components/ImageAnnotation.js +6 -0
- package/dist/components/ImageAnnotation.mjs +6 -0
- package/dist/components/ImageCropper.js +3 -7
- package/dist/components/ImageCropper.mjs +6 -1
- package/dist/components/ImageGroup.js +6 -12
- package/dist/components/ImageGroup.mjs +10 -3
- package/dist/components/ImagePreview.js +4 -8
- package/dist/components/ImagePreview.mjs +7 -2
- package/dist/components/ImageViewer.d.mts +1 -0
- package/dist/components/ImageViewer.d.ts +1 -0
- package/dist/components/ImageViewer.js +3 -7
- package/dist/components/ImageViewer.mjs +6 -1
- package/dist/components/InfiniteScroll.js +3 -11
- package/dist/components/InfiniteScroll.mjs +8 -1
- package/dist/components/Input.js +3 -7
- package/dist/components/Input.mjs +6 -1
- package/dist/components/InputGroup.js +12 -22
- package/dist/components/InputGroup.mjs +12 -1
- package/dist/components/InputNumber.js +3 -7
- package/dist/components/InputNumber.mjs +6 -1
- package/dist/components/Kanban.js +5 -13
- package/dist/components/Kanban.mjs +10 -3
- package/dist/components/Layout.js +3 -7
- package/dist/components/Layout.mjs +6 -1
- package/dist/components/LineChart.js +4 -12
- package/dist/components/LineChart.mjs +15 -8
- package/dist/components/Link.js +3 -7
- package/dist/components/Link.mjs +6 -1
- package/dist/components/List.js +4 -8
- package/dist/components/List.mjs +7 -2
- package/dist/components/Loading.js +4 -8
- package/dist/components/Loading.mjs +7 -2
- package/dist/components/MarkdownEditor.d.mts +21 -0
- package/dist/components/MarkdownEditor.d.ts +21 -0
- package/dist/components/MarkdownEditor.js +9 -0
- package/dist/components/MarkdownEditor.mjs +9 -0
- package/dist/components/Mentions.js +3 -11
- package/dist/components/Mentions.mjs +8 -1
- package/dist/components/Menu.d.mts +4 -0
- package/dist/components/Menu.d.ts +4 -0
- package/dist/components/Menu.js +14 -26
- package/dist/components/Menu.mjs +14 -1
- package/dist/components/MenuItem.js +3 -12
- package/dist/components/MenuItem.mjs +7 -1
- package/dist/components/MenuItemGroup.js +3 -12
- package/dist/components/MenuItemGroup.mjs +7 -1
- package/dist/components/Message.d.mts +3 -1
- package/dist/components/Message.d.ts +3 -1
- package/dist/components/Message.js +5 -15
- package/dist/components/Message.mjs +11 -2
- package/dist/components/Modal.js +4 -8
- package/dist/components/Modal.mjs +8 -3
- package/dist/components/Notification.d.mts +3 -1
- package/dist/components/Notification.d.ts +3 -1
- package/dist/components/Notification.js +5 -15
- package/dist/components/Notification.mjs +11 -2
- package/dist/components/NotificationCenter.js +8 -16
- package/dist/components/NotificationCenter.mjs +16 -9
- package/dist/components/NumberKeyboard.d.mts +13 -0
- package/dist/components/NumberKeyboard.d.ts +13 -0
- package/dist/components/NumberKeyboard.js +8 -0
- package/dist/components/NumberKeyboard.mjs +8 -0
- package/dist/components/OrgChart.d.mts +16 -0
- package/dist/components/OrgChart.d.ts +16 -0
- package/dist/components/OrgChart.js +7 -0
- package/dist/components/OrgChart.mjs +7 -0
- package/dist/components/Pagination.js +3 -11
- package/dist/components/Pagination.mjs +8 -1
- package/dist/components/PieChart.js +4 -12
- package/dist/components/PieChart.mjs +12 -5
- package/dist/components/Popconfirm.js +5 -9
- package/dist/components/Popconfirm.mjs +8 -3
- package/dist/components/Popover.js +5 -9
- package/dist/components/Popover.mjs +8 -3
- package/dist/components/PrintLayout.js +4 -10
- package/dist/components/PrintLayout.mjs +8 -1
- package/dist/components/Progress.js +3 -7
- package/dist/components/Progress.mjs +6 -1
- package/dist/components/QRCode.js +3 -11
- package/dist/components/QRCode.mjs +8 -1
- package/dist/components/RadarChart.js +4 -12
- package/dist/components/RadarChart.mjs +13 -6
- package/dist/components/Radio.js +4 -8
- package/dist/components/Radio.mjs +8 -3
- package/dist/components/RadioGroup.js +4 -10
- package/dist/components/RadioGroup.mjs +9 -2
- package/dist/components/Rate.js +3 -7
- package/dist/components/Rate.mjs +6 -1
- package/dist/components/Resizable.js +3 -11
- package/dist/components/Resizable.mjs +8 -1
- package/dist/components/Result.js +3 -7
- package/dist/components/Result.mjs +7 -2
- package/dist/components/RichTextEditor.js +3 -11
- package/dist/components/RichTextEditor.mjs +9 -2
- package/dist/components/Row.js +4 -10
- package/dist/components/Row.mjs +8 -1
- package/dist/components/ScatterChart.js +4 -12
- package/dist/components/ScatterChart.mjs +15 -8
- package/dist/components/ScrollSpy.d.mts +13 -0
- package/dist/components/ScrollSpy.d.ts +13 -0
- package/dist/components/ScrollSpy.js +8 -0
- package/dist/components/ScrollSpy.mjs +8 -0
- package/dist/components/Segmented.js +3 -7
- package/dist/components/Segmented.mjs +6 -1
- package/dist/components/Select.d.mts +2 -1
- package/dist/components/Select.d.ts +2 -1
- package/dist/components/Select.js +3 -7
- package/dist/components/Select.mjs +6 -1
- package/dist/components/Sidebar.js +3 -7
- package/dist/components/Sidebar.mjs +6 -1
- package/dist/components/Signature.d.mts +17 -0
- package/dist/components/Signature.d.ts +17 -0
- package/dist/components/Signature.js +8 -0
- package/dist/components/Signature.mjs +8 -0
- package/dist/components/Skeleton.js +3 -7
- package/dist/components/Skeleton.mjs +6 -1
- package/dist/components/Slider.js +3 -7
- package/dist/components/Slider.mjs +6 -1
- package/dist/components/Space.js +3 -7
- package/dist/components/Space.mjs +6 -1
- package/dist/components/Splitter.js +3 -11
- package/dist/components/Splitter.mjs +8 -1
- package/dist/components/Spotlight.d.mts +11 -0
- package/dist/components/Spotlight.d.ts +11 -0
- package/dist/components/Spotlight.js +9 -0
- package/dist/components/Spotlight.mjs +9 -0
- package/dist/components/Statistic.js +3 -7
- package/dist/components/Statistic.mjs +6 -1
- package/dist/components/Stepper.js +3 -7
- package/dist/components/Stepper.mjs +6 -1
- package/dist/components/Steps.js +6 -14
- package/dist/components/Steps.mjs +10 -1
- package/dist/components/StepsItem.js +3 -7
- package/dist/components/StepsItem.mjs +6 -1
- package/dist/components/SubMenu.js +3 -12
- package/dist/components/SubMenu.mjs +7 -1
- package/dist/components/SunburstChart.js +4 -8
- package/dist/components/SunburstChart.mjs +10 -5
- package/dist/components/Switch.js +3 -7
- package/dist/components/Switch.mjs +6 -1
- package/dist/components/TabPane.js +3 -7
- package/dist/components/TabPane.mjs +6 -1
- package/dist/components/Table.d.mts +2 -2
- package/dist/components/Table.d.ts +2 -2
- package/dist/components/Table.js +3 -7
- package/dist/components/Table.mjs +6 -1
- package/dist/components/Tabs.d.mts +6 -0
- package/dist/components/Tabs.d.ts +6 -0
- package/dist/components/Tabs.js +6 -14
- package/dist/components/Tabs.mjs +10 -1
- package/dist/components/Tag.js +3 -7
- package/dist/components/Tag.mjs +6 -1
- package/dist/components/TaskBoard.js +4 -12
- package/dist/components/TaskBoard.mjs +9 -2
- package/dist/components/Text.js +3 -7
- package/dist/components/Text.mjs +6 -1
- package/dist/components/Textarea.js +3 -7
- package/dist/components/Textarea.mjs +7 -2
- package/dist/components/TimePicker.js +3 -7
- package/dist/components/TimePicker.mjs +6 -1
- package/dist/components/Timeline.js +3 -7
- package/dist/components/Timeline.mjs +6 -1
- package/dist/components/Tooltip.js +5 -9
- package/dist/components/Tooltip.mjs +8 -3
- package/dist/components/Tour.d.mts +2 -0
- package/dist/components/Tour.d.ts +2 -0
- package/dist/components/Tour.js +3 -7
- package/dist/components/Tour.mjs +7 -2
- package/dist/components/Transfer.js +3 -7
- package/dist/components/Transfer.mjs +6 -1
- package/dist/components/Tree.js +4 -12
- package/dist/components/Tree.mjs +9 -2
- package/dist/components/TreeMapChart.js +4 -8
- package/dist/components/TreeMapChart.mjs +10 -5
- package/dist/components/TreeSelect.js +3 -7
- package/dist/components/TreeSelect.mjs +6 -1
- package/dist/components/Upload.js +4 -8
- package/dist/components/Upload.mjs +7 -2
- package/dist/components/VirtualList.js +3 -7
- package/dist/components/VirtualList.mjs +6 -1
- package/dist/components/VirtualTable.js +3 -11
- package/dist/components/VirtualTable.mjs +8 -1
- package/dist/components/Watermark.js +3 -7
- package/dist/components/Watermark.mjs +6 -1
- package/dist/index.d.mts +15 -4
- package/dist/index.d.ts +15 -4
- package/dist/index.js +708 -813
- package/dist/index.mjs +672 -172
- package/dist/{types-BT4oTXQ_.d.ts → types-mtq1tZJd.d.mts} +1 -0
- package/dist/{types-BT4oTXQ_.d.mts → types-mtq1tZJd.d.ts} +1 -0
- package/package.json +4 -4
- package/dist/chunk-2EC4F7VG.js +0 -134
- package/dist/chunk-2HDQRMGU.js +0 -482
- package/dist/chunk-2N3CQT4X.js +0 -126
- package/dist/chunk-466OSPRM.js +0 -293
- package/dist/chunk-4MKMM2OI.js +0 -112
- package/dist/chunk-4YVXF45R.js +0 -520
- package/dist/chunk-564WBQ77.mjs +0 -107
- package/dist/chunk-5OLE7XM3.js +0 -329
- package/dist/chunk-6LDJSFUQ.js +0 -251
- package/dist/chunk-6N6CWBPP.js +0 -213
- package/dist/chunk-6YBLWFP5.js +0 -72
- package/dist/chunk-72ZRDBXN.js +0 -25
- package/dist/chunk-A4PPPGJ5.js +0 -284
- package/dist/chunk-ACQLSECT.js +0 -279
- package/dist/chunk-AIYOQ5MX.js +0 -328
- package/dist/chunk-BZ3AXFLG.js +0 -149
- package/dist/chunk-DSLKTIPD.js +0 -75
- package/dist/chunk-FNK4ZATV.js +0 -94
- package/dist/chunk-GAT4ZATZ.js +0 -302
- package/dist/chunk-HCKV7ONR.js +0 -343
- package/dist/chunk-ITLA7OLQ.js +0 -192
- package/dist/chunk-L5HVRTUO.js +0 -935
- package/dist/chunk-MPO7Y76D.js +0 -120
- package/dist/chunk-MU6Z5DCI.js +0 -53
- package/dist/chunk-MUUOE2NT.js +0 -217
- package/dist/chunk-NHBNPK5J.js +0 -201
- package/dist/chunk-OFWK2B23.js +0 -480
- package/dist/chunk-PGBKMW4Q.js +0 -145
- package/dist/chunk-PR5ZPB6J.js +0 -545
- package/dist/chunk-PTWCIG3Y.js +0 -44
- package/dist/chunk-PVNHW3PY.js +0 -205
- package/dist/chunk-QYJBMQ5P.js +0 -167
- package/dist/chunk-R4JSBXGG.js +0 -12
- package/dist/chunk-RLQITKTC.js +0 -119
- package/dist/chunk-RVCUNEBU.js +0 -85
- package/dist/chunk-SO6POTSO.js +0 -110
- package/dist/chunk-SR5OHSI7.js +0 -174
- package/dist/chunk-UB6SHKPR.js +0 -58
- package/dist/chunk-UEJHVPE2.js +0 -97
- package/dist/chunk-ULODU52Q.js +0 -232
- package/dist/chunk-VBBOH5HA.js +0 -25
- package/dist/chunk-X7WESYRG.js +0 -72
- package/dist/chunk-XAALCDGD.js +0 -254
- package/dist/chunk-XN43YK75.js +0 -153
- package/dist/chunk-YACOKYDW.js +0 -147
- package/dist/chunk-YI6ORD3U.js +0 -227
- package/dist/chunk-YTLJPWXL.js +0 -174
- package/dist/chunk-ZDK4LEPB.js +0 -404
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
// src/components/ImageAnnotation.tsx
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import {
|
|
4
|
+
classNames,
|
|
5
|
+
createImageAnnotationBox,
|
|
6
|
+
createImageAnnotationPath,
|
|
7
|
+
defaultImageAnnotationTools,
|
|
8
|
+
getImageAnnotationCenter,
|
|
9
|
+
getImageAnnotationPathData,
|
|
10
|
+
getImageAnnotationPointFromClient,
|
|
11
|
+
getImageAnnotationShapeAriaLabel,
|
|
12
|
+
getImageAnnotationStrokeColor,
|
|
13
|
+
getImageAnnotationToolButtonClasses,
|
|
14
|
+
getImageAnnotationToolLabel,
|
|
15
|
+
imageAnnotationContainerClasses,
|
|
16
|
+
imageAnnotationDeleteButtonClasses,
|
|
17
|
+
imageAnnotationImageClasses,
|
|
18
|
+
imageAnnotationLabelClasses,
|
|
19
|
+
imageAnnotationOverlayClasses,
|
|
20
|
+
imageAnnotationReadonlyOverlayClasses,
|
|
21
|
+
imageAnnotationStageClasses,
|
|
22
|
+
imageAnnotationToolbarClasses,
|
|
23
|
+
shouldCommitImageAnnotationBox
|
|
24
|
+
} from "@expcat/tigercat-core";
|
|
25
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
+
function ImageAnnotation({
|
|
27
|
+
src,
|
|
28
|
+
alt = "Image to annotate",
|
|
29
|
+
value,
|
|
30
|
+
defaultValue = [],
|
|
31
|
+
selectedId,
|
|
32
|
+
defaultSelectedId,
|
|
33
|
+
tool,
|
|
34
|
+
defaultTool = "select",
|
|
35
|
+
tools = defaultImageAnnotationTools,
|
|
36
|
+
disabled = false,
|
|
37
|
+
readonly = false,
|
|
38
|
+
minSize = 0.01,
|
|
39
|
+
strokeWidth = 2,
|
|
40
|
+
showLabels = true,
|
|
41
|
+
className,
|
|
42
|
+
style,
|
|
43
|
+
onChange,
|
|
44
|
+
onSelect,
|
|
45
|
+
onToolChange,
|
|
46
|
+
onReady
|
|
47
|
+
}) {
|
|
48
|
+
const containerRef = useRef(null);
|
|
49
|
+
const overlayRef = useRef(null);
|
|
50
|
+
const idSeedRef = useRef(0);
|
|
51
|
+
const drawingRef = useRef(null);
|
|
52
|
+
const [imageLoaded, setImageLoaded] = useState(false);
|
|
53
|
+
const [displayWidth, setDisplayWidth] = useState(0);
|
|
54
|
+
const [displayHeight, setDisplayHeight] = useState(0);
|
|
55
|
+
const [innerAnnotations, setInnerAnnotations] = useState(defaultValue);
|
|
56
|
+
const [innerSelectedId, setInnerSelectedId] = useState(defaultSelectedId);
|
|
57
|
+
const [innerTool, setInnerTool] = useState(defaultTool);
|
|
58
|
+
const [draft, setDraft] = useState(null);
|
|
59
|
+
const annotations = value ?? innerAnnotations;
|
|
60
|
+
const activeSelectedId = selectedId ?? innerSelectedId;
|
|
61
|
+
const activeTool = tool ?? innerTool;
|
|
62
|
+
const canEdit = !disabled && !readonly;
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
setImageLoaded(false);
|
|
65
|
+
setDraft(null);
|
|
66
|
+
if (typeof window === "undefined" || typeof window.Image !== "function") return;
|
|
67
|
+
const img = new window.Image();
|
|
68
|
+
img.onload = () => {
|
|
69
|
+
const container = containerRef.current;
|
|
70
|
+
const naturalWidth = img.naturalWidth || 1;
|
|
71
|
+
const naturalHeight = img.naturalHeight || 1;
|
|
72
|
+
const containerWidth = container?.clientWidth || naturalWidth;
|
|
73
|
+
const containerHeight = container?.clientHeight || naturalHeight;
|
|
74
|
+
const ratio = Math.min(containerWidth / naturalWidth, containerHeight / naturalHeight, 1);
|
|
75
|
+
setDisplayWidth(naturalWidth * ratio);
|
|
76
|
+
setDisplayHeight(naturalHeight * ratio);
|
|
77
|
+
setImageLoaded(true);
|
|
78
|
+
onReady?.();
|
|
79
|
+
};
|
|
80
|
+
img.src = src;
|
|
81
|
+
}, [src, onReady]);
|
|
82
|
+
const commitAnnotations = useCallback(
|
|
83
|
+
(next, meta) => {
|
|
84
|
+
if (value === void 0) setInnerAnnotations(next);
|
|
85
|
+
onChange?.(next, meta);
|
|
86
|
+
},
|
|
87
|
+
[onChange, value]
|
|
88
|
+
);
|
|
89
|
+
const selectAnnotation = useCallback(
|
|
90
|
+
(annotation) => {
|
|
91
|
+
if (selectedId === void 0) setInnerSelectedId(annotation?.id);
|
|
92
|
+
onSelect?.(annotation);
|
|
93
|
+
},
|
|
94
|
+
[onSelect, selectedId]
|
|
95
|
+
);
|
|
96
|
+
const setActiveTool = useCallback(
|
|
97
|
+
(nextTool) => {
|
|
98
|
+
setDraft(null);
|
|
99
|
+
drawingRef.current = null;
|
|
100
|
+
if (tool === void 0) setInnerTool(nextTool);
|
|
101
|
+
onToolChange?.(nextTool);
|
|
102
|
+
},
|
|
103
|
+
[onToolChange, tool]
|
|
104
|
+
);
|
|
105
|
+
const createId = useCallback((shape) => {
|
|
106
|
+
idSeedRef.current += 1;
|
|
107
|
+
return `${shape}-${idSeedRef.current}`;
|
|
108
|
+
}, []);
|
|
109
|
+
const getPointFromEvent = useCallback((event) => {
|
|
110
|
+
const bounds = overlayRef.current?.getBoundingClientRect();
|
|
111
|
+
if (!bounds) return { x: 0, y: 0 };
|
|
112
|
+
return getImageAnnotationPointFromClient(event.clientX, event.clientY, bounds);
|
|
113
|
+
}, []);
|
|
114
|
+
const commitAnnotation = useCallback(
|
|
115
|
+
(annotation) => {
|
|
116
|
+
const next = [...annotations, annotation];
|
|
117
|
+
commitAnnotations(next, { type: "add", annotation });
|
|
118
|
+
selectAnnotation(annotation);
|
|
119
|
+
},
|
|
120
|
+
[annotations, commitAnnotations, selectAnnotation]
|
|
121
|
+
);
|
|
122
|
+
const commitPolygon = useCallback(() => {
|
|
123
|
+
const drawing = drawingRef.current;
|
|
124
|
+
if (!drawing || drawing.tool !== "polygon" || drawing.points.length < 3) return;
|
|
125
|
+
const annotation = createImageAnnotationPath("polygon", createId("polygon"), drawing.points);
|
|
126
|
+
drawingRef.current = null;
|
|
127
|
+
setDraft(null);
|
|
128
|
+
commitAnnotation(annotation);
|
|
129
|
+
}, [commitAnnotation, createId]);
|
|
130
|
+
const handleStageMouseDown = useCallback(
|
|
131
|
+
(event) => {
|
|
132
|
+
if (!canEdit || activeTool === "select" || activeTool === "polygon") return;
|
|
133
|
+
const point = getPointFromEvent(event);
|
|
134
|
+
drawingRef.current = { tool: activeTool, start: point, points: [point] };
|
|
135
|
+
const handleMouseMove = (moveEvent) => {
|
|
136
|
+
const drawing = drawingRef.current;
|
|
137
|
+
if (!drawing) return;
|
|
138
|
+
const nextPoint = getPointFromEvent(moveEvent);
|
|
139
|
+
if (drawing.tool === "rectangle" || drawing.tool === "ellipse") {
|
|
140
|
+
setDraft(createImageAnnotationBox(drawing.tool, "draft", drawing.start, nextPoint));
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const nextPoints = [...drawing.points, nextPoint];
|
|
144
|
+
drawingRef.current = { ...drawing, points: nextPoints };
|
|
145
|
+
setDraft(createImageAnnotationPath("freehand", "draft", nextPoints));
|
|
146
|
+
};
|
|
147
|
+
const handleMouseUp = (upEvent) => {
|
|
148
|
+
const drawing = drawingRef.current;
|
|
149
|
+
drawingRef.current = null;
|
|
150
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
151
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
152
|
+
if (!drawing) return;
|
|
153
|
+
const end = getPointFromEvent(upEvent);
|
|
154
|
+
if (drawing.tool === "rectangle" || drawing.tool === "ellipse") {
|
|
155
|
+
const annotation = createImageAnnotationBox(
|
|
156
|
+
drawing.tool,
|
|
157
|
+
createId(drawing.tool),
|
|
158
|
+
drawing.start,
|
|
159
|
+
end
|
|
160
|
+
);
|
|
161
|
+
setDraft(null);
|
|
162
|
+
if (shouldCommitImageAnnotationBox(annotation, minSize)) commitAnnotation(annotation);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const points = [...drawing.points, end];
|
|
166
|
+
setDraft(null);
|
|
167
|
+
if (points.length >= 2)
|
|
168
|
+
commitAnnotation(createImageAnnotationPath("freehand", createId("freehand"), points));
|
|
169
|
+
};
|
|
170
|
+
document.addEventListener("mousemove", handleMouseMove);
|
|
171
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
172
|
+
},
|
|
173
|
+
[activeTool, canEdit, commitAnnotation, createId, getPointFromEvent, minSize]
|
|
174
|
+
);
|
|
175
|
+
const handleStageClick = useCallback(
|
|
176
|
+
(event) => {
|
|
177
|
+
if (!canEdit || activeTool !== "polygon") return;
|
|
178
|
+
const point = getPointFromEvent(event);
|
|
179
|
+
const drawing = drawingRef.current;
|
|
180
|
+
const points = drawing?.tool === "polygon" ? [...drawing.points, point] : [point];
|
|
181
|
+
drawingRef.current = { tool: "polygon", start: points[0], points };
|
|
182
|
+
setDraft(createImageAnnotationPath("polygon", "draft", points));
|
|
183
|
+
},
|
|
184
|
+
[activeTool, canEdit, getPointFromEvent]
|
|
185
|
+
);
|
|
186
|
+
const removeSelectedAnnotation = useCallback(() => {
|
|
187
|
+
if (!canEdit || !activeSelectedId) return;
|
|
188
|
+
const removed = annotations.find((annotation) => annotation.id === activeSelectedId);
|
|
189
|
+
const next = annotations.filter((annotation) => annotation.id !== activeSelectedId);
|
|
190
|
+
commitAnnotations(next, { type: "remove", annotation: removed });
|
|
191
|
+
selectAnnotation(null);
|
|
192
|
+
}, [activeSelectedId, annotations, canEdit, commitAnnotations, selectAnnotation]);
|
|
193
|
+
const handleKeyDown = useCallback(
|
|
194
|
+
(event) => {
|
|
195
|
+
if (event.key === "Escape") {
|
|
196
|
+
drawingRef.current = null;
|
|
197
|
+
setDraft(null);
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
if (event.key === "Enter") {
|
|
201
|
+
commitPolygon();
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (event.key === "Delete" || event.key === "Backspace") {
|
|
205
|
+
event.preventDefault();
|
|
206
|
+
removeSelectedAnnotation();
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
[commitPolygon, removeSelectedAnnotation]
|
|
210
|
+
);
|
|
211
|
+
const renderAnnotation = useCallback(
|
|
212
|
+
(annotation, isDraft = false) => {
|
|
213
|
+
const selected = !isDraft && annotation.id === activeSelectedId;
|
|
214
|
+
const stroke = getImageAnnotationStrokeColor(annotation);
|
|
215
|
+
const commonProps = {
|
|
216
|
+
stroke,
|
|
217
|
+
strokeWidth: selected ? strokeWidth + 1 : strokeWidth,
|
|
218
|
+
fill: stroke,
|
|
219
|
+
fillOpacity: annotation.type === "freehand" ? 0 : selected ? 0.18 : 0.1,
|
|
220
|
+
role: "button",
|
|
221
|
+
tabIndex: isDraft ? -1 : 0,
|
|
222
|
+
"aria-label": getImageAnnotationShapeAriaLabel(annotation),
|
|
223
|
+
className: classNames(!isDraft && "cursor-pointer focus:outline-none")
|
|
224
|
+
};
|
|
225
|
+
const onClick = (event) => {
|
|
226
|
+
if (isDraft) return;
|
|
227
|
+
event.stopPropagation();
|
|
228
|
+
selectAnnotation(annotation);
|
|
229
|
+
};
|
|
230
|
+
if (annotation.type === "rectangle") {
|
|
231
|
+
return /* @__PURE__ */ jsx(
|
|
232
|
+
"rect",
|
|
233
|
+
{
|
|
234
|
+
...commonProps,
|
|
235
|
+
x: annotation.x * displayWidth,
|
|
236
|
+
y: annotation.y * displayHeight,
|
|
237
|
+
width: annotation.width * displayWidth,
|
|
238
|
+
height: annotation.height * displayHeight,
|
|
239
|
+
onClick
|
|
240
|
+
},
|
|
241
|
+
annotation.id
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
if (annotation.type === "ellipse") {
|
|
245
|
+
return /* @__PURE__ */ jsx(
|
|
246
|
+
"ellipse",
|
|
247
|
+
{
|
|
248
|
+
...commonProps,
|
|
249
|
+
cx: (annotation.x + annotation.width / 2) * displayWidth,
|
|
250
|
+
cy: (annotation.y + annotation.height / 2) * displayHeight,
|
|
251
|
+
rx: annotation.width * displayWidth / 2,
|
|
252
|
+
ry: annotation.height * displayHeight / 2,
|
|
253
|
+
onClick
|
|
254
|
+
},
|
|
255
|
+
annotation.id
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
const pathAnnotation = annotation;
|
|
259
|
+
return /* @__PURE__ */ jsx(
|
|
260
|
+
"path",
|
|
261
|
+
{
|
|
262
|
+
...commonProps,
|
|
263
|
+
d: getImageAnnotationPathData(pathAnnotation, displayWidth, displayHeight),
|
|
264
|
+
fillOpacity: pathAnnotation.type === "polygon" ? commonProps.fillOpacity : 0,
|
|
265
|
+
onClick
|
|
266
|
+
},
|
|
267
|
+
annotation.id
|
|
268
|
+
);
|
|
269
|
+
},
|
|
270
|
+
[activeSelectedId, displayHeight, displayWidth, selectAnnotation, strokeWidth]
|
|
271
|
+
);
|
|
272
|
+
const renderedAnnotations = useMemo(
|
|
273
|
+
() => annotations.map((annotation) => renderAnnotation(annotation)),
|
|
274
|
+
[annotations, renderAnnotation]
|
|
275
|
+
);
|
|
276
|
+
const renderedLabels = showLabels ? annotations.filter((annotation) => annotation.label).map((annotation) => {
|
|
277
|
+
const center = getImageAnnotationCenter(annotation, displayWidth, displayHeight);
|
|
278
|
+
return /* @__PURE__ */ jsx(
|
|
279
|
+
"text",
|
|
280
|
+
{
|
|
281
|
+
x: center.x,
|
|
282
|
+
y: center.y,
|
|
283
|
+
textAnchor: "middle",
|
|
284
|
+
dominantBaseline: "middle",
|
|
285
|
+
className: imageAnnotationLabelClasses,
|
|
286
|
+
children: annotation.label
|
|
287
|
+
},
|
|
288
|
+
`${annotation.id}-label`
|
|
289
|
+
);
|
|
290
|
+
}) : null;
|
|
291
|
+
const containerClasses = classNames(imageAnnotationContainerClasses, className);
|
|
292
|
+
return /* @__PURE__ */ jsxs("div", { className: containerClasses, style, onKeyDown: handleKeyDown, children: [
|
|
293
|
+
/* @__PURE__ */ jsxs("div", { className: imageAnnotationToolbarClasses, "aria-label": "Annotation tools", children: [
|
|
294
|
+
tools.map((item) => /* @__PURE__ */ jsx(
|
|
295
|
+
"button",
|
|
296
|
+
{
|
|
297
|
+
type: "button",
|
|
298
|
+
className: getImageAnnotationToolButtonClasses(activeTool === item),
|
|
299
|
+
disabled: disabled || readonly,
|
|
300
|
+
"aria-pressed": activeTool === item,
|
|
301
|
+
onClick: () => setActiveTool(item),
|
|
302
|
+
children: getImageAnnotationToolLabel(item)
|
|
303
|
+
},
|
|
304
|
+
item
|
|
305
|
+
)),
|
|
306
|
+
/* @__PURE__ */ jsx(
|
|
307
|
+
"button",
|
|
308
|
+
{
|
|
309
|
+
type: "button",
|
|
310
|
+
className: imageAnnotationDeleteButtonClasses,
|
|
311
|
+
disabled: !canEdit || !activeSelectedId,
|
|
312
|
+
onClick: removeSelectedAnnotation,
|
|
313
|
+
children: "Delete"
|
|
314
|
+
}
|
|
315
|
+
)
|
|
316
|
+
] }),
|
|
317
|
+
/* @__PURE__ */ jsx(
|
|
318
|
+
"div",
|
|
319
|
+
{
|
|
320
|
+
ref: containerRef,
|
|
321
|
+
className: imageAnnotationStageClasses,
|
|
322
|
+
style: { width: imageLoaded ? `${displayWidth}px` : void 0 },
|
|
323
|
+
role: imageLoaded ? "application" : "img",
|
|
324
|
+
"aria-label": imageLoaded ? "Image annotation editor" : "Loading image for annotation",
|
|
325
|
+
children: !imageLoaded ? /* @__PURE__ */ jsx("div", { className: "flex min-h-[200px] min-w-[240px] items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "h-8 w-8 animate-spin rounded-full border-2 border-[var(--tiger-border,#d1d5db)] border-t-[var(--tiger-primary,#2563eb)]" }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
326
|
+
/* @__PURE__ */ jsx(
|
|
327
|
+
"img",
|
|
328
|
+
{
|
|
329
|
+
src,
|
|
330
|
+
alt,
|
|
331
|
+
className: imageAnnotationImageClasses,
|
|
332
|
+
style: { width: `${displayWidth}px`, height: `${displayHeight}px` },
|
|
333
|
+
draggable: false
|
|
334
|
+
}
|
|
335
|
+
),
|
|
336
|
+
/* @__PURE__ */ jsxs(
|
|
337
|
+
"svg",
|
|
338
|
+
{
|
|
339
|
+
ref: overlayRef,
|
|
340
|
+
className: classNames(
|
|
341
|
+
imageAnnotationOverlayClasses,
|
|
342
|
+
(!canEdit || activeTool === "select") && imageAnnotationReadonlyOverlayClasses
|
|
343
|
+
),
|
|
344
|
+
width: displayWidth,
|
|
345
|
+
height: displayHeight,
|
|
346
|
+
viewBox: `0 0 ${displayWidth} ${displayHeight}`,
|
|
347
|
+
"aria-label": "Image annotation canvas",
|
|
348
|
+
onMouseDown: handleStageMouseDown,
|
|
349
|
+
onClick: handleStageClick,
|
|
350
|
+
onDoubleClick: commitPolygon,
|
|
351
|
+
children: [
|
|
352
|
+
renderedAnnotations,
|
|
353
|
+
draft ? renderAnnotation(draft, true) : null,
|
|
354
|
+
renderedLabels
|
|
355
|
+
]
|
|
356
|
+
}
|
|
357
|
+
)
|
|
358
|
+
] })
|
|
359
|
+
}
|
|
360
|
+
)
|
|
361
|
+
] });
|
|
362
|
+
}
|
|
363
|
+
ImageAnnotation.displayName = "ImageAnnotation";
|
|
364
|
+
|
|
365
|
+
export {
|
|
366
|
+
ImageAnnotation
|
|
367
|
+
};
|
package/dist/chunk-VJJ76I7U.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/components/Header.tsx
|
|
2
2
|
|
|
3
|
-
var tigercatCore = require('@expcat/tigercat-core');
|
|
4
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
var _tigercatcore = require('@expcat/tigercat-core');
|
|
6
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
7
7
|
var Header = ({
|
|
8
8
|
className,
|
|
9
9
|
height = "64px",
|
|
@@ -11,9 +11,11 @@ var Header = ({
|
|
|
11
11
|
children,
|
|
12
12
|
...props
|
|
13
13
|
}) => {
|
|
14
|
-
const headerClasses =
|
|
14
|
+
const headerClasses = _tigercatcore.classNames.call(void 0, _tigercatcore.layoutHeaderClasses, className);
|
|
15
15
|
const headerStyle = { ...style, height };
|
|
16
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "header", { className: headerClasses, style: headerStyle, ...props, children });
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
|
|
20
|
+
|
|
19
21
|
exports.Header = Header;
|
|
@@ -1,14 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
useChartInteraction
|
|
3
|
+
} from "./chunk-6QML6T3Y.mjs";
|
|
4
|
+
import {
|
|
5
|
+
ChartLegend
|
|
6
|
+
} from "./chunk-UBP7HZSU.mjs";
|
|
7
|
+
import {
|
|
8
|
+
ChartSeries
|
|
9
|
+
} from "./chunk-SDLMB34Y.mjs";
|
|
10
|
+
import {
|
|
11
|
+
ChartTooltip
|
|
12
|
+
} from "./chunk-NASC6XHN.mjs";
|
|
13
|
+
import {
|
|
14
|
+
ChartAxis
|
|
15
|
+
} from "./chunk-RQSQXQN6.mjs";
|
|
16
|
+
import {
|
|
17
|
+
ChartCanvas
|
|
18
|
+
} from "./chunk-DKNVSQSV.mjs";
|
|
19
|
+
import {
|
|
20
|
+
ChartGrid
|
|
21
|
+
} from "./chunk-677VSTPW.mjs";
|
|
11
22
|
|
|
23
|
+
// src/components/AreaChart.tsx
|
|
24
|
+
import { useId, useMemo, useState, useCallback } from "react";
|
|
25
|
+
import {
|
|
26
|
+
classNames,
|
|
27
|
+
createAreaPath,
|
|
28
|
+
createLinearScale,
|
|
29
|
+
createLinePath,
|
|
30
|
+
createPointScale,
|
|
31
|
+
getChartElementOpacity,
|
|
32
|
+
getChartInnerRect,
|
|
33
|
+
getStableChartGradientPrefix,
|
|
34
|
+
getNumberExtent,
|
|
35
|
+
linePointTransitionClasses,
|
|
36
|
+
stackSeriesData,
|
|
37
|
+
resolveChartPalette,
|
|
38
|
+
buildChartLegendItems,
|
|
39
|
+
buildChartSeriesKeys,
|
|
40
|
+
resolveMultiSeriesTooltipContent,
|
|
41
|
+
resolveSeriesData,
|
|
42
|
+
defaultSeriesXYTooltipFormatter
|
|
43
|
+
} from "@expcat/tigercat-core";
|
|
44
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
45
|
var AreaChart = ({
|
|
13
46
|
width = 320,
|
|
14
47
|
height = 200,
|
|
@@ -71,7 +104,11 @@ var AreaChart = ({
|
|
|
71
104
|
}) => {
|
|
72
105
|
const [hoveredPointInfo, setHoveredPointInfo] = useState(null);
|
|
73
106
|
const [tooltipPosition, setTooltipPosition] = useState({ x: 0, y: 0 });
|
|
74
|
-
const
|
|
107
|
+
const gradientId = useId();
|
|
108
|
+
const gradientPrefix = useMemo(
|
|
109
|
+
() => getStableChartGradientPrefix("area", gradientId),
|
|
110
|
+
[gradientId]
|
|
111
|
+
);
|
|
75
112
|
const innerRect = useMemo(
|
|
76
113
|
() => getChartInnerRect(width, height, padding),
|
|
77
114
|
[width, height, padding]
|
|
@@ -284,12 +321,15 @@ var AreaChart = ({
|
|
|
284
321
|
(gradient || animated || strokeGradient || pointGradient) && /* @__PURE__ */ jsxs("defs", { children: [
|
|
285
322
|
animated && /* @__PURE__ */ jsx("style", { children: `
|
|
286
323
|
.tiger-area-animated {
|
|
287
|
-
animation: tiger-area-draw 1.2s cubic-bezier(.4,0,.2,1) forwards;
|
|
324
|
+
animation: tiger-area-draw var(--tiger-motion-duration-slow,1.2s) var(--tiger-motion-ease-emphasized,cubic-bezier(.4,0,.2,1)) forwards;
|
|
288
325
|
}
|
|
289
326
|
@keyframes tiger-area-draw {
|
|
290
327
|
from { stroke-dashoffset: 1; }
|
|
291
328
|
to { stroke-dashoffset: 0; }
|
|
292
329
|
}
|
|
330
|
+
@media (prefers-reduced-motion: reduce) {
|
|
331
|
+
.tiger-area-animated { animation-duration: 0ms; }
|
|
332
|
+
}
|
|
293
333
|
` }),
|
|
294
334
|
gradient && reversedSeriesData.map((sd) => /* @__PURE__ */ jsxs(
|
|
295
335
|
"linearGradient",
|
|
@@ -425,7 +465,7 @@ var AreaChart = ({
|
|
|
425
465
|
strokeLinejoin: "round",
|
|
426
466
|
pathLength: animated ? 1 : void 0,
|
|
427
467
|
className: classNames(
|
|
428
|
-
"transition-opacity duration-
|
|
468
|
+
"transition-opacity [transition-duration:var(--tiger-motion-duration-base,200ms)]",
|
|
429
469
|
animated && "tiger-area-animated"
|
|
430
470
|
)
|
|
431
471
|
}
|
|
@@ -501,4 +541,7 @@ var AreaChart = ({
|
|
|
501
541
|
};
|
|
502
542
|
var AreaChart_default = AreaChart;
|
|
503
543
|
|
|
504
|
-
export {
|
|
544
|
+
export {
|
|
545
|
+
AreaChart,
|
|
546
|
+
AreaChart_default
|
|
547
|
+
};
|
|
@@ -1,8 +1,44 @@
|
|
|
1
|
-
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
2
|
-
import { parseTime, getTimePickerLabels, getTimePeriodLabels, formatTimeDisplayWithLocale, generateHours, generateMinutes, generateSeconds, getTimePickerInputClasses, getTimePickerIconButtonClasses, classNames, timePickerInputWrapperClasses, timePickerClearButtonClasses, TimePickerCloseIconPath, ClockIconPath, timePickerPanelClasses, timePickerRangeHeaderClasses, getTimePickerRangeTabButtonClasses, timePickerPanelContentClasses, timePickerColumnClasses, timePickerColumnHeaderClasses, timePickerColumnListClasses, to24HourFormat, padTwo, getTimePickerOptionAriaLabel, getTimePickerItemClasses, getTimePickerPeriodButtonClasses, timePickerFooterClasses, timePickerFooterButtonClasses, timePickerBaseClasses, to12HourFormat, isTimeInRange, formatTime, getCurrentTime, icon20ViewBox } from '@expcat/tigercat-core';
|
|
3
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
1
|
// src/components/TimePicker.tsx
|
|
2
|
+
import { useState, useMemo, useRef, useEffect, useCallback } from "react";
|
|
3
|
+
import {
|
|
4
|
+
classNames,
|
|
5
|
+
icon20ViewBox,
|
|
6
|
+
parseTime,
|
|
7
|
+
formatTime,
|
|
8
|
+
formatTimeDisplayWithLocale,
|
|
9
|
+
getTimePeriodLabels,
|
|
10
|
+
getTimePickerLabels,
|
|
11
|
+
getTimePickerOptionAriaLabel,
|
|
12
|
+
to12HourFormat,
|
|
13
|
+
to24HourFormat,
|
|
14
|
+
isTimeInRange,
|
|
15
|
+
generateHours,
|
|
16
|
+
generateMinutes,
|
|
17
|
+
generateSeconds,
|
|
18
|
+
getCurrentTime,
|
|
19
|
+
padTwo,
|
|
20
|
+
timePickerBaseClasses,
|
|
21
|
+
timePickerInputWrapperClasses,
|
|
22
|
+
getTimePickerInputClasses,
|
|
23
|
+
getTimePickerIconButtonClasses,
|
|
24
|
+
timePickerClearButtonClasses,
|
|
25
|
+
timePickerPanelClasses,
|
|
26
|
+
timePickerDesktopPanelContentClasses,
|
|
27
|
+
timePickerMobileWheelClasses,
|
|
28
|
+
timePickerMobileWheelSelectClasses,
|
|
29
|
+
timePickerRangeHeaderClasses,
|
|
30
|
+
getTimePickerRangeTabButtonClasses,
|
|
31
|
+
timePickerColumnClasses,
|
|
32
|
+
timePickerColumnHeaderClasses,
|
|
33
|
+
timePickerColumnListClasses,
|
|
34
|
+
getTimePickerItemClasses,
|
|
35
|
+
getTimePickerPeriodButtonClasses,
|
|
36
|
+
timePickerFooterClasses,
|
|
37
|
+
timePickerFooterButtonClasses,
|
|
38
|
+
ClockIconPath,
|
|
39
|
+
TimePickerCloseIconPath
|
|
40
|
+
} from "@expcat/tigercat-core";
|
|
41
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
42
|
var Icon = ({ path, className }) => /* @__PURE__ */ jsx(
|
|
7
43
|
"svg",
|
|
8
44
|
{
|
|
@@ -78,7 +114,7 @@ var TimePicker = (allProps) => {
|
|
|
78
114
|
const [selectedMinutes, setSelectedMinutes] = useState(parsedTime?.minutes ?? 0);
|
|
79
115
|
const [selectedSeconds, setSelectedSeconds] = useState(parsedTime?.seconds ?? 0);
|
|
80
116
|
const [selectedPeriod, setSelectedPeriod] = useState("AM");
|
|
81
|
-
const syncFromActiveValue = () => {
|
|
117
|
+
const syncFromActiveValue = useCallback(() => {
|
|
82
118
|
const parsed = parseTime(activeValue);
|
|
83
119
|
if (!parsed) return;
|
|
84
120
|
setSelectedHours(parsed.hours);
|
|
@@ -88,10 +124,10 @@ var TimePicker = (allProps) => {
|
|
|
88
124
|
const { period } = to12HourFormat(parsed.hours);
|
|
89
125
|
setSelectedPeriod(period);
|
|
90
126
|
}
|
|
91
|
-
};
|
|
127
|
+
}, [activeValue, format]);
|
|
92
128
|
useEffect(() => {
|
|
93
129
|
syncFromActiveValue();
|
|
94
|
-
}, [
|
|
130
|
+
}, [syncFromActiveValue]);
|
|
95
131
|
const labels = useMemo(
|
|
96
132
|
() => getTimePickerLabels(locale, labelsOverrides),
|
|
97
133
|
[locale, labelsOverrides]
|
|
@@ -422,7 +458,52 @@ var TimePicker = (allProps) => {
|
|
|
422
458
|
}
|
|
423
459
|
)
|
|
424
460
|
] }),
|
|
425
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
461
|
+
/* @__PURE__ */ jsxs("div", { className: timePickerMobileWheelClasses, children: [
|
|
462
|
+
/* @__PURE__ */ jsx(
|
|
463
|
+
"select",
|
|
464
|
+
{
|
|
465
|
+
className: timePickerMobileWheelSelectClasses,
|
|
466
|
+
value: format === "12" ? to12HourFormat(selectedHours).hours : selectedHours,
|
|
467
|
+
"aria-label": labels.hour,
|
|
468
|
+
onChange: (event) => selectHour(Number(event.target.value)),
|
|
469
|
+
children: hoursList.map((hour) => /* @__PURE__ */ jsx("option", { value: hour, disabled: isHourDisabled(hour), children: padTwo(hour) }, hour))
|
|
470
|
+
}
|
|
471
|
+
),
|
|
472
|
+
/* @__PURE__ */ jsx(
|
|
473
|
+
"select",
|
|
474
|
+
{
|
|
475
|
+
className: timePickerMobileWheelSelectClasses,
|
|
476
|
+
value: selectedMinutes,
|
|
477
|
+
"aria-label": labels.minute,
|
|
478
|
+
onChange: (event) => selectMinute(Number(event.target.value)),
|
|
479
|
+
children: minutesList.map((minute) => /* @__PURE__ */ jsx("option", { value: minute, disabled: isMinuteDisabled(minute), children: padTwo(minute) }, minute))
|
|
480
|
+
}
|
|
481
|
+
),
|
|
482
|
+
showSeconds && /* @__PURE__ */ jsx(
|
|
483
|
+
"select",
|
|
484
|
+
{
|
|
485
|
+
className: timePickerMobileWheelSelectClasses,
|
|
486
|
+
value: selectedSeconds,
|
|
487
|
+
"aria-label": labels.second,
|
|
488
|
+
onChange: (event) => selectSecond(Number(event.target.value)),
|
|
489
|
+
children: secondsList.map((second) => /* @__PURE__ */ jsx("option", { value: second, children: padTwo(second) }, second))
|
|
490
|
+
}
|
|
491
|
+
),
|
|
492
|
+
format === "12" && /* @__PURE__ */ jsxs(
|
|
493
|
+
"select",
|
|
494
|
+
{
|
|
495
|
+
className: timePickerMobileWheelSelectClasses,
|
|
496
|
+
value: selectedPeriod,
|
|
497
|
+
"aria-label": "Period",
|
|
498
|
+
onChange: (event) => selectPeriod(event.target.value),
|
|
499
|
+
children: [
|
|
500
|
+
/* @__PURE__ */ jsx("option", { value: "AM", children: periodLabels.am }),
|
|
501
|
+
/* @__PURE__ */ jsx("option", { value: "PM", children: periodLabels.pm })
|
|
502
|
+
]
|
|
503
|
+
}
|
|
504
|
+
)
|
|
505
|
+
] }),
|
|
506
|
+
/* @__PURE__ */ jsxs("div", { className: timePickerDesktopPanelContentClasses, children: [
|
|
426
507
|
/* @__PURE__ */ jsxs("div", { className: timePickerColumnClasses, children: [
|
|
427
508
|
/* @__PURE__ */ jsx("div", { className: timePickerColumnHeaderClasses, children: labels.hour }),
|
|
428
509
|
/* @__PURE__ */ jsx("div", { className: timePickerColumnListClasses, children: hoursList.map((hour) => {
|
|
@@ -540,4 +621,6 @@ var TimePicker = (allProps) => {
|
|
|
540
621
|
] });
|
|
541
622
|
};
|
|
542
623
|
|
|
543
|
-
export {
|
|
624
|
+
export {
|
|
625
|
+
TimePicker
|
|
626
|
+
};
|