one-design-next 0.0.4-alpha.100
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 +134 -0
- package/dist/_util/canUseDom.d.ts +1 -0
- package/dist/_util/canUseDom.js +3 -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 +657 -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/_util/useControlledState.d.ts +8 -0
- package/dist/_util/useControlledState.js +30 -0
- package/dist/_util/useLayoutEffect.d.ts +4 -0
- package/dist/_util/useLayoutEffect.js +30 -0
- package/dist/alert/index.d.ts +63 -0
- package/dist/alert/index.js +137 -0
- package/dist/alert/style/index.css +184 -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 +64 -0
- package/dist/auto-complete/index.js +149 -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 +74 -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 +338 -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 +5 -0
- package/dist/calendar/style/index.d.ts +2 -0
- package/dist/calendar/style/index.js +2 -0
- package/dist/card/header.d.ts +26 -0
- package/dist/card/header.js +37 -0
- package/dist/card/index.d.ts +24 -0
- package/dist/card/index.js +31 -0
- package/dist/card/style/index.css +141 -0
- package/dist/card/style/index.d.ts +1 -0
- package/dist/card/style/index.js +1 -0
- package/dist/cascader/CascaderOptionContent.d.ts +20 -0
- package/dist/cascader/CascaderOptionContent.js +85 -0
- package/dist/cascader/Panel.d.ts +53 -0
- package/dist/cascader/Panel.js +131 -0
- package/dist/cascader/index.d.ts +59 -0
- package/dist/cascader/index.js +436 -0
- package/dist/cascader/style/index.css +414 -0
- package/dist/cascader/style/index.d.ts +2 -0
- package/dist/cascader/style/index.js +2 -0
- package/dist/cascader/utils.d.ts +14 -0
- package/dist/cascader/utils.js +109 -0
- package/dist/chart/index.d.ts +14 -0
- package/dist/chart/index.js +11 -0
- package/dist/chart/style/index.css +1 -0
- package/dist/chart/style/index.d.ts +2 -0
- package/dist/chart/style/index.js +2 -0
- package/dist/checkbox/Checkbox.d.ts +77 -0
- package/dist/checkbox/Checkbox.js +178 -0
- package/dist/checkbox/Context.d.ts +35 -0
- package/dist/checkbox/Context.js +2 -0
- package/dist/checkbox/Group.d.ts +68 -0
- package/dist/checkbox/Group.js +151 -0
- package/dist/checkbox/index.d.ts +5 -0
- package/dist/checkbox/index.js +3 -0
- package/dist/checkbox/style/index.css +330 -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 +103 -0
- package/dist/collapse/style/index.css +59 -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 +135 -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 +31 -0
- package/dist/date-picker/MonthPicker.js +161 -0
- package/dist/date-picker/QuarterPicker.d.ts +36 -0
- package/dist/date-picker/QuarterPicker.js +168 -0
- package/dist/date-picker/YearPicker.d.ts +13 -0
- package/dist/date-picker/YearPicker.js +84 -0
- package/dist/date-picker/index.d.ts +240 -0
- package/dist/date-picker/index.js +1249 -0
- package/dist/date-picker/style/index.css +511 -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 +58 -0
- package/dist/date-range-picker/index.js +1043 -0
- package/dist/dialog/index.d.ts +139 -0
- package/dist/dialog/index.js +300 -0
- package/dist/dialog/style/index.css +228 -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 +92 -0
- package/dist/drawer/index.js +214 -0
- package/dist/drawer/style/index.css +244 -0
- package/dist/drawer/style/index.d.ts +2 -0
- package/dist/drawer/style/index.js +2 -0
- package/dist/dropdown/index.d.ts +91 -0
- package/dist/dropdown/index.js +846 -0
- package/dist/dropdown/style/index.css +206 -0
- package/dist/dropdown/style/index.d.ts +2 -0
- package/dist/dropdown/style/index.js +2 -0
- package/dist/ellipsis-text/index.d.ts +19 -0
- package/dist/ellipsis-text/index.js +97 -0
- package/dist/ellipsis-text/style/index.css +1 -0
- package/dist/ellipsis-text/style/index.d.ts +2 -0
- package/dist/ellipsis-text/style/index.js +2 -0
- package/dist/empty/index.d.ts +20 -0
- package/dist/empty/index.js +2398 -0
- package/dist/empty/style/index.css +80 -0
- package/dist/empty/style/index.d.ts +2 -0
- package/dist/empty/style/index.js +2 -0
- package/dist/form/index.d.ts +106 -0
- package/dist/form/index.js +272 -0
- package/dist/form/style/index.css +84 -0
- package/dist/form/style/index.d.ts +2 -0
- package/dist/form/style/index.js +2 -0
- package/dist/hover-fill/index.d.ts +50 -0
- package/dist/hover-fill/index.js +258 -0
- package/dist/hover-fill/style/index.css +35 -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 +102 -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/card-distribute.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/chart.svg +3 -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/flame.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-add.svg +3 -0
- package/dist/icon/svg/product/user-circle.svg +1 -0
- package/dist/icon/svg/product/user-edit.svg +1 -0
- package/dist/icon/svg/product/user-pack.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 +479 -0
- package/dist/icon/svg-data.js +481 -0
- package/dist/icon/test-icons.html +122 -0
- package/dist/icon/types.d.ts +3 -0
- package/dist/icon/types.js +5 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +57 -0
- package/dist/input/index.d.ts +82 -0
- package/dist/input/index.js +451 -0
- package/dist/input/style/index.css +244 -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 +41 -0
- package/dist/input-number/index.js +431 -0
- package/dist/input-number/style/index.css +65 -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 +110 -0
- package/dist/input-otp/style/index.d.ts +2 -0
- package/dist/input-otp/style/index.js +2 -0
- package/dist/layout/index.d.ts +3 -0
- package/dist/layout/index.js +3 -0
- package/dist/layout/layout.d.ts +32 -0
- package/dist/layout/layout.js +203 -0
- package/dist/layout/mp-layout.d.ts +68 -0
- package/dist/layout/mp-layout.js +204 -0
- package/dist/layout/style/index.css +464 -0
- package/dist/layout/style/index.d.ts +2 -0
- package/dist/layout/style/index.js +2 -0
- package/dist/link/index.d.ts +37 -0
- package/dist/link/index.js +46 -0
- package/dist/link/style/index.css +39 -0
- package/dist/link/style/index.d.ts +2 -0
- package/dist/link/style/index.js +2 -0
- package/dist/loading/index.d.ts +11 -0
- package/dist/loading/index.js +46 -0
- package/dist/loading/style/index.css +84 -0
- package/dist/loading/style/index.d.ts +2 -0
- package/dist/loading/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 +121 -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 +114 -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 +1 -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 +63 -0
- package/dist/pagination/index.js +424 -0
- package/dist/pagination/style/index.css +135 -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 +143 -0
- package/dist/pop-base/index.js +381 -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 +123 -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 +35 -0
- package/dist/radio/index.js +77 -0
- package/dist/radio/primitive.d.ts +5 -0
- package/dist/radio/primitive.js +28 -0
- package/dist/radio/style/index.css +224 -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 +29 -0
- package/dist/scroll-area/index.js +118 -0
- package/dist/scroll-area/style/index.css +107 -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 +86 -0
- package/dist/select/index.js +275 -0
- package/dist/select/style/index.css +1473 -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/select/utils.d.ts +9 -0
- package/dist/select/utils.js +40 -0
- package/dist/slider/index.d.ts +69 -0
- package/dist/slider/index.js +264 -0
- package/dist/slider/style/index.css +210 -0
- package/dist/slider/style/index.d.ts +2 -0
- package/dist/slider/style/index.js +2 -0
- package/dist/style/base.css +296 -0
- package/dist/style/index.d.ts +7 -0
- package/dist/style/index.js +18 -0
- package/dist/style/theme-adui.css +352 -0
- package/dist/switch/index.d.ts +12 -0
- package/dist/switch/index.js +55 -0
- package/dist/switch/style/index.css +149 -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 +82 -0
- package/dist/table/index.d.ts +97 -0
- package/dist/table/index.js +796 -0
- package/dist/table/style/index.css +301 -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 +268 -0
- package/dist/tabs/index.d.ts +51 -0
- package/dist/tabs/index.js +697 -0
- package/dist/tabs/style/index.css +305 -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 +29 -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 +153 -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 +180 -0
- package/dist/tree-select/style/index.d.ts +1 -0
- package/dist/tree-select/style/index.js +1 -0
- package/dist/virtual-list/index.d.ts +98 -0
- package/dist/virtual-list/index.js +56 -0
- package/dist/virtual-list/style/index.css +9 -0
- package/dist/virtual-list/style/index.d.ts +2 -0
- package/dist/virtual-list/style/index.js +2 -0
- package/package.json +132 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
html {
|
|
2
|
+
--odn-empty-gap: 8px;
|
|
3
|
+
--odn-empty-large-image-size: 120px;
|
|
4
|
+
--odn-empty-medium-image-size: 80px;
|
|
5
|
+
--odn-empty-small-image-size: 60px;
|
|
6
|
+
--odn-empty-large-title-font-size: 16px;
|
|
7
|
+
--odn-empty-medium-title-font-size: 14px;
|
|
8
|
+
--odn-empty-small-title-font-size: 13px;
|
|
9
|
+
--odn-empty-title-color: var(--odn-color-black-9);
|
|
10
|
+
--odn-empty-title-font-weight: 600;
|
|
11
|
+
--odn-empty-title-line-height: 1.5;
|
|
12
|
+
--odn-empty-description-font-size: 12px;
|
|
13
|
+
--odn-empty-description-color: var(--odn-color-black-9);
|
|
14
|
+
--odn-empty-description-line-height: 1.5;
|
|
15
|
+
--odn-empty-content-gap: 4px;
|
|
16
|
+
--odn-empty-extra-gap: 8px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@layer components {
|
|
20
|
+
[data-odn-empty] {
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: var(--odn-empty-gap);
|
|
25
|
+
}
|
|
26
|
+
[data-odn-empty-image] {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
flex-shrink: 0;
|
|
31
|
+
}
|
|
32
|
+
[data-odn-empty-image] img,
|
|
33
|
+
[data-odn-empty-image] svg {
|
|
34
|
+
display: block;
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: auto;
|
|
37
|
+
}
|
|
38
|
+
[data-odn-empty-size=large] [data-odn-empty-image] {
|
|
39
|
+
width: var(--odn-empty-large-image-size);
|
|
40
|
+
}
|
|
41
|
+
[data-odn-empty-size=large] [data-odn-empty-title] {
|
|
42
|
+
font-size: var(--odn-empty-large-title-font-size);
|
|
43
|
+
}
|
|
44
|
+
[data-odn-empty-size=medium] [data-odn-empty-image] {
|
|
45
|
+
width: var(--odn-empty-medium-image-size);
|
|
46
|
+
}
|
|
47
|
+
[data-odn-empty-size=medium] [data-odn-empty-title] {
|
|
48
|
+
font-size: var(--odn-empty-medium-title-font-size);
|
|
49
|
+
}
|
|
50
|
+
[data-odn-empty-size=small] [data-odn-empty-image] {
|
|
51
|
+
width: var(--odn-empty-small-image-size);
|
|
52
|
+
}
|
|
53
|
+
[data-odn-empty-size=small] [data-odn-empty-title] {
|
|
54
|
+
font-size: var(--odn-empty-small-title-font-size);
|
|
55
|
+
}
|
|
56
|
+
[data-odn-empty-content] {
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: var(--odn-empty-content-gap);
|
|
61
|
+
}
|
|
62
|
+
[data-odn-empty-title] {
|
|
63
|
+
line-height: var(--odn-empty-title-line-height);
|
|
64
|
+
font-weight: var(--odn-empty-title-font-weight);
|
|
65
|
+
color: var(--odn-empty-title-color);
|
|
66
|
+
text-align: center;
|
|
67
|
+
}
|
|
68
|
+
[data-odn-empty-description] {
|
|
69
|
+
font-size: var(--odn-empty-description-font-size);
|
|
70
|
+
line-height: var(--odn-empty-description-line-height);
|
|
71
|
+
color: var(--odn-empty-description-color);
|
|
72
|
+
text-align: center;
|
|
73
|
+
}
|
|
74
|
+
[data-odn-empty-extra] {
|
|
75
|
+
margin-top: var(--odn-empty-extra-gap);
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './style';
|
|
3
|
+
export interface FormProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'onSubmit'> {
|
|
4
|
+
/**
|
|
5
|
+
* @description 表单验证模式
|
|
6
|
+
* @default 'onSubmit'
|
|
7
|
+
*/
|
|
8
|
+
validationMode?: 'onSubmit' | 'onBlur' | 'onChange';
|
|
9
|
+
/**
|
|
10
|
+
* @description 外部错误信息
|
|
11
|
+
*/
|
|
12
|
+
errors?: Record<string, string | string[]>;
|
|
13
|
+
/**
|
|
14
|
+
* @description 表单提交回调
|
|
15
|
+
*/
|
|
16
|
+
onFormSubmit?: (formValues: Record<string, any>, eventDetails: any) => void;
|
|
17
|
+
/**
|
|
18
|
+
* @description 标签宽度(单位 em),设置后所有 Form.Item 的 label 统一使用该宽度。不设置则自动计算最长 label 的宽度
|
|
19
|
+
*/
|
|
20
|
+
labelSize?: number;
|
|
21
|
+
/**
|
|
22
|
+
* @description 标签对齐方式,统一设置所有 Form.Item 的标签对齐
|
|
23
|
+
* @default 'left'
|
|
24
|
+
*/
|
|
25
|
+
labelAlign?: 'left' | 'right';
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export interface FormItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
29
|
+
/**
|
|
30
|
+
* @description 字段名称
|
|
31
|
+
*/
|
|
32
|
+
name?: string;
|
|
33
|
+
/**
|
|
34
|
+
* @description 标签文本
|
|
35
|
+
*/
|
|
36
|
+
label?: React.ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* @description 标签对齐方式,优先级高于 Form 的 labelAlign
|
|
39
|
+
*/
|
|
40
|
+
labelAlign?: 'left' | 'right';
|
|
41
|
+
/**
|
|
42
|
+
* @description 标签宽度,用于固定宽度对齐,优先级高于 Form 的 labelSize
|
|
43
|
+
*/
|
|
44
|
+
labelWidth?: number | string;
|
|
45
|
+
/**
|
|
46
|
+
* @description 标签单行最大字符数(超出换行)
|
|
47
|
+
*/
|
|
48
|
+
labelMaxChars?: number;
|
|
49
|
+
/**
|
|
50
|
+
* @description 是否必填
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
required?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* @description 提示信息(显示为问号图标 Tooltip)
|
|
56
|
+
*/
|
|
57
|
+
tooltip?: React.ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* @description 帮助信息(显示在控件下方)
|
|
60
|
+
*/
|
|
61
|
+
help?: React.ReactNode;
|
|
62
|
+
/**
|
|
63
|
+
* @description 错误信息(显示在控件下方)
|
|
64
|
+
*/
|
|
65
|
+
error?: React.ReactNode;
|
|
66
|
+
/**
|
|
67
|
+
* @description 自定义验证函数
|
|
68
|
+
*/
|
|
69
|
+
validate?: (value: unknown) => string | string[] | null | Promise<string | string[] | null>;
|
|
70
|
+
/**
|
|
71
|
+
* @description 验证模式
|
|
72
|
+
*/
|
|
73
|
+
validationMode?: 'onSubmit' | 'onBlur' | 'onChange';
|
|
74
|
+
/**
|
|
75
|
+
* @description 是否禁用
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
disabled?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* @description 纯数据展示模式
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
display?: boolean;
|
|
84
|
+
children?: React.ReactNode;
|
|
85
|
+
}
|
|
86
|
+
export interface FormDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
87
|
+
children?: React.ReactNode;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Form 表单
|
|
91
|
+
*/
|
|
92
|
+
declare const Form: React.ForwardRefExoticComponent<FormProps & React.RefAttributes<HTMLFormElement>>;
|
|
93
|
+
/**
|
|
94
|
+
* Form.Item 表单项
|
|
95
|
+
*/
|
|
96
|
+
declare const FormItem: React.ForwardRefExoticComponent<FormItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
97
|
+
/**
|
|
98
|
+
* Form.Description 表单描述
|
|
99
|
+
*/
|
|
100
|
+
declare const FormDescription: React.ForwardRefExoticComponent<FormDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
101
|
+
type FormComponent = typeof Form & {
|
|
102
|
+
Item: typeof FormItem;
|
|
103
|
+
Description: typeof FormDescription;
|
|
104
|
+
};
|
|
105
|
+
declare const FormWithSub: FormComponent;
|
|
106
|
+
export default FormWithSub;
|
|
@@ -0,0 +1,272 @@
|
|
|
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 = ["validationMode", "errors", "onFormSubmit", "labelSize", "labelAlign", "children", "className"],
|
|
3
|
+
_excluded2 = ["name", "label", "labelAlign", "labelWidth", "labelMaxChars", "required", "tooltip", "help", "error", "validate", "validationMode", "disabled", "display", "children", "className", "style"],
|
|
4
|
+
_excluded3 = ["children"];
|
|
5
|
+
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); }
|
|
6
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
7
|
+
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."); }
|
|
8
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
9
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
|
+
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."); }
|
|
17
|
+
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; } }
|
|
18
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
22
|
+
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); }
|
|
23
|
+
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; }
|
|
24
|
+
import * as React from 'react';
|
|
25
|
+
import { Form as BaseForm } from '@base-ui/react/form';
|
|
26
|
+
import { Field as BaseField } from '@base-ui/react/field';
|
|
27
|
+
import Tooltip from "../tooltip";
|
|
28
|
+
import Icon from "../icon";
|
|
29
|
+
import "./style";
|
|
30
|
+
|
|
31
|
+
// ---- Context ----
|
|
32
|
+
|
|
33
|
+
var FormContext = /*#__PURE__*/React.createContext(null);
|
|
34
|
+
function useFormContext() {
|
|
35
|
+
return React.useContext(FormContext);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 计算字符串的显示宽度(中文 1em,英文/数字约 0.6em)
|
|
40
|
+
*/
|
|
41
|
+
function measureLabelWidth(text) {
|
|
42
|
+
var width = 0;
|
|
43
|
+
var _iterator = _createForOfIteratorHelper(text),
|
|
44
|
+
_step;
|
|
45
|
+
try {
|
|
46
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
47
|
+
var char = _step.value;
|
|
48
|
+
// CJK characters are approximately 1em wide
|
|
49
|
+
if (/[\u4e00-\u9fff\u3000-\u303f\uff00-\uffef]/.test(char)) {
|
|
50
|
+
width += 1;
|
|
51
|
+
} else {
|
|
52
|
+
width += 0.6;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
} catch (err) {
|
|
56
|
+
_iterator.e(err);
|
|
57
|
+
} finally {
|
|
58
|
+
_iterator.f();
|
|
59
|
+
}
|
|
60
|
+
return width;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// ---- Props ----
|
|
64
|
+
|
|
65
|
+
// ---- Form ----
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Form 表单
|
|
69
|
+
*/
|
|
70
|
+
var Form = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
71
|
+
var _ref$validationMode = _ref.validationMode,
|
|
72
|
+
validationMode = _ref$validationMode === void 0 ? 'onSubmit' : _ref$validationMode,
|
|
73
|
+
errors = _ref.errors,
|
|
74
|
+
onFormSubmit = _ref.onFormSubmit,
|
|
75
|
+
labelSize = _ref.labelSize,
|
|
76
|
+
labelAlign = _ref.labelAlign,
|
|
77
|
+
children = _ref.children,
|
|
78
|
+
className = _ref.className,
|
|
79
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
80
|
+
var _React$useState = React.useState({}),
|
|
81
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
82
|
+
labelMap = _React$useState2[0],
|
|
83
|
+
setLabelMap = _React$useState2[1];
|
|
84
|
+
var registerLabel = React.useCallback(function (id, text) {
|
|
85
|
+
setLabelMap(function (prev) {
|
|
86
|
+
if (prev[id] === text) return prev;
|
|
87
|
+
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, id, text));
|
|
88
|
+
});
|
|
89
|
+
}, []);
|
|
90
|
+
var unregisterLabel = React.useCallback(function (id) {
|
|
91
|
+
setLabelMap(function (prev) {
|
|
92
|
+
if (!(id in prev)) return prev;
|
|
93
|
+
var next = _objectSpread({}, prev);
|
|
94
|
+
delete next[id];
|
|
95
|
+
return next;
|
|
96
|
+
});
|
|
97
|
+
}, []);
|
|
98
|
+
|
|
99
|
+
// Auto-calculate: find the max label width from all registered labels
|
|
100
|
+
var autoLabelSize = React.useMemo(function () {
|
|
101
|
+
var texts = Object.values(labelMap);
|
|
102
|
+
if (texts.length === 0) return 0;
|
|
103
|
+
return Math.ceil(Math.max.apply(Math, _toConsumableArray(texts.map(measureLabelWidth))));
|
|
104
|
+
}, [labelMap]);
|
|
105
|
+
var contextValue = React.useMemo(function () {
|
|
106
|
+
return {
|
|
107
|
+
labelSize: labelSize,
|
|
108
|
+
labelAlign: labelAlign,
|
|
109
|
+
registerLabel: registerLabel,
|
|
110
|
+
unregisterLabel: unregisterLabel,
|
|
111
|
+
autoLabelSize: autoLabelSize
|
|
112
|
+
};
|
|
113
|
+
}, [labelSize, labelAlign, registerLabel, unregisterLabel, autoLabelSize]);
|
|
114
|
+
return /*#__PURE__*/React.createElement(FormContext.Provider, {
|
|
115
|
+
value: contextValue
|
|
116
|
+
}, /*#__PURE__*/React.createElement(BaseForm, _extends({
|
|
117
|
+
ref: ref,
|
|
118
|
+
className: className,
|
|
119
|
+
"data-odn-form": "",
|
|
120
|
+
validationMode: validationMode,
|
|
121
|
+
errors: errors,
|
|
122
|
+
onFormSubmit: onFormSubmit
|
|
123
|
+
}, otherProps), children));
|
|
124
|
+
});
|
|
125
|
+
Form.displayName = 'Form';
|
|
126
|
+
|
|
127
|
+
// ---- Form.Item ----
|
|
128
|
+
|
|
129
|
+
var formItemIdCounter = 0;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Form.Item 表单项
|
|
133
|
+
*/
|
|
134
|
+
var FormItem = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
135
|
+
var _ref3;
|
|
136
|
+
var name = _ref2.name,
|
|
137
|
+
label = _ref2.label,
|
|
138
|
+
labelAlignProp = _ref2.labelAlign,
|
|
139
|
+
labelWidth = _ref2.labelWidth,
|
|
140
|
+
labelMaxChars = _ref2.labelMaxChars,
|
|
141
|
+
required = _ref2.required,
|
|
142
|
+
tooltip = _ref2.tooltip,
|
|
143
|
+
help = _ref2.help,
|
|
144
|
+
error = _ref2.error,
|
|
145
|
+
validate = _ref2.validate,
|
|
146
|
+
validationMode = _ref2.validationMode,
|
|
147
|
+
disabled = _ref2.disabled,
|
|
148
|
+
display = _ref2.display,
|
|
149
|
+
children = _ref2.children,
|
|
150
|
+
className = _ref2.className,
|
|
151
|
+
styleProp = _ref2.style,
|
|
152
|
+
otherProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
153
|
+
var formCtx = useFormContext();
|
|
154
|
+
|
|
155
|
+
// Register label text for auto-calculation
|
|
156
|
+
var idRef = React.useRef('');
|
|
157
|
+
if (!idRef.current) {
|
|
158
|
+
idRef.current = "form-item-".concat(++formItemIdCounter);
|
|
159
|
+
}
|
|
160
|
+
var labelText = typeof label === 'string' ? label : typeof label === 'number' ? String(label) : '';
|
|
161
|
+
React.useEffect(function () {
|
|
162
|
+
if (formCtx && labelText) {
|
|
163
|
+
formCtx.registerLabel(idRef.current, labelText);
|
|
164
|
+
}
|
|
165
|
+
return function () {
|
|
166
|
+
if (formCtx) {
|
|
167
|
+
formCtx.unregisterLabel(idRef.current);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
}, [formCtx, labelText]);
|
|
171
|
+
|
|
172
|
+
// Resolve label align: item prop > form prop > default
|
|
173
|
+
var labelAlign = (_ref3 = labelAlignProp !== null && labelAlignProp !== void 0 ? labelAlignProp : formCtx === null || formCtx === void 0 ? void 0 : formCtx.labelAlign) !== null && _ref3 !== void 0 ? _ref3 : 'left';
|
|
174
|
+
|
|
175
|
+
// Resolve label width: item labelWidth > form labelSize > auto-calculated
|
|
176
|
+
var labelStyle = {};
|
|
177
|
+
if (labelWidth) {
|
|
178
|
+
var w = typeof labelWidth === 'number' ? "".concat(labelWidth, "px") : labelWidth;
|
|
179
|
+
labelStyle.width = w;
|
|
180
|
+
labelStyle.minWidth = w;
|
|
181
|
+
} else if (formCtx) {
|
|
182
|
+
var _formCtx$labelSize;
|
|
183
|
+
var size = (_formCtx$labelSize = formCtx.labelSize) !== null && _formCtx$labelSize !== void 0 ? _formCtx$labelSize : formCtx.autoLabelSize;
|
|
184
|
+
if (size > 0) {
|
|
185
|
+
labelStyle.width = "".concat(size, "em");
|
|
186
|
+
labelStyle.minWidth = "".concat(size, "em");
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (labelMaxChars) {
|
|
190
|
+
labelStyle.maxWidth = "".concat(labelMaxChars, "em");
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// Extra width for tooltip icon
|
|
194
|
+
var hasTooltip = !!tooltip;
|
|
195
|
+
if (display) {
|
|
196
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
197
|
+
ref: ref,
|
|
198
|
+
"data-odn-form-item": "",
|
|
199
|
+
"data-odn-form-item-display": "true",
|
|
200
|
+
"data-odn-form-item-label-align": labelAlign,
|
|
201
|
+
className: className,
|
|
202
|
+
style: styleProp
|
|
203
|
+
}, otherProps), label !== undefined && /*#__PURE__*/React.createElement("div", {
|
|
204
|
+
"data-odn-form-item-label": "",
|
|
205
|
+
style: labelStyle
|
|
206
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
207
|
+
"data-odn-form-item-label-text": ""
|
|
208
|
+
}, label)), /*#__PURE__*/React.createElement("div", {
|
|
209
|
+
"data-odn-form-item-content": ""
|
|
210
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
211
|
+
"data-odn-form-item-control": ""
|
|
212
|
+
}, children)));
|
|
213
|
+
}
|
|
214
|
+
return /*#__PURE__*/React.createElement(BaseField.Root, _extends({
|
|
215
|
+
ref: ref,
|
|
216
|
+
name: name,
|
|
217
|
+
disabled: disabled,
|
|
218
|
+
validate: validate,
|
|
219
|
+
validationMode: validationMode,
|
|
220
|
+
"data-odn-form-item": "",
|
|
221
|
+
"data-odn-form-item-label-align": labelAlign,
|
|
222
|
+
className: className,
|
|
223
|
+
style: styleProp
|
|
224
|
+
}, otherProps), label !== undefined && /*#__PURE__*/React.createElement(BaseField.Label, {
|
|
225
|
+
"data-odn-form-item-label": "",
|
|
226
|
+
"data-odn-form-item-label-has-tooltip": hasTooltip || undefined,
|
|
227
|
+
style: labelStyle
|
|
228
|
+
}, required && /*#__PURE__*/React.createElement("span", {
|
|
229
|
+
"data-odn-form-item-required": ""
|
|
230
|
+
}, "*"), /*#__PURE__*/React.createElement("span", {
|
|
231
|
+
"data-odn-form-item-label-text": ""
|
|
232
|
+
}, label), tooltip && /*#__PURE__*/React.createElement(Tooltip, {
|
|
233
|
+
popup: tooltip,
|
|
234
|
+
placement: "top"
|
|
235
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
236
|
+
"data-odn-form-item-tooltip": ""
|
|
237
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
238
|
+
name: "help-circle"
|
|
239
|
+
})))), /*#__PURE__*/React.createElement("div", {
|
|
240
|
+
"data-odn-form-item-content": ""
|
|
241
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
242
|
+
"data-odn-form-item-control": ""
|
|
243
|
+
}, children), error && /*#__PURE__*/React.createElement("div", {
|
|
244
|
+
"data-odn-form-item-error": ""
|
|
245
|
+
}, error), !error && /*#__PURE__*/React.createElement(BaseField.Error, {
|
|
246
|
+
"data-odn-form-item-error": ""
|
|
247
|
+
}), help && /*#__PURE__*/React.createElement("div", {
|
|
248
|
+
"data-odn-form-item-help": ""
|
|
249
|
+
}, help)));
|
|
250
|
+
});
|
|
251
|
+
FormItem.displayName = 'Form.Item';
|
|
252
|
+
|
|
253
|
+
// ---- Form.Description ----
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Form.Description 表单描述
|
|
257
|
+
*/
|
|
258
|
+
var FormDescription = /*#__PURE__*/React.forwardRef(function (_ref4, ref) {
|
|
259
|
+
var children = _ref4.children,
|
|
260
|
+
otherProps = _objectWithoutProperties(_ref4, _excluded3);
|
|
261
|
+
return /*#__PURE__*/React.createElement(BaseField.Description, _extends({
|
|
262
|
+
ref: ref
|
|
263
|
+
}, otherProps), children);
|
|
264
|
+
});
|
|
265
|
+
FormDescription.displayName = 'Form.Description';
|
|
266
|
+
|
|
267
|
+
// ---- Compose ----
|
|
268
|
+
|
|
269
|
+
var FormWithSub = Form;
|
|
270
|
+
FormWithSub.Item = FormItem;
|
|
271
|
+
FormWithSub.Description = FormDescription;
|
|
272
|
+
export default FormWithSub;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--odn-form-font-size: 14px;
|
|
3
|
+
--odn-form-line-height: 22px;
|
|
4
|
+
--odn-form-label-font-size: 14px;
|
|
5
|
+
--odn-form-label-line-height: 22px;
|
|
6
|
+
--odn-form-label-color: var(--odn-color-solid-black-12);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@layer components {
|
|
10
|
+
[data-odn-form] {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
}
|
|
14
|
+
[data-odn-form-item] {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: flex-start;
|
|
17
|
+
gap: 16px;
|
|
18
|
+
padding: 12px 0;
|
|
19
|
+
font-size: var(--odn-form-font-size, 14px);
|
|
20
|
+
line-height: var(--odn-form-line-height, 22px);
|
|
21
|
+
}
|
|
22
|
+
[data-odn-form-item-label-align=right] [data-odn-form-item-label] {
|
|
23
|
+
text-align: right;
|
|
24
|
+
justify-content: flex-end;
|
|
25
|
+
}
|
|
26
|
+
[data-odn-form-item-label] {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: flex-start;
|
|
29
|
+
flex-shrink: 0;
|
|
30
|
+
gap: 2px;
|
|
31
|
+
padding-top: 7px;
|
|
32
|
+
font-size: var(--odn-form-label-font-size, 14px);
|
|
33
|
+
line-height: var(--odn-form-label-line-height, 22px);
|
|
34
|
+
color: var(--odn-form-label-color, var(--odn-color-solid-black-12));
|
|
35
|
+
}
|
|
36
|
+
[data-odn-form-item-required] {
|
|
37
|
+
color: var(--odn-color-error);
|
|
38
|
+
margin-right: 2px;
|
|
39
|
+
}
|
|
40
|
+
[data-odn-form-item-tooltip] {
|
|
41
|
+
display: inline-flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
align-self: center;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
color: var(--odn-color-solid-black-9);
|
|
46
|
+
margin-left: 2px;
|
|
47
|
+
height: var(--odn-form-label-line-height, 22px);
|
|
48
|
+
}
|
|
49
|
+
[data-odn-form-item-tooltip] svg {
|
|
50
|
+
width: 14px;
|
|
51
|
+
height: 14px;
|
|
52
|
+
}
|
|
53
|
+
[data-odn-form-item-tooltip]:hover {
|
|
54
|
+
color: var(--odn-color-solid-black-10);
|
|
55
|
+
}
|
|
56
|
+
[data-odn-form-item-content] {
|
|
57
|
+
flex: 1;
|
|
58
|
+
min-width: 0;
|
|
59
|
+
}
|
|
60
|
+
[data-odn-form-item-control] {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 8px;
|
|
64
|
+
}
|
|
65
|
+
[data-odn-form-item-error] {
|
|
66
|
+
font-size: 12px;
|
|
67
|
+
line-height: 20px;
|
|
68
|
+
color: var(--odn-color-error);
|
|
69
|
+
margin-top: 2px;
|
|
70
|
+
}
|
|
71
|
+
[data-odn-form-item-error]:empty {
|
|
72
|
+
display: none;
|
|
73
|
+
}
|
|
74
|
+
[data-odn-form-item-help] {
|
|
75
|
+
font-size: 12px;
|
|
76
|
+
line-height: 20px;
|
|
77
|
+
color: var(--odn-color-solid-black-9);
|
|
78
|
+
margin-top: 2px;
|
|
79
|
+
}
|
|
80
|
+
[data-odn-form-item-display=true] [data-odn-form-item-control] {
|
|
81
|
+
color: var(--odn-color-solid-black-12);
|
|
82
|
+
padding-top: 7px;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style';
|
|
3
|
+
export interface HoverFillProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/**
|
|
5
|
+
* @description hover 颜色
|
|
6
|
+
* @default 'rgba(33, 34, 38, 0.05)'
|
|
7
|
+
*/
|
|
8
|
+
hoverColor?: string;
|
|
9
|
+
/**
|
|
10
|
+
* @description active 颜色
|
|
11
|
+
* @default 'rgba(33, 34, 38, 0.08)'
|
|
12
|
+
*/
|
|
13
|
+
activeColor?: string;
|
|
14
|
+
/**
|
|
15
|
+
* @description 背景类名,在这里加圆角
|
|
16
|
+
*/
|
|
17
|
+
bgClassName?: string;
|
|
18
|
+
/**
|
|
19
|
+
* @description 背景样式,在这里加圆角
|
|
20
|
+
*/
|
|
21
|
+
bgStyle?: React.CSSProperties;
|
|
22
|
+
/**
|
|
23
|
+
* @description 是否禁用
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @description hover 时的鼠标样式
|
|
29
|
+
* @type React.CSSProperties['cursor']
|
|
30
|
+
* @default 'pointer'
|
|
31
|
+
*/
|
|
32
|
+
hoverCursor?: React.CSSProperties['cursor'];
|
|
33
|
+
}
|
|
34
|
+
export interface HoverFillState {
|
|
35
|
+
timer: number;
|
|
36
|
+
bgVisible: boolean;
|
|
37
|
+
baseNode?: HTMLDivElement | null;
|
|
38
|
+
bgNode?: HTMLDivElement | null;
|
|
39
|
+
bgX: number;
|
|
40
|
+
bgY: number;
|
|
41
|
+
bgScale: number;
|
|
42
|
+
}
|
|
43
|
+
declare global {
|
|
44
|
+
interface Window {
|
|
45
|
+
odnHoverFillState: HoverFillState;
|
|
46
|
+
odnHoverFillStateStack: HoverFillState[];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
declare const HoverFill: React.ForwardRefExoticComponent<HoverFillProps & React.RefAttributes<unknown>>;
|
|
50
|
+
export default HoverFill;
|