@oceanbase/ui 1.0.0-alpha.8 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui.min.js +1 -1
- package/es/Action/Group.d.ts +1 -2
- package/es/Action/Group.js +292 -120
- package/es/Action/Item.js +1 -0
- package/es/Action/index.js +1 -0
- 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 +3 -0
- package/es/BasicLayout/locale/ja-JP.js +4 -1
- 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 +11 -3
- package/es/BatchOperationBar/index.js +16 -4
- 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 +1 -0
- package/es/BatchOperationBar/locale/ja-JP.js +2 -1
- 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.js +6 -1
- package/es/Boundary/Components/Code.js +2 -1
- package/es/Boundary/Components/Exception.js +3 -2
- package/es/Boundary/Components/Function.js +2 -1
- package/es/Boundary/index.js +1 -0
- package/es/Boundary/style/index.js +5 -3
- package/es/ContentWithIcon/index.js +1 -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 +32 -16
- package/es/DateRanger/Ranger.d.ts +4 -1
- package/es/DateRanger/Ranger.js +59 -42
- 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 +2 -0
- package/es/DateRanger/locale/ja-JP.js +3 -1
- 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.js +52 -14
- package/es/Dialog/Anchor.js +1 -0
- package/es/Dialog/EventProxy.js +1 -0
- package/es/Dialog/index.d.ts +5 -0
- package/es/Dialog/index.js +78 -14
- 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 +5 -0
- package/es/Dialog/locale/ja-JP.js +6 -1
- 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.js +25 -6
- 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 +3 -1
- package/es/DocDialog/locale/ja-JP.js +3 -1
- 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.js +3 -6
- package/es/FullscreenBox/index.js +19 -10
- 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 +4 -1
- package/es/FullscreenBox/locale/ja-JP.js +4 -1
- 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.js +32 -11
- package/es/Highlight/DiffView/DiffCells.js +1 -0
- package/es/Highlight/DiffView/index.js +1 -0
- package/es/Highlight/HighlightCell.js +1 -0
- package/es/Highlight/JsonView.js +1 -0
- package/es/Highlight/index.js +10 -2
- 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 +2 -0
- package/es/Highlight/locale/ja-JP.js +3 -1
- 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.js +1 -1
- 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 +1 -0
- package/es/Login/ActivateForm.js +1 -0
- package/es/Login/LoginForm.js +1 -0
- package/es/Login/RegisterForm.js +1 -0
- package/es/Login/index.js +1 -0
- package/es/Login/style/index.js +1 -1
- package/es/Lottie/index.js +1 -0
- package/es/NavMenu/index.d.ts +5 -2
- package/es/NavMenu/index.js +28 -5
- 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/PageContainer/ItemRender.js +1 -0
- package/es/PageContainer/index.js +62 -19
- package/es/PageContainer/style/index.js +26 -11
- 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 +18 -13
- 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 +1 -0
- package/es/Password/locale/ja-JP.js +1 -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.js +9 -4
- package/es/ProTable/index.js +10 -2
- package/es/Ranger/QuickPicker.js +1 -0
- package/es/Ranger/Ranger.js +1 -0
- package/es/Ranger/index.js +1 -0
- package/es/Ranger/style/index.js +1 -1
- package/es/SideTip/Dragger.js +3 -1
- package/es/SideTip/IconLoading.js +1 -0
- package/es/SideTip/index.js +39 -8
- 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 +4 -1
- package/es/SideTip/locale/ja-JP.js +4 -1
- 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.js +10 -1
- package/es/TagSelect/Group.js +7 -2
- package/es/TagSelect/Item.js +3 -1
- package/es/TagSelect/index.js +1 -0
- package/es/TreeSearch/index.js +1 -0
- package/es/Welcome/index.js +1 -0
- package/es/Welcome/step.js +1 -0
- package/es/_util/genComponentStyleHook.d.ts +2 -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.js +1 -0
- package/es/locale/LocaleWrapper.js +1 -0
- package/es/locale/en-US.js +6 -0
- package/es/locale/index.js +1 -0
- package/es/locale/ja-JP.js +6 -0
- package/es/locale/zh-CN.js +6 -0
- package/es/locale/zh-TW.js +6 -0
- package/lib/Action/Group.d.ts +1 -2
- package/lib/Action/Group.js +333 -176
- package/lib/Action/Item.js +47 -66
- package/lib/Action/index.js +13 -36
- package/lib/Action/style/index.js +25 -43
- package/lib/BackgroundTaskManager/RefreshMan.js +34 -51
- package/lib/BackgroundTaskManager/constants.js +10 -32
- package/lib/BackgroundTaskManager/index.d.ts +2 -0
- package/lib/BackgroundTaskManager/index.js +137 -126
- package/lib/BasicLayout/Header.js +242 -200
- package/lib/BasicLayout/index.d.ts +3 -1
- package/lib/BasicLayout/index.js +308 -317
- 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 +3 -0
- package/lib/BasicLayout/locale/ja-JP.js +19 -34
- 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 +186 -198
- package/lib/BatchOperationBar/index.js +120 -152
- 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 +1 -0
- package/lib/BatchOperationBar/locale/ja-JP.js +11 -28
- 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.js +35 -46
- package/lib/Boundary/Components/Code.js +57 -76
- package/lib/Boundary/Components/Exception.js +103 -124
- package/lib/Boundary/Components/Function.js +47 -63
- 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.js +11 -25
- package/lib/Boundary/locale/en-US.js +14 -32
- package/lib/Boundary/locale/ja-JP.js +14 -32
- package/lib/Boundary/locale/zh-CN.js +14 -32
- package/lib/Boundary/locale/zh-TW.js +14 -32
- package/lib/Boundary/style/index.js +32 -49
- package/lib/Boundary/utils.js +9 -31
- package/lib/ContentWithIcon/index.js +101 -115
- package/lib/ContentWithIcon/style/index.js +17 -36
- package/lib/ContentWithQuestion/index.js +40 -53
- 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 +358 -329
- package/lib/DateRanger/Ranger.d.ts +4 -1
- package/lib/DateRanger/Ranger.js +446 -516
- 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 +2 -0
- package/lib/DateRanger/locale/ja-JP.js +22 -47
- 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.js +101 -72
- package/lib/DateRanger/typing.js +4 -16
- package/lib/Dialog/Anchor.js +70 -96
- package/lib/Dialog/Dock.js +14 -36
- package/lib/Dialog/EventProxy.js +21 -40
- package/lib/Dialog/index.d.ts +5 -0
- package/lib/Dialog/index.js +385 -371
- 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 +5 -0
- package/lib/Dialog/locale/ja-JP.js +13 -26
- 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.js +81 -79
- package/lib/DocDialog/index.js +69 -82
- 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 +3 -1
- package/lib/DocDialog/locale/ja-JP.js +7 -23
- 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 -51
- 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.js +22 -40
- package/lib/FullscreenBox/index.js +159 -139
- 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 +4 -1
- package/lib/FullscreenBox/locale/ja-JP.js +8 -23
- 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.js +52 -48
- package/lib/Highlight/DiffView/DiffCells.js +34 -55
- package/lib/Highlight/DiffView/index.js +165 -164
- package/lib/Highlight/HighlightCell.js +28 -48
- package/lib/Highlight/JsonView.js +45 -75
- package/lib/Highlight/index.js +206 -214
- 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 +2 -0
- package/lib/Highlight/locale/ja-JP.js +9 -25
- 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.js +129 -145
- package/lib/Highlight/useKeyDownCopyEvent.js +40 -65
- package/lib/IconFont/index.js +23 -29
- package/lib/LightFilter/index.d.ts +6 -2
- package/lib/LightFilter/index.js +46 -44
- 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 +43 -54
- package/lib/Login/ActivateForm.js +93 -120
- package/lib/Login/LoginForm.js +149 -185
- package/lib/Login/RegisterForm.js +122 -164
- package/lib/Login/index.js +157 -163
- package/lib/Login/locale/en-US.js +31 -49
- package/lib/Login/locale/ja-JP.js +31 -49
- package/lib/Login/locale/zh-CN.js +31 -49
- package/lib/Login/locale/zh-TW.js +30 -48
- package/lib/Login/style/index.js +78 -99
- package/lib/Lottie/index.js +7 -25
- package/lib/NavMenu/index.d.ts +5 -2
- package/lib/NavMenu/index.js +121 -110
- 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.js +31 -49
- package/lib/PageContainer/ItemRender.js +28 -47
- package/lib/PageContainer/index.js +161 -142
- package/lib/PageContainer/locale/en-US.js +8 -26
- package/lib/PageContainer/locale/ja-JP.js +8 -26
- package/lib/PageContainer/locale/zh-CN.js +8 -26
- package/lib/PageContainer/locale/zh-TW.js +8 -26
- package/lib/PageContainer/style/index.js +55 -47
- package/lib/PageLoading/index.js +33 -55
- package/lib/Password/Content.d.ts +2 -0
- package/lib/Password/Content.js +100 -81
- package/lib/Password/index.d.ts +1 -0
- package/lib/Password/index.js +132 -161
- 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 +1 -0
- package/lib/Password/locale/ja-JP.js +17 -34
- 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 -99
- package/lib/ProCard/style/index.js +31 -38
- package/lib/ProTable/index.js +102 -123
- package/lib/ProTable/style/index.js +21 -38
- package/lib/Ranger/QuickPicker.js +92 -95
- package/lib/Ranger/Ranger.js +98 -134
- 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.js +31 -49
- package/lib/Ranger/locale/zh-CN.js +7 -25
- package/lib/Ranger/locale/zh-TW.js +7 -25
- package/lib/Ranger/style/index.js +22 -40
- package/lib/Ranger/typing.js +4 -16
- package/lib/SideTip/Dragger.js +259 -220
- package/lib/SideTip/IconLoading.js +43 -75
- package/lib/SideTip/index.js +155 -128
- 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 +4 -1
- package/lib/SideTip/locale/ja-JP.js +8 -23
- 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.js +85 -92
- package/lib/SideTip/utils.js +40 -61
- package/lib/TagSelect/Group.js +68 -84
- package/lib/TagSelect/Item.js +68 -92
- 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 -127
- package/lib/TreeSearch/util.js +52 -70
- package/lib/Welcome/index.js +142 -118
- package/lib/Welcome/locale/en-US.js +8 -26
- package/lib/Welcome/locale/ja-JP.js +8 -26
- package/lib/Welcome/locale/zh-CN.js +8 -26
- package/lib/Welcome/locale/zh-TW.js +8 -26
- package/lib/Welcome/step/style/index.js +24 -40
- package/lib/Welcome/step.js +63 -60
- package/lib/Welcome/style/index.js +58 -70
- package/lib/_util/genComponentStyleHook.d.ts +2 -1
- 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.js +282 -129
- package/lib/interface.js +4 -16
- package/lib/locale/LocaleWrapper.js +50 -61
- package/lib/locale/en-US.js +43 -64
- package/lib/locale/index.js +5 -17
- package/lib/locale/ja-JP.js +43 -64
- package/lib/locale/zh-CN.js +42 -63
- package/lib/locale/zh-TW.js +38 -59
- package/package.json +6 -6
|
@@ -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); }
|
|
@@ -48,6 +49,7 @@ var useClickFSA = function useClickFSA() {
|
|
|
48
49
|
var prefixCls = 'ant-picker';
|
|
49
50
|
var TIME_FORMAT = 'HH:mm:ss';
|
|
50
51
|
var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
52
|
+
var _defaultValue$, _defaultValue$2, _calendarValue$, _calendarValue$2;
|
|
51
53
|
var defaultValue = props.defaultValue,
|
|
52
54
|
isMoment = props.isMoment,
|
|
53
55
|
locale = props.locale,
|
|
@@ -91,6 +93,13 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
91
93
|
setActiveIndex = _React$useState6[1];
|
|
92
94
|
var isEn = (locale === null || locale === void 0 ? void 0 : locale.antLocale) === 'en';
|
|
93
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
|
+
|
|
94
103
|
//
|
|
95
104
|
var DATE_FORMAT = isEn ? DATE_TIME_MONTH_FORMAT : DATE_TIME_MONTH_FORMAT_CN;
|
|
96
105
|
var getDateInstance = useCallback(function (v, format, strict) {
|
|
@@ -116,10 +125,8 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
116
125
|
setInternalHoverValues(date && clickFSA === CLICK_STATE.START ? fillCalendarValue(date, activeIndex) : null);
|
|
117
126
|
};
|
|
118
127
|
|
|
119
|
-
//
|
|
120
|
-
var formatValues =
|
|
121
|
-
return (a === null || a === void 0 ? void 0 : a.valueOf()) - (b === null || b === void 0 ? void 0 : b.valueOf());
|
|
122
|
-
}).map(function (item) {
|
|
128
|
+
// 保持原始顺序,不进行排序(只在提交时排序)
|
|
129
|
+
var formatValues = calendarValue.map(function (item) {
|
|
123
130
|
return item === null || item === void 0 ? void 0 : item.format(DATE_FORMAT);
|
|
124
131
|
});
|
|
125
132
|
var _Form$useForm = Form.useForm(),
|
|
@@ -129,14 +136,20 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
129
136
|
_sDate = _formatValues[0],
|
|
130
137
|
_eDate = _formatValues[1];
|
|
131
138
|
var setFormatDateToForm = function setFormatDateToForm() {
|
|
139
|
+
var _calendarValue = _slicedToArray(calendarValue, 2),
|
|
140
|
+
startVal = _calendarValue[0],
|
|
141
|
+
endVal = _calendarValue[1];
|
|
132
142
|
form.setFieldsValue({
|
|
133
143
|
startDate: getDateInstance(_sDate),
|
|
134
|
-
endDate: getDateInstance(_eDate)
|
|
144
|
+
endDate: getDateInstance(_eDate),
|
|
145
|
+
// 同步更新时间值,保持原始顺序
|
|
146
|
+
startTime: startVal || getDateInstance(),
|
|
147
|
+
endTime: endVal || getDateInstance()
|
|
135
148
|
});
|
|
136
149
|
};
|
|
137
150
|
useEffect(function () {
|
|
138
151
|
setFormatDateToForm();
|
|
139
|
-
}, [
|
|
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()]);
|
|
140
153
|
var defaultTime = useMemo(function () {
|
|
141
154
|
return getDateInstance();
|
|
142
155
|
}, []);
|
|
@@ -198,7 +211,7 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
198
211
|
}],
|
|
199
212
|
children: /*#__PURE__*/_jsx(DatePicker, {
|
|
200
213
|
format: {
|
|
201
|
-
format:
|
|
214
|
+
format: DATE_FORMAT,
|
|
202
215
|
type: 'mask'
|
|
203
216
|
},
|
|
204
217
|
style: {
|
|
@@ -274,7 +287,7 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
274
287
|
}],
|
|
275
288
|
children: /*#__PURE__*/_jsx(DatePicker, {
|
|
276
289
|
format: {
|
|
277
|
-
format:
|
|
290
|
+
format: DATE_FORMAT,
|
|
278
291
|
type: 'mask'
|
|
279
292
|
},
|
|
280
293
|
style: {
|
|
@@ -412,15 +425,18 @@ var InternalPickerPanel = function InternalPickerPanel(props) {
|
|
|
412
425
|
startTime = values.startTime,
|
|
413
426
|
endDate = values.endDate,
|
|
414
427
|
endTime = values.endTime;
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
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],
|
|
419
437
|
_ref6 = _slicedToArray(_ref5, 2),
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
var start = "".concat(formatDate(startDate), " ").concat(sTime.format(TIME_FORMAT));
|
|
423
|
-
var end = "".concat(formatDate(endDate), " ").concat(eTime.format(TIME_FORMAT));
|
|
438
|
+
start = _ref6[0],
|
|
439
|
+
end = _ref6[1];
|
|
424
440
|
var errorList = [];
|
|
425
441
|
var message = '';
|
|
426
442
|
rules === null || rules === void 0 || rules.some(function (item) {
|
|
@@ -2,6 +2,7 @@ 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';
|
|
@@ -12,7 +13,7 @@ export type RangeDateValue = {
|
|
|
12
13
|
name: RangeName;
|
|
13
14
|
range: RangeValue;
|
|
14
15
|
};
|
|
15
|
-
export interface DateRangerProps extends Omit<RangePickerProps, 'mode' | 'picker' | 'value' | 'defaultValue'> {
|
|
16
|
+
export interface DateRangerProps extends Omit<RangePickerProps, 'mode' | 'picker' | 'value' | 'defaultValue' | 'variant'> {
|
|
16
17
|
selects?: RangeOption[];
|
|
17
18
|
defaultQuickValue?: string;
|
|
18
19
|
hasRewind?: boolean;
|
|
@@ -37,6 +38,8 @@ export interface DateRangerProps extends Omit<RangePickerProps, 'mode' | 'picker
|
|
|
37
38
|
value?: RangeValue;
|
|
38
39
|
defaultValue?: RangeValue;
|
|
39
40
|
size?: 'small' | 'large' | 'middle';
|
|
41
|
+
/** 边框变体,默认实线,可配置为 dashed 虚线 */
|
|
42
|
+
variant?: 'dashed';
|
|
40
43
|
tooltipProps?: TooltipProps;
|
|
41
44
|
autoAdjustOverflow?: boolean;
|
|
42
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; }
|
|
@@ -18,14 +19,16 @@ 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
21
|
import React, { useContext, useEffect, useRef, useState, useImperativeHandle, useMemo } from 'react';
|
|
21
|
-
import { Button, ConfigProvider,
|
|
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 { CUSTOMIZE,
|
|
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";
|
|
29
32
|
import InternalPickerPanel from "./PickerPanel";
|
|
30
33
|
import zhCN from "./locale/zh-CN";
|
|
31
34
|
import useStyle from "./style";
|
|
@@ -78,6 +81,7 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
78
81
|
size = props.size,
|
|
79
82
|
_props$stickRangeName = props.stickRangeName,
|
|
80
83
|
stickRangeName = _props$stickRangeName === void 0 ? false : _props$stickRangeName,
|
|
84
|
+
variant = props.variant,
|
|
81
85
|
tooltipProps = props.tooltipProps,
|
|
82
86
|
isMomentProps = props.isMoment,
|
|
83
87
|
rules = props.rules,
|
|
@@ -131,6 +135,7 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
131
135
|
var rangeRef = useRef(null);
|
|
132
136
|
var popRef = useRef(null);
|
|
133
137
|
var labelRef = useRef(null);
|
|
138
|
+
var editableInputRef = useRef(null);
|
|
134
139
|
|
|
135
140
|
// 没有 selects 时,回退到普通 RangePicker, 当前时间选项为自定义时,应该显示 RangePicker
|
|
136
141
|
var _useState13 = useState(rangeName !== CUSTOMIZE),
|
|
@@ -315,7 +320,7 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
315
320
|
return diffMs > differenceMs;
|
|
316
321
|
}) : selects[rangeNameIndex + 1];
|
|
317
322
|
return wrapSSR( /*#__PURE__*/_jsxs(Space, {
|
|
318
|
-
className: classNames(rest.className, _defineProperty(_defineProperty(_defineProperty({}, prefix, true), "".concat(prefix, "-show-range"), true), "".concat(prefix, "-back-radio-focused"), backRadioFocused)),
|
|
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)),
|
|
319
324
|
style: rest.style,
|
|
320
325
|
children: [/*#__PURE__*/_jsxs(Space, {
|
|
321
326
|
size: 0,
|
|
@@ -450,12 +455,22 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
450
455
|
rules: rules,
|
|
451
456
|
hideSecond: hideSecond,
|
|
452
457
|
onOk: function onOk(vList) {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
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
|
+
}
|
|
459
474
|
},
|
|
460
475
|
onCancel: function onCancel() {
|
|
461
476
|
closeTooltip();
|
|
@@ -517,36 +532,27 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
517
532
|
})
|
|
518
533
|
}), (!simpleMode || !isPlay) && /*#__PURE__*/_jsx("span", {
|
|
519
534
|
ref: rangeRef,
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
// pointerEvents: 'none',
|
|
528
|
-
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);
|
|
529
542
|
},
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
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);
|
|
536
552
|
}
|
|
537
|
-
|
|
538
|
-
,
|
|
539
|
-
value: innerValue,
|
|
540
|
-
onChange: datePickerChange,
|
|
541
|
-
allowClear: false,
|
|
542
|
-
size: size,
|
|
543
|
-
suffixIcon: null
|
|
544
|
-
// 透传 props 到 antd Ranger
|
|
545
|
-
}, omit(rest, 'value', 'onChange', 'style', 'className')), {}, {
|
|
546
|
-
open: false
|
|
547
|
-
}))
|
|
553
|
+
}, omit(rest, 'value', 'onChange', 'style', 'className', 'onClick', 'disabled', 'format')))
|
|
548
554
|
})]
|
|
549
|
-
}), /*#__PURE__*/_jsxs(Radio.Group, {
|
|
555
|
+
}), (hasRewind || hasForward) && /*#__PURE__*/_jsxs(Radio.Group, {
|
|
550
556
|
value: isPlay ? 'play' : '',
|
|
551
557
|
className: "".concat(prefix, "-playback-control"),
|
|
552
558
|
buttonStyle: "solid",
|
|
@@ -557,6 +563,7 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
557
563
|
},
|
|
558
564
|
children: /*#__PURE__*/_jsx(Radio.Button, {
|
|
559
565
|
value: "stepBack",
|
|
566
|
+
"aria-label": locale.jumpBack,
|
|
560
567
|
style: {
|
|
561
568
|
paddingInline: 8,
|
|
562
569
|
borderInlineStart: 0,
|
|
@@ -579,7 +586,9 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
579
586
|
rangeChange([newStartTime, newEndTime]);
|
|
580
587
|
}
|
|
581
588
|
},
|
|
582
|
-
children: /*#__PURE__*/_jsx(LeftOutlined, {
|
|
589
|
+
children: /*#__PURE__*/_jsx(LeftOutlined, {
|
|
590
|
+
"aria-hidden": true
|
|
591
|
+
})
|
|
583
592
|
})
|
|
584
593
|
}), hasForward && /*#__PURE__*/_jsx(Tooltip, {
|
|
585
594
|
title: locale.jumpForward,
|
|
@@ -588,9 +597,9 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
588
597
|
},
|
|
589
598
|
children: /*#__PURE__*/_jsx(Radio.Button, {
|
|
590
599
|
value: "stepForward",
|
|
600
|
+
"aria-label": locale.jumpForward,
|
|
591
601
|
style: {
|
|
592
602
|
paddingInline: 8,
|
|
593
|
-
borderInlineStart: 0,
|
|
594
603
|
borderTopLeftRadius: 0,
|
|
595
604
|
borderBottomLeftRadius: 0
|
|
596
605
|
}
|
|
@@ -608,11 +617,14 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
608
617
|
}
|
|
609
618
|
}
|
|
610
619
|
},
|
|
611
|
-
children: /*#__PURE__*/_jsx(RightOutlined, {
|
|
620
|
+
children: /*#__PURE__*/_jsx(RightOutlined, {
|
|
621
|
+
"aria-hidden": true
|
|
622
|
+
})
|
|
612
623
|
})
|
|
613
624
|
})]
|
|
614
625
|
})]
|
|
615
626
|
}), hasSync && rangeName !== CUSTOMIZE && /*#__PURE__*/_jsx(Button, {
|
|
627
|
+
"aria-label": locale.syncToCurrent,
|
|
616
628
|
style: {
|
|
617
629
|
paddingInline: 8,
|
|
618
630
|
color: token.colorTextSecondary
|
|
@@ -620,8 +632,11 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
620
632
|
onClick: function onClick() {
|
|
621
633
|
setNow();
|
|
622
634
|
},
|
|
623
|
-
children: /*#__PURE__*/_jsx(SyncOutlined, {
|
|
635
|
+
children: /*#__PURE__*/_jsx(SyncOutlined, {
|
|
636
|
+
"aria-hidden": true
|
|
637
|
+
})
|
|
624
638
|
}), hasZoomOut && /*#__PURE__*/_jsx(Button, {
|
|
639
|
+
"aria-label": locale.zoomOutRange,
|
|
625
640
|
disabled: !nextRangeItem,
|
|
626
641
|
style: {
|
|
627
642
|
color: token.colorTextSecondary
|
|
@@ -634,7 +649,9 @@ var Ranger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
634
649
|
return;
|
|
635
650
|
}
|
|
636
651
|
},
|
|
637
|
-
icon: /*#__PURE__*/_jsx(ZoomOutOutlined, {
|
|
652
|
+
icon: /*#__PURE__*/_jsx(ZoomOutOutlined, {
|
|
653
|
+
"aria-hidden": true
|
|
654
|
+
})
|
|
638
655
|
})]
|
|
639
656
|
}));
|
|
640
657
|
});
|
|
@@ -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;
|