one-design-next 0.0.4-alpha.57
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/LICENSE +21 -0
- package/README.md +32 -0
- package/dist/_util/color.d.ts +103 -0
- package/dist/_util/color.js +250 -0
- package/dist/_util/date.d.ts +53 -0
- package/dist/_util/date.js +656 -0
- package/dist/_util/focusManager.d.ts +12 -0
- package/dist/_util/focusManager.js +56 -0
- package/dist/_util/queueMtPolyfill.d.ts +5 -0
- package/dist/_util/queueMtPolyfill.js +19 -0
- package/dist/_util/time.d.ts +44 -0
- package/dist/_util/time.js +150 -0
- package/dist/_util/useActive.d.ts +6 -0
- package/dist/_util/useActive.js +25 -0
- package/dist/alert/index.d.ts +63 -0
- package/dist/alert/index.js +137 -0
- package/dist/alert/style/index.css +199 -0
- package/dist/alert/style/index.d.ts +2 -0
- package/dist/alert/style/index.js +2 -0
- package/dist/auto-complete/index.d.ts +51 -0
- package/dist/auto-complete/index.js +104 -0
- package/dist/avatar/index.d.ts +68 -0
- package/dist/avatar/index.js +177 -0
- package/dist/avatar/primitive.d.ts +6 -0
- package/dist/avatar/primitive.js +23 -0
- package/dist/avatar/style/index.css +79 -0
- package/dist/avatar/style/index.d.ts +2 -0
- package/dist/avatar/style/index.js +2 -0
- package/dist/button/index.d.ts +15 -0
- package/dist/button/index.js +64 -0
- package/dist/button/style/index.css +347 -0
- package/dist/button/style/index.d.ts +2 -0
- package/dist/button/style/index.js +2 -0
- package/dist/calendar/index.d.ts +25 -0
- package/dist/calendar/index.js +379 -0
- package/dist/calendar/style/index.css +3 -0
- package/dist/calendar/style/index.d.ts +2 -0
- package/dist/calendar/style/index.js +2 -0
- package/dist/cascader/CascaderOptionContent.d.ts +20 -0
- package/dist/cascader/CascaderOptionContent.js +75 -0
- package/dist/cascader/Panel.d.ts +53 -0
- package/dist/cascader/Panel.js +116 -0
- package/dist/cascader/index.d.ts +54 -0
- package/dist/cascader/index.js +314 -0
- package/dist/cascader/style/index.css +458 -0
- package/dist/cascader/style/index.d.ts +2 -0
- package/dist/cascader/style/index.js +2 -0
- package/dist/cascader/utils.d.ts +12 -0
- package/dist/cascader/utils.js +85 -0
- package/dist/chart/index.d.ts +14 -0
- package/dist/chart/index.js +11 -0
- package/dist/chart/style/index.css +0 -0
- package/dist/chart/style/index.d.ts +2 -0
- package/dist/chart/style/index.js +2 -0
- package/dist/checkbox/Checkbox.d.ts +69 -0
- package/dist/checkbox/Checkbox.js +148 -0
- package/dist/checkbox/Context.d.ts +21 -0
- package/dist/checkbox/Context.js +2 -0
- package/dist/checkbox/Group.d.ts +49 -0
- package/dist/checkbox/Group.js +125 -0
- package/dist/checkbox/index.d.ts +5 -0
- package/dist/checkbox/index.js +3 -0
- package/dist/checkbox/style/index.css +306 -0
- package/dist/checkbox/style/index.d.ts +2 -0
- package/dist/checkbox/style/index.js +2 -0
- package/dist/collapse/index.d.ts +43 -0
- package/dist/collapse/index.js +111 -0
- package/dist/collapse/primitive.d.ts +21 -0
- package/dist/collapse/primitive.js +107 -0
- package/dist/collapse/style/index.css +63 -0
- package/dist/collapse/style/index.d.ts +2 -0
- package/dist/collapse/style/index.js +2 -0
- package/dist/color-picker/index.d.ts +55 -0
- package/dist/color-picker/index.js +588 -0
- package/dist/color-picker/style/index.css +153 -0
- package/dist/color-picker/style/index.d.ts +2 -0
- package/dist/color-picker/style/index.js +2 -0
- package/dist/config-provider/index.d.ts +46 -0
- package/dist/config-provider/index.js +37 -0
- package/dist/date-picker/MonthPicker.d.ts +15 -0
- package/dist/date-picker/MonthPicker.js +134 -0
- package/dist/date-picker/QuarterPicker.d.ts +15 -0
- package/dist/date-picker/QuarterPicker.js +135 -0
- package/dist/date-picker/YearPicker.d.ts +13 -0
- package/dist/date-picker/YearPicker.js +81 -0
- package/dist/date-picker/index.d.ts +172 -0
- package/dist/date-picker/index.js +1138 -0
- package/dist/date-picker/style/index.css +548 -0
- package/dist/date-picker/style/index.d.ts +2 -0
- package/dist/date-picker/style/index.js +2 -0
- package/dist/date-range-picker/index.d.ts +46 -0
- package/dist/date-range-picker/index.js +1034 -0
- package/dist/dialog/index.d.ts +132 -0
- package/dist/dialog/index.js +282 -0
- package/dist/dialog/style/index.css +252 -0
- package/dist/dialog/style/index.d.ts +2 -0
- package/dist/dialog/style/index.js +2 -0
- package/dist/dialog/useModalPosition.d.ts +6 -0
- package/dist/dialog/useModalPosition.js +34 -0
- package/dist/drawer/index.d.ts +76 -0
- package/dist/drawer/index.js +186 -0
- package/dist/drawer/style/index.css +235 -0
- package/dist/drawer/style/index.d.ts +2 -0
- package/dist/drawer/style/index.js +2 -0
- package/dist/dropdown/index.d.ts +86 -0
- package/dist/dropdown/index.js +836 -0
- package/dist/dropdown/style/index.css +236 -0
- package/dist/dropdown/style/index.d.ts +2 -0
- package/dist/dropdown/style/index.js +2 -0
- package/dist/hover-fill/index.d.ts +43 -0
- package/dist/hover-fill/index.js +222 -0
- package/dist/hover-fill/style/index.css +38 -0
- package/dist/hover-fill/style/index.d.ts +2 -0
- package/dist/hover-fill/style/index.js +2 -0
- package/dist/icon/index.d.ts +11 -0
- package/dist/icon/index.js +95 -0
- package/dist/icon/style/index.css +15 -0
- package/dist/icon/style/index.d.ts +2 -0
- package/dist/icon/style/index.js +2 -0
- package/dist/icon/svg/alert/alert-circle-filled.svg +1 -0
- package/dist/icon/svg/alert/alert-circle.svg +1 -0
- package/dist/icon/svg/alert/help-circle-filled.svg +1 -0
- package/dist/icon/svg/alert/help-circle.svg +1 -0
- package/dist/icon/svg/alert/info-circle-filled.svg +1 -0
- package/dist/icon/svg/alert/info-circle.svg +1 -0
- package/dist/icon/svg/alert/stop.svg +1 -0
- package/dist/icon/svg/alert/warning-filled.svg +1 -0
- package/dist/icon/svg/alert/warning.svg +1 -0
- package/dist/icon/svg/content/QRcode.svg +1 -0
- package/dist/icon/svg/content/bell-filled.svg +1 -0
- package/dist/icon/svg/content/bell.svg +1 -0
- package/dist/icon/svg/content/bidding.svg +1 -0
- package/dist/icon/svg/content/calendar.svg +1 -0
- package/dist/icon/svg/content/code.svg +1 -0
- package/dist/icon/svg/content/customColumn.svg +1 -0
- package/dist/icon/svg/content/data.svg +1 -0
- package/dist/icon/svg/content/dataReport-filled.svg +1 -0
- package/dist/icon/svg/content/dataReport.svg +1 -0
- package/dist/icon/svg/content/download-1.svg +1 -0
- package/dist/icon/svg/content/download-filled.svg +1 -0
- package/dist/icon/svg/content/download.svg +1 -0
- package/dist/icon/svg/content/exchange.svg +1 -0
- package/dist/icon/svg/content/filter-filled.svg +1 -0
- package/dist/icon/svg/content/filter.svg +1 -0
- package/dist/icon/svg/content/hot-filled.svg +1 -0
- package/dist/icon/svg/content/hot.svg +1 -0
- package/dist/icon/svg/content/link.svg +1 -0
- package/dist/icon/svg/content/location.svg +1 -0
- package/dist/icon/svg/content/maxSize.svg +1 -0
- package/dist/icon/svg/content/mobile-filled.svg +1 -0
- package/dist/icon/svg/content/mobile.svg +1 -0
- package/dist/icon/svg/content/mute.svg +1 -0
- package/dist/icon/svg/content/mutiImage-filled.svg +1 -0
- package/dist/icon/svg/content/mutiImage.svg +1 -0
- package/dist/icon/svg/content/refresh.svg +1 -0
- package/dist/icon/svg/content/report.svg +1 -0
- package/dist/icon/svg/content/save.svg +1 -0
- package/dist/icon/svg/content/search-bold.svg +1 -0
- package/dist/icon/svg/content/search-filled.svg +1 -0
- package/dist/icon/svg/content/search.svg +1 -0
- package/dist/icon/svg/content/setting.svg +1 -0
- package/dist/icon/svg/content/share.svg +1 -0
- package/dist/icon/svg/content/sort.svg +1 -0
- package/dist/icon/svg/content/sound.svg +1 -0
- package/dist/icon/svg/content/sticker-filled.svg +1 -0
- package/dist/icon/svg/content/sticker.svg +1 -0
- package/dist/icon/svg/content/tag-filled.svg +1 -0
- package/dist/icon/svg/content/tag.svg +1 -0
- package/dist/icon/svg/content/thumbDown-filled.svg +1 -0
- package/dist/icon/svg/content/thumbDown.svg +1 -0
- package/dist/icon/svg/content/thumbUp-filled.svg +1 -0
- package/dist/icon/svg/content/thumbUp.svg +1 -0
- package/dist/icon/svg/content/time-bold.svg +1 -0
- package/dist/icon/svg/content/time.svg +1 -0
- package/dist/icon/svg/content/verify.svg +1 -0
- package/dist/icon/svg/content/video.svg +1 -0
- package/dist/icon/svg/content/videoScreenshot.svg +1 -0
- package/dist/icon/svg/content/zoomIn.svg +1 -0
- package/dist/icon/svg/content/zoomOut.svg +1 -0
- package/dist/icon/svg/data/compare.svg +1 -0
- package/dist/icon/svg/data/histogram.svg +1 -0
- package/dist/icon/svg/editor/cancel-circle-filled.svg +1 -0
- package/dist/icon/svg/editor/cancel-circle.svg +1 -0
- package/dist/icon/svg/editor/cancel.svg +1 -0
- package/dist/icon/svg/editor/check-circle-filled.svg +1 -0
- package/dist/icon/svg/editor/check-circle.svg +1 -0
- package/dist/icon/svg/editor/check.svg +1 -0
- package/dist/icon/svg/editor/copy.svg +1 -0
- package/dist/icon/svg/editor/custom-filled.svg +1 -0
- package/dist/icon/svg/editor/custom.svg +1 -0
- package/dist/icon/svg/editor/delete.svg +1 -0
- package/dist/icon/svg/editor/deleteAD-filled.svg +1 -0
- package/dist/icon/svg/editor/draggable.svg +1 -0
- package/dist/icon/svg/editor/edit.svg +1 -0
- package/dist/icon/svg/editor/import.svg +1 -0
- package/dist/icon/svg/editor/minus-circle-filled.svg +1 -0
- package/dist/icon/svg/editor/minus-circle.svg +1 -0
- package/dist/icon/svg/editor/minus.svg +1 -0
- package/dist/icon/svg/editor/modify-bold.svg +1 -0
- package/dist/icon/svg/editor/modify.svg +1 -0
- package/dist/icon/svg/editor/multiCreate.svg +1 -0
- package/dist/icon/svg/editor/mutiSelect-filled.svg +1 -0
- package/dist/icon/svg/editor/mutiSelect.svg +1 -0
- package/dist/icon/svg/editor/pause-filled.svg +1 -0
- package/dist/icon/svg/editor/play-filled.svg +1 -0
- package/dist/icon/svg/editor/plus-circle-filled.svg +1 -0
- package/dist/icon/svg/editor/plus-circle.svg +1 -0
- package/dist/icon/svg/editor/plus.svg +1 -0
- package/dist/icon/svg/editor/send.svg +1 -0
- package/dist/icon/svg/editor/subdivide.svg +1 -0
- package/dist/icon/svg/navigation/arrowDown-filled.svg +1 -0
- package/dist/icon/svg/navigation/arrowDown.svg +1 -0
- package/dist/icon/svg/navigation/arrowLeft-filled.svg +1 -0
- package/dist/icon/svg/navigation/arrowLeft.svg +1 -0
- package/dist/icon/svg/navigation/arrowRight-filled.svg +1 -0
- package/dist/icon/svg/navigation/arrowRight.svg +1 -0
- package/dist/icon/svg/navigation/arrowUp-filled.svg +1 -0
- package/dist/icon/svg/navigation/arrowUp.svg +1 -0
- package/dist/icon/svg/navigation/bottom-filled.svg +1 -0
- package/dist/icon/svg/navigation/bottom.svg +1 -0
- package/dist/icon/svg/navigation/doubleLeft-filled.svg +1 -0
- package/dist/icon/svg/navigation/doubleLeft.svg +1 -0
- package/dist/icon/svg/navigation/doubleRight-filled.svg +1 -0
- package/dist/icon/svg/navigation/doubleRight.svg +1 -0
- package/dist/icon/svg/navigation/down-bold.svg +1 -0
- package/dist/icon/svg/navigation/down-filled.svg +1 -0
- package/dist/icon/svg/navigation/down.svg +1 -0
- package/dist/icon/svg/navigation/fall-filled.svg +1 -0
- package/dist/icon/svg/navigation/fold.svg +1 -0
- package/dist/icon/svg/navigation/fullScreen.svg +1 -0
- package/dist/icon/svg/navigation/left-bold.svg +1 -0
- package/dist/icon/svg/navigation/left-filled.svg +1 -0
- package/dist/icon/svg/navigation/left.svg +1 -0
- package/dist/icon/svg/navigation/leftFirst-filled.svg +1 -0
- package/dist/icon/svg/navigation/leftFirst.svg +1 -0
- package/dist/icon/svg/navigation/logout.svg +1 -0
- package/dist/icon/svg/navigation/menu.svg +1 -0
- package/dist/icon/svg/navigation/menuLeft-bold.svg +1 -0
- package/dist/icon/svg/navigation/menuLeft.svg +1 -0
- package/dist/icon/svg/navigation/menuRight-bold.svg +1 -0
- package/dist/icon/svg/navigation/menuRight.svg +1 -0
- package/dist/icon/svg/navigation/more-vertical.svg +1 -0
- package/dist/icon/svg/navigation/more.svg +1 -0
- package/dist/icon/svg/navigation/pointerLeft-filled.svg +1 -0
- package/dist/icon/svg/navigation/pointerRight-filled.svg +1 -0
- package/dist/icon/svg/navigation/right-bold.svg +1 -0
- package/dist/icon/svg/navigation/right-filled.svg +1 -0
- package/dist/icon/svg/navigation/right.svg +1 -0
- package/dist/icon/svg/navigation/rightLast-filled.svg +1 -0
- package/dist/icon/svg/navigation/rightLast.svg +1 -0
- package/dist/icon/svg/navigation/rise-filled.svg +1 -0
- package/dist/icon/svg/navigation/top-filled.svg +1 -0
- package/dist/icon/svg/navigation/top.svg +1 -0
- package/dist/icon/svg/navigation/unfold-filled.svg +1 -0
- package/dist/icon/svg/navigation/unfold.svg +1 -0
- package/dist/icon/svg/navigation/up-bold.svg +1 -0
- package/dist/icon/svg/navigation/up-filled.svg +1 -0
- package/dist/icon/svg/navigation/up.svg +1 -0
- package/dist/icon/svg/product/AIFile.svg +1 -0
- package/dist/icon/svg/product/LandingPage.svg +1 -0
- package/dist/icon/svg/product/addressBook.svg +1 -0
- package/dist/icon/svg/product/alarmClock.svg +1 -0
- package/dist/icon/svg/product/asset-square.svg +1 -0
- package/dist/icon/svg/product/assetProtecting.svg +1 -0
- package/dist/icon/svg/product/autoAD-square-filled.svg +1 -0
- package/dist/icon/svg/product/channels-square-filled.svg +1 -0
- package/dist/icon/svg/product/channels.svg +1 -0
- package/dist/icon/svg/product/chatBubble-filled.svg +1 -0
- package/dist/icon/svg/product/checkBadge.svg +1 -0
- package/dist/icon/svg/product/comments.svg +1 -0
- package/dist/icon/svg/product/container.svg +1 -0
- package/dist/icon/svg/product/dataAuth.svg +1 -0
- package/dist/icon/svg/product/dataBoard.svg +1 -0
- package/dist/icon/svg/product/dataBox.svg +1 -0
- package/dist/icon/svg/product/dataFolder.svg +1 -0
- package/dist/icon/svg/product/dataRising.svg +1 -0
- package/dist/icon/svg/product/detect.svg +1 -0
- package/dist/icon/svg/product/exposure-filled.svg +1 -0
- package/dist/icon/svg/product/extendedConfig.svg +1 -0
- package/dist/icon/svg/product/file-filled.svg +1 -0
- package/dist/icon/svg/product/flag.svg +1 -0
- package/dist/icon/svg/product/folderZip.svg +1 -0
- package/dist/icon/svg/product/folderzip-bold.svg +1 -0
- package/dist/icon/svg/product/guideBook.svg +1 -0
- package/dist/icon/svg/product/hosting.svg +1 -0
- package/dist/icon/svg/product/icon-outlined.svg +1 -0
- package/dist/icon/svg/product/idea-bold.svg +1 -0
- package/dist/icon/svg/product/idea.svg +1 -0
- package/dist/icon/svg/product/image-bold.svg +1 -0
- package/dist/icon/svg/product/image-filled.svg +1 -0
- package/dist/icon/svg/product/image.svg +1 -0
- package/dist/icon/svg/product/images.svg +1 -0
- package/dist/icon/svg/product/keyword.svg +1 -0
- package/dist/icon/svg/product/linkSquare.svg +1 -0
- package/dist/icon/svg/product/lock.svg +1 -0
- package/dist/icon/svg/product/magic-filled.svg +1 -0
- package/dist/icon/svg/product/magic.svg +1 -0
- package/dist/icon/svg/product/miniProgram.svg +1 -0
- package/dist/icon/svg/product/minigame-filled.svg +1 -0
- package/dist/icon/svg/product/mobilePage.svg +1 -0
- package/dist/icon/svg/product/moments-filled.svg +1 -0
- package/dist/icon/svg/product/notepad-bold.svg +1 -0
- package/dist/icon/svg/product/notepad.svg +1 -0
- package/dist/icon/svg/product/offiaccount-filled.svg +1 -0
- package/dist/icon/svg/product/playing.svg +1 -0
- package/dist/icon/svg/product/qualification.svg +1 -0
- package/dist/icon/svg/product/quickFile.svg +1 -0
- package/dist/icon/svg/product/ringStruckture.svg +1 -0
- package/dist/icon/svg/product/searchAD-filled.svg +1 -0
- package/dist/icon/svg/product/searchAD.svg +1 -0
- package/dist/icon/svg/product/shield-filled.svg +1 -0
- package/dist/icon/svg/product/shield.svg +1 -0
- package/dist/icon/svg/product/shop.svg +1 -0
- package/dist/icon/svg/product/shopping.svg +1 -0
- package/dist/icon/svg/product/star-filled.svg +1 -0
- package/dist/icon/svg/product/star.svg +1 -0
- package/dist/icon/svg/product/support-bold.svg +1 -0
- package/dist/icon/svg/product/target.svg +1 -0
- package/dist/icon/svg/product/targeting.svg +1 -0
- package/dist/icon/svg/product/task-filled.svg +1 -0
- package/dist/icon/svg/product/task.svg +1 -0
- package/dist/icon/svg/product/template.svg +1 -0
- package/dist/icon/svg/product/templateBag.svg +1 -0
- package/dist/icon/svg/product/text.svg +1 -0
- package/dist/icon/svg/product/treeStructure.svg +1 -0
- package/dist/icon/svg/product/user-circle.svg +1 -0
- package/dist/icon/svg/product/userList.svg +1 -0
- package/dist/icon/svg/product/userPack.svg +1 -0
- package/dist/icon/svg/product/users-bold.svg +1 -0
- package/dist/icon/svg/product/users.svg +1 -0
- package/dist/icon/svg/product/videoBag-filled.svg +1 -0
- package/dist/icon/svg/product/viewMask.svg +1 -0
- package/dist/icon/svg/product/wallet.svg +1 -0
- package/dist/icon/svg/product/wechatBubble-filled.svg +1 -0
- package/dist/icon/svg/product/wechatBubble.svg +1 -0
- package/dist/icon/svg/product/wechatSearch.svg +1 -0
- package/dist/icon/svg/product/writing.svg +1 -0
- package/dist/icon/svg-data.d.ts +221 -0
- package/dist/icon/svg-data.js +224 -0
- package/dist/icon/test-icons.html +122 -0
- package/dist/icon/types.d.ts +3 -0
- package/dist/icon/types.js +10 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +46 -0
- package/dist/input/index.d.ts +80 -0
- package/dist/input/index.js +437 -0
- package/dist/input/style/index.css +256 -0
- package/dist/input/style/index.d.ts +2 -0
- package/dist/input/style/index.js +2 -0
- package/dist/input-number/index.d.ts +36 -0
- package/dist/input-number/index.js +429 -0
- package/dist/input-number/style/index.css +70 -0
- package/dist/input-number/style/index.d.ts +2 -0
- package/dist/input-number/style/index.js +2 -0
- package/dist/input-otp/index.d.ts +71 -0
- package/dist/input-otp/index.js +87 -0
- package/dist/input-otp/style/index.css +114 -0
- package/dist/input-otp/style/index.d.ts +2 -0
- package/dist/input-otp/style/index.js +2 -0
- package/dist/message/MessageBase.d.ts +86 -0
- package/dist/message/MessageBase.js +395 -0
- package/dist/message/MessageReact16.d.ts +2 -0
- package/dist/message/MessageReact16.js +86 -0
- package/dist/message/MessageReact18.d.ts +2 -0
- package/dist/message/MessageReact18.js +98 -0
- package/dist/message/index.d.ts +3 -0
- package/dist/message/index.js +7 -0
- package/dist/message/style/index.css +133 -0
- package/dist/message/style/index.d.ts +2 -0
- package/dist/message/style/index.js +2 -0
- package/dist/modal-base/gap.d.ts +14 -0
- package/dist/modal-base/gap.js +31 -0
- package/dist/modal-base/index.d.ts +26 -0
- package/dist/modal-base/index.js +110 -0
- package/dist/number-flow/index.d.ts +13 -0
- package/dist/number-flow/index.js +25 -0
- package/dist/number-flow/style/index.css +0 -0
- package/dist/number-flow/style/index.d.ts +2 -0
- package/dist/number-flow/style/index.js +2 -0
- package/dist/pagination/index.d.ts +38 -0
- package/dist/pagination/index.js +349 -0
- package/dist/pagination/style/index.css +128 -0
- package/dist/pagination/style/index.d.ts +2 -0
- package/dist/pagination/style/index.js +2 -0
- package/dist/pop-base/index.d.ts +123 -0
- package/dist/pop-base/index.js +349 -0
- package/dist/pop-base/mergeProps.d.ts +37 -0
- package/dist/pop-base/mergeProps.js +144 -0
- package/dist/pop-base/style/index.css +150 -0
- package/dist/pop-base/style/index.d.ts +2 -0
- package/dist/pop-base/style/index.js +2 -0
- package/dist/pop-base/useForkRef.d.ts +5 -0
- package/dist/pop-base/useForkRef.js +52 -0
- package/dist/popover/index.d.ts +4 -0
- package/dist/popover/index.js +9 -0
- package/dist/radio/index.d.ts +21 -0
- package/dist/radio/index.js +45 -0
- package/dist/radio/primitive.d.ts +5 -0
- package/dist/radio/primitive.js +28 -0
- package/dist/radio/style/index.css +219 -0
- package/dist/radio/style/index.d.ts +2 -0
- package/dist/radio/style/index.js +2 -0
- package/dist/scroll-area/index.d.ts +24 -0
- package/dist/scroll-area/index.js +96 -0
- package/dist/scroll-area/style/index.css +77 -0
- package/dist/scroll-area/style/index.d.ts +2 -0
- package/dist/scroll-area/style/index.js +2 -0
- package/dist/select/index.d.ts +85 -0
- package/dist/select/index.js +262 -0
- package/dist/select/style/index.css +1736 -0
- package/dist/select/style/index.d.ts +2 -0
- package/dist/select/style/index.js +2 -0
- package/dist/select/useIcons.d.ts +25 -0
- package/dist/select/useIcons.js +80 -0
- package/dist/slider/index.d.ts +69 -0
- package/dist/slider/index.js +264 -0
- package/dist/slider/style/index.css +237 -0
- package/dist/slider/style/index.d.ts +2 -0
- package/dist/slider/style/index.js +2 -0
- package/dist/style/base.css +298 -0
- package/dist/style/index.d.ts +6 -0
- package/dist/style/index.js +17 -0
- package/dist/switch/index.d.ts +12 -0
- package/dist/switch/index.js +55 -0
- package/dist/switch/style/index.css +152 -0
- package/dist/switch/style/index.d.ts +2 -0
- package/dist/switch/style/index.js +2 -0
- package/dist/table/TableCellContent.d.ts +20 -0
- package/dist/table/TableCellContent.js +77 -0
- package/dist/table/index.d.ts +97 -0
- package/dist/table/index.js +791 -0
- package/dist/table/style/index.css +320 -0
- package/dist/table/style/index.d.ts +2 -0
- package/dist/table/style/index.js +2 -0
- package/dist/table/useSelection.d.ts +13 -0
- package/dist/table/useSelection.js +259 -0
- package/dist/tabs/index.d.ts +51 -0
- package/dist/tabs/index.js +617 -0
- package/dist/tabs/style/index.css +369 -0
- package/dist/tabs/style/index.d.ts +2 -0
- package/dist/tabs/style/index.js +2 -0
- package/dist/text-swap/index.d.ts +58 -0
- package/dist/text-swap/index.js +280 -0
- package/dist/text-swap/style/index.css +32 -0
- package/dist/text-swap/style/index.d.ts +2 -0
- package/dist/text-swap/style/index.js +2 -0
- package/dist/time-picker/index.d.ts +67 -0
- package/dist/time-picker/index.js +945 -0
- package/dist/time-picker/style/index.css +166 -0
- package/dist/time-picker/style/index.d.ts +2 -0
- package/dist/time-picker/style/index.js +2 -0
- package/dist/tooltip/index.d.ts +10 -0
- package/dist/tooltip/index.js +178 -0
- package/dist/tree-select/index.d.ts +25 -0
- package/dist/tree-select/index.js +140 -0
- package/dist/tree-select/style/index.css +204 -0
- package/dist/tree-select/style/index.d.ts +1 -0
- package/dist/tree-select/style/index.js +1 -0
- package/package.json +124 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type RenderNode = React.ReactNode | ((props: any) => React.ReactNode);
|
|
4
|
+
export default function useIcons({ suffixIcon, clearIcon, menuItemSelectedIcon, removeIcon, loading, multiple, hasFeedback, prefixCls, showSuffixIcon, feedbackIcon, showArrow, }: {
|
|
5
|
+
suffixIcon?: React.ReactNode;
|
|
6
|
+
clearIcon?: RenderNode;
|
|
7
|
+
menuItemSelectedIcon?: RenderNode;
|
|
8
|
+
removeIcon?: RenderNode;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
multiple?: boolean;
|
|
11
|
+
hasFeedback?: boolean;
|
|
12
|
+
feedbackIcon?: ReactNode;
|
|
13
|
+
prefixCls: string;
|
|
14
|
+
showSuffixIcon?: boolean;
|
|
15
|
+
showArrow?: boolean;
|
|
16
|
+
}): {
|
|
17
|
+
clearIcon: string | number | boolean | Iterable<ReactNode> | React.JSX.Element | ((props: any) => ReactNode);
|
|
18
|
+
suffixIcon: React.JSX.Element | (({ open, showSearch, }: {
|
|
19
|
+
open: boolean;
|
|
20
|
+
showSearch: boolean;
|
|
21
|
+
}) => React.JSX.Element | null) | null;
|
|
22
|
+
itemIcon: string | number | boolean | Iterable<ReactNode> | React.JSX.Element | ((props: any) => ReactNode) | null;
|
|
23
|
+
removeIcon: string | number | boolean | Iterable<ReactNode> | React.JSX.Element | ((props: any) => ReactNode) | null;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Icon from "../icon";
|
|
3
|
+
export default function useIcons(_ref) {
|
|
4
|
+
var suffixIcon = _ref.suffixIcon,
|
|
5
|
+
clearIcon = _ref.clearIcon,
|
|
6
|
+
menuItemSelectedIcon = _ref.menuItemSelectedIcon,
|
|
7
|
+
removeIcon = _ref.removeIcon,
|
|
8
|
+
loading = _ref.loading,
|
|
9
|
+
multiple = _ref.multiple,
|
|
10
|
+
hasFeedback = _ref.hasFeedback,
|
|
11
|
+
prefixCls = _ref.prefixCls,
|
|
12
|
+
showSuffixIcon = _ref.showSuffixIcon,
|
|
13
|
+
feedbackIcon = _ref.feedbackIcon,
|
|
14
|
+
showArrow = _ref.showArrow;
|
|
15
|
+
// Clear Icon
|
|
16
|
+
var mergedClearIcon = clearIcon !== null && clearIcon !== void 0 ? clearIcon : /*#__PURE__*/React.createElement(Icon, {
|
|
17
|
+
name: "cancel-circle-filled",
|
|
18
|
+
style: {
|
|
19
|
+
background: 'var(--odn-color-white)'
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Validation Feedback Icon
|
|
24
|
+
var getSuffixIconNode = function getSuffixIconNode(arrowIcon) {
|
|
25
|
+
if (suffixIcon === null && !hasFeedback && !showArrow) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, showSuffixIcon !== false && arrowIcon, hasFeedback && feedbackIcon);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// Arrow item icon
|
|
32
|
+
var mergedSuffixIcon = null;
|
|
33
|
+
if (suffixIcon !== undefined) {
|
|
34
|
+
mergedSuffixIcon = getSuffixIconNode(suffixIcon);
|
|
35
|
+
} else if (loading) {
|
|
36
|
+
mergedSuffixIcon = getSuffixIconNode( /*#__PURE__*/React.createElement(Icon, {
|
|
37
|
+
name: "loading",
|
|
38
|
+
spin: true
|
|
39
|
+
}));
|
|
40
|
+
} else {
|
|
41
|
+
var iconCls = "".concat(prefixCls, "-suffix");
|
|
42
|
+
mergedSuffixIcon = function mergedSuffixIcon(_ref2) {
|
|
43
|
+
var open = _ref2.open,
|
|
44
|
+
showSearch = _ref2.showSearch;
|
|
45
|
+
// if (open && showSearch) {
|
|
46
|
+
// return getSuffixIconNode(<Icon name="search" className={iconCls} />);
|
|
47
|
+
// }
|
|
48
|
+
return getSuffixIconNode( /*#__PURE__*/React.createElement(Icon, {
|
|
49
|
+
name: "down",
|
|
50
|
+
className: iconCls
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Checked item icon
|
|
56
|
+
var mergedItemIcon = null;
|
|
57
|
+
if (menuItemSelectedIcon !== undefined) {
|
|
58
|
+
mergedItemIcon = menuItemSelectedIcon;
|
|
59
|
+
} else if (multiple) {
|
|
60
|
+
mergedItemIcon = /*#__PURE__*/React.createElement(Icon, {
|
|
61
|
+
name: "check"
|
|
62
|
+
});
|
|
63
|
+
} else {
|
|
64
|
+
mergedItemIcon = null;
|
|
65
|
+
}
|
|
66
|
+
var mergedRemoveIcon = null;
|
|
67
|
+
if (removeIcon !== undefined) {
|
|
68
|
+
mergedRemoveIcon = removeIcon;
|
|
69
|
+
} else {
|
|
70
|
+
mergedRemoveIcon = /*#__PURE__*/React.createElement(Icon, {
|
|
71
|
+
name: "cancel"
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
clearIcon: mergedClearIcon,
|
|
76
|
+
suffixIcon: mergedSuffixIcon,
|
|
77
|
+
itemIcon: mergedItemIcon,
|
|
78
|
+
removeIcon: mergedRemoveIcon
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { SliderProps as RcSliderProps } from 'rc-slider';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type InputNumberProps } from '../input-number';
|
|
4
|
+
import './style';
|
|
5
|
+
export type SliderValue = number | [number, number] | undefined | null;
|
|
6
|
+
export interface SliderProps<T extends SliderValue = SliderValue> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
7
|
+
/**
|
|
8
|
+
* @description 最小值
|
|
9
|
+
* @default 0
|
|
10
|
+
*/
|
|
11
|
+
min?: number;
|
|
12
|
+
/**
|
|
13
|
+
* @description 最大值
|
|
14
|
+
* @default 100
|
|
15
|
+
*/
|
|
16
|
+
max?: number;
|
|
17
|
+
/**
|
|
18
|
+
* @description 步长
|
|
19
|
+
* @default 1
|
|
20
|
+
*/
|
|
21
|
+
step?: number;
|
|
22
|
+
/**
|
|
23
|
+
* @description 当前值
|
|
24
|
+
*/
|
|
25
|
+
value?: T;
|
|
26
|
+
/**
|
|
27
|
+
* @description 值变化时的回调
|
|
28
|
+
*/
|
|
29
|
+
onChange?: (value: T) => void;
|
|
30
|
+
/**
|
|
31
|
+
* @description 值变化完成时的回调
|
|
32
|
+
*/
|
|
33
|
+
onChangeComplete?: (value: SliderValue) => void;
|
|
34
|
+
/**
|
|
35
|
+
* @description 是否为范围选择
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
range?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* @description 标记
|
|
41
|
+
*/
|
|
42
|
+
marks?: RcSliderProps['marks'];
|
|
43
|
+
/**
|
|
44
|
+
* @description 单位
|
|
45
|
+
*/
|
|
46
|
+
unit?: React.ReactNode;
|
|
47
|
+
/**
|
|
48
|
+
* @description 是否显示 tooltip
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
tooltipVisible?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* @description 是否显示 tooltip
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
onTooltipVisibleChange?: (visible: boolean) => void;
|
|
57
|
+
/**
|
|
58
|
+
* @description 是否显示数字输入框
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
61
|
+
inputVisible?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* @description 透传 input props
|
|
64
|
+
* @default undefined
|
|
65
|
+
*/
|
|
66
|
+
inputProps?: InputNumberProps;
|
|
67
|
+
}
|
|
68
|
+
declare const Slider: <T extends SliderValue>({ className, style, min, max, step, value: valueProp, onChange, onChangeComplete, range, unit, marks, tooltipVisible: tooltipVisibleProp, onTooltipVisibleChange, inputVisible, inputProps, ...restProps }: SliderProps<T>) => React.JSX.Element;
|
|
69
|
+
export default Slider;
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
var _excluded = ["className", "style", "min", "max", "step", "value", "onChange", "onChangeComplete", "range", "unit", "marks", "tooltipVisible", "onTooltipVisibleChange", "inputVisible", "inputProps"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
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; }
|
|
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; }
|
|
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
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); }
|
|
8
|
+
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); }
|
|
9
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
+
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."); }
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
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; } }
|
|
14
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
17
|
+
import RcSlider from 'rc-slider';
|
|
18
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
19
|
+
import InputNumber from "../input-number";
|
|
20
|
+
import "./style";
|
|
21
|
+
var Slider = function Slider(_ref) {
|
|
22
|
+
var className = _ref.className,
|
|
23
|
+
style = _ref.style,
|
|
24
|
+
_ref$min = _ref.min,
|
|
25
|
+
min = _ref$min === void 0 ? 0 : _ref$min,
|
|
26
|
+
_ref$max = _ref.max,
|
|
27
|
+
max = _ref$max === void 0 ? 100 : _ref$max,
|
|
28
|
+
_ref$step = _ref.step,
|
|
29
|
+
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
30
|
+
_ref$value = _ref.value,
|
|
31
|
+
valueProp = _ref$value === void 0 ? null : _ref$value,
|
|
32
|
+
onChange = _ref.onChange,
|
|
33
|
+
onChangeComplete = _ref.onChangeComplete,
|
|
34
|
+
_ref$range = _ref.range,
|
|
35
|
+
range = _ref$range === void 0 ? false : _ref$range,
|
|
36
|
+
unit = _ref.unit,
|
|
37
|
+
marks = _ref.marks,
|
|
38
|
+
tooltipVisibleProp = _ref.tooltipVisible,
|
|
39
|
+
onTooltipVisibleChange = _ref.onTooltipVisibleChange,
|
|
40
|
+
_ref$inputVisible = _ref.inputVisible,
|
|
41
|
+
inputVisible = _ref$inputVisible === void 0 ? false : _ref$inputVisible,
|
|
42
|
+
inputProps = _ref.inputProps,
|
|
43
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
44
|
+
// 计算值相对于 min-max 范围的百分比
|
|
45
|
+
var getPercentage = function getPercentage(val) {
|
|
46
|
+
return (val - min) / (max - min) * 100;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// 根据 step 计算小数位数
|
|
50
|
+
var getDecimalPlaces = function getDecimalPlaces(step) {
|
|
51
|
+
var stepStr = step.toString();
|
|
52
|
+
if (stepStr.includes('.')) {
|
|
53
|
+
return stepStr.split('.')[1].length;
|
|
54
|
+
}
|
|
55
|
+
return 0;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// 根据 step 格式化数值显示
|
|
59
|
+
var formatValueForDisplay = function formatValueForDisplay(val) {
|
|
60
|
+
var decimalPlaces = getDecimalPlaces(step);
|
|
61
|
+
return val.toFixed(decimalPlaces);
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* 初始化 Slider 的值
|
|
65
|
+
* 1. 优先判断 Prop value,如果存在 Prop value,则 Slider 完全交由外部控制,内部状态无效;
|
|
66
|
+
* 2. 再判断 Prop defaultValue,如果存在默认值,则 Slider 值为此默认值。
|
|
67
|
+
*/
|
|
68
|
+
var _useState = useState(function () {
|
|
69
|
+
var val;
|
|
70
|
+
if (valueProp !== null) {
|
|
71
|
+
val = typeof valueProp === 'string' ? Number(valueProp) : valueProp;
|
|
72
|
+
}
|
|
73
|
+
if (val === undefined) {
|
|
74
|
+
return val;
|
|
75
|
+
}
|
|
76
|
+
return range ? val : Number(val);
|
|
77
|
+
}),
|
|
78
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
79
|
+
value = _useState2[0],
|
|
80
|
+
setValue = _useState2[1];
|
|
81
|
+
var _useState3 = useState(false),
|
|
82
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
83
|
+
hoverOpen = _useState4[0],
|
|
84
|
+
setHoverOpen = _useState4[1];
|
|
85
|
+
var _useState5 = useState(false),
|
|
86
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
87
|
+
focusOpen = _useState6[0],
|
|
88
|
+
setFocusOpen = _useState6[1];
|
|
89
|
+
var _useState7 = useState(false),
|
|
90
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
91
|
+
dragging = _useState8[0],
|
|
92
|
+
setDragging = _useState8[1];
|
|
93
|
+
var tooltipLeft = useRef(null);
|
|
94
|
+
var tooltipRight = useRef(null);
|
|
95
|
+
var tooltipCombined = useRef(null);
|
|
96
|
+
var _useState9 = useState('separated'),
|
|
97
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
98
|
+
rangeTooltipCombinedStatus = _useState10[0],
|
|
99
|
+
setRangeTooltipCombinedStatus = _useState10[1];
|
|
100
|
+
var tooltipVisible = tooltipVisibleProp;
|
|
101
|
+
if (tooltipVisible === undefined) {
|
|
102
|
+
tooltipVisible = hoverOpen || focusOpen;
|
|
103
|
+
}
|
|
104
|
+
useEffect(function () {
|
|
105
|
+
if (onTooltipVisibleChange) {
|
|
106
|
+
onTooltipVisibleChange(hoverOpen || focusOpen);
|
|
107
|
+
}
|
|
108
|
+
}, [hoverOpen, focusOpen, onTooltipVisibleChange]);
|
|
109
|
+
useEffect(function () {
|
|
110
|
+
if (valueProp !== null && valueProp !== undefined && (_typeof(valueProp) === 'object' || !isNaN(valueProp)) && (typeof valueProp === 'string' ? Number(valueProp) : valueProp) !== value) {
|
|
111
|
+
setValue(range ? valueProp : Number(valueProp));
|
|
112
|
+
}
|
|
113
|
+
}, [valueProp]);
|
|
114
|
+
useEffect(function () {
|
|
115
|
+
var onMouseUp = function onMouseUp() {
|
|
116
|
+
// Delay for 1 frame to make the click to enable hide tooltip
|
|
117
|
+
// even when the handle is focused
|
|
118
|
+
setTimeout(function () {
|
|
119
|
+
setFocusOpen(false);
|
|
120
|
+
}, 1);
|
|
121
|
+
};
|
|
122
|
+
document.addEventListener('mouseup', onMouseUp);
|
|
123
|
+
return function () {
|
|
124
|
+
document.removeEventListener('mouseup', onMouseUp);
|
|
125
|
+
};
|
|
126
|
+
}, []);
|
|
127
|
+
useEffect(function () {
|
|
128
|
+
// 这里做双滑块模式时的 tooltip 设计
|
|
129
|
+
if (range && Array.isArray(value) && tooltipVisible && tooltipLeft.current && tooltipRight.current) {
|
|
130
|
+
var rectLeft = tooltipLeft.current.getBoundingClientRect();
|
|
131
|
+
var rectRight = tooltipRight.current.getBoundingClientRect();
|
|
132
|
+
// 判断两个 tooltip 是否在位置上存在重叠
|
|
133
|
+
if (rectLeft.left === rectRight.left) {
|
|
134
|
+
setRangeTooltipCombinedStatus('overlapped');
|
|
135
|
+
} else if (rectLeft.left + rectLeft.width > rectRight.left) {
|
|
136
|
+
setRangeTooltipCombinedStatus('combined');
|
|
137
|
+
if (tooltipCombined.current) {
|
|
138
|
+
tooltipCombined.current.style.left = "calc(".concat(getPercentage(value[0]), "% - ").concat(rectLeft.width / 2, "px)");
|
|
139
|
+
tooltipCombined.current.style.width = "calc(".concat(getPercentage(value[1]) - getPercentage(value[0]), "% + ").concat(rectLeft.width, "px)");
|
|
140
|
+
}
|
|
141
|
+
} else {
|
|
142
|
+
setRangeTooltipCombinedStatus('separated');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}, [value, range, tooltipVisible]);
|
|
146
|
+
var checkValueIsValid = function checkValueIsValid(val) {
|
|
147
|
+
return val !== value && val !== null && val !== undefined && min !== undefined && max !== undefined && val >= min && val <= max;
|
|
148
|
+
};
|
|
149
|
+
var handleChange = function handleChange(val) {
|
|
150
|
+
var newValue = range ? val : Number(val);
|
|
151
|
+
if (range || typeof newValue === 'number' && checkValueIsValid(newValue)) {
|
|
152
|
+
if (valueProp === null && newValue !== null) {
|
|
153
|
+
setValue(newValue);
|
|
154
|
+
}
|
|
155
|
+
if (onChange) {
|
|
156
|
+
onChange(newValue);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
var handleChangeComplete = function handleChangeComplete(val) {
|
|
161
|
+
setDragging(false);
|
|
162
|
+
if (valueProp === null && val !== null) {
|
|
163
|
+
setValue(val);
|
|
164
|
+
}
|
|
165
|
+
if (onChangeComplete) {
|
|
166
|
+
onChangeComplete(val);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
170
|
+
"data-odn-slider-wrapper": true,
|
|
171
|
+
className: className,
|
|
172
|
+
style: style
|
|
173
|
+
}, restProps), range && Array.isArray(value) && /*#__PURE__*/React.createElement("div", {
|
|
174
|
+
"data-odn-slider-range-tooltip-wrapper": true,
|
|
175
|
+
"data-odn-slider-range-tooltip-wrapper-visible": tooltipVisible,
|
|
176
|
+
"data-odn-slider-range-tooltip-wrapper-combined": rangeTooltipCombinedStatus === 'combined',
|
|
177
|
+
"data-odn-slider-range-tooltip-wrapper-overlapped": rangeTooltipCombinedStatus === 'overlapped'
|
|
178
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
179
|
+
"data-odn-slider-range-tooltip": true,
|
|
180
|
+
"data-odn-slider-range-tooltip-left": true,
|
|
181
|
+
style: {
|
|
182
|
+
left: "".concat(getPercentage(value[0]), "%")
|
|
183
|
+
},
|
|
184
|
+
ref: tooltipLeft
|
|
185
|
+
}, unit ? "".concat(formatValueForDisplay(value[0])).concat(unit) : formatValueForDisplay(value[0])), /*#__PURE__*/React.createElement("div", {
|
|
186
|
+
"data-odn-slider-range-tooltip": true,
|
|
187
|
+
"data-odn-slider-range-tooltip-right": true,
|
|
188
|
+
style: {
|
|
189
|
+
left: "".concat(getPercentage(value[1]), "%")
|
|
190
|
+
},
|
|
191
|
+
ref: tooltipRight
|
|
192
|
+
}, unit ? "".concat(formatValueForDisplay(value[1])).concat(unit) : formatValueForDisplay(value[1])), /*#__PURE__*/React.createElement("div", {
|
|
193
|
+
"data-odn-slider-range-tooltip-combined": true,
|
|
194
|
+
ref: tooltipCombined
|
|
195
|
+
}, formatValueForDisplay(value[0]), " -", ' ', unit ? "".concat(formatValueForDisplay(value[1])).concat(unit) : formatValueForDisplay(value[1]))), /*#__PURE__*/React.createElement(RcSlider, {
|
|
196
|
+
range: range,
|
|
197
|
+
allowCross: false,
|
|
198
|
+
handleRender: function handleRender(node, info) {
|
|
199
|
+
var nodeProps = node.props;
|
|
200
|
+
function proxyEvent(eventName, event, triggerRestPropsEvent) {
|
|
201
|
+
var _eventName2, _ref3;
|
|
202
|
+
if (triggerRestPropsEvent) {
|
|
203
|
+
var _eventName, _ref2;
|
|
204
|
+
(_eventName = (_ref2 = restProps)[eventName]) === null || _eventName === void 0 || _eventName.call(_ref2, event);
|
|
205
|
+
}
|
|
206
|
+
(_eventName2 = (_ref3 = nodeProps)[eventName]) === null || _eventName2 === void 0 || _eventName2.call(_ref3, event);
|
|
207
|
+
}
|
|
208
|
+
var passedProps = _objectSpread(_objectSpread({}, nodeProps), {}, {
|
|
209
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
210
|
+
setHoverOpen(true);
|
|
211
|
+
proxyEvent('onMouseEnter', e);
|
|
212
|
+
},
|
|
213
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
214
|
+
setHoverOpen(false);
|
|
215
|
+
proxyEvent('onMouseLeave', e);
|
|
216
|
+
},
|
|
217
|
+
onMouseDown: function onMouseDown(e) {
|
|
218
|
+
setFocusOpen(true);
|
|
219
|
+
setDragging(true);
|
|
220
|
+
proxyEvent('onMouseDown', e);
|
|
221
|
+
},
|
|
222
|
+
onFocus: function onFocus(e) {
|
|
223
|
+
var _restProps$onFocus;
|
|
224
|
+
setFocusOpen(true);
|
|
225
|
+
(_restProps$onFocus = restProps.onFocus) === null || _restProps$onFocus === void 0 || _restProps$onFocus.call(restProps, e);
|
|
226
|
+
proxyEvent('onFocus', e, true);
|
|
227
|
+
},
|
|
228
|
+
onBlur: function onBlur(e) {
|
|
229
|
+
var _restProps$onBlur;
|
|
230
|
+
setFocusOpen(false);
|
|
231
|
+
(_restProps$onBlur = restProps.onBlur) === null || _restProps$onBlur === void 0 || _restProps$onBlur.call(restProps, e);
|
|
232
|
+
proxyEvent('onBlur', e, true);
|
|
233
|
+
},
|
|
234
|
+
children: !range && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
235
|
+
"data-odn-slider-handle-tooltip": true,
|
|
236
|
+
"data-odn-slider-handle-tooltip-visible": tooltipVisible
|
|
237
|
+
}, unit ? "".concat(formatValueForDisplay(info.value)).concat(unit) : formatValueForDisplay(info.value)))
|
|
238
|
+
});
|
|
239
|
+
var cloneNode = /*#__PURE__*/React.cloneElement(node, passedProps);
|
|
240
|
+
return cloneNode;
|
|
241
|
+
},
|
|
242
|
+
value: value,
|
|
243
|
+
onChange: function onChange(v) {
|
|
244
|
+
handleChange(v);
|
|
245
|
+
},
|
|
246
|
+
onChangeComplete: function onChangeComplete(v) {
|
|
247
|
+
handleChangeComplete(v);
|
|
248
|
+
},
|
|
249
|
+
prefixCls: "odn-slider",
|
|
250
|
+
min: min,
|
|
251
|
+
max: max,
|
|
252
|
+
step: step,
|
|
253
|
+
marks: marks
|
|
254
|
+
}), inputVisible && !range && /*#__PURE__*/React.createElement(InputNumber, _extends({
|
|
255
|
+
value: value,
|
|
256
|
+
step: step,
|
|
257
|
+
min: min,
|
|
258
|
+
max: max,
|
|
259
|
+
onChange: function onChange(v) {
|
|
260
|
+
handleChange(v);
|
|
261
|
+
}
|
|
262
|
+
}, inputProps)));
|
|
263
|
+
};
|
|
264
|
+
export default Slider;
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
html {
|
|
2
|
+
--odn-slider-margin-inline-start: 5px;
|
|
3
|
+
--odn-slider-margin-inline-end: 5px;
|
|
4
|
+
--odn-slider-padding-block: 4px;
|
|
5
|
+
--odn-slider-track-height: 4px;
|
|
6
|
+
--odn-slider-track-background: var(--odn-color-primary);
|
|
7
|
+
--odn-slider-rail-background: var(--odn-color-black-3);
|
|
8
|
+
--odn-slider-border-radius: 4px;
|
|
9
|
+
--odn-slider-handle-width: 12px;
|
|
10
|
+
--odn-slider-handle-height: 12px;
|
|
11
|
+
--odn-slider-handle-border-radius: 12px;
|
|
12
|
+
--odn-slider-tooltip-padding-block: 10px;
|
|
13
|
+
--odn-slider-tooltip-padding-inline: 16px;
|
|
14
|
+
--odn-slider-tooltip-font-size: 13px;
|
|
15
|
+
--odn-slider-tooltip-background-color: #393939;
|
|
16
|
+
--odn-slider-tooltip-border-radius: 6px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[data-odn-slider-wrapper] {
|
|
20
|
+
position: relative;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: 8px;
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
user-select: none;
|
|
26
|
+
--odn-input-number-width: 90px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.odn-slider {
|
|
30
|
+
flex: 1;
|
|
31
|
+
list-style: none;
|
|
32
|
+
position: relative;
|
|
33
|
+
z-index: 1;
|
|
34
|
+
margin-left: var(--odn-slider-margin-inline-start);
|
|
35
|
+
margin-right: var(--odn-slider-margin-inline-end);
|
|
36
|
+
padding: var(--odn-slider-padding-block) 0;
|
|
37
|
+
height: calc(var(--odn-slider-track-height) + var(--odn-slider-padding-block) * 2);
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.odn-slider-hasMarks {
|
|
42
|
+
padding-bottom: 12px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.odn-slider-rail {
|
|
46
|
+
position: absolute;
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: var(--odn-slider-track-height);
|
|
49
|
+
background: var(--odn-slider-rail-background);
|
|
50
|
+
border-radius: var(--odn-slider-border-radius);
|
|
51
|
+
transition: background-color 0.25s cubic-bezier(0.32, 0.72, 0, 1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.odn-slider-track {
|
|
55
|
+
position: absolute;
|
|
56
|
+
height: var(--odn-slider-track-height);
|
|
57
|
+
background: var(--odn-slider-track-background);
|
|
58
|
+
border-radius: var(--odn-slider-border-radius);
|
|
59
|
+
transition: background-color 0.25s cubic-bezier(0.32, 0.72, 0, 1);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
[data-odn-slider-handle-wrapper] {
|
|
63
|
+
position: relative;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.odn-slider-handle {
|
|
67
|
+
position: absolute;
|
|
68
|
+
top: calc(50% - var(--odn-slider-handle-height) / 2);
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
width: var(--odn-slider-handle-width);
|
|
71
|
+
height: var(--odn-slider-handle-height);
|
|
72
|
+
background-color: #fff;
|
|
73
|
+
border-radius: var(--odn-slider-handle-border-radius);
|
|
74
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 2px 0 rgba(0, 0, 0, 0.1);
|
|
75
|
+
transition: border-color 0.25s cubic-bezier(0.32, 0.72, 0, 1), transform 0.25s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.25s cubic-bezier(0.32, 0.72, 0, 1);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.odn-slider-handle.odn-slider-handle-dragging {
|
|
79
|
+
box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 2px 0 rgba(0, 0, 0, 0.1);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.odn-slider-handle:hover {
|
|
83
|
+
transform: scale(1.2);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.odn-slider-handle:focus {
|
|
87
|
+
outline: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.odn-slider-handle.ant-tooltip-open {
|
|
91
|
+
border-color: #1890ff;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.odn-slider:hover .odn-slider-rail {
|
|
95
|
+
background: var(--odn-slider-rail-background);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.odn-slider:hover .odn-slider-handle:not(.ant-tooltip-open) {
|
|
99
|
+
border-color: #69c0ff;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.odn-slider-step {
|
|
103
|
+
position: absolute;
|
|
104
|
+
width: 100%;
|
|
105
|
+
height: var(--odn-slider-track-height);
|
|
106
|
+
background: transparent;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.odn-slider-mark-text {
|
|
110
|
+
position: absolute;
|
|
111
|
+
top: 14px;
|
|
112
|
+
font-size: 13px;
|
|
113
|
+
line-height: 20px;
|
|
114
|
+
text-align: center;
|
|
115
|
+
color: #1f1f1f;
|
|
116
|
+
word-break: keep-all;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.odn-slider-disabled {
|
|
121
|
+
cursor: not-allowed;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.odn-slider-disabled .odn-slider-mark-text,
|
|
125
|
+
.odn-slider-disabled .odn-slider-handle {
|
|
126
|
+
cursor: not-allowed;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
[data-odn-slider-handle-tooltip] {
|
|
130
|
+
position: absolute;
|
|
131
|
+
left: 50%;
|
|
132
|
+
bottom: 22px;
|
|
133
|
+
padding: var(--odn-slider-tooltip-padding-block) var(--odn-slider-tooltip-padding-inline);
|
|
134
|
+
font-size: var(--odn-slider-tooltip-font-size);
|
|
135
|
+
color: #fff;
|
|
136
|
+
background-color: var(--odn-slider-tooltip-background-color);
|
|
137
|
+
border-radius: var(--odn-slider-tooltip-border-radius);
|
|
138
|
+
transform: translate3d(-50%, 0, 0) scale(0.8);
|
|
139
|
+
opacity: 0;
|
|
140
|
+
visibility: hidden;
|
|
141
|
+
transform-origin: 50% calc(100% + 4px);
|
|
142
|
+
transition: all 0.15s cubic-bezier(0.32, 0.72, 0, 1) 0.1s;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
[data-odn-slider-handle-tooltip]::before {
|
|
146
|
+
content: "";
|
|
147
|
+
position: absolute;
|
|
148
|
+
bottom: -5px;
|
|
149
|
+
left: 50%;
|
|
150
|
+
margin-left: -5px;
|
|
151
|
+
width: 0;
|
|
152
|
+
height: 0;
|
|
153
|
+
border-width: 5px 5px 0;
|
|
154
|
+
border-color: rgba(0, 0, 0, 0);
|
|
155
|
+
border-top-color: var(--odn-slider-tooltip-background-color);
|
|
156
|
+
border-style: solid;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
[data-odn-slider-handle-tooltip-visible=true] {
|
|
160
|
+
opacity: 1;
|
|
161
|
+
visibility: visible;
|
|
162
|
+
transform: translate3d(-50%, 0, 0) scale(1);
|
|
163
|
+
transition: all 0.15s cubic-bezier(0.32, 0.72, 0, 1);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
[data-odn-slider-range-tooltip-wrapper] {
|
|
167
|
+
position: absolute;
|
|
168
|
+
inset: 0 5px;
|
|
169
|
+
opacity: 0;
|
|
170
|
+
visibility: hidden;
|
|
171
|
+
transition: all 0.15s cubic-bezier(0.32, 0.72, 0, 1);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
[data-odn-slider-range-tooltip-wrapper][data-odn-slider-range-tooltip-wrapper-visible=true] {
|
|
175
|
+
opacity: 1;
|
|
176
|
+
visibility: visible;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
[data-odn-slider-range-tooltip-wrapper-visible][data-odn-slider-range-tooltip-wrapper-combined=true] [data-odn-slider-range-tooltip] {
|
|
180
|
+
color: transparent;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
[data-odn-slider-range-tooltip-wrapper-visible][data-odn-slider-range-tooltip-wrapper-combined=true] [data-odn-slider-range-tooltip-left] {
|
|
184
|
+
border-radius: 6px 0 0 6px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
[data-odn-slider-range-tooltip-wrapper-visible][data-odn-slider-range-tooltip-wrapper-combined=true] [data-odn-slider-range-tooltip-right] {
|
|
188
|
+
border-radius: 0 6px 6px 0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
[data-odn-slider-range-tooltip-wrapper-visible][data-odn-slider-range-tooltip-wrapper-combined=true] [data-odn-slider-range-tooltip-combined] {
|
|
192
|
+
opacity: 1;
|
|
193
|
+
visibility: visible;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
[data-odn-slider-handle-tooltip-wrapper-visible][data-odn-slider-handle-tooltip-wrapper-overlapped=true] [data-odn-slider-handle-tooltip-left] {
|
|
197
|
+
opacity: 0;
|
|
198
|
+
visibility: hidden;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
[data-odn-slider-range-tooltip] {
|
|
202
|
+
position: absolute;
|
|
203
|
+
bottom: 22px;
|
|
204
|
+
padding: var(--odn-slider-tooltip-padding-block) var(--odn-slider-tooltip-padding-inline);
|
|
205
|
+
font-size: var(--odn-slider-tooltip-font-size);
|
|
206
|
+
color: #fff;
|
|
207
|
+
background-color: var(--odn-slider-tooltip-background-color);
|
|
208
|
+
border-radius: var(--odn-slider-tooltip-border-radius);
|
|
209
|
+
transform: translate3d(-50%, 0, 0);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
[data-odn-slider-range-tooltip]::before {
|
|
213
|
+
content: "";
|
|
214
|
+
position: absolute;
|
|
215
|
+
bottom: -5px;
|
|
216
|
+
left: 50%;
|
|
217
|
+
margin-left: -5px;
|
|
218
|
+
width: 0;
|
|
219
|
+
height: 0;
|
|
220
|
+
border-width: 5px 5px 0;
|
|
221
|
+
border-color: transparent;
|
|
222
|
+
border-top-color: var(--odn-slider-tooltip-background-color);
|
|
223
|
+
border-style: solid;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
[data-odn-slider-range-tooltip-combined] {
|
|
227
|
+
position: absolute;
|
|
228
|
+
bottom: 22px;
|
|
229
|
+
display: flex;
|
|
230
|
+
padding: var(--odn-slider-tooltip-padding-block) 0;
|
|
231
|
+
align-items: center;
|
|
232
|
+
justify-content: center;
|
|
233
|
+
color: #fff;
|
|
234
|
+
opacity: 0;
|
|
235
|
+
visibility: hidden;
|
|
236
|
+
font-size: var(--odn-slider-tooltip-font-size);
|
|
237
|
+
}
|