@nutui/nutui-react-taro 1.4.4 → 1.4.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 +15 -0
- package/dist/esm/Address.js +5 -5
- package/dist/esm/Audio.js +5 -5
- package/dist/esm/AvatarContext-7153ad2b.js +3 -1
- package/dist/esm/AvatarGroup.js +4 -4
- package/dist/esm/Calendar.js +5 -5
- package/dist/esm/CalendarItem.js +4 -4
- package/dist/esm/Card.js +4 -3
- package/dist/esm/Cell.js +2 -2
- package/dist/esm/ConfigProvider.js +3 -3
- package/dist/esm/CountDown.js +4 -4
- package/dist/esm/DatePicker.js +5 -5
- package/dist/esm/Dialog.js +4 -4
- package/dist/esm/Ellipsis.js +4 -4
- package/dist/esm/Empty.js +4 -4
- package/dist/esm/FixedNav.js +4 -4
- package/dist/esm/Form.js +4 -4
- package/dist/esm/FormItem.js +3 -3
- package/dist/esm/Grid.js +4 -4
- package/dist/esm/GridItem.js +4 -4
- package/dist/esm/Image.js +4 -4
- package/dist/esm/Infiniteloading.js +4 -4
- package/dist/esm/Input.js +4 -4
- package/dist/esm/MenuItem.js +4 -4
- package/dist/esm/NoticeBar.js +2 -2
- package/dist/esm/NumberKeyboard.js +4 -4
- package/dist/esm/Pagination.js +4 -4
- package/dist/esm/Picker.js +4 -4
- package/dist/esm/PullToRefresh.js +4 -4
- package/dist/esm/Range.js +4 -4
- package/dist/esm/SearchBar.js +4 -4
- package/dist/esm/ShortPassword.js +4 -4
- package/dist/esm/SideNavBar.js +4 -4
- package/dist/esm/Signature.js +4 -4
- package/dist/esm/Sticky.js +4 -4
- package/dist/esm/Table.js +4 -4
- package/dist/esm/Tag.js +3 -2
- package/dist/esm/TextArea.js +4 -4
- package/dist/esm/TimeDetail.js +4 -4
- package/dist/esm/TimePannel.js +4 -4
- package/dist/esm/TimeSelect.js +6 -6
- package/dist/esm/Uploader.js +4 -4
- package/dist/esm/UserContext-68f62e66.js +3 -1
- package/dist/esm/UserContext-b4181162.js +3 -1
- package/dist/esm/UserContext-be8097d2.js +3 -1
- package/dist/esm/VirtualList.js +6 -4
- package/dist/esm/WaterMark.js +4 -4
- package/dist/esm/actionsheet.taro-a58d3d12.js +45 -83
- package/dist/esm/address.taro-79cc7c96.js +461 -0
- package/dist/esm/animate.taro-b0e83dd5.js +32 -46
- package/dist/esm/animatingnumbers.taro-6f40a2e9.js +93 -134
- package/dist/esm/audio.taro-4fadc583.js +161 -0
- package/dist/esm/avatar.taro-85ced995.js +93 -119
- package/dist/esm/avatargroup-1d900174.js +34 -0
- package/dist/esm/backtop.taro-99107c30.js +39 -62
- package/dist/esm/badge.taro-fe9171ec.js +40 -58
- package/dist/esm/barrage.taro-0e157b5e.js +61 -91
- package/dist/esm/bem-893ad28d.js +3 -6
- package/dist/esm/button.taro-4ce133b9.js +87 -98
- package/dist/esm/calendar.taro-4ed72058.js +38 -0
- package/dist/esm/calendaritem.taro-1ebe428d.js +571 -0
- package/dist/esm/card.taro-39055e82.js +32 -0
- package/dist/esm/cascader.taro-d8cb1c3e.js +397 -636
- package/dist/esm/cell.taro-9a04a92e.js +64 -0
- package/dist/esm/cellgroup.taro-e094471c.js +18 -27
- package/dist/esm/checkbox.taro-0bda9796.js +160 -232
- package/dist/esm/circleprogress.taro-47db537c.js +99 -120
- package/dist/esm/col.taro-b61c7cba.js +33 -50
- package/dist/esm/collapse.taro-af58206c.js +73 -86
- package/dist/esm/collapseitem-ce1849d2.js +75 -139
- package/dist/esm/configprovider-5eea4f5d.js +19 -0
- package/dist/esm/configprovider.taro-26882dd2.js +42 -0
- package/dist/esm/countdown.taro-9e40de9c.js +225 -0
- package/dist/esm/datepicker.taro-7220e495.js +270 -0
- package/dist/esm/dialog.taro-1c03960e.js +123 -0
- package/dist/esm/divider.taro-5236fe6a.js +27 -27
- package/dist/esm/drag.taro-82b6b27a.js +99 -138
- package/dist/esm/elevator.taro-d7d65470.js +185 -259
- package/dist/esm/ellipsis.taro-49b6db0c.js +232 -0
- package/dist/esm/empty.taro-7bd813f9.js +62 -0
- package/dist/esm/fixednav.taro-5ad15202.js +53 -0
- package/dist/esm/form.taro-71d32671.js +179 -0
- package/dist/esm/formitem.taro-3089489b.js +89 -0
- package/dist/esm/grid.taro-e6decfce.js +58 -0
- package/dist/esm/grid.taro.context-39636af9.js +4 -2
- package/dist/esm/griditem.taro-4cade72e.js +90 -0
- package/dist/esm/icon-8dc4de10.js +43 -51
- package/dist/esm/icon.taro-1d0d4fb7.js +43 -51
- package/dist/esm/image.taro-e6dc5867.js +64 -0
- package/dist/esm/imagepreview.taro-3400ea03.js +158 -205
- package/dist/esm/index.taro-a36f96fb.js +149 -210
- package/dist/esm/indicator.taro-183ea169.js +29 -43
- package/dist/esm/infiniteloading.taro-6c2a2e95.js +142 -0
- package/dist/esm/input.taro-fd566407.js +243 -0
- package/dist/esm/inputnumber.taro-dc39b853.js +129 -177
- package/dist/esm/layout.taro-358f014f.js +6 -9
- package/dist/esm/menu.taro-4abed328.js +89 -132
- package/dist/esm/menuitem.taro-6e8b27c3.js +130 -0
- package/dist/esm/navbar.taro-c931c078.js +69 -105
- package/dist/esm/noticebar.taro-69ea7673.js +450 -0
- package/dist/esm/notify.taro-308e5892.js +66 -97
- package/dist/esm/numberkeyboard.taro-194519e4.js +158 -0
- package/dist/esm/nutui-react.es.js +44 -44
- package/dist/esm/offsetContext-bfb02c25.js +3 -1
- package/dist/esm/overlay.taro-98367bc1.js +59 -74
- package/dist/esm/pagination.taro-bb490de9.js +124 -0
- package/dist/esm/picker.taro-2a8ded7c.js +420 -0
- package/dist/esm/popover.taro-46d813e8.js +132 -222
- package/dist/esm/popup.taro-cb777e09.js +125 -178
- package/dist/esm/price.taro-8801462e.js +75 -86
- package/dist/esm/progress.taro-623bc807.js +84 -118
- package/dist/esm/pulltorefresh.taro-cab7b51c.js +221 -0
- package/dist/esm/range.taro-5d6ff217.js +332 -0
- package/dist/esm/rate.taro-10197384.js +64 -111
- package/dist/esm/row.taro-37a895de.js +38 -42
- package/dist/esm/searchbar.taro-839dd622.js +148 -0
- package/dist/esm/shortpassword.taro-182d46f7.js +111 -0
- package/dist/esm/sidenavbar.taro-006cf38b.js +35 -0
- package/dist/esm/sidenavbaritem.taro-fee11d26.js +9 -22
- package/dist/esm/signature.taro-33632585.js +143 -0
- package/dist/esm/skeleton.taro-853ce460.js +51 -88
- package/dist/esm/step.taro-1c94e067.js +49 -78
- package/dist/esm/steps.taro-acf205a0.js +21 -30
- package/dist/esm/sticky.taro-d0553f48.js +13 -0
- package/dist/esm/subsidenavbar.taro-f46b4c73.js +58 -75
- package/dist/esm/swipe.taro-83bc248f.js +164 -254
- package/dist/esm/swiper.taro-852f6615.js +424 -505
- package/dist/esm/swiperitem-86a3578a.js +20 -28
- package/dist/esm/switch.taro-bae2dca0.js +43 -64
- package/dist/esm/tabbar.taro-86cece39.js +47 -57
- package/dist/esm/tabbaritem.taro-8dfb8055.js +51 -79
- package/dist/esm/table.taro-cb4dd2c3.js +92 -0
- package/dist/esm/tabpane.taro-91cd6cf4.js +17 -22
- package/dist/esm/tabs.taro-e71875fa.js +121 -165
- package/dist/esm/tag.taro-00fe554d.js +89 -0
- package/dist/esm/textarea.taro-42600f8c.js +74 -0
- package/dist/esm/timedetail.taro-c5f564fd.js +44 -0
- package/dist/esm/timepannel.taro-29f9dd86.js +22 -0
- package/dist/esm/timeselect.taro-3ecce65d.js +133 -0
- package/dist/esm/toast.taro-0804b6b4.js +99 -137
- package/dist/esm/trendarrow.taro-5a7153e4.js +63 -90
- package/dist/esm/types/src/packages/cell/cell.taro.d.ts +0 -1
- package/dist/esm/types/src/packages/noticebar/noticebar.d.ts +5 -4
- package/dist/esm/types/src/packages/noticebar/noticebar.taro.d.ts +5 -4
- package/dist/esm/types/src/packages/uploader/uploader.d.ts +1 -1
- package/dist/esm/types/src/packages/virtuallist/virtuallist.taro.d.ts +13 -2
- package/dist/esm/typings-1c5f2628.js +7 -6
- package/dist/esm/uploader.taro-f80d76d9.js +392 -0
- package/dist/esm/useClientRect-bf69d7b3.js +5 -25
- package/dist/esm/useTouch-a2ea68c6.js +63 -93
- package/dist/esm/video-8a3518c5.js +59 -83
- package/dist/esm/virtuallist.taro-e3345ced.js +215 -0
- package/dist/esm/watermark.taro-cd9db98a.js +114 -0
- package/dist/esm/zh-CN-dfc384d0.js +128 -133
- 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.es.js +634 -5664
- package/dist/nutui.react.umd.js +634 -5664
- package/dist/packages/noticebar/noticebar.scss +17 -0
- package/dist/packages/radio/radio.scss +3 -1
- package/dist/packages/row/row.scss +2 -0
- package/dist/packages/searchbar/searchbar.scss +1 -1
- package/dist/packages/tag/tag.scss +13 -5
- package/dist/packages/virtuallist/virtuallist.scss +24 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/temp.scss +2340 -0
- package/dist/styles/theme-dark.scss +7 -0
- package/dist/styles/theme-default.scss +11 -0
- package/dist/styles/variables.scss +1945 -710
- package/dist/types/index.d.ts +16 -23
- package/package.json +9 -4
- package/dist/esm/address.taro-1e2aea24.js +0 -615
- package/dist/esm/audio.taro-fddcdfc0.js +0 -228
- package/dist/esm/avatargroup-f7f600ff.js +0 -42
- package/dist/esm/calendar.taro-72974415.js +0 -83
- package/dist/esm/calendaritem.taro-84e889eb.js +0 -580
- package/dist/esm/card.taro-a530dfb3.js +0 -61
- package/dist/esm/cell.taro-cf50c4f2.js +0 -109
- package/dist/esm/configprovider-c7d60e20.js +0 -18
- package/dist/esm/configprovider.taro-8bdb3a28.js +0 -50
- package/dist/esm/countdown.taro-d7dc8681.js +0 -246
- package/dist/esm/datepicker.taro-7199f521.js +0 -304
- package/dist/esm/dialog.taro-f54cfbf0.js +0 -187
- package/dist/esm/ellipsis.taro-c0de6ff4.js +0 -309
- package/dist/esm/empty.taro-dbc66496.js +0 -81
- package/dist/esm/fixednav.taro-9e759320.js +0 -97
- package/dist/esm/form.taro-880014b1.js +0 -181
- package/dist/esm/formitem.taro-3695f4a7.js +0 -136
- package/dist/esm/grid.taro-c2cc12d6.js +0 -81
- package/dist/esm/griditem.taro-892153cd.js +0 -122
- package/dist/esm/image.taro-c30973d5.js +0 -105
- package/dist/esm/infiniteloading.taro-b5ddf3cc.js +0 -188
- package/dist/esm/input.taro-104130c1.js +0 -361
- package/dist/esm/menuitem.taro-216e9f7d.js +0 -193
- package/dist/esm/noticebar.taro-94002898.js +0 -368
- package/dist/esm/numberkeyboard.taro-5e8f0ddf.js +0 -245
- package/dist/esm/pagination.taro-9925ffab.js +0 -169
- package/dist/esm/picker.taro-3b5cc054.js +0 -540
- package/dist/esm/pulltorefresh.taro-f26a20dd.js +0 -302
- package/dist/esm/range.taro-c41e9b90.js +0 -469
- package/dist/esm/searchbar.taro-01ed4ea4.js +0 -236
- package/dist/esm/shortpassword.taro-3a3bf412.js +0 -190
- package/dist/esm/sidenavbar.taro-06026f31.js +0 -66
- package/dist/esm/signature.taro-17648cac.js +0 -192
- package/dist/esm/sticky.taro-36013e97.js +0 -16
- package/dist/esm/table.taro-adda6622.js +0 -139
- package/dist/esm/tag.taro-bd900990.js +0 -104
- package/dist/esm/textarea.taro-83d5fe73.js +0 -102
- package/dist/esm/timedetail.taro-105f5380.js +0 -68
- package/dist/esm/timepannel.taro-c66c63dd.js +0 -30
- package/dist/esm/timeselect.taro-fc7ec6ee.js +0 -172
- package/dist/esm/uploader.taro-a1edf38f.js +0 -529
- package/dist/esm/virtuallist.taro-4add61c3.js +0 -315
- package/dist/esm/watermark.taro-323d1cf3.js +0 -132
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
var _excluded = ["className", "url", "style", "autoplay", "loop", "type", "onFastBack", "onForward", "onPause", "onPlay", "onPlayEnd", "onCanPlay", "children", "iconClassPrefix", "iconFontClassName"];
|
|
5
|
-
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; }
|
|
6
|
-
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; }
|
|
7
|
-
import React__default, { useState, useRef } from 'react';
|
|
8
|
-
import Taro from '@tarojs/taro';
|
|
9
|
-
import { I as Icon } from './icon.taro-1d0d4fb7.js';
|
|
10
|
-
import { R as Range } from './range.taro-c41e9b90.js';
|
|
11
|
-
import { B as Button } from './button.taro-4ce133b9.js';
|
|
12
|
-
import { c as cn } from './bem-893ad28d.js';
|
|
13
|
-
import { u as useConfig } from './configprovider.taro-8bdb3a28.js';
|
|
14
|
-
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
15
|
-
var b = cn('audio');
|
|
16
|
-
var warn = console.warn;
|
|
17
|
-
var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
18
|
-
className: '',
|
|
19
|
-
url: '',
|
|
20
|
-
style: {},
|
|
21
|
-
autoplay: false,
|
|
22
|
-
loop: false,
|
|
23
|
-
type: 'progress',
|
|
24
|
-
onFastBack: function onFastBack(ctx) {},
|
|
25
|
-
onForward: function onForward(ctx) {},
|
|
26
|
-
onPause: function onPause(ctx) {},
|
|
27
|
-
onPlay: function onPlay(ctx) {},
|
|
28
|
-
onPlayEnd: function onPlayEnd(ctx) {},
|
|
29
|
-
onCanPlay: function onCanPlay(ctx) {}
|
|
30
|
-
});
|
|
31
|
-
var Audio = function Audio(props) {
|
|
32
|
-
var _useConfig = useConfig(),
|
|
33
|
-
locale = _useConfig.locale;
|
|
34
|
-
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
35
|
-
className = _defaultProps$props.className,
|
|
36
|
-
url = _defaultProps$props.url,
|
|
37
|
-
style = _defaultProps$props.style,
|
|
38
|
-
autoplay = _defaultProps$props.autoplay,
|
|
39
|
-
loop = _defaultProps$props.loop,
|
|
40
|
-
type = _defaultProps$props.type,
|
|
41
|
-
onFastBack = _defaultProps$props.onFastBack,
|
|
42
|
-
onForward = _defaultProps$props.onForward,
|
|
43
|
-
onPause = _defaultProps$props.onPause,
|
|
44
|
-
onPlay = _defaultProps$props.onPlay,
|
|
45
|
-
onPlayEnd = _defaultProps$props.onPlayEnd,
|
|
46
|
-
onCanPlay = _defaultProps$props.onCanPlay,
|
|
47
|
-
children = _defaultProps$props.children,
|
|
48
|
-
iconClassPrefix = _defaultProps$props.iconClassPrefix,
|
|
49
|
-
iconFontClassName = _defaultProps$props.iconFontClassName,
|
|
50
|
-
rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
51
|
-
var _useState = useState(false),
|
|
52
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
53
|
-
playing = _useState2[0],
|
|
54
|
-
setPlaying = _useState2[1];
|
|
55
|
-
var _useState3 = useState(0),
|
|
56
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
57
|
-
totalSeconds = _useState4[0],
|
|
58
|
-
setTotalSeconds = _useState4[1];
|
|
59
|
-
var _useState5 = useState(0),
|
|
60
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
61
|
-
percent = _useState6[0],
|
|
62
|
-
setPercent = _useState6[1];
|
|
63
|
-
var _useState7 = useState(false),
|
|
64
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
65
|
-
isCanPlay = _useState8[0],
|
|
66
|
-
setIsCanPlay = _useState8[1];
|
|
67
|
-
var _useState9 = useState('00:00:00'),
|
|
68
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
69
|
-
currentDuration = _useState10[0],
|
|
70
|
-
setCurrentDuration = _useState10[1];
|
|
71
|
-
var statusRef = useRef({
|
|
72
|
-
currentTime: 0,
|
|
73
|
-
currentDuration: '00:00:00',
|
|
74
|
-
percent: 0
|
|
75
|
-
});
|
|
76
|
-
var audioRef = useRef(Taro.createInnerAudioContext());
|
|
77
|
-
var audioCtx = audioRef.current;
|
|
78
|
-
audioCtx.src = url;
|
|
79
|
-
audioCtx.autoplay = autoplay || false;
|
|
80
|
-
audioCtx.loop = loop || false;
|
|
81
|
-
audioCtx.onPause(function () {
|
|
82
|
-
props.onPause && props.onPause(audioCtx);
|
|
83
|
-
});
|
|
84
|
-
audioCtx.onEnded(function () {
|
|
85
|
-
if (props.loop) {
|
|
86
|
-
warn(locale.audio.tips || 'onPlayEnd事件在loop=false时才会触发');
|
|
87
|
-
} else {
|
|
88
|
-
props.onPlayEnd && props.onPlayEnd(audioCtx);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
audioCtx.onPlay(function () {
|
|
92
|
-
var duration = audioCtx.duration;
|
|
93
|
-
setTotalSeconds(Math.floor(duration));
|
|
94
|
-
props.onPlay && props.onPlay(audioCtx);
|
|
95
|
-
});
|
|
96
|
-
audioCtx.onCanplay(function () {
|
|
97
|
-
var intervalID = setInterval(function () {
|
|
98
|
-
if (audioCtx.duration !== 0) {
|
|
99
|
-
setTotalSeconds(audioCtx.duration);
|
|
100
|
-
clearInterval(intervalID);
|
|
101
|
-
}
|
|
102
|
-
}, 500);
|
|
103
|
-
setIsCanPlay(true);
|
|
104
|
-
props.onCanPlay && props.onCanPlay(audioCtx);
|
|
105
|
-
});
|
|
106
|
-
audioCtx.onTimeUpdate(function () {
|
|
107
|
-
var time = parseInt("".concat(audioCtx.currentTime));
|
|
108
|
-
var formated = formatSeconds("".concat(time));
|
|
109
|
-
statusRef.current.currentDuration = formated;
|
|
110
|
-
setPercent(time / totalSeconds * 100);
|
|
111
|
-
setCurrentDuration(formatSeconds(audioCtx.currentTime.toString()));
|
|
112
|
-
});
|
|
113
|
-
audioCtx.onError(function (res) {
|
|
114
|
-
console.log('code', res.errCode);
|
|
115
|
-
console.log('message', res.errMsg);
|
|
116
|
-
});
|
|
117
|
-
function formatSeconds(value) {
|
|
118
|
-
if (!value) {
|
|
119
|
-
return '00:00:00';
|
|
120
|
-
}
|
|
121
|
-
var time = parseInt(value);
|
|
122
|
-
var hours = Math.floor(time / 3600);
|
|
123
|
-
var minutes = Math.floor((time - hours * 3600) / 60);
|
|
124
|
-
var secondss = time - hours * 3600 - minutes * 60;
|
|
125
|
-
var result = '';
|
|
126
|
-
result += "".concat("0".concat(hours.toString()).slice(-2), ":");
|
|
127
|
-
result += "".concat("0".concat(minutes.toString()).slice(-2), ":");
|
|
128
|
-
result += "0".concat(secondss.toString()).slice(-2);
|
|
129
|
-
return result;
|
|
130
|
-
}
|
|
131
|
-
var handleBack = function handleBack() {
|
|
132
|
-
var currentTime = Math.floor(audioCtx.currentTime);
|
|
133
|
-
statusRef.current.currentTime = Math.max(currentTime - 1, 0);
|
|
134
|
-
setCurrentDuration(formatSeconds(statusRef.current.currentTime.toString()));
|
|
135
|
-
audioCtx.seek(statusRef.current.currentTime);
|
|
136
|
-
props.onFastBack && props.onFastBack(audioCtx);
|
|
137
|
-
};
|
|
138
|
-
var handleForward = function handleForward() {
|
|
139
|
-
var currentTime = Math.floor(audioCtx.currentTime);
|
|
140
|
-
statusRef.current.currentTime = Math.min(currentTime + 1, audioCtx.duration);
|
|
141
|
-
setCurrentDuration(formatSeconds(statusRef.current.currentTime.toString()));
|
|
142
|
-
audioCtx.seek(statusRef.current.currentTime);
|
|
143
|
-
props.onForward && props.onForward(audioCtx);
|
|
144
|
-
};
|
|
145
|
-
var handleStatusChange = function handleStatusChange() {
|
|
146
|
-
setPlaying(!playing);
|
|
147
|
-
if (!playing) {
|
|
148
|
-
audioCtx.play();
|
|
149
|
-
} else {
|
|
150
|
-
audioCtx.pause();
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
var renderIcon = function renderIcon() {
|
|
154
|
-
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
155
|
-
className: b('icon')
|
|
156
|
-
}, React__default.createElement("div", {
|
|
157
|
-
className: "".concat(b('icon-box'), " ").concat(playing ? b('icon-play') : b('icon-stop')),
|
|
158
|
-
onClick: handleStatusChange
|
|
159
|
-
}, playing ? React__default.createElement(Icon, {
|
|
160
|
-
classPrefix: iconClassPrefix,
|
|
161
|
-
fontClassName: iconFontClassName,
|
|
162
|
-
name: "service",
|
|
163
|
-
className: "nut-icon-loading"
|
|
164
|
-
}) : React__default.createElement(Icon, {
|
|
165
|
-
classPrefix: iconClassPrefix,
|
|
166
|
-
fontClassName: iconFontClassName,
|
|
167
|
-
name: "service"
|
|
168
|
-
}))));
|
|
169
|
-
};
|
|
170
|
-
var renderProgerss = function renderProgerss() {
|
|
171
|
-
return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
172
|
-
className: b('progress')
|
|
173
|
-
}, React__default.createElement("div", {
|
|
174
|
-
className: "time"
|
|
175
|
-
}, currentDuration), React__default.createElement("div", {
|
|
176
|
-
className: b('progress-bar-wrapper')
|
|
177
|
-
}, React__default.createElement(Range, {
|
|
178
|
-
modelValue: percent,
|
|
179
|
-
hiddenTag: true,
|
|
180
|
-
hiddenRange: true,
|
|
181
|
-
"inactive-color": "#cccccc",
|
|
182
|
-
"active-color": "#fa2c19"
|
|
183
|
-
})), React__default.createElement("div", {
|
|
184
|
-
className: "time"
|
|
185
|
-
}, formatSeconds("".concat(totalSeconds)) || '00:00:00')), React__default.createElement("div", {
|
|
186
|
-
className: isCanPlay ? 'custom-button-group' : 'custom-button-group-disable'
|
|
187
|
-
}, React__default.createElement(Button, {
|
|
188
|
-
type: "primary",
|
|
189
|
-
size: "small",
|
|
190
|
-
className: "back",
|
|
191
|
-
onClick: handleBack
|
|
192
|
-
}, locale.audio.back || '快退'), React__default.createElement(Button, {
|
|
193
|
-
type: "primary",
|
|
194
|
-
size: "small",
|
|
195
|
-
className: "start",
|
|
196
|
-
onClick: handleStatusChange
|
|
197
|
-
}, playing ? "".concat(locale.audio.pause || '暂停') : "".concat(locale.audio.start || '开始')), React__default.createElement(Button, {
|
|
198
|
-
type: "primary",
|
|
199
|
-
size: "small",
|
|
200
|
-
onClick: handleForward
|
|
201
|
-
}, locale.audio.forward || '快进')));
|
|
202
|
-
};
|
|
203
|
-
var renderNone = function renderNone() {
|
|
204
|
-
return React__default.createElement("div", {
|
|
205
|
-
className: b('none-container'),
|
|
206
|
-
onClick: handleStatusChange
|
|
207
|
-
}, children);
|
|
208
|
-
};
|
|
209
|
-
var renderAudio = function renderAudio() {
|
|
210
|
-
switch (type) {
|
|
211
|
-
case 'icon':
|
|
212
|
-
return renderIcon();
|
|
213
|
-
case 'progress':
|
|
214
|
-
return renderProgerss();
|
|
215
|
-
case 'none':
|
|
216
|
-
return renderNone();
|
|
217
|
-
default:
|
|
218
|
-
return null;
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
return React__default.createElement("div", _objectSpread({
|
|
222
|
-
className: "".concat(b(), " ").concat(className),
|
|
223
|
-
style: style
|
|
224
|
-
}, rest), renderAudio());
|
|
225
|
-
};
|
|
226
|
-
Audio.defaultProps = defaultProps;
|
|
227
|
-
Audio.displayName = 'NutAudio';
|
|
228
|
-
export { Audio as A };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
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; }
|
|
3
|
-
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; }
|
|
4
|
-
import React__default, { useRef } from 'react';
|
|
5
|
-
import classNames from 'classnames';
|
|
6
|
-
import { A as AvatarContext } from './AvatarContext-7153ad2b.js';
|
|
7
|
-
import { c as cn } from './bem-893ad28d.js';
|
|
8
|
-
import { u as useConfig } from './configprovider-c7d60e20.js';
|
|
9
|
-
var defaultProps = {
|
|
10
|
-
maxContent: '',
|
|
11
|
-
maxCount: '',
|
|
12
|
-
maxBgColor: '#eee',
|
|
13
|
-
maxColor: '#666',
|
|
14
|
-
size: '',
|
|
15
|
-
shape: '',
|
|
16
|
-
span: '-8',
|
|
17
|
-
zIndex: 'left'
|
|
18
|
-
};
|
|
19
|
-
var AvatarGroup = function AvatarGroup(props) {
|
|
20
|
-
useConfig();
|
|
21
|
-
var propAvatarGroup = _objectSpread(_objectSpread({}, defaultProps), props);
|
|
22
|
-
var className = propAvatarGroup.className,
|
|
23
|
-
style = propAvatarGroup.style,
|
|
24
|
-
children = propAvatarGroup.children;
|
|
25
|
-
var avatarGroupRef = useRef(null);
|
|
26
|
-
var b = cn('avatar-group');
|
|
27
|
-
var cls = classNames(b(''), className);
|
|
28
|
-
var parentAvatar = {
|
|
29
|
-
propAvatarGroup: propAvatarGroup,
|
|
30
|
-
avatarGroupRef: avatarGroupRef
|
|
31
|
-
};
|
|
32
|
-
return React__default.createElement(AvatarContext.Provider, {
|
|
33
|
-
value: parentAvatar
|
|
34
|
-
}, React__default.createElement("div", {
|
|
35
|
-
className: cls,
|
|
36
|
-
style: style,
|
|
37
|
-
ref: avatarGroupRef
|
|
38
|
-
}, children));
|
|
39
|
-
};
|
|
40
|
-
AvatarGroup.defaultProps = defaultProps;
|
|
41
|
-
AvatarGroup.displayName = 'NutAvatarGroup';
|
|
42
|
-
export { AvatarGroup as A };
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
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; }
|
|
3
|
-
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; }
|
|
4
|
-
import React__default from 'react';
|
|
5
|
-
import { P as Popup } from './popup.taro-cb777e09.js';
|
|
6
|
-
import { U as Utils, C as CalendarItem } from './calendaritem.taro-84e889eb.js';
|
|
7
|
-
import { u as useConfig } from './configprovider.taro-8bdb3a28.js';
|
|
8
|
-
var defaultProps = {
|
|
9
|
-
type: 'one',
|
|
10
|
-
isAutoBackFill: false,
|
|
11
|
-
poppable: true,
|
|
12
|
-
visible: false,
|
|
13
|
-
title: '日历选择',
|
|
14
|
-
defaultValue: '',
|
|
15
|
-
startDate: Utils.getDay(0),
|
|
16
|
-
endDate: Utils.getDay(365),
|
|
17
|
-
onClose: function onClose() {},
|
|
18
|
-
onChoose: function onChoose(param) {}
|
|
19
|
-
};
|
|
20
|
-
var Calendar = function Calendar(props) {
|
|
21
|
-
var _useConfig = useConfig(),
|
|
22
|
-
locale = _useConfig.locale;
|
|
23
|
-
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
24
|
-
children = _defaultProps$props.children,
|
|
25
|
-
poppable = _defaultProps$props.poppable,
|
|
26
|
-
visible = _defaultProps$props.visible,
|
|
27
|
-
type = _defaultProps$props.type,
|
|
28
|
-
isAutoBackFill = _defaultProps$props.isAutoBackFill,
|
|
29
|
-
title = _defaultProps$props.title,
|
|
30
|
-
defaultValue = _defaultProps$props.defaultValue,
|
|
31
|
-
startDate = _defaultProps$props.startDate,
|
|
32
|
-
endDate = _defaultProps$props.endDate,
|
|
33
|
-
onClose = _defaultProps$props.onClose,
|
|
34
|
-
onChoose = _defaultProps$props.onChoose;
|
|
35
|
-
var close = function close() {
|
|
36
|
-
onClose && onClose();
|
|
37
|
-
};
|
|
38
|
-
var update = function update() {};
|
|
39
|
-
var choose = function choose(param) {
|
|
40
|
-
close();
|
|
41
|
-
onChoose && onChoose(param);
|
|
42
|
-
};
|
|
43
|
-
var closePopup = function closePopup() {
|
|
44
|
-
close();
|
|
45
|
-
};
|
|
46
|
-
return React__default.createElement(React__default.Fragment, null, poppable ? React__default.createElement(Popup, {
|
|
47
|
-
visible: visible,
|
|
48
|
-
position: "bottom",
|
|
49
|
-
round: true,
|
|
50
|
-
duration: 0.5,
|
|
51
|
-
closeable: true,
|
|
52
|
-
destroyOnClose: true,
|
|
53
|
-
onClickOverlay: closePopup,
|
|
54
|
-
onClickCloseIcon: closePopup,
|
|
55
|
-
style: {
|
|
56
|
-
height: '85vh'
|
|
57
|
-
}
|
|
58
|
-
}, React__default.createElement(CalendarItem, {
|
|
59
|
-
type: type,
|
|
60
|
-
isAutoBackFill: isAutoBackFill,
|
|
61
|
-
poppable: poppable,
|
|
62
|
-
title: locale.calendaritem.title || title,
|
|
63
|
-
defaultValue: defaultValue,
|
|
64
|
-
startDate: startDate,
|
|
65
|
-
endDate: endDate,
|
|
66
|
-
onUpdate: update,
|
|
67
|
-
onClose: close,
|
|
68
|
-
onChoose: choose
|
|
69
|
-
})) : React__default.createElement(CalendarItem, {
|
|
70
|
-
type: type,
|
|
71
|
-
isAutoBackFill: isAutoBackFill,
|
|
72
|
-
poppable: poppable,
|
|
73
|
-
title: locale.calendaritem.title,
|
|
74
|
-
defaultValue: defaultValue,
|
|
75
|
-
startDate: startDate,
|
|
76
|
-
endDate: endDate,
|
|
77
|
-
onClose: close,
|
|
78
|
-
onChoose: choose
|
|
79
|
-
}));
|
|
80
|
-
};
|
|
81
|
-
Calendar.defaultProps = defaultProps;
|
|
82
|
-
Calendar.displayName = 'NutCalendar';
|
|
83
|
-
export { Calendar as C };
|