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,320 @@
|
|
|
1
|
+
html {
|
|
2
|
+
--odn-table-loading-height: 240px;
|
|
3
|
+
--odn-table-border-color: var(--odn-color-solid-black-5);
|
|
4
|
+
--odn-table-cell-bg: var(--odn-color-white);
|
|
5
|
+
--odn-table-cell-bg-hover: var(--odn-color-solid-black-1);
|
|
6
|
+
--odn-table-cell-bg-striped: var(--odn-color-solid-black-1);
|
|
7
|
+
--odn-table-cell-bg-striped-hover: var(--odn-color-solid-black-2);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[data-odn-table] {
|
|
11
|
+
max-width: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.odn-table {
|
|
15
|
+
border-collapse: collapse;
|
|
16
|
+
border-spacing: 0;
|
|
17
|
+
width: 100%;
|
|
18
|
+
max-width: 100%;
|
|
19
|
+
}
|
|
20
|
+
.odn-table table {
|
|
21
|
+
width: 100%;
|
|
22
|
+
text-align: start;
|
|
23
|
+
border-collapse: separate;
|
|
24
|
+
border-spacing: 0;
|
|
25
|
+
font-size: var(--odn-font-size);
|
|
26
|
+
line-height: var(--odn-line-height);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.odn-table-body::-webkit-scrollbar,
|
|
30
|
+
.odn-table-content::-webkit-scrollbar {
|
|
31
|
+
width: 14px;
|
|
32
|
+
height: 14px;
|
|
33
|
+
}
|
|
34
|
+
.odn-table-body::-webkit-scrollbar-thumb,
|
|
35
|
+
.odn-table-content::-webkit-scrollbar-thumb {
|
|
36
|
+
min-width: 14px;
|
|
37
|
+
min-height: 14px;
|
|
38
|
+
background-color: var(--odn-color-border);
|
|
39
|
+
background-clip: content-box;
|
|
40
|
+
border: 4px solid transparent;
|
|
41
|
+
border-radius: 14px;
|
|
42
|
+
}
|
|
43
|
+
.odn-table-body::-webkit-scrollbar-track,
|
|
44
|
+
.odn-table-content::-webkit-scrollbar-track {
|
|
45
|
+
background-color: rgba(0, 0, 0, 0);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.odn-table-cell {
|
|
49
|
+
padding: 12px;
|
|
50
|
+
overflow-wrap: break-word;
|
|
51
|
+
background-color: var(--odn-table-cell-bg);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.odn-table-cell-ellipsis .odn-table-cell-content {
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
text-overflow: ellipsis;
|
|
58
|
+
word-break: keep-all;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.odn-table-cell-row-hover {
|
|
62
|
+
background-color: var(--odn-table-cell-bg-hover);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.odn-table-summary td {
|
|
66
|
+
border-top: 1px solid var(--odn-table-border-color);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.odn-table-thead {
|
|
70
|
+
position: relative;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.odn-table-thead .odn-table-cell {
|
|
74
|
+
font-weight: 600;
|
|
75
|
+
text-align: start;
|
|
76
|
+
border-bottom: 1px solid var(--odn-table-border-color);
|
|
77
|
+
user-select: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.odn-table-tbody .odn-table-row:not(:last-child) .odn-table-cell {
|
|
81
|
+
border-bottom: 1px solid var(--odn-table-border-color);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
[data-odn-table-bordered=true] .odn-table {
|
|
85
|
+
border-top: 1px solid var(--odn-table-border-color);
|
|
86
|
+
border-left: 1px solid var(--odn-table-border-color);
|
|
87
|
+
}
|
|
88
|
+
[data-odn-table-bordered=true] .odn-table-cell {
|
|
89
|
+
border-right: 1px solid var(--odn-table-border-color);
|
|
90
|
+
}
|
|
91
|
+
[data-odn-table-bordered=true] .odn-table-tbody .odn-table-row .odn-table-cell {
|
|
92
|
+
border-bottom: 1px solid var(--odn-table-border-color);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
[data-odn-table-striped=true] .odn-table-thead .odn-table-cell {
|
|
96
|
+
background-color: var(--odn-table-cell-bg-striped);
|
|
97
|
+
}
|
|
98
|
+
[data-odn-table-striped=true] .odn-table-tbody .odn-table-row:nth-child(even) .odn-table-cell {
|
|
99
|
+
background-color: var(--odn-table-cell-bg-striped);
|
|
100
|
+
}
|
|
101
|
+
[data-odn-table-striped=true] .odn-table-tbody .odn-table-row:nth-child(even) .odn-table-cell.odn-table-cell-row-hover {
|
|
102
|
+
background-color: var(--odn-table-cell-bg-striped-hover);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
[data-odn-table-selection-checkbox] {
|
|
106
|
+
vertical-align: top;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-odn-table-tr-clickable=true] .odn-table-row {
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
[data-odn-table-column-filter] {
|
|
114
|
+
display: inline-block;
|
|
115
|
+
margin-left: 4px;
|
|
116
|
+
vertical-align: -3px;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
color: var(--odn-color-black-8);
|
|
119
|
+
}
|
|
120
|
+
[data-odn-table-column-filter]:hover {
|
|
121
|
+
color: var(--odn-color-black-9);
|
|
122
|
+
}
|
|
123
|
+
[data-odn-table-column-filter][data-odn-table-column-filter-active=true] {
|
|
124
|
+
color: var(--odn-color-primary);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
[data-odn-table-filter-menu] {
|
|
128
|
+
padding: 12px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
[data-odn-table-filter-footer] {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
justify-content: space-between;
|
|
135
|
+
gap: 12px;
|
|
136
|
+
padding: 8px;
|
|
137
|
+
border-top: 1px solid var(--odn-table-border-color);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
[data-odn-table-column-sorter] {
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
justify-content: center;
|
|
144
|
+
gap: 4px;
|
|
145
|
+
cursor: pointer;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
[data-odn-table-column-sorter-inner] {
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
justify-content: center;
|
|
152
|
+
gap: 4px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
[data-odn-table-column-sorter-title] {
|
|
156
|
+
flex: 1;
|
|
157
|
+
min-width: 0;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
[data-odn-table-column-sorter-inner] {
|
|
161
|
+
flex: none;
|
|
162
|
+
position: relative;
|
|
163
|
+
width: 16px;
|
|
164
|
+
height: 16px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
[data-odn-table-column-sorter-up],
|
|
168
|
+
[data-odn-table-column-sorter-down] {
|
|
169
|
+
position: absolute;
|
|
170
|
+
top: 0;
|
|
171
|
+
left: 0;
|
|
172
|
+
width: 100%;
|
|
173
|
+
height: 100%;
|
|
174
|
+
fill: var(--odn-color-black-8);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
[data-odn-table-column-sorter-order=ascend],
|
|
178
|
+
[data-odn-table-column-sorter-order=descend] {
|
|
179
|
+
color: var(--odn-color-primary);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
[data-odn-table-column-sorter-order=ascend] [data-odn-table-column-sorter-up] {
|
|
183
|
+
fill: var(--odn-color-primary);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
[data-odn-table-column-sorter-order=descend] [data-odn-table-column-sorter-down] {
|
|
187
|
+
fill: var(--odn-color-primary);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
[data-odn-table-expand-icon] {
|
|
191
|
+
display: block;
|
|
192
|
+
cursor: pointer;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.odn-table-cell-fix-left::after,
|
|
196
|
+
.odn-table-cell-fix-right::after {
|
|
197
|
+
content: "";
|
|
198
|
+
position: absolute;
|
|
199
|
+
top: 0;
|
|
200
|
+
bottom: 1px;
|
|
201
|
+
width: 30px;
|
|
202
|
+
transition: box-shadow 0.15s cubic-bezier(0.32, 0.72, 0, 1);
|
|
203
|
+
pointer-events: none;
|
|
204
|
+
will-change: transform;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.odn-table-cell-fix-left::after {
|
|
208
|
+
right: 0;
|
|
209
|
+
transform: translate3d(100%, 0, 0);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.odn-table-cell-fix-right::after {
|
|
213
|
+
left: 0;
|
|
214
|
+
transform: translate3d(-100%, 0, 0);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.odn-table-ping-left .odn-table-cell-fix-left-last::after {
|
|
218
|
+
box-shadow: inset 10px 0 8px -8px var(--odn-color-black-3);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.odn-table-ping-right .odn-table-cell-fix-right-first::after {
|
|
222
|
+
box-shadow: inset -10px 0 8px -8px var(--odn-color-black-3);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
[data-odn-table-empty] {
|
|
226
|
+
display: flex;
|
|
227
|
+
flex-direction: column;
|
|
228
|
+
align-items: center;
|
|
229
|
+
justify-content: center;
|
|
230
|
+
gap: 12px;
|
|
231
|
+
height: var(--odn-table-loading-height);
|
|
232
|
+
font-size: 13px;
|
|
233
|
+
font-weight: 600;
|
|
234
|
+
color: var(--odn-color-black-9);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.odn-table-thead::after {
|
|
238
|
+
content: "";
|
|
239
|
+
display: none;
|
|
240
|
+
position: absolute;
|
|
241
|
+
top: 100%;
|
|
242
|
+
left: 0;
|
|
243
|
+
width: 100%;
|
|
244
|
+
height: 2px;
|
|
245
|
+
background: linear-gradient(90deg, color-mix(in srgb, var(--odn-primary-color) 5%, transparent) 0%, var(--odn-primary-color) 50%, color-mix(in srgb, var(--odn-primary-color) 5%, transparent) 100%);
|
|
246
|
+
background-size: 200% 100%;
|
|
247
|
+
z-index: 1;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
[data-odn-table-loading=true] .odn-table-thead::after {
|
|
251
|
+
display: block;
|
|
252
|
+
animation: loading-bar 2s ease-in-out infinite;
|
|
253
|
+
}
|
|
254
|
+
[data-odn-table-loading=true] .odn-table {
|
|
255
|
+
pointer-events: none;
|
|
256
|
+
}
|
|
257
|
+
[data-odn-table-loading=true] .odn-table-tbody {
|
|
258
|
+
opacity: 0.5;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
@keyframes loading-bar {
|
|
262
|
+
0% {
|
|
263
|
+
background-position: 200% 0;
|
|
264
|
+
}
|
|
265
|
+
100% {
|
|
266
|
+
background-position: -200% 0;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
[data-odn-table-popover-text] {
|
|
270
|
+
text-decoration-line: underline;
|
|
271
|
+
text-decoration-thickness: 1px;
|
|
272
|
+
text-decoration-style: dashed;
|
|
273
|
+
text-underline-offset: 3px;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
[data-odn-table-popover-icon] {
|
|
277
|
+
display: inline-block;
|
|
278
|
+
margin-left: 2px;
|
|
279
|
+
vertical-align: -3px;
|
|
280
|
+
cursor: pointer;
|
|
281
|
+
color: var(--odn-color-black-8);
|
|
282
|
+
}
|
|
283
|
+
[data-odn-table-popover-icon]:hover {
|
|
284
|
+
color: var(--odn-color-black-9);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.odn-table-sticky-holder {
|
|
288
|
+
position: sticky;
|
|
289
|
+
z-index: 3;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.odn-table-sticky-scroll {
|
|
293
|
+
position: sticky;
|
|
294
|
+
bottom: 0;
|
|
295
|
+
height: 8px;
|
|
296
|
+
z-index: 3;
|
|
297
|
+
display: flex;
|
|
298
|
+
align-items: center;
|
|
299
|
+
background-color: #fff;
|
|
300
|
+
border-top: 1px solid var(--odn-color-border);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.odn-table-sticky-scroll-bar {
|
|
304
|
+
height: 6px;
|
|
305
|
+
background-color: var(--odn-color-border);
|
|
306
|
+
border-radius: 9999px;
|
|
307
|
+
position: absolute;
|
|
308
|
+
top: calc(50% - 3px);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.odn-table-measure-cell {
|
|
312
|
+
padding-block: 0 !important;
|
|
313
|
+
border-block: 0 !important;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.odn-table-measure-cell-content {
|
|
317
|
+
height: 0;
|
|
318
|
+
overflow: hidden;
|
|
319
|
+
pointer-events: none;
|
|
320
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ColumnType as RcColumnType } from 'rc-table/lib/interface';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { TableRowSelection } from './index';
|
|
4
|
+
export interface UseSelectionOptions<T> {
|
|
5
|
+
dataSource: T[];
|
|
6
|
+
rowSelection?: TableRowSelection<T>;
|
|
7
|
+
columns: RcColumnType<T>[];
|
|
8
|
+
}
|
|
9
|
+
export interface UseSelectionReturn<T> {
|
|
10
|
+
columns: RcColumnType<T>[];
|
|
11
|
+
onRowClick?: (record: T, event?: React.MouseEvent) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function useSelection<T extends Record<string, unknown>>({ dataSource, rowSelection, columns, }: UseSelectionOptions<T>): UseSelectionReturn<T>;
|
|
@@ -0,0 +1,259 @@
|
|
|
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 = ["popover", "popoverProps"],
|
|
3
|
+
_excluded2 = ["popover", "popoverProps"];
|
|
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 _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); }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
13
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
+
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); }
|
|
15
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
16
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
17
|
+
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; }
|
|
18
|
+
import React from 'react';
|
|
19
|
+
import Checkbox from "../checkbox";
|
|
20
|
+
import Popover from "../popover";
|
|
21
|
+
import Radio from "../radio";
|
|
22
|
+
export function useSelection(_ref) {
|
|
23
|
+
var dataSource = _ref.dataSource,
|
|
24
|
+
rowSelection = _ref.rowSelection,
|
|
25
|
+
columns = _ref.columns;
|
|
26
|
+
var processedColumns = _toConsumableArray(columns);
|
|
27
|
+
|
|
28
|
+
// 行点击处理函数
|
|
29
|
+
var onRowClick;
|
|
30
|
+
if (rowSelection) {
|
|
31
|
+
var selectedRowKeys = rowSelection.selectedRowKeys || [];
|
|
32
|
+
var selectionType = rowSelection.type || 'checkbox';
|
|
33
|
+
|
|
34
|
+
// 统一的单行选择处理
|
|
35
|
+
var handleRowSelect = function handleRowSelect(record, checked) {
|
|
36
|
+
if (!(rowSelection !== null && rowSelection !== void 0 && rowSelection.onChange)) return;
|
|
37
|
+
var recordKey = record.key;
|
|
38
|
+
var newSelectedRowKeys;
|
|
39
|
+
if (selectionType === 'radio') {
|
|
40
|
+
// 单选模式:直接设置为当前选中的项
|
|
41
|
+
newSelectedRowKeys = [recordKey];
|
|
42
|
+
} else {
|
|
43
|
+
// 多选模式
|
|
44
|
+
if (checked) {
|
|
45
|
+
// 选中:添加 key
|
|
46
|
+
newSelectedRowKeys = selectedRowKeys.includes(recordKey) ? selectedRowKeys : [].concat(_toConsumableArray(selectedRowKeys), [recordKey]);
|
|
47
|
+
} else {
|
|
48
|
+
// 取消选中:移除 key
|
|
49
|
+
newSelectedRowKeys = selectedRowKeys.filter(function (key) {
|
|
50
|
+
return key !== recordKey;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
var selectedRecords = dataSource.filter(function (item) {
|
|
55
|
+
return newSelectedRowKeys.includes(item.key);
|
|
56
|
+
});
|
|
57
|
+
rowSelection.onChange(newSelectedRowKeys, {
|
|
58
|
+
selectedRows: selectedRecords
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// 行点击处理
|
|
63
|
+
onRowClick = function onRowClick(record, event) {
|
|
64
|
+
if (!(rowSelection !== null && rowSelection !== void 0 && rowSelection.selectOnRowClick)) return;
|
|
65
|
+
|
|
66
|
+
// 检查是否点击的是选择控件,如果是则不处理行点击
|
|
67
|
+
var target = event === null || event === void 0 ? void 0 : event.target;
|
|
68
|
+
if (target && (target.closest('[data-odn-table-selection-checkbox]') || target.closest('[data-odn-table-selection-radio]'))) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
var recordKey = record.key;
|
|
72
|
+
|
|
73
|
+
// 检查行是否被禁用
|
|
74
|
+
if (selectionType === 'checkbox') {
|
|
75
|
+
var _rowSelection$getChec;
|
|
76
|
+
var checkboxProps = (_rowSelection$getChec = rowSelection.getCheckboxProps) === null || _rowSelection$getChec === void 0 ? void 0 : _rowSelection$getChec.call(rowSelection, record);
|
|
77
|
+
if (checkboxProps !== null && checkboxProps !== void 0 && checkboxProps.disabled) return;
|
|
78
|
+
|
|
79
|
+
// 多选:切换选中状态
|
|
80
|
+
var isSelected = selectedRowKeys.includes(recordKey);
|
|
81
|
+
handleRowSelect(record, !isSelected);
|
|
82
|
+
} else if (selectionType === 'radio') {
|
|
83
|
+
var _rowSelection$getRadi;
|
|
84
|
+
var radioProps = (_rowSelection$getRadi = rowSelection.getRadioProps) === null || _rowSelection$getRadi === void 0 ? void 0 : _rowSelection$getRadi.call(rowSelection, record);
|
|
85
|
+
if (radioProps !== null && radioProps !== void 0 && radioProps.disabled) return;
|
|
86
|
+
|
|
87
|
+
// 单选:直接选中
|
|
88
|
+
handleRowSelect(record, true);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
if (selectionType === 'checkbox') {
|
|
92
|
+
// 多选逻辑
|
|
93
|
+
var showSelectAll = rowSelection.selectAll !== false; // 默认为 true
|
|
94
|
+
|
|
95
|
+
// 获取所有可选择的行的 key
|
|
96
|
+
var getSelectableRowKeys = function getSelectableRowKeys() {
|
|
97
|
+
return dataSource.filter(function (record) {
|
|
98
|
+
var _rowSelection$getChec2;
|
|
99
|
+
var checkboxProps = (_rowSelection$getChec2 = rowSelection.getCheckboxProps) === null || _rowSelection$getChec2 === void 0 ? void 0 : _rowSelection$getChec2.call(rowSelection, record);
|
|
100
|
+
return !(checkboxProps !== null && checkboxProps !== void 0 && checkboxProps.disabled);
|
|
101
|
+
}).map(function (record) {
|
|
102
|
+
return record.key;
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// 判断是否全选
|
|
107
|
+
var isAllSelected = function isAllSelected() {
|
|
108
|
+
var selectableKeys = getSelectableRowKeys();
|
|
109
|
+
return selectableKeys.length > 0 && selectableKeys.every(function (key) {
|
|
110
|
+
return selectedRowKeys.includes(key);
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// 判断是否部分选中
|
|
115
|
+
var isIndeterminate = function isIndeterminate() {
|
|
116
|
+
var selectableKeys = getSelectableRowKeys();
|
|
117
|
+
var selectedCount = selectableKeys.filter(function (key) {
|
|
118
|
+
return selectedRowKeys.includes(key);
|
|
119
|
+
}).length;
|
|
120
|
+
return selectedCount > 0 && selectedCount < selectableKeys.length;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// 全选/取消全选处理
|
|
124
|
+
var handleSelectAll = function handleSelectAll(checked) {
|
|
125
|
+
if (!(rowSelection !== null && rowSelection !== void 0 && rowSelection.onChange)) return;
|
|
126
|
+
var selectableKeys = getSelectableRowKeys();
|
|
127
|
+
var selectableRecords = dataSource.filter(function (record) {
|
|
128
|
+
var _rowSelection$getChec3;
|
|
129
|
+
var checkboxProps = (_rowSelection$getChec3 = rowSelection.getCheckboxProps) === null || _rowSelection$getChec3 === void 0 ? void 0 : _rowSelection$getChec3.call(rowSelection, record);
|
|
130
|
+
return !(checkboxProps !== null && checkboxProps !== void 0 && checkboxProps.disabled);
|
|
131
|
+
});
|
|
132
|
+
var newSelectedRowKeys;
|
|
133
|
+
if (checked) {
|
|
134
|
+
// 全选:添加所有可选择的 key
|
|
135
|
+
newSelectedRowKeys = _toConsumableArray(new Set([].concat(_toConsumableArray(selectedRowKeys), _toConsumableArray(selectableKeys))));
|
|
136
|
+
} else {
|
|
137
|
+
// 取消全选:移除所有可选择的 key
|
|
138
|
+
newSelectedRowKeys = selectedRowKeys.filter(function (key) {
|
|
139
|
+
return !selectableKeys.includes(key);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
rowSelection.onChange(newSelectedRowKeys, {
|
|
143
|
+
selectedRows: selectableRecords
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
// 添加多选列到 columns 开头
|
|
148
|
+
processedColumns.unshift({
|
|
149
|
+
title: showSelectAll ? /*#__PURE__*/React.createElement(Checkbox, {
|
|
150
|
+
"data-odn-table-selection-checkbox-all": true,
|
|
151
|
+
"data-odn-table-selection-checkbox": true,
|
|
152
|
+
checked: isAllSelected(),
|
|
153
|
+
indeterminate: isIndeterminate(),
|
|
154
|
+
onChange: function onChange(checked) {
|
|
155
|
+
return handleSelectAll(checked);
|
|
156
|
+
}
|
|
157
|
+
}) : '',
|
|
158
|
+
key: 'selection',
|
|
159
|
+
width: rowSelection.width || 40,
|
|
160
|
+
align: rowSelection.align,
|
|
161
|
+
render: function render(value, record, rowIndex) {
|
|
162
|
+
var _rowSelection$getChec4;
|
|
163
|
+
var recordKey = record.key;
|
|
164
|
+
var isSelected = selectedRowKeys.includes(recordKey);
|
|
165
|
+
var checkboxProps = (_rowSelection$getChec4 = rowSelection.getCheckboxProps) === null || _rowSelection$getChec4 === void 0 ? void 0 : _rowSelection$getChec4.call(rowSelection, record);
|
|
166
|
+
var _ref2 = checkboxProps || {},
|
|
167
|
+
popover = _ref2.popover,
|
|
168
|
+
popoverProps = _ref2.popoverProps,
|
|
169
|
+
restCheckboxProps = _objectWithoutProperties(_ref2, _excluded);
|
|
170
|
+
var checkbox = /*#__PURE__*/React.createElement(Checkbox, _extends({
|
|
171
|
+
"data-odn-table-selection-checkbox": true,
|
|
172
|
+
checked: isSelected,
|
|
173
|
+
onChange: function onChange(checked) {
|
|
174
|
+
return handleRowSelect === null || handleRowSelect === void 0 ? void 0 : handleRowSelect(record, checked);
|
|
175
|
+
}
|
|
176
|
+
}, restCheckboxProps));
|
|
177
|
+
var defaultNode = popover ? /*#__PURE__*/React.createElement(Popover, _extends({
|
|
178
|
+
popup: popover,
|
|
179
|
+
placement: "left"
|
|
180
|
+
}, popoverProps), checkbox) : checkbox;
|
|
181
|
+
|
|
182
|
+
// 如果提供了自定义 render 函数,使用它
|
|
183
|
+
if (rowSelection.render) {
|
|
184
|
+
return rowSelection.render({
|
|
185
|
+
row: record,
|
|
186
|
+
rowIndex: rowIndex,
|
|
187
|
+
node: defaultNode
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
return defaultNode;
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
} else if (selectionType === 'radio') {
|
|
194
|
+
// 单选逻辑
|
|
195
|
+
var handleRadioChange = function handleRadioChange(value) {
|
|
196
|
+
var selectedRecord = dataSource.find(function (item) {
|
|
197
|
+
return item.key === value;
|
|
198
|
+
});
|
|
199
|
+
if (selectedRecord) {
|
|
200
|
+
handleRowSelect(selectedRecord, true);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
// 为每行创建单选选项
|
|
205
|
+
var radioOptions = dataSource.map(function (record) {
|
|
206
|
+
var _rowSelection$getRadi2;
|
|
207
|
+
var recordKey = record.key;
|
|
208
|
+
var radioProps = (_rowSelection$getRadi2 = rowSelection.getRadioProps) === null || _rowSelection$getRadi2 === void 0 ? void 0 : _rowSelection$getRadi2.call(rowSelection, record);
|
|
209
|
+
return {
|
|
210
|
+
label: '',
|
|
211
|
+
// 空标签,因为表格行本身就是标签
|
|
212
|
+
value: recordKey,
|
|
213
|
+
disabled: (radioProps === null || radioProps === void 0 ? void 0 : radioProps.disabled) || false
|
|
214
|
+
};
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
// 添加单选列到 columns 开头
|
|
218
|
+
processedColumns.unshift({
|
|
219
|
+
title: '',
|
|
220
|
+
key: 'selection',
|
|
221
|
+
width: rowSelection.width || 40,
|
|
222
|
+
align: rowSelection.align,
|
|
223
|
+
render: function render(value, record, rowIndex) {
|
|
224
|
+
var _rowSelection$getRadi3;
|
|
225
|
+
var radioProps = (_rowSelection$getRadi3 = rowSelection.getRadioProps) === null || _rowSelection$getRadi3 === void 0 ? void 0 : _rowSelection$getRadi3.call(rowSelection, record);
|
|
226
|
+
var _ref3 = radioProps || {},
|
|
227
|
+
popover = _ref3.popover,
|
|
228
|
+
popoverProps = _ref3.popoverProps,
|
|
229
|
+
restRadioProps = _objectWithoutProperties(_ref3, _excluded2);
|
|
230
|
+
var radio = /*#__PURE__*/React.createElement("div", {
|
|
231
|
+
"data-odn-table-selection-radio": true
|
|
232
|
+
}, /*#__PURE__*/React.createElement(Radio.Group, {
|
|
233
|
+
value: selectedRowKeys[0] || '',
|
|
234
|
+
onChange: handleRadioChange,
|
|
235
|
+
options: [_objectSpread(_objectSpread({}, radioOptions[rowIndex]), restRadioProps)]
|
|
236
|
+
}));
|
|
237
|
+
var defaultNode = popover ? /*#__PURE__*/React.createElement(Popover, _extends({
|
|
238
|
+
popup: popover,
|
|
239
|
+
placement: "left"
|
|
240
|
+
}, popoverProps), radio) : radio;
|
|
241
|
+
|
|
242
|
+
// 如果提供了自定义 render 函数,使用它
|
|
243
|
+
if (rowSelection.render) {
|
|
244
|
+
return rowSelection.render({
|
|
245
|
+
row: record,
|
|
246
|
+
rowIndex: rowIndex,
|
|
247
|
+
node: defaultNode
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
return defaultNode;
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return {
|
|
256
|
+
columns: processedColumns,
|
|
257
|
+
onRowClick: rowSelection !== null && rowSelection !== void 0 && rowSelection.selectOnRowClick ? onRowClick : undefined
|
|
258
|
+
};
|
|
259
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style';
|
|
3
|
+
export declare const MOTION_CONFIG: {
|
|
4
|
+
readonly visualDuration: 0.15;
|
|
5
|
+
readonly bounce: 0;
|
|
6
|
+
};
|
|
7
|
+
export type TabItemValue = string | number;
|
|
8
|
+
export interface TabItem<T extends TabItemValue = TabItemValue> {
|
|
9
|
+
value: T;
|
|
10
|
+
label: React.ReactNode | ((item: TabItem<T>, index: number, active: boolean) => React.ReactNode);
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface TabsBaseProps<T extends TabItemValue = TabItemValue> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onAnimationStart' | 'onDrag' | 'onDragEnd' | 'onDragStart' | 'onDragEndCapture' | 'onDragCapture'> {
|
|
14
|
+
gap?: number;
|
|
15
|
+
items?: TabItem<T>[];
|
|
16
|
+
value?: T;
|
|
17
|
+
onChange?: (e: React.MouseEvent<HTMLDivElement>, value: T) => void;
|
|
18
|
+
itemClassName?: string | ((item: TabItem<T>, index: number) => string);
|
|
19
|
+
itemStyle?: React.CSSProperties | ((item: TabItem<T>, index: number) => React.CSSProperties);
|
|
20
|
+
activeItemClassName?: string | ((item: TabItem<T>, index: number) => string);
|
|
21
|
+
activeItemStyle?: React.CSSProperties | ((item: TabItem<T>, index: number) => React.CSSProperties);
|
|
22
|
+
}
|
|
23
|
+
export interface TabsVerticalProps<T extends TabItemValue = TabItemValue> extends TabsBaseProps<T> {
|
|
24
|
+
indicatorWrapperClassName?: string;
|
|
25
|
+
indicatorWrapperStyle?: React.CSSProperties;
|
|
26
|
+
indicatorClassName?: string;
|
|
27
|
+
indicatorStyle?: React.CSSProperties;
|
|
28
|
+
}
|
|
29
|
+
export interface TabsDividerProps<T extends TabItemValue = TabItemValue> extends TabsBaseProps<T> {
|
|
30
|
+
dividerClassName?: string;
|
|
31
|
+
dividerStyle?: React.CSSProperties;
|
|
32
|
+
}
|
|
33
|
+
export interface TabsButtonGroupProps<T extends TabItemValue = TabItemValue> extends TabsBaseProps<T> {
|
|
34
|
+
indicatorClassName?: string;
|
|
35
|
+
indicatorStyle?: React.CSSProperties;
|
|
36
|
+
}
|
|
37
|
+
export interface TabsTabsProps<T extends TabItemValue = TabItemValue> extends TabsBaseProps<T> {
|
|
38
|
+
indicatorClassName?: string;
|
|
39
|
+
indicatorStyle?: React.CSSProperties;
|
|
40
|
+
}
|
|
41
|
+
export interface TabsTagProps<T extends TabItemValue = TabItemValue> extends TabsBaseProps<T> {
|
|
42
|
+
}
|
|
43
|
+
declare const Tabs: {
|
|
44
|
+
(): React.JSX.Element;
|
|
45
|
+
Default: <T extends TabItemValue>({ gap, items, value, onChange, itemClassName, itemStyle, activeItemClassName, activeItemStyle, indicatorClassName, indicatorStyle, style, ...props }: TabsTabsProps<T>) => React.JSX.Element;
|
|
46
|
+
ButtonGroup: <T_1 extends TabItemValue>({ gap, items, value, onChange, itemClassName, itemStyle, activeItemClassName, activeItemStyle, indicatorClassName, indicatorStyle, style, ...props }: TabsButtonGroupProps<T_1>) => React.JSX.Element;
|
|
47
|
+
Vertical: <T_2 extends TabItemValue>({ gap, items, value, onChange, itemClassName, itemStyle, activeItemClassName, activeItemStyle, indicatorWrapperClassName, indicatorWrapperStyle, indicatorClassName, indicatorStyle, ...props }: TabsVerticalProps<T_2>) => React.JSX.Element;
|
|
48
|
+
Divider: <T_3 extends TabItemValue>({ gap, items, value, onChange, itemClassName, itemStyle, activeItemClassName, activeItemStyle, dividerClassName, dividerStyle, style, className, ...props }: TabsDividerProps<T_3>) => React.JSX.Element;
|
|
49
|
+
Tag: <T_4 extends TabItemValue>({ gap, items, value, onChange, itemClassName, itemStyle, activeItemClassName, activeItemStyle, style, ...props }: TabsTagProps<T_4>) => React.JSX.Element;
|
|
50
|
+
};
|
|
51
|
+
export default Tabs;
|