@expcat/tigercat-react 1.4.0 → 2.0.0-preview.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-NQNHM4OL.mjs → chunk-25D5TXZH.mjs} +3 -3
- package/dist/{chunk-BN4ZKCAI.mjs → chunk-2GSXSLGC.mjs} +74 -46
- package/dist/{chunk-R2KUNFDN.mjs → chunk-2PZICT2T.mjs} +6 -6
- package/dist/{chunk-OXQOKKTP.mjs → chunk-2UFTDDPW.mjs} +3 -3
- package/dist/{chunk-MV54EEKO.mjs → chunk-2UOGBS3C.mjs} +1 -1
- package/dist/{chunk-ZITBUGBH.mjs → chunk-2YDLAZTK.mjs} +66 -19
- package/dist/chunk-3O3AQLNS.mjs +172 -0
- package/dist/{chunk-VAIWWELW.mjs → chunk-3OBUJIJI.mjs} +23 -10
- package/dist/{chunk-J3N24I7A.mjs → chunk-4F3UTDFE.mjs} +24 -6
- package/dist/{chunk-EEF26RBA.mjs → chunk-4SU6D2E7.mjs} +15 -3
- package/dist/{chunk-PTMVWEIC.mjs → chunk-4XGO3OSE.mjs} +4 -3
- package/dist/{chunk-OFRKYQOZ.mjs → chunk-533KLM7P.mjs} +4 -4
- package/dist/chunk-5SX2M3LU.mjs +319 -0
- package/dist/{chunk-KED5S2WG.mjs → chunk-6REMGSLS.mjs} +22 -11
- package/dist/{chunk-YSGM22AH.mjs → chunk-6UIVNRAR.mjs} +7 -4
- package/dist/{chunk-SLEXEH7R.mjs → chunk-7PP6RECM.mjs} +4 -12
- package/dist/{chunk-IZGXDHPB.mjs → chunk-7RI5W465.mjs} +19 -25
- package/dist/chunk-7S4TP4MZ.mjs +211 -0
- package/dist/{chunk-AG4HRAW2.mjs → chunk-7TVZTASQ.mjs} +9 -9
- package/dist/{chunk-7U6VWD4H.mjs → chunk-AF3N4GJJ.mjs} +6 -6
- package/dist/{chunk-4MONGWU5.mjs → chunk-AKNWUI7K.mjs} +1 -1
- package/dist/{chunk-M6YXUNOU.mjs → chunk-AMEH5EHB.mjs} +3 -3
- package/dist/{chunk-ULWT6W6M.mjs → chunk-B3O6MAC3.mjs} +11 -6
- package/dist/chunk-BBK37UMR.mjs +134 -0
- package/dist/chunk-BPFKTAF2.mjs +49 -0
- package/dist/chunk-BPQEM6AF.mjs +110 -0
- package/dist/{chunk-XBM76P27.mjs → chunk-BSXPB2V6.mjs} +8 -6
- package/dist/{chunk-I7FEGKX2.mjs → chunk-CR4QBH46.mjs} +36 -11
- package/dist/{chunk-QOEE2PW5.mjs → chunk-D524E52A.mjs} +37 -22
- package/dist/{chunk-BONUUJU3.mjs → chunk-DJOFM2VO.mjs} +1 -8
- package/dist/chunk-EKILTLUO.mjs +222 -0
- package/dist/{chunk-6BOSSZM3.mjs → chunk-EPWAROC2.mjs} +2 -2
- package/dist/chunk-FNBTGIDG.mjs +52 -0
- package/dist/{chunk-NEZ445D4.mjs → chunk-G27UYCLT.mjs} +7 -15
- package/dist/{chunk-OTEM4FVX.mjs → chunk-G7D4QV7A.mjs} +26 -8
- package/dist/{chunk-JOB47R6Q.mjs → chunk-GCOA4AO6.mjs} +72 -29
- package/dist/chunk-GFLKO46C.mjs +262 -0
- package/dist/{chunk-TNTOSFGN.mjs → chunk-GQPKHMHA.mjs} +1 -1
- package/dist/{chunk-2Y5NIPHB.mjs → chunk-I3SE5HMH.mjs} +39 -10
- package/dist/{chunk-3RBRWBUG.mjs → chunk-IIWUQK2P.mjs} +2 -2
- package/dist/{chunk-ELRZ2ZHM.mjs → chunk-J4HCTYJG.mjs} +18 -20
- package/dist/chunk-JNZHZVPW.mjs +143 -0
- package/dist/{chunk-WFWEMXO7.mjs → chunk-JSBWEK6D.mjs} +132 -56
- package/dist/{chunk-SQTOVSDU.mjs → chunk-K6JLLCY7.mjs} +17 -11
- package/dist/{chunk-3EB42WFR.mjs → chunk-KCPGFO5R.mjs} +2 -2
- package/dist/{chunk-G3PBQ4B4.mjs → chunk-KQ4ZKXXN.mjs} +52 -2
- package/dist/{chunk-2L7QEOFD.mjs → chunk-KWVA2DN3.mjs} +1 -1
- package/dist/{chunk-YH57D4AV.mjs → chunk-LAKPYMBZ.mjs} +1 -0
- package/dist/{chunk-6GU5NH5F.mjs → chunk-LBXNMCXN.mjs} +33 -5
- package/dist/{chunk-CAQPYJFA.mjs → chunk-LJWQ7T57.mjs} +20 -3
- package/dist/{chunk-KGMVRIYC.mjs → chunk-LOM6NNQK.mjs} +29 -16
- package/dist/{chunk-ZQSMJS2Q.mjs → chunk-MMWF2OPA.mjs} +29 -20
- package/dist/{chunk-AVLIUHOS.mjs → chunk-MOLUSXVC.mjs} +6 -6
- package/dist/{chunk-RVLV63SI.mjs → chunk-MQ34GFHN.mjs} +109 -43
- package/dist/{chunk-WMPCN7OF.mjs → chunk-MZCGQED3.mjs} +15 -3
- package/dist/{chunk-KDXKF6B2.mjs → chunk-MZPKFMQC.mjs} +1 -1
- package/dist/{chunk-WIWTY74F.mjs → chunk-NJHZQBA7.mjs} +16 -2
- package/dist/{chunk-QIL24WZD.mjs → chunk-NRWH5IWZ.mjs} +13 -8
- package/dist/{chunk-FUE7IBTJ.mjs → chunk-OGG2TQDG.mjs} +4 -4
- package/dist/{chunk-MV2JQ6XQ.mjs → chunk-OL3RXYMG.mjs} +1 -1
- package/dist/{chunk-VHGCWZ6V.mjs → chunk-OTRPN5ZG.mjs} +58 -13
- package/dist/{chunk-D7UR526A.mjs → chunk-Q327ESD2.mjs} +9 -5
- package/dist/{chunk-NSEO2B74.mjs → chunk-Q5JTIICP.mjs} +25 -5
- package/dist/{chunk-RYHM75MP.mjs → chunk-QWUDJC6K.mjs} +1 -1
- package/dist/{chunk-376X7SDZ.mjs → chunk-R67HTROL.mjs} +7 -6
- package/dist/{chunk-HHMYERHY.mjs → chunk-RCUL6RZU.mjs} +3 -2
- package/dist/{chunk-C44WSDEY.mjs → chunk-S7IB6YST.mjs} +2 -1
- package/dist/{chunk-RVO6R37N.mjs → chunk-SHDQJ5BJ.mjs} +1 -1
- package/dist/{chunk-L6KSO66F.mjs → chunk-SHJNDDYK.mjs} +3 -6
- package/dist/{chunk-J5N5OQWB.mjs → chunk-SNE3E22Q.mjs} +12 -9
- package/dist/{chunk-NKKIJQMV.mjs → chunk-SPIPFOGD.mjs} +4 -2
- package/dist/{chunk-SY23FAXK.mjs → chunk-T6HNFCOW.mjs} +24 -8
- package/dist/{chunk-M3MOSUZO.mjs → chunk-TJDZFN2Z.mjs} +15 -6
- package/dist/{chunk-6QQBMZQ6.mjs → chunk-U2ZXZ2KQ.mjs} +74 -10
- package/dist/{chunk-DVEK5SO6.mjs → chunk-UYJJLHVA.mjs} +9 -4
- package/dist/{chunk-PXO2F2CS.mjs → chunk-V23KR23W.mjs} +47 -4
- package/dist/{chunk-56CTXEJS.mjs → chunk-VBGJQPPI.mjs} +24 -11
- package/dist/{chunk-WTSG7QXK.mjs → chunk-VKIGZWRK.mjs} +10 -10
- package/dist/{chunk-KXT2TP6A.mjs → chunk-WKTIDYPD.mjs} +82 -16
- package/dist/chunk-WLFLQB4R.mjs +312 -0
- package/dist/{chunk-2LYV6NBJ.mjs → chunk-WTIEJCRV.mjs} +7 -1
- package/dist/{chunk-VM4ZQHT5.mjs → chunk-XHNR3A7A.mjs} +66 -19
- package/dist/{chunk-CME2IFUT.mjs → chunk-XSAKD4MX.mjs} +52 -30
- package/dist/{chunk-7DUHHRAU.mjs → chunk-Y5X3G2LD.mjs} +41 -5
- package/dist/{chunk-NITD53UU.mjs → chunk-YI7NQWUV.mjs} +38 -0
- package/dist/{chunk-NASC6XHN.mjs → chunk-YORCCCQX.mjs} +29 -20
- package/dist/{chunk-J4OQ2VRH.mjs → chunk-YTFQBXH4.mjs} +73 -14
- package/dist/{chunk-RYNLPRUM.mjs → chunk-Z2NZ2XC5.mjs} +5 -5
- package/dist/{chunk-ZA5EFHET.mjs → chunk-Z6BDNV3S.mjs} +18 -1
- package/dist/{chunk-NKSYX4R7.mjs → chunk-ZFGSZW7S.mjs} +6 -6
- package/dist/{chunk-UBP7HZSU.mjs → chunk-ZG2W4HS5.mjs} +6 -4
- package/dist/components/ActivityFeed.mjs +4 -4
- package/dist/components/Anchor.d.mts +1 -1
- package/dist/components/AreaChart.d.mts +4 -4
- package/dist/components/AreaChart.mjs +5 -5
- package/dist/components/AutoComplete.d.mts +1 -1
- package/dist/components/AutoComplete.mjs +2 -1
- package/dist/components/BackTop.mjs +1 -1
- package/dist/components/Badge.mjs +2 -1
- package/dist/components/BarChart.mjs +5 -5
- package/dist/components/Breadcrumb.d.mts +1 -1
- package/dist/components/Calendar.d.mts +2 -10
- package/dist/components/Calendar.mjs +2 -1
- package/dist/components/Carousel.d.mts +12 -0
- package/dist/components/Carousel.mjs +2 -1
- package/dist/components/Cascader.d.mts +2 -0
- package/dist/components/Cascader.mjs +1 -1
- package/dist/components/ChartAxis.d.mts +1 -2
- package/dist/components/ChartGrid.d.mts +1 -2
- package/dist/components/ChartLegend.mjs +1 -1
- package/dist/components/ChartSeries.d.mts +1 -2
- package/dist/components/ChartTooltip.d.mts +1 -1
- package/dist/components/ChartTooltip.mjs +1 -1
- package/dist/components/ChatWindow.mjs +8 -6
- package/dist/components/Checkbox.d.mts +2 -2
- package/dist/components/Checkbox.mjs +3 -3
- package/dist/components/CheckboxGroup.d.mts +3 -3
- package/dist/components/CheckboxGroup.mjs +2 -2
- package/dist/components/CodeEditor.mjs +1 -1
- package/dist/components/CommentThread.mjs +6 -4
- package/dist/components/CropUpload.d.mts +6 -2
- package/dist/components/CropUpload.mjs +3 -3
- package/dist/components/DataTableWithToolbar.d.mts +5 -20
- package/dist/components/DataTableWithToolbar.mjs +13 -12
- package/dist/components/DatePicker.d.mts +9 -6
- package/dist/components/DatePicker.mjs +3 -2
- package/dist/components/Descriptions.d.mts +2 -2
- package/dist/components/DonutChart.d.mts +4 -4
- package/dist/components/DonutChart.mjs +5 -5
- package/dist/components/Drawer.d.mts +1 -1
- package/dist/components/Drawer.mjs +1 -1
- package/dist/components/Dropdown.d.mts +14 -2
- package/dist/components/Dropdown.mjs +3 -1
- package/dist/components/Empty.mjs +2 -1
- package/dist/components/FileManager.d.mts +3 -23
- package/dist/components/FileManager.mjs +1 -1
- package/dist/components/FloatButton.mjs +1 -1
- package/dist/components/Form.d.mts +2 -2
- package/dist/components/Form.mjs +1 -1
- package/dist/components/FormItem.mjs +2 -2
- package/dist/components/FormWizard.mjs +2 -2
- package/dist/components/FunnelChart.mjs +4 -4
- package/dist/components/GaugeChart.mjs +2 -1
- package/dist/components/HeatmapChart.mjs +3 -3
- package/dist/components/Image.mjs +5 -4
- package/dist/components/ImageAnnotation.d.mts +1 -1
- package/dist/components/ImageAnnotation.mjs +2 -1
- package/dist/components/ImageCropper.mjs +2 -1
- package/dist/components/ImageGroup.d.mts +2 -2
- package/dist/components/ImageGroup.mjs +3 -2
- package/dist/components/ImagePreview.mjs +2 -1
- package/dist/components/ImageViewer.d.mts +2 -12
- package/dist/components/ImageViewer.mjs +2 -1
- package/dist/components/InfiniteScroll.mjs +1 -1
- package/dist/components/Input.mjs +3 -2
- package/dist/components/InputGroup.d.mts +3 -3
- package/dist/components/InputNumber.mjs +3 -2
- package/dist/components/Kanban.d.mts +5 -1
- package/dist/components/Kanban.mjs +2 -2
- package/dist/components/LineChart.mjs +5 -5
- package/dist/components/List.d.mts +3 -4
- package/dist/components/List.mjs +2 -2
- package/dist/components/Loading.mjs +1 -1
- package/dist/components/MarkdownEditor.mjs +2 -2
- package/dist/components/Menu.d.mts +92 -7
- package/dist/components/Menu.mjs +1 -1
- package/dist/components/Message.d.mts +4 -17
- package/dist/components/Message.mjs +162 -4
- package/dist/components/MessageContainer.d.mts +11 -0
- package/dist/components/MessageContainer.mjs +9 -0
- package/dist/components/MessageRoot.d.mts +9 -0
- package/dist/components/MessageRoot.mjs +6 -0
- package/dist/components/Modal.d.mts +4 -0
- package/dist/components/Modal.mjs +1 -1
- package/dist/components/Notification.d.mts +4 -17
- package/dist/components/Notification.mjs +188 -4
- package/dist/components/NotificationCenter.mjs +5 -5
- package/dist/components/NotificationContainer.d.mts +11 -0
- package/dist/components/NotificationContainer.mjs +9 -0
- package/dist/components/NotificationRoot.d.mts +9 -0
- package/dist/components/NotificationRoot.mjs +6 -0
- package/dist/components/PieChart.mjs +4 -4
- package/dist/components/Popconfirm.mjs +2 -2
- package/dist/components/Popover.mjs +2 -2
- package/dist/components/QRCode.d.mts +2 -1
- package/dist/components/QRCode.mjs +2 -1
- package/dist/components/RadarChart.mjs +5 -5
- package/dist/components/Radio.mjs +3 -3
- package/dist/components/RadioGroup.d.mts +2 -2
- package/dist/components/RadioGroup.mjs +2 -2
- package/dist/components/Rate.mjs +1 -1
- package/dist/components/Resizable.mjs +1 -1
- package/dist/components/Result.mjs +1 -1
- package/dist/components/RichTextEditor.mjs +2 -2
- package/dist/components/ScatterChart.mjs +5 -5
- package/dist/components/ScrollSpy.d.mts +1 -1
- package/dist/components/ScrollSpy.mjs +1 -1
- package/dist/components/Segmented.d.mts +1 -1
- package/dist/components/Segmented.mjs +1 -1
- package/dist/components/Select.d.mts +1 -1
- package/dist/components/Select.mjs +1 -1
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/Splitter.mjs +1 -1
- package/dist/components/Spotlight.mjs +2 -2
- package/dist/components/Steps.mjs +1 -1
- package/dist/components/SunburstChart.mjs +4 -4
- package/dist/components/Table.d.mts +2 -2
- package/dist/components/Table.mjs +8 -8
- package/dist/components/Tabs.d.mts +2 -6
- package/dist/components/Tabs.mjs +1 -1
- package/dist/components/Tag.mjs +2 -1
- package/dist/components/TaskBoard.d.mts +3 -1
- package/dist/components/TaskBoard.mjs +1 -1
- package/dist/components/Textarea.mjs +3 -2
- package/dist/components/TimePicker.d.mts +10 -9
- package/dist/components/TimePicker.mjs +2 -2
- package/dist/components/Timeline.d.mts +5 -1
- package/dist/components/Timeline.mjs +2 -1
- package/dist/components/Tooltip.mjs +2 -2
- package/dist/components/Tour.mjs +3 -2
- package/dist/components/Transfer.d.mts +3 -1
- package/dist/components/Transfer.mjs +1 -1
- package/dist/components/Tree.d.mts +12 -0
- package/dist/components/Tree.mjs +2 -2
- package/dist/components/TreeMapChart.mjs +4 -4
- package/dist/components/TreeSelect.d.mts +2 -0
- package/dist/components/TreeSelect.mjs +1 -1
- package/dist/components/Upload.mjs +2 -2
- package/dist/components/VirtualList.mjs +1 -1
- package/dist/components/VirtualTable.d.mts +13 -9
- package/dist/components/VirtualTable.mjs +1 -1
- package/dist/hooks/useChartInteraction.d.mts +85 -0
- package/dist/hooks/useChartInteraction.mjs +6 -0
- package/dist/hooks/useControlledState.d.mts +33 -0
- package/dist/hooks/useControlledState.mjs +6 -0
- package/dist/hooks/useDrag.d.mts +39 -0
- package/dist/hooks/useDrag.mjs +6 -0
- package/dist/hooks/useFormController.d.mts +24 -0
- package/dist/hooks/useFormController.mjs +6 -0
- package/dist/index.d.mts +59 -231
- package/dist/index.mjs +2154 -896
- package/package.json +747 -17
- package/dist/chunk-2RBHQBSG.js +0 -164
- package/dist/chunk-2WDCWFOM.js +0 -246
- package/dist/chunk-3E76U2RG.js +0 -149
- package/dist/chunk-3EDASNTG.js +0 -290
- package/dist/chunk-3QFHVAZT.js +0 -72
- package/dist/chunk-4AMSYFYC.js +0 -443
- package/dist/chunk-4DTMFQCY.js +0 -167
- package/dist/chunk-4LIDROT4.js +0 -88
- package/dist/chunk-4MQCUKIC.js +0 -80
- package/dist/chunk-4PPTEEDI.js +0 -81
- package/dist/chunk-4TEILQSN.js +0 -58
- package/dist/chunk-5ALMTE35.js +0 -109
- package/dist/chunk-5EVHVZG5.js +0 -131
- package/dist/chunk-6CWZXS5B.js +0 -152
- package/dist/chunk-6HDMUF23.js +0 -22
- package/dist/chunk-6OMCHC6W.js +0 -224
- package/dist/chunk-7CHTTM6D.js +0 -632
- package/dist/chunk-7PXALKLM.js +0 -245
- package/dist/chunk-7Z64GEMN.js +0 -320
- package/dist/chunk-AF2AEZKM.js +0 -165
- package/dist/chunk-ANBNSUSR.js +0 -330
- package/dist/chunk-ANN5P7TJ.js +0 -443
- package/dist/chunk-AUW7DCXL.js +0 -67
- package/dist/chunk-AX5XRD2Q.js +0 -36
- package/dist/chunk-B3CRHKTZ.mjs +0 -50
- package/dist/chunk-B5TUTAVX.js +0 -321
- package/dist/chunk-B63GEB2Y.js +0 -749
- package/dist/chunk-BA6TJQZL.js +0 -457
- package/dist/chunk-BEM7XG2L.js +0 -240
- package/dist/chunk-BEZO5IE4.js +0 -65
- package/dist/chunk-BO45CU4Q.js +0 -323
- package/dist/chunk-BRA3PO53.js +0 -497
- package/dist/chunk-BROIZ266.js +0 -185
- package/dist/chunk-C5BPHZXK.js +0 -77
- package/dist/chunk-CC5GFX6F.js +0 -219
- package/dist/chunk-CDRQSKXT.mjs +0 -195
- package/dist/chunk-CHPJPIW6.js +0 -93
- package/dist/chunk-CNNEUJR2.js +0 -207
- package/dist/chunk-D5MQBUP2.js +0 -250
- package/dist/chunk-D6TKXVEB.js +0 -14
- package/dist/chunk-DBMC6FPU.js +0 -270
- package/dist/chunk-DCKBVRLI.js +0 -547
- package/dist/chunk-DEIVWO2D.mjs +0 -285
- package/dist/chunk-E5GD3H7L.js +0 -100
- package/dist/chunk-EHIXCFD7.js +0 -367
- package/dist/chunk-EJKOUI26.js +0 -337
- package/dist/chunk-EOU6WZTS.js +0 -647
- package/dist/chunk-EPJ6W4VI.mjs +0 -165
- package/dist/chunk-EQD2U4KM.js +0 -509
- package/dist/chunk-FBFCJCON.js +0 -129
- package/dist/chunk-FI53LYZ6.js +0 -447
- package/dist/chunk-FJDTVJTX.js +0 -19
- package/dist/chunk-FQO7BKXW.js +0 -65
- package/dist/chunk-FZHBVHQ6.js +0 -280
- package/dist/chunk-GDPU5MYA.js +0 -93
- package/dist/chunk-GG72T6JK.js +0 -125
- package/dist/chunk-GYQ2DN6Z.mjs +0 -174
- package/dist/chunk-H4AR4GXH.js +0 -181
- package/dist/chunk-H6NC6SBX.js +0 -330
- package/dist/chunk-HQ3QOT7H.js +0 -38
- package/dist/chunk-I3CDTF4U.js +0 -48
- package/dist/chunk-IZXU7DF6.js +0 -46
- package/dist/chunk-J4SNBXJM.js +0 -127
- package/dist/chunk-J6OZWT3P.js +0 -252
- package/dist/chunk-JB33A4S6.js +0 -136
- package/dist/chunk-JIFSUUGA.js +0 -120
- package/dist/chunk-K2TXT5HQ.js +0 -195
- package/dist/chunk-KYNWNTGO.js +0 -649
- package/dist/chunk-L24PPXLV.js +0 -108
- package/dist/chunk-L3WPA2RP.js +0 -25
- package/dist/chunk-LJRCEB7F.js +0 -718
- package/dist/chunk-LODDAS62.js +0 -188
- package/dist/chunk-LROHXQWX.js +0 -28
- package/dist/chunk-LZG24TDB.js +0 -73
- package/dist/chunk-M3FVPPMM.js +0 -188
- package/dist/chunk-MB3QU3US.js +0 -119
- package/dist/chunk-MC26ORSN.js +0 -305
- package/dist/chunk-MTIGGMHG.mjs +0 -180
- package/dist/chunk-N2JYU4JI.js +0 -68
- package/dist/chunk-NDGA3N6H.js +0 -180
- package/dist/chunk-NMKFR435.js +0 -373
- package/dist/chunk-NRLGZRK2.js +0 -227
- package/dist/chunk-NVI2P7VH.js +0 -350
- package/dist/chunk-OBY4FYRZ.js +0 -64
- package/dist/chunk-OS6M3IZF.js +0 -374
- package/dist/chunk-P36GX65N.js +0 -79
- package/dist/chunk-PFYK2V3E.js +0 -149
- package/dist/chunk-PHAJXRGE.js +0 -285
- package/dist/chunk-PNAWOJ32.js +0 -60
- package/dist/chunk-PT5T5F4H.js +0 -340
- package/dist/chunk-PTEDJ6MA.js +0 -31
- package/dist/chunk-PZNVU37I.js +0 -50
- package/dist/chunk-Q2GPRAF4.js +0 -70
- package/dist/chunk-Q4JMAQXJ.js +0 -46
- package/dist/chunk-QIKR5EFI.js +0 -230
- package/dist/chunk-QLATA4UB.js +0 -82
- package/dist/chunk-QMK4OFC5.js +0 -235
- package/dist/chunk-QQKP437L.js +0 -52
- package/dist/chunk-QYYAXM5F.js +0 -80
- package/dist/chunk-RFHPG4KN.js +0 -413
- package/dist/chunk-RTHC4KWM.js +0 -55
- package/dist/chunk-RYIYE2PY.js +0 -139
- package/dist/chunk-S5Y6UHAK.mjs +0 -131
- package/dist/chunk-SDZKL3IB.mjs +0 -240
- package/dist/chunk-SH4BZYXO.js +0 -120
- package/dist/chunk-SQGFNVYT.js +0 -234
- package/dist/chunk-SQONS5PH.js +0 -46
- package/dist/chunk-STTQ5LXX.js +0 -153
- package/dist/chunk-SXHCMZ6U.js +0 -303
- package/dist/chunk-T7KO6EVK.js +0 -174
- package/dist/chunk-TB2UHDOZ.js +0 -21
- package/dist/chunk-TDODFBBO.js +0 -101
- package/dist/chunk-TEYL5X56.js +0 -1580
- package/dist/chunk-TQOWIDQT.js +0 -51
- package/dist/chunk-U356F7GU.js +0 -209
- package/dist/chunk-U3M24RPH.js +0 -85
- package/dist/chunk-UAM3RQY4.js +0 -474
- package/dist/chunk-UEAXYZSE.js +0 -134
- package/dist/chunk-UF3DXKCI.js +0 -30
- package/dist/chunk-UIIOZEUP.js +0 -232
- package/dist/chunk-UKLVOR4E.js +0 -72
- package/dist/chunk-UKQMF3JV.js +0 -217
- package/dist/chunk-UVMQJOTX.js +0 -74
- package/dist/chunk-VC26SAXB.js +0 -692
- package/dist/chunk-VDF2BD2A.js +0 -135
- package/dist/chunk-VE3SYUMH.js +0 -45
- package/dist/chunk-VNMWPJDN.js +0 -147
- package/dist/chunk-W3VLCSJL.js +0 -26
- package/dist/chunk-W6AWN7BC.js +0 -366
- package/dist/chunk-WCTNQYXO.js +0 -312
- package/dist/chunk-WN3ZI7FN.js +0 -144
- package/dist/chunk-WOSKRZOO.js +0 -89
- package/dist/chunk-WV5XHYW6.js +0 -95
- package/dist/chunk-WYKUC5MM.js +0 -333
- package/dist/chunk-WZUADPYB.js +0 -169
- package/dist/chunk-X7JAYXPY.js +0 -239
- package/dist/chunk-XFPJYKBQ.js +0 -98
- package/dist/chunk-XTQUPDRI.js +0 -278
- package/dist/chunk-XTV5JLLC.js +0 -170
- package/dist/chunk-YID7J6ZK.js +0 -51
- package/dist/chunk-YMKA4L3Z.js +0 -28
- package/dist/chunk-YRVAF2ID.js +0 -142
- package/dist/chunk-YWTZALG5.js +0 -32
- package/dist/chunk-ZDNQGS4O.js +0 -226
- package/dist/chunk-ZDXIP33Y.js +0 -67
- package/dist/chunk-ZJI2VLIL.js +0 -86
- package/dist/chunk-ZLNBE4IS.js +0 -92
- package/dist/chunk-ZRHDNGWO.js +0 -54
- package/dist/chunk-ZZAR4IDS.js +0 -112
- package/dist/components/ActivityFeed.d.ts +0 -10
- package/dist/components/ActivityFeed.js +0 -18
- package/dist/components/Affix.d.ts +0 -11
- package/dist/components/Affix.js +0 -6
- package/dist/components/Alert.d.ts +0 -25
- package/dist/components/Alert.js +0 -7
- package/dist/components/Anchor.d.ts +0 -57
- package/dist/components/Anchor.js +0 -12
- package/dist/components/AnchorLink.d.mts +0 -3
- package/dist/components/AnchorLink.d.ts +0 -3
- package/dist/components/AnchorLink.js +0 -7
- package/dist/components/AnchorLink.mjs +0 -7
- package/dist/components/AreaChart.d.ts +0 -24
- package/dist/components/AreaChart.js +0 -15
- package/dist/components/AutoComplete.d.ts +0 -16
- package/dist/components/AutoComplete.js +0 -6
- package/dist/components/Avatar.d.ts +0 -12
- package/dist/components/Avatar.js +0 -7
- package/dist/components/AvatarGroup.d.ts +0 -14
- package/dist/components/AvatarGroup.js +0 -8
- package/dist/components/BackTop.d.ts +0 -21
- package/dist/components/BackTop.js +0 -8
- package/dist/components/Badge.d.ts +0 -9
- package/dist/components/Badge.js +0 -6
- package/dist/components/BarChart.d.ts +0 -16
- package/dist/components/BarChart.js +0 -15
- package/dist/components/Breadcrumb.d.ts +0 -32
- package/dist/components/Breadcrumb.js +0 -10
- package/dist/components/BreadcrumbItem.d.mts +0 -3
- package/dist/components/BreadcrumbItem.d.ts +0 -3
- package/dist/components/BreadcrumbItem.js +0 -6
- package/dist/components/BreadcrumbItem.mjs +0 -6
- package/dist/components/Button.d.ts +0 -10
- package/dist/components/Button.js +0 -7
- package/dist/components/ButtonGroup.d.ts +0 -15
- package/dist/components/ButtonGroup.js +0 -10
- package/dist/components/Calendar.d.ts +0 -15
- package/dist/components/Calendar.js +0 -8
- package/dist/components/Card.d.ts +0 -33
- package/dist/components/Card.js +0 -6
- package/dist/components/Carousel.d.ts +0 -26
- package/dist/components/Carousel.js +0 -6
- package/dist/components/Cascader.d.ts +0 -17
- package/dist/components/Cascader.js +0 -7
- package/dist/components/ChartAxis.d.ts +0 -10
- package/dist/components/ChartAxis.js +0 -8
- package/dist/components/ChartCanvas.d.ts +0 -9
- package/dist/components/ChartCanvas.js +0 -8
- package/dist/components/ChartGrid.d.ts +0 -11
- package/dist/components/ChartGrid.js +0 -8
- package/dist/components/ChartLegend.d.ts +0 -17
- package/dist/components/ChartLegend.js +0 -8
- package/dist/components/ChartSeries.d.ts +0 -18
- package/dist/components/ChartSeries.js +0 -8
- package/dist/components/ChartTooltip.d.ts +0 -12
- package/dist/components/ChartTooltip.js +0 -8
- package/dist/components/ChatWindow.d.ts +0 -12
- package/dist/components/ChatWindow.js +0 -17
- package/dist/components/Checkbox.d.ts +0 -48
- package/dist/components/Checkbox.js +0 -8
- package/dist/components/CheckboxGroup.d.ts +0 -39
- package/dist/components/CheckboxGroup.js +0 -9
- package/dist/components/Code.d.ts +0 -9
- package/dist/components/Code.js +0 -8
- package/dist/components/CodeEditor.d.ts +0 -18
- package/dist/components/CodeEditor.js +0 -8
- package/dist/components/Col.d.ts +0 -7
- package/dist/components/Col.js +0 -7
- package/dist/components/Collapse.d.ts +0 -29
- package/dist/components/Collapse.js +0 -10
- package/dist/components/CollapsePanel.d.ts +0 -24
- package/dist/components/CollapsePanel.js +0 -9
- package/dist/components/ColorPicker.d.ts +0 -12
- package/dist/components/ColorPicker.js +0 -6
- package/dist/components/ColorSwatch.d.ts +0 -11
- package/dist/components/ColorSwatch.js +0 -8
- package/dist/components/CommentThread.d.ts +0 -8
- package/dist/components/CommentThread.js +0 -16
- package/dist/components/ConfigProvider.d.ts +0 -21
- package/dist/components/ConfigProvider.js +0 -8
- package/dist/components/Container.d.ts +0 -13
- package/dist/components/Container.js +0 -6
- package/dist/components/Content.d.ts +0 -9
- package/dist/components/Content.js +0 -6
- package/dist/components/Countdown.d.ts +0 -12
- package/dist/components/Countdown.js +0 -8
- package/dist/components/CronEditor.d.ts +0 -12
- package/dist/components/CronEditor.js +0 -8
- package/dist/components/CropUpload.d.ts +0 -52
- package/dist/components/CropUpload.js +0 -12
- package/dist/components/DataTableWithToolbar.d.ts +0 -65
- package/dist/components/DataTableWithToolbar.js +0 -23
- package/dist/components/DatePicker.d.ts +0 -25
- package/dist/components/DatePicker.js +0 -7
- package/dist/components/Descriptions.d.ts +0 -53
- package/dist/components/Descriptions.js +0 -8
- package/dist/components/Divider.d.ts +0 -10
- package/dist/components/Divider.js +0 -6
- package/dist/components/DonutChart.d.ts +0 -20
- package/dist/components/DonutChart.js +0 -13
- package/dist/components/Drawer.d.ts +0 -21
- package/dist/components/Drawer.js +0 -8
- package/dist/components/Dropdown.d.ts +0 -35
- package/dist/components/Dropdown.js +0 -11
- package/dist/components/DropdownItem.d.mts +0 -17
- package/dist/components/DropdownItem.d.ts +0 -17
- package/dist/components/DropdownItem.js +0 -8
- package/dist/components/DropdownItem.mjs +0 -8
- package/dist/components/DropdownMenu.d.mts +0 -3
- package/dist/components/DropdownMenu.d.ts +0 -3
- package/dist/components/DropdownMenu.js +0 -8
- package/dist/components/DropdownMenu.mjs +0 -8
- package/dist/components/Empty.d.ts +0 -14
- package/dist/components/Empty.js +0 -6
- package/dist/components/FileManager.d.ts +0 -30
- package/dist/components/FileManager.js +0 -9
- package/dist/components/FloatButton.d.ts +0 -21
- package/dist/components/FloatButton.js +0 -8
- package/dist/components/Footer.d.ts +0 -9
- package/dist/components/Footer.js +0 -6
- package/dist/components/Form.d.ts +0 -92
- package/dist/components/Form.js +0 -9
- package/dist/components/FormItem.d.ts +0 -16
- package/dist/components/FormItem.js +0 -8
- package/dist/components/FormWizard.d.ts +0 -10
- package/dist/components/FormWizard.js +0 -12
- package/dist/components/FunnelChart.d.ts +0 -15
- package/dist/components/FunnelChart.js +0 -10
- package/dist/components/Gantt.d.ts +0 -16
- package/dist/components/Gantt.js +0 -7
- package/dist/components/GaugeChart.d.ts +0 -9
- package/dist/components/GaugeChart.js +0 -7
- package/dist/components/Header.d.ts +0 -9
- package/dist/components/Header.js +0 -6
- package/dist/components/HeatmapChart.d.ts +0 -13
- package/dist/components/HeatmapChart.js +0 -9
- package/dist/components/Icon.d.ts +0 -9
- package/dist/components/Icon.js +0 -6
- package/dist/components/Image.d.ts +0 -20
- package/dist/components/Image.js +0 -10
- package/dist/components/ImageAnnotation.d.ts +0 -19
- package/dist/components/ImageAnnotation.js +0 -6
- package/dist/components/ImageCropper.d.ts +0 -21
- package/dist/components/ImageCropper.js +0 -6
- package/dist/components/ImageGroup.d.ts +0 -30
- package/dist/components/ImageGroup.js +0 -10
- package/dist/components/ImagePreview.d.ts +0 -21
- package/dist/components/ImagePreview.js +0 -7
- package/dist/components/ImageViewer.d.ts +0 -21
- package/dist/components/ImageViewer.js +0 -6
- package/dist/components/InfiniteScroll.d.ts +0 -22
- package/dist/components/InfiniteScroll.js +0 -9
- package/dist/components/Input.d.ts +0 -46
- package/dist/components/Input.js +0 -7
- package/dist/components/InputGroup.d.ts +0 -20
- package/dist/components/InputGroup.js +0 -12
- package/dist/components/InputNumber.d.ts +0 -24
- package/dist/components/InputNumber.js +0 -7
- package/dist/components/Kanban.d.ts +0 -47
- package/dist/components/Kanban.js +0 -10
- package/dist/components/Layout.d.ts +0 -9
- package/dist/components/Layout.js +0 -6
- package/dist/components/LineChart.d.ts +0 -19
- package/dist/components/LineChart.js +0 -15
- package/dist/components/Link.d.ts +0 -10
- package/dist/components/Link.js +0 -6
- package/dist/components/List.d.ts +0 -127
- package/dist/components/List.js +0 -8
- package/dist/components/Loading.d.ts +0 -8
- package/dist/components/Loading.js +0 -8
- package/dist/components/MarkdownEditor.d.ts +0 -21
- package/dist/components/MarkdownEditor.js +0 -9
- package/dist/components/Mentions.d.ts +0 -18
- package/dist/components/Mentions.js +0 -8
- package/dist/components/Menu.d.ts +0 -13
- package/dist/components/Menu.js +0 -15
- package/dist/components/MenuItem.d.mts +0 -7
- package/dist/components/MenuItem.d.ts +0 -7
- package/dist/components/MenuItem.js +0 -8
- package/dist/components/MenuItem.mjs +0 -8
- package/dist/components/MenuItemGroup.d.mts +0 -7
- package/dist/components/MenuItemGroup.d.ts +0 -7
- package/dist/components/MenuItemGroup.js +0 -8
- package/dist/components/MenuItemGroup.mjs +0 -8
- package/dist/components/Message.d.ts +0 -28
- package/dist/components/Message.js +0 -11
- package/dist/components/Modal.d.ts +0 -56
- package/dist/components/Modal.js +0 -10
- package/dist/components/Notification.d.ts +0 -27
- package/dist/components/Notification.js +0 -11
- package/dist/components/NotificationCenter.d.ts +0 -8
- package/dist/components/NotificationCenter.js +0 -18
- package/dist/components/NumberKeyboard.d.ts +0 -13
- package/dist/components/NumberKeyboard.js +0 -9
- package/dist/components/OrgChart.d.ts +0 -16
- package/dist/components/OrgChart.js +0 -7
- package/dist/components/Pagination.d.ts +0 -15
- package/dist/components/Pagination.js +0 -9
- package/dist/components/PieChart.d.ts +0 -14
- package/dist/components/PieChart.js +0 -12
- package/dist/components/Popconfirm.d.ts +0 -24
- package/dist/components/Popconfirm.js +0 -8
- package/dist/components/Popover.d.ts +0 -22
- package/dist/components/Popover.js +0 -8
- package/dist/components/PrintLayout.d.ts +0 -22
- package/dist/components/PrintLayout.js +0 -8
- package/dist/components/Progress.d.ts +0 -8
- package/dist/components/Progress.js +0 -6
- package/dist/components/QRCode.d.ts +0 -16
- package/dist/components/QRCode.js +0 -8
- package/dist/components/RadarChart.d.ts +0 -31
- package/dist/components/RadarChart.js +0 -13
- package/dist/components/Radio.d.ts +0 -20
- package/dist/components/Radio.js +0 -8
- package/dist/components/RadioGroup.d.ts +0 -28
- package/dist/components/RadioGroup.js +0 -9
- package/dist/components/Rate.d.ts +0 -14
- package/dist/components/Rate.js +0 -6
- package/dist/components/Resizable.d.ts +0 -13
- package/dist/components/Resizable.js +0 -8
- package/dist/components/Result.d.ts +0 -14
- package/dist/components/Result.js +0 -7
- package/dist/components/RichTextEditor.d.ts +0 -33
- package/dist/components/RichTextEditor.js +0 -9
- package/dist/components/Row.d.ts +0 -11
- package/dist/components/Row.js +0 -8
- package/dist/components/ScatterChart.d.ts +0 -32
- package/dist/components/ScatterChart.js +0 -15
- package/dist/components/ScrollSpy.d.ts +0 -13
- package/dist/components/ScrollSpy.js +0 -8
- package/dist/components/Segmented.d.ts +0 -12
- package/dist/components/Segmented.js +0 -6
- package/dist/components/Select.d.ts +0 -26
- package/dist/components/Select.js +0 -7
- package/dist/components/Sidebar.d.ts +0 -9
- package/dist/components/Sidebar.js +0 -6
- package/dist/components/Signature.d.ts +0 -18
- package/dist/components/Signature.js +0 -9
- package/dist/components/Skeleton.d.ts +0 -7
- package/dist/components/Skeleton.js +0 -6
- package/dist/components/Slider.d.ts +0 -12
- package/dist/components/Slider.js +0 -6
- package/dist/components/Space.d.ts +0 -11
- package/dist/components/Space.js +0 -6
- package/dist/components/Splitter.d.ts +0 -18
- package/dist/components/Splitter.js +0 -8
- package/dist/components/Spotlight.d.ts +0 -11
- package/dist/components/Spotlight.js +0 -11
- package/dist/components/Statistic.d.ts +0 -8
- package/dist/components/Statistic.js +0 -6
- package/dist/components/Stepper.d.ts +0 -12
- package/dist/components/Stepper.js +0 -6
- package/dist/components/Steps.d.ts +0 -62
- package/dist/components/Steps.js +0 -10
- package/dist/components/StepsItem.d.mts +0 -3
- package/dist/components/StepsItem.d.ts +0 -3
- package/dist/components/StepsItem.js +0 -6
- package/dist/components/StepsItem.mjs +0 -6
- package/dist/components/SubMenu.d.mts +0 -7
- package/dist/components/SubMenu.d.ts +0 -7
- package/dist/components/SubMenu.js +0 -8
- package/dist/components/SubMenu.mjs +0 -8
- package/dist/components/SunburstChart.d.ts +0 -15
- package/dist/components/SunburstChart.js +0 -10
- package/dist/components/Switch.d.ts +0 -12
- package/dist/components/Switch.js +0 -6
- package/dist/components/TabPane.d.mts +0 -3
- package/dist/components/TabPane.d.ts +0 -3
- package/dist/components/TabPane.js +0 -6
- package/dist/components/TabPane.mjs +0 -6
- package/dist/components/Table.d.ts +0 -7
- package/dist/components/Table.js +0 -14
- package/dist/components/Tabs.d.ts +0 -151
- package/dist/components/Tabs.js +0 -10
- package/dist/components/Tag.d.ts +0 -16
- package/dist/components/Tag.js +0 -6
- package/dist/components/TaskBoard.d.ts +0 -13
- package/dist/components/TaskBoard.js +0 -9
- package/dist/components/Text.d.ts +0 -9
- package/dist/components/Text.js +0 -6
- package/dist/components/Textarea.d.ts +0 -13
- package/dist/components/Textarea.js +0 -7
- package/dist/components/TimePicker.d.ts +0 -29
- package/dist/components/TimePicker.js +0 -8
- package/dist/components/Timeline.d.ts +0 -47
- package/dist/components/Timeline.js +0 -6
- package/dist/components/Tooltip.d.ts +0 -15
- package/dist/components/Tooltip.js +0 -8
- package/dist/components/Tour.d.ts +0 -16
- package/dist/components/Tour.js +0 -8
- package/dist/components/Transfer.d.ts +0 -14
- package/dist/components/Transfer.js +0 -7
- package/dist/components/Tree.d.ts +0 -193
- package/dist/components/Tree.js +0 -10
- package/dist/components/TreeMapChart.d.ts +0 -15
- package/dist/components/TreeMapChart.js +0 -10
- package/dist/components/TreeSelect.d.ts +0 -14
- package/dist/components/TreeSelect.js +0 -7
- package/dist/components/Upload.d.ts +0 -16
- package/dist/components/Upload.js +0 -8
- package/dist/components/VirtualList.d.ts +0 -14
- package/dist/components/VirtualList.js +0 -6
- package/dist/components/VirtualTable.d.ts +0 -27
- package/dist/components/VirtualTable.js +0 -9
- package/dist/components/Watermark.d.ts +0 -9
- package/dist/components/Watermark.js +0 -6
- package/dist/index.d.ts +0 -326
- package/dist/index.js +0 -910
- package/dist/types-0oVwMXtR.d.ts +0 -33
- package/dist/types-DaC4a0Ny.d.mts +0 -80
- package/dist/types-DaC4a0Ny.d.ts +0 -80
- /package/dist/{chunk-6QML6T3Y.mjs → chunk-DNOPEJ5I.mjs} +0 -0
- /package/dist/{chunk-WHYHLUXG.mjs → chunk-MEFARVQI.mjs} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useChartInteraction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DNOPEJ5I.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ChartTooltip
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YORCCCQX.mjs";
|
|
7
7
|
import {
|
|
8
8
|
ChartCanvas
|
|
9
9
|
} from "./chunk-DKNVSQSV.mjs";
|
|
@@ -292,7 +292,7 @@ var HeatmapChart = ({
|
|
|
292
292
|
ChartTooltip,
|
|
293
293
|
{
|
|
294
294
|
content: tooltipContent,
|
|
295
|
-
|
|
295
|
+
open: resolvedHoveredIndex !== null && tooltipContent !== "",
|
|
296
296
|
x: tooltipPosition.x,
|
|
297
297
|
y: tooltipPosition.y
|
|
298
298
|
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useControlledState
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MEFARVQI.mjs";
|
|
4
|
+
import {
|
|
5
|
+
useTigerConfig
|
|
6
|
+
} from "./chunk-QAIBQHIO.mjs";
|
|
4
7
|
|
|
5
8
|
// src/components/DatePicker.tsx
|
|
6
9
|
import {
|
|
7
10
|
datePickerInputWrapperClasses,
|
|
8
11
|
datePickerClearButtonClasses,
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
calendarSolidIcon20PathD,
|
|
13
|
+
closeSolidIcon20PathD
|
|
11
14
|
} from "@expcat/tigercat-core";
|
|
12
15
|
|
|
13
16
|
// src/components/DatePicker/state.ts
|
|
@@ -27,14 +30,29 @@ import {
|
|
|
27
30
|
getDatePickerIconButtonClasses,
|
|
28
31
|
getDatePickerLocaleCode,
|
|
29
32
|
getDatePickerLabels,
|
|
30
|
-
getLocaleDirection
|
|
33
|
+
getLocaleDirection,
|
|
34
|
+
mergeTigerLocale
|
|
31
35
|
} from "@expcat/tigercat-core";
|
|
32
36
|
|
|
33
37
|
// src/components/DatePicker/types.ts
|
|
34
38
|
var isRangeDatePicker = (props) => props.range === true;
|
|
35
39
|
|
|
36
40
|
// src/components/DatePicker/state.ts
|
|
41
|
+
function normalizeDatePickerLocale(locale) {
|
|
42
|
+
if (!locale) return void 0;
|
|
43
|
+
if (typeof locale === "string") return { locale };
|
|
44
|
+
if ("datePicker" in locale) return locale;
|
|
45
|
+
const preset = locale;
|
|
46
|
+
return {
|
|
47
|
+
locale: hasDatePickerLocaleCode(preset) ? preset.locale : void 0,
|
|
48
|
+
datePicker: preset
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function hasDatePickerLocaleCode(locale) {
|
|
52
|
+
return typeof locale.locale === "string";
|
|
53
|
+
}
|
|
37
54
|
function useDatePickerState(props) {
|
|
55
|
+
const config = useTigerConfig();
|
|
38
56
|
const {
|
|
39
57
|
size = "md",
|
|
40
58
|
disabled = false,
|
|
@@ -100,7 +118,11 @@ function useDatePickerState(props) {
|
|
|
100
118
|
);
|
|
101
119
|
const minDateParsed = useMemo(() => parseDate(props.minDate ?? null), [props.minDate]);
|
|
102
120
|
const maxDateParsed = useMemo(() => parseDate(props.maxDate ?? null), [props.maxDate]);
|
|
103
|
-
const
|
|
121
|
+
const mergedLocale = useMemo(
|
|
122
|
+
() => mergeTigerLocale(config.locale, normalizeDatePickerLocale(props.locale)),
|
|
123
|
+
[config.locale, props.locale]
|
|
124
|
+
);
|
|
125
|
+
const localeCode = useMemo(() => getDatePickerLocaleCode(mergedLocale), [mergedLocale]);
|
|
104
126
|
const [viewingMonth, setViewingMonth] = useState(
|
|
105
127
|
(selectedDate ?? selectedRange[0])?.getMonth() ?? (/* @__PURE__ */ new Date()).getMonth()
|
|
106
128
|
);
|
|
@@ -140,8 +162,8 @@ function useDatePickerState(props) {
|
|
|
140
162
|
const dayNames = useMemo(() => getShortDayNames(localeCode), [localeCode]);
|
|
141
163
|
const isRtl = getLocaleDirection(localeCode) === "rtl";
|
|
142
164
|
const labels = useMemo(
|
|
143
|
-
() => getDatePickerLabels(
|
|
144
|
-
[
|
|
165
|
+
() => getDatePickerLabels(mergedLocale, props.labels),
|
|
166
|
+
[mergedLocale, props.labels]
|
|
145
167
|
);
|
|
146
168
|
const mobileDate = useMemo(() => {
|
|
147
169
|
if (!isRangeMode) return selectedDate ?? normalizeDate(/* @__PURE__ */ new Date());
|
|
@@ -312,7 +334,10 @@ function useDatePickerState(props) {
|
|
|
312
334
|
}
|
|
313
335
|
const [start, end] = selectedRange;
|
|
314
336
|
if (activeRangePart === "start") {
|
|
315
|
-
const next = [
|
|
337
|
+
const next = [
|
|
338
|
+
normalized,
|
|
339
|
+
end && end < normalized ? normalized : end
|
|
340
|
+
];
|
|
316
341
|
setRangeValue(next);
|
|
317
342
|
setActiveRangePart("end");
|
|
318
343
|
return;
|
|
@@ -544,11 +569,8 @@ function renderDatePickerMobile(ctx) {
|
|
|
544
569
|
|
|
545
570
|
// src/components/DatePicker/render-calendar.tsx
|
|
546
571
|
import {
|
|
547
|
-
formatDate as formatDate2,
|
|
548
572
|
formatMonthYear,
|
|
549
|
-
|
|
550
|
-
isToday as isTodayUtil,
|
|
551
|
-
normalizeDate as normalizeDate2,
|
|
573
|
+
getDatePickerCalendarCellState,
|
|
552
574
|
datePickerCalendarClasses,
|
|
553
575
|
datePickerCalendarHeaderClasses,
|
|
554
576
|
datePickerNavButtonClasses,
|
|
@@ -558,8 +580,8 @@ import {
|
|
|
558
580
|
getDatePickerDayCellClasses,
|
|
559
581
|
datePickerFooterClasses,
|
|
560
582
|
datePickerFooterButtonClasses as datePickerFooterButtonClasses2,
|
|
561
|
-
|
|
562
|
-
|
|
583
|
+
chevronLeftSolidIcon20PathD,
|
|
584
|
+
chevronRightSolidIcon20PathD
|
|
563
585
|
} from "@expcat/tigercat-core";
|
|
564
586
|
|
|
565
587
|
// src/components/DatePicker/icons.tsx
|
|
@@ -597,7 +619,13 @@ function renderDatePickerCalendar(ctx) {
|
|
|
597
619
|
className: datePickerNavButtonClasses,
|
|
598
620
|
onClick: ctx.previousMonth,
|
|
599
621
|
"aria-label": ctx.labels.previousMonth,
|
|
600
|
-
children: /* @__PURE__ */ jsx3(
|
|
622
|
+
children: /* @__PURE__ */ jsx3(
|
|
623
|
+
Icon,
|
|
624
|
+
{
|
|
625
|
+
path: ctx.isRtl ? chevronRightSolidIcon20PathD : chevronLeftSolidIcon20PathD,
|
|
626
|
+
className: "w-5 h-5"
|
|
627
|
+
}
|
|
628
|
+
)
|
|
601
629
|
}
|
|
602
630
|
),
|
|
603
631
|
/* @__PURE__ */ jsx3("div", { className: datePickerMonthYearClasses, children: formatMonthYear(ctx.viewingYear, ctx.viewingMonth, ctx.localeCode) }),
|
|
@@ -608,16 +636,18 @@ function renderDatePickerCalendar(ctx) {
|
|
|
608
636
|
className: datePickerNavButtonClasses,
|
|
609
637
|
onClick: ctx.nextMonth,
|
|
610
638
|
"aria-label": ctx.labels.nextMonth,
|
|
611
|
-
children: /* @__PURE__ */ jsx3(
|
|
639
|
+
children: /* @__PURE__ */ jsx3(
|
|
640
|
+
Icon,
|
|
641
|
+
{
|
|
642
|
+
path: ctx.isRtl ? chevronLeftSolidIcon20PathD : chevronRightSolidIcon20PathD,
|
|
643
|
+
className: "w-5 h-5"
|
|
644
|
+
}
|
|
645
|
+
)
|
|
612
646
|
}
|
|
613
647
|
)
|
|
614
648
|
] }),
|
|
615
649
|
/* @__PURE__ */ jsx3("div", { className: datePickerCalendarGridClasses, role: "row", children: ctx.dayNames.map((day) => /* @__PURE__ */ jsx3("div", { className: datePickerDayNameClasses, role: "columnheader", children: day }, day)) }),
|
|
616
650
|
(() => {
|
|
617
|
-
const [rangeStart, rangeEnd] = ctx.selectedRange;
|
|
618
|
-
const normStart = rangeStart ? normalizeDate2(rangeStart) : null;
|
|
619
|
-
const normEnd = rangeEnd ? normalizeDate2(rangeEnd) : null;
|
|
620
|
-
const isSelectingEnd = ctx.isRangeMode && Boolean(rangeStart) && !rangeEnd;
|
|
621
651
|
return /* @__PURE__ */ jsx3(
|
|
622
652
|
"div",
|
|
623
653
|
{
|
|
@@ -627,38 +657,36 @@ function renderDatePickerCalendar(ctx) {
|
|
|
627
657
|
"aria-colcount": 7,
|
|
628
658
|
children: ctx.calendarDays.map((date, index) => {
|
|
629
659
|
if (!date) return null;
|
|
630
|
-
const
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
const isDisabled = ctx.isDateDisabled(date) || Boolean(isBeforeRangeStart);
|
|
639
|
-
const iso = formatDate2(date, "yyyy-MM-dd");
|
|
660
|
+
const cell = getDatePickerCalendarCellState({
|
|
661
|
+
date,
|
|
662
|
+
selectedDate: ctx.selectedDate,
|
|
663
|
+
selectedRange: ctx.selectedRange,
|
|
664
|
+
isRangeMode: ctx.isRangeMode,
|
|
665
|
+
isCurrentMonth: ctx.isCurrentMonth,
|
|
666
|
+
isDateDisabled: ctx.isDateDisabled
|
|
667
|
+
});
|
|
640
668
|
return /* @__PURE__ */ jsx3(
|
|
641
669
|
"button",
|
|
642
670
|
{
|
|
643
671
|
type: "button",
|
|
644
672
|
className: getDatePickerDayCellClasses(
|
|
645
|
-
isCurrentMonthDay,
|
|
646
|
-
isSelected,
|
|
647
|
-
isTodayDay,
|
|
648
|
-
isDisabled,
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
673
|
+
cell.isCurrentMonthDay,
|
|
674
|
+
cell.isSelected,
|
|
675
|
+
cell.isTodayDay,
|
|
676
|
+
cell.isDisabled,
|
|
677
|
+
cell.isInRange,
|
|
678
|
+
cell.isRangeStart,
|
|
679
|
+
cell.isRangeEnd
|
|
652
680
|
),
|
|
653
|
-
disabled: isDisabled,
|
|
681
|
+
disabled: cell.isDisabled,
|
|
654
682
|
onClick: () => ctx.selectDate(date),
|
|
655
683
|
role: "gridcell",
|
|
656
|
-
"data-date": iso,
|
|
657
|
-
onFocus: () => ctx.setActiveDateIso(iso),
|
|
658
|
-
tabIndex: ctx.activeDateIso === iso && !isDisabled ? 0 : -1,
|
|
659
|
-
"aria-label": iso,
|
|
660
|
-
"aria-selected": isSelected,
|
|
661
|
-
"aria-current": isTodayDay ? "date" : void 0,
|
|
684
|
+
"data-date": cell.iso,
|
|
685
|
+
onFocus: () => ctx.setActiveDateIso(cell.iso),
|
|
686
|
+
tabIndex: ctx.activeDateIso === cell.iso && !cell.isDisabled ? 0 : -1,
|
|
687
|
+
"aria-label": cell.iso,
|
|
688
|
+
"aria-selected": cell.isSelected,
|
|
689
|
+
"aria-current": cell.isTodayDay ? "date" : void 0,
|
|
662
690
|
children: date.getDate()
|
|
663
691
|
},
|
|
664
692
|
index
|
|
@@ -724,7 +752,7 @@ var DatePicker = (props) => {
|
|
|
724
752
|
className: datePickerClearButtonClasses,
|
|
725
753
|
onClick: ctx.clearDate,
|
|
726
754
|
"aria-label": ctx.labels.clearDate,
|
|
727
|
-
children: /* @__PURE__ */ jsx4(Icon, { path:
|
|
755
|
+
children: /* @__PURE__ */ jsx4(Icon, { path: closeSolidIcon20PathD, className: "w-4 h-4" })
|
|
728
756
|
}
|
|
729
757
|
),
|
|
730
758
|
/* @__PURE__ */ jsx4(
|
|
@@ -735,7 +763,7 @@ var DatePicker = (props) => {
|
|
|
735
763
|
disabled: ctx.disabled || ctx.readonly,
|
|
736
764
|
onClick: ctx.toggleCalendar,
|
|
737
765
|
"aria-label": ctx.labels.toggleCalendar,
|
|
738
|
-
children: /* @__PURE__ */ jsx4(Icon, { path:
|
|
766
|
+
children: /* @__PURE__ */ jsx4(Icon, { path: calendarSolidIcon20PathD, className: "w-5 h-5" })
|
|
739
767
|
}
|
|
740
768
|
)
|
|
741
769
|
] }),
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useChartInteraction
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
ChartLegend
|
|
6
|
-
} from "./chunk-UBP7HZSU.mjs";
|
|
3
|
+
} from "./chunk-DNOPEJ5I.mjs";
|
|
7
4
|
import {
|
|
8
5
|
ChartTooltip
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YORCCCQX.mjs";
|
|
10
7
|
import {
|
|
11
8
|
ChartCanvas
|
|
12
9
|
} from "./chunk-DKNVSQSV.mjs";
|
|
10
|
+
import {
|
|
11
|
+
ChartLegend
|
|
12
|
+
} from "./chunk-ZG2W4HS5.mjs";
|
|
13
13
|
|
|
14
14
|
// src/components/SunburstChart.tsx
|
|
15
15
|
import { useId, useMemo } from "react";
|
|
@@ -197,7 +197,7 @@ var SunburstChart = ({
|
|
|
197
197
|
ChartTooltip,
|
|
198
198
|
{
|
|
199
199
|
content: tooltipContent,
|
|
200
|
-
|
|
200
|
+
open: resolvedHoveredIndex !== null && tooltipContent !== "",
|
|
201
201
|
x: tooltipPosition.x,
|
|
202
202
|
y: tooltipPosition.y
|
|
203
203
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useControlledState
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MEFARVQI.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useTigerConfig
|
|
6
6
|
} from "./chunk-QAIBQHIO.mjs";
|
|
@@ -394,7 +394,7 @@ var Upload = ({
|
|
|
394
394
|
const imageUrl = file.url || (file.file ? URL.createObjectURL(file.file) : "");
|
|
395
395
|
return /* @__PURE__ */ jsxs("div", { className: getPictureCardClasses(file.status), children: [
|
|
396
396
|
imageUrl && /* @__PURE__ */ jsx("img", { src: imageUrl, alt: file.name, className: "w-full h-full object-cover" }),
|
|
397
|
-
/* @__PURE__ */ jsxs("div", { className: "absolute inset-0 bg-black
|
|
397
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute inset-0 bg-black/0 hover:bg-black/50 transition-all flex items-center justify-center space-x-2 opacity-0 hover:opacity-100", children: [
|
|
398
398
|
/* @__PURE__ */ jsx(
|
|
399
399
|
"button",
|
|
400
400
|
{
|
|
@@ -456,7 +456,7 @@ var Upload = ({
|
|
|
456
456
|
}
|
|
457
457
|
)
|
|
458
458
|
] }),
|
|
459
|
-
file.status === "uploading" && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-white
|
|
459
|
+
file.status === "uploading" && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-white/75 flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
460
460
|
"svg",
|
|
461
461
|
{
|
|
462
462
|
className: getUploadStatusIconClasses("uploading", "lg", {
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useChartInteraction
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
ChartLegend
|
|
6
|
-
} from "./chunk-UBP7HZSU.mjs";
|
|
7
|
-
import {
|
|
8
|
-
ChartSeries
|
|
9
|
-
} from "./chunk-SDLMB34Y.mjs";
|
|
3
|
+
} from "./chunk-DNOPEJ5I.mjs";
|
|
10
4
|
import {
|
|
11
5
|
ChartTooltip
|
|
12
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YORCCCQX.mjs";
|
|
13
7
|
import {
|
|
14
8
|
ChartAxis
|
|
15
9
|
} from "./chunk-RQSQXQN6.mjs";
|
|
@@ -19,6 +13,12 @@ import {
|
|
|
19
13
|
import {
|
|
20
14
|
ChartGrid
|
|
21
15
|
} from "./chunk-677VSTPW.mjs";
|
|
16
|
+
import {
|
|
17
|
+
ChartLegend
|
|
18
|
+
} from "./chunk-ZG2W4HS5.mjs";
|
|
19
|
+
import {
|
|
20
|
+
ChartSeries
|
|
21
|
+
} from "./chunk-SDLMB34Y.mjs";
|
|
22
22
|
|
|
23
23
|
// src/components/LineChart.tsx
|
|
24
24
|
import { useId, useMemo, useState, useCallback } from "react";
|
|
@@ -49,12 +49,12 @@ var LineChart = ({
|
|
|
49
49
|
series,
|
|
50
50
|
xScale: xScaleProp,
|
|
51
51
|
yScale: yScaleProp,
|
|
52
|
-
lineColor
|
|
52
|
+
lineColor = "var(--tiger-primary,#2563eb)",
|
|
53
53
|
strokeWidth = 2,
|
|
54
54
|
curve = "linear",
|
|
55
55
|
showPoints = true,
|
|
56
56
|
pointSize = 4,
|
|
57
|
-
pointColor
|
|
57
|
+
pointColor,
|
|
58
58
|
showGrid = true,
|
|
59
59
|
showAxis = true,
|
|
60
60
|
showXAxis = true,
|
|
@@ -112,8 +112,13 @@ var LineChart = ({
|
|
|
112
112
|
[width, height, padding]
|
|
113
113
|
);
|
|
114
114
|
const resolvedSeries = useMemo(
|
|
115
|
-
() => resolveSeriesData(series, data
|
|
116
|
-
|
|
115
|
+
() => resolveSeriesData(series, data, {
|
|
116
|
+
// Single-series colors (`lineColor`/`pointColor`) seed the synthesized
|
|
117
|
+
// series so they take effect when only `data` is provided.
|
|
118
|
+
color: lineColor,
|
|
119
|
+
pointColor
|
|
120
|
+
}),
|
|
121
|
+
[series, data, lineColor, pointColor]
|
|
117
122
|
);
|
|
118
123
|
const {
|
|
119
124
|
activeIndex,
|
|
@@ -259,6 +264,16 @@ var LineChart = ({
|
|
|
259
264
|
setHoveredPointInfo(null);
|
|
260
265
|
onPointHover?.(null, null, null);
|
|
261
266
|
}, [onPointHover]);
|
|
267
|
+
const showPointTooltipFromElement = useCallback(
|
|
268
|
+
(el, seriesIndex, pointIndex) => {
|
|
269
|
+
if (!hoverable) return;
|
|
270
|
+
const rect = el.getBoundingClientRect();
|
|
271
|
+
setHoveredPointInfo({ seriesIndex, pointIndex });
|
|
272
|
+
setTooltipPosition({ x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 });
|
|
273
|
+
onPointHover?.(seriesIndex, pointIndex, resolvedSeries[seriesIndex]?.data[pointIndex]);
|
|
274
|
+
},
|
|
275
|
+
[hoverable, onPointHover, resolvedSeries]
|
|
276
|
+
);
|
|
262
277
|
const handlePointClick = useCallback(
|
|
263
278
|
(seriesIndex, pointIndex) => {
|
|
264
279
|
onPointClick?.(seriesIndex, pointIndex, resolvedSeries[seriesIndex]?.data[pointIndex]);
|
|
@@ -275,6 +290,7 @@ var LineChart = ({
|
|
|
275
290
|
},
|
|
276
291
|
[selectable, handleSeriesSelect]
|
|
277
292
|
);
|
|
293
|
+
const pointClickable = selectable || !!onPointClick;
|
|
278
294
|
const chart = /* @__PURE__ */ jsxs(
|
|
279
295
|
ChartCanvas,
|
|
280
296
|
{
|
|
@@ -437,6 +453,8 @@ var LineChart = ({
|
|
|
437
453
|
sd.showPoints && sd.points.map((point) => {
|
|
438
454
|
const isHovered = hoveredPointInfo?.seriesIndex === sd.seriesIndex && hoveredPointInfo?.pointIndex === point.pointIndex;
|
|
439
455
|
const hoverSize = sd.pointSize + 2;
|
|
456
|
+
const datum = resolvedSeries[sd.seriesIndex]?.data?.[point.pointIndex];
|
|
457
|
+
const pointInteractive = hoverable || pointClickable;
|
|
440
458
|
return /* @__PURE__ */ jsx(
|
|
441
459
|
"circle",
|
|
442
460
|
{
|
|
@@ -446,17 +464,46 @@ var LineChart = ({
|
|
|
446
464
|
fill: sd.pointHollow ? "white" : pointGradient ? `url(#${gradientPrefix}-point-${sd.seriesKey})` : sd.pointColor,
|
|
447
465
|
stroke: sd.pointHollow ? sd.pointColor : "none",
|
|
448
466
|
strokeWidth: sd.pointHollow ? 2 : 0,
|
|
449
|
-
className:
|
|
467
|
+
className: classNames(
|
|
468
|
+
linePointTransitionClasses,
|
|
469
|
+
pointInteractive && "cursor-pointer"
|
|
470
|
+
),
|
|
450
471
|
style: isHovered ? { filter: `drop-shadow(0 0 4px ${sd.color})` } : void 0,
|
|
472
|
+
role: pointInteractive ? "button" : "img",
|
|
473
|
+
"aria-label": datum?.label ?? String(datum?.y ?? ""),
|
|
474
|
+
tabIndex: pointInteractive ? 0 : void 0,
|
|
451
475
|
"data-point-index": point.pointIndex,
|
|
452
476
|
"data-series-key": sd.seriesKey,
|
|
453
|
-
onMouseEnter: (e) => handlePointMouseEnter(sd.seriesIndex, point.pointIndex, e),
|
|
454
|
-
onMouseMove: handlePointMouseMove,
|
|
455
|
-
onMouseLeave: handlePointMouseLeave,
|
|
456
|
-
onClick: (e) => {
|
|
477
|
+
onMouseEnter: hoverable ? (e) => handlePointMouseEnter(sd.seriesIndex, point.pointIndex, e) : void 0,
|
|
478
|
+
onMouseMove: hoverable ? handlePointMouseMove : void 0,
|
|
479
|
+
onMouseLeave: hoverable ? handlePointMouseLeave : void 0,
|
|
480
|
+
onClick: pointClickable ? (e) => {
|
|
457
481
|
e.stopPropagation();
|
|
458
482
|
handlePointClick(sd.seriesIndex, point.pointIndex);
|
|
459
|
-
}
|
|
483
|
+
} : void 0,
|
|
484
|
+
onFocus: hoverable ? (e) => showPointTooltipFromElement(
|
|
485
|
+
e.currentTarget,
|
|
486
|
+
sd.seriesIndex,
|
|
487
|
+
point.pointIndex
|
|
488
|
+
) : void 0,
|
|
489
|
+
onBlur: hoverable ? handlePointMouseLeave : void 0,
|
|
490
|
+
onKeyDown: pointInteractive ? (e) => {
|
|
491
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
492
|
+
e.preventDefault();
|
|
493
|
+
e.stopPropagation();
|
|
494
|
+
if (pointClickable) {
|
|
495
|
+
handlePointClick(sd.seriesIndex, point.pointIndex);
|
|
496
|
+
} else {
|
|
497
|
+
showPointTooltipFromElement(
|
|
498
|
+
e.currentTarget,
|
|
499
|
+
sd.seriesIndex,
|
|
500
|
+
point.pointIndex
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
} else if (e.key === "Escape" && hoverable) {
|
|
504
|
+
handlePointMouseLeave();
|
|
505
|
+
}
|
|
506
|
+
} : void 0
|
|
460
507
|
},
|
|
461
508
|
`point-${sd.seriesKey}-${point.pointIndex}`
|
|
462
509
|
);
|
|
@@ -472,7 +519,7 @@ var LineChart = ({
|
|
|
472
519
|
ChartTooltip,
|
|
473
520
|
{
|
|
474
521
|
content: tooltipContent,
|
|
475
|
-
|
|
522
|
+
open: hoveredPointInfo !== null && tooltipContent !== "",
|
|
476
523
|
x: tooltipPosition.x,
|
|
477
524
|
y: tooltipPosition.y
|
|
478
525
|
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// src/hooks/useFormController.ts
|
|
2
|
+
import { useState, useCallback, useMemo, useRef } from "react";
|
|
3
|
+
import {
|
|
4
|
+
validateForm,
|
|
5
|
+
validateField as validateFieldUtil,
|
|
6
|
+
getValueByPath,
|
|
7
|
+
createFormErrorMap,
|
|
8
|
+
clearFieldErrors,
|
|
9
|
+
createFormHistory,
|
|
10
|
+
pushFormHistory,
|
|
11
|
+
undoFormHistory,
|
|
12
|
+
redoFormHistory,
|
|
13
|
+
canUndo as canUndoFn,
|
|
14
|
+
canRedo as canRedoFn
|
|
15
|
+
} from "@expcat/tigercat-core";
|
|
16
|
+
function useFormController(options = {}) {
|
|
17
|
+
const { initialValues = {}, rules, undoable = false, maxHistorySize = 50 } = options;
|
|
18
|
+
const [values, setValues] = useState(() => ({ ...initialValues }));
|
|
19
|
+
const [errors, setErrors] = useState([]);
|
|
20
|
+
const valuesRef = useRef(values);
|
|
21
|
+
valuesRef.current = values;
|
|
22
|
+
const rulesRef = useRef(rules);
|
|
23
|
+
rulesRef.current = rules;
|
|
24
|
+
const initialRef = useRef(initialValues);
|
|
25
|
+
const [history, setHistory] = useState(
|
|
26
|
+
() => undoable ? createFormHistory(initialValues, maxHistorySize) : null
|
|
27
|
+
);
|
|
28
|
+
const errorsByField = useMemo(() => createFormErrorMap(errors), [errors]);
|
|
29
|
+
const hasErrors = errors.length > 0;
|
|
30
|
+
const setFieldValue = useCallback(
|
|
31
|
+
(fieldName, value) => {
|
|
32
|
+
setValues((prev) => {
|
|
33
|
+
const next = { ...prev, [fieldName]: value };
|
|
34
|
+
valuesRef.current = next;
|
|
35
|
+
return next;
|
|
36
|
+
});
|
|
37
|
+
if (undoable) {
|
|
38
|
+
setHistory(
|
|
39
|
+
(h) => h ? pushFormHistory(h, { ...valuesRef.current, [fieldName]: value }) : h
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
[undoable]
|
|
44
|
+
);
|
|
45
|
+
const setBulkValues = useCallback(
|
|
46
|
+
(partial) => {
|
|
47
|
+
setValues((prev) => {
|
|
48
|
+
const next = { ...prev, ...partial };
|
|
49
|
+
valuesRef.current = next;
|
|
50
|
+
return next;
|
|
51
|
+
});
|
|
52
|
+
if (undoable) {
|
|
53
|
+
setHistory((h) => h ? pushFormHistory(h, { ...valuesRef.current, ...partial }) : h);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
[undoable]
|
|
57
|
+
);
|
|
58
|
+
const getFieldValue = useCallback(
|
|
59
|
+
(fieldName) => getValueByPath(valuesRef.current, fieldName),
|
|
60
|
+
[]
|
|
61
|
+
);
|
|
62
|
+
const validate = useCallback(async () => {
|
|
63
|
+
const r = rulesRef.current;
|
|
64
|
+
if (!r) {
|
|
65
|
+
setErrors([]);
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
const result = await validateForm(valuesRef.current, r);
|
|
69
|
+
setErrors(result.errors);
|
|
70
|
+
return result.valid;
|
|
71
|
+
}, []);
|
|
72
|
+
const validateFields = useCallback(async (fieldNames) => {
|
|
73
|
+
const r = rulesRef.current;
|
|
74
|
+
if (!r || fieldNames.length === 0) return true;
|
|
75
|
+
const nextErrors = [];
|
|
76
|
+
for (const name of fieldNames) {
|
|
77
|
+
const fieldRules = r[name];
|
|
78
|
+
if (!fieldRules) continue;
|
|
79
|
+
const error = await validateFieldUtil(
|
|
80
|
+
name,
|
|
81
|
+
getValueByPath(valuesRef.current, name),
|
|
82
|
+
fieldRules,
|
|
83
|
+
valuesRef.current
|
|
84
|
+
);
|
|
85
|
+
if (error) nextErrors.push({ field: name, message: error });
|
|
86
|
+
}
|
|
87
|
+
const fieldSet = new Set(fieldNames);
|
|
88
|
+
setErrors((prev) => [...prev.filter((e) => !fieldSet.has(e.field)), ...nextErrors]);
|
|
89
|
+
return nextErrors.length === 0;
|
|
90
|
+
}, []);
|
|
91
|
+
const validateField = useCallback(async (fieldName) => {
|
|
92
|
+
const r = rulesRef.current;
|
|
93
|
+
const fieldRules = r?.[fieldName];
|
|
94
|
+
if (!fieldRules) return null;
|
|
95
|
+
const error = await validateFieldUtil(
|
|
96
|
+
fieldName,
|
|
97
|
+
getValueByPath(valuesRef.current, fieldName),
|
|
98
|
+
fieldRules,
|
|
99
|
+
valuesRef.current
|
|
100
|
+
);
|
|
101
|
+
setErrors((prev) => {
|
|
102
|
+
const filtered = prev.filter((e) => e.field !== fieldName);
|
|
103
|
+
return error ? [...filtered, { field: fieldName, message: error }] : filtered;
|
|
104
|
+
});
|
|
105
|
+
return error;
|
|
106
|
+
}, []);
|
|
107
|
+
const clearValidate = useCallback((fieldNames) => {
|
|
108
|
+
if (!fieldNames) {
|
|
109
|
+
setErrors([]);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const fields = Array.isArray(fieldNames) ? fieldNames : [fieldNames];
|
|
113
|
+
setErrors((prev) => clearFieldErrors(fields, prev));
|
|
114
|
+
}, []);
|
|
115
|
+
const reset = useCallback(() => {
|
|
116
|
+
const init = { ...initialRef.current };
|
|
117
|
+
setValues(init);
|
|
118
|
+
valuesRef.current = init;
|
|
119
|
+
setErrors([]);
|
|
120
|
+
if (undoable) {
|
|
121
|
+
setHistory(createFormHistory(init, maxHistorySize));
|
|
122
|
+
}
|
|
123
|
+
}, [undoable, maxHistorySize]);
|
|
124
|
+
const undo = useCallback(() => {
|
|
125
|
+
if (!undoable) return;
|
|
126
|
+
setHistory((h) => {
|
|
127
|
+
if (!h) return h;
|
|
128
|
+
const next = undoFormHistory(h);
|
|
129
|
+
if (!next) return h;
|
|
130
|
+
setValues(next.present);
|
|
131
|
+
valuesRef.current = next.present;
|
|
132
|
+
return next;
|
|
133
|
+
});
|
|
134
|
+
}, [undoable]);
|
|
135
|
+
const redo = useCallback(() => {
|
|
136
|
+
if (!undoable) return;
|
|
137
|
+
setHistory((h) => {
|
|
138
|
+
if (!h) return h;
|
|
139
|
+
const next = redoFormHistory(h);
|
|
140
|
+
if (!next) return h;
|
|
141
|
+
setValues(next.present);
|
|
142
|
+
valuesRef.current = next.present;
|
|
143
|
+
return next;
|
|
144
|
+
});
|
|
145
|
+
}, [undoable]);
|
|
146
|
+
return {
|
|
147
|
+
values,
|
|
148
|
+
errors,
|
|
149
|
+
errorsByField,
|
|
150
|
+
hasErrors,
|
|
151
|
+
setFieldValue,
|
|
152
|
+
setValues: setBulkValues,
|
|
153
|
+
getFieldValue,
|
|
154
|
+
validate,
|
|
155
|
+
validateFields,
|
|
156
|
+
validateField,
|
|
157
|
+
clearValidate,
|
|
158
|
+
reset,
|
|
159
|
+
undo,
|
|
160
|
+
redo,
|
|
161
|
+
get canUndo() {
|
|
162
|
+
return undoable && history != null && canUndoFn(history);
|
|
163
|
+
},
|
|
164
|
+
get canRedo() {
|
|
165
|
+
return undoable && history != null && canRedoFn(history);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export {
|
|
171
|
+
useFormController
|
|
172
|
+
};
|