@nutui/nutui-react-taro 1.2.2-beta.0 → 1.3.0-beta.5
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 +17 -0
- package/dist/esm/ActionSheet.js +5 -4
- package/dist/esm/Address.js +5 -4
- package/dist/esm/AnimatingNumbers.js +3 -2
- package/dist/esm/Avatar.js +3 -3
- package/dist/esm/AvatarGroup.js +2 -2
- package/dist/esm/BackTop.js +3 -3
- package/dist/esm/Badge.js +3 -3
- package/dist/esm/Barrage.js +3 -2
- package/dist/esm/Button.js +3 -3
- package/dist/esm/Calendar.js +5 -4
- package/dist/esm/CalendarItem.js +2 -2
- package/dist/esm/Card.js +3 -3
- package/dist/esm/Cell.js +3 -3
- package/dist/esm/Checkbox.js +3 -3
- package/dist/esm/CheckboxGroup.js +2 -2
- package/dist/esm/Col.js +2 -2
- package/dist/esm/Collapse.js +2 -2
- package/dist/esm/CollapseItem.js +3 -3
- package/dist/esm/DatePicker.js +7 -6
- package/dist/esm/Dialog.js +4 -4
- package/dist/esm/Divider.js +2 -2
- package/dist/esm/Drag.js +2 -2
- package/dist/esm/Elevator.js +3 -2
- package/dist/esm/Empty.js +2 -2
- package/dist/esm/FixedNav.js +3 -3
- package/dist/esm/Icon/style/index.js +1 -0
- package/dist/esm/Icon.js +2 -2
- package/dist/esm/Infiniteloading.js +3 -3
- package/dist/esm/Input.js +3 -3
- package/dist/esm/InputNumber.js +3 -3
- package/dist/esm/NavBar.js +4 -3
- package/dist/esm/NoticeBar.js +3 -3
- package/dist/esm/{Notification-b09c89e8.js → Notification-dccc7625.js} +18 -11
- package/dist/esm/Notify.js +2 -2
- package/dist/esm/NumberKeyboard.js +5 -4
- package/dist/esm/Picker.js +7 -6
- package/dist/esm/Popover.js +5 -4
- package/dist/esm/Popup.js +4 -3
- package/dist/esm/Progress.js +3 -3
- package/dist/esm/Radio.js +4 -4
- package/dist/esm/RadioGroup.js +2 -3
- package/dist/esm/Range.js +7 -7
- package/dist/esm/Rate.js +3 -3
- package/dist/esm/Row.js +2 -2
- package/dist/esm/SearchBar.js +3 -3
- package/dist/esm/ShortPassword.js +5 -4
- package/dist/esm/SideNavBar/style/index.js +2 -0
- package/dist/esm/SideNavBar.js +14 -0
- package/dist/esm/SideNavBarItem/style/index.js +2 -0
- package/dist/esm/SideNavBarItem.js +3 -0
- package/dist/esm/Signature.js +4 -4
- package/dist/esm/Skeleton.js +3 -3
- package/dist/esm/Step.js +3 -3
- package/dist/esm/SubSideNavBar/style/index.js +2 -0
- package/dist/esm/SubSideNavBar.js +4 -0
- package/dist/esm/Swiper.js +2 -2
- package/dist/esm/SwiperItem.js +2 -2
- package/dist/esm/TabPane.js +2 -2
- package/dist/esm/TabbarItem.js +3 -3
- package/dist/esm/Table/style/index.js +2 -0
- package/dist/esm/Table.js +9 -0
- package/dist/esm/Tabs.js +3 -3
- package/dist/esm/Tag.js +3 -3
- package/dist/esm/TextArea.js +2 -2
- package/dist/esm/TimeSelect.js +5 -4
- package/dist/esm/Toast.js +4 -4
- package/dist/esm/Uploader.js +3 -3
- package/dist/esm/{actionsheet.taro-4ae40ea0.js → actionsheet.taro-f4d407b0.js} +1 -1
- package/dist/esm/{address.taro-82a8fa11.js → address.taro-a1092e30.js} +78 -30
- package/dist/esm/{animatingnumbers.taro-cda438cc.js → animatingnumbers.taro-877baa98.js} +20 -15
- package/dist/esm/{avatar.taro-5dafffdc.js → avatar.taro-0a0472fd.js} +1 -2
- package/dist/esm/{avatargroup.taro-a39282b3.js → avatargroup-65173caa.js} +0 -0
- package/dist/esm/{backtop.taro-65dccd86.js → backtop.taro-0e2e3946.js} +8 -6
- package/dist/esm/{badge.taro-8c001377.js → badge.taro-eeac9de8.js} +5 -5
- package/dist/esm/{barrage.taro-f1139b9c.js → barrage.taro-efac8422.js} +42 -19
- package/dist/esm/{button.taro-90c8bb93.js → button-521a516b.js} +1 -1
- package/dist/esm/{button-9b1f3219.js → button.taro-d5968f9d.js} +1 -1
- package/dist/esm/{calendar.taro-d3a90861.js → calendar.taro-4b2103c1.js} +6 -2
- package/dist/esm/{calendaritem.taro-bbe4a226.js → calendaritem.taro-fe84d94b.js} +23 -71
- package/dist/esm/{card.taro-c4f88500.js → card.taro-0861c7b3.js} +2 -2
- package/dist/esm/{cell.taro-8080af48.js → cell.taro-3bb1b0f2.js} +1 -1
- package/dist/esm/{checkbox.taro-7267be92.js → checkbox.taro-6fbc4b3c.js} +55 -10
- package/dist/esm/{checkboxgroup.taro-bc16131f.js → checkboxgroup.taro-3d380042.js} +26 -4
- package/dist/esm/{col.taro-ff3af36f.js → col.taro-2a437387.js} +6 -2
- package/dist/esm/{collapse.taro-5fac953d.js → collapse.taro-72e58ba2.js} +1 -0
- package/dist/esm/{collapseitem.taro-179cf530.js → collapseitem-5556ec54.js} +14 -13
- package/dist/esm/{datepicker.taro-f7c8ef80.js → datepicker.taro-c1249537.js} +7 -5
- package/dist/esm/{dialog.taro-57f6fc2e.js → dialog.taro-5b850861.js} +1 -1
- package/dist/esm/{divider.taro-beaec14a.js → divider.taro-5236fe6a.js} +6 -3
- package/dist/esm/{drag.taro-7c0493f8.js → drag.taro-56e8c87a.js} +1 -1
- package/dist/esm/{elevator.taro-e37a3fbb.js → elevator.taro-15b0d8c2.js} +139 -39
- package/dist/esm/{empty.taro-c7ccac8a.js → empty.taro-6f86eda5.js} +2 -2
- package/dist/esm/{fixednav.taro-5b473df6.js → fixednav.taro-ca94fd6a.js} +3 -3
- package/dist/esm/{icon-62bd7379.js → icon-8dc4de10.js} +9 -9
- package/dist/esm/{icon.taro-bf130544.js → icon.taro-1d0d4fb7.js} +11 -9
- package/dist/esm/{infiniteloading.taro-abf15a17.js → infiniteloading.taro-d2c0ca14.js} +1 -1
- package/dist/esm/input.taro-2e31ebbb.js +392 -0
- package/dist/esm/{inputnumber.taro-4ec2bfb6.js → inputnumber.taro-75662231.js} +17 -18
- package/dist/esm/navbar.taro-f2eae6a6.js +123 -0
- package/dist/esm/{noticebar.taro-70193e5e.js → noticebar.taro-ae593896.js} +74 -41
- package/dist/esm/{notify.taro-837a878b.js → notify.taro-95b5f97e.js} +19 -4
- package/dist/esm/{numberkeyboard.taro-a80cec74.js → numberkeyboard.taro-71b2e0eb.js} +1 -1
- package/dist/esm/nutui-react.es.js +69 -65
- package/dist/esm/offsetContext-0e3d04b3.js +19 -0
- package/dist/esm/{picker.taro-c05b1930.js → picker.taro-0eb8bfa3.js} +7 -5
- package/dist/esm/{pickerSlot-c8f5343e.js → pickerSlot-f8e4e542.js} +9 -6
- package/dist/esm/{popover.taro-3b06163e.js → popover.taro-4c102df6.js} +142 -105
- package/dist/esm/{popup-15922d84.js → popup-67173ec6.js} +55 -31
- package/dist/esm/{popup.taro-897e35fd.js → popup.taro-a89dd3a1.js} +55 -31
- package/dist/esm/{progress.taro-51bcdd4f.js → progress.taro-dd93ac38.js} +1 -1
- package/dist/esm/radio.taro-32cb0172.js +129 -0
- package/dist/esm/{radiogroup.taro-f2401b7a.js → radiogroup-e698d3df.js} +5 -2
- package/dist/esm/{range.taro-41ced357.js → range.taro-034fcf7a.js} +188 -20
- package/dist/esm/{rate.taro-3d6edec3.js → rate.taro-a0b21714.js} +6 -2
- package/dist/esm/{row.taro-7afb510a.js → row.taro-cec13a7e.js} +9 -3
- package/dist/esm/{searchbar.taro-b05ef5a8.js → searchbar.taro-4c6091cb.js} +1 -1
- package/dist/esm/{shortpassword.taro-aad27ce9.js → shortpassword.taro-ce46b9cd.js} +2 -2
- package/dist/esm/sidenavbar.taro-36f1e118.js +65 -0
- package/dist/esm/sidenavbaritem.taro-77e077f4.js +32 -0
- package/dist/esm/{signature.taro-454c5413.js → signature.taro-45aedfa9.js} +1 -1
- package/dist/esm/{skeleton.taro-b2831f6f.js → skeleton.taro-5934c7d7.js} +6 -7
- package/dist/esm/{step.taro-33775bf4.js → step-9a048771.js} +1 -1
- package/dist/esm/subsidenavbar.taro-2c1fcf16.js +94 -0
- package/dist/esm/{swiper.taro-624d2cf2.js → swiper.taro-59bf2777.js} +37 -13
- package/dist/esm/{swiperitem.taro-984e3ebb.js → swiperitem-d00e7513.js} +1 -15
- package/dist/esm/{tabbaritem.taro-898becb1.js → tabbaritem.taro-a88d3ae7.js} +1 -1
- package/dist/esm/table.taro-49009dfc.js +153 -0
- package/dist/esm/{tabpane.taro-24514060.js → tabpane.taro-95aa185b.js} +3 -2
- package/dist/esm/{tabs.taro-56a953f6.js → tabs.taro-d1e85ea5.js} +15 -5
- package/dist/esm/{tag.taro-77cf134f.js → tag.taro-3bbbb557.js} +2 -2
- package/dist/esm/{textarea.taro-5d4efaf0.js → textarea.taro-0c40e966.js} +5 -2
- package/dist/esm/{timeselect.taro-e4c97354.js → timeselect.taro-c35d3490.js} +1 -1
- package/dist/esm/{toast.taro-b7ff92f1.js → toast.taro-48539c09.js} +1 -1
- package/dist/esm/{uploader.taro-5fab7e14.js → uploader.taro-ece83a00.js} +3 -3
- package/dist/esm/{index-31152350.js → useTouch-a2ea68c6.js} +26 -12
- 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/nutui.react.es.js +2406 -1269
- package/dist/nutui.react.umd.js +17 -20
- package/dist/packages/address/address.scss +9 -2
- package/dist/packages/col/col.scss +6 -6
- package/dist/packages/icon/icon.scss +104 -12
- package/dist/packages/noticebar/noticebar.scss +31 -15
- package/dist/packages/notify/notify.scss +9 -0
- package/dist/packages/popover/popover.scss +205 -83
- package/dist/packages/range/range.scss +141 -13
- package/dist/packages/sidenavbar/sidenavbar.scss +69 -0
- package/dist/packages/sidenavbaritem/sidenavbaritem.scss +8 -0
- package/dist/packages/subsidenavbar/subsidenavbar.scss +23 -0
- package/dist/packages/swiper/swiper.scss +3 -0
- package/dist/packages/table/table.scss +81 -0
- package/dist/packages/toast/toast.scss +16 -13
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/animation/icon.scss +245 -0
- package/dist/styles/animation/index.scss +1 -0
- package/dist/styles/font/config.json +169 -0
- package/dist/styles/font/demo_index.html +210 -3
- package/dist/styles/font/iconfont.css +39 -3
- package/dist/styles/font/iconfont.js +32 -32
- package/dist/styles/font/iconfont.json +63 -0
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/themes/default.scss +4 -0
- package/dist/styles/variables.scss +43 -14
- package/dist/types/address/address.taro.d.ts +4 -27
- package/dist/types/animatingnumbers/animatingnumbers.taro.d.ts +1 -1
- package/dist/types/animatingnumbers/countup.taro.d.ts +11 -0
- package/dist/types/avatargroup/index.taro.d.ts +1 -1
- package/dist/types/backtop/backtop.taro.d.ts +4 -4
- package/dist/types/badge/badge.taro.d.ts +2 -1
- package/dist/types/card/card.taro.d.ts +4 -4
- package/dist/types/cellgroup/cellgroup.taro.d.ts +1 -0
- package/dist/types/checkbox/checkbox.taro.d.ts +4 -0
- package/dist/types/checkboxgroup/checkboxgroup.taro.d.ts +1 -0
- package/dist/types/col/col.taro.d.ts +4 -1
- package/dist/types/collapse/collapse.taro.d.ts +2 -1
- package/dist/types/collapseitem/index.taro.d.ts +1 -1
- package/dist/types/elevator/elevator.taro.d.ts +6 -1
- package/dist/types/fixednav/fixednav.taro.d.ts +5 -5
- package/dist/types/icon/icon.taro.d.ts +10 -3
- package/dist/types/input/input.taro.d.ts +42 -5
- package/dist/types/navbar/navbar.taro.d.ts +10 -4
- package/dist/types/noticebar/noticebar.taro.d.ts +1 -1
- package/dist/types/nutui.react.d.ts +5 -1
- package/dist/types/picker/picker.taro.d.ts +1 -0
- package/dist/types/popover/popover.taro.d.ts +15 -7
- package/dist/types/popup/popup.taro.d.ts +2 -0
- package/dist/types/radiogroup/index.taro.d.ts +1 -1
- package/dist/types/range/range.taro.d.ts +3 -1
- package/dist/types/row/row.taro.d.ts +4 -1
- package/dist/types/sidenavbar/index.taro.d.ts +2 -0
- package/dist/types/sidenavbar/sidenavbar.taro.d.ts +3 -0
- package/dist/types/sidenavbaritem/index.taro.d.ts +2 -0
- package/dist/types/sidenavbaritem/sidenavbaritem.taro.d.ts +3 -0
- package/dist/types/skeleton/skeleton.taro.d.ts +1 -0
- package/dist/types/step/index.taro.d.ts +1 -1
- package/dist/types/subsidenavbar/index.taro.d.ts +2 -0
- package/dist/types/subsidenavbar/subsidenavbar.taro.d.ts +3 -0
- package/dist/types/swiper/swiper.taro.d.ts +1 -0
- package/dist/types/swiperitem/index.taro.d.ts +1 -1
- package/dist/types/tabbar/tabbar.taro.d.ts +1 -0
- package/dist/types/table/index.taro.d.ts +2 -0
- package/dist/types/table/table.taro.d.ts +3 -0
- package/dist/types/tabpane/tabpane.taro.d.ts +3 -1
- package/dist/types/tabs/tabs.taro.d.ts +2 -0
- package/dist/types/tag/tag.taro.d.ts +2 -1
- package/package.json +15 -8
- package/dist/esm/context-aa058329.js +0 -6
- package/dist/esm/input.taro-b6927020.js +0 -190
- package/dist/esm/navbar.taro-f2ba2cf4.js +0 -66
- package/dist/esm/radio.taro-923d91bc.js +0 -200
- package/dist/packages/range/custom.scss +0 -9
- package/dist/types/actionsheet/demo.taro.d.ts +0 -6
- package/dist/types/address/demo.taro.d.ts +0 -3
- package/dist/types/animatingnumbers/demo.taro.d.ts +0 -3
- package/dist/types/avatar/demo.taro.d.ts +0 -4
- package/dist/types/avatargroup/avatargroup.taro.d.ts +0 -14
- package/dist/types/backtop/demo.taro.d.ts +0 -3
- package/dist/types/badge/demo.taro.d.ts +0 -3
- package/dist/types/barrage/demo.taro.d.ts +0 -4
- package/dist/types/button/demo.taro.d.ts +0 -3
- package/dist/types/calendar/demo.taro.d.ts +0 -3
- package/dist/types/card/demo.taro.d.ts +0 -3
- package/dist/types/cell/demo.taro.d.ts +0 -3
- package/dist/types/checkbox/demo.taro.d.ts +0 -3
- package/dist/types/circleprogress/demo.taro.d.ts +0 -4
- package/dist/types/collapse/demo.taro.d.ts +0 -3
- package/dist/types/collapseitem/collapseitem.taro.d.ts +0 -18
- package/dist/types/configprovider/demo.taro.d.ts +0 -3
- package/dist/types/countdown/demo.taro.d.ts +0 -3
- package/dist/types/datepicker/demo.taro.d.ts +0 -3
- package/dist/types/dialog/demo.taro.d.ts +0 -3
- package/dist/types/divider/demo.taro.d.ts +0 -3
- package/dist/types/drag/demo.taro.d.ts +0 -3
- package/dist/types/elevator/demo.taro.d.ts +0 -3
- package/dist/types/empty/demo.taro.d.ts +0 -4
- package/dist/types/fixednav/demo.taro.d.ts +0 -3
- package/dist/types/icon/demo.taro.d.ts +0 -3
- package/dist/types/indicator/demo.taro.d.ts +0 -4
- package/dist/types/infiniteloading/demo.taro.d.ts +0 -4
- package/dist/types/input/demo.taro.d.ts +0 -3
- package/dist/types/inputnumber/demo.taro.d.ts +0 -3
- package/dist/types/layout/demo.taro.d.ts +0 -4
- package/dist/types/navbar/demo.taro.d.ts +0 -3
- package/dist/types/noticebar/demo.taro.d.ts +0 -3
- package/dist/types/notify/demo.taro.d.ts +0 -3
- package/dist/types/numberkeyboard/demo.taro.d.ts +0 -3
- package/dist/types/overlay/demo.taro.d.ts +0 -4
- package/dist/types/pagination/demo.taro.d.ts +0 -3
- package/dist/types/picker/demo.taro.d.ts +0 -3
- package/dist/types/popover/demo.taro.d.ts +0 -3
- package/dist/types/popup/demo.taro.d.ts +0 -4
- package/dist/types/price/demo.taro.d.ts +0 -3
- package/dist/types/progress/demo.taro.d.ts +0 -3
- package/dist/types/radio/demo.taro.d.ts +0 -3
- package/dist/types/radiogroup/radiogroup.taro.d.ts +0 -11
- package/dist/types/range/demo.taro.d.ts +0 -3
- package/dist/types/rate/demo.taro.d.ts +0 -3
- package/dist/types/searchbar/demo.taro.d.ts +0 -3
- package/dist/types/shortpassword/demo.taro.d.ts +0 -3
- package/dist/types/signature/demo.taro.d.ts +0 -3
- package/dist/types/skeleton/demo.taro.d.ts +0 -4
- package/dist/types/step/step.taro.d.ts +0 -13
- package/dist/types/steps/demo.taro.d.ts +0 -4
- package/dist/types/swiper/demo.taro.d.ts +0 -4
- package/dist/types/swiperitem/swiperitem.taro.d.ts +0 -7
- package/dist/types/switch/demo.taro.d.ts +0 -3
- package/dist/types/tabbar/demo.taro.d.ts +0 -3
- package/dist/types/tabs/demo.taro.d.ts +0 -3
- package/dist/types/tag/demo.taro.d.ts +0 -3
- package/dist/types/textarea/demo.taro.d.ts +0 -3
- package/dist/types/timedetail/demo.taro.d.ts +0 -3
- package/dist/types/timepannel/demo.taro.d.ts +0 -3
- package/dist/types/timeselect/demo.taro.d.ts +0 -3
- package/dist/types/toast/demo.taro.d.ts +0 -3
- package/dist/types/uploader/demo.taro.d.ts +0 -16
- package/dist/types/virtuallist/demo.taro.d.ts +0 -3
|
@@ -9,7 +9,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
9
9
|
|
|
10
10
|
import React__default, { useRef, useState, useEffect } from 'react';
|
|
11
11
|
import classNames from 'classnames';
|
|
12
|
-
import { I as Icon } from './icon-
|
|
12
|
+
import { I as Icon } from './icon-8dc4de10.js';
|
|
13
13
|
import { c as cn } from './bem-893ad28d.js';
|
|
14
14
|
var defaultProps = {
|
|
15
15
|
// 滚动方向 across 横向 vertical 纵向
|
|
@@ -25,7 +25,7 @@ var defaultProps = {
|
|
|
25
25
|
color: '',
|
|
26
26
|
background: '',
|
|
27
27
|
delay: 1,
|
|
28
|
-
scrollable:
|
|
28
|
+
scrollable: null,
|
|
29
29
|
speed: 50
|
|
30
30
|
};
|
|
31
31
|
|
|
@@ -102,6 +102,11 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
102
102
|
timer = _useState18[0],
|
|
103
103
|
SetTimer = _useState18[1];
|
|
104
104
|
|
|
105
|
+
var _useState19 = useState(null),
|
|
106
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
107
|
+
isCanScroll = _useState20[0],
|
|
108
|
+
SetIsCanScroll = _useState20[1];
|
|
109
|
+
|
|
105
110
|
useState(0);
|
|
106
111
|
useEffect(function () {
|
|
107
112
|
if (direction === 'vertical') {
|
|
@@ -132,12 +137,14 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
132
137
|
|
|
133
138
|
var cloneChild = function cloneChild(listItem, listIndex) {
|
|
134
139
|
return React__default.Children.map(children, function (child, index) {
|
|
135
|
-
if (child && index
|
|
140
|
+
if (child && index === listIndex) {
|
|
136
141
|
return React__default.cloneElement(child, {
|
|
137
142
|
key: listIndex,
|
|
138
143
|
children: listItem
|
|
139
144
|
});
|
|
140
145
|
}
|
|
146
|
+
|
|
147
|
+
return null;
|
|
141
148
|
});
|
|
142
149
|
};
|
|
143
150
|
|
|
@@ -156,7 +163,7 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
156
163
|
}
|
|
157
164
|
|
|
158
165
|
setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
159
|
-
var
|
|
166
|
+
var warpRes, contentRes, wrapW, offsetW, canScroll;
|
|
160
167
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
161
168
|
while (1) {
|
|
162
169
|
switch (_context.prev = _context.next) {
|
|
@@ -173,16 +180,18 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
173
180
|
return wrap.current.getBoundingClientRect();
|
|
174
181
|
|
|
175
182
|
case 4:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
_context.next = 8;
|
|
183
|
+
warpRes = _context.sent;
|
|
184
|
+
_context.next = 7;
|
|
179
185
|
return content.current.getBoundingClientRect();
|
|
180
186
|
|
|
181
|
-
case
|
|
187
|
+
case 7:
|
|
182
188
|
contentRes = _context.sent;
|
|
189
|
+
wrapW = warpRes.width;
|
|
183
190
|
offsetW = contentRes.width;
|
|
191
|
+
canScroll = scrollable == null ? offsetW > wrapW : scrollable;
|
|
192
|
+
SetIsCanScroll(canScroll);
|
|
184
193
|
|
|
185
|
-
if (
|
|
194
|
+
if (canScroll) {
|
|
186
195
|
SetWrapWidth(wrapW);
|
|
187
196
|
SetOffsetW(offsetW);
|
|
188
197
|
SetDuration(offsetW / speed);
|
|
@@ -191,13 +200,13 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
191
200
|
SetAnimationClass('');
|
|
192
201
|
}
|
|
193
202
|
|
|
194
|
-
case
|
|
203
|
+
case 13:
|
|
195
204
|
case "end":
|
|
196
205
|
return _context.stop();
|
|
197
206
|
}
|
|
198
207
|
}
|
|
199
208
|
}, _callee);
|
|
200
|
-
})));
|
|
209
|
+
})), 0);
|
|
201
210
|
};
|
|
202
211
|
|
|
203
212
|
var handleClick = function handleClick(event) {
|
|
@@ -274,27 +283,49 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
274
283
|
|
|
275
284
|
var handleClickIcon = function handleClickIcon() {
|
|
276
285
|
close && close(scrollList[0]);
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
var iconShow = function iconShow() {
|
|
289
|
+
if (leftIcon === 'close') {
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
return true;
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
var iconBg = function iconBg() {
|
|
297
|
+
var iconBg = '';
|
|
298
|
+
|
|
299
|
+
if (leftIcon) {
|
|
300
|
+
iconBg = leftIcon;
|
|
301
|
+
}
|
|
283
302
|
|
|
303
|
+
return iconBg;
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
var isEllipsis = function isEllipsis() {
|
|
307
|
+
if (isCanScroll == null) {
|
|
308
|
+
return wrapable;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
return !isCanScroll && !wrapable;
|
|
312
|
+
};
|
|
284
313
|
|
|
285
314
|
var contentStyle = {
|
|
286
|
-
paddingLeft: firstRound ? 0 :
|
|
287
|
-
animationDelay: "".concat(firstRound ?
|
|
288
|
-
animationDuration: "".concat(duration, "s")
|
|
315
|
+
// paddingLeft: firstRound ? 0 : `${wrapWidth}px`,
|
|
316
|
+
animationDelay: "".concat(firstRound ? delay : 0, "s"),
|
|
317
|
+
animationDuration: "".concat(duration, "s"),
|
|
318
|
+
transform: "translateX(".concat(firstRound ? 0 : "".concat(wrapWidth, "px"), ")")
|
|
289
319
|
};
|
|
290
320
|
var barStyle = {
|
|
291
321
|
color: color,
|
|
292
322
|
background: background,
|
|
293
|
-
height: direction
|
|
323
|
+
height: direction === 'vertical' ? "".concat(height, "px") : ''
|
|
294
324
|
};
|
|
325
|
+
var duringTime = ~~(height / speed / 4);
|
|
295
326
|
var horseLampStyle = {
|
|
296
327
|
transform: complexAm ? "translateY(".concat(distance, "px)") : '',
|
|
297
|
-
transition: animate ? "all ".concat(~~(height / speed
|
|
328
|
+
transition: animate ? "all ".concat(duringTime === 0 ? ~~(height / speed) : duringTime, "s") : '',
|
|
298
329
|
marginTop: animate ? "-".concat(height, "px") : ''
|
|
299
330
|
};
|
|
300
331
|
var b = cn('noticebar');
|
|
@@ -307,34 +338,34 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
307
338
|
return React__default.createElement("div", {
|
|
308
339
|
className: "".concat(b(), " ").concat(className || ''),
|
|
309
340
|
style: style
|
|
310
|
-
}, showNoticeBar && direction
|
|
341
|
+
}, showNoticeBar && direction === 'across' ? React__default.createElement("div", {
|
|
311
342
|
className: noticebarClass,
|
|
312
343
|
style: barStyle,
|
|
313
344
|
onClick: handleClick
|
|
314
|
-
}, React__default.createElement("div", {
|
|
345
|
+
}, iconShow() ? React__default.createElement("div", {
|
|
315
346
|
className: "left-icon",
|
|
316
347
|
style: {
|
|
317
|
-
backgroundImage: "url(".concat(
|
|
348
|
+
backgroundImage: "url(".concat(iconBg() || '', ")")
|
|
318
349
|
}
|
|
319
|
-
}, !
|
|
350
|
+
}, !iconBg() ? React__default.createElement(Icon, {
|
|
320
351
|
name: "notice",
|
|
321
352
|
size: "16",
|
|
322
353
|
color: color
|
|
323
|
-
}) : null), React__default.createElement("div", {
|
|
354
|
+
}) : null) : null, React__default.createElement("div", {
|
|
324
355
|
ref: wrap,
|
|
325
356
|
className: "wrap"
|
|
326
357
|
}, React__default.createElement("div", {
|
|
327
358
|
ref: content,
|
|
328
|
-
className: "content ".concat(animationClass, " ").concat(
|
|
359
|
+
className: "content ".concat(animationClass, " ").concat(isEllipsis() && 'nut-ellipsis'),
|
|
329
360
|
style: contentStyle,
|
|
330
361
|
onAnimationEnd: onAnimationEnd
|
|
331
|
-
}, children, text)), closeMode ? React__default.createElement("div", {
|
|
362
|
+
}, children, text)), closeMode || rightIcon ? React__default.createElement("div", {
|
|
332
363
|
className: "right-icon",
|
|
333
364
|
onClick: onClickIcon
|
|
334
365
|
}, React__default.createElement(Icon, {
|
|
335
|
-
name:
|
|
366
|
+
name: rightIcon || 'close',
|
|
336
367
|
color: color
|
|
337
|
-
})) : null) : scrollList.current.length > 0 && direction
|
|
368
|
+
})) : null) : null, scrollList.current.length > 0 && direction === 'vertical' ? React__default.createElement("div", {
|
|
338
369
|
className: "nut-noticebar-vertical",
|
|
339
370
|
style: barStyle
|
|
340
371
|
}, children ? React__default.createElement("div", {
|
|
@@ -346,16 +377,18 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
346
377
|
className: "horseLamp_list",
|
|
347
378
|
style: horseLampStyle
|
|
348
379
|
}, scrollList.current.map(function (item, index) {
|
|
349
|
-
return
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
380
|
+
return (// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
|
|
381
|
+
React__default.createElement("li", {
|
|
382
|
+
className: "horseLamp_list_item",
|
|
383
|
+
style: {
|
|
384
|
+
height: height
|
|
385
|
+
},
|
|
386
|
+
key: index,
|
|
387
|
+
onClick: function onClick() {
|
|
388
|
+
go(item);
|
|
389
|
+
}
|
|
390
|
+
}, item)
|
|
391
|
+
);
|
|
359
392
|
})), React__default.createElement("div", {
|
|
360
393
|
className: "go",
|
|
361
394
|
onClick: function onClick() {
|
|
@@ -105,11 +105,14 @@ var Notification = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
105
105
|
color = _this$props.color,
|
|
106
106
|
background = _this$props.background,
|
|
107
107
|
type = _this$props.type,
|
|
108
|
-
className = _this$props.className
|
|
108
|
+
className = _this$props.className,
|
|
109
|
+
position = _this$props.position,
|
|
110
|
+
isWrapTeleport = _this$props.isWrapTeleport;
|
|
109
111
|
this.state;
|
|
110
112
|
cn('notify');
|
|
111
113
|
var classes = classNames(_defineProperty({
|
|
112
|
-
'popup-top':
|
|
114
|
+
'popup-top': position === 'top',
|
|
115
|
+
'popup-bottom': position === 'bottom',
|
|
113
116
|
'nut-notify': true
|
|
114
117
|
}, "nut-notify--".concat(type), true));
|
|
115
118
|
return React.createElement(React.Fragment, null, React.createElement(CSSTransition, {
|
|
@@ -117,7 +120,9 @@ var Notification = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
117
120
|
timeout: 300,
|
|
118
121
|
classNames: "fade",
|
|
119
122
|
unmountOnExit: true,
|
|
120
|
-
appear: true
|
|
123
|
+
appear: true,
|
|
124
|
+
position: position,
|
|
125
|
+
isWrapTeleport: isWrapTeleport
|
|
121
126
|
}, React.createElement("div", {
|
|
122
127
|
className: "".concat(classes, " ").concat(className),
|
|
123
128
|
style: {
|
|
@@ -169,8 +174,11 @@ var options = {
|
|
|
169
174
|
msg: '',
|
|
170
175
|
id: '',
|
|
171
176
|
duration: 3000,
|
|
177
|
+
color: '',
|
|
172
178
|
type: 'danger',
|
|
173
179
|
className: '',
|
|
180
|
+
position: 'top',
|
|
181
|
+
isWrapTeleport: true,
|
|
174
182
|
onClosed: function onClosed() {},
|
|
175
183
|
onClick: function onClick() {}
|
|
176
184
|
};
|
|
@@ -187,7 +195,12 @@ function getInstance(props, callback) {
|
|
|
187
195
|
}
|
|
188
196
|
|
|
189
197
|
function notice(opts) {
|
|
190
|
-
|
|
198
|
+
// function close() {
|
|
199
|
+
// if (messageInstance) {
|
|
200
|
+
// messageInstance.destroy()
|
|
201
|
+
// messageInstance = null
|
|
202
|
+
// }
|
|
203
|
+
// }
|
|
191
204
|
opts = _objectSpread(_objectSpread({}, options), opts);
|
|
192
205
|
getInstance(opts, function (notification) {
|
|
193
206
|
messageInstance = notification;
|
|
@@ -197,6 +210,8 @@ function notice(opts) {
|
|
|
197
210
|
var errorMsg = function errorMsg(msg) {
|
|
198
211
|
if (!msg) {
|
|
199
212
|
console.warn('[NutUI Notify]: msg不能为空');
|
|
213
|
+
} else {
|
|
214
|
+
console.log('ok');
|
|
200
215
|
}
|
|
201
216
|
};
|
|
202
217
|
|
|
@@ -9,7 +9,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
9
9
|
import React__default, { useState, useEffect } from 'react';
|
|
10
10
|
import classNames from 'classnames';
|
|
11
11
|
import { c as cn } from './bem-893ad28d.js';
|
|
12
|
-
import { P as Popup } from './popup-
|
|
12
|
+
import { P as Popup } from './popup-67173ec6.js';
|
|
13
13
|
import { u as useConfig } from './configprovider-18657611.js';
|
|
14
14
|
var defaultProps = {
|
|
15
15
|
confirmText: '',
|
|
@@ -1,98 +1,102 @@
|
|
|
1
|
-
export { B as Button } from './button.taro-
|
|
2
|
-
export { C as Cell } from './cell.taro-
|
|
1
|
+
export { B as Button } from './button.taro-d5968f9d.js';
|
|
2
|
+
export { C as Cell } from './cell.taro-3bb1b0f2.js';
|
|
3
3
|
export { C as CellGroup } from './cellgroup.taro-8c87bf08.js';
|
|
4
|
-
export { I as Icon } from './icon.taro-
|
|
4
|
+
export { I as Icon } from './icon.taro-1d0d4fb7.js';
|
|
5
5
|
export { O as Overlay } from './overlay.taro-a784329e.js';
|
|
6
|
-
export { P as Popup } from './popup.taro-
|
|
6
|
+
export { P as Popup } from './popup.taro-a89dd3a1.js';
|
|
7
7
|
export { C as ConfigProvider } from './configprovider.taro-98343012.js';
|
|
8
8
|
export { L as Layout } from './layout.taro-358f014f.js';
|
|
9
|
-
export { C as Col } from './col.taro-
|
|
10
|
-
export { R as Row } from './row.taro-
|
|
11
|
-
export { D as Divider } from './divider.taro-
|
|
12
|
-
export { N as NavBar } from './navbar.taro-
|
|
13
|
-
export { F as FixedNav } from './fixednav.taro-
|
|
9
|
+
export { C as Col } from './col.taro-2a437387.js';
|
|
10
|
+
export { R as Row } from './row.taro-cec13a7e.js';
|
|
11
|
+
export { D as Divider } from './divider.taro-5236fe6a.js';
|
|
12
|
+
export { N as NavBar } from './navbar.taro-f2eae6a6.js';
|
|
13
|
+
export { F as FixedNav } from './fixednav.taro-ca94fd6a.js';
|
|
14
14
|
export { T as Tabbar } from './tabbar.taro-da72fa2c.js';
|
|
15
|
-
export { T as TabbarItem } from './tabbaritem.taro-
|
|
16
|
-
export { E as Elevator } from './elevator.taro-
|
|
15
|
+
export { T as TabbarItem } from './tabbaritem.taro-a88d3ae7.js';
|
|
16
|
+
export { E as Elevator } from './elevator.taro-15b0d8c2.js';
|
|
17
17
|
export { P as Pagination } from './pagination.taro-abc4a71e.js';
|
|
18
|
-
export { T as Tabs } from './tabs.taro-
|
|
19
|
-
export { T as TabPane } from './tabpane.taro-
|
|
18
|
+
export { T as Tabs } from './tabs.taro-d1e85ea5.js';
|
|
19
|
+
export { T as TabPane } from './tabpane.taro-95aa185b.js';
|
|
20
20
|
export { I as Indicator } from './indicator.taro-183ea169.js';
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
36
|
-
export { S as
|
|
37
|
-
export {
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
export {
|
|
41
|
-
export {
|
|
42
|
-
export {
|
|
43
|
-
export {
|
|
21
|
+
export { S as SideNavBar } from './sidenavbar.taro-36f1e118.js';
|
|
22
|
+
export { S as SubSideNavBar } from './subsidenavbar.taro-2c1fcf16.js';
|
|
23
|
+
export { S as SideNavBarItem } from './sidenavbaritem.taro-77e077f4.js';
|
|
24
|
+
export { R as Range } from './range.taro-034fcf7a.js';
|
|
25
|
+
export { C as Calendar } from './calendar.taro-4b2103c1.js';
|
|
26
|
+
export { C as Checkbox } from './checkbox.taro-6fbc4b3c.js';
|
|
27
|
+
export { C as CheckboxGroup } from './checkboxgroup.taro-3d380042.js';
|
|
28
|
+
export { D as DatePicker } from './datepicker.taro-c1249537.js';
|
|
29
|
+
export { I as InputNumber } from './inputnumber.taro-75662231.js';
|
|
30
|
+
export { I as Input } from './input.taro-2e31ebbb.js';
|
|
31
|
+
export { R as Radio } from './radio.taro-32cb0172.js';
|
|
32
|
+
export { R as RadioGroup } from './radiogroup-e698d3df.js';
|
|
33
|
+
export { R as Rate } from './rate.taro-a0b21714.js';
|
|
34
|
+
export { C as CalendarItem } from './calendaritem.taro-fe84d94b.js';
|
|
35
|
+
export { P as Picker } from './picker.taro-0eb8bfa3.js';
|
|
36
|
+
export { S as ShortPassword } from './shortpassword.taro-ce46b9cd.js';
|
|
37
|
+
export { T as TextArea } from './textarea.taro-0c40e966.js';
|
|
38
|
+
export { U as Uploader } from './uploader.taro-ece83a00.js';
|
|
39
|
+
export { S as SearchBar } from './searchbar.taro-4c6091cb.js';
|
|
40
|
+
export { N as NumberKeyboard } from './numberkeyboard.taro-71b2e0eb.js';
|
|
41
|
+
export { A as ActionSheet } from './actionsheet.taro-f4d407b0.js';
|
|
42
|
+
export { B as BackTop } from './backtop.taro-0e2e3946.js';
|
|
43
|
+
export { D as Drag } from './drag.taro-56e8c87a.js';
|
|
44
|
+
export { D as Dialog } from './dialog.taro-5b850861.js';
|
|
45
|
+
export { I as Infiniteloading } from './infiniteloading.taro-d2c0ca14.js';
|
|
46
|
+
export { N as Notify } from './notify.taro-95b5f97e.js';
|
|
44
47
|
export { S as Switch } from './switch.taro-be5eb823.js';
|
|
45
|
-
export { T as Toast } from './toast.taro-
|
|
48
|
+
export { T as Toast } from './toast.taro-48539c09.js';
|
|
46
49
|
export { C as CircleProgress } from './circleprogress.taro-1a38e1c6.js';
|
|
47
|
-
export { N as NoticeBar } from './noticebar.taro-
|
|
50
|
+
export { N as NoticeBar } from './noticebar.taro-ae593896.js';
|
|
48
51
|
export { S as Steps } from './steps.taro-943f4fbb.js';
|
|
49
|
-
export { S as Step } from './step
|
|
50
|
-
export { S as Swiper } from './swiper.taro-
|
|
51
|
-
export { S as SwiperItem } from './swiperitem
|
|
52
|
-
export { A as Avatar } from './avatar.taro-
|
|
53
|
-
export { A as AvatarGroup } from './avatargroup
|
|
52
|
+
export { S as Step } from './step-9a048771.js';
|
|
53
|
+
export { S as Swiper } from './swiper.taro-59bf2777.js';
|
|
54
|
+
export { S as SwiperItem } from './swiperitem-d00e7513.js';
|
|
55
|
+
export { A as Avatar } from './avatar.taro-0a0472fd.js';
|
|
56
|
+
export { A as AvatarGroup } from './avatargroup-65173caa.js';
|
|
54
57
|
export { P as Price } from './price.taro-97393d8f.js';
|
|
55
|
-
export { B as Badge } from './badge.taro-
|
|
56
|
-
export { T as Tag } from './tag.taro-
|
|
57
|
-
export { P as Popover } from './popover.taro-
|
|
58
|
-
export { S as Skeleton } from './skeleton.taro-
|
|
58
|
+
export { B as Badge } from './badge.taro-eeac9de8.js';
|
|
59
|
+
export { T as Tag } from './tag.taro-3bbbb557.js';
|
|
60
|
+
export { P as Popover } from './popover.taro-4c102df6.js';
|
|
61
|
+
export { S as Skeleton } from './skeleton.taro-5934c7d7.js';
|
|
59
62
|
export { C as CountDown } from './countdown.taro-cd6a1bd4.js';
|
|
60
|
-
export { C as Collapse } from './collapse.taro-
|
|
61
|
-
export { C as CollapseItem } from './collapseitem
|
|
62
|
-
export { A as AnimatingNumbers } from './animatingnumbers.taro-
|
|
63
|
-
export { E as Empty } from './empty.taro-
|
|
63
|
+
export { C as Collapse } from './collapse.taro-72e58ba2.js';
|
|
64
|
+
export { C as CollapseItem } from './collapseitem-5556ec54.js';
|
|
65
|
+
export { A as AnimatingNumbers } from './animatingnumbers.taro-877baa98.js';
|
|
66
|
+
export { E as Empty } from './empty.taro-6f86eda5.js';
|
|
64
67
|
export { V as VirtualList } from './virtuallist.taro-2ff1a5ad.js';
|
|
68
|
+
export { T as Table } from './table.taro-49009dfc.js';
|
|
65
69
|
export { V as Video } from './video-c1090c92.js';
|
|
66
|
-
export { P as Progress } from './progress.taro-
|
|
67
|
-
export { A as Address } from './address.taro-
|
|
68
|
-
export { B as Barrage } from './barrage.taro-
|
|
69
|
-
export { S as Signature } from './signature.taro-
|
|
70
|
-
export { C as Card } from './card.taro-
|
|
70
|
+
export { P as Progress } from './progress.taro-dd93ac38.js';
|
|
71
|
+
export { A as Address } from './address.taro-a1092e30.js';
|
|
72
|
+
export { B as Barrage } from './barrage.taro-efac8422.js';
|
|
73
|
+
export { S as Signature } from './signature.taro-45aedfa9.js';
|
|
74
|
+
export { C as Card } from './card.taro-0861c7b3.js';
|
|
71
75
|
export { T as TimePannel } from './timepannel.taro-2d54b3db.js';
|
|
72
76
|
export { T as TimeDetail } from './timedetail.taro-0e31b4a5.js';
|
|
73
|
-
export { T as TimeSelect } from './timeselect.taro-
|
|
77
|
+
export { T as TimeSelect } from './timeselect.taro-c35d3490.js';
|
|
74
78
|
import 'react';
|
|
75
|
-
import './icon-
|
|
79
|
+
import './icon-8dc4de10.js';
|
|
76
80
|
import './bem-893ad28d.js';
|
|
77
81
|
import '@bem-react/classname';
|
|
78
82
|
import 'react-router-dom';
|
|
79
83
|
import '@tarojs/taro';
|
|
80
84
|
import 'classnames';
|
|
85
|
+
import 'react-dom';
|
|
81
86
|
import 'react-transition-group';
|
|
82
87
|
import './overlay-ed3eb37d.js';
|
|
83
88
|
import './zh-CN-f5124686.js';
|
|
84
89
|
import './UserContext-be8097d2.js';
|
|
85
90
|
import './configprovider-18657611.js';
|
|
86
|
-
import './
|
|
87
|
-
import './
|
|
88
|
-
import '
|
|
89
|
-
import './
|
|
91
|
+
import './popup-67173ec6.js';
|
|
92
|
+
import './offsetContext-0e3d04b3.js';
|
|
93
|
+
import './useTouch-a2ea68c6.js';
|
|
94
|
+
import './Notification-dccc7625.js';
|
|
90
95
|
import './raf-3fbb5f92.js';
|
|
91
|
-
import './pickerSlot-
|
|
92
|
-
import './context-aa058329.js';
|
|
96
|
+
import './pickerSlot-f8e4e542.js';
|
|
93
97
|
import '@use-gesture/react';
|
|
94
98
|
import '@react-spring/web';
|
|
95
|
-
import './button-
|
|
99
|
+
import './button-521a516b.js';
|
|
96
100
|
import './UserContext-68f62e66.js';
|
|
97
101
|
import './UserContext-b4181162.js';
|
|
98
102
|
import './AvatarContext-7153ad2b.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
|
|
3
|
+
var handleClick = function handleClick(e) {
|
|
4
|
+
e.stopPropagation();
|
|
5
|
+
var isIcon = e.target.className.includes('arrow-icon');
|
|
6
|
+
var isTitle = e.target.className.includes('__title') || isIcon;
|
|
7
|
+
var currentClass = e.currentTarget.className;
|
|
8
|
+
var isShow = currentClass.includes('nutShow');
|
|
9
|
+
var arrowIcon = e.currentTarget.querySelector('.arrow-icon');
|
|
10
|
+
var iconClass = arrowIcon.className;
|
|
11
|
+
|
|
12
|
+
if (isTitle) {
|
|
13
|
+
e.currentTarget.className = isShow ? currentClass.replace('nutShow', 'nutHide') : currentClass.replace('nutHide', 'nutShow');
|
|
14
|
+
arrowIcon.className = isShow ? iconClass.replace('arrow-down', 'arrow-up') : iconClass.replace('arrow-up', 'arrow-down');
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var OffsetContext = createContext(20);
|
|
19
|
+
export { OffsetContext as O, handleClick as h };
|
|
@@ -2,15 +2,15 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["isVisible", "title", "listData", "defaultValueData", "onConfirm", "onClose", "onCloseUpdate", "onChange", "className", "style", "threeDimensional"];
|
|
5
|
+
var _excluded = ["isVisible", "title", "listData", "defaultValueData", "onConfirm", "onClose", "onCloseUpdate", "onChange", "className", "style", "threeDimensional", "swipeDuration"];
|
|
6
6
|
|
|
7
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
8
|
|
|
9
9
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
10
|
|
|
11
11
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
12
|
-
import { P as Popup } from './popup-
|
|
13
|
-
import { P as PickerSlot } from './pickerSlot-
|
|
12
|
+
import { P as Popup } from './popup-67173ec6.js';
|
|
13
|
+
import { P as PickerSlot } from './pickerSlot-f8e4e542.js';
|
|
14
14
|
import { u as useConfig } from './configprovider-18657611.js';
|
|
15
15
|
import { c as cn } from './bem-893ad28d.js';
|
|
16
16
|
|
|
@@ -30,6 +30,7 @@ var InternalPicker = function InternalPicker(props, ref) {
|
|
|
30
30
|
className = props.className,
|
|
31
31
|
style = props.style,
|
|
32
32
|
threeDimensional = props.threeDimensional,
|
|
33
|
+
swipeDuration = props.swipeDuration,
|
|
33
34
|
rest = _objectWithoutProperties(props, _excluded);
|
|
34
35
|
|
|
35
36
|
var _useState = useState([]),
|
|
@@ -208,8 +209,8 @@ var InternalPicker = function InternalPicker(props, ref) {
|
|
|
208
209
|
var data = [];
|
|
209
210
|
var normalData = normalListData();
|
|
210
211
|
setColumnsList(normalData);
|
|
211
|
-
normalData.map(function (item) {
|
|
212
|
-
data.push(item[0].value);
|
|
212
|
+
normalData.length > 0 && normalData.map(function (item) {
|
|
213
|
+
item[0] && data.push(item[0].value);
|
|
213
214
|
return item;
|
|
214
215
|
});
|
|
215
216
|
|
|
@@ -252,6 +253,7 @@ var InternalPicker = function InternalPicker(props, ref) {
|
|
|
252
253
|
chooseItem: function chooseItem(value, index) {
|
|
253
254
|
return _chooseItem(value, index);
|
|
254
255
|
},
|
|
256
|
+
swipeDuration: swipeDuration,
|
|
255
257
|
key: index,
|
|
256
258
|
keyIndex: index
|
|
257
259
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
3
|
-
import { u as useTouch } from './
|
|
3
|
+
import { u as useTouch } from './useTouch-a2ea68c6.js';
|
|
4
4
|
|
|
5
5
|
var InternalPickerSlot = function InternalPickerSlot(props, ref) {
|
|
6
6
|
var _props$keyIndex = props.keyIndex,
|
|
@@ -10,8 +10,11 @@ var InternalPickerSlot = function InternalPickerSlot(props, ref) {
|
|
|
10
10
|
listData = _props$listData === void 0 ? [] : _props$listData,
|
|
11
11
|
_props$threeDimension = props.threeDimensional,
|
|
12
12
|
threeDimensional = _props$threeDimension === void 0 ? true : _props$threeDimension,
|
|
13
|
+
_props$swipeDuration = props.swipeDuration,
|
|
14
|
+
swipeDuration = _props$swipeDuration === void 0 ? 1000 : _props$swipeDuration,
|
|
13
15
|
chooseItem = props.chooseItem;
|
|
14
|
-
var touch = useTouch();
|
|
16
|
+
var touch = useTouch();
|
|
17
|
+
var DEFAULT_DURATION = 200; // 触发惯性滑动条件:
|
|
15
18
|
// 在手指离开屏幕时,如果和上一次 move 时的间隔小于 `MOMENTUM_TIME` 且 move
|
|
16
19
|
// 距离大于 `MOMENTUM_DISTANCE` 时,执行惯性滑动
|
|
17
20
|
|
|
@@ -58,7 +61,7 @@ var InternalPickerSlot = function InternalPickerSlot(props, ref) {
|
|
|
58
61
|
var setTransform = function setTransform() {
|
|
59
62
|
var translateY = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
60
63
|
var type = arguments.length > 1 ? arguments[1] : undefined;
|
|
61
|
-
var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] :
|
|
64
|
+
var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_DURATION;
|
|
62
65
|
var deg = arguments.length > 3 ? arguments[3] : undefined;
|
|
63
66
|
var nTime = time;
|
|
64
67
|
|
|
@@ -139,7 +142,7 @@ var InternalPickerSlot = function InternalPickerSlot(props, ref) {
|
|
|
139
142
|
if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
|
|
140
143
|
// 惯性滚动
|
|
141
144
|
var distance = momentum(move, moveTime);
|
|
142
|
-
setMove(distance, 'end',
|
|
145
|
+
setMove(distance, 'end', +swipeDuration);
|
|
143
146
|
} else {
|
|
144
147
|
setMove(move, 'end');
|
|
145
148
|
}
|
|
@@ -228,12 +231,12 @@ var InternalPickerSlot = function InternalPickerSlot(props, ref) {
|
|
|
228
231
|
transform: "rotate3d(1, 0, 0, ".concat(-rotation * (index + 1), "deg) translate3d(0px, 0px, 104px)")
|
|
229
232
|
},
|
|
230
233
|
key: item.value ? item.value : index
|
|
231
|
-
}, item.text ? item.text : item);
|
|
234
|
+
}, React__default.createElement(React__default.Fragment, null, item.text ? item.text : item));
|
|
232
235
|
}), !threeDimensional && listData.map(function (item, index) {
|
|
233
236
|
return React__default.createElement("div", {
|
|
234
237
|
className: "nut-picker-roller-item-tile",
|
|
235
238
|
key: item.value ? item.value : index
|
|
236
|
-
}, item.text ? item.text : item);
|
|
239
|
+
}, React__default.createElement(React__default.Fragment, null, item.text ? item.text : item));
|
|
237
240
|
})), React__default.createElement("div", {
|
|
238
241
|
className: "nut-picker-mask"
|
|
239
242
|
}), React__default.createElement("div", {
|