@nutui/nutui-react-taro 2.0.0-alpha.0 → 2.0.0-alpha.10
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 +137 -638
- package/dist/esm/ActionSheet.js +15 -16
- package/dist/esm/Address.js +19 -22
- package/dist/esm/Animate.js +7 -9
- package/dist/esm/AnimatingNumbers.js +8 -9
- package/dist/esm/Audio.js +18 -20
- package/dist/esm/Avatar.js +11 -12
- package/dist/esm/AvatarGroup.js +8 -13
- package/dist/esm/BackTop.js +9 -10
- package/dist/esm/Badge.js +7 -10
- package/dist/esm/Barrage.js +9 -10
- package/dist/esm/Button.js +8 -9
- package/dist/esm/Calendar.js +18 -21
- package/dist/esm/CalendarItem.js +11 -14
- package/dist/esm/Card.js +12 -13
- package/dist/esm/Cascader.js +16 -18
- package/dist/esm/Cell.js +7 -8
- package/dist/esm/CellGroup.js +7 -8
- package/dist/esm/Checkbox.js +9 -10
- package/dist/esm/CheckboxGroup.js +9 -10
- package/dist/esm/CircleProgress.js +8 -10
- package/dist/esm/Col.js +8 -8
- package/dist/esm/Collapse.js +8 -9
- package/dist/esm/CollapseItem.js +7 -8
- package/dist/esm/ConfigProvider.js +9 -9
- package/dist/esm/CountDown.js +8 -11
- package/dist/esm/DatePicker.js +20 -24
- package/dist/esm/Dialog.js +13 -15
- package/dist/esm/Divider.js +7 -7
- package/dist/esm/Drag.js +7 -9
- package/dist/esm/Elevator.js +9 -10
- package/dist/esm/Ellipsis.js +9 -11
- package/dist/esm/Empty.js +7 -11
- package/dist/esm/FixedNav.js +11 -14
- package/dist/esm/Form.js +10 -11
- package/dist/esm/FormItem.js +8 -9
- package/dist/esm/Grid.js +8 -11
- package/dist/esm/GridItem.js +7 -10
- package/dist/esm/Image.js +7 -10
- package/dist/esm/ImagePreview.js +18 -20
- package/dist/esm/Indicator.js +6 -7
- package/dist/esm/Infiniteloading.js +12 -15
- package/dist/esm/Input.js +11 -11
- package/dist/esm/InputNumber.js +9 -10
- package/dist/esm/Layout.js +5 -6
- package/dist/esm/Menu.js +8 -9
- package/dist/esm/MenuItem.js +13 -15
- package/dist/esm/NavBar.js +7 -11
- package/dist/esm/NoticeBar.js +9 -12
- package/dist/esm/Notify.js +8 -10
- package/dist/esm/NumberKeyboard.js +14 -19
- package/dist/esm/Overlay.js +8 -9
- package/dist/esm/Pagination.js +9 -12
- package/dist/esm/Picker.js +19 -23
- package/dist/esm/Popover.js +10 -11
- package/dist/esm/Popup.js +12 -15
- package/dist/esm/Price.js +6 -8
- package/dist/esm/Progress.js +7 -11
- package/dist/esm/PullToRefresh.js +9 -14
- package/dist/esm/Radio.js +9 -10
- package/dist/esm/RadioGroup.js +9 -10
- package/dist/esm/Range/style/index.js +1 -1
- package/dist/esm/Range.js +11 -16
- package/dist/esm/Rate.js +9 -10
- package/dist/esm/Row.js +8 -8
- package/dist/esm/SearchBar.js +11 -14
- package/dist/esm/ShortPassword.js +16 -19
- package/dist/esm/SideNavBar.js +14 -20
- package/dist/esm/SideNavBarItem.js +5 -6
- package/dist/esm/Signature.js +13 -16
- package/dist/esm/Skeleton.js +14 -13
- package/dist/esm/Step.js +8 -11
- package/dist/esm/Steps/style/index.js +1 -1
- package/dist/esm/Steps.js +8 -10
- package/dist/esm/Sticky.js +10 -12
- package/dist/esm/SubSideNavBar.js +6 -7
- package/dist/esm/Swipe.js +11 -12
- package/dist/esm/Swiper.js +8 -11
- package/dist/esm/SwiperItem.js +5 -10
- package/dist/esm/Switch.js +7 -8
- package/dist/esm/TabPane.js +6 -9
- package/dist/esm/Tabbar/style/index.js +1 -1
- package/dist/esm/Tabbar.js +10 -8
- package/dist/esm/TabbarItem.js +8 -10
- package/dist/esm/Table.js +9 -14
- package/dist/esm/Tabs.js +11 -12
- package/dist/esm/Tag.js +8 -9
- package/dist/esm/TextArea.js +11 -11
- package/dist/esm/TimeDetail.js +8 -11
- package/dist/esm/TimePannel.js +8 -11
- package/dist/esm/TimeSelect.js +18 -21
- package/dist/esm/Toast.js +9 -10
- package/dist/esm/TrendArrow.js +8 -9
- package/dist/esm/Uploader.js +14 -19
- package/dist/esm/UserContext-ab42ba7f.js +5 -0
- package/dist/esm/Video.js +8 -9
- package/dist/esm/VirtualList.js +8 -11
- package/dist/esm/WaterMark.js +10 -13
- package/dist/esm/actionsheet.taro-d2217152.js +61 -0
- package/dist/esm/address.taro-1a8ab3f1.js +470 -0
- package/dist/esm/animate.taro-c8b29242.js +44 -0
- package/dist/esm/animatingnumbers.taro-c2a52dbd.js +103 -0
- package/dist/esm/audio.taro-bbd39f93.js +185 -0
- package/dist/esm/avatar.taro-01536aff.js +100 -0
- package/dist/esm/avatargroup-ad5ffb46.js +34 -0
- package/dist/esm/backtop.taro-7de36464.js +48 -0
- package/dist/esm/badge.taro-872605bf.js +48 -0
- package/dist/esm/barrage.taro-c8cb9864.js +91 -0
- package/dist/esm/bem-cdccae08.js +5 -0
- package/dist/esm/button.taro-01eae688.js +72 -0
- package/dist/esm/calendar.taro-10a6cb11.js +70 -0
- package/dist/esm/calendaritem.taro-3e5f114e.js +732 -0
- package/dist/esm/can-use-dom-0e539bd3.js +4 -0
- package/dist/esm/card.taro-2080f4d2.js +51 -0
- package/dist/esm/cascader.taro-fb7a0230.js +471 -0
- package/dist/esm/cell.taro-4e31d1fa.js +48 -0
- package/dist/esm/cellgroup.taro-a790d91b.js +28 -0
- package/dist/esm/checkbox.taro-016074da.js +177 -0
- package/dist/esm/circleprogress.taro-7149e09d.js +104 -0
- package/dist/esm/col.taro-d6a46a7d.js +41 -0
- package/dist/esm/collapse.taro-3d997680.js +70 -0
- package/dist/esm/collapseitem-f4571575.js +76 -0
- package/dist/esm/configprovider.taro-25758d9f.js +462 -0
- package/dist/esm/context-ab42ba7f.js +5 -0
- package/dist/esm/context-d0fccf11.js +5 -0
- package/dist/esm/countdown.taro-22200811.js +210 -0
- package/dist/esm/datepicker.taro-65dbeceb.js +260 -0
- package/dist/esm/dialog.taro-290eb9a6.js +128 -0
- package/dist/esm/divider.taro-0cb5f894.js +31 -0
- package/dist/esm/drag.taro-48e1ff38.js +111 -0
- package/dist/esm/elevator.taro-df8fde9d.js +206 -0
- package/dist/esm/ellipsis.taro-f9688dd7.js +242 -0
- package/dist/esm/empty.taro-ca792f57.js +59 -0
- package/dist/esm/fixednav.taro-28e5f776.js +61 -0
- package/dist/esm/form.taro-b06754e8.js +182 -0
- package/dist/esm/formitem.taro-b326809d.js +108 -0
- package/dist/esm/grid.taro-fbbd8618.js +52 -0
- package/dist/esm/griditem.taro-b0c37077.js +85 -0
- package/dist/esm/image.taro-767aa000.js +65 -0
- package/dist/esm/imagepreview.taro-daa5a84f.js +180 -0
- package/dist/esm/index-e3184f19.js +9 -0
- package/dist/esm/indicator.taro-edbc71df.js +30 -0
- package/dist/esm/infiniteloading.taro-f8f23ac6.js +143 -0
- package/dist/esm/input.taro-27d686c9.js +164 -0
- package/dist/esm/inputnumber.taro-6657d2c1.js +197 -0
- package/dist/esm/layout.taro-9659a928.js +11 -0
- package/dist/esm/menu.taro-cd0fef41.js +122 -0
- package/dist/esm/menuitem.taro-6076bffa.js +142 -0
- package/dist/esm/navbar.taro-5e1a0835.js +61 -0
- package/dist/esm/noticebar.taro-2f02b2ad.js +369 -0
- package/dist/esm/notify.taro-5768403d.js +75 -0
- package/dist/esm/numberkeyboard.taro-ad8afaf9.js +136 -0
- package/dist/esm/nutui-react.es.js +206 -118
- package/dist/esm/offsetContext-f32a9246.js +5 -0
- package/dist/esm/overlay.taro-75012bd3.js +77 -0
- package/dist/esm/pagination.taro-63607c3b.js +94 -0
- package/dist/esm/picker.taro-0570ec32.js +481 -0
- package/dist/esm/popover.taro-ad483372.js +162 -0
- package/dist/esm/popup.taro-e756f3fc.js +150 -0
- package/dist/esm/price.taro-479f1b82.js +80 -0
- package/dist/esm/progress.taro-437b9f6a.js +66 -0
- package/dist/esm/pulltorefresh.taro-6afe4805.js +138 -0
- package/dist/esm/radio.taro-5d6ca4ad.js +153 -0
- package/dist/esm/range.taro-615e193a.js +259 -0
- package/dist/esm/rate.taro-78c66969.js +77 -0
- package/dist/esm/row.taro-8b7febd4.js +48 -0
- package/dist/esm/searchbar.taro-37ade36e.js +159 -0
- package/dist/esm/shortpassword.taro-f7292032.js +146 -0
- package/dist/esm/sidenavbar.taro-9f210df4.js +51 -0
- package/dist/esm/sidenavbaritem.taro-32a45ce6.js +12 -0
- package/dist/esm/signature.taro-c57469aa.js +146 -0
- package/dist/esm/skeleton.taro-9ff9baf4.js +71 -0
- package/dist/esm/step.taro-2f55e4f2.js +63 -0
- package/dist/esm/steps.taro-196c1f59.js +31 -0
- package/dist/esm/sticky.taro-f8ae8d5e.js +154 -0
- package/dist/esm/subsidenavbar.taro-abe07673.js +64 -0
- package/dist/esm/swipe.taro-de80fcd8.js +180 -0
- package/dist/esm/swiper.taro-4aeb8526.js +86 -0
- package/dist/esm/swiperitem.taro-ef7342e8.js +14 -0
- package/dist/esm/switch.taro-f0da73a3.js +44 -0
- package/dist/esm/tabbar.taro-18eee41f.js +55 -0
- package/dist/esm/tabbaritem.taro-89646ca1.js +47 -0
- package/dist/esm/table.taro-15a55c5d.js +100 -0
- package/dist/esm/tabpane.taro-f8d92ece.js +21 -0
- package/dist/esm/tabs.taro-66164782.js +146 -0
- package/dist/esm/tag.taro-1b4134a5.js +92 -0
- package/dist/esm/textarea.taro-c110565e.js +102 -0
- package/dist/esm/timedetail.taro-8d2acbbf.js +41 -0
- package/dist/esm/timepannel.taro-ee4c5dfa.js +22 -0
- package/dist/esm/timeselect.taro-069deedd.js +133 -0
- package/dist/esm/toast.taro-92c10e1d.js +114 -0
- package/dist/esm/trendarrow.taro-0cf43935.js +72 -0
- package/dist/esm/typings-11d83a22.js +7 -0
- package/dist/esm/uploader.taro-7e38fc37.js +519 -0
- package/dist/esm/use-client-rect-f317804e.js +10 -0
- package/dist/esm/use-props-value-7ac1b1b5.js +16 -0
- package/dist/esm/use-touch-ff43512c.js +69 -0
- package/dist/esm/video-5d106e33.js +73 -0
- package/dist/esm/virtuallist.taro-99f03769.js +195 -0
- package/dist/esm/watermark.taro-cef29c03.js +109 -0
- 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/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.mjs +16980 -22641
- package/dist/nutui.react.umd.js +17061 -22738
- package/dist/packages/audio/audio.scss +2 -15
- package/dist/packages/badge/badge.scss +8 -18
- package/dist/packages/calendar/calendar.scss +0 -30
- package/dist/packages/cascader/cascader.scss +0 -26
- package/dist/packages/cellgroup/cellgroup.scss +20 -16
- package/dist/packages/checkbox/checkbox.scss +8 -11
- package/dist/packages/circleprogress/circleprogress.scss +0 -9
- package/dist/packages/dialog/dialog.scss +36 -65
- package/dist/packages/elevator/elevator.scss +2 -28
- package/dist/packages/empty/empty.scss +0 -9
- package/dist/packages/imagepreview/imagepreview.scss +52 -16
- package/dist/packages/input/input.scss +13 -180
- package/dist/packages/menu/menu.scss +44 -55
- package/dist/packages/menuitem/menuitem.scss +16 -26
- package/dist/packages/navbar/navbar.scss +16 -115
- package/dist/packages/noticebar/noticebar.scss +18 -19
- package/dist/packages/notify/notify.scss +1 -1
- package/dist/packages/numberkeyboard/numberkeyboard.scss +29 -77
- package/dist/packages/overlay/overlay.scss +11 -4
- package/dist/packages/picker/picker.scss +66 -137
- package/dist/packages/popup/popup.scss +0 -16
- package/dist/packages/price/price.scss +8 -0
- package/dist/packages/progress/progress.scss +19 -58
- package/dist/packages/pulltorefresh/pulltorefresh.scss +0 -8
- package/dist/packages/radio/radio.scss +13 -32
- package/dist/packages/radiogroup/radiogroup.scss +17 -51
- package/dist/packages/range/range.scss +24 -49
- package/dist/packages/row/row.scss +13 -31
- package/dist/packages/sidenavbar/sidenavbar.scss +0 -19
- package/dist/packages/step/step.scss +9 -62
- package/dist/packages/steps/steps.scss +2 -0
- package/dist/packages/swiper/swiper.scss +3 -18
- package/dist/packages/switch/switch.scss +13 -31
- package/dist/packages/tabbar/tabbar.scss +16 -22
- package/dist/packages/tabbaritem/tabbaritem.scss +9 -70
- package/dist/packages/table/table.scss +0 -56
- package/dist/packages/tabs/tabs.scss +196 -225
- package/dist/packages/textarea/textarea.scss +5 -12
- package/dist/packages/uploader/uploader.scss +2 -28
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/themes/default.scss +17 -18
- package/dist/styles/variables-jmapp.scss +120 -240
- package/dist/styles/variables.scss +139 -252
- package/dist/types/index.d.ts +572 -722
- package/package.json +2 -2
- package/dist/esm/AvatarContext-c96afdcc.js +0 -5
- package/dist/esm/Icon.js +0 -64
- package/dist/esm/UserContext-0aac9a82.js +0 -5
- package/dist/esm/UserContext-e402e1a6.js +0 -5
- package/dist/esm/UserContext-e8176108.js +0 -5
- package/dist/esm/actionsheet.taro-b76a342e.js +0 -53
- package/dist/esm/address.taro-1812caeb.js +0 -461
- package/dist/esm/animate.taro-fb7986d6.js +0 -40
- package/dist/esm/animatingnumbers.taro-03e5d61d.js +0 -104
- package/dist/esm/audio.taro-f672a68c.js +0 -162
- package/dist/esm/avatar.taro-de157a1f.js +0 -105
- package/dist/esm/avatargroup-b476ac68.js +0 -34
- package/dist/esm/backtop.taro-ba271b8f.js +0 -52
- package/dist/esm/badge.taro-ae154f41.js +0 -50
- package/dist/esm/barrage.taro-80df08d3.js +0 -94
- package/dist/esm/bem-350c1702.js +0 -5
- package/dist/esm/button.taro-a1c9512f.js +0 -65
- package/dist/esm/calendar.taro-b6b147ca.js +0 -65
- package/dist/esm/calendaritem.taro-ae167e59.js +0 -787
- package/dist/esm/can-use-dom-3eeb5af4.js +0 -6
- package/dist/esm/card.taro-5e9b34c8.js +0 -33
- package/dist/esm/cascader.taro-9c0a1a38.js +0 -447
- package/dist/esm/cell.taro-26870740.js +0 -43
- package/dist/esm/cellgroup.taro-6e901b54.js +0 -24
- package/dist/esm/checkbox.taro-785c528b.js +0 -168
- package/dist/esm/circleprogress.taro-79854448.js +0 -109
- package/dist/esm/col.taro-53eed3cc.js +0 -41
- package/dist/esm/collapse.taro-35a8a0d6.js +0 -79
- package/dist/esm/collapseitem-690eb91c.js +0 -68
- package/dist/esm/configprovider-9960f0fb.js +0 -19
- package/dist/esm/configprovider.taro-c8c54556.js +0 -45
- package/dist/esm/countdown.taro-0e6bf7a2.js +0 -225
- package/dist/esm/datepicker.taro-439e2080.js +0 -275
- package/dist/esm/dialog.taro-00ac41fd.js +0 -118
- package/dist/esm/divider.taro-6c1657ce.js +0 -31
- package/dist/esm/drag.taro-79bb8744.js +0 -110
- package/dist/esm/elevator.taro-81a11ecc.js +0 -178
- package/dist/esm/ellipsis.taro-b6cda065.js +0 -241
- package/dist/esm/empty.taro-fde835ca.js +0 -62
- package/dist/esm/fixednav.taro-39fbd47a.js +0 -54
- package/dist/esm/form.taro-0d83f1e8.js +0 -179
- package/dist/esm/formitem.taro-0de07d1e.js +0 -89
- package/dist/esm/get-scroll-parent-b4a07e65.js +0 -25
- package/dist/esm/grid.taro-3797169c.js +0 -49
- package/dist/esm/griditem.taro-04f59ae1.js +0 -80
- package/dist/esm/image.taro-edb572bb.js +0 -64
- package/dist/esm/imagepreview.taro-867ee24a.js +0 -167
- package/dist/esm/index-5bcb0ff8.js +0 -7
- package/dist/esm/indicator.taro-c10334e8.js +0 -30
- package/dist/esm/infiniteloading.taro-73c9b8ca.js +0 -141
- package/dist/esm/input.taro-10ed5500.js +0 -237
- package/dist/esm/inputnumber.taro-108c4784.js +0 -199
- package/dist/esm/layout.taro-9046d093.js +0 -11
- package/dist/esm/menu.taro-54951911.js +0 -98
- package/dist/esm/menuitem.taro-86a6bb6c.js +0 -128
- package/dist/esm/navbar.taro-69f47d51.js +0 -77
- package/dist/esm/noticebar.taro-49e7441f.js +0 -427
- package/dist/esm/notify.taro-e17c6f82.js +0 -75
- package/dist/esm/numberkeyboard.taro-81b36e5e.js +0 -159
- package/dist/esm/offsetContext-c2a746fa.js +0 -5
- package/dist/esm/overlay.taro-ad0d4775.js +0 -75
- package/dist/esm/pagination.taro-60b22b27.js +0 -91
- package/dist/esm/picker.taro-5c9030a7.js +0 -423
- package/dist/esm/popover.taro-2a57eae4.js +0 -153
- package/dist/esm/popup.taro-124b9bab.js +0 -142
- package/dist/esm/price.taro-776ed16e.js +0 -83
- package/dist/esm/progress.taro-24392ef3.js +0 -88
- package/dist/esm/pulltorefresh.taro-d5fcfcb0.js +0 -181
- package/dist/esm/radio.taro-51e10152.js +0 -177
- package/dist/esm/range.taro-7a2b6ca1.js +0 -332
- package/dist/esm/rate.taro-57341aa9.js +0 -77
- package/dist/esm/row.taro-f64d4a13.js +0 -46
- package/dist/esm/searchbar.taro-eef468bb.js +0 -152
- package/dist/esm/shortpassword.taro-9a2c98ad.js +0 -119
- package/dist/esm/sidenavbar.taro-0265812f.js +0 -35
- package/dist/esm/sidenavbaritem.taro-bb80dbf4.js +0 -12
- package/dist/esm/signature.taro-f01b2b05.js +0 -143
- package/dist/esm/skeleton.taro-64e858a2.js +0 -62
- package/dist/esm/step.taro-2ec1f283.js +0 -58
- package/dist/esm/steps.taro-c82d2252.js +0 -30
- package/dist/esm/sticky.taro-b5bde7b1.js +0 -136
- package/dist/esm/subsidenavbar.taro-3cce8442.js +0 -63
- package/dist/esm/supports-passive-c85ef996.js +0 -18
- package/dist/esm/swipe.taro-350c9a94.js +0 -177
- package/dist/esm/swiper.taro-7a94e211.js +0 -451
- package/dist/esm/swiperitem-c9e3d0d5.js +0 -29
- package/dist/esm/switch.taro-34ca8228.js +0 -50
- package/dist/esm/tabbar.taro-9acfc2fa.js +0 -59
- package/dist/esm/tabbaritem.taro-42ba353f.js +0 -55
- package/dist/esm/table.taro-3946697c.js +0 -95
- package/dist/esm/tabpane.taro-4ca340ef.js +0 -23
- package/dist/esm/tabs.taro-be8cacb5.js +0 -140
- package/dist/esm/tag.taro-0c2567de.js +0 -92
- package/dist/esm/textarea.taro-a0f79515.js +0 -94
- package/dist/esm/timedetail.taro-fce4e614.js +0 -44
- package/dist/esm/timepannel.taro-fd3d008d.js +0 -22
- package/dist/esm/timeselect.taro-5b047850.js +0 -133
- package/dist/esm/toast.taro-e4f44812.js +0 -108
- package/dist/esm/trendarrow.taro-7cf90def.js +0 -70
- package/dist/esm/typings-d8491423.js +0 -6
- package/dist/esm/uploader.taro-0cca7e97.js +0 -496
- package/dist/esm/use-client-rect-1f8ed1fe.js +0 -18
- package/dist/esm/use-props-value-ae7ee726.js +0 -15
- package/dist/esm/use-touch-db24bb5c.js +0 -69
- package/dist/esm/video-7ed508cc.js +0 -67
- package/dist/esm/virtuallist.taro-35b9bd9a.js +0 -214
- package/dist/esm/watermark.taro-c780d360.js +0 -114
- package/dist/esm/zh-CN-b4f493ba.js +0 -131
- package/dist/packages/icon/icon.scss +0 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import React, { useMemo, useState } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { RectDown } from "@nutui/icons-react-taro";
|
|
4
|
+
import { View } from "@tarojs/components";
|
|
5
|
+
import { P as Popup } from "./popup.taro-e756f3fc.js";
|
|
6
|
+
import { u as useConfig } from "./configprovider.taro-25758d9f.js";
|
|
7
|
+
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
8
|
+
const defaultProps = {
|
|
9
|
+
...ComponentDefaults,
|
|
10
|
+
visible: false,
|
|
11
|
+
type: "default",
|
|
12
|
+
custom: [],
|
|
13
|
+
random: false,
|
|
14
|
+
onClose: () => {
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const NumberKeyboard = (props) => {
|
|
18
|
+
const { locale } = useConfig();
|
|
19
|
+
const { title, confirmText, visible, type, custom, random, style, className, onChange, onDelete, onClose, onConfirm, ...rest } = props;
|
|
20
|
+
const classPrefix = "nut-numberkeyboard";
|
|
21
|
+
const getBasicKeys = () => {
|
|
22
|
+
const keys = new Array(9).fill(0).map((_, index) => {
|
|
23
|
+
return {
|
|
24
|
+
id: String(index + 1),
|
|
25
|
+
type: "num"
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
return random ? keys.sort(() => Math.random() > 0.5 ? 1 : -1) : keys;
|
|
29
|
+
};
|
|
30
|
+
const getCustomKeys = () => {
|
|
31
|
+
const customKeys = [
|
|
32
|
+
{ id: "close", type: "close" },
|
|
33
|
+
{ id: "0", type: "num" },
|
|
34
|
+
{ id: "delete", type: "delete" }
|
|
35
|
+
];
|
|
36
|
+
if (!custom)
|
|
37
|
+
return customKeys;
|
|
38
|
+
if (custom.length > 0) {
|
|
39
|
+
customKeys[0] = { id: custom[0], type: "custom" };
|
|
40
|
+
}
|
|
41
|
+
if (custom.length > 1) {
|
|
42
|
+
customKeys[2] = { id: custom[1], type: "custom" };
|
|
43
|
+
}
|
|
44
|
+
return customKeys;
|
|
45
|
+
};
|
|
46
|
+
const keysList = useMemo(() => {
|
|
47
|
+
return [...getBasicKeys(), ...getCustomKeys()];
|
|
48
|
+
}, [type, random, custom]);
|
|
49
|
+
const DeleteIcon = () => {
|
|
50
|
+
const style2 = {
|
|
51
|
+
background: `url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAnCAYAAABJ0cukAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozOUNBQTQ0MkY3RTMxMUVBQjIzNEJCQkYxNDZGQjg5OCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozOUNBQTQ0M0Y3RTMxMUVBQjIzNEJCQkYxNDZGQjg5OCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjM5Q0FBNDQwRjdFMzExRUFCMjM0QkJCRjE0NkZCODk4IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM5Q0FBNDQxRjdFMzExRUFCMjM0QkJCRjE0NkZCODk4Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+T12ahwAABClJREFUeNrUWVtIFFEY3pkdrbaCiAINK81VW3d2102pjKLtoXoJrNAswoeEXoyilx7sJXvIh6CHAoMg6yEfSpdECIqE0jCMbMm9qCVYUmR5S8huXmZO39nWOI7mzsy6uzqgM/vvzNnv+y/n/84ZjhBiWMwHF+kA+fn5y0ZHRzNwuTomgDnui9/vfzMvBJxWa7bE87W4tMbY8S8MhNz0BQLVugnY7fZdGORZPNNHJmSPUSf47QD/PN75z3NcpqD1IVEU8wC+dZojDIajyMu6WAG322zBmQf/7LzGnHeAdRtjmuAIKYoleMWxQnUEHA6HVZLldsb0m3oehdQQzzQSVILPJLIcYEw/4HkK/kG86yAsAZvNtgng3059hte/Gf56/uFCaGR8mIJdj3m2hzGNGAkpRM4vCPBzErBYLMko2A//DIQMoQ0WtgcCjWFnCVGswEzxCecqLc0y9Nyww2ariYhAbm7umgRB6GNM/QTgfT7fEzWD4t7dOK0D4TKAcrtcLkENeNx/gUoSpOnx4Gc9BHJyclZNjI8PMqY+judp2jSr1iuENDPi5fDX4WG32WxeogL81NGRIEk3NBNAh10uS9IIY/oIbxR6vd4WLXmJAq9Ayl1kTAUmk8mNyJrUgDfK8hFPV9dnTQSCHiLkO/Ndb8jzrXqKawYJQg4gsu6srKyV4cC/7ujo1CqneRSPxNh74PligPdE3PYVIDHuY6PRWCxPTp7VC35KSvwjwBpwdPP4gXYc86ZdZnr6Pf7S9HqexUs9z0qBLprz8wn+PzWRFknaKGsgjwlvCdLGH42GQ0lg+dqkMP+Enj+lF/yMWYgnJD1qEhhphOWgS2E2yQZDJWa/lEgIvGIa0D2HKJZGA7yiBgaZqO9AermdFstGXQR8fn+BootW4wfPRBE8zXmXoia2SYLgpsJRVwqBBJ2N+pnueRVhPR8l8MGCnaWw8wDCDSWQoasGQCKJnpjGcwkkKqMBfo7ZyQklQCOxWVcRg4QDXmhkSJRjsGvRAD8HCTuNhNPpXKtLzHn9/n0orBqm052GvL2lcfepTMs8PwsJqyRJRbrlNFpBCUBcYWaKE2h4tampqUtV6pP60HNtapuUksTY2NidiLcWUQPnMOhlxvQoITGxxOPxDIVdR2dnb/V2dr7Umn50/Q31261JC4UhUQYSVUxdtPCCUAK10RuvZeQ0LRQ2tD7fddxdyuT3TijJehATF/yinqmJ2wB+jCGRA11TH9xiXAwEQpG4i0gcZHLPjHSqF0Vx76IgEIpEA9a7+3H5K2RK4jnuPvTToXgR0LW9Htpap71iAzPVNsUIMH0XMdXkfLrfD9BdanifksiKW/5w3Emj3mcHBgb6kpKTn6KYzfBCehzg10H6lHPzMdIWq9U8znEpsXE6N4rTO9TjSGgPanG/pfwjwABn1PZcM5XI0AAAAABJRU5ErkJggg0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLTkwMjA5MzIyMjIxMzkzMzc2NzAwNjg0MC0tDQo=') no-repeat center`,
|
|
52
|
+
backgroundSize: "100% 100%",
|
|
53
|
+
width: "30px",
|
|
54
|
+
height: "24px"
|
|
55
|
+
};
|
|
56
|
+
return React.createElement(View, { style: style2 });
|
|
57
|
+
};
|
|
58
|
+
const NumberKeyboardKey = (props2) => {
|
|
59
|
+
const { item } = props2;
|
|
60
|
+
const [active, setActive] = useState(false);
|
|
61
|
+
const onTouchStart = () => {
|
|
62
|
+
setActive(true);
|
|
63
|
+
};
|
|
64
|
+
const onTouchEnd = (item2) => {
|
|
65
|
+
setActive(false);
|
|
66
|
+
if (item2.type === "num" || item2.type === "custom") {
|
|
67
|
+
onChange && onChange(item2.id);
|
|
68
|
+
}
|
|
69
|
+
if (item2.type === "close") {
|
|
70
|
+
onClose && onClose();
|
|
71
|
+
}
|
|
72
|
+
if (item2.type === "delete") {
|
|
73
|
+
onDelete && onDelete();
|
|
74
|
+
}
|
|
75
|
+
if (item2.type === "confirm") {
|
|
76
|
+
onConfirm && onConfirm();
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
return React.createElement(
|
|
80
|
+
"div",
|
|
81
|
+
{ key: item.id, className: `${classPrefix}__body__wrapper` },
|
|
82
|
+
React.createElement(
|
|
83
|
+
"div",
|
|
84
|
+
{ className: classNames({
|
|
85
|
+
key: true,
|
|
86
|
+
active,
|
|
87
|
+
close: item.type === "close",
|
|
88
|
+
delete: item.type === "delete",
|
|
89
|
+
confirm: item.type === "confirm"
|
|
90
|
+
}), onTouchStart: () => onTouchStart(), onTouchEnd: () => onTouchEnd(item), onTouchCancel: () => onTouchEnd(item) },
|
|
91
|
+
(item.type === "num" || item.type === "custom") && React.createElement("div", null, item.id),
|
|
92
|
+
item.type === "delete" && React.createElement(DeleteIcon, null),
|
|
93
|
+
item.type === "close" && React.createElement(RectDown, { size: 25 }),
|
|
94
|
+
item.type === "confirm" && React.createElement(React.Fragment, null, confirmText || locale.done)
|
|
95
|
+
)
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
return React.createElement(
|
|
99
|
+
Popup,
|
|
100
|
+
{ visible, position: "bottom", onClickOverlay: onClose, onClickCloseIcon: onClose, overlayStyle: { backgroundColor: "rgba(0, 0, 0, 0)" }, ...rest },
|
|
101
|
+
React.createElement(
|
|
102
|
+
"div",
|
|
103
|
+
{ className: classNames(classPrefix, className), style },
|
|
104
|
+
title && React.createElement(
|
|
105
|
+
"div",
|
|
106
|
+
{ className: `${classPrefix}__header` },
|
|
107
|
+
React.createElement("h3", { className: `${classPrefix}__header__title` }, title),
|
|
108
|
+
type === "default" && React.createElement("span", { className: `${classPrefix}__header__close`, onClick: onClose }, locale.done)
|
|
109
|
+
),
|
|
110
|
+
React.createElement(
|
|
111
|
+
"div",
|
|
112
|
+
{ className: `${classPrefix}__body` },
|
|
113
|
+
React.createElement("div", { className: `${classPrefix}__body__keys` }, keysList == null ? void 0 : keysList.map((item) => {
|
|
114
|
+
return React.createElement(NumberKeyboardKey, { key: item.id, item });
|
|
115
|
+
})),
|
|
116
|
+
type === "rightColumn" && React.createElement(
|
|
117
|
+
"div",
|
|
118
|
+
{ className: `${classPrefix}__sidebar` },
|
|
119
|
+
React.createElement(NumberKeyboardKey, { key: "delete", item: {
|
|
120
|
+
id: "delete",
|
|
121
|
+
type: "delete"
|
|
122
|
+
} }),
|
|
123
|
+
React.createElement(NumberKeyboardKey, { key: "confirm", item: {
|
|
124
|
+
id: "confirm",
|
|
125
|
+
type: "confirm"
|
|
126
|
+
} })
|
|
127
|
+
)
|
|
128
|
+
)
|
|
129
|
+
)
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
NumberKeyboard.defaultProps = defaultProps;
|
|
133
|
+
NumberKeyboard.displayName = "NutNumberKeyboard";
|
|
134
|
+
export {
|
|
135
|
+
NumberKeyboard as N
|
|
136
|
+
};
|
|
@@ -1,118 +1,206 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
import
|
|
93
|
-
import
|
|
94
|
-
import
|
|
95
|
-
import
|
|
96
|
-
import
|
|
97
|
-
import
|
|
98
|
-
import
|
|
99
|
-
import
|
|
100
|
-
import
|
|
101
|
-
import
|
|
102
|
-
import
|
|
103
|
-
import
|
|
104
|
-
import
|
|
105
|
-
import
|
|
106
|
-
import
|
|
107
|
-
import
|
|
108
|
-
import
|
|
109
|
-
import
|
|
110
|
-
import
|
|
111
|
-
import
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
1
|
+
import { B } from "./button.taro-01eae688.js";
|
|
2
|
+
import { C } from "./cell.taro-4e31d1fa.js";
|
|
3
|
+
import { C as C2 } from "./cellgroup.taro-a790d91b.js";
|
|
4
|
+
import { C as C3 } from "./configprovider.taro-25758d9f.js";
|
|
5
|
+
import { I } from "./image.taro-767aa000.js";
|
|
6
|
+
import { O } from "./overlay.taro-75012bd3.js";
|
|
7
|
+
import { C as C4 } from "./col.taro-d6a46a7d.js";
|
|
8
|
+
import { D } from "./divider.taro-0cb5f894.js";
|
|
9
|
+
import { G } from "./grid.taro-fbbd8618.js";
|
|
10
|
+
import { G as G2 } from "./griditem.taro-b0c37077.js";
|
|
11
|
+
import { L } from "./layout.taro-9659a928.js";
|
|
12
|
+
import { R } from "./row.taro-8b7febd4.js";
|
|
13
|
+
import { S } from "./sticky.taro-f8ae8d5e.js";
|
|
14
|
+
import { B as B2 } from "./backtop.taro-7de36464.js";
|
|
15
|
+
import { E } from "./elevator.taro-df8fde9d.js";
|
|
16
|
+
import { F } from "./fixednav.taro-28e5f776.js";
|
|
17
|
+
import { N } from "./navbar.taro-5e1a0835.js";
|
|
18
|
+
import { S as S2 } from "./sidenavbar.taro-9f210df4.js";
|
|
19
|
+
import { S as S3 } from "./sidenavbaritem.taro-32a45ce6.js";
|
|
20
|
+
import { S as S4 } from "./subsidenavbar.taro-abe07673.js";
|
|
21
|
+
import { T } from "./tabbar.taro-18eee41f.js";
|
|
22
|
+
import { T as T2 } from "./tabbaritem.taro-89646ca1.js";
|
|
23
|
+
import { T as T3 } from "./tabpane.taro-f8d92ece.js";
|
|
24
|
+
import { T as T4 } from "./tabs.taro-66164782.js";
|
|
25
|
+
import { A } from "./address.taro-1a8ab3f1.js";
|
|
26
|
+
import { C as C5 } from "./calendar.taro-10a6cb11.js";
|
|
27
|
+
import { C as C6 } from "./calendaritem.taro-3e5f114e.js";
|
|
28
|
+
import { C as C7 } from "./cascader.taro-fb7a0230.js";
|
|
29
|
+
import { C as C8, a } from "./checkbox.taro-016074da.js";
|
|
30
|
+
import { D as D2 } from "./datepicker.taro-65dbeceb.js";
|
|
31
|
+
import { F as F2 } from "./form.taro-b06754e8.js";
|
|
32
|
+
import { F as F3 } from "./formitem.taro-b326809d.js";
|
|
33
|
+
import { I as I2 } from "./input.taro-27d686c9.js";
|
|
34
|
+
import { I as I3 } from "./inputnumber.taro-6657d2c1.js";
|
|
35
|
+
import { M } from "./menu.taro-cd0fef41.js";
|
|
36
|
+
import { M as M2 } from "./menuitem.taro-6076bffa.js";
|
|
37
|
+
import { N as N2 } from "./numberkeyboard.taro-ad8afaf9.js";
|
|
38
|
+
import { P } from "./picker.taro-0570ec32.js";
|
|
39
|
+
import { R as R2, a as a2 } from "./radio.taro-5d6ca4ad.js";
|
|
40
|
+
import { R as R3 } from "./range.taro-615e193a.js";
|
|
41
|
+
import { R as R4 } from "./rate.taro-78c66969.js";
|
|
42
|
+
import { S as S5 } from "./searchbar.taro-37ade36e.js";
|
|
43
|
+
import { S as S6 } from "./shortpassword.taro-f7292032.js";
|
|
44
|
+
import { S as S7 } from "./signature.taro-c57469aa.js";
|
|
45
|
+
import { S as S8 } from "./switch.taro-f0da73a3.js";
|
|
46
|
+
import { T as T5 } from "./textarea.taro-c110565e.js";
|
|
47
|
+
import { U } from "./uploader.taro-7e38fc37.js";
|
|
48
|
+
import { A as A2 } from "./actionsheet.taro-d2217152.js";
|
|
49
|
+
import { B as B3 } from "./badge.taro-872605bf.js";
|
|
50
|
+
import { B as B4 } from "./dialog.taro-290eb9a6.js";
|
|
51
|
+
import { D as D3 } from "./drag.taro-48e1ff38.js";
|
|
52
|
+
import { E as E2 } from "./empty.taro-ca792f57.js";
|
|
53
|
+
import { I as I4 } from "./infiniteloading.taro-f8f23ac6.js";
|
|
54
|
+
import { N as N3 } from "./noticebar.taro-2f02b2ad.js";
|
|
55
|
+
import { N as N4 } from "./notify.taro-5768403d.js";
|
|
56
|
+
import { P as P2 } from "./popover.taro-ad483372.js";
|
|
57
|
+
import { P as P3 } from "./pulltorefresh.taro-6afe4805.js";
|
|
58
|
+
import { S as S9 } from "./skeleton.taro-9ff9baf4.js";
|
|
59
|
+
import { S as S10 } from "./swipe.taro-de80fcd8.js";
|
|
60
|
+
import { P as P4 } from "./popup.taro-e756f3fc.js";
|
|
61
|
+
import { T as T6 } from "./toast.taro-92c10e1d.js";
|
|
62
|
+
import { A as A3 } from "./animate.taro-c8b29242.js";
|
|
63
|
+
import { A as A4 } from "./animatingnumbers.taro-c2a52dbd.js";
|
|
64
|
+
import { A as A5 } from "./audio.taro-bbd39f93.js";
|
|
65
|
+
import { A as A6 } from "./avatar.taro-01536aff.js";
|
|
66
|
+
import { A as A7 } from "./avatargroup-ad5ffb46.js";
|
|
67
|
+
import { C as C9 } from "./circleprogress.taro-7149e09d.js";
|
|
68
|
+
import { C as C10 } from "./collapse.taro-3d997680.js";
|
|
69
|
+
import { C as C11 } from "./collapseitem-f4571575.js";
|
|
70
|
+
import { C as C12 } from "./countdown.taro-22200811.js";
|
|
71
|
+
import { E as E3 } from "./ellipsis.taro-f9688dd7.js";
|
|
72
|
+
import { I as I5 } from "./imagepreview.taro-daa5a84f.js";
|
|
73
|
+
import { I as I6 } from "./indicator.taro-edbc71df.js";
|
|
74
|
+
import { V } from "./virtuallist.taro-99f03769.js";
|
|
75
|
+
import { P as P5 } from "./pagination.taro-63607c3b.js";
|
|
76
|
+
import { P as P6 } from "./price.taro-479f1b82.js";
|
|
77
|
+
import { P as P7 } from "./progress.taro-437b9f6a.js";
|
|
78
|
+
import { S as S11 } from "./step.taro-2f55e4f2.js";
|
|
79
|
+
import { S as S12 } from "./steps.taro-196c1f59.js";
|
|
80
|
+
import { S as S13 } from "./swiper.taro-4aeb8526.js";
|
|
81
|
+
import { S as S14 } from "./swiperitem.taro-ef7342e8.js";
|
|
82
|
+
import { T as T7 } from "./table.taro-15a55c5d.js";
|
|
83
|
+
import { T as T8 } from "./tag.taro-1b4134a5.js";
|
|
84
|
+
import { V as V2 } from "./video-5d106e33.js";
|
|
85
|
+
import { B as B5 } from "./barrage.taro-c8cb9864.js";
|
|
86
|
+
import { C as C13 } from "./card.taro-2080f4d2.js";
|
|
87
|
+
import { T as T9 } from "./timedetail.taro-8d2acbbf.js";
|
|
88
|
+
import { T as T10 } from "./timepannel.taro-ee4c5dfa.js";
|
|
89
|
+
import { T as T11 } from "./timeselect.taro-069deedd.js";
|
|
90
|
+
import { T as T12 } from "./trendarrow.taro-0cf43935.js";
|
|
91
|
+
import { W } from "./watermark.taro-cef29c03.js";
|
|
92
|
+
import "react";
|
|
93
|
+
import "classnames";
|
|
94
|
+
import "@nutui/icons-react-taro";
|
|
95
|
+
import "./typings-11d83a22.js";
|
|
96
|
+
import "@tarojs/components";
|
|
97
|
+
import "./UserContext-ab42ba7f.js";
|
|
98
|
+
import "@tarojs/taro";
|
|
99
|
+
import "./use-client-rect-f317804e.js";
|
|
100
|
+
import "./can-use-dom-0e539bd3.js";
|
|
101
|
+
import "./offsetContext-f32a9246.js";
|
|
102
|
+
import "./use-props-value-7ac1b1b5.js";
|
|
103
|
+
import "./bem-cdccae08.js";
|
|
104
|
+
import "@bem-react/classname";
|
|
105
|
+
import "./ConfigProvider.js";
|
|
106
|
+
import "react-transition-group";
|
|
107
|
+
import "./use-touch-ff43512c.js";
|
|
108
|
+
import "./index-e3184f19.js";
|
|
109
|
+
import "react-dom";
|
|
110
|
+
import "./context-d0fccf11.js";
|
|
111
|
+
import "./context-ab42ba7f.js";
|
|
112
|
+
export {
|
|
113
|
+
A2 as ActionSheet,
|
|
114
|
+
A as Address,
|
|
115
|
+
A3 as Animate,
|
|
116
|
+
A4 as AnimatingNumbers,
|
|
117
|
+
A5 as Audio,
|
|
118
|
+
A6 as Avatar,
|
|
119
|
+
A7 as AvatarGroup,
|
|
120
|
+
B2 as BackTop,
|
|
121
|
+
B3 as Badge,
|
|
122
|
+
B5 as Barrage,
|
|
123
|
+
B as Button,
|
|
124
|
+
C5 as Calendar,
|
|
125
|
+
C6 as CalendarItem,
|
|
126
|
+
C13 as Card,
|
|
127
|
+
C7 as Cascader,
|
|
128
|
+
C as Cell,
|
|
129
|
+
C2 as CellGroup,
|
|
130
|
+
C8 as Checkbox,
|
|
131
|
+
a as CheckboxGroup,
|
|
132
|
+
C9 as CircleProgress,
|
|
133
|
+
C4 as Col,
|
|
134
|
+
C10 as Collapse,
|
|
135
|
+
C11 as CollapseItem,
|
|
136
|
+
C3 as ConfigProvider,
|
|
137
|
+
C12 as CountDown,
|
|
138
|
+
D2 as DatePicker,
|
|
139
|
+
B4 as Dialog,
|
|
140
|
+
D as Divider,
|
|
141
|
+
D3 as Drag,
|
|
142
|
+
E as Elevator,
|
|
143
|
+
E3 as Ellipsis,
|
|
144
|
+
E2 as Empty,
|
|
145
|
+
F as FixedNav,
|
|
146
|
+
F2 as Form,
|
|
147
|
+
F3 as FormItem,
|
|
148
|
+
G as Grid,
|
|
149
|
+
G2 as GridItem,
|
|
150
|
+
I as Image,
|
|
151
|
+
I5 as ImagePreview,
|
|
152
|
+
I6 as Indicator,
|
|
153
|
+
I4 as Infiniteloading,
|
|
154
|
+
I2 as Input,
|
|
155
|
+
I3 as InputNumber,
|
|
156
|
+
L as Layout,
|
|
157
|
+
M as Menu,
|
|
158
|
+
M2 as MenuItem,
|
|
159
|
+
N as NavBar,
|
|
160
|
+
N3 as NoticeBar,
|
|
161
|
+
N4 as Notify,
|
|
162
|
+
N2 as NumberKeyboard,
|
|
163
|
+
O as Overlay,
|
|
164
|
+
P5 as Pagination,
|
|
165
|
+
P as Picker,
|
|
166
|
+
P2 as Popover,
|
|
167
|
+
P4 as Popup,
|
|
168
|
+
P6 as Price,
|
|
169
|
+
P7 as Progress,
|
|
170
|
+
P3 as PullToRefresh,
|
|
171
|
+
R2 as Radio,
|
|
172
|
+
a2 as RadioGroup,
|
|
173
|
+
R3 as Range,
|
|
174
|
+
R4 as Rate,
|
|
175
|
+
R as Row,
|
|
176
|
+
S5 as SearchBar,
|
|
177
|
+
S6 as ShortPassword,
|
|
178
|
+
S2 as SideNavBar,
|
|
179
|
+
S3 as SideNavBarItem,
|
|
180
|
+
S7 as Signature,
|
|
181
|
+
S9 as Skeleton,
|
|
182
|
+
S11 as Step,
|
|
183
|
+
S12 as Steps,
|
|
184
|
+
S as Sticky,
|
|
185
|
+
S4 as SubSideNavBar,
|
|
186
|
+
S10 as Swipe,
|
|
187
|
+
S13 as Swiper,
|
|
188
|
+
S14 as SwiperItem,
|
|
189
|
+
S8 as Switch,
|
|
190
|
+
T3 as TabPane,
|
|
191
|
+
T as Tabbar,
|
|
192
|
+
T2 as TabbarItem,
|
|
193
|
+
T7 as Table,
|
|
194
|
+
T4 as Tabs,
|
|
195
|
+
T8 as Tag,
|
|
196
|
+
T5 as TextArea,
|
|
197
|
+
T9 as TimeDetail,
|
|
198
|
+
T10 as TimePannel,
|
|
199
|
+
T11 as TimeSelect,
|
|
200
|
+
T6 as Toast,
|
|
201
|
+
T12 as TrendArrow,
|
|
202
|
+
U as Uploader,
|
|
203
|
+
V2 as Video,
|
|
204
|
+
V as VirtualList,
|
|
205
|
+
W as WaterMark
|
|
206
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { useRef, useEffect } from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { View } from "@tarojs/components";
|
|
4
|
+
import { C as ComponentDefaults } from "./typings-11d83a22.js";
|
|
5
|
+
const defaultOverlayProps = {
|
|
6
|
+
...ComponentDefaults,
|
|
7
|
+
zIndex: 1e3,
|
|
8
|
+
duration: 0.3,
|
|
9
|
+
closeOnOverlayClick: true,
|
|
10
|
+
visible: false,
|
|
11
|
+
lockScroll: true,
|
|
12
|
+
onClick: (event) => {
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const Overlay = (props) => {
|
|
16
|
+
const { children, zIndex, duration, className, closeOnOverlayClick, visible, lockScroll, style, afterShow, afterClose, onClick, ...rest } = {
|
|
17
|
+
...defaultOverlayProps,
|
|
18
|
+
...props
|
|
19
|
+
};
|
|
20
|
+
const classPrefix = `nut-overlay`;
|
|
21
|
+
const renderRef = useRef(true);
|
|
22
|
+
const intervalCloseRef = useRef(0);
|
|
23
|
+
const intervalShowRef = useRef(0);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (visible) {
|
|
26
|
+
intervalShowRef.current = window.setTimeout(() => {
|
|
27
|
+
afterShow && afterShow();
|
|
28
|
+
}, duration * 1e3 * 0.8);
|
|
29
|
+
}
|
|
30
|
+
lock();
|
|
31
|
+
}, [visible]);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
return () => {
|
|
34
|
+
clearTimeout(intervalCloseRef.current);
|
|
35
|
+
clearTimeout(intervalShowRef.current);
|
|
36
|
+
document.body.classList.remove("nut-overflow-hidden");
|
|
37
|
+
};
|
|
38
|
+
}, []);
|
|
39
|
+
const classes = classNames({
|
|
40
|
+
"nut-overlay-fade-leave-active": !renderRef.current && !visible,
|
|
41
|
+
"nut-overlay-fade-enter-active": visible,
|
|
42
|
+
"nut-overlay-first-render": renderRef.current && !visible,
|
|
43
|
+
"nut-overlay-hidden-render": !visible
|
|
44
|
+
}, className, classPrefix);
|
|
45
|
+
const styles = {
|
|
46
|
+
zIndex,
|
|
47
|
+
animationDuration: `${props.duration}s`,
|
|
48
|
+
...style
|
|
49
|
+
};
|
|
50
|
+
const lock = () => {
|
|
51
|
+
if (lockScroll && visible) {
|
|
52
|
+
document.body.classList.add("nut-overflow-hidden");
|
|
53
|
+
} else {
|
|
54
|
+
document.body.classList.remove("nut-overflow-hidden");
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const handleClick = (e) => {
|
|
58
|
+
if (closeOnOverlayClick) {
|
|
59
|
+
onClick && onClick(e);
|
|
60
|
+
renderRef.current = false;
|
|
61
|
+
intervalCloseRef.current = window.setTimeout(() => {
|
|
62
|
+
afterClose && afterClose();
|
|
63
|
+
}, duration * 1e3 * 0.8);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
return React.createElement(
|
|
67
|
+
React.Fragment,
|
|
68
|
+
null,
|
|
69
|
+
React.createElement(View, { className: classes, style: styles, ...rest, catchMove: lockScroll, onClick: handleClick }, children)
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
Overlay.defaultProps = defaultOverlayProps;
|
|
73
|
+
Overlay.displayName = "NutOverlay";
|
|
74
|
+
export {
|
|
75
|
+
Overlay as O,
|
|
76
|
+
defaultOverlayProps as d
|
|
77
|
+
};
|