@nutui/nutui-react-taro 2.3.10 → 2.3.12
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/CHANGELOG.md +27 -0
- package/dist/esm/ActionSheet/style/style.css +1 -1
- package/dist/esm/ActionSheet.js +1 -13
- package/dist/esm/Address/style/style.css +1 -1
- package/dist/esm/Address.js +1 -21
- package/dist/esm/Animate/style/style.css +1 -1
- package/dist/esm/Animate.js +1 -4
- package/dist/esm/AnimatingNumbers.js +8 -22
- package/dist/esm/Audio/style/style.css +1 -1
- package/dist/esm/Audio.js +1 -15
- package/dist/esm/Avatar.js +1 -10
- package/dist/esm/AvatarCropper.js +1 -10
- package/dist/esm/AvatarGroup.js +1 -4
- package/dist/esm/BackTop.js +1 -6
- package/dist/esm/Badge/style/style.css +1 -1
- package/dist/esm/Badge.js +1 -4
- package/dist/esm/Barrage/style/style.css +1 -1
- package/dist/esm/Barrage.js +1 -7
- package/dist/esm/Button.js +1 -6
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/Calendar.js +1 -20
- package/dist/esm/CalendarCard.js +1 -8
- package/dist/esm/CalendarItem.js +1 -12
- package/dist/esm/Card/style/style.css +1 -1
- package/dist/esm/Card.js +1 -7
- package/dist/esm/Cascader/style/style.css +1 -1
- package/dist/esm/Cascader.js +1 -18
- package/dist/esm/Cell.js +1 -5
- package/dist/esm/CellGroup.js +1 -4
- package/dist/esm/Checkbox/style/style.css +1 -1
- package/dist/esm/Checkbox.js +1 -7
- package/dist/esm/CheckboxGroup/style/style.css +1 -1
- package/dist/esm/CheckboxGroup.js +1 -7
- package/dist/esm/CircleProgress.js +1 -6
- package/dist/esm/Col/style/style.css +1 -1
- package/dist/esm/Col.js +1 -5
- package/dist/esm/Collapse/style/style.css +1 -1
- package/dist/esm/Collapse.js +1 -8
- package/dist/esm/CollapseItem/style/style.css +1 -1
- package/dist/esm/CollapseItem.js +1 -5
- package/dist/esm/ConfigProvider.js +4 -6
- package/dist/esm/CountDown.js +1 -7
- package/dist/esm/DatePicker/style/style.css +1 -1
- package/dist/esm/DatePicker.js +1 -21
- package/dist/esm/Dialog/style/style.css +1 -1
- package/dist/esm/Dialog.js +1 -16
- package/dist/esm/Divider/style/style.css +1 -1
- package/dist/esm/Divider.js +1 -4
- package/dist/esm/Drag.js +1 -4
- package/dist/esm/Elevator.js +1 -6
- package/dist/esm/Ellipsis.js +1 -7
- package/dist/esm/Empty.js +1 -9
- package/dist/esm/FixedNav.js +1 -13
- package/dist/esm/Form/style/style.css +1 -1
- package/dist/esm/Form.js +7 -18
- package/dist/esm/FormItem/style/style.css +1 -1
- package/dist/esm/FormItem.js +1 -6
- package/dist/esm/Grid/style/style.css +1 -1
- package/dist/esm/Grid.js +1 -7
- package/dist/esm/GridItem/style/style.css +1 -1
- package/dist/esm/GridItem.js +1 -6
- package/dist/esm/Image.js +1 -7
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/ImagePreview.js +1 -20
- package/dist/esm/Indicator/style/style.css +1 -1
- package/dist/esm/Indicator.js +1 -3
- package/dist/esm/InfiniteLoading.js +1 -8
- package/dist/esm/Input.js +1 -11
- package/dist/esm/InputNumber.js +1 -7
- package/dist/esm/Layout.js +1 -2
- package/dist/esm/Loading.js +1 -5
- package/dist/esm/Menu/style/style.css +1 -1
- package/dist/esm/Menu.js +1 -15
- package/dist/esm/MenuItem/style/style.css +1 -1
- package/dist/esm/MenuItem.js +1 -14
- package/dist/esm/NavBar/style/style.css +1 -1
- package/dist/esm/NavBar.js +1 -7
- package/dist/esm/NoticeBar/style/style.css +1 -1
- package/dist/esm/NoticeBar.js +1 -7
- package/dist/esm/Notify.js +1 -9
- package/dist/esm/NumberKeyboard/style/style.css +1 -1
- package/dist/esm/NumberKeyboard.js +1 -15
- package/dist/esm/Overlay.js +1 -9
- package/dist/esm/Pagination.js +1 -8
- package/dist/esm/Picker/style/style.css +1 -1
- package/dist/esm/Picker.js +1 -19
- package/dist/esm/Popover/style/style.css +1 -1
- package/dist/esm/Popover.js +1 -14
- package/dist/esm/Popup/style/style.css +1 -1
- package/dist/esm/Popup.js +1 -12
- package/dist/esm/Price/style/style.css +1 -1
- package/dist/esm/Price.js +1 -3
- package/dist/esm/Progress.js +1 -4
- package/dist/esm/PullToRefresh.js +1 -10
- package/dist/esm/Radio/style/style.css +1 -1
- package/dist/esm/Radio.js +1 -7
- package/dist/esm/RadioGroup/style/style.css +1 -1
- package/dist/esm/RadioGroup.js +1 -7
- package/dist/esm/Range/style/style.css +1 -1
- package/dist/esm/Range.js +1 -10
- package/dist/esm/Rate.js +1 -11
- package/dist/esm/Row.js +1 -5
- package/dist/esm/SafeArea.js +1 -3
- package/dist/esm/SearchBar/style/style.css +1 -1
- package/dist/esm/SearchBar.js +1 -7
- package/dist/esm/ShortPassword/style/style.css +1 -1
- package/dist/esm/ShortPassword.js +1 -17
- package/dist/esm/SideNavBar/style/style.css +1 -1
- package/dist/esm/SideNavBar.js +1 -14
- package/dist/esm/SideNavBarItem.js +1 -2
- package/dist/esm/Signature.js +1 -4
- package/dist/esm/Skeleton/style/style.css +1 -1
- package/dist/esm/Skeleton.js +1 -11
- package/dist/esm/Space.js +1 -3
- package/dist/esm/Step/style/style.css +1 -1
- package/dist/esm/Step.js +1 -6
- package/dist/esm/Steps/style/style.css +1 -1
- package/dist/esm/Steps.js +1 -5
- package/dist/esm/Sticky.js +1 -7
- package/dist/esm/SubSideNavBar.js +1 -3
- package/dist/esm/Swipe/style/style.css +1 -1
- package/dist/esm/Swipe.js +1 -8
- package/dist/esm/Swiper/style/style.css +1 -1
- package/dist/esm/Swiper.js +9 -11
- package/dist/esm/SwiperItem.js +1 -2
- package/dist/esm/Switch/style/style.css +1 -1
- package/dist/esm/Switch.js +1 -5
- package/dist/esm/TabPane.js +1 -3
- package/dist/esm/Tabbar/style/style.css +1 -1
- package/dist/esm/Tabbar.js +1 -8
- package/dist/esm/TabbarItem/style/style.css +1 -1
- package/dist/esm/TabbarItem.js +1 -5
- package/dist/esm/Table/style/style.css +1 -1
- package/dist/esm/Table.js +1 -9
- package/dist/esm/Tabs/style/style.css +1 -1
- package/dist/esm/Tabs.js +1 -11
- package/dist/esm/Tag.js +1 -5
- package/dist/esm/TextArea/style/style.css +1 -1
- package/dist/esm/TextArea.js +1 -10
- package/dist/esm/TimeDetail.js +1 -4
- package/dist/esm/TimeSelect/style/style.css +1 -1
- package/dist/esm/TimeSelect.js +1 -16
- package/dist/esm/Toast.js +1 -15
- package/dist/esm/Tour/style/style.css +1 -1
- package/dist/esm/Tour.js +1 -16
- package/dist/esm/TrendArrow.js +1 -4
- package/dist/esm/Uploader.js +1 -14
- package/dist/esm/Video.js +1 -4
- package/dist/esm/VirtualList/style/style.css +1 -1
- package/dist/esm/VirtualList.js +1 -6
- package/dist/esm/WaterMark.js +1 -7
- package/dist/esm/{actionsheet.taro-6NiOrNyd.js → actionsheet.taro-C5BqWoML.js} +9 -17
- package/dist/esm/{address.taro-zQuxQEce.js → address.taro-DjlXNWie.js} +19 -44
- package/dist/esm/{animate.taro-m67VyUHP.js → animate.taro-Dg9jxZEu.js} +6 -14
- package/dist/esm/{audio.taro-dJgj5qIu.js → audio.taro-DXxWGngO.js} +14 -30
- package/dist/esm/avatar.taro-a6CX3kxV.js +86 -0
- package/dist/esm/{avatarcropper.taro-GIZxzMJ_.js → avatarcropper.taro-BFvFmK4t.js} +47 -90
- package/dist/esm/{avatargroup.taro-h6dpv6UX.js → avatargroup.taro-bpT5kPbf.js} +3 -11
- package/dist/esm/{backtop.taro-Y3vOJiXq.js → backtop.taro-B-zl6AEC.js} +4 -15
- package/dist/esm/{badge.taro-993L861f.js → badge.taro-CyDqBb9Z.js} +4 -15
- package/dist/esm/{barrage.taro-6nbq7wtt.js → barrage.taro-BNOcZsJ1.js} +18 -28
- package/dist/esm/{button.taro-3IIFy1M2.js → button.taro-OKGsDVW7.js} +8 -23
- package/dist/esm/{calendar.taro-iNNHje7V.js → calendar.taro-DbHJEx4G.js} +12 -39
- package/dist/esm/{calendarcard.taro-9s7naGmU.js → calendarcard.taro-BHGCq5zX.js} +10 -14
- package/dist/esm/{calendaritem.taro-o6Z8OOGY.js → calendaritem.taro-B8tN2DYa.js} +11 -36
- package/dist/esm/{card.taro-p4PTy-IU.js → card.taro-uLorQW97.js} +7 -22
- package/dist/esm/{cascader.taro-M2nZWxiB.js → cascader.taro-CpofskUL.js} +47 -83
- package/dist/esm/{cell.taro-jD6MoFTj.js → cell.taro-CCnLF6RC.js} +9 -23
- package/dist/esm/{cellgroup.taro-08A3XAze.js → cellgroup.taro-Dz69kT6e.js} +5 -12
- package/dist/esm/{checkbox.taro-xMxWdpyI.js → checkbox.taro-D9F_HM7f.js} +19 -29
- package/dist/esm/{circleprogress.taro-myZgamBw.js → circleprogress.taro-CKSrzt8Q.js} +8 -22
- package/dist/esm/{col.taro-5FMpttLE.js → col.taro-C8DUuJYh.js} +5 -13
- package/dist/esm/{collapse.taro-sZibDygv.js → collapse.taro-BM0BsN30.js} +5 -14
- package/dist/esm/{collapseitem.taro-AaQ_msgd.js → collapseitem.taro-D_m4VEdG.js} +7 -16
- package/dist/esm/configprovider.taro-CyU_tvNJ.js +202 -0
- package/dist/esm/{countdown.taro-XZlfWBrA.js → countdown.taro-Dfa9kpmZ.js} +8 -18
- package/dist/esm/{datepicker.taro-DrXkqJkN.js → datepicker.taro-DshCn7Rn.js} +13 -25
- package/dist/esm/{dialog.taro-dmQGDu3o.js → dialog.taro-xsQhsC1V.js} +19 -19
- package/dist/esm/{divider.taro-H5fKry4P.js → divider.taro-DRcO_m9e.js} +5 -11
- package/dist/esm/{drag.taro-BwcleRuB.js → drag.taro-CcHIO07Y.js} +10 -18
- package/dist/esm/{elevator.taro-2nbUM3vH.js → elevator.taro-uhrF7ChY.js} +5 -17
- package/dist/esm/{ellipsis.taro-VApVqS_j.js → ellipsis.taro-B_mTyNyk.js} +25 -34
- package/dist/esm/{empty.taro-gwvOr1xf.js → empty.taro-Brkv6B2Z.js} +8 -18
- package/dist/esm/{fixednav.taro-QVBXysDj.js → fixednav.taro-WTBxWxOo.js} +10 -21
- package/dist/esm/formitem.taro-Brz5dj_8.js +330 -0
- package/dist/esm/{get-rect-by-taro-piSHvCGp.js → get-rect-by-taro-CSN0TGnD.js} +3 -2
- package/dist/esm/{grid.taro-3X-_AhXw.js → grid.taro-BA76RrgT.js} +5 -4
- package/dist/esm/{griditem.taro-TJDJVeQy.js → griditem.taro-JLddv9zD.js} +6 -11
- package/dist/esm/{image.taro-FfeikBlO.js → image.taro-BLz2WCva.js} +5 -6
- package/dist/esm/{imagepreview.taro--fVrJUOE.js → imagepreview.taro-Bb1TkBCV.js} +13 -31
- package/dist/esm/{indicator.taro-ZH6MICsS.js → indicator.taro-CpHZtD9p.js} +3 -5
- package/dist/esm/{infiniteloading.taro-BO0_y46K.js → infiniteloading.taro-Ccq4bEzk.js} +14 -21
- package/dist/esm/{input.taro-YoPsV-op.js → input.taro-BVC8gEuk.js} +17 -31
- package/dist/esm/inputnumber.taro-F3jNGr_V.js +158 -0
- package/dist/esm/{layout.taro-lnN-wB0Y.js → layout.taro-BE2868d6.js} +1 -1
- package/dist/esm/{loading.taro-aHN6xLIT.js → loading.taro-CRF1z5wQ.js} +5 -8
- package/dist/esm/{menu.taro-ODwHYGFM.js → menu.taro-BAiJPGR7.js} +12 -25
- package/dist/esm/{menuitem.taro-9nyTDLpt.js → menuitem.taro-oLv6ZYC5.js} +15 -36
- package/dist/esm/{navbar.taro-AuKPDCaW.js → navbar.taro-B8u3DOE4.js} +14 -29
- package/dist/esm/{noticebar.taro-bHnEzTvL.js → noticebar.taro-CMdfOp2g.js} +16 -32
- package/dist/esm/{notify.taro-mA9KS8qh.js → notify.taro-jP7y9zMU.js} +6 -15
- package/dist/esm/{numberkeyboard.taro-bF6VCXry.js → numberkeyboard.taro-B9rMgy7D.js} +9 -16
- package/dist/esm/nutui-react.es.js +93 -118
- package/dist/esm/{overlay.taro-HsGeVyPh.js → overlay.taro-BaBu-3-F.js} +10 -22
- package/dist/esm/{pagination.taro-C4_Ey5KC.js → pagination.taro-DAK6ddag.js} +7 -19
- package/dist/esm/{picker.taro-csU3SZPF.js → picker.taro-Cmng9GW9.js} +34 -43
- package/dist/esm/{popover.taro-qldQwLPC.js → popover.taro-CcKwnX27.js} +23 -41
- package/dist/esm/{popup.taro-ObEUml4r.js → popup.taro-Iy_WQZ-m.js} +8 -32
- package/dist/esm/{price.taro-Z1zR8YWV.js → price.taro-UVRHPHRD.js} +5 -16
- package/dist/esm/{progress.taro-pStvlrbA.js → progress.taro-BOHykt7X.js} +8 -14
- package/dist/esm/{pulltorefresh.taro-2jER8Mat.js → pulltorefresh.taro-BJdQj5sL.js} +31 -47
- package/dist/esm/{radio.taro-EKJXMjnX.js → radio.taro-CjJgX9o2.js} +20 -33
- package/dist/esm/{range.taro-mDYY3SXA.js → range.taro-BxMDs5Cy.js} +20 -22
- package/dist/esm/{rate.taro-_5Mjd_EO.js → rate.taro-BABLqt4h.js} +7 -20
- package/dist/esm/{row.taro-IxNlKKQM.js → row.taro-D8chDydP.js} +4 -14
- package/dist/esm/{searchbar.taro-hVzdT6nI.js → searchbar.taro-PfVx6o-6.js} +9 -26
- package/dist/esm/{shortpassword.taro-ECs_E1Xn.js → shortpassword.taro-BXsxku33.js} +10 -20
- package/dist/esm/{sidenavbar.taro-8qoGZg5n.js → sidenavbar.taro-eK5vaZPR.js} +7 -13
- package/dist/esm/sidenavbaritem.taro-L7HbsCLn.js +14 -0
- package/dist/esm/{signature.taro-y3qxnKMv.js → signature.taro-KPm_xs66.js} +11 -19
- package/dist/esm/{skeleton.taro-Pg7WtP0e.js → skeleton.taro-BwIDIf2p.js} +8 -19
- package/dist/esm/{space.taro-q3R_yq79.js → space.taro-CZ999etm.js} +1 -4
- package/dist/esm/{step.taro-_DEZqFGb.js → step.taro-DLr2GzYk.js} +8 -16
- package/dist/esm/steps.taro-C8Yg1Sns.js +28 -0
- package/dist/esm/{sticky.taro-p-evMNR-.js → sticky.taro-DRBk3gkQ.js} +12 -15
- package/dist/esm/{subsidenavbar.taro-Zy52MDDG.js → subsidenavbar.taro-ByxYpgfP.js} +7 -9
- package/dist/esm/{swipe.taro-p2ONOq1o.js → swipe.taro-wm7YWwaj.js} +29 -31
- package/dist/esm/{swiperitem.taro-BC1CE0T-.js → swiperitem.taro-8JXI24f0.js} +3 -1
- package/dist/esm/{switch.taro-L0BAbMeu.js → switch.taro-D1HgJoJz.js} +6 -13
- package/dist/esm/{tabbar.taro-QE0rjSKE.js → tabbar.taro-8_SmJofa.js} +7 -18
- package/dist/esm/tabbaritem.taro-Cb-yfOln.js +58 -0
- package/dist/esm/{table.taro-0zRh2hq6.js → table.taro-0BcEBB0F.js} +7 -18
- package/dist/esm/{tabpane.taro-5k7wWimS.js → tabpane.taro-BAe86j3t.js} +1 -4
- package/dist/esm/{tabs.taro-Yj7vgtSg.js → tabs.taro-HgAoKBAc.js} +14 -30
- package/dist/esm/{tag.taro-5KC_wObY.js → tag.taro-BsmY5QfN.js} +7 -22
- package/dist/esm/{textarea.taro-9zQLTCwU.js → textarea.taro-BJIFCpKb.js} +11 -20
- package/dist/esm/{timedetail.taro-TF9Wcblh.js → timedetail.taro-x6Zey1xi.js} +11 -21
- package/dist/esm/{timeselect.taro-j8LgSCe5.js → timeselect.taro-BXq4APSJ.js} +20 -33
- package/dist/esm/{toast.taro-xnEQSCDJ.js → toast.taro-BIR_7Wgb.js} +8 -26
- package/dist/esm/{tour.taro-CGEjzzN_.js → tour.taro-CMagdKcp.js} +7 -24
- package/dist/esm/{trendarrow.taro-hsM6-XsQ.js → trendarrow.taro-BHUetKSS.js} +6 -18
- package/dist/esm/tslib.es6-BZ8i9Q6l.js +47 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo1.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo2.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo3.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo4.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo5.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo6.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo7.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo8.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/h5/demo9.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo1.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo10.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo2.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo3.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo4.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo5.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo6.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo7.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo8.d.ts +3 -0
- package/dist/esm/types/src/packages/button/demos/taro/demo9.d.ts +3 -0
- package/dist/esm/types/src/packages/configprovider/configprovider.d.ts +1 -0
- package/dist/esm/types/src/packages/configprovider/configprovider.taro.d.ts +1 -0
- package/dist/esm/types/src/packages/configprovider/index.d.ts +2 -2
- package/dist/esm/types/src/packages/configprovider/index.taro.d.ts +2 -2
- package/dist/esm/types/src/packages/inputnumber/inputnumber.d.ts +15 -15
- package/dist/esm/types/src/packages/inputnumber/inputnumber.taro.d.ts +17 -17
- package/dist/esm/{uploader.taro-bRF02TR9.js → uploader.taro-CuaIVvya.js} +47 -99
- package/dist/esm/{use-custom-event-XvsODK8c.js → use-custom-event-DuP4onEm.js} +5 -5
- package/dist/esm/{use-props-value-vKr0R0AX.js → use-props-value-SH9krhkx.js} +2 -2
- package/dist/esm/{video.taro-csvHwS2v.js → video.taro-CEMVfhCS.js} +3 -5
- package/dist/esm/{virtuallist.taro-AeTVtFFa.js → virtuallist.taro-C5vZAyza.js} +7 -17
- package/dist/esm/{watermark.taro-nvSmcwu-.js → watermark.taro-BxM8VfXb.js} +5 -30
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/tr-TR.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.es.js +439 -497
- package/dist/nutui.react.umd.js +440 -498
- package/dist/packages/animate/animate.scss +0 -27
- package/dist/packages/audio/audio.scss +0 -5
- package/dist/packages/avatarcropper/avatarcropper.scss +0 -2
- package/dist/packages/badge/badge.scss +7 -0
- package/dist/packages/barrage/barrage.scss +22 -3
- package/dist/packages/button/button.scss +0 -1
- package/dist/packages/calendar/calendar.scss +4 -4
- package/dist/packages/calendarcard/calendarcard.scss +0 -1
- package/dist/packages/cascader/cascader.scss +0 -1
- package/dist/packages/checkbox/checkbox.scss +0 -2
- package/dist/packages/checkboxgroup/checkboxgroup.scss +1 -3
- package/dist/packages/col/col.scss +2 -2
- package/dist/packages/collapseitem/collapseitem.scss +2 -3
- package/dist/packages/dialog/dialog.scss +4 -0
- package/dist/packages/divider/divider.scss +1 -1
- package/dist/packages/fixednav/fixednav.scss +0 -2
- package/dist/packages/form/form.scss +24 -26
- package/dist/packages/formitem/formitem.scss +0 -1
- package/dist/packages/grid/grid.scss +1 -1
- package/dist/packages/griditem/griditem.scss +28 -26
- package/dist/packages/imagepreview/imagepreview.scss +0 -1
- package/dist/packages/indicator/indicator.scss +2 -3
- package/dist/packages/menu/menu.scss +0 -7
- package/dist/packages/menuitem/menuitem.scss +14 -10
- package/dist/packages/navbar/navbar.scss +3 -5
- package/dist/packages/noticebar/noticebar.scss +20 -0
- package/dist/packages/numberkeyboard/numberkeyboard.scss +25 -18
- package/dist/packages/pagination/pagination.scss +0 -2
- package/dist/packages/picker/picker.scss +9 -0
- package/dist/packages/popover/popover.scss +0 -4
- package/dist/packages/popup/popup.scss +3 -19
- package/dist/packages/price/price.scss +1 -0
- package/dist/packages/radio/radio.scss +0 -1
- package/dist/packages/radiogroup/radiogroup.scss +10 -1
- package/dist/packages/range/range.scss +127 -127
- package/dist/packages/rate/rate.scss +0 -1
- package/dist/packages/searchbar/searchbar.scss +3 -2
- package/dist/packages/shortpassword/shortpassword.scss +4 -0
- package/dist/packages/skeleton/skeleton.scss +13 -3
- package/dist/packages/space/space.scss +0 -1
- package/dist/packages/step/step.scss +21 -25
- package/dist/packages/swipe/swipe.scss +0 -15
- package/dist/packages/swiper/swiper.scss +0 -1
- package/dist/packages/switch/switch.scss +11 -0
- package/dist/packages/table/table.scss +4 -5
- package/dist/packages/tabs/tabs.scss +2 -4
- package/dist/packages/tag/tag.scss +0 -1
- package/dist/packages/textarea/textarea.scss +1 -6
- package/dist/packages/timeselect/timeselect.scss +1 -6
- package/dist/packages/tour/tour.scss +1 -5
- package/dist/packages/trendarrow/trendarrow.scss +0 -1
- package/dist/packages/uploader/uploader.scss +0 -1
- package/dist/packages/virtuallist/virtuallist.scss +12 -12
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables-jmapp.scss +4 -0
- package/dist/styles/variables.scss +11 -7
- package/dist/types/index.d.ts +98 -98
- package/dist/types/packages/actionsheet/actionsheet.d.ts +1 -1
- package/dist/types/packages/actionsheet/actionsheet.taro.d.ts +1 -1
- package/dist/types/packages/address/address.d.ts +1 -1
- package/dist/types/packages/address/address.taro.d.ts +1 -1
- package/dist/types/packages/address/customRender.d.ts +1 -1
- package/dist/types/packages/address/customRender.taro.d.ts +1 -1
- package/dist/types/packages/avatar/avatar.d.ts +1 -1
- package/dist/types/packages/avatar/avatar.taro.d.ts +1 -1
- package/dist/types/packages/button/demos/h5/demo1.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo2.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo3.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo4.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo5.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo6.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo7.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo8.d.ts +3 -0
- package/dist/types/packages/button/demos/h5/demo9.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo1.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo10.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo2.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo3.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo4.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo5.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo6.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo7.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo8.d.ts +3 -0
- package/dist/types/packages/button/demos/taro/demo9.d.ts +3 -0
- package/dist/types/packages/calendaritem/calendaritem.d.ts +1 -1
- package/dist/types/packages/calendaritem/calendaritem.taro.d.ts +1 -1
- package/dist/types/packages/cascader/cascader.d.ts +1 -1
- package/dist/types/packages/cascader/cascader.taro.d.ts +1 -1
- package/dist/types/packages/cell/cell.d.ts +1 -1
- package/dist/types/packages/cell/cell.taro.d.ts +1 -1
- package/dist/types/packages/checkbox/checkbox.d.ts +2 -2
- package/dist/types/packages/checkbox/checkbox.taro.d.ts +2 -2
- package/dist/types/packages/checkboxgroup/checkboxgroup.d.ts +2 -2
- package/dist/types/packages/checkboxgroup/checkboxgroup.taro.d.ts +2 -2
- package/dist/types/packages/configprovider/configprovider.d.ts +1 -0
- package/dist/types/packages/configprovider/configprovider.taro.d.ts +1 -0
- package/dist/types/packages/configprovider/index.d.ts +2 -2
- package/dist/types/packages/configprovider/index.taro.d.ts +2 -2
- package/dist/types/packages/datepicker/datepicker.d.ts +1 -1
- package/dist/types/packages/datepicker/datepicker.taro.d.ts +1 -1
- package/dist/types/packages/dialog/dialogwrap.d.ts +1 -1
- package/dist/types/packages/empty/empty.d.ts +1 -1
- package/dist/types/packages/empty/empty.taro.d.ts +15 -3
- package/dist/types/packages/fixednav/fixednav.d.ts +1 -1
- package/dist/types/packages/fixednav/fixednav.taro.d.ts +1 -1
- package/dist/types/packages/form/form.d.ts +1 -1
- package/dist/types/packages/form/form.taro.d.ts +1 -1
- package/dist/types/packages/form/index.d.ts +1 -1
- package/dist/types/packages/form/index.taro.d.ts +1 -1
- package/dist/types/packages/inputnumber/inputnumber.d.ts +15 -15
- package/dist/types/packages/inputnumber/inputnumber.taro.d.ts +33 -29
- package/dist/types/packages/menu/menu.d.ts +1 -1
- package/dist/types/packages/menu/menu.taro.d.ts +1 -1
- package/dist/types/packages/numberkeyboard/numberkeyboard.d.ts +1 -1
- package/dist/types/packages/numberkeyboard/numberkeyboard.taro.d.ts +1 -1
- package/dist/types/packages/nutui.react.build.d.ts +98 -98
- package/dist/types/packages/nutui.react.d.ts +98 -98
- package/dist/types/packages/nutui.react.taro.d.ts +98 -98
- package/dist/types/packages/picker/picker.d.ts +1 -1
- package/dist/types/packages/picker/picker.taro.d.ts +1 -1
- package/dist/types/packages/popover/popover.d.ts +1 -1
- package/dist/types/packages/popover/popover.taro.d.ts +1 -1
- package/dist/types/packages/popup/popup.d.ts +1 -1
- package/dist/types/packages/popup/popup.taro.d.ts +1 -1
- package/dist/types/packages/radio/radio.d.ts +2 -2
- package/dist/types/packages/radio/radio.taro.d.ts +2 -2
- package/dist/types/packages/shortpassword/shortpassword.d.ts +1 -1
- package/dist/types/packages/shortpassword/shortpassword.taro.d.ts +1 -1
- package/dist/types/packages/swiper/index.d.ts +1 -1
- package/dist/types/packages/swiper/index.taro.d.ts +1 -1
- package/dist/types/packages/tabs/tabs.d.ts +1 -1
- package/dist/types/packages/tabs/tabs.taro.d.ts +1 -1
- package/dist/types/packages/timedetail/timedetail.d.ts +1 -1
- package/dist/types/packages/timedetail/timedetail.taro.d.ts +1 -1
- package/dist/types/packages/tour/tour.d.ts +1 -1
- package/dist/types/packages/tour/tour.taro.d.ts +1 -1
- package/package.json +9 -5
- package/dist/esm/avatar.taro-7ltbzIdY.js +0 -109
- package/dist/esm/configprovider.taro-q5J2gQbi.js +0 -486
- package/dist/esm/formitem.taro-PPkTQGfW.js +0 -1435
- package/dist/esm/index-oitVOJp9.js +0 -661
- package/dist/esm/inputnumber.taro-7QptygT3.js +0 -197
- package/dist/esm/sidenavbaritem.taro-AxJNRAdi.js +0 -13
- package/dist/esm/steps.taro-PH0qWPla.js +0 -32
- package/dist/esm/tabbaritem.taro-t9C07OYX.js +0 -73
- /package/dist/esm/{UserContext-9BL0cq8w.js → UserContext-BlM0373q.js} +0 -0
- /package/dist/esm/{context-6mGEMLsx.js → context-4T-L2x0_.js} +0 -0
- /package/dist/esm/{context-9BL0cq8w.js → context-BlM0373q.js} +0 -0
- /package/dist/esm/{date-nxKOxj5-.js → date-D0pth0qC.js} +0 -0
- /package/dist/esm/{get-scroll-parent-uywvoQMl.js → get-scroll-parent-DB1VRg11.js} +0 -0
- /package/dist/esm/{index-YvHA__3D.js → index-DeNfBlua.js} +0 -0
- /package/dist/esm/{pad-zero-iY-0-oys.js → pad-zero-B2OUQfh7.js} +0 -0
- /package/dist/esm/{px-check-JiWLYN2v.js → px-check-D1Xbd9pj.js} +0 -0
- /package/dist/esm/{raf-UzmDvMUW.js → raf-zwv-SBjP.js} +0 -0
- /package/dist/esm/{safearea.taro-afu_mY7g.js → safearea.taro-BMQHr7tu.js} +0 -0
- /package/dist/esm/{typings-buMpDfSR.js → typings-DV9RBfhj.js} +0 -0
- /package/dist/esm/{use-force-update-0oEVD8Nr.js → use-force-update-CudFjCsy.js} +0 -0
- /package/dist/esm/{use-refs-IdrY0ww3.js → use-refs-BeEmziIR.js} +0 -0
- /package/dist/esm/{use-touch-BUFdkOSA.js → use-touch-OfEaR5qi.js} +0 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { _ as __rest } from "./tslib.es6-BZ8i9Q6l.js";
|
|
2
|
+
import React__default, { useState, useRef, useContext, useEffect } from "react";
|
|
3
|
+
import Taro, { getEnv } from "@tarojs/taro";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import { User } from "@nutui/icons-react-taro";
|
|
6
|
+
import { I as Image } from "./image.taro-BLz2WCva.js";
|
|
7
|
+
import { a as AvatarContext, A as AvatarGroup } from "./avatargroup.taro-bpT5kPbf.js";
|
|
8
|
+
import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
|
|
9
|
+
const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { size: "", shape: "round", icon: "", fit: "cover", background: "#eee", color: "#666", src: "", alt: "" });
|
|
10
|
+
const classPrefix = `nut-avatar`;
|
|
11
|
+
const Avatar = (props) => {
|
|
12
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
13
|
+
const _q = Object.assign(Object.assign({}, defaultProps), props), { children, size, shape, background, color, src, icon, fit, alt, className, style, onClick, onError } = _q, rest = __rest(_q, ["children", "size", "shape", "background", "color", "src", "icon", "fit", "alt", "className", "style", "onClick", "onError"]);
|
|
14
|
+
const [maxSum, setMaxSum] = useState(0);
|
|
15
|
+
const [showMax, setShowMax] = useState(false);
|
|
16
|
+
const [avatarIndex, setAvatarIndex] = useState(1);
|
|
17
|
+
const avatarRef = useRef(null);
|
|
18
|
+
const parent = useContext(AvatarContext);
|
|
19
|
+
const sizeValue = ["large", "normal", "small"];
|
|
20
|
+
const classes = classNames({
|
|
21
|
+
[`nut-avatar-${((_a = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _a === void 0 ? void 0 : _a.size) || size || "normal"}`]: true,
|
|
22
|
+
[`nut-avatar-${((_b = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _b === void 0 ? void 0 : _b.shape) || shape}`]: true
|
|
23
|
+
});
|
|
24
|
+
const cls = classNames(classPrefix, classes, className);
|
|
25
|
+
const styles = Object.assign({ width: sizeValue.indexOf(size) > -1 ? "" : `${size}px`, height: sizeValue.indexOf(size) > -1 ? "" : `${size}px`, backgroundColor: `${background}`, color, marginLeft: avatarIndex !== 1 && ((_c = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _c === void 0 ? void 0 : _c.gap) ? `${(_d = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _d === void 0 ? void 0 : _d.gap}px` : "", zIndex: ((_e = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _e === void 0 ? void 0 : _e.level) === "right" ? `${Math.abs(maxSum - avatarIndex)}` : "" }, style);
|
|
26
|
+
const maxStyles = {
|
|
27
|
+
backgroundColor: `${(_f = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _f === void 0 ? void 0 : _f.maxBackground}`,
|
|
28
|
+
color: `${(_g = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _g === void 0 ? void 0 : _g.maxColor}`
|
|
29
|
+
};
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
var _a2;
|
|
32
|
+
const avatarChildren = (_a2 = parent === null || parent === void 0 ? void 0 : parent.avatarGroupRef) === null || _a2 === void 0 ? void 0 : _a2.current.children;
|
|
33
|
+
if (avatarChildren) {
|
|
34
|
+
avatarLength(avatarChildren);
|
|
35
|
+
}
|
|
36
|
+
}, []);
|
|
37
|
+
const isAvatarInClassList = (element) => {
|
|
38
|
+
var _a2, _b2;
|
|
39
|
+
if (getEnv() === Taro.ENV_TYPE.WEB) {
|
|
40
|
+
return element.classList[0] === "nut-avatar" || element.classList.values().next().value === "nut-avatar";
|
|
41
|
+
}
|
|
42
|
+
return ((_a2 = element.classList) === null || _a2 === void 0 ? void 0 : _a2.tokenList[0]) === "nut-avatar" || ((_b2 = element.classList) === null || _b2 === void 0 ? void 0 : _b2.tokenList.values().next().value) === "nut-avatar";
|
|
43
|
+
};
|
|
44
|
+
const avatarLength = (children2) => {
|
|
45
|
+
var _a2, _b2, _c2;
|
|
46
|
+
for (let i = 0; i < children2.length; i++) {
|
|
47
|
+
if (children2[i] && children2[i].classList && isAvatarInClassList(children2[i])) {
|
|
48
|
+
children2[i].setAttribute("data-index", i + 1);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const index = (_b2 = (_a2 = avatarRef === null || avatarRef === void 0 ? void 0 : avatarRef.current) === null || _a2 === void 0 ? void 0 : _a2.dataset) === null || _b2 === void 0 ? void 0 : _b2.index;
|
|
52
|
+
const maxCount = (_c2 = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _c2 === void 0 ? void 0 : _c2.max;
|
|
53
|
+
setMaxSum(children2.length);
|
|
54
|
+
setAvatarIndex(index);
|
|
55
|
+
if (index === children2.length && index !== maxCount && children2.length > maxCount) {
|
|
56
|
+
setShowMax(true);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const errorEvent = () => {
|
|
60
|
+
if (props.onError) {
|
|
61
|
+
props.onError();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const clickAvatar = (e) => {
|
|
65
|
+
onClick && onClick(e);
|
|
66
|
+
};
|
|
67
|
+
return React__default.createElement(React__default.Fragment, null, (showMax || !((_h = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _h === void 0 ? void 0 : _h.max) || avatarIndex <= ((_j = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _j === void 0 ? void 0 : _j.max)) && React__default.createElement(
|
|
68
|
+
"div",
|
|
69
|
+
Object.assign({ className: cls }, rest, { style: !showMax ? styles : maxStyles, onClick: clickAvatar, ref: avatarRef }),
|
|
70
|
+
(!((_k = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _k === void 0 ? void 0 : _k.max) || avatarIndex <= ((_l = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _l === void 0 ? void 0 : _l.max)) && React__default.createElement(
|
|
71
|
+
React__default.Fragment,
|
|
72
|
+
null,
|
|
73
|
+
src && React__default.createElement(Image, { className: "avatar-img", src, style: { objectFit: fit }, onError: errorEvent }),
|
|
74
|
+
React__default.isValidElement(icon) ? React__default.cloneElement(icon, Object.assign(Object.assign({}, icon.props), { className: `${icon.props.className || ""} icon` })) : null,
|
|
75
|
+
children && React__default.createElement("span", { className: "text" }, children),
|
|
76
|
+
!src && !icon && !children && React__default.createElement(User, { className: "icon" })
|
|
77
|
+
),
|
|
78
|
+
showMax && React__default.createElement("div", { className: "text" }, ((_m = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _m === void 0 ? void 0 : _m.maxContent) ? (_o = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _o === void 0 ? void 0 : _o.maxContent : `+ ${avatarIndex - Number(((_p = parent === null || parent === void 0 ? void 0 : parent.propAvatarGroup) === null || _p === void 0 ? void 0 : _p.max) || 0)}`)
|
|
79
|
+
));
|
|
80
|
+
};
|
|
81
|
+
Avatar.defaultProps = defaultProps;
|
|
82
|
+
Avatar.displayName = "NutAvatar";
|
|
83
|
+
Avatar.Group = AvatarGroup;
|
|
84
|
+
export {
|
|
85
|
+
Avatar as A
|
|
86
|
+
};
|
|
@@ -1,33 +1,21 @@
|
|
|
1
|
+
import { _ as __rest, a as __awaiter } from "./tslib.es6-BZ8i9Q6l.js";
|
|
1
2
|
import React__default, { useState, useMemo, useEffect, useCallback } from "react";
|
|
2
3
|
import Taro, { useReady, createSelectorQuery } from "@tarojs/taro";
|
|
3
4
|
import classNames from "classnames";
|
|
4
5
|
import { Canvas } from "@tarojs/components";
|
|
5
|
-
import { B as Button } from "./button.taro-
|
|
6
|
-
import { C as ComponentDefaults } from "./typings-
|
|
7
|
-
import { u as useTouch } from "./use-touch-
|
|
8
|
-
import { p as preventDefault, c as clamp } from "./index-
|
|
9
|
-
const defaultProps = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
React__default.createElement(Button, { key: "reset" }, "重置"),
|
|
16
|
-
React__default.createElement(Button, { key: "rotate" }, "旋转"),
|
|
17
|
-
React__default.createElement(Button, { type: "success", key: "confirm" }, "确认")
|
|
18
|
-
],
|
|
19
|
-
toolbarPosition: "bottom",
|
|
20
|
-
editText: "编辑",
|
|
21
|
-
sizeType: ["original", "compressed"],
|
|
22
|
-
sourceType: ["album", "camera"],
|
|
23
|
-
shape: "square"
|
|
24
|
-
};
|
|
6
|
+
import { B as Button } from "./button.taro-OKGsDVW7.js";
|
|
7
|
+
import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
|
|
8
|
+
import { u as useTouch } from "./use-touch-OfEaR5qi.js";
|
|
9
|
+
import { p as preventDefault, c as clamp } from "./index-DeNfBlua.js";
|
|
10
|
+
const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { maxZoom: 3, space: 10, toolbar: [
|
|
11
|
+
React__default.createElement(Button, { type: "danger", key: "cancel" }, "取消"),
|
|
12
|
+
React__default.createElement(Button, { key: "reset" }, "重置"),
|
|
13
|
+
React__default.createElement(Button, { key: "rotate" }, "旋转"),
|
|
14
|
+
React__default.createElement(Button, { type: "success", key: "confirm" }, "确认")
|
|
15
|
+
], toolbarPosition: "bottom", editText: "编辑", sizeType: ["original", "compressed"], sourceType: ["album", "camera"], shape: "square" });
|
|
25
16
|
const classPrefix = `nut-avatar-cropper`;
|
|
26
17
|
const AvatarCropper = (props) => {
|
|
27
|
-
const { children, toolbar, maxZoom, space, toolbarPosition, editText, sizeType, sourceType, shape, className, style, onConfirm, onCancel,
|
|
28
|
-
...defaultProps,
|
|
29
|
-
...props
|
|
30
|
-
};
|
|
18
|
+
const _a = Object.assign(Object.assign({}, defaultProps), props), { children, toolbar, maxZoom, space, toolbarPosition, editText, sizeType, sourceType, shape, className, style, onConfirm, onCancel } = _a, rest = __rest(_a, ["children", "toolbar", "maxZoom", "space", "toolbarPosition", "editText", "sizeType", "sourceType", "shape", "className", "style", "onConfirm", "onCancel"]);
|
|
31
19
|
const cls = classNames(classPrefix, "taro", className, shape === "round" && "round");
|
|
32
20
|
const toolbarPositionCls = classNames(`${classPrefix}-popup-toolbar`, toolbarPosition);
|
|
33
21
|
const [visible, setVisible] = useState(false);
|
|
@@ -58,7 +46,7 @@ const AvatarCropper = (props) => {
|
|
|
58
46
|
height: 0
|
|
59
47
|
// 要使用的图像的高度
|
|
60
48
|
};
|
|
61
|
-
const [drawImage, setDrawImg] = useState({
|
|
49
|
+
const [drawImage, setDrawImg] = useState(Object.assign({}, defDrawImage));
|
|
62
50
|
const [canvasAll, setCanvasAll] = useState({
|
|
63
51
|
canvasId: `canvas-${Date.now()}`,
|
|
64
52
|
cropperCanvas: null,
|
|
@@ -70,15 +58,12 @@ const AvatarCropper = (props) => {
|
|
|
70
58
|
createSelectorQuery().select(`#${canvasId}`).node(({ node: canvas }) => {
|
|
71
59
|
canvas.width = state.displayWidth;
|
|
72
60
|
canvas.height = state.displayHeight;
|
|
73
|
-
setCanvasAll({
|
|
61
|
+
setCanvasAll(Object.assign(Object.assign({}, canvasAll), { cropperCanvas: canvas }));
|
|
74
62
|
}).exec();
|
|
75
63
|
}
|
|
76
64
|
});
|
|
77
65
|
useEffect(() => {
|
|
78
|
-
setCanvasAll({
|
|
79
|
-
...canvasAll,
|
|
80
|
-
cropperCanvasContext: Taro.createCanvasContext(canvasAll.canvasId)
|
|
81
|
-
});
|
|
66
|
+
setCanvasAll(Object.assign(Object.assign({}, canvasAll), { cropperCanvasContext: Taro.createCanvasContext(canvasAll.canvasId) }));
|
|
82
67
|
}, []);
|
|
83
68
|
const touch = useTouch();
|
|
84
69
|
const highlightStyle = useMemo(() => {
|
|
@@ -145,8 +130,8 @@ const AvatarCropper = (props) => {
|
|
|
145
130
|
const webDraw = useCallback(() => {
|
|
146
131
|
const canvasDom = document.getElementById(canvasAll.canvasId);
|
|
147
132
|
let canvas = canvasDom;
|
|
148
|
-
if ((canvasDom
|
|
149
|
-
canvas = canvasDom
|
|
133
|
+
if ((canvasDom === null || canvasDom === void 0 ? void 0 : canvasDom.tagName) !== "CANVAS") {
|
|
134
|
+
canvas = canvasDom === null || canvasDom === void 0 ? void 0 : canvasDom.getElementsByTagName("canvas")[0];
|
|
150
135
|
}
|
|
151
136
|
canvas.width = state.displayWidth;
|
|
152
137
|
canvas.height = state.displayHeight;
|
|
@@ -192,23 +177,23 @@ const AvatarCropper = (props) => {
|
|
|
192
177
|
}, [drawImage, state.scale, state.angle, state.moveX, state.moveY]);
|
|
193
178
|
useEffect(() => {
|
|
194
179
|
if (Math.abs(state.moveX) > maxMoveX) {
|
|
195
|
-
setState({
|
|
180
|
+
setState(Object.assign(Object.assign({}, state), { moveX: maxMoveX }));
|
|
196
181
|
}
|
|
197
182
|
if (Math.abs(state.moveY) > maxMoveY) {
|
|
198
|
-
setState({
|
|
183
|
+
setState(Object.assign(Object.assign({}, state), { moveY: maxMoveY }));
|
|
199
184
|
}
|
|
200
185
|
draw();
|
|
201
186
|
}, [state, maxMoveX, maxMoveY, draw]);
|
|
202
|
-
const setDrawImgInfo =
|
|
187
|
+
const setDrawImgInfo = (image) => __awaiter(void 0, void 0, void 0, function* () {
|
|
203
188
|
const { displayWidth, cropperWidth } = state;
|
|
204
|
-
const copyDrawImg = {
|
|
189
|
+
const copyDrawImg = Object.assign({}, defDrawImage);
|
|
205
190
|
const { width: imgWidth, height: imgHeight } = image;
|
|
206
191
|
copyDrawImg.src = image.path;
|
|
207
192
|
if (Taro.getEnv() === "WEB") {
|
|
208
|
-
copyDrawImg.src =
|
|
193
|
+
copyDrawImg.src = yield dataURLToImage(image.path);
|
|
209
194
|
}
|
|
210
195
|
if (showAlipayCanvas2D) {
|
|
211
|
-
copyDrawImg.src =
|
|
196
|
+
copyDrawImg.src = yield dataURLToCanvasImage(canvasAll.cropperCanvas, image.path);
|
|
212
197
|
}
|
|
213
198
|
const isPortrait = imgHeight > imgWidth;
|
|
214
199
|
const rate = isPortrait ? imgWidth / imgHeight : imgHeight / imgWidth;
|
|
@@ -218,9 +203,9 @@ const AvatarCropper = (props) => {
|
|
|
218
203
|
copyDrawImg.y = -copyDrawImg.height / 2;
|
|
219
204
|
setDrawImg(copyDrawImg);
|
|
220
205
|
const scale = cropperWidth / (isPortrait ? copyDrawImg.width : copyDrawImg.height);
|
|
221
|
-
setState({
|
|
206
|
+
setState(Object.assign(Object.assign({}, state), { defScale: scale }));
|
|
222
207
|
resetScale(scale);
|
|
223
|
-
};
|
|
208
|
+
});
|
|
224
209
|
const chooseImage = () => {
|
|
225
210
|
Taro.chooseImage({
|
|
226
211
|
count: 1,
|
|
@@ -233,31 +218,24 @@ const AvatarCropper = (props) => {
|
|
|
233
218
|
}
|
|
234
219
|
});
|
|
235
220
|
};
|
|
236
|
-
const imageChange =
|
|
221
|
+
const imageChange = (file) => __awaiter(void 0, void 0, void 0, function* () {
|
|
237
222
|
Taro.getImageInfo({
|
|
238
223
|
src: file.path
|
|
239
224
|
}).then((res) => {
|
|
240
225
|
setVisible(true);
|
|
241
226
|
setDrawImgInfo(res);
|
|
242
227
|
});
|
|
243
|
-
};
|
|
228
|
+
});
|
|
244
229
|
const resetScale = (scale) => {
|
|
245
|
-
setState({
|
|
246
|
-
...state,
|
|
247
|
-
moveX: 0,
|
|
248
|
-
moveY: 0,
|
|
249
|
-
angle: 0,
|
|
250
|
-
scale: scale || state.defScale,
|
|
251
|
-
defScale: scale || state.defScale
|
|
252
|
-
});
|
|
230
|
+
setState(Object.assign(Object.assign({}, state), { moveX: 0, moveY: 0, angle: 0, scale: scale || state.defScale, defScale: scale || state.defScale }));
|
|
253
231
|
};
|
|
254
232
|
const setScale = (scale) => {
|
|
255
233
|
scale = clamp(scale, 0.3, +maxZoom + 1);
|
|
256
234
|
if (scale !== state.scale) {
|
|
257
|
-
setState({
|
|
235
|
+
setState(Object.assign(Object.assign({}, state), { scale }));
|
|
258
236
|
}
|
|
259
237
|
};
|
|
260
|
-
const getDistance = (touches) => Math.sqrt((touches[0].clientX - touches[1].clientX
|
|
238
|
+
const getDistance = (touches) => Math.sqrt(Math.pow(touches[0].clientX - touches[1].clientX, 2) + Math.pow(touches[0].clientY - touches[1].clientY, 2));
|
|
261
239
|
const [startMove, setStartMove] = useState({
|
|
262
240
|
startMoveX: 0,
|
|
263
241
|
startMoveY: 0,
|
|
@@ -269,20 +247,12 @@ const AvatarCropper = (props) => {
|
|
|
269
247
|
const { touches } = event;
|
|
270
248
|
const { offsetX } = touch;
|
|
271
249
|
touch.start(event);
|
|
272
|
-
const fingerNum = touches
|
|
273
|
-
setStartMove({
|
|
274
|
-
...startMove,
|
|
275
|
-
startMoveX: state.moveX,
|
|
276
|
-
startMoveY: state.moveY
|
|
277
|
-
});
|
|
250
|
+
const fingerNum = touches === null || touches === void 0 ? void 0 : touches.length;
|
|
251
|
+
setStartMove(Object.assign(Object.assign({}, startMove), { startMoveX: state.moveX, startMoveY: state.moveY }));
|
|
278
252
|
setMoving(fingerNum === 1);
|
|
279
253
|
setZooming(fingerNum === 2 && !offsetX.current);
|
|
280
254
|
if (fingerNum === 2 && !offsetX.current) {
|
|
281
|
-
setStartMove({
|
|
282
|
-
...startMove,
|
|
283
|
-
startScale: state.scale,
|
|
284
|
-
startDistance: getDistance(event.touches)
|
|
285
|
-
});
|
|
255
|
+
setStartMove(Object.assign(Object.assign({}, startMove), { startScale: state.scale, startDistance: getDistance(event.touches) }));
|
|
286
256
|
}
|
|
287
257
|
};
|
|
288
258
|
const onTouchMove = (event) => {
|
|
@@ -295,11 +265,7 @@ const AvatarCropper = (props) => {
|
|
|
295
265
|
const { deltaX, deltaY } = touch;
|
|
296
266
|
const moveX = deltaX.current * state.scale + startMoveX;
|
|
297
267
|
const moveY = deltaY.current * state.scale + startMoveY;
|
|
298
|
-
setState({
|
|
299
|
-
...state,
|
|
300
|
-
moveX: clamp(moveX, -maxMoveX, maxMoveX),
|
|
301
|
-
moveY: clamp(moveY, -maxMoveY, maxMoveY)
|
|
302
|
-
});
|
|
268
|
+
setState(Object.assign(Object.assign({}, state), { moveX: clamp(moveX, -maxMoveX, maxMoveX), moveY: clamp(moveY, -maxMoveY, maxMoveY) }));
|
|
303
269
|
}
|
|
304
270
|
if (zooming && touches.length === 2) {
|
|
305
271
|
const distance = getDistance(touches);
|
|
@@ -313,25 +279,16 @@ const AvatarCropper = (props) => {
|
|
|
313
279
|
stopPropagation = !(moving && startMoveX === state.moveX && startMoveY === state.moveY);
|
|
314
280
|
if (!event.touches.length) {
|
|
315
281
|
if (zooming) {
|
|
316
|
-
setState({
|
|
317
|
-
...state,
|
|
318
|
-
moveX: clamp(state.moveX, -maxMoveX, maxMoveX),
|
|
319
|
-
moveY: clamp(state.moveY, -maxMoveY, maxMoveY)
|
|
320
|
-
});
|
|
282
|
+
setState(Object.assign(Object.assign({}, state), { moveX: clamp(state.moveX, -maxMoveX, maxMoveX), moveY: clamp(state.moveY, -maxMoveY, maxMoveY) }));
|
|
321
283
|
setZooming(false);
|
|
322
284
|
}
|
|
323
285
|
setMoving(false);
|
|
324
|
-
setStartMove({
|
|
325
|
-
...startMove,
|
|
326
|
-
startMoveX: 0,
|
|
327
|
-
startMoveY: 0,
|
|
328
|
-
startScale: state.defScale
|
|
329
|
-
});
|
|
286
|
+
setStartMove(Object.assign(Object.assign({}, startMove), { startMoveX: 0, startMoveY: 0, startScale: state.defScale }));
|
|
330
287
|
if (state.scale < state.defScale) {
|
|
331
288
|
resetScale();
|
|
332
289
|
}
|
|
333
290
|
if (state.scale > maxZoom) {
|
|
334
|
-
setState({
|
|
291
|
+
setState(Object.assign(Object.assign({}, state), { scale: +maxZoom }));
|
|
335
292
|
}
|
|
336
293
|
}
|
|
337
294
|
}
|
|
@@ -339,14 +296,14 @@ const AvatarCropper = (props) => {
|
|
|
339
296
|
touch.reset();
|
|
340
297
|
};
|
|
341
298
|
const reset = () => {
|
|
342
|
-
setState({
|
|
299
|
+
setState(Object.assign(Object.assign({}, state), { angle: 0 }));
|
|
343
300
|
};
|
|
344
301
|
const rotate = () => {
|
|
345
302
|
if (state.angle === 270) {
|
|
346
|
-
setState({
|
|
303
|
+
setState(Object.assign(Object.assign({}, state), { angle: 0 }));
|
|
347
304
|
return;
|
|
348
305
|
}
|
|
349
|
-
setState({
|
|
306
|
+
setState(Object.assign(Object.assign({}, state), { angle: state.angle + 90 }));
|
|
350
307
|
};
|
|
351
308
|
const cancel = (isEmit = true) => {
|
|
352
309
|
setVisible(false);
|
|
@@ -357,8 +314,8 @@ const AvatarCropper = (props) => {
|
|
|
357
314
|
const { cropperWidth, displayHeight } = state;
|
|
358
315
|
const canvasDom = document.getElementById(canvasAll.canvasId);
|
|
359
316
|
let canvas = canvasDom;
|
|
360
|
-
if ((canvasDom
|
|
361
|
-
canvas = canvasDom
|
|
317
|
+
if ((canvasDom === null || canvasDom === void 0 ? void 0 : canvasDom.tagName) !== "CANVAS") {
|
|
318
|
+
canvas = canvasDom === null || canvasDom === void 0 ? void 0 : canvasDom.getElementsByTagName("canvas")[0];
|
|
362
319
|
}
|
|
363
320
|
const width = cropperWidth;
|
|
364
321
|
const height = cropperWidth;
|
|
@@ -382,11 +339,11 @@ const AvatarCropper = (props) => {
|
|
|
382
339
|
height: cropperWidth,
|
|
383
340
|
destWidth: cropperWidth,
|
|
384
341
|
destHeight: cropperWidth,
|
|
385
|
-
success:
|
|
342
|
+
success: (res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
386
343
|
const filePath = res.tempFilePath;
|
|
387
344
|
onConfirm && onConfirm(filePath);
|
|
388
345
|
cancel(false);
|
|
389
|
-
}
|
|
346
|
+
})
|
|
390
347
|
});
|
|
391
348
|
};
|
|
392
349
|
const confirm = () => {
|
|
@@ -408,11 +365,11 @@ const AvatarCropper = (props) => {
|
|
|
408
365
|
height: cropperWidth,
|
|
409
366
|
destWidth: cropperWidth * systemInfo.pixelRatio,
|
|
410
367
|
destHeight: cropperWidth * systemInfo.pixelRatio,
|
|
411
|
-
success:
|
|
368
|
+
success: (res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
412
369
|
const filePath = res.tempFilePath;
|
|
413
370
|
onConfirm && onConfirm(filePath);
|
|
414
371
|
cancel(false);
|
|
415
|
-
}
|
|
372
|
+
})
|
|
416
373
|
});
|
|
417
374
|
};
|
|
418
375
|
const ToolBar = () => {
|
|
@@ -450,7 +407,7 @@ const AvatarCropper = (props) => {
|
|
|
450
407
|
null,
|
|
451
408
|
React__default.createElement(
|
|
452
409
|
"div",
|
|
453
|
-
{ className: cls,
|
|
410
|
+
Object.assign({ className: cls }, rest, { style }),
|
|
454
411
|
children,
|
|
455
412
|
React__default.createElement("div", { className: "nut-avatar-cropper-edit-text", onClick: chooseImage }, editText)
|
|
456
413
|
),
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import React__default, { createContext, useRef } from "react";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
-
import { C as ComponentDefaults } from "./typings-
|
|
3
|
+
import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
|
|
4
4
|
const AvatarContext = createContext({});
|
|
5
|
-
const defaultProps = {
|
|
6
|
-
...ComponentDefaults,
|
|
7
|
-
maxContent: "",
|
|
8
|
-
max: "",
|
|
9
|
-
maxBackground: "#eee",
|
|
10
|
-
maxColor: "#666",
|
|
11
|
-
gap: "-8",
|
|
12
|
-
level: "left"
|
|
13
|
-
};
|
|
5
|
+
const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { maxContent: "", max: "", maxBackground: "#eee", maxColor: "#666", gap: "-8", level: "left" });
|
|
14
6
|
const classPrefix = `nut-avatar-group`;
|
|
15
7
|
const AvatarGroup = (props) => {
|
|
16
|
-
const propAvatarGroup = {
|
|
8
|
+
const propAvatarGroup = Object.assign(Object.assign({}, defaultProps), props);
|
|
17
9
|
const { className, style, children } = propAvatarGroup;
|
|
18
10
|
const avatarGroupRef = useRef(null);
|
|
19
11
|
const cls = classNames(classPrefix, className);
|
|
@@ -2,18 +2,10 @@ import React__default, { useState } from "react";
|
|
|
2
2
|
import { usePageScroll, pageScrollTo } from "@tarojs/taro";
|
|
3
3
|
import { Top } from "@nutui/icons-react-taro";
|
|
4
4
|
import classNames from "classnames";
|
|
5
|
-
import { C as ComponentDefaults } from "./typings-
|
|
6
|
-
const defaultProps = {
|
|
7
|
-
...ComponentDefaults,
|
|
8
|
-
threshold: 200,
|
|
9
|
-
zIndex: 900,
|
|
10
|
-
duration: 1e3
|
|
11
|
-
};
|
|
5
|
+
import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
|
|
6
|
+
const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { threshold: 200, zIndex: 900, duration: 1e3 });
|
|
12
7
|
const BackTop = (props) => {
|
|
13
|
-
const { children, threshold, zIndex, className, duration, style, onClick } = {
|
|
14
|
-
...defaultProps,
|
|
15
|
-
...props
|
|
16
|
-
};
|
|
8
|
+
const { children, threshold, zIndex, className, duration, style, onClick } = Object.assign(Object.assign({}, defaultProps), props);
|
|
17
9
|
const classPrefix = "nut-backtop";
|
|
18
10
|
const [backTop, SetBackTop] = useState(false);
|
|
19
11
|
usePageScroll((res) => {
|
|
@@ -27,10 +19,7 @@ const BackTop = (props) => {
|
|
|
27
19
|
duration: duration > 0 ? duration : 0
|
|
28
20
|
});
|
|
29
21
|
};
|
|
30
|
-
const styles = style ? {
|
|
31
|
-
zIndex,
|
|
32
|
-
...style
|
|
33
|
-
} : {
|
|
22
|
+
const styles = Object.keys(style || {}).length !== 0 ? Object.assign({ zIndex }, style) : {
|
|
34
23
|
right: "10px",
|
|
35
24
|
bottom: "20px",
|
|
36
25
|
zIndex
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
import React__default from "react";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
-
import { C as ComponentDefaults } from "./typings-
|
|
4
|
-
const defaultProps = {
|
|
5
|
-
...ComponentDefaults,
|
|
6
|
-
value: "",
|
|
7
|
-
dot: false,
|
|
8
|
-
max: 99,
|
|
9
|
-
top: "4",
|
|
10
|
-
right: "8",
|
|
11
|
-
color: ""
|
|
12
|
-
};
|
|
3
|
+
import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
|
|
4
|
+
const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { value: "", dot: false, max: 99, top: "4", right: "8", color: "" });
|
|
13
5
|
const Badge = (props) => {
|
|
14
6
|
var _a;
|
|
15
|
-
const { className, style, value, max, children, dot, top, right, color } = {
|
|
16
|
-
...defaultProps,
|
|
17
|
-
...props
|
|
18
|
-
};
|
|
7
|
+
const { className, style, value, max, children, dot, top, right, color } = Object.assign(Object.assign({}, defaultProps), props);
|
|
19
8
|
const classPrefix = "nut-badge";
|
|
20
9
|
const classes = classNames(classPrefix, className);
|
|
21
10
|
function content() {
|
|
@@ -39,7 +28,7 @@ const Badge = (props) => {
|
|
|
39
28
|
return value;
|
|
40
29
|
}
|
|
41
30
|
const contentClasses = classNames({ [`${classPrefix}-dot`]: dot }, `${classPrefix}-content`, { [`${classPrefix}-sup`]: isNumber() || isString() || dot }, {
|
|
42
|
-
[`${classPrefix}-one`]: typeof content() === "string" && ((_a = `${content()}`)
|
|
31
|
+
[`${classPrefix}-one`]: typeof content() === "string" && ((_a = `${content()}`) === null || _a === void 0 ? void 0 : _a.length) === 1
|
|
43
32
|
});
|
|
44
33
|
const getStyle = () => {
|
|
45
34
|
const style2 = {};
|
|
@@ -1,23 +1,13 @@
|
|
|
1
|
+
import { _ as __rest, a as __awaiter } from "./tslib.es6-BZ8i9Q6l.js";
|
|
1
2
|
import React__default, { useRef, useImperativeHandle, useEffect } from "react";
|
|
2
3
|
import classNames from "classnames";
|
|
3
4
|
import { View } from "@tarojs/components";
|
|
4
|
-
import { C as ComponentDefaults } from "./typings-
|
|
5
|
-
import { g as getRectByTaro } from "./get-rect-by-taro-
|
|
6
|
-
const defaultProps = {
|
|
7
|
-
...ComponentDefaults,
|
|
8
|
-
list: [],
|
|
9
|
-
interval: 500,
|
|
10
|
-
loop: true,
|
|
11
|
-
duration: 3e3,
|
|
12
|
-
rows: 3,
|
|
13
|
-
gapY: 10
|
|
14
|
-
};
|
|
5
|
+
import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
|
|
6
|
+
import { g as getRectByTaro } from "./get-rect-by-taro-CSN0TGnD.js";
|
|
7
|
+
const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { list: [], interval: 500, loop: true, duration: 3e3, rows: 3, gapY: 10 });
|
|
15
8
|
const classPrefix = `nut-barrage`;
|
|
16
9
|
const InternalBarrage = (props, ref) => {
|
|
17
|
-
const { className, interval, loop, list, duration, rows, gapY,
|
|
18
|
-
...defaultProps,
|
|
19
|
-
...props
|
|
20
|
-
};
|
|
10
|
+
const _a = Object.assign(Object.assign({}, defaultProps), props), { className, interval, loop, list, duration, rows, gapY } = _a, restProps = __rest(_a, ["className", "interval", "loop", "list", "duration", "rows", "gapY"]);
|
|
21
11
|
const barrageBody = useRef(null);
|
|
22
12
|
const barrageContainer = useRef(null);
|
|
23
13
|
const barrageCWidth = useRef(0);
|
|
@@ -36,23 +26,23 @@ const InternalBarrage = (props, ref) => {
|
|
|
36
26
|
}
|
|
37
27
|
}
|
|
38
28
|
}));
|
|
39
|
-
const getNodeWidth =
|
|
29
|
+
const getNodeWidth = (node, type = "width") => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
30
|
if (node) {
|
|
41
|
-
const refe =
|
|
31
|
+
const refe = yield getRectByTaro(node);
|
|
42
32
|
return Math.ceil(type === "height" ? refe.height : refe.width);
|
|
43
33
|
}
|
|
44
34
|
return 0;
|
|
45
|
-
};
|
|
35
|
+
});
|
|
46
36
|
useEffect(() => {
|
|
47
|
-
const init =
|
|
37
|
+
const init = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
38
|
if (barrageBody.current) {
|
|
49
|
-
barrageCWidth.current =
|
|
39
|
+
barrageCWidth.current = yield getNodeWidth(barrageBody.current);
|
|
50
40
|
}
|
|
51
|
-
};
|
|
41
|
+
});
|
|
52
42
|
init();
|
|
53
43
|
setTimeout(() => {
|
|
54
|
-
var
|
|
55
|
-
(
|
|
44
|
+
var _a2;
|
|
45
|
+
(_a2 = barrageBody.current) === null || _a2 === void 0 ? void 0 : _a2.style.setProperty("--move-distance", `-${barrageCWidth.current}px`);
|
|
56
46
|
index.current = 0;
|
|
57
47
|
run();
|
|
58
48
|
}, 300);
|
|
@@ -72,7 +62,7 @@ const InternalBarrage = (props, ref) => {
|
|
|
72
62
|
play();
|
|
73
63
|
}, intervalCache);
|
|
74
64
|
};
|
|
75
|
-
const play =
|
|
65
|
+
const play = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
76
66
|
if (!loop && index.current >= list.length) {
|
|
77
67
|
return;
|
|
78
68
|
}
|
|
@@ -87,8 +77,8 @@ const InternalBarrage = (props, ref) => {
|
|
|
87
77
|
el.classList.add("barrage-item");
|
|
88
78
|
barrageContainer.current.appendChild(el);
|
|
89
79
|
try {
|
|
90
|
-
const width =
|
|
91
|
-
const height =
|
|
80
|
+
const width = yield getNodeWidth(el);
|
|
81
|
+
const height = yield getNodeWidth(el, "height");
|
|
92
82
|
el.classList.add("move");
|
|
93
83
|
const elScrollDuration = width / barrageCWidth.current * duration;
|
|
94
84
|
times.current[currentIndex] = Math.ceil(elScrollDuration);
|
|
@@ -103,10 +93,10 @@ const InternalBarrage = (props, ref) => {
|
|
|
103
93
|
});
|
|
104
94
|
index.current++;
|
|
105
95
|
run();
|
|
106
|
-
};
|
|
96
|
+
});
|
|
107
97
|
return React__default.createElement(
|
|
108
98
|
View,
|
|
109
|
-
{ className: classes, ref: barrageBody,
|
|
99
|
+
Object.assign({ className: classes, ref: barrageBody }, restProps),
|
|
110
100
|
React__default.createElement(View, { ref: barrageContainer, className: "bContainer" })
|
|
111
101
|
);
|
|
112
102
|
};
|
|
@@ -1,36 +1,21 @@
|
|
|
1
|
+
import { _ as __rest } from "./tslib.es6-BZ8i9Q6l.js";
|
|
1
2
|
import React__default, { useCallback } from "react";
|
|
2
3
|
import classNames from "classnames";
|
|
3
4
|
import { Loading } from "@nutui/icons-react-taro";
|
|
4
5
|
import { getEnv } from "@tarojs/taro";
|
|
5
|
-
import { C as ComponentDefaults } from "./typings-
|
|
6
|
+
import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
|
|
6
7
|
const prefixCls = "nut-button";
|
|
7
|
-
const defaultProps = {
|
|
8
|
-
|
|
9
|
-
color: "",
|
|
10
|
-
type: "default",
|
|
11
|
-
size: "normal",
|
|
12
|
-
shape: "round",
|
|
13
|
-
fill: "outline",
|
|
14
|
-
loading: false,
|
|
15
|
-
disabled: false,
|
|
16
|
-
block: false,
|
|
17
|
-
icon: null,
|
|
18
|
-
rightIcon: null,
|
|
19
|
-
onClick: (e) => {
|
|
20
|
-
}
|
|
21
|
-
};
|
|
8
|
+
const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { color: "", type: "default", size: "normal", shape: "round", fill: "outline", loading: false, disabled: false, block: false, icon: null, rightIcon: null, onClick: (e) => {
|
|
9
|
+
} });
|
|
22
10
|
const Button = React__default.forwardRef((props, ref) => {
|
|
23
|
-
const { color, shape, fill, loading, disabled, type, size, block, icon, rightIcon, children, className, style, onClick,
|
|
24
|
-
...defaultProps,
|
|
25
|
-
...props
|
|
26
|
-
};
|
|
11
|
+
const _a = Object.assign(Object.assign({}, defaultProps), props), { color, shape, fill, loading, disabled, type, size, block, icon, rightIcon, children, className, style, onClick } = _a, rest = __rest(_a, ["color", "shape", "fill", "loading", "disabled", "type", "size", "block", "icon", "rightIcon", "children", "className", "style", "onClick"]);
|
|
27
12
|
const getStyle = useCallback(() => {
|
|
28
13
|
const style2 = {};
|
|
29
14
|
if (props.color) {
|
|
30
15
|
if (props.fill && (props.fill === "outline" || props.fill === "dashed")) {
|
|
31
16
|
style2.color = color;
|
|
32
17
|
style2.background = "#fff";
|
|
33
|
-
if (!(color
|
|
18
|
+
if (!(color === null || color === void 0 ? void 0 : color.includes("gradient"))) {
|
|
34
19
|
style2.borderColor = color;
|
|
35
20
|
}
|
|
36
21
|
} else {
|
|
@@ -54,13 +39,13 @@ const Button = React__default.forwardRef((props, ref) => {
|
|
|
54
39
|
// eslint-disable-next-line react/button-has-type
|
|
55
40
|
React__default.createElement(
|
|
56
41
|
"button",
|
|
57
|
-
{
|
|
42
|
+
Object.assign({}, rest, { ref, className: classNames(prefixCls, `${prefixCls}-${type}`, props.fill ? `${prefixCls}-${fill}` : null, children ? "" : `${prefixCls}-icononly`, {
|
|
58
43
|
[`${prefixCls}-${size}`]: size,
|
|
59
44
|
[`${prefixCls}-${shape}`]: shape,
|
|
60
45
|
[`${prefixCls}-block`]: block,
|
|
61
46
|
[`${prefixCls}-disabled`]: disabled,
|
|
62
47
|
[`${prefixCls}-loading`]: loading
|
|
63
|
-
}, className), style: {
|
|
48
|
+
}, className), style: Object.assign(Object.assign({}, getStyle()), style), onClick: (e) => handleClick(e) }),
|
|
64
49
|
React__default.createElement(
|
|
65
50
|
"div",
|
|
66
51
|
{ className: "nut-button-wrap" },
|