@oceanbase/ui 1.0.0-alpha.2 → 1.0.0-alpha.20
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/static/Inter-Medium.ea234620.woff2 +0 -0
- package/dist/static/Inter-Regular.34ba43c9.woff2 +0 -0
- package/dist/static/Inter-SemiBold.95439fb4.woff2 +0 -0
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +1 -1
- package/es/Action/Group.d.ts +1 -2
- package/es/Action/Group.js +340 -62
- package/es/Action/Item.d.ts +6 -15
- package/es/Action/Item.js +86 -128
- package/es/Action/index.d.ts +6 -3
- package/es/Action/index.js +1 -0
- package/es/Action/style/index.d.ts +2 -2
- package/es/Action/style/index.js +8 -4
- package/es/BackgroundTaskManager/RefreshMan.js +1 -0
- package/es/BackgroundTaskManager/index.d.ts +2 -0
- package/es/BackgroundTaskManager/index.js +26 -4
- package/es/BasicLayout/Header.js +1 -0
- package/es/BasicLayout/index.d.ts +3 -1
- package/es/BasicLayout/index.js +63 -24
- package/es/BasicLayout/locale/en-US.d.ts +3 -0
- package/es/BasicLayout/locale/en-US.js +4 -1
- package/es/BasicLayout/locale/ja-JP.d.ts +16 -0
- package/es/BasicLayout/locale/ja-JP.js +15 -0
- package/es/BasicLayout/locale/zh-CN.d.ts +3 -0
- package/es/BasicLayout/locale/zh-CN.js +4 -1
- package/es/BasicLayout/locale/zh-TW.d.ts +3 -0
- package/es/BasicLayout/locale/zh-TW.js +4 -1
- package/es/BasicLayout/style/index.js +45 -25
- package/es/BatchOperationBar/index.d.ts +0 -1
- package/es/BatchOperationBar/index.js +33 -17
- package/es/BatchOperationBar/locale/en-US.d.ts +1 -0
- package/es/BatchOperationBar/locale/en-US.js +2 -1
- package/es/BatchOperationBar/locale/ja-JP.d.ts +8 -0
- package/es/BatchOperationBar/locale/ja-JP.js +7 -0
- package/es/BatchOperationBar/locale/zh-CN.d.ts +1 -0
- package/es/BatchOperationBar/locale/zh-CN.js +2 -1
- package/es/BatchOperationBar/locale/zh-TW.d.ts +1 -0
- package/es/BatchOperationBar/locale/zh-TW.js +2 -1
- package/es/BatchOperationBar/style/index.d.ts +10 -0
- package/es/BatchOperationBar/style/index.js +56 -0
- package/es/Boundary/Components/Code.js +13 -6
- package/es/Boundary/Components/Exception.js +86 -74
- package/es/Boundary/Components/Function.js +13 -6
- package/es/Boundary/index.d.ts +0 -1
- package/es/Boundary/index.js +1 -1
- package/es/Boundary/locale/en-US.js +1 -1
- package/es/Boundary/locale/ja-JP.d.ts +11 -0
- package/es/Boundary/locale/ja-JP.js +10 -0
- package/es/Boundary/locale/zh-CN.js +1 -1
- package/es/Boundary/locale/zh-TW.js +1 -1
- package/es/Boundary/style/index.d.ts +10 -0
- package/es/Boundary/style/index.js +48 -0
- package/es/ContentWithIcon/index.d.ts +0 -1
- package/es/ContentWithIcon/index.js +30 -29
- package/es/ContentWithIcon/style/index.d.ts +10 -0
- package/es/ContentWithIcon/style/index.js +26 -0
- package/es/ContentWithQuestion/index.js +1 -0
- package/es/DateRanger/EditableDateTimeInput.d.ts +23 -0
- package/es/DateRanger/EditableDateTimeInput.js +129 -0
- package/es/DateRanger/PickerPanel.js +37 -20
- package/es/DateRanger/Ranger.d.ts +4 -2
- package/es/DateRanger/Ranger.js +71 -49
- package/es/DateRanger/hooks/index.d.ts +4 -0
- package/es/DateRanger/hooks/index.js +2 -0
- package/es/DateRanger/hooks/useAutoWidthInput.d.ts +13 -0
- package/es/DateRanger/hooks/useAutoWidthInput.js +44 -0
- package/es/DateRanger/hooks/useSegmentedInput.d.ts +31 -0
- package/es/DateRanger/hooks/useSegmentedInput.js +304 -0
- package/es/DateRanger/index.js +1 -0
- package/es/DateRanger/locale/en-US.d.ts +2 -0
- package/es/DateRanger/locale/en-US.js +3 -1
- package/es/DateRanger/locale/ja-JP.d.ts +58 -0
- package/es/DateRanger/locale/ja-JP.js +22 -0
- package/es/DateRanger/locale/zh-CN.d.ts +2 -0
- package/es/DateRanger/locale/zh-CN.js +3 -1
- package/es/DateRanger/locale/zh-TW.d.ts +2 -0
- package/es/DateRanger/locale/zh-TW.js +3 -1
- package/es/DateRanger/style/index.d.ts +10 -0
- package/es/DateRanger/style/index.js +164 -0
- package/es/Dialog/Anchor.d.ts +2 -10
- package/es/Dialog/Anchor.js +68 -96
- package/es/Dialog/EventProxy.js +1 -0
- package/es/Dialog/index.d.ts +5 -1
- package/es/Dialog/index.js +599 -576
- package/es/Dialog/locale/en-US.d.ts +5 -0
- package/es/Dialog/locale/en-US.js +6 -1
- package/es/Dialog/locale/ja-JP.d.ts +10 -0
- package/es/Dialog/locale/ja-JP.js +9 -0
- package/es/Dialog/locale/zh-CN.d.ts +5 -0
- package/es/Dialog/locale/zh-CN.js +6 -1
- package/es/Dialog/locale/zh-TW.d.ts +5 -0
- package/es/Dialog/locale/zh-TW.js +6 -1
- package/es/Dialog/style/index.d.ts +10 -0
- package/es/Dialog/style/index.js +116 -0
- package/es/DocDialog/index.js +29 -9
- package/es/DocDialog/locale/en-US.d.ts +3 -1
- package/es/DocDialog/locale/en-US.js +3 -1
- package/es/DocDialog/locale/ja-JP.d.ts +4 -0
- package/es/DocDialog/locale/ja-JP.js +3 -0
- package/es/DocDialog/locale/zh-CN.d.ts +3 -1
- package/es/DocDialog/locale/zh-CN.js +3 -1
- package/es/DocDialog/locale/zh-TW.d.ts +3 -1
- package/es/DocDialog/locale/zh-TW.js +3 -1
- package/es/FooterToolbar/index.d.ts +7 -4
- package/es/FooterToolbar/index.js +28 -11
- package/es/FooterToolbar/locale/en-US.d.ts +4 -0
- package/es/FooterToolbar/locale/en-US.js +3 -0
- package/es/FooterToolbar/locale/ja-JP.d.ts +4 -0
- package/es/FooterToolbar/locale/ja-JP.js +3 -0
- package/es/FooterToolbar/locale/zh-CN.d.ts +4 -0
- package/es/FooterToolbar/locale/zh-CN.js +3 -0
- package/es/FooterToolbar/locale/zh-TW.d.ts +4 -0
- package/es/FooterToolbar/locale/zh-TW.js +3 -0
- package/es/FooterToolbar/style/index.d.ts +0 -2
- package/es/FooterToolbar/style/index.js +10 -19
- package/es/FullscreenBox/index.d.ts +0 -1
- package/es/FullscreenBox/index.js +62 -44
- package/es/FullscreenBox/locale/en-US.d.ts +4 -1
- package/es/FullscreenBox/locale/en-US.js +4 -1
- package/es/FullscreenBox/locale/ja-JP.d.ts +5 -0
- package/es/FullscreenBox/locale/ja-JP.js +4 -0
- package/es/FullscreenBox/locale/zh-CN.d.ts +4 -1
- package/es/FullscreenBox/locale/zh-CN.js +4 -1
- package/es/FullscreenBox/locale/zh-TW.d.ts +4 -1
- package/es/FullscreenBox/locale/zh-TW.js +4 -1
- package/es/FullscreenBox/style/index.d.ts +10 -0
- package/es/FullscreenBox/style/index.js +74 -0
- package/es/Highlight/DiffView/DiffCells.js +1 -0
- package/es/Highlight/DiffView/index.d.ts +0 -1
- package/es/Highlight/DiffView/index.js +6 -5
- package/es/Highlight/HighlightCell.js +1 -0
- package/es/Highlight/JsonView.d.ts +0 -1
- package/es/Highlight/JsonView.js +6 -5
- package/es/Highlight/index.d.ts +1 -2
- package/es/Highlight/index.js +33 -25
- package/es/Highlight/locale/en-US.d.ts +2 -0
- package/es/Highlight/locale/en-US.js +3 -1
- package/es/Highlight/locale/ja-JP.d.ts +6 -0
- package/es/Highlight/locale/ja-JP.js +5 -0
- package/es/Highlight/locale/zh-CN.d.ts +2 -0
- package/es/Highlight/locale/zh-CN.js +3 -1
- package/es/Highlight/locale/zh-TW.d.ts +2 -0
- package/es/Highlight/locale/zh-TW.js +3 -1
- package/es/Highlight/style/index.d.ts +10 -0
- package/es/Highlight/style/index.js +213 -0
- package/es/Highlight/useKeyDownCopyEvent.js +1 -0
- package/es/IconFont/index.js +1 -0
- package/es/LightFilter/index.d.ts +6 -2
- package/es/LightFilter/index.js +25 -8
- package/es/LightFilter/locale/en-US.d.ts +4 -0
- package/es/LightFilter/locale/en-US.js +3 -0
- package/es/LightFilter/locale/ja-JP.d.ts +4 -0
- package/es/LightFilter/locale/ja-JP.js +3 -0
- package/es/LightFilter/locale/zh-CN.d.ts +4 -0
- package/es/LightFilter/locale/zh-CN.js +3 -0
- package/es/LightFilter/locale/zh-TW.d.ts +4 -0
- package/es/LightFilter/locale/zh-TW.js +3 -0
- package/es/LocaleDropdown/index.js +5 -2
- package/es/Login/ActivateForm.d.ts +0 -1
- package/es/Login/ActivateForm.js +13 -9
- package/es/Login/LoginForm.d.ts +0 -1
- package/es/Login/LoginForm.js +21 -15
- package/es/Login/RegisterForm.d.ts +0 -1
- package/es/Login/RegisterForm.js +15 -11
- package/es/Login/index.d.ts +0 -1
- package/es/Login/index.js +25 -22
- package/es/Login/locale/ja-JP.d.ts +28 -0
- package/es/Login/locale/ja-JP.js +27 -0
- package/es/Login/locale/zh-CN.js +2 -2
- package/es/Login/style/index.d.ts +10 -0
- package/es/Login/style/index.js +182 -0
- package/es/Lottie/index.js +1 -0
- package/es/NavMenu/index.d.ts +5 -3
- package/es/NavMenu/index.js +39 -13
- package/es/NavMenu/locale/en-US.d.ts +4 -0
- package/es/NavMenu/locale/en-US.js +3 -0
- package/es/NavMenu/locale/ja-JP.d.ts +4 -0
- package/es/NavMenu/locale/ja-JP.js +3 -0
- package/es/NavMenu/locale/zh-CN.d.ts +4 -0
- package/es/NavMenu/locale/zh-CN.js +3 -0
- package/es/NavMenu/locale/zh-TW.d.ts +4 -0
- package/es/NavMenu/locale/zh-TW.js +3 -0
- package/es/NavMenu/style/index.d.ts +10 -0
- package/es/NavMenu/style/index.js +47 -0
- package/es/PageContainer/ItemRender.js +1 -0
- package/es/PageContainer/index.d.ts +2 -0
- package/es/PageContainer/index.js +124 -30
- package/es/PageContainer/locale/en-US.d.ts +1 -0
- package/es/PageContainer/locale/en-US.js +2 -1
- package/es/PageContainer/locale/ja-JP.d.ts +5 -0
- package/es/PageContainer/locale/ja-JP.js +4 -0
- package/es/PageContainer/locale/zh-CN.d.ts +1 -0
- package/es/PageContainer/locale/zh-CN.js +2 -1
- package/es/PageContainer/locale/zh-TW.d.ts +1 -0
- package/es/PageContainer/locale/zh-TW.js +2 -1
- package/es/PageContainer/style/index.js +42 -13
- package/es/PageLoading/index.js +1 -0
- package/es/Password/Content.d.ts +2 -0
- package/es/Password/Content.js +12 -3
- package/es/Password/index.d.ts +1 -0
- package/es/Password/index.js +19 -14
- package/es/Password/locale/en-US.d.ts +1 -0
- package/es/Password/locale/en-US.js +2 -1
- package/es/Password/locale/ja-JP.d.ts +14 -0
- package/es/Password/locale/ja-JP.js +13 -0
- package/es/Password/locale/zh-CN.d.ts +1 -0
- package/es/Password/locale/zh-CN.js +1 -0
- package/es/Password/locale/zh-TW.d.ts +1 -0
- package/es/Password/locale/zh-TW.js +2 -1
- package/es/ProCard/index.js +1 -0
- package/es/ProCard/style/index.d.ts +2 -2
- package/es/ProCard/style/index.js +12 -6
- package/es/ProTable/index.js +10 -2
- package/es/ProTable/style/index.d.ts +2 -2
- package/es/ProTable/style/index.js +10 -5
- package/es/Ranger/QuickPicker.js +9 -4
- package/es/Ranger/Ranger.d.ts +0 -1
- package/es/Ranger/Ranger.js +13 -9
- package/es/Ranger/index.js +1 -0
- package/es/Ranger/locale/ja-JP.d.ts +28 -0
- package/es/Ranger/locale/ja-JP.js +29 -0
- package/es/Ranger/style/index.d.ts +10 -0
- package/es/Ranger/style/index.js +44 -0
- package/es/SideTip/Dragger.js +3 -1
- package/es/SideTip/IconLoading.js +1 -0
- package/es/SideTip/index.d.ts +0 -1
- package/es/SideTip/index.js +62 -29
- package/es/SideTip/locale/en-US.d.ts +4 -1
- package/es/SideTip/locale/en-US.js +4 -1
- package/es/SideTip/locale/ja-JP.d.ts +5 -0
- package/es/SideTip/locale/ja-JP.js +4 -0
- package/es/SideTip/locale/zh-CN.d.ts +4 -1
- package/es/SideTip/locale/zh-CN.js +4 -1
- package/es/SideTip/locale/zh-TW.d.ts +4 -1
- package/es/SideTip/locale/zh-TW.js +4 -1
- package/es/SideTip/style/index.d.ts +10 -0
- package/es/SideTip/style/index.js +171 -0
- package/es/TagSelect/Group.d.ts +6 -6
- package/es/TagSelect/Group.js +11 -4
- package/es/TagSelect/Item.js +8 -4
- package/es/TagSelect/index.js +1 -0
- package/es/TreeSearch/index.js +1 -0
- package/es/Welcome/index.d.ts +0 -1
- package/es/Welcome/index.js +31 -26
- package/es/Welcome/locale/ja-JP.d.ts +5 -0
- package/es/Welcome/locale/ja-JP.js +4 -0
- package/es/Welcome/step/style/index.d.ts +10 -0
- package/es/Welcome/step/style/index.js +44 -0
- package/es/Welcome/step.d.ts +0 -1
- package/es/Welcome/step.js +18 -14
- package/es/Welcome/style/index.d.ts +10 -0
- package/es/Welcome/style/index.js +141 -0
- package/es/_util/genComponentStyleHook.d.ts +4 -3
- package/es/_util/genComponentStyleHook.js +1 -1
- package/es/_util/index.js +6 -0
- package/es/assets/logo/oceanbase_logo.svg +45 -29
- package/es/assets/logo/oceanbase_logo_dark.svg +45 -29
- package/es/assets/logo/oceanbase_watermark.svg +45 -31
- package/es/constant/index.js +1 -0
- package/es/index.d.ts +0 -5
- package/es/index.js +1 -3
- package/es/locale/LocaleWrapper.js +1 -0
- package/es/locale/en-US.js +6 -4
- package/es/locale/index.js +1 -0
- package/es/locale/ja-JP.d.ts +3 -0
- package/es/locale/ja-JP.js +44 -0
- package/es/locale/zh-CN.js +6 -4
- package/es/locale/zh-TW.js +6 -4
- package/lib/Action/Group.d.ts +1 -2
- package/lib/Action/Group.js +354 -121
- package/lib/Action/Item.d.ts +6 -15
- package/lib/Action/Item.js +81 -110
- package/lib/Action/index.d.ts +6 -3
- package/lib/Action/index.js +13 -36
- package/lib/Action/style/index.d.ts +2 -2
- package/lib/Action/style/index.js +38 -41
- package/lib/BackgroundTaskManager/RefreshMan.js +34 -60
- package/lib/BackgroundTaskManager/constants.js +10 -32
- package/lib/BackgroundTaskManager/index.d.ts +2 -0
- package/lib/BackgroundTaskManager/index.js +137 -135
- package/lib/BasicLayout/Header.js +238 -138
- package/lib/BasicLayout/index.d.ts +3 -1
- package/lib/BasicLayout/index.js +306 -292
- package/lib/BasicLayout/locale/en-US.d.ts +3 -0
- package/lib/BasicLayout/locale/en-US.js +19 -34
- package/lib/BasicLayout/locale/ja-JP.d.ts +16 -0
- package/lib/BasicLayout/locale/ja-JP.js +21 -0
- package/lib/BasicLayout/locale/zh-CN.d.ts +3 -0
- package/lib/BasicLayout/locale/zh-CN.js +19 -34
- package/lib/BasicLayout/locale/zh-TW.d.ts +3 -0
- package/lib/BasicLayout/locale/zh-TW.js +19 -34
- package/lib/BasicLayout/style/Header.js +41 -60
- package/lib/BasicLayout/style/index.js +201 -204
- package/lib/BatchOperationBar/index.d.ts +0 -1
- package/lib/BatchOperationBar/index.js +119 -132
- package/lib/BatchOperationBar/locale/en-US.d.ts +1 -0
- package/lib/BatchOperationBar/locale/en-US.js +11 -28
- package/lib/BatchOperationBar/locale/ja-JP.d.ts +8 -0
- package/lib/BatchOperationBar/locale/ja-JP.js +13 -0
- package/lib/BatchOperationBar/locale/zh-CN.d.ts +1 -0
- package/lib/BatchOperationBar/locale/zh-CN.js +11 -28
- package/lib/BatchOperationBar/locale/zh-TW.d.ts +1 -0
- package/lib/BatchOperationBar/locale/zh-TW.js +11 -28
- package/lib/BatchOperationBar/style/index.d.ts +10 -0
- package/lib/BatchOperationBar/style/index.js +71 -0
- package/lib/Boundary/Components/Code.js +57 -64
- package/lib/Boundary/Components/Exception.js +117 -117
- package/lib/Boundary/Components/Function.js +47 -51
- package/lib/Boundary/Components/index.js +36 -25
- package/lib/Boundary/IBoundary.js +4 -16
- package/lib/Boundary/constant.js +16 -38
- package/lib/Boundary/index.d.ts +0 -1
- package/lib/Boundary/index.js +11 -26
- package/lib/Boundary/locale/en-US.js +14 -32
- package/lib/Boundary/locale/ja-JP.d.ts +11 -0
- package/lib/Boundary/locale/ja-JP.js +16 -0
- package/lib/Boundary/locale/zh-CN.js +14 -32
- package/lib/Boundary/locale/zh-TW.js +14 -32
- package/lib/Boundary/style/index.d.ts +10 -0
- package/lib/Boundary/style/index.js +57 -0
- package/lib/Boundary/utils.js +9 -31
- package/lib/ContentWithIcon/index.d.ts +0 -1
- package/lib/ContentWithIcon/index.js +99 -102
- package/lib/ContentWithIcon/style/index.d.ts +10 -0
- package/lib/ContentWithIcon/style/index.js +38 -0
- package/lib/ContentWithQuestion/index.js +40 -48
- package/lib/ContentWithQuestion/style/index.js +16 -35
- package/lib/DateRanger/EditableDateTimeInput.d.ts +23 -0
- package/lib/DateRanger/EditableDateTimeInput.js +131 -0
- package/lib/DateRanger/PickerPanel.js +341 -294
- package/lib/DateRanger/Ranger.d.ts +4 -2
- package/lib/DateRanger/Ranger.js +376 -405
- package/lib/DateRanger/constant/index.js +188 -376
- package/lib/DateRanger/hooks/index.d.ts +4 -0
- package/lib/DateRanger/hooks/index.js +19 -0
- package/lib/DateRanger/hooks/useAutoWidthInput.d.ts +13 -0
- package/lib/DateRanger/hooks/useAutoWidthInput.js +37 -0
- package/lib/DateRanger/hooks/useSegmentedInput.d.ts +31 -0
- package/lib/DateRanger/hooks/useSegmentedInput.js +233 -0
- package/lib/DateRanger/index.js +45 -65
- package/lib/DateRanger/locale/en-US.d.ts +2 -0
- package/lib/DateRanger/locale/en-US.js +22 -47
- package/lib/DateRanger/locale/ja-JP.d.ts +58 -0
- package/lib/DateRanger/locale/ja-JP.js +24 -0
- package/lib/DateRanger/locale/zh-CN.d.ts +2 -0
- package/lib/DateRanger/locale/zh-CN.js +22 -47
- package/lib/DateRanger/locale/zh-TW.d.ts +2 -0
- package/lib/DateRanger/locale/zh-TW.js +22 -47
- package/lib/DateRanger/style/index.d.ts +10 -0
- package/lib/DateRanger/style/index.js +224 -0
- package/lib/DateRanger/typing.js +4 -16
- package/lib/Dialog/Anchor.d.ts +2 -10
- package/lib/Dialog/Anchor.js +80 -105
- package/lib/Dialog/Dock.js +14 -36
- package/lib/Dialog/EventProxy.js +21 -49
- package/lib/Dialog/index.d.ts +5 -1
- package/lib/Dialog/index.js +581 -519
- package/lib/Dialog/locale/en-US.d.ts +5 -0
- package/lib/Dialog/locale/en-US.js +13 -26
- package/lib/Dialog/locale/ja-JP.d.ts +10 -0
- package/lib/Dialog/locale/ja-JP.js +15 -0
- package/lib/Dialog/locale/zh-CN.d.ts +5 -0
- package/lib/Dialog/locale/zh-CN.js +13 -26
- package/lib/Dialog/locale/zh-TW.d.ts +5 -0
- package/lib/Dialog/locale/zh-TW.js +13 -26
- package/lib/Dialog/style/index.d.ts +10 -0
- package/lib/Dialog/style/index.js +137 -0
- package/lib/DocDialog/index.js +69 -81
- package/lib/DocDialog/locale/en-US.d.ts +3 -1
- package/lib/DocDialog/locale/en-US.js +7 -23
- package/lib/DocDialog/locale/ja-JP.d.ts +4 -0
- package/lib/DocDialog/locale/ja-JP.js +9 -0
- package/lib/DocDialog/locale/zh-CN.d.ts +3 -1
- package/lib/DocDialog/locale/zh-CN.js +7 -23
- package/lib/DocDialog/locale/zh-TW.d.ts +3 -1
- package/lib/DocDialog/locale/zh-TW.js +7 -23
- package/lib/FooterToolbar/index.d.ts +7 -4
- package/lib/FooterToolbar/index.js +48 -50
- package/lib/FooterToolbar/locale/en-US.d.ts +4 -0
- package/lib/FooterToolbar/locale/en-US.js +9 -0
- package/lib/FooterToolbar/locale/ja-JP.d.ts +4 -0
- package/lib/FooterToolbar/locale/ja-JP.js +9 -0
- package/lib/FooterToolbar/locale/zh-CN.d.ts +4 -0
- package/lib/FooterToolbar/locale/zh-CN.js +9 -0
- package/lib/FooterToolbar/locale/zh-TW.d.ts +4 -0
- package/lib/FooterToolbar/locale/zh-TW.js +9 -0
- package/lib/FooterToolbar/style/index.d.ts +0 -2
- package/lib/FooterToolbar/style/index.js +25 -54
- package/lib/FullscreenBox/index.d.ts +0 -1
- package/lib/FullscreenBox/index.js +159 -121
- package/lib/FullscreenBox/locale/en-US.d.ts +4 -1
- package/lib/FullscreenBox/locale/en-US.js +8 -23
- package/lib/FullscreenBox/locale/ja-JP.d.ts +5 -0
- package/lib/FullscreenBox/locale/ja-JP.js +10 -0
- package/lib/FullscreenBox/locale/zh-CN.d.ts +4 -1
- package/lib/FullscreenBox/locale/zh-CN.js +8 -23
- package/lib/FullscreenBox/locale/zh-TW.d.ts +4 -1
- package/lib/FullscreenBox/locale/zh-TW.js +8 -23
- package/lib/FullscreenBox/style/index.d.ts +10 -0
- package/lib/FullscreenBox/style/index.js +90 -0
- package/lib/Highlight/DiffView/DiffCells.js +35 -49
- package/lib/Highlight/DiffView/index.d.ts +0 -1
- package/lib/Highlight/DiffView/index.js +154 -149
- package/lib/Highlight/HighlightCell.js +29 -46
- package/lib/Highlight/JsonView.d.ts +0 -1
- package/lib/Highlight/JsonView.js +45 -74
- package/lib/Highlight/index.d.ts +1 -2
- package/lib/Highlight/index.js +204 -204
- package/lib/Highlight/languages/bash.js +7 -34
- package/lib/Highlight/languages/cpp.js +7 -34
- package/lib/Highlight/languages/css.js +7 -34
- package/lib/Highlight/languages/dockerfile.js +7 -34
- package/lib/Highlight/languages/go.js +7 -34
- package/lib/Highlight/languages/groovy.js +7 -34
- package/lib/Highlight/languages/http.js +7 -34
- package/lib/Highlight/languages/java.js +7 -34
- package/lib/Highlight/languages/javascript.js +7 -34
- package/lib/Highlight/languages/json.js +7 -34
- package/lib/Highlight/languages/markdown.js +7 -34
- package/lib/Highlight/languages/nginx.js +7 -34
- package/lib/Highlight/languages/python.js +7 -34
- package/lib/Highlight/languages/ruby.js +7 -34
- package/lib/Highlight/languages/solidity.js +7 -34
- package/lib/Highlight/languages/sql.js +7 -34
- package/lib/Highlight/languages/typescript.js +7 -34
- package/lib/Highlight/languages/xml.js +7 -34
- package/lib/Highlight/languages/yaml.js +7 -34
- package/lib/Highlight/locale/en-US.d.ts +2 -0
- package/lib/Highlight/locale/en-US.js +9 -25
- package/lib/Highlight/locale/ja-JP.d.ts +6 -0
- package/lib/Highlight/locale/ja-JP.js +11 -0
- package/lib/Highlight/locale/zh-CN.d.ts +2 -0
- package/lib/Highlight/locale/zh-CN.js +9 -25
- package/lib/Highlight/locale/zh-TW.d.ts +2 -0
- package/lib/Highlight/locale/zh-TW.js +9 -25
- package/lib/Highlight/style/index.d.ts +10 -0
- package/lib/Highlight/style/index.js +277 -0
- package/lib/Highlight/useKeyDownCopyEvent.js +40 -65
- package/lib/IconFont/index.js +23 -39
- package/lib/LightFilter/index.d.ts +6 -2
- package/lib/LightFilter/index.js +46 -43
- package/lib/LightFilter/locale/en-US.d.ts +4 -0
- package/lib/LightFilter/locale/en-US.js +9 -0
- package/lib/LightFilter/locale/ja-JP.d.ts +4 -0
- package/lib/LightFilter/locale/ja-JP.js +9 -0
- package/lib/LightFilter/locale/zh-CN.d.ts +4 -0
- package/lib/LightFilter/locale/zh-CN.js +9 -0
- package/lib/LightFilter/locale/zh-TW.d.ts +4 -0
- package/lib/LightFilter/locale/zh-TW.js +9 -0
- package/lib/LightFilter/style/index.js +15 -33
- package/lib/LocaleDropdown/index.js +44 -61
- package/lib/Login/ActivateForm.d.ts +0 -1
- package/lib/Login/ActivateForm.js +93 -119
- package/lib/Login/LoginForm.d.ts +0 -1
- package/lib/Login/LoginForm.js +135 -150
- package/lib/Login/RegisterForm.d.ts +0 -1
- package/lib/Login/RegisterForm.js +122 -163
- package/lib/Login/index.d.ts +0 -1
- package/lib/Login/index.js +156 -132
- package/lib/Login/locale/en-US.js +31 -49
- package/lib/Login/locale/ja-JP.d.ts +28 -0
- package/lib/Login/locale/ja-JP.js +33 -0
- package/lib/Login/locale/zh-CN.js +31 -49
- package/lib/Login/locale/zh-TW.js +30 -48
- package/lib/Login/style/index.d.ts +10 -0
- package/lib/Login/style/index.js +246 -0
- package/lib/Lottie/index.js +7 -25
- package/lib/NavMenu/index.d.ts +5 -3
- package/lib/NavMenu/index.js +118 -103
- package/lib/NavMenu/locale/en-US.d.ts +4 -0
- package/lib/NavMenu/locale/en-US.js +9 -0
- package/lib/NavMenu/locale/ja-JP.d.ts +4 -0
- package/lib/NavMenu/locale/ja-JP.js +9 -0
- package/lib/NavMenu/locale/zh-CN.d.ts +4 -0
- package/lib/NavMenu/locale/zh-CN.js +9 -0
- package/lib/NavMenu/locale/zh-TW.d.ts +4 -0
- package/lib/NavMenu/locale/zh-TW.js +9 -0
- package/lib/NavMenu/style/index.d.ts +10 -0
- package/lib/NavMenu/style/index.js +60 -0
- package/lib/PageContainer/ItemRender.js +27 -46
- package/lib/PageContainer/index.d.ts +2 -0
- package/lib/PageContainer/index.js +167 -97
- package/lib/PageContainer/locale/en-US.d.ts +1 -0
- package/lib/PageContainer/locale/en-US.js +8 -25
- package/lib/PageContainer/locale/ja-JP.d.ts +5 -0
- package/lib/PageContainer/locale/ja-JP.js +10 -0
- package/lib/PageContainer/locale/zh-CN.d.ts +1 -0
- package/lib/PageContainer/locale/zh-CN.js +8 -25
- package/lib/PageContainer/locale/zh-TW.d.ts +1 -0
- package/lib/PageContainer/locale/zh-TW.js +8 -25
- package/lib/PageContainer/style/index.js +69 -45
- package/lib/PageLoading/index.js +32 -64
- package/lib/Password/Content.d.ts +2 -0
- package/lib/Password/Content.js +99 -84
- package/lib/Password/index.d.ts +1 -0
- package/lib/Password/index.js +127 -141
- package/lib/Password/locale/en-US.d.ts +1 -0
- package/lib/Password/locale/en-US.js +15 -32
- package/lib/Password/locale/ja-JP.d.ts +14 -0
- package/lib/Password/locale/ja-JP.js +19 -0
- package/lib/Password/locale/zh-CN.d.ts +1 -0
- package/lib/Password/locale/zh-CN.js +16 -33
- package/lib/Password/locale/zh-TW.d.ts +1 -0
- package/lib/Password/locale/zh-TW.js +15 -32
- package/lib/ProCard/index.js +77 -98
- package/lib/ProCard/style/index.d.ts +2 -2
- package/lib/ProCard/style/index.js +32 -38
- package/lib/ProTable/index.js +102 -122
- package/lib/ProTable/style/index.d.ts +2 -2
- package/lib/ProTable/style/index.js +29 -37
- package/lib/Ranger/QuickPicker.js +91 -83
- package/lib/Ranger/Ranger.d.ts +0 -1
- package/lib/Ranger/Ranger.js +98 -128
- package/lib/Ranger/constant/index.js +115 -266
- package/lib/Ranger/index.js +61 -70
- package/lib/Ranger/locale/en-US.js +31 -49
- package/lib/Ranger/locale/ja-JP.d.ts +28 -0
- package/lib/Ranger/locale/ja-JP.js +35 -0
- package/lib/Ranger/locale/zh-CN.js +7 -25
- package/lib/Ranger/locale/zh-TW.js +7 -25
- package/lib/Ranger/style/index.d.ts +10 -0
- package/lib/Ranger/style/index.js +64 -0
- package/lib/Ranger/typing.js +4 -16
- package/lib/SideTip/Dragger.js +259 -219
- package/lib/SideTip/IconLoading.js +43 -75
- package/lib/SideTip/index.d.ts +0 -1
- package/lib/SideTip/index.js +160 -116
- package/lib/SideTip/locale/en-US.d.ts +4 -1
- package/lib/SideTip/locale/en-US.js +8 -23
- package/lib/SideTip/locale/ja-JP.d.ts +5 -0
- package/lib/SideTip/locale/ja-JP.js +10 -0
- package/lib/SideTip/locale/zh-CN.d.ts +4 -1
- package/lib/SideTip/locale/zh-CN.js +8 -23
- package/lib/SideTip/locale/zh-TW.d.ts +4 -1
- package/lib/SideTip/locale/zh-TW.js +8 -23
- package/lib/SideTip/style/index.d.ts +10 -0
- package/lib/SideTip/style/index.js +204 -0
- package/lib/SideTip/utils.js +40 -61
- package/lib/TagSelect/Group.d.ts +6 -6
- package/lib/TagSelect/Group.js +68 -79
- package/lib/TagSelect/Item.js +67 -86
- package/lib/TagSelect/TagSelectContext.js +7 -25
- package/lib/TagSelect/index.js +12 -36
- package/lib/TagSelect/style/index.js +41 -64
- package/lib/TreeSearch/index.js +133 -132
- package/lib/TreeSearch/util.js +52 -70
- package/lib/Welcome/index.d.ts +0 -1
- package/lib/Welcome/index.js +140 -84
- package/lib/Welcome/locale/en-US.js +8 -26
- package/lib/Welcome/locale/ja-JP.d.ts +5 -0
- package/lib/Welcome/locale/ja-JP.js +10 -0
- package/lib/Welcome/locale/zh-CN.js +8 -26
- package/lib/Welcome/locale/zh-TW.js +8 -26
- package/lib/Welcome/step/style/index.d.ts +10 -0
- package/lib/Welcome/step/style/index.js +58 -0
- package/lib/Welcome/step.d.ts +0 -1
- package/lib/Welcome/step.js +63 -49
- package/lib/Welcome/style/index.d.ts +10 -0
- package/lib/Welcome/style/index.js +176 -0
- package/lib/_util/genComponentStyleHook.d.ts +4 -3
- package/lib/_util/genComponentStyleHook.js +15 -43
- package/lib/_util/index.js +43 -44
- package/lib/_util/useNavigate.js +11 -26
- package/lib/assets/logo/oceanbase_logo.svg +45 -29
- package/lib/assets/logo/oceanbase_logo_dark.svg +45 -29
- package/lib/assets/logo/oceanbase_watermark.svg +45 -31
- package/lib/constant/index.js +23 -50
- package/lib/index.d.ts +0 -5
- package/lib/index.js +282 -136
- package/lib/interface.js +4 -16
- package/lib/locale/LocaleWrapper.js +52 -62
- package/lib/locale/en-US.js +43 -68
- package/lib/locale/index.js +5 -17
- package/lib/locale/ja-JP.d.ts +3 -0
- package/lib/locale/ja-JP.js +46 -0
- package/lib/locale/zh-CN.js +42 -67
- package/lib/locale/zh-TW.js +38 -63
- package/package.json +9 -12
- package/dist/static/Inter.f6bcdfb6.woff2 +0 -0
- package/es/BatchOperationBar/index.less +0 -46
- package/es/BatchOperationBar/index.less.d.ts +0 -15
- package/es/Boundary/index.less +0 -36
- package/es/ContentWithIcon/index.less +0 -21
- package/es/DateRanger/index.less +0 -180
- package/es/Dialog/index.less +0 -116
- package/es/FullscreenBox/index.less +0 -49
- package/es/GraphToolbar/index.d.ts +0 -26
- package/es/GraphToolbar/index.js +0 -146
- package/es/GraphToolbar/index.less +0 -65
- package/es/GraphToolbar/locale/en-US.d.ts +0 -9
- package/es/GraphToolbar/locale/en-US.js +0 -8
- package/es/GraphToolbar/locale/zh-CN.d.ts +0 -9
- package/es/GraphToolbar/locale/zh-CN.js +0 -8
- package/es/GraphToolbar/locale/zh-TW.d.ts +0 -9
- package/es/GraphToolbar/locale/zh-TW.js +0 -8
- package/es/Highlight/index.less +0 -381
- package/es/Login/index.less +0 -268
- package/es/NavMenu/index.less +0 -50
- package/es/Ranger/index.less +0 -57
- package/es/SideTip/index.less +0 -180
- package/es/TaskGraph/Graph.d.ts +0 -24
- package/es/TaskGraph/Graph.js +0 -271
- package/es/TaskGraph/graph.less +0 -23
- package/es/TaskGraph/index.d.ts +0 -16
- package/es/TaskGraph/index.js +0 -178
- package/es/TaskGraph/index.less +0 -117
- package/es/TaskGraph/locale/en-US.d.ts +0 -13
- package/es/TaskGraph/locale/en-US.js +0 -12
- package/es/TaskGraph/locale/zh-CN.d.ts +0 -13
- package/es/TaskGraph/locale/zh-CN.js +0 -12
- package/es/TaskGraph/locale/zh-TW.d.ts +0 -13
- package/es/TaskGraph/locale/zh-TW.js +0 -12
- package/es/TaskGraph/register.d.ts +0 -7
- package/es/TaskGraph/register.js +0 -200
- package/es/Welcome/index.less +0 -185
- package/es/index.less +0 -1
- package/es/variable.less +0 -54
- package/lib/BatchOperationBar/index.less +0 -46
- package/lib/BatchOperationBar/index.less.d.ts +0 -15
- package/lib/Boundary/index.less +0 -36
- package/lib/ContentWithIcon/index.less +0 -21
- package/lib/DateRanger/index.less +0 -180
- package/lib/Dialog/index.less +0 -116
- package/lib/FullscreenBox/index.less +0 -49
- package/lib/GraphToolbar/index.d.ts +0 -26
- package/lib/GraphToolbar/index.js +0 -154
- package/lib/GraphToolbar/index.less +0 -65
- package/lib/GraphToolbar/locale/en-US.d.ts +0 -9
- package/lib/GraphToolbar/locale/en-US.js +0 -32
- package/lib/GraphToolbar/locale/zh-CN.d.ts +0 -9
- package/lib/GraphToolbar/locale/zh-CN.js +0 -32
- package/lib/GraphToolbar/locale/zh-TW.d.ts +0 -9
- package/lib/GraphToolbar/locale/zh-TW.js +0 -32
- package/lib/Highlight/index.less +0 -381
- package/lib/Login/index.less +0 -268
- package/lib/NavMenu/index.less +0 -50
- package/lib/Ranger/index.less +0 -57
- package/lib/SideTip/index.less +0 -180
- package/lib/TaskGraph/Graph.d.ts +0 -24
- package/lib/TaskGraph/Graph.js +0 -261
- package/lib/TaskGraph/graph.less +0 -23
- package/lib/TaskGraph/index.d.ts +0 -16
- package/lib/TaskGraph/index.js +0 -164
- package/lib/TaskGraph/index.less +0 -117
- package/lib/TaskGraph/locale/en-US.d.ts +0 -13
- package/lib/TaskGraph/locale/en-US.js +0 -36
- package/lib/TaskGraph/locale/zh-CN.d.ts +0 -13
- package/lib/TaskGraph/locale/zh-CN.js +0 -36
- package/lib/TaskGraph/locale/zh-TW.d.ts +0 -13
- package/lib/TaskGraph/locale/zh-TW.js +0 -36
- package/lib/TaskGraph/register.d.ts +0 -7
- package/lib/TaskGraph/register.js +0 -205
- package/lib/Welcome/index.less +0 -185
- package/lib/index.less +0 -1
- package/lib/variable.less +0 -54
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
+
import React, { useMemo, useImperativeHandle, forwardRef } from 'react';
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import { Input } from '@oceanbase/design';
|
|
9
|
+
import { useSegmentedInput } from "./hooks/useSegmentedInput";
|
|
10
|
+
import { useAutoWidthInput } from "./hooks/useAutoWidthInput";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
var EditableDateTimeInput = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
14
|
+
var value = props.value,
|
|
15
|
+
onChange = props.onChange,
|
|
16
|
+
formatProp = props.format,
|
|
17
|
+
_props$hideYear = props.hideYear,
|
|
18
|
+
hideYear = _props$hideYear === void 0 ? false : _props$hideYear,
|
|
19
|
+
_props$hideSecond = props.hideSecond,
|
|
20
|
+
hideSecond = _props$hideSecond === void 0 ? false : _props$hideSecond,
|
|
21
|
+
_props$isMoment = props.isMoment,
|
|
22
|
+
isMoment = _props$isMoment === void 0 ? false : _props$isMoment,
|
|
23
|
+
_props$isCn = props.isCn,
|
|
24
|
+
isCn = _props$isCn === void 0 ? true : _props$isCn,
|
|
25
|
+
className = props.className,
|
|
26
|
+
_props$prefixCls = props.prefixCls,
|
|
27
|
+
prefixCls = _props$prefixCls === void 0 ? 'ant-picker' : _props$prefixCls,
|
|
28
|
+
_props$disabled = props.disabled,
|
|
29
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
30
|
+
onClick = props.onClick,
|
|
31
|
+
_props$open = props.open,
|
|
32
|
+
open = _props$open === void 0 ? false : _props$open;
|
|
33
|
+
|
|
34
|
+
// 根据配置生成格式,优先使用外部传入的 format
|
|
35
|
+
var format = useMemo(function () {
|
|
36
|
+
if (formatProp) {
|
|
37
|
+
return formatProp;
|
|
38
|
+
}
|
|
39
|
+
if (isCn) {
|
|
40
|
+
if (hideYear) {
|
|
41
|
+
return hideSecond ? 'MM-DD HH:mm' : 'MM-DD HH:mm:ss';
|
|
42
|
+
}
|
|
43
|
+
return hideSecond ? 'YYYY-MM-DD HH:mm' : 'YYYY-MM-DD HH:mm:ss';
|
|
44
|
+
} else {
|
|
45
|
+
if (hideYear) {
|
|
46
|
+
return hideSecond ? 'MM/DD HH:mm' : 'MM/DD HH:mm:ss';
|
|
47
|
+
}
|
|
48
|
+
return hideSecond ? 'MM/DD/YYYY HH:mm' : 'MM/DD/YYYY HH:mm:ss';
|
|
49
|
+
}
|
|
50
|
+
}, [formatProp, hideYear, hideSecond, isCn]);
|
|
51
|
+
|
|
52
|
+
// 提取时区后缀(如 "(UTC+8)"、" UTC+8" 等)
|
|
53
|
+
var _useMemo = useMemo(function () {
|
|
54
|
+
var timezonePattern = /(\s*\(?(?:UTC|GMT)[+-]?\d*\)?)\s*$/i;
|
|
55
|
+
var match = format.match(timezonePattern);
|
|
56
|
+
if (match) {
|
|
57
|
+
return {
|
|
58
|
+
baseFormat: format.slice(0, match.index),
|
|
59
|
+
timezoneSuffix: match[1]
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
baseFormat: format,
|
|
64
|
+
timezoneSuffix: ''
|
|
65
|
+
};
|
|
66
|
+
}, [format]),
|
|
67
|
+
baseFormat = _useMemo.baseFormat;
|
|
68
|
+
|
|
69
|
+
// 使用分段输入 hook
|
|
70
|
+
var _useSegmentedInput = useSegmentedInput({
|
|
71
|
+
value: value,
|
|
72
|
+
onChange: onChange,
|
|
73
|
+
format: format,
|
|
74
|
+
baseFormat: baseFormat,
|
|
75
|
+
isMoment: isMoment,
|
|
76
|
+
isCn: isCn,
|
|
77
|
+
onClick: onClick,
|
|
78
|
+
open: open
|
|
79
|
+
}),
|
|
80
|
+
inputRef = _useSegmentedInput.inputRef,
|
|
81
|
+
isEditing = _useSegmentedInput.isEditing,
|
|
82
|
+
displayValue = _useSegmentedInput.displayValue,
|
|
83
|
+
handleClick = _useSegmentedInput.handleClick,
|
|
84
|
+
handleDoubleClick = _useSegmentedInput.handleDoubleClick,
|
|
85
|
+
handleBlur = _useSegmentedInput.handleBlur,
|
|
86
|
+
handleKeyDown = _useSegmentedInput.handleKeyDown,
|
|
87
|
+
hasPastedValue = _useSegmentedInput.hasPastedValue,
|
|
88
|
+
confirmPastedValue = _useSegmentedInput.confirmPastedValue;
|
|
89
|
+
var _useAutoWidthInput = useAutoWidthInput({
|
|
90
|
+
inputRef: inputRef,
|
|
91
|
+
value: displayValue,
|
|
92
|
+
minWidth: 80,
|
|
93
|
+
extraWidth: isCn ? 26 : 0
|
|
94
|
+
}),
|
|
95
|
+
sizerRef = _useAutoWidthInput.sizerRef,
|
|
96
|
+
inputWidth = _useAutoWidthInput.inputWidth;
|
|
97
|
+
|
|
98
|
+
// 暴露方法给父组件
|
|
99
|
+
useImperativeHandle(ref, function () {
|
|
100
|
+
return {
|
|
101
|
+
hasPastedValue: hasPastedValue,
|
|
102
|
+
confirmPastedValue: confirmPastedValue
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
106
|
+
className: classNames("".concat(prefixCls, "-range-editable"), className, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-range-editable-focused"), isEditing), "".concat(prefixCls, "-range-editable-disabled"), disabled)),
|
|
107
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
108
|
+
ref: sizerRef,
|
|
109
|
+
className: "".concat(prefixCls, "-range-editable-sizer"),
|
|
110
|
+
"aria-hidden": true
|
|
111
|
+
}), /*#__PURE__*/_jsx(Input, {
|
|
112
|
+
ref: inputRef,
|
|
113
|
+
className: "".concat(prefixCls, "-range-editable-input"),
|
|
114
|
+
style: {
|
|
115
|
+
width: inputWidth
|
|
116
|
+
},
|
|
117
|
+
value: displayValue,
|
|
118
|
+
readOnly: true,
|
|
119
|
+
disabled: disabled,
|
|
120
|
+
variant: "borderless",
|
|
121
|
+
onClick: handleClick,
|
|
122
|
+
onDoubleClick: handleDoubleClick,
|
|
123
|
+
onBlur: handleBlur,
|
|
124
|
+
onKeyDown: handleKeyDown
|
|
125
|
+
})]
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
EditableDateTimeInput.displayName = 'EditableDateTimeInput';
|
|
129
|
+
export default EditableDateTimeInput;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
3
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
4
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -8,18 +9,17 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
8
9
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
10
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
12
|
+
import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
12
13
|
import dayjsGenerateConfig from 'rc-picker/es/generate/dayjs';
|
|
13
14
|
import momentGenerateConfig from 'rc-picker/es/generate/moment';
|
|
14
15
|
import useCSSVarCls from 'antd/es/config-provider/hooks/useCSSVarCls';
|
|
15
16
|
import useStyle from 'antd/es/date-picker/style/index';
|
|
16
17
|
import { PickerPanel } from 'rc-picker';
|
|
17
18
|
import classNames from 'classnames';
|
|
18
|
-
import { Alert, Button, Col, DatePicker, Divider, Form, Row, Space, TimePicker } from '@oceanbase/design';
|
|
19
|
+
import { Alert, Button, Col, ConfigProvider, DatePicker, Divider, Form, Row, Space, TimePicker } from '@oceanbase/design';
|
|
19
20
|
import { noop } from 'lodash';
|
|
20
21
|
import moment from 'moment';
|
|
21
22
|
import dayjs from 'dayjs';
|
|
22
|
-
import { getPrefix } from "../_util";
|
|
23
23
|
import { DATE_TIME_MONTH_FORMAT, DATE_TIME_MONTH_FORMAT_CN } from "./constant";
|
|
24
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
25
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -46,10 +46,10 @@ var useClickFSA = function useClickFSA() {
|
|
|
46
46
|
};
|
|
47
47
|
return [state, next];
|
|
48
48
|
};
|
|
49
|
-
var prefix = getPrefix('ranger-picker-panel');
|
|
50
49
|
var prefixCls = 'ant-picker';
|
|
51
50
|
var TIME_FORMAT = 'HH:mm:ss';
|
|
52
51
|
var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
52
|
+
var _defaultValue$, _defaultValue$2, _calendarValue$, _calendarValue$2;
|
|
53
53
|
var defaultValue = props.defaultValue,
|
|
54
54
|
isMoment = props.isMoment,
|
|
55
55
|
locale = props.locale,
|
|
@@ -63,6 +63,9 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
63
63
|
onCancel = _props$onCancel === void 0 ? noop : _props$onCancel,
|
|
64
64
|
disabledDate = props.disabledDate,
|
|
65
65
|
hideSecond = props.hideSecond;
|
|
66
|
+
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
67
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
68
|
+
var prefix = getPrefixCls('ranger-picker-panel');
|
|
66
69
|
var rootCls = useCSSVarCls(prefixCls);
|
|
67
70
|
var _useStyle = useStyle(prefixCls, rootCls),
|
|
68
71
|
_useStyle2 = _slicedToArray(_useStyle, 3),
|
|
@@ -90,6 +93,13 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
90
93
|
setActiveIndex = _React$useState6[1];
|
|
91
94
|
var isEn = (locale === null || locale === void 0 ? void 0 : locale.antLocale) === 'en';
|
|
92
95
|
|
|
96
|
+
// 监听外部传入的 defaultValue 变化,同步更新 calendarValue
|
|
97
|
+
React.useEffect(function () {
|
|
98
|
+
if (defaultValue && defaultValue.length === 2) {
|
|
99
|
+
setCalendarValue(defaultValue);
|
|
100
|
+
}
|
|
101
|
+
}, [defaultValue === null || defaultValue === void 0 || (_defaultValue$ = defaultValue[0]) === null || _defaultValue$ === void 0 ? void 0 : _defaultValue$.valueOf(), defaultValue === null || defaultValue === void 0 || (_defaultValue$2 = defaultValue[1]) === null || _defaultValue$2 === void 0 ? void 0 : _defaultValue$2.valueOf()]);
|
|
102
|
+
|
|
93
103
|
//
|
|
94
104
|
var DATE_FORMAT = isEn ? DATE_TIME_MONTH_FORMAT : DATE_TIME_MONTH_FORMAT_CN;
|
|
95
105
|
var getDateInstance = useCallback(function (v, format, strict) {
|
|
@@ -115,10 +125,8 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
115
125
|
setInternalHoverValues(date && clickFSA === CLICK_STATE.START ? fillCalendarValue(date, activeIndex) : null);
|
|
116
126
|
};
|
|
117
127
|
|
|
118
|
-
//
|
|
119
|
-
var formatValues =
|
|
120
|
-
return (a === null || a === void 0 ? void 0 : a.valueOf()) - (b === null || b === void 0 ? void 0 : b.valueOf());
|
|
121
|
-
}).map(function (item) {
|
|
128
|
+
// 保持原始顺序,不进行排序(只在提交时排序)
|
|
129
|
+
var formatValues = calendarValue.map(function (item) {
|
|
122
130
|
return item === null || item === void 0 ? void 0 : item.format(DATE_FORMAT);
|
|
123
131
|
});
|
|
124
132
|
var _Form$useForm = Form.useForm(),
|
|
@@ -128,14 +136,20 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
128
136
|
_sDate = _formatValues[0],
|
|
129
137
|
_eDate = _formatValues[1];
|
|
130
138
|
var setFormatDateToForm = function setFormatDateToForm() {
|
|
139
|
+
var _calendarValue = _slicedToArray(calendarValue, 2),
|
|
140
|
+
startVal = _calendarValue[0],
|
|
141
|
+
endVal = _calendarValue[1];
|
|
131
142
|
form.setFieldsValue({
|
|
132
143
|
startDate: getDateInstance(_sDate),
|
|
133
|
-
endDate: getDateInstance(_eDate)
|
|
144
|
+
endDate: getDateInstance(_eDate),
|
|
145
|
+
// 同步更新时间值,保持原始顺序
|
|
146
|
+
startTime: startVal || getDateInstance(),
|
|
147
|
+
endTime: endVal || getDateInstance()
|
|
134
148
|
});
|
|
135
149
|
};
|
|
136
150
|
useEffect(function () {
|
|
137
151
|
setFormatDateToForm();
|
|
138
|
-
}, [
|
|
152
|
+
}, [calendarValue === null || calendarValue === void 0 || (_calendarValue$ = calendarValue[0]) === null || _calendarValue$ === void 0 ? void 0 : _calendarValue$.valueOf(), calendarValue === null || calendarValue === void 0 || (_calendarValue$2 = calendarValue[1]) === null || _calendarValue$2 === void 0 ? void 0 : _calendarValue$2.valueOf()]);
|
|
139
153
|
var defaultTime = useMemo(function () {
|
|
140
154
|
return getDateInstance();
|
|
141
155
|
}, []);
|
|
@@ -197,7 +211,7 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
197
211
|
}],
|
|
198
212
|
children: /*#__PURE__*/_jsx(DatePicker, {
|
|
199
213
|
format: {
|
|
200
|
-
format:
|
|
214
|
+
format: DATE_FORMAT,
|
|
201
215
|
type: 'mask'
|
|
202
216
|
},
|
|
203
217
|
style: {
|
|
@@ -273,7 +287,7 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
273
287
|
}],
|
|
274
288
|
children: /*#__PURE__*/_jsx(DatePicker, {
|
|
275
289
|
format: {
|
|
276
|
-
format:
|
|
290
|
+
format: DATE_FORMAT,
|
|
277
291
|
type: 'mask'
|
|
278
292
|
},
|
|
279
293
|
style: {
|
|
@@ -411,15 +425,18 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
411
425
|
startTime = values.startTime,
|
|
412
426
|
endDate = values.endDate,
|
|
413
427
|
endTime = values.endTime;
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
428
|
+
|
|
429
|
+
// 组合日期和时间
|
|
430
|
+
var startDateTime = "".concat(formatDate(startDate), " ").concat(startTime.format(TIME_FORMAT));
|
|
431
|
+
var endDateTime = "".concat(formatDate(endDate), " ").concat(endTime.format(TIME_FORMAT));
|
|
432
|
+
|
|
433
|
+
// 对完整的日期时间进行排序,保证开始时间在结束时间之前
|
|
434
|
+
var startMoment = getDateInstance(startDateTime, "".concat(DATE_FORMAT, " ").concat(TIME_FORMAT));
|
|
435
|
+
var endMoment = getDateInstance(endDateTime, "".concat(DATE_FORMAT, " ").concat(TIME_FORMAT));
|
|
436
|
+
var _ref5 = startMoment.valueOf() <= endMoment.valueOf() ? [startDateTime, endDateTime] : [endDateTime, startDateTime],
|
|
418
437
|
_ref6 = _slicedToArray(_ref5, 2),
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
var start = "".concat(formatDate(startDate), " ").concat(sTime.format(TIME_FORMAT));
|
|
422
|
-
var end = "".concat(formatDate(endDate), " ").concat(eTime.format(TIME_FORMAT));
|
|
438
|
+
start = _ref6[0],
|
|
439
|
+
end = _ref6[1];
|
|
423
440
|
var errorList = [];
|
|
424
441
|
var message = '';
|
|
425
442
|
rules === null || rules === void 0 || rules.some(function (item) {
|
|
@@ -2,10 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import type { TooltipProps } from '@oceanbase/design';
|
|
3
3
|
import type { RangePickerProps } from '@oceanbase/design/es/date-picker';
|
|
4
4
|
import type { Dayjs } from 'dayjs';
|
|
5
|
+
import 'dayjs/locale/zh-cn';
|
|
5
6
|
import type { Moment } from 'moment';
|
|
6
7
|
import type { RangeOption } from './typing';
|
|
7
8
|
import type { Rule } from './PickerPanel';
|
|
8
|
-
import './index.less';
|
|
9
9
|
export type RangeName = 'customize' | string;
|
|
10
10
|
export type RangeValue = [Moment, Moment] | [Dayjs, Dayjs] | [] | null;
|
|
11
11
|
export type RangeValueFormat = [string, string] | [] | null;
|
|
@@ -13,7 +13,7 @@ export type RangeDateValue = {
|
|
|
13
13
|
name: RangeName;
|
|
14
14
|
range: RangeValue;
|
|
15
15
|
};
|
|
16
|
-
export interface DateRangerProps extends Omit<RangePickerProps, 'mode' | 'picker' | 'value' | 'defaultValue'> {
|
|
16
|
+
export interface DateRangerProps extends Omit<RangePickerProps, 'mode' | 'picker' | 'value' | 'defaultValue' | 'variant'> {
|
|
17
17
|
selects?: RangeOption[];
|
|
18
18
|
defaultQuickValue?: string;
|
|
19
19
|
hasRewind?: boolean;
|
|
@@ -38,6 +38,8 @@ export interface DateRangerProps extends Omit<RangePickerProps, 'mode' | 'picker
|
|
|
38
38
|
value?: RangeValue;
|
|
39
39
|
defaultValue?: RangeValue;
|
|
40
40
|
size?: 'small' | 'large' | 'middle';
|
|
41
|
+
/** 边框变体,默认实线,可配置为 dashed 虚线 */
|
|
42
|
+
variant?: 'dashed';
|
|
41
43
|
tooltipProps?: TooltipProps;
|
|
42
44
|
autoAdjustOverflow?: boolean;
|
|
43
45
|
overlayClassName?: string;
|
package/es/DateRanger/Ranger.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
var _excluded = ["selects", "value", "defaultValue", "defaultQuickValue", "hasRewind", "hasPlay", "hasSync", "hasForward", "hasZoomOut", "hasTagInPicker", "pastOnly", "simpleMode", "hideYear", "hideSecond", "autoCalcRange", "history", "onChange", "disabledDate", "locale", "size", "stickRangeName", "variant", "tooltipProps", "isMoment", "rules", "tip", "autoAdjustOverflow", "overlayClassName", "overlayStyle", "getPopupContainer"];
|
|
2
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -17,27 +18,33 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
17
18
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
19
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
20
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
20
|
-
import React, { useEffect, useRef, useState, useImperativeHandle, useMemo } from 'react';
|
|
21
|
-
import { Button,
|
|
21
|
+
import React, { useContext, useEffect, useRef, useState, useImperativeHandle, useMemo } from 'react';
|
|
22
|
+
import { Button, ConfigProvider, Divider, Dropdown, Flex, Menu, Radio, Space, Tooltip, message, theme } from '@oceanbase/design';
|
|
22
23
|
import { LeftOutlined, RightOutlined, ZoomOutOutlined, SyncOutlined, ArrowLeftOutlined, CopyOutlined, DeleteOutlined } from '@oceanbase/icons';
|
|
23
24
|
import dayjs from 'dayjs';
|
|
25
|
+
import 'dayjs/locale/zh-cn';
|
|
24
26
|
import { findIndex, isEqual as _isEqual, isNil, noop, omit } from 'lodash';
|
|
25
27
|
import moment from 'moment';
|
|
26
28
|
import classNames from 'classnames';
|
|
27
29
|
import LocaleWrapper from "../locale/LocaleWrapper";
|
|
28
|
-
import {
|
|
29
|
-
import
|
|
30
|
+
import { CUSTOMIZE, NEAR_1_MINUTES, NEAR_30_MINUTES, NEAR_1_HOURS, NEAR_3_HOURS, NEAR_6_HOURS, TODAY, LAST_3_DAYS, YEAR_DATE_TIME_SECOND_FORMAT_CN } from "./constant";
|
|
31
|
+
import EditableDateTimeInput from "./EditableDateTimeInput";
|
|
30
32
|
import InternalPickerPanel from "./PickerPanel";
|
|
31
33
|
import zhCN from "./locale/zh-CN";
|
|
32
|
-
import "./
|
|
34
|
+
import useStyle from "./style";
|
|
33
35
|
import { useClickAway } from 'ahooks';
|
|
34
36
|
import { useLocalStorageState } from '@oceanbase/util';
|
|
35
37
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
36
38
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
37
39
|
var DefaultMaxHistoryCapacity = 20;
|
|
38
|
-
var prefix = getPrefix('date-ranger');
|
|
39
40
|
var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
40
41
|
var _selects$;
|
|
42
|
+
var _useContext = useContext(ConfigProvider.ConfigContext),
|
|
43
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
44
|
+
var prefixCls = getPrefixCls('date-ranger');
|
|
45
|
+
var _useStyle = useStyle(prefixCls),
|
|
46
|
+
wrapSSR = _useStyle.wrapSSR;
|
|
47
|
+
var prefix = prefixCls;
|
|
41
48
|
var _props$selects = props.selects,
|
|
42
49
|
selects = _props$selects === void 0 ? [NEAR_1_MINUTES, NEAR_30_MINUTES, NEAR_1_HOURS, NEAR_3_HOURS, NEAR_6_HOURS, TODAY, LAST_3_DAYS] : _props$selects,
|
|
43
50
|
value = props.value,
|
|
@@ -74,6 +81,7 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
74
81
|
size = props.size,
|
|
75
82
|
_props$stickRangeName = props.stickRangeName,
|
|
76
83
|
stickRangeName = _props$stickRangeName === void 0 ? false : _props$stickRangeName,
|
|
84
|
+
variant = props.variant,
|
|
77
85
|
tooltipProps = props.tooltipProps,
|
|
78
86
|
isMomentProps = props.isMoment,
|
|
79
87
|
rules = props.rules,
|
|
@@ -127,6 +135,7 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
127
135
|
var rangeRef = useRef(null);
|
|
128
136
|
var popRef = useRef(null);
|
|
129
137
|
var labelRef = useRef(null);
|
|
138
|
+
var editableInputRef = useRef(null);
|
|
130
139
|
|
|
131
140
|
// 没有 selects 时,回退到普通 RangePicker, 当前时间选项为自定义时,应该显示 RangePicker
|
|
132
141
|
var _useState13 = useState(rangeName !== CUSTOMIZE),
|
|
@@ -141,7 +150,8 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
141
150
|
}
|
|
142
151
|
return false;
|
|
143
152
|
}, [historyProp]);
|
|
144
|
-
var
|
|
153
|
+
var localStorageKey = "".concat(prefixCls, "-date-ranger-history");
|
|
154
|
+
var _useLocalStorageState = useLocalStorageState(localStorageKey, {
|
|
145
155
|
defaultValue: [],
|
|
146
156
|
listenStorageChange: true
|
|
147
157
|
}),
|
|
@@ -309,8 +319,8 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
309
319
|
var diffMs = e.diff(s);
|
|
310
320
|
return diffMs > differenceMs;
|
|
311
321
|
}) : selects[rangeNameIndex + 1];
|
|
312
|
-
return /*#__PURE__*/_jsxs(Space, {
|
|
313
|
-
className: classNames(rest.className, _defineProperty(_defineProperty(_defineProperty({}, prefix, true), "".concat(prefix, "-show-range"), true), "".concat(prefix, "-back-radio-focused"), backRadioFocused)),
|
|
322
|
+
return wrapSSR( /*#__PURE__*/_jsxs(Space, {
|
|
323
|
+
className: classNames(rest.className, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, prefix, true), "".concat(prefix, "-show-range"), true), "".concat(prefix, "-dashed"), variant === 'dashed'), "".concat(prefix, "-back-radio-focused"), backRadioFocused)),
|
|
314
324
|
style: rest.style,
|
|
315
325
|
children: [/*#__PURE__*/_jsxs(Space, {
|
|
316
326
|
size: 0,
|
|
@@ -445,12 +455,22 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
445
455
|
rules: rules,
|
|
446
456
|
hideSecond: hideSecond,
|
|
447
457
|
onOk: function onOk(vList) {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
458
|
+
var _editableInputRef$cur;
|
|
459
|
+
// 如果有粘贴值,优先使用粘贴值
|
|
460
|
+
if ((_editableInputRef$cur = editableInputRef.current) !== null && _editableInputRef$cur !== void 0 && _editableInputRef$cur.hasPastedValue) {
|
|
461
|
+
editableInputRef.current.confirmPastedValue();
|
|
462
|
+
setIsPlay(false);
|
|
463
|
+
handleNameChange(CUSTOMIZE);
|
|
464
|
+
closeTooltip();
|
|
465
|
+
} else {
|
|
466
|
+
// 否则使用面板中的值
|
|
467
|
+
setIsPlay(false);
|
|
468
|
+
handleNameChange(CUSTOMIZE);
|
|
469
|
+
rangeChange(vList.map(function (v) {
|
|
470
|
+
return isMoment ? moment(v) : dayjs(v);
|
|
471
|
+
}));
|
|
472
|
+
closeTooltip();
|
|
473
|
+
}
|
|
454
474
|
},
|
|
455
475
|
onCancel: function onCancel() {
|
|
456
476
|
closeTooltip();
|
|
@@ -512,36 +532,27 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
512
532
|
})
|
|
513
533
|
}), (!simpleMode || !isPlay) && /*#__PURE__*/_jsx("span", {
|
|
514
534
|
ref: rangeRef,
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
// pointerEvents: 'none',
|
|
523
|
-
border: 0
|
|
535
|
+
className: "".concat(prefix, "-editable-wrapper"),
|
|
536
|
+
children: /*#__PURE__*/_jsx(EditableDateTimeInput, _objectSpread({
|
|
537
|
+
ref: editableInputRef,
|
|
538
|
+
prefixCls: prefixCls,
|
|
539
|
+
value: innerValue,
|
|
540
|
+
onChange: function onChange(newValue) {
|
|
541
|
+
datePickerChange(newValue);
|
|
524
542
|
},
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
543
|
+
hideYear: hideYear && isThisYear,
|
|
544
|
+
hideSecond: hideSecond,
|
|
545
|
+
isMoment: isMoment,
|
|
546
|
+
isCn: isCn,
|
|
547
|
+
format: (rest === null || rest === void 0 ? void 0 : rest.format) || YEAR_DATE_TIME_SECOND_FORMAT_CN,
|
|
548
|
+
open: open,
|
|
549
|
+
onClick: function onClick() {
|
|
550
|
+
setOpen(true);
|
|
551
|
+
setTooltipOpen(true);
|
|
531
552
|
}
|
|
532
|
-
|
|
533
|
-
,
|
|
534
|
-
value: innerValue,
|
|
535
|
-
onChange: datePickerChange,
|
|
536
|
-
allowClear: false,
|
|
537
|
-
size: size,
|
|
538
|
-
suffixIcon: null
|
|
539
|
-
// 透传 props 到 antd Ranger
|
|
540
|
-
}, omit(rest, 'value', 'onChange', 'style', 'className')), {}, {
|
|
541
|
-
open: false
|
|
542
|
-
}))
|
|
553
|
+
}, omit(rest, 'value', 'onChange', 'style', 'className', 'onClick', 'disabled', 'format')))
|
|
543
554
|
})]
|
|
544
|
-
}), /*#__PURE__*/_jsxs(Radio.Group, {
|
|
555
|
+
}), (hasRewind || hasForward) && /*#__PURE__*/_jsxs(Radio.Group, {
|
|
545
556
|
value: isPlay ? 'play' : '',
|
|
546
557
|
className: "".concat(prefix, "-playback-control"),
|
|
547
558
|
buttonStyle: "solid",
|
|
@@ -552,6 +563,7 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
552
563
|
},
|
|
553
564
|
children: /*#__PURE__*/_jsx(Radio.Button, {
|
|
554
565
|
value: "stepBack",
|
|
566
|
+
"aria-label": locale.jumpBack,
|
|
555
567
|
style: {
|
|
556
568
|
paddingInline: 8,
|
|
557
569
|
borderInlineStart: 0,
|
|
@@ -574,7 +586,9 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
574
586
|
rangeChange([newStartTime, newEndTime]);
|
|
575
587
|
}
|
|
576
588
|
},
|
|
577
|
-
children: /*#__PURE__*/_jsx(LeftOutlined, {
|
|
589
|
+
children: /*#__PURE__*/_jsx(LeftOutlined, {
|
|
590
|
+
"aria-hidden": true
|
|
591
|
+
})
|
|
578
592
|
})
|
|
579
593
|
}), hasForward && /*#__PURE__*/_jsx(Tooltip, {
|
|
580
594
|
title: locale.jumpForward,
|
|
@@ -583,9 +597,9 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
583
597
|
},
|
|
584
598
|
children: /*#__PURE__*/_jsx(Radio.Button, {
|
|
585
599
|
value: "stepForward",
|
|
600
|
+
"aria-label": locale.jumpForward,
|
|
586
601
|
style: {
|
|
587
602
|
paddingInline: 8,
|
|
588
|
-
borderInlineStart: 0,
|
|
589
603
|
borderTopLeftRadius: 0,
|
|
590
604
|
borderBottomLeftRadius: 0
|
|
591
605
|
}
|
|
@@ -603,11 +617,14 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
603
617
|
}
|
|
604
618
|
}
|
|
605
619
|
},
|
|
606
|
-
children: /*#__PURE__*/_jsx(RightOutlined, {
|
|
620
|
+
children: /*#__PURE__*/_jsx(RightOutlined, {
|
|
621
|
+
"aria-hidden": true
|
|
622
|
+
})
|
|
607
623
|
})
|
|
608
624
|
})]
|
|
609
625
|
})]
|
|
610
626
|
}), hasSync && rangeName !== CUSTOMIZE && /*#__PURE__*/_jsx(Button, {
|
|
627
|
+
"aria-label": locale.syncToCurrent,
|
|
611
628
|
style: {
|
|
612
629
|
paddingInline: 8,
|
|
613
630
|
color: token.colorTextSecondary
|
|
@@ -615,8 +632,11 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
615
632
|
onClick: function onClick() {
|
|
616
633
|
setNow();
|
|
617
634
|
},
|
|
618
|
-
children: /*#__PURE__*/_jsx(SyncOutlined, {
|
|
635
|
+
children: /*#__PURE__*/_jsx(SyncOutlined, {
|
|
636
|
+
"aria-hidden": true
|
|
637
|
+
})
|
|
619
638
|
}), hasZoomOut && /*#__PURE__*/_jsx(Button, {
|
|
639
|
+
"aria-label": locale.zoomOutRange,
|
|
620
640
|
disabled: !nextRangeItem,
|
|
621
641
|
style: {
|
|
622
642
|
color: token.colorTextSecondary
|
|
@@ -629,9 +649,11 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
629
649
|
return;
|
|
630
650
|
}
|
|
631
651
|
},
|
|
632
|
-
icon: /*#__PURE__*/_jsx(ZoomOutOutlined, {
|
|
652
|
+
icon: /*#__PURE__*/_jsx(ZoomOutOutlined, {
|
|
653
|
+
"aria-hidden": true
|
|
654
|
+
})
|
|
633
655
|
})]
|
|
634
|
-
});
|
|
656
|
+
}));
|
|
635
657
|
});
|
|
636
658
|
export default LocaleWrapper({
|
|
637
659
|
componentName: 'DateRanger',
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { useSegmentedInput } from './useSegmentedInput';
|
|
2
|
+
export { useAutoWidthInput } from './useAutoWidthInput';
|
|
3
|
+
export type { UseSegmentedInputOptions, UseSegmentedInputReturn } from './useSegmentedInput';
|
|
4
|
+
export type { UseAutoWidthInputOptions, UseAutoWidthInputReturn } from './useAutoWidthInput';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { InputRef } from '@oceanbase/design';
|
|
3
|
+
export interface UseAutoWidthInputOptions {
|
|
4
|
+
inputRef: React.RefObject<InputRef>;
|
|
5
|
+
value: string;
|
|
6
|
+
minWidth?: number;
|
|
7
|
+
extraWidth?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface UseAutoWidthInputReturn {
|
|
10
|
+
inputWidth: number;
|
|
11
|
+
sizerRef: React.RefObject<HTMLSpanElement>;
|
|
12
|
+
}
|
|
13
|
+
export declare const useAutoWidthInput: (options: UseAutoWidthInputOptions) => UseAutoWidthInputReturn;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { useLayoutEffect, useRef, useState } from 'react';
|
|
8
|
+
var getHorizontalSpacing = function getHorizontalSpacing(computedStyle) {
|
|
9
|
+
return (parseFloat(computedStyle.paddingLeft) || 0) + (parseFloat(computedStyle.paddingRight) || 0) + (parseFloat(computedStyle.borderLeftWidth) || 0) + (parseFloat(computedStyle.borderRightWidth) || 0);
|
|
10
|
+
};
|
|
11
|
+
var getSizingValue = function getSizingValue(value) {
|
|
12
|
+
return value ? value.replace(/\d/g, '0') : "\xA0";
|
|
13
|
+
};
|
|
14
|
+
export var useAutoWidthInput = function useAutoWidthInput(options) {
|
|
15
|
+
var inputRef = options.inputRef,
|
|
16
|
+
value = options.value,
|
|
17
|
+
_options$minWidth = options.minWidth,
|
|
18
|
+
minWidth = _options$minWidth === void 0 ? 80 : _options$minWidth,
|
|
19
|
+
_options$extraWidth = options.extraWidth,
|
|
20
|
+
extraWidth = _options$extraWidth === void 0 ? 0 : _options$extraWidth;
|
|
21
|
+
var sizerRef = useRef(null);
|
|
22
|
+
var _useState = useState(minWidth),
|
|
23
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
+
inputWidth = _useState2[0],
|
|
25
|
+
setInputWidth = _useState2[1];
|
|
26
|
+
useLayoutEffect(function () {
|
|
27
|
+
var _inputRef$current;
|
|
28
|
+
var nativeInput = (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.input;
|
|
29
|
+
var sizer = sizerRef.current;
|
|
30
|
+
if (!nativeInput || !sizer) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
var computedStyle = window.getComputedStyle(nativeInput);
|
|
34
|
+
sizer.style.font = computedStyle.font;
|
|
35
|
+
sizer.style.letterSpacing = computedStyle.letterSpacing;
|
|
36
|
+
sizer.style.fontVariantNumeric = computedStyle.fontVariantNumeric;
|
|
37
|
+
sizer.textContent = getSizingValue(value);
|
|
38
|
+
setInputWidth(Math.max(minWidth, Math.ceil(sizer.getBoundingClientRect().width + getHorizontalSpacing(computedStyle) + extraWidth)));
|
|
39
|
+
}, [extraWidth, inputRef, minWidth, value]);
|
|
40
|
+
return {
|
|
41
|
+
inputWidth: inputWidth,
|
|
42
|
+
sizerRef: sizerRef
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Dayjs } from 'dayjs';
|
|
3
|
+
import type { Moment } from 'moment';
|
|
4
|
+
import 'dayjs/locale/en';
|
|
5
|
+
import 'dayjs/locale/zh-cn';
|
|
6
|
+
import type { InputRef } from '@oceanbase/design';
|
|
7
|
+
export interface UseSegmentedInputOptions {
|
|
8
|
+
value?: [Dayjs | Moment | null, Dayjs | Moment | null];
|
|
9
|
+
onChange?: (value: [Dayjs | Moment, Dayjs | Moment]) => void;
|
|
10
|
+
format: string;
|
|
11
|
+
baseFormat: string;
|
|
12
|
+
isMoment?: boolean;
|
|
13
|
+
isCn?: boolean;
|
|
14
|
+
onClick?: () => void;
|
|
15
|
+
locale?: string;
|
|
16
|
+
open?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface UseSegmentedInputReturn {
|
|
19
|
+
inputRef: React.RefObject<InputRef>;
|
|
20
|
+
isEditing: boolean;
|
|
21
|
+
displayValue: string;
|
|
22
|
+
handleClick: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
23
|
+
handleDoubleClick: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
24
|
+
handleBlur: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
25
|
+
handleKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
26
|
+
confirmPastedValue: () => void;
|
|
27
|
+
hasPastedValue: boolean;
|
|
28
|
+
getPastedValue: () => [Dayjs | Moment, Dayjs | Moment] | null;
|
|
29
|
+
}
|
|
30
|
+
export declare const useSegmentedInput: (options: UseSegmentedInputOptions) => UseSegmentedInputReturn;
|
|
31
|
+
export default useSegmentedInput;
|