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,85 @@
|
|
|
1
|
+
import type { BaseSelectRef, SelectProps as RcSelectProps } from 'rc-select';
|
|
2
|
+
import { OptGroup, Option } from 'rc-select';
|
|
3
|
+
import type { BaseOptionType, DefaultOptionType } from 'rc-select/lib/Select';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import './style';
|
|
6
|
+
type RawValue = string | number;
|
|
7
|
+
type SemanticName = 'root';
|
|
8
|
+
type PopupSemantic = 'root';
|
|
9
|
+
export interface LabeledValue {
|
|
10
|
+
key?: string;
|
|
11
|
+
value: RawValue;
|
|
12
|
+
label: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[] | undefined;
|
|
15
|
+
export interface InternalSelectProps<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType> extends Omit<RcSelectProps<ValueType, OptionType>, 'mode'> {
|
|
16
|
+
rootClassName?: string;
|
|
17
|
+
prefix?: React.ReactNode;
|
|
18
|
+
suffixIcon?: React.ReactNode;
|
|
19
|
+
size?: 'small' | 'middle' | 'large';
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
mode?: 'multiple' | 'tags' | 'SECRET_COMBOBOX_MODE_DO_NOT_USE' | 'combobox';
|
|
22
|
+
/** @deprecated Use `variant` instead. */
|
|
23
|
+
bordered?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated `showArrow` is deprecated which will be removed in next major version. It will be a
|
|
26
|
+
* default behavior, you can hide it by setting `suffixIcon` to null.
|
|
27
|
+
*/
|
|
28
|
+
showArrow?: boolean;
|
|
29
|
+
styles?: Partial<Record<SemanticName, React.CSSProperties>> & {
|
|
30
|
+
popup?: Partial<Record<PopupSemantic, React.CSSProperties>>;
|
|
31
|
+
};
|
|
32
|
+
classNames?: Partial<Record<SemanticName, string>> & {
|
|
33
|
+
popup?: Partial<Record<PopupSemantic, string>>;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export interface SelectProps<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType> extends Omit<InternalSelectProps<ValueType, OptionType>, 'mode' | 'getInputElement' | 'getRawInputElement' | 'backfill' | 'placement'> {
|
|
37
|
+
placement?: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';
|
|
38
|
+
mode?: 'multiple' | 'tags';
|
|
39
|
+
status?: 'error' | 'warning';
|
|
40
|
+
popupClassName?: string;
|
|
41
|
+
popupMatchSelectWidth?: boolean | number;
|
|
42
|
+
popupRender?: (menu: React.ReactElement) => React.ReactElement;
|
|
43
|
+
visible?: RcSelectProps['open'];
|
|
44
|
+
onVisibleChange?: RcSelectProps['onDropdownVisibleChange'];
|
|
45
|
+
light?: boolean;
|
|
46
|
+
optionCheckPosition?: 'left' | 'right';
|
|
47
|
+
showInnerSearch?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface SelectButtonProps {
|
|
50
|
+
/** 是否显示箭头 */
|
|
51
|
+
showArrow?: boolean;
|
|
52
|
+
/** 尺寸 */
|
|
53
|
+
size?: 'small' | 'middle' | 'large';
|
|
54
|
+
/** 是否禁用 */
|
|
55
|
+
disabled?: boolean;
|
|
56
|
+
/** 前缀图标 */
|
|
57
|
+
prefix?: React.ReactNode;
|
|
58
|
+
/** 占位符 */
|
|
59
|
+
placeholder?: string;
|
|
60
|
+
/** 当前值 */
|
|
61
|
+
value?: string | number;
|
|
62
|
+
/** 是否打开 */
|
|
63
|
+
active?: boolean;
|
|
64
|
+
/** 是否允许清除 */
|
|
65
|
+
allowClear?: boolean;
|
|
66
|
+
/** 点击事件 */
|
|
67
|
+
onClick?: () => void;
|
|
68
|
+
/** 清除事件 */
|
|
69
|
+
onClear?: () => void;
|
|
70
|
+
/** 样式类名 */
|
|
71
|
+
className?: string;
|
|
72
|
+
/** 内联样式 */
|
|
73
|
+
style?: React.CSSProperties;
|
|
74
|
+
}
|
|
75
|
+
declare const SelectButton: React.ForwardRefExoticComponent<SelectButtonProps & React.RefAttributes<HTMLDivElement>>;
|
|
76
|
+
export interface SelectComponent {
|
|
77
|
+
<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType>(props: React.PropsWithChildren<SelectProps<ValueType, OptionType>> & React.RefAttributes<BaseSelectRef>): React.ReactElement;
|
|
78
|
+
displayName?: string;
|
|
79
|
+
SECRET_COMBOBOX_MODE_DO_NOT_USE: string;
|
|
80
|
+
Option: typeof Option;
|
|
81
|
+
OptGroup: typeof OptGroup;
|
|
82
|
+
Button: typeof SelectButton;
|
|
83
|
+
}
|
|
84
|
+
declare const Select: SelectComponent;
|
|
85
|
+
export default Select;
|
|
@@ -0,0 +1,262 @@
|
|
|
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 = ["className", "light", "mode", "suffixIcon", "popupClassName", "visible", "onVisibleChange", "showInnerSearch", "popupRender", "searchValue", "onSearch", "maxCount", "defaultValue", "value", "onChange", "placeholder", "showSearch", "size", "autoClearSearchValue"];
|
|
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 RcSelect, { OptGroup, Option } from 'rc-select';
|
|
19
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
20
|
+
import Checkbox from "../checkbox";
|
|
21
|
+
import Icon from "../icon";
|
|
22
|
+
import "./style";
|
|
23
|
+
import useIcons from "./useIcons";
|
|
24
|
+
var InternalSelect = function InternalSelect(props, ref) {
|
|
25
|
+
var className = props.className,
|
|
26
|
+
light = props.light,
|
|
27
|
+
mode = props.mode,
|
|
28
|
+
_props$suffixIcon = props.suffixIcon,
|
|
29
|
+
suffixIconProp = _props$suffixIcon === void 0 ? /*#__PURE__*/React.createElement(Icon, {
|
|
30
|
+
name: "down"
|
|
31
|
+
}) : _props$suffixIcon,
|
|
32
|
+
popupClassName = props.popupClassName,
|
|
33
|
+
visibleProp = props.visible,
|
|
34
|
+
onVisibleChange = props.onVisibleChange,
|
|
35
|
+
_props$showInnerSearc = props.showInnerSearch,
|
|
36
|
+
showInnerSearch = _props$showInnerSearc === void 0 ? false : _props$showInnerSearc,
|
|
37
|
+
popupRender = props.popupRender,
|
|
38
|
+
searchValueProp = props.searchValue,
|
|
39
|
+
onSearch = props.onSearch,
|
|
40
|
+
maxCount = props.maxCount,
|
|
41
|
+
_props$defaultValue = props.defaultValue,
|
|
42
|
+
defaultValue = _props$defaultValue === void 0 ? undefined : _props$defaultValue,
|
|
43
|
+
_props$value = props.value,
|
|
44
|
+
valueProp = _props$value === void 0 ? undefined : _props$value,
|
|
45
|
+
_onChange = props.onChange,
|
|
46
|
+
_props$placeholder = props.placeholder,
|
|
47
|
+
placeholder = _props$placeholder === void 0 ? '请选择' : _props$placeholder,
|
|
48
|
+
_props$showSearch = props.showSearch,
|
|
49
|
+
showSearch = _props$showSearch === void 0 ? false : _props$showSearch,
|
|
50
|
+
_props$size = props.size,
|
|
51
|
+
size = _props$size === void 0 ? 'middle' : _props$size,
|
|
52
|
+
_props$autoClearSearc = props.autoClearSearchValue,
|
|
53
|
+
autoClearSearchValue = _props$autoClearSearc === void 0 ? true : _props$autoClearSearc,
|
|
54
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
55
|
+
var isMultiple = mode === 'multiple' || mode === 'tags';
|
|
56
|
+
var _useIcons = useIcons(_objectSpread(_objectSpread({}, rest), {}, {
|
|
57
|
+
multiple: isMultiple,
|
|
58
|
+
hasFeedback: false,
|
|
59
|
+
feedbackIcon: undefined,
|
|
60
|
+
showSuffixIcon: !!suffixIconProp,
|
|
61
|
+
prefixCls: 'odn-select',
|
|
62
|
+
suffixIcon: suffixIconProp
|
|
63
|
+
})),
|
|
64
|
+
_suffixIcon = _useIcons.suffixIcon,
|
|
65
|
+
itemIcon = _useIcons.itemIcon,
|
|
66
|
+
removeIcon = _useIcons.removeIcon,
|
|
67
|
+
clearIcon = _useIcons.clearIcon;
|
|
68
|
+
var _useState = useState(valueProp === undefined ? defaultValue : valueProp),
|
|
69
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
70
|
+
value = _useState2[0],
|
|
71
|
+
setValue = _useState2[1];
|
|
72
|
+
var _useState3 = useState(visibleProp),
|
|
73
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
74
|
+
visible = _useState4[0],
|
|
75
|
+
setVisible = _useState4[1];
|
|
76
|
+
var _useState5 = useState(searchValueProp || ''),
|
|
77
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
78
|
+
searchValue = _useState6[0],
|
|
79
|
+
setSearchValue = _useState6[1];
|
|
80
|
+
var dropdownSearchInputRef = useRef(null);
|
|
81
|
+
var handleVisibleChange = function handleVisibleChange(bool) {
|
|
82
|
+
if (visibleProp === undefined) {
|
|
83
|
+
setVisible(bool);
|
|
84
|
+
}
|
|
85
|
+
onVisibleChange === null || onVisibleChange === void 0 || onVisibleChange(bool);
|
|
86
|
+
};
|
|
87
|
+
useEffect(function () {
|
|
88
|
+
if (valueProp !== undefined) {
|
|
89
|
+
setValue(valueProp);
|
|
90
|
+
}
|
|
91
|
+
}, [valueProp]);
|
|
92
|
+
useEffect(function () {
|
|
93
|
+
if (searchValueProp !== undefined) {
|
|
94
|
+
setSearchValue(searchValueProp);
|
|
95
|
+
}
|
|
96
|
+
}, [searchValueProp]);
|
|
97
|
+
useEffect(function () {
|
|
98
|
+
if (visibleProp !== undefined) {
|
|
99
|
+
setVisible(visibleProp);
|
|
100
|
+
}
|
|
101
|
+
}, [visibleProp]);
|
|
102
|
+
useEffect(function () {
|
|
103
|
+
if (visible) {
|
|
104
|
+
setTimeout(function () {
|
|
105
|
+
var _dropdownSearchInputR;
|
|
106
|
+
(_dropdownSearchInputR = dropdownSearchInputRef.current) === null || _dropdownSearchInputR === void 0 || _dropdownSearchInputR.focus();
|
|
107
|
+
}, 150);
|
|
108
|
+
}
|
|
109
|
+
}, [visible]);
|
|
110
|
+
return /*#__PURE__*/React.createElement(RcSelect, _extends({
|
|
111
|
+
ref: ref,
|
|
112
|
+
prefixCls: "odn-select",
|
|
113
|
+
className: clsx(className, "odn-select-".concat(size), showInnerSearch && 'odn-select-show-inner-search', light && 'odn-select-light', !light && 'odn-select-outlined'),
|
|
114
|
+
transitionName: "odn-slide-up",
|
|
115
|
+
mode: mode,
|
|
116
|
+
suffixIcon: function suffixIcon(suffixIconProps) {
|
|
117
|
+
var suffixIconFinal = typeof _suffixIcon === 'function' ? _suffixIcon(suffixIconProps) : _suffixIcon;
|
|
118
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !!maxCount && mode === 'multiple' && Array.isArray(value) && /*#__PURE__*/React.createElement("span", {
|
|
119
|
+
className: "odn-select-max-count"
|
|
120
|
+
}, value.length, " / ", maxCount), suffixIconFinal);
|
|
121
|
+
},
|
|
122
|
+
menuItemSelectedIcon: mode === 'multiple' ? function (props) {
|
|
123
|
+
var value = props.value,
|
|
124
|
+
disabled = props.disabled,
|
|
125
|
+
isSelected = props.isSelected;
|
|
126
|
+
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
127
|
+
checked: isSelected,
|
|
128
|
+
disabled: disabled
|
|
129
|
+
});
|
|
130
|
+
} : itemIcon,
|
|
131
|
+
dropdownClassName: clsx(mode && "odn-select-dropdown-".concat(mode), popupClassName),
|
|
132
|
+
removeIcon: removeIcon,
|
|
133
|
+
clearIcon: clearIcon,
|
|
134
|
+
maxCount: maxCount,
|
|
135
|
+
open: visible,
|
|
136
|
+
onDropdownVisibleChange: handleVisibleChange,
|
|
137
|
+
searchValue: searchValue,
|
|
138
|
+
value: value,
|
|
139
|
+
onChange: function onChange(param, option) {
|
|
140
|
+
if (valueProp === undefined) {
|
|
141
|
+
setValue(param);
|
|
142
|
+
}
|
|
143
|
+
if (autoClearSearchValue) {
|
|
144
|
+
if (searchValueProp === undefined) {
|
|
145
|
+
setSearchValue('');
|
|
146
|
+
}
|
|
147
|
+
if (onSearch) {
|
|
148
|
+
onSearch('');
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
_onChange === null || _onChange === void 0 || _onChange(param !== null && param !== void 0 ? param : null, option);
|
|
152
|
+
},
|
|
153
|
+
dropdownRender: function dropdownRender(menu) {
|
|
154
|
+
var searchNode = showInnerSearch ? /*#__PURE__*/React.createElement("div", {
|
|
155
|
+
className: "odn-select-dropdown-top"
|
|
156
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
157
|
+
className: "odn-select-dropdown-search"
|
|
158
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
159
|
+
name: "search",
|
|
160
|
+
className: "odn-select-dropdown-search-icon"
|
|
161
|
+
}), /*#__PURE__*/React.createElement("input", {
|
|
162
|
+
ref: dropdownSearchInputRef,
|
|
163
|
+
className: "odn-select-dropdown-search-input",
|
|
164
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
165
|
+
value: searchValue,
|
|
166
|
+
onChange: function onChange(e) {
|
|
167
|
+
var value = e.target.value;
|
|
168
|
+
if (searchValueProp === undefined) {
|
|
169
|
+
setSearchValue(value);
|
|
170
|
+
}
|
|
171
|
+
if (onSearch) {
|
|
172
|
+
onSearch(value);
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
onKeyDown: function onKeyDown(e) {
|
|
176
|
+
e.stopPropagation();
|
|
177
|
+
}
|
|
178
|
+
}))) : null;
|
|
179
|
+
var content = /*#__PURE__*/React.createElement(React.Fragment, null, searchNode, menu);
|
|
180
|
+
return popupRender ? popupRender(content) : content;
|
|
181
|
+
},
|
|
182
|
+
placeholder: placeholder,
|
|
183
|
+
notFoundContent: "\u65E0\u5339\u914D\u7ED3\u679C",
|
|
184
|
+
showSearch: showSearch,
|
|
185
|
+
autoClearSearchValue: autoClearSearchValue,
|
|
186
|
+
optionFilterProp: "label"
|
|
187
|
+
}, rest));
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
// Select.Button 组件接口
|
|
191
|
+
|
|
192
|
+
// Select.Button 组件
|
|
193
|
+
var SelectButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
194
|
+
var _ref$showArrow = _ref.showArrow,
|
|
195
|
+
showArrow = _ref$showArrow === void 0 ? true : _ref$showArrow,
|
|
196
|
+
_ref$size = _ref.size,
|
|
197
|
+
size = _ref$size === void 0 ? 'middle' : _ref$size,
|
|
198
|
+
_ref$disabled = _ref.disabled,
|
|
199
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
200
|
+
prefix = _ref.prefix,
|
|
201
|
+
_ref$placeholder = _ref.placeholder,
|
|
202
|
+
placeholder = _ref$placeholder === void 0 ? '请选择' : _ref$placeholder,
|
|
203
|
+
value = _ref.value,
|
|
204
|
+
_ref$active = _ref.active,
|
|
205
|
+
active = _ref$active === void 0 ? false : _ref$active,
|
|
206
|
+
_ref$allowClear = _ref.allowClear,
|
|
207
|
+
allowClear = _ref$allowClear === void 0 ? false : _ref$allowClear,
|
|
208
|
+
onClick = _ref.onClick,
|
|
209
|
+
onClear = _ref.onClear,
|
|
210
|
+
className = _ref.className,
|
|
211
|
+
style = _ref.style;
|
|
212
|
+
var buttonClasses = clsx('odn-select-button odn-select odn-select-outlined odn-select-single odn-select-allow-clear odn-select-show-arrow', "odn-select-button-".concat(size), {
|
|
213
|
+
'odn-select-button-disabled': disabled,
|
|
214
|
+
'odn-select-open': active,
|
|
215
|
+
'odn-select-focused': active
|
|
216
|
+
}, className);
|
|
217
|
+
var hasValue = value !== undefined && value !== '';
|
|
218
|
+
var showClear = allowClear && hasValue && !disabled;
|
|
219
|
+
var handleClear = function handleClear(e) {
|
|
220
|
+
e.stopPropagation();
|
|
221
|
+
onClear === null || onClear === void 0 || onClear();
|
|
222
|
+
};
|
|
223
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
224
|
+
ref: ref,
|
|
225
|
+
className: buttonClasses,
|
|
226
|
+
style: style,
|
|
227
|
+
onClick: disabled ? undefined : onClick
|
|
228
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
229
|
+
className: "odn-select-selector"
|
|
230
|
+
}, !!prefix && /*#__PURE__*/React.createElement("span", {
|
|
231
|
+
className: "odn-select-prefix"
|
|
232
|
+
}, prefix), /*#__PURE__*/React.createElement("span", {
|
|
233
|
+
className: "odn-select-selection-wrap"
|
|
234
|
+
}, value ? /*#__PURE__*/React.createElement("span", {
|
|
235
|
+
className: "odn-select-selection-item"
|
|
236
|
+
}, value) : /*#__PURE__*/React.createElement("span", {
|
|
237
|
+
className: "odn-select-selection-placeholder"
|
|
238
|
+
}, placeholder))), /*#__PURE__*/React.createElement("div", {
|
|
239
|
+
className: "odn-select-arrow"
|
|
240
|
+
}, showArrow ? /*#__PURE__*/React.createElement(Icon, {
|
|
241
|
+
name: "down"
|
|
242
|
+
}) : null), allowClear && showClear && /*#__PURE__*/React.createElement("span", {
|
|
243
|
+
className: "odn-select-clear",
|
|
244
|
+
onClick: handleClear
|
|
245
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
246
|
+
name: "cancel-circle-filled",
|
|
247
|
+
style: {
|
|
248
|
+
background: 'var(--odn-color-white)'
|
|
249
|
+
}
|
|
250
|
+
})));
|
|
251
|
+
});
|
|
252
|
+
SelectButton.displayName = 'Select.Button';
|
|
253
|
+
|
|
254
|
+
// 明确定义 Select 组件的类型,避免依赖 rc-select 的内部类型路径
|
|
255
|
+
|
|
256
|
+
var Select = /*#__PURE__*/React.forwardRef(InternalSelect);
|
|
257
|
+
Select.displayName = 'Select';
|
|
258
|
+
Select.SECRET_COMBOBOX_MODE_DO_NOT_USE = 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
|
|
259
|
+
Select.Option = Option;
|
|
260
|
+
Select.OptGroup = OptGroup;
|
|
261
|
+
Select.Button = SelectButton;
|
|
262
|
+
export default Select;
|