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,56 @@
|
|
|
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
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
var TAB_KEY_CODE = 9;
|
|
9
|
+
export var FocusManager = /*#__PURE__*/function () {
|
|
10
|
+
function FocusManager(container, className) {
|
|
11
|
+
var _this = this;
|
|
12
|
+
_classCallCheck(this, FocusManager);
|
|
13
|
+
_defineProperty(this, "container", void 0);
|
|
14
|
+
_defineProperty(this, "className", void 0);
|
|
15
|
+
_defineProperty(this, "isRunning", false);
|
|
16
|
+
_defineProperty(this, "handleKeyDown", function (e) {
|
|
17
|
+
if ('which' in e && e.which === TAB_KEY_CODE) {
|
|
18
|
+
_this.reset();
|
|
19
|
+
_this.container.addEventListener('mousedown', _this.handleMouseDown);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
_defineProperty(this, "handleMouseDown", function () {
|
|
23
|
+
_this.reset();
|
|
24
|
+
_this.container.classList.add(_this.className);
|
|
25
|
+
_this.container.addEventListener('keydown', _this.handleKeyDown);
|
|
26
|
+
});
|
|
27
|
+
this.container = container;
|
|
28
|
+
this.className = className;
|
|
29
|
+
}
|
|
30
|
+
_createClass(FocusManager, [{
|
|
31
|
+
key: "isActive",
|
|
32
|
+
value: function isActive() {
|
|
33
|
+
return this.isRunning;
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
key: "start",
|
|
37
|
+
value: function start() {
|
|
38
|
+
this.container.addEventListener('mousedown', this.handleMouseDown);
|
|
39
|
+
this.isRunning = true;
|
|
40
|
+
}
|
|
41
|
+
}, {
|
|
42
|
+
key: "stop",
|
|
43
|
+
value: function stop() {
|
|
44
|
+
this.reset();
|
|
45
|
+
this.isRunning = false;
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
key: "reset",
|
|
49
|
+
value: function reset() {
|
|
50
|
+
this.container.classList.remove(this.className);
|
|
51
|
+
this.container.removeEventListener('keydown', this.handleKeyDown);
|
|
52
|
+
this.container.removeEventListener('mousedown', this.handleMouseDown);
|
|
53
|
+
}
|
|
54
|
+
}]);
|
|
55
|
+
return FocusManager;
|
|
56
|
+
}();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* floating-ui 依赖 window.queueMicrotask,在低版本浏览器中不支持,需要 polyfill
|
|
3
|
+
* 使用 Promise fallback,如果 Promise 也不支持,则使用 setTimeout 覆盖 window.queueMicrotask
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export var queueMicrotaskPolyfill = function queueMicrotaskPolyfill() {
|
|
7
|
+
if (typeof window.queueMicrotask === 'function') {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (typeof Promise === 'function') {
|
|
11
|
+
window.queueMicrotask = function (fn) {
|
|
12
|
+
Promise.resolve().then(fn);
|
|
13
|
+
};
|
|
14
|
+
} else {
|
|
15
|
+
window.queueMicrotask = function (fn) {
|
|
16
|
+
setTimeout(fn, 0);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 时间相关的通用工具方法
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* 验证时间字符串格式是否合法
|
|
6
|
+
* @param timeStr 时间字符串,支持 HH:MM 或 HH:MM:SS 格式
|
|
7
|
+
* @param picker 选择器类型,'hour' 表示只允许小时选择(分钟必须为00)
|
|
8
|
+
* @returns 是否合法
|
|
9
|
+
*/
|
|
10
|
+
export declare const isLegalTimeString: (timeStr: string, picker?: 'hour' | 'minute' | 'second') => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 判断时间1是否在时间2之后
|
|
13
|
+
* @param time1 时间1
|
|
14
|
+
* @param time2 时间2
|
|
15
|
+
* @returns 是否在之后
|
|
16
|
+
*/
|
|
17
|
+
export declare const isTimeAfter: (time1: string, time2: string) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 判断时间1是否在时间2之前
|
|
20
|
+
* @param time1 时间1
|
|
21
|
+
* @param time2 时间2
|
|
22
|
+
* @returns 是否在之前
|
|
23
|
+
*/
|
|
24
|
+
export declare const isTimeBefore: (time1: string, time2: string) => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 判断两个时间是否相等
|
|
27
|
+
* @param time1 时间1
|
|
28
|
+
* @param time2 时间2
|
|
29
|
+
* @returns 是否相等
|
|
30
|
+
*/
|
|
31
|
+
export declare const isTimeEqual: (time1: string, time2: string) => boolean;
|
|
32
|
+
/**
|
|
33
|
+
* 将时间字符串转换为总秒数
|
|
34
|
+
* @param timeStr 时间字符串
|
|
35
|
+
* @returns 总秒数
|
|
36
|
+
*/
|
|
37
|
+
export declare const timeToSeconds: (timeStr: string) => number;
|
|
38
|
+
/**
|
|
39
|
+
* 将总秒数转换为时间字符串
|
|
40
|
+
* @param totalSeconds 总秒数
|
|
41
|
+
* @param includeSeconds 是否包含秒数
|
|
42
|
+
* @returns 时间字符串
|
|
43
|
+
*/
|
|
44
|
+
export declare const secondsToTime: (totalSeconds: number, includeSeconds?: boolean) => string;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
/**
|
|
8
|
+
* 时间相关的通用工具方法
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 验证时间字符串格式是否合法
|
|
13
|
+
* @param timeStr 时间字符串,支持 HH:MM 或 HH:MM:SS 格式
|
|
14
|
+
* @param picker 选择器类型,'hour' 表示只允许小时选择(分钟必须为00)
|
|
15
|
+
* @returns 是否合法
|
|
16
|
+
*/
|
|
17
|
+
export var isLegalTimeString = function isLegalTimeString(timeStr, picker) {
|
|
18
|
+
if (timeStr.trim() === '') {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 验证时间格式 HH:MM 或 HH:MM:SS
|
|
23
|
+
var timeRegex = /^([0-1]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$/;
|
|
24
|
+
if (!timeRegex.test(timeStr)) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
var _timeStr$split$map = timeStr.split(':').map(Number),
|
|
28
|
+
_timeStr$split$map2 = _slicedToArray(_timeStr$split$map, 3),
|
|
29
|
+
hours = _timeStr$split$map2[0],
|
|
30
|
+
minutes = _timeStr$split$map2[1],
|
|
31
|
+
seconds = _timeStr$split$map2[2];
|
|
32
|
+
|
|
33
|
+
// 基础验证
|
|
34
|
+
if (hours < 0 || hours > 23 || minutes < 0 || minutes > 59) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// 秒数验证(如果存在)
|
|
39
|
+
if (seconds !== undefined && (seconds < 0 || seconds > 59)) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// picker 特定验证
|
|
44
|
+
if (picker === 'hour') {
|
|
45
|
+
// 小时模式下,分钟必须为 00
|
|
46
|
+
return minutes === 0;
|
|
47
|
+
}
|
|
48
|
+
if (picker === 'second') {
|
|
49
|
+
// 秒模式下,必须包含秒数部分
|
|
50
|
+
return seconds !== undefined;
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 判断时间1是否在时间2之后
|
|
57
|
+
* @param time1 时间1
|
|
58
|
+
* @param time2 时间2
|
|
59
|
+
* @returns 是否在之后
|
|
60
|
+
*/
|
|
61
|
+
export var isTimeAfter = function isTimeAfter(time1, time2) {
|
|
62
|
+
var _time1$split$map = time1.split(':').map(Number),
|
|
63
|
+
_time1$split$map2 = _slicedToArray(_time1$split$map, 3),
|
|
64
|
+
hours1 = _time1$split$map2[0],
|
|
65
|
+
minutes1 = _time1$split$map2[1],
|
|
66
|
+
seconds1 = _time1$split$map2[2];
|
|
67
|
+
var _time2$split$map = time2.split(':').map(Number),
|
|
68
|
+
_time2$split$map2 = _slicedToArray(_time2$split$map, 3),
|
|
69
|
+
hours2 = _time2$split$map2[0],
|
|
70
|
+
minutes2 = _time2$split$map2[1],
|
|
71
|
+
seconds2 = _time2$split$map2[2];
|
|
72
|
+
var totalSeconds1 = hours1 * 3600 + minutes1 * 60 + (seconds1 || 0);
|
|
73
|
+
var totalSeconds2 = hours2 * 3600 + minutes2 * 60 + (seconds2 || 0);
|
|
74
|
+
return totalSeconds1 > totalSeconds2;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* 判断时间1是否在时间2之前
|
|
79
|
+
* @param time1 时间1
|
|
80
|
+
* @param time2 时间2
|
|
81
|
+
* @returns 是否在之前
|
|
82
|
+
*/
|
|
83
|
+
export var isTimeBefore = function isTimeBefore(time1, time2) {
|
|
84
|
+
var _time1$split$map3 = time1.split(':').map(Number),
|
|
85
|
+
_time1$split$map4 = _slicedToArray(_time1$split$map3, 3),
|
|
86
|
+
hours1 = _time1$split$map4[0],
|
|
87
|
+
minutes1 = _time1$split$map4[1],
|
|
88
|
+
seconds1 = _time1$split$map4[2];
|
|
89
|
+
var _time2$split$map3 = time2.split(':').map(Number),
|
|
90
|
+
_time2$split$map4 = _slicedToArray(_time2$split$map3, 3),
|
|
91
|
+
hours2 = _time2$split$map4[0],
|
|
92
|
+
minutes2 = _time2$split$map4[1],
|
|
93
|
+
seconds2 = _time2$split$map4[2];
|
|
94
|
+
var totalSeconds1 = hours1 * 3600 + minutes1 * 60 + (seconds1 || 0);
|
|
95
|
+
var totalSeconds2 = hours2 * 3600 + minutes2 * 60 + (seconds2 || 0);
|
|
96
|
+
return totalSeconds1 < totalSeconds2;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* 判断两个时间是否相等
|
|
101
|
+
* @param time1 时间1
|
|
102
|
+
* @param time2 时间2
|
|
103
|
+
* @returns 是否相等
|
|
104
|
+
*/
|
|
105
|
+
export var isTimeEqual = function isTimeEqual(time1, time2) {
|
|
106
|
+
var _time1$split$map5 = time1.split(':').map(Number),
|
|
107
|
+
_time1$split$map6 = _slicedToArray(_time1$split$map5, 3),
|
|
108
|
+
hours1 = _time1$split$map6[0],
|
|
109
|
+
minutes1 = _time1$split$map6[1],
|
|
110
|
+
seconds1 = _time1$split$map6[2];
|
|
111
|
+
var _time2$split$map5 = time2.split(':').map(Number),
|
|
112
|
+
_time2$split$map6 = _slicedToArray(_time2$split$map5, 3),
|
|
113
|
+
hours2 = _time2$split$map6[0],
|
|
114
|
+
minutes2 = _time2$split$map6[1],
|
|
115
|
+
seconds2 = _time2$split$map6[2];
|
|
116
|
+
var totalSeconds1 = hours1 * 3600 + minutes1 * 60 + (seconds1 || 0);
|
|
117
|
+
var totalSeconds2 = hours2 * 3600 + minutes2 * 60 + (seconds2 || 0);
|
|
118
|
+
return totalSeconds1 === totalSeconds2;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* 将时间字符串转换为总秒数
|
|
123
|
+
* @param timeStr 时间字符串
|
|
124
|
+
* @returns 总秒数
|
|
125
|
+
*/
|
|
126
|
+
export var timeToSeconds = function timeToSeconds(timeStr) {
|
|
127
|
+
var _timeStr$split$map3 = timeStr.split(':').map(Number),
|
|
128
|
+
_timeStr$split$map4 = _slicedToArray(_timeStr$split$map3, 3),
|
|
129
|
+
hours = _timeStr$split$map4[0],
|
|
130
|
+
minutes = _timeStr$split$map4[1],
|
|
131
|
+
seconds = _timeStr$split$map4[2];
|
|
132
|
+
return hours * 3600 + minutes * 60 + (seconds || 0);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* 将总秒数转换为时间字符串
|
|
137
|
+
* @param totalSeconds 总秒数
|
|
138
|
+
* @param includeSeconds 是否包含秒数
|
|
139
|
+
* @returns 时间字符串
|
|
140
|
+
*/
|
|
141
|
+
export var secondsToTime = function secondsToTime(totalSeconds) {
|
|
142
|
+
var includeSeconds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
143
|
+
var hours = Math.floor(totalSeconds / 3600);
|
|
144
|
+
var minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
145
|
+
var seconds = totalSeconds % 60;
|
|
146
|
+
if (includeSeconds) {
|
|
147
|
+
return "".concat(hours.toString().padStart(2, '0'), ":").concat(minutes.toString().padStart(2, '0'), ":").concat(seconds.toString().padStart(2, '0'));
|
|
148
|
+
}
|
|
149
|
+
return "".concat(hours.toString().padStart(2, '0'), ":").concat(minutes.toString().padStart(2, '0'));
|
|
150
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useRef } from "react";
|
|
2
|
+
export function useActive(_ref) {
|
|
3
|
+
var ref = _ref.ref,
|
|
4
|
+
_ref$delay = _ref.delay,
|
|
5
|
+
delay = _ref$delay === void 0 ? 200 : _ref$delay;
|
|
6
|
+
var activeTimeOutRef = useRef(0);
|
|
7
|
+
var handleWindowMouseUp = function handleWindowMouseUp() {
|
|
8
|
+
window.clearTimeout(activeTimeOutRef.current);
|
|
9
|
+
window.removeEventListener("mouseup", handleWindowMouseUp);
|
|
10
|
+
};
|
|
11
|
+
var handleMouseDown = function handleMouseDown() {
|
|
12
|
+
window.addEventListener("mouseup", handleWindowMouseUp);
|
|
13
|
+
if (ref && "current" in ref && ref.current) {
|
|
14
|
+
delete ref.current.dataset.actived;
|
|
15
|
+
}
|
|
16
|
+
activeTimeOutRef.current = window.setTimeout(function () {
|
|
17
|
+
if (ref && "current" in ref && ref.current) {
|
|
18
|
+
ref.current.dataset.actived = "true";
|
|
19
|
+
}
|
|
20
|
+
}, delay);
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
handleMouseDown: handleMouseDown
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style';
|
|
3
|
+
export interface AlertProps extends Omit<React.ComponentProps<'div'>, 'title'> {
|
|
4
|
+
/**
|
|
5
|
+
* @description 尺寸
|
|
6
|
+
* @default "medium"
|
|
7
|
+
*/
|
|
8
|
+
size?: 'small' | 'medium' | 'large';
|
|
9
|
+
/**
|
|
10
|
+
* @description 类型
|
|
11
|
+
* @default "info"
|
|
12
|
+
*/
|
|
13
|
+
intent?: 'info' | 'danger' | 'success' | 'warning';
|
|
14
|
+
/**
|
|
15
|
+
* @description 标题
|
|
16
|
+
*/
|
|
17
|
+
title?: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* @description 内容
|
|
20
|
+
*/
|
|
21
|
+
message?: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* @description 是否可关闭
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
closable?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @description 关闭回调
|
|
29
|
+
*/
|
|
30
|
+
onClose?: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* @description 关闭后回调
|
|
33
|
+
*/
|
|
34
|
+
afterClose?: () => void;
|
|
35
|
+
/**
|
|
36
|
+
* @description 是否可展开。当有 title 时,展开和关闭 icon 支持同时显示;否则展开会替代关闭 icon
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
expandable?: boolean | null;
|
|
40
|
+
/**
|
|
41
|
+
* @description 默认是否展开,内部驱动
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
defaultExpanded?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* @description 是否展开,外部控制
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
expanded?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* @description 展开状态变化回调
|
|
52
|
+
*/
|
|
53
|
+
onExpandChange?: (expanded: boolean) => void;
|
|
54
|
+
/**
|
|
55
|
+
* @description 展开内容
|
|
56
|
+
*/
|
|
57
|
+
expandContent?: React.ReactNode;
|
|
58
|
+
}
|
|
59
|
+
export interface AlertRef extends HTMLDivElement {
|
|
60
|
+
close: () => void;
|
|
61
|
+
}
|
|
62
|
+
declare const Alert: React.ForwardRefExoticComponent<Omit<AlertProps, "ref"> & React.RefAttributes<AlertRef>>;
|
|
63
|
+
export default Alert;
|
|
@@ -0,0 +1,137 @@
|
|
|
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 = ["size", "intent", "title", "message", "closable", "onClose", "afterClose", "expandable", "defaultExpanded", "expanded", "onExpandChange", "expandContent"];
|
|
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 _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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
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; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
15
|
+
import React, { useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
16
|
+
import Icon from "../icon";
|
|
17
|
+
import "./style";
|
|
18
|
+
var iconMap = {
|
|
19
|
+
info: 'info-circle-filled',
|
|
20
|
+
danger: 'cancel-circle-filled',
|
|
21
|
+
warning: 'alert-circle-filled',
|
|
22
|
+
success: 'check-circle-filled'
|
|
23
|
+
};
|
|
24
|
+
var Alert = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
25
|
+
var _ref$size = _ref.size,
|
|
26
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
27
|
+
_ref$intent = _ref.intent,
|
|
28
|
+
intent = _ref$intent === void 0 ? 'info' : _ref$intent,
|
|
29
|
+
title = _ref.title,
|
|
30
|
+
message = _ref.message,
|
|
31
|
+
_ref$closable = _ref.closable,
|
|
32
|
+
closable = _ref$closable === void 0 ? false : _ref$closable,
|
|
33
|
+
onClose = _ref.onClose,
|
|
34
|
+
afterClose = _ref.afterClose,
|
|
35
|
+
expandable = _ref.expandable,
|
|
36
|
+
_ref$defaultExpanded = _ref.defaultExpanded,
|
|
37
|
+
defaultExpanded = _ref$defaultExpanded === void 0 ? false : _ref$defaultExpanded,
|
|
38
|
+
_ref$expanded = _ref.expanded,
|
|
39
|
+
expandedProp = _ref$expanded === void 0 ? null : _ref$expanded,
|
|
40
|
+
onExpandChange = _ref.onExpandChange,
|
|
41
|
+
expandContent = _ref.expandContent,
|
|
42
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
+
var innerRef = useRef(null);
|
|
44
|
+
var _useState = useState(false),
|
|
45
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
46
|
+
closed = _useState2[0],
|
|
47
|
+
setClosed = _useState2[1];
|
|
48
|
+
var expandContentRef = useRef(null);
|
|
49
|
+
var expandContentInnerRef = useRef(null);
|
|
50
|
+
var _useState3 = useState(expandedProp !== null && expandedProp !== undefined ? expandedProp : defaultExpanded),
|
|
51
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
52
|
+
expanded = _useState4[0],
|
|
53
|
+
setExpanded = _useState4[1];
|
|
54
|
+
var handleClose = function handleClose() {
|
|
55
|
+
if (onClose) {
|
|
56
|
+
onClose();
|
|
57
|
+
}
|
|
58
|
+
if (innerRef.current) {
|
|
59
|
+
innerRef.current.style.height = "".concat(innerRef.current.offsetHeight, "px");
|
|
60
|
+
setTimeout(function () {
|
|
61
|
+
['marginTop', 'marginBottom', 'paddingTop', 'paddingBottom', 'height', 'opacity'].forEach(function (key) {
|
|
62
|
+
if (innerRef.current) {
|
|
63
|
+
Object.assign(innerRef.current.style, _defineProperty({}, key, '0'));
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
setTimeout(function () {
|
|
67
|
+
setClosed(true);
|
|
68
|
+
if (afterClose) {
|
|
69
|
+
afterClose();
|
|
70
|
+
}
|
|
71
|
+
}, 300);
|
|
72
|
+
}, 0);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
useEffect(function () {
|
|
76
|
+
if (expandedProp !== null && expandedProp !== undefined) {
|
|
77
|
+
setExpanded(expandedProp);
|
|
78
|
+
}
|
|
79
|
+
}, [expandedProp]);
|
|
80
|
+
useImperativeHandle(ref, function () {
|
|
81
|
+
if (innerRef.current) {
|
|
82
|
+
Object.assign(innerRef.current, {
|
|
83
|
+
close: handleClose
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return innerRef.current;
|
|
87
|
+
});
|
|
88
|
+
if (closed) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
92
|
+
"data-odn-alert": true,
|
|
93
|
+
"data-odn-alert-size": size,
|
|
94
|
+
"data-odn-alert-intent": intent,
|
|
95
|
+
ref: innerRef
|
|
96
|
+
}, props), /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
"data-odn-alert-icon-wrapper": true
|
|
98
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
"data-odn-alert-icon-placeholder": true
|
|
100
|
+
}, "."), /*#__PURE__*/React.createElement(Icon, {
|
|
101
|
+
"data-odn-alert-icon": true,
|
|
102
|
+
name: iconMap[intent]
|
|
103
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
104
|
+
"data-odn-alert-content": true
|
|
105
|
+
}, title && /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
"data-odn-alert-title": true
|
|
107
|
+
}, title), message && /*#__PURE__*/React.createElement("div", {
|
|
108
|
+
"data-odn-alert-message": true
|
|
109
|
+
}, message), expandable && /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
"data-odn-alert-expand-content": true,
|
|
111
|
+
ref: expandContentRef
|
|
112
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
113
|
+
"data-odn-alert-expand-content-inner": true,
|
|
114
|
+
ref: expandContentInnerRef
|
|
115
|
+
}, expanded ? expandContent : null))), (closable || expandable) && /*#__PURE__*/React.createElement("div", {
|
|
116
|
+
"data-odn-alert-right": true
|
|
117
|
+
}, closable && /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
"data-odn-alert-close-icon-wrapper": true,
|
|
119
|
+
onClick: handleClose
|
|
120
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
121
|
+
"data-odn-alert-icon-placeholder": true
|
|
122
|
+
}, "."), /*#__PURE__*/React.createElement(Icon, {
|
|
123
|
+
"data-odn-alert-close-icon": true,
|
|
124
|
+
name: "cancel"
|
|
125
|
+
})), expandable && /*#__PURE__*/React.createElement("div", {
|
|
126
|
+
"data-odn-alert-expand-button": true,
|
|
127
|
+
onClick: function onClick() {
|
|
128
|
+
if (expandedProp === null || expandedProp === undefined) {
|
|
129
|
+
setExpanded(!expanded);
|
|
130
|
+
}
|
|
131
|
+
if (onExpandChange) {
|
|
132
|
+
onExpandChange(!expanded);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}, expanded ? '收起' : '展开')));
|
|
136
|
+
});
|
|
137
|
+
export default Alert;
|