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,166 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--odn-tp-input-padding-inline-end: 32px;
|
|
3
|
+
--odn-tp-input-padding-inline-start: 12px;
|
|
4
|
+
--odn-tp-input-padding-block: 6px;
|
|
5
|
+
--odn-tp-input-border-radius: 6px;
|
|
6
|
+
--odn-tp-input-width: 160px;
|
|
7
|
+
--odn-tp-input-height: 36px;
|
|
8
|
+
--odn-tp-input-font-size: 14px;
|
|
9
|
+
--odn-tp-input-line-height: 1.5;
|
|
10
|
+
--odn-tp-icon-size: 16px;
|
|
11
|
+
--odn-tp-icon-right: 8px;
|
|
12
|
+
--odn-tp-popup-padding-block: 8px;
|
|
13
|
+
--odn-tp-popup-padding-inline: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
[data-odn-time-picker-container] {
|
|
17
|
+
position: relative;
|
|
18
|
+
display: inline-block;
|
|
19
|
+
width: var(--odn-tp-input-width);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[data-odn-time-picker-container-disabled=true] [data-odn-time-picker-input] {
|
|
23
|
+
color: var(--odn-color-black-8);
|
|
24
|
+
background: var(--odn-color-black-3);
|
|
25
|
+
border: 1px solid var(--odn-color-black-6);
|
|
26
|
+
cursor: not-allowed;
|
|
27
|
+
}
|
|
28
|
+
[data-odn-time-picker-container-disabled=true] [data-odn-time-picker-icon-container] {
|
|
29
|
+
cursor: not-allowed;
|
|
30
|
+
}
|
|
31
|
+
[data-odn-time-picker-container-disabled=true] [data-odn-time-picker-icon] {
|
|
32
|
+
color: var(--odn-color-black-8);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[data-odn-time-picker-container-selected=true][data-odn-time-picker-container-disabled=false][data-odn-time-picker-container-allow-clear=true]:hover [data-odn-time-picker-icon-clear] {
|
|
36
|
+
opacity: 1;
|
|
37
|
+
}
|
|
38
|
+
[data-odn-time-picker-container-selected=true][data-odn-time-picker-container-disabled=false][data-odn-time-picker-container-allow-clear=true]:hover [data-odn-time-picker-icon-clock] {
|
|
39
|
+
opacity: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[data-odn-time-picker-input] {
|
|
43
|
+
position: relative;
|
|
44
|
+
z-index: 1;
|
|
45
|
+
width: 100%;
|
|
46
|
+
min-height: 100%;
|
|
47
|
+
max-height: 100%;
|
|
48
|
+
font-family: inherit;
|
|
49
|
+
text-align: inherit;
|
|
50
|
+
font-size: var(--odn-tp-input-font-size);
|
|
51
|
+
line-height: var(--odn-tp-input-line-height);
|
|
52
|
+
color: #1f1f1f;
|
|
53
|
+
background-color: #fff;
|
|
54
|
+
border-radius: var(--odn-tp-input-border-radius);
|
|
55
|
+
outline: none;
|
|
56
|
+
appearance: none;
|
|
57
|
+
transition: 0.2s cubic-bezier(0.32, 0.72, 0, 1) background-color, 0.2s cubic-bezier(0.32, 0.72, 0, 1) border-color;
|
|
58
|
+
padding: var(--odn-tp-input-padding-block) var(--odn-tp-input-padding-inline-end) var(--odn-tp-input-padding-block) var(--odn-tp-input-padding-inline-start);
|
|
59
|
+
height: var(--odn-tp-input-height);
|
|
60
|
+
border: 1px solid var(--odn-color-black-6);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
[data-odn-time-picker-input]:not([data-odn-time-picker-input-disabled=true]):hover {
|
|
64
|
+
border: 1px solid var(--odn-color-black-7);
|
|
65
|
+
}
|
|
66
|
+
[data-odn-time-picker-input]:not([data-odn-time-picker-input-disabled=true]):focus {
|
|
67
|
+
border: 1px solid var(--odn-color-primary);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
[data-odn-time-picker-container-allow-clear=false] [data-odn-time-picker-icon-container],
|
|
71
|
+
[data-odn-time-picker-container-selected=false] [data-odn-time-picker-icon-container] {
|
|
72
|
+
pointer-events: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
[data-odn-time-picker-icon-container] {
|
|
76
|
+
position: absolute;
|
|
77
|
+
z-index: 1;
|
|
78
|
+
top: 50%;
|
|
79
|
+
right: var(--odn-tp-icon-right);
|
|
80
|
+
width: var(--odn-tp-icon-size);
|
|
81
|
+
height: var(--odn-tp-icon-size);
|
|
82
|
+
transform: translateY(-50%);
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
[data-odn-time-picker-icon] {
|
|
87
|
+
position: absolute;
|
|
88
|
+
top: 0;
|
|
89
|
+
left: 0;
|
|
90
|
+
z-index: 1;
|
|
91
|
+
transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
[data-odn-time-picker-icon-clock] {
|
|
95
|
+
color: var(--odn-color-black-9);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
[data-odn-time-picker-icon-clear] {
|
|
99
|
+
opacity: 0;
|
|
100
|
+
color: var(--odn-color-black-7);
|
|
101
|
+
}
|
|
102
|
+
[data-odn-time-picker-icon-clear]:hover {
|
|
103
|
+
color: var(--odn-color-black-8);
|
|
104
|
+
}
|
|
105
|
+
[data-odn-time-picker-icon-clear]:active {
|
|
106
|
+
color: var(--odn-color-black-9);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-odn-time-picker-popup-content] {
|
|
110
|
+
display: flex;
|
|
111
|
+
height: calc(var(--odn-popup-control-height) * 6 + var(--odn-tp-popup-padding-block) * 2);
|
|
112
|
+
user-select: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
[data-odn-time-picker-options] {
|
|
116
|
+
flex: 1;
|
|
117
|
+
padding: var(--odn-tp-popup-padding-block) var(--odn-tp-popup-padding-inline);
|
|
118
|
+
min-width: 80px;
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
height: calc(var(--odn-popup-control-height) * 6 + var(--odn-tp-popup-padding-block) * 2);
|
|
122
|
+
}
|
|
123
|
+
[data-odn-time-picker-options]:not(:last-child) {
|
|
124
|
+
box-shadow: 1px 0 0 var(--odn-color-black-4);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
[data-odn-time-picker-option] {
|
|
128
|
+
display: flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
justify-content: center;
|
|
131
|
+
height: var(--odn-popup-control-height);
|
|
132
|
+
font-size: 14px;
|
|
133
|
+
color: var(--odn-color-black-12);
|
|
134
|
+
cursor: pointer;
|
|
135
|
+
text-align: center;
|
|
136
|
+
}
|
|
137
|
+
[data-odn-time-picker-option]:hover:not([data-odn-time-picker-option-disabled=true]) {
|
|
138
|
+
background-color: var(--odn-color-black-1);
|
|
139
|
+
}
|
|
140
|
+
[data-odn-time-picker-option][data-odn-time-picker-option-selected=true] {
|
|
141
|
+
background-color: var(--odn-color-blue-1);
|
|
142
|
+
}
|
|
143
|
+
[data-odn-time-picker-option][data-odn-time-picker-option-selected=true]:hover {
|
|
144
|
+
background-color: var(--odn-color-blue-1);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
[data-odn-time-picker-option-disabled=true] {
|
|
148
|
+
color: var(--odn-color-black-8);
|
|
149
|
+
cursor: not-allowed;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
[data-odn-time-picker-padding-bottom] {
|
|
153
|
+
height: calc(var(--odn-popup-control-height) * 5);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
[data-odn-time-picker-container-light=true] [data-odn-time-picker-input] {
|
|
157
|
+
background-color: transparent;
|
|
158
|
+
border: 1px solid transparent;
|
|
159
|
+
}
|
|
160
|
+
[data-odn-time-picker-container-light=true] [data-odn-time-picker-input]:hover {
|
|
161
|
+
border: 1px solid transparent;
|
|
162
|
+
}
|
|
163
|
+
[data-odn-time-picker-container-light=true] [data-odn-time-picker-input]:focus {
|
|
164
|
+
background-color: #fff;
|
|
165
|
+
border: 1px solid var(--odn-color-primary);
|
|
166
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PopoverProps } from '../pop-base';
|
|
3
|
+
export interface TooltipGroupProps extends Omit<PopoverProps, 'popup'>, React.HTMLAttributes<JSX.IntrinsicElements> {
|
|
4
|
+
as?: keyof JSX.IntrinsicElements;
|
|
5
|
+
}
|
|
6
|
+
declare const Tooltip: React.FC<PopoverProps> & {
|
|
7
|
+
Group: typeof TooltipGroup;
|
|
8
|
+
};
|
|
9
|
+
declare const TooltipGroup: (props: TooltipGroupProps) => React.JSX.Element;
|
|
10
|
+
export default Tooltip;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
var _excluded = ["as", "arrowed", "autoPlacements", "offset", "popupStyle", "popupClassName", "mouseEnterDelay", "mouseLeaveDelay", "flip", "matchWidth", "portal", "shift", "children", "placement"],
|
|
3
|
+
_excluded2 = ["onMouseEnter", "onMouseLeave"];
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
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); }
|
|
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
|
+
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); }
|
|
18
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
19
|
+
import PopBase from "../pop-base";
|
|
20
|
+
var Tooltip = function Tooltip(props) {
|
|
21
|
+
return /*#__PURE__*/React.createElement(PopBase, _extends({
|
|
22
|
+
type: "tooltip",
|
|
23
|
+
mouseEnterDelay: 0.1
|
|
24
|
+
}, props));
|
|
25
|
+
};
|
|
26
|
+
var TooltipGroup = function TooltipGroup(props) {
|
|
27
|
+
var _tooltipInfos$hoverIn;
|
|
28
|
+
var _props$as = props.as,
|
|
29
|
+
as = _props$as === void 0 ? 'div' : _props$as,
|
|
30
|
+
arrowed = props.arrowed,
|
|
31
|
+
autoPlacements = props.autoPlacements,
|
|
32
|
+
offset = props.offset,
|
|
33
|
+
popupStyle = props.popupStyle,
|
|
34
|
+
popupClassName = props.popupClassName,
|
|
35
|
+
_props$mouseEnterDela = props.mouseEnterDelay,
|
|
36
|
+
mouseEnterDelay = _props$mouseEnterDela === void 0 ? 0.1 : _props$mouseEnterDela,
|
|
37
|
+
mouseLeaveDelay = props.mouseLeaveDelay,
|
|
38
|
+
flip = props.flip,
|
|
39
|
+
matchWidth = props.matchWidth,
|
|
40
|
+
portal = props.portal,
|
|
41
|
+
shift = props.shift,
|
|
42
|
+
children = props.children,
|
|
43
|
+
_props$placement = props.placement,
|
|
44
|
+
placement = _props$placement === void 0 ? 'top' : _props$placement,
|
|
45
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
46
|
+
var Tag = as;
|
|
47
|
+
var tooltipInfos = React.Children.toArray(children).map(function (child) {
|
|
48
|
+
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
49
|
+
return {
|
|
50
|
+
popup: child.props.popup,
|
|
51
|
+
children: child.props.children
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}).filter(Boolean);
|
|
55
|
+
var _useState = useState(false),
|
|
56
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
57
|
+
visible = _useState2[0],
|
|
58
|
+
setVisible = _useState2[1];
|
|
59
|
+
var _useState3 = useState(0),
|
|
60
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
61
|
+
hoverIndex = _useState4[0],
|
|
62
|
+
setHoverIndex = _useState4[1];
|
|
63
|
+
var lastHoverIndex = useRef(hoverIndex);
|
|
64
|
+
var hoverTimer = useRef(0);
|
|
65
|
+
var tagRef = useRef(null);
|
|
66
|
+
var handleMouseEnter = function handleMouseEnter(e, index) {
|
|
67
|
+
clearTimeout(hoverTimer.current);
|
|
68
|
+
var currentTarget = e.currentTarget;
|
|
69
|
+
hoverTimer.current = window.setTimeout(function () {
|
|
70
|
+
var _tagRef$current;
|
|
71
|
+
setHoverIndex(index);
|
|
72
|
+
setVisible(true);
|
|
73
|
+
var _ref = ((_tagRef$current = tagRef.current) === null || _tagRef$current === void 0 ? void 0 : _tagRef$current.getBoundingClientRect()) || {
|
|
74
|
+
left: 0,
|
|
75
|
+
top: 0,
|
|
76
|
+
width: 0,
|
|
77
|
+
height: 0
|
|
78
|
+
},
|
|
79
|
+
left = _ref.left,
|
|
80
|
+
top = _ref.top,
|
|
81
|
+
width = _ref.width,
|
|
82
|
+
height = _ref.height;
|
|
83
|
+
var _currentTarget$getBou = currentTarget.getBoundingClientRect(),
|
|
84
|
+
targetLeft = _currentTarget$getBou.left,
|
|
85
|
+
targetTop = _currentTarget$getBou.top,
|
|
86
|
+
targetWidth = _currentTarget$getBou.width,
|
|
87
|
+
targetHeight = _currentTarget$getBou.height;
|
|
88
|
+
var offsetX = 0;
|
|
89
|
+
var offsetY = 0;
|
|
90
|
+
if (placement.startsWith('top') || placement.startsWith('bottom')) {
|
|
91
|
+
offsetX = targetLeft - left - width / 2 + targetWidth / 2;
|
|
92
|
+
if (placement.startsWith('top')) {
|
|
93
|
+
offsetY = targetTop - top;
|
|
94
|
+
} else {
|
|
95
|
+
offsetY = targetTop - top - height + targetHeight;
|
|
96
|
+
}
|
|
97
|
+
} else if (placement.startsWith('left') || placement.startsWith('right')) {
|
|
98
|
+
offsetY = targetTop - top - height / 2 + targetHeight / 2;
|
|
99
|
+
if (placement.startsWith('left')) {
|
|
100
|
+
offsetX = targetLeft - left;
|
|
101
|
+
} else {
|
|
102
|
+
offsetX = targetLeft - left - width + targetWidth;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
setOffsetX(offsetX);
|
|
106
|
+
setOffsetY(offsetY);
|
|
107
|
+
}, visible ? 0 : mouseEnterDelay * 1000);
|
|
108
|
+
};
|
|
109
|
+
var handleMouseLeave = function handleMouseLeave(e, index) {
|
|
110
|
+
clearTimeout(hoverTimer.current);
|
|
111
|
+
hoverTimer.current = window.setTimeout(function () {
|
|
112
|
+
setVisible(false);
|
|
113
|
+
}, 200);
|
|
114
|
+
};
|
|
115
|
+
var _useState5 = useState(0),
|
|
116
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
117
|
+
offsetX = _useState6[0],
|
|
118
|
+
setOffsetX = _useState6[1];
|
|
119
|
+
var _useState7 = useState(0),
|
|
120
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
121
|
+
offsetY = _useState8[0],
|
|
122
|
+
setOffsetY = _useState8[1];
|
|
123
|
+
useEffect(function () {
|
|
124
|
+
if (lastHoverIndex.current !== hoverIndex) {
|
|
125
|
+
lastHoverIndex.current = hoverIndex;
|
|
126
|
+
}
|
|
127
|
+
}, [hoverIndex]);
|
|
128
|
+
useEffect(function () {
|
|
129
|
+
return function () {
|
|
130
|
+
clearTimeout(hoverTimer.current);
|
|
131
|
+
};
|
|
132
|
+
}, []);
|
|
133
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
134
|
+
popup: /*#__PURE__*/React.createElement("div", {
|
|
135
|
+
"data-odn-tooltip-group-content": true
|
|
136
|
+
}, (_tooltipInfos$hoverIn = tooltipInfos[hoverIndex]) === null || _tooltipInfos$hoverIn === void 0 ? void 0 : _tooltipInfos$hoverIn.popup),
|
|
137
|
+
popupClassName: popupClassName,
|
|
138
|
+
autoPlacements: autoPlacements,
|
|
139
|
+
arrowed: arrowed,
|
|
140
|
+
offset: offset,
|
|
141
|
+
mouseEnterDelay: mouseEnterDelay,
|
|
142
|
+
mouseLeaveDelay: mouseLeaveDelay,
|
|
143
|
+
flip: flip,
|
|
144
|
+
matchWidth: matchWidth,
|
|
145
|
+
portal: portal,
|
|
146
|
+
shift: shift,
|
|
147
|
+
placement: placement,
|
|
148
|
+
visible: visible,
|
|
149
|
+
popupStyle: _objectSpread(_objectSpread({}, popupStyle), {}, {
|
|
150
|
+
transform: "translate(".concat(offsetX, "px, ").concat(offsetY, "px) scale(").concat(visible ? 1 : 0.8, ")")
|
|
151
|
+
})
|
|
152
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tag, _objectSpread({
|
|
153
|
+
ref: tagRef,
|
|
154
|
+
children: tooltipInfos.map(function (info, index) {
|
|
155
|
+
if ( /*#__PURE__*/React.isValidElement(info.children)) {
|
|
156
|
+
var _ref2 = info.children.props,
|
|
157
|
+
_onMouseEnter = _ref2.onMouseEnter,
|
|
158
|
+
_onMouseLeave = _ref2.onMouseLeave,
|
|
159
|
+
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
160
|
+
return /*#__PURE__*/React.cloneElement(info.children, _objectSpread(_objectSpread({
|
|
161
|
+
key: index
|
|
162
|
+
}, rest), {}, {
|
|
163
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
164
|
+
handleMouseEnter(e, index);
|
|
165
|
+
_onMouseEnter === null || _onMouseEnter === void 0 || _onMouseEnter(e);
|
|
166
|
+
},
|
|
167
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
168
|
+
handleMouseLeave(e, index);
|
|
169
|
+
_onMouseLeave === null || _onMouseLeave === void 0 || _onMouseLeave(e);
|
|
170
|
+
}
|
|
171
|
+
}));
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
}, otherProps))));
|
|
175
|
+
};
|
|
176
|
+
Tooltip.Group = TooltipGroup;
|
|
177
|
+
Tooltip.displayName = 'Tooltip';
|
|
178
|
+
export default Tooltip;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TreeSelectProps as RcTreeSelectProps } from 'rc-tree-select';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import '../select/style';
|
|
4
|
+
import './style';
|
|
5
|
+
export interface TreeNodeData {
|
|
6
|
+
key: string | number;
|
|
7
|
+
title: React.ReactNode;
|
|
8
|
+
value: string | number;
|
|
9
|
+
children?: TreeNodeData[];
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
checkable?: boolean;
|
|
12
|
+
selectable?: boolean;
|
|
13
|
+
isLeaf?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface TreeSelectProps extends Omit<RcTreeSelectProps, 'treeData'> {
|
|
16
|
+
treeData?: TreeNodeData[];
|
|
17
|
+
mode?: 'multiple';
|
|
18
|
+
visible?: RcTreeSelectProps['open'];
|
|
19
|
+
onVisibleChange?: RcTreeSelectProps['onDropdownVisibleChange'];
|
|
20
|
+
showInnerSearch?: boolean;
|
|
21
|
+
light?: boolean;
|
|
22
|
+
popupRender?: (menu: React.ReactElement) => React.ReactElement;
|
|
23
|
+
}
|
|
24
|
+
declare const TreeSelect: React.FC<TreeSelectProps>;
|
|
25
|
+
export default TreeSelect;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
var _excluded = ["mode", "suffixIcon", "visible", "onVisibleChange", "treeCheckable", "className", "showInnerSearch", "light", "popupRender", "searchValue", "onSearch"];
|
|
3
|
+
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); }
|
|
4
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
|
+
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."); }
|
|
6
|
+
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); }
|
|
7
|
+
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; }
|
|
8
|
+
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; } }
|
|
9
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
+
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); }
|
|
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 clsx from 'clsx';
|
|
18
|
+
import RcTreeSelect from 'rc-tree-select';
|
|
19
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
20
|
+
import Icon from "../icon";
|
|
21
|
+
import "../select/style";
|
|
22
|
+
import useIcons from "../select/useIcons";
|
|
23
|
+
import "./style";
|
|
24
|
+
var TreeSelect = function TreeSelect(_ref) {
|
|
25
|
+
var mode = _ref.mode,
|
|
26
|
+
_ref$suffixIcon = _ref.suffixIcon,
|
|
27
|
+
suffixIconProp = _ref$suffixIcon === void 0 ? /*#__PURE__*/React.createElement(Icon, {
|
|
28
|
+
name: "down"
|
|
29
|
+
}) : _ref$suffixIcon,
|
|
30
|
+
visibleProp = _ref.visible,
|
|
31
|
+
onVisibleChange = _ref.onVisibleChange,
|
|
32
|
+
_ref$treeCheckable = _ref.treeCheckable,
|
|
33
|
+
treeCheckable = _ref$treeCheckable === void 0 ? true : _ref$treeCheckable,
|
|
34
|
+
className = _ref.className,
|
|
35
|
+
_ref$showInnerSearch = _ref.showInnerSearch,
|
|
36
|
+
showInnerSearch = _ref$showInnerSearch === void 0 ? false : _ref$showInnerSearch,
|
|
37
|
+
_ref$light = _ref.light,
|
|
38
|
+
light = _ref$light === void 0 ? false : _ref$light,
|
|
39
|
+
popupRender = _ref.popupRender,
|
|
40
|
+
searchValueProp = _ref.searchValue,
|
|
41
|
+
onSearch = _ref.onSearch,
|
|
42
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
+
var isMultiple = mode === 'multiple';
|
|
44
|
+
var _useIcons = useIcons(_objectSpread(_objectSpread({}, rest), {}, {
|
|
45
|
+
multiple: isMultiple,
|
|
46
|
+
hasFeedback: false,
|
|
47
|
+
feedbackIcon: undefined,
|
|
48
|
+
showSuffixIcon: !!suffixIconProp,
|
|
49
|
+
prefixCls: 'odn-select',
|
|
50
|
+
suffixIcon: suffixIconProp
|
|
51
|
+
})),
|
|
52
|
+
_suffixIcon = _useIcons.suffixIcon,
|
|
53
|
+
itemIcon = _useIcons.itemIcon,
|
|
54
|
+
removeIcon = _useIcons.removeIcon,
|
|
55
|
+
clearIcon = _useIcons.clearIcon;
|
|
56
|
+
var _useState = useState(visibleProp),
|
|
57
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
58
|
+
visible = _useState2[0],
|
|
59
|
+
setVisible = _useState2[1];
|
|
60
|
+
var _useState3 = useState(searchValueProp || ''),
|
|
61
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
62
|
+
searchValue = _useState4[0],
|
|
63
|
+
setSearchValue = _useState4[1];
|
|
64
|
+
var dropdownSearchInputRef = useRef(null);
|
|
65
|
+
var handleVisibleChange = function handleVisibleChange(bool) {
|
|
66
|
+
if (visibleProp === undefined) {
|
|
67
|
+
setVisible(bool);
|
|
68
|
+
}
|
|
69
|
+
onVisibleChange === null || onVisibleChange === void 0 || onVisibleChange(bool);
|
|
70
|
+
};
|
|
71
|
+
useEffect(function () {
|
|
72
|
+
if (searchValueProp !== undefined) {
|
|
73
|
+
setSearchValue(searchValueProp);
|
|
74
|
+
}
|
|
75
|
+
}, [searchValueProp]);
|
|
76
|
+
useEffect(function () {
|
|
77
|
+
if (visible) {
|
|
78
|
+
setTimeout(function () {
|
|
79
|
+
var _dropdownSearchInputR;
|
|
80
|
+
(_dropdownSearchInputR = dropdownSearchInputRef.current) === null || _dropdownSearchInputR === void 0 || _dropdownSearchInputR.focus();
|
|
81
|
+
}, 150);
|
|
82
|
+
}
|
|
83
|
+
}, [visible]);
|
|
84
|
+
return /*#__PURE__*/React.createElement(RcTreeSelect, _extends({
|
|
85
|
+
prefixCls: "odn-select",
|
|
86
|
+
dropdownClassName: clsx('odn-ts', isMultiple && 'odn-ts-multiple'),
|
|
87
|
+
className: clsx(className, showInnerSearch && 'odn-select-show-inner-search', light && 'odn-select-light', !light && 'odn-select-outlined'),
|
|
88
|
+
transitionName: "odn-slide-up",
|
|
89
|
+
showSearch: false,
|
|
90
|
+
suffixIcon: function suffixIcon(suffixIconProps) {
|
|
91
|
+
var suffixIconFinal = typeof _suffixIcon === 'function' ? _suffixIcon(suffixIconProps) : _suffixIcon;
|
|
92
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, suffixIconFinal);
|
|
93
|
+
},
|
|
94
|
+
switcherIcon: /*#__PURE__*/React.createElement(Icon, {
|
|
95
|
+
name: "right"
|
|
96
|
+
}),
|
|
97
|
+
removeIcon: removeIcon,
|
|
98
|
+
clearIcon: clearIcon,
|
|
99
|
+
open: visible,
|
|
100
|
+
onDropdownVisibleChange: handleVisibleChange,
|
|
101
|
+
multiple: isMultiple,
|
|
102
|
+
treeCheckable: isMultiple ? treeCheckable ? /*#__PURE__*/React.createElement("span", {
|
|
103
|
+
className: "odn-select-tree-checkbox-inner"
|
|
104
|
+
}) : treeCheckable : false,
|
|
105
|
+
showCheckedStrategy: "SHOW_PARENT",
|
|
106
|
+
searchValue: searchValue,
|
|
107
|
+
dropdownRender: function dropdownRender(menu) {
|
|
108
|
+
var searchNode = showInnerSearch ? /*#__PURE__*/React.createElement("div", {
|
|
109
|
+
className: "odn-select-dropdown-top"
|
|
110
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
111
|
+
className: "odn-select-dropdown-search"
|
|
112
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
113
|
+
name: "search",
|
|
114
|
+
className: "odn-select-dropdown-search-icon"
|
|
115
|
+
}), /*#__PURE__*/React.createElement("input", {
|
|
116
|
+
ref: dropdownSearchInputRef,
|
|
117
|
+
className: "odn-select-dropdown-search-input",
|
|
118
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
119
|
+
value: searchValue,
|
|
120
|
+
onChange: function onChange(e) {
|
|
121
|
+
var value = e.target.value;
|
|
122
|
+
if (searchValueProp === undefined) {
|
|
123
|
+
setSearchValue(value);
|
|
124
|
+
}
|
|
125
|
+
if (onSearch) {
|
|
126
|
+
onSearch(value);
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
onKeyDown: function onKeyDown(e) {
|
|
130
|
+
e.stopPropagation();
|
|
131
|
+
}
|
|
132
|
+
}))) : null;
|
|
133
|
+
var content = /*#__PURE__*/React.createElement(React.Fragment, null, searchNode, menu);
|
|
134
|
+
return popupRender ? popupRender(content) : content;
|
|
135
|
+
},
|
|
136
|
+
notFoundContent: "\u65E0\u5339\u914D\u7ED3\u679C"
|
|
137
|
+
}, rest));
|
|
138
|
+
};
|
|
139
|
+
TreeSelect.displayName = 'TreeSelect';
|
|
140
|
+
export default TreeSelect;
|