@nutui/nutui-react-taro 1.3.0 → 1.3.1-beta.0
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/dist/esm/Address.js +4 -4
- package/dist/esm/Audio/style/index.js +4 -0
- package/dist/esm/Audio.js +18 -0
- package/dist/esm/AvatarGroup.js +4 -4
- package/dist/esm/Calendar/style/index.js +1 -2
- package/dist/esm/Calendar.js +6 -5
- package/dist/esm/CalendarItem.js +5 -5
- package/dist/esm/Cascader/style/index.js +2 -0
- package/dist/esm/Cascader.js +14 -0
- package/dist/esm/ConfigProvider.js +3 -3
- package/dist/esm/CountDown.js +4 -4
- package/dist/esm/DatePicker.js +4 -4
- package/dist/esm/Dialog.js +4 -4
- package/dist/esm/Empty.js +4 -4
- package/dist/esm/FixedNav.js +4 -4
- package/dist/esm/Grid/style/index.js +2 -0
- package/dist/esm/Grid.js +7 -0
- package/dist/esm/GridItem/style/index.js +2 -0
- package/dist/esm/GridItem.js +8 -0
- package/dist/esm/ImagePreview/style/index.js +2 -0
- package/dist/esm/ImagePreview.js +15 -0
- package/dist/esm/Infiniteloading.js +4 -4
- package/dist/esm/Input.js +4 -4
- package/dist/esm/Menu/style/index.js +3 -0
- package/dist/esm/Menu.js +7 -0
- package/dist/esm/MenuItem/style/index.js +3 -0
- package/dist/esm/MenuItem.js +11 -0
- package/dist/esm/NoticeBar.js +3 -2
- package/dist/esm/{Notification-dccc7625.js → Notification-422905bd.js} +2 -1
- package/dist/esm/Notify.js +3 -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/Popover.js +3 -2
- package/dist/esm/Range.js +7 -5
- 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/Swipe/style/index.js +2 -0
- package/dist/esm/Swipe.js +7 -0
- package/dist/esm/Swiper.js +3 -2
- package/dist/esm/Table.js +4 -4
- 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 +4 -4
- package/dist/esm/Toast.js +4 -3
- package/dist/esm/Uploader.js +4 -4
- package/dist/esm/VirtualList.js +4 -4
- package/dist/esm/{address.taro-a1092e30.js → address.taro-4765a826.js} +17 -6
- package/dist/esm/audio.taro-cd6cc93b.js +292 -0
- package/dist/esm/{avatargroup-65173caa.js → avatargroup-1ca79066.js} +1 -1
- package/dist/esm/calendar.taro-1abb1925.js +89 -0
- package/dist/esm/{calendaritem.taro-fe84d94b.js → calendaritem.taro-3c06a809.js} +130 -5
- package/dist/esm/cascader.taro-31dbc60e.js +786 -0
- package/dist/esm/{configprovider-18657611.js → configprovider-9c393a29.js} +1 -1
- package/dist/esm/{configprovider.taro-98343012.js → configprovider.taro-1ff7f150.js} +2 -2
- package/dist/esm/{countdown.taro-cd6a1bd4.js → countdown.taro-b00d0d46.js} +1 -1
- package/dist/esm/{datepicker.taro-c1249537.js → datepicker.taro-e385849d.js} +1 -1
- package/dist/esm/{dialog.taro-5b850861.js → dialog.taro-c80b7b5f.js} +12 -18
- package/dist/esm/{empty.taro-6f86eda5.js → empty.taro-20b8adac.js} +1 -1
- package/dist/esm/{fixednav.taro-ca94fd6a.js → fixednav.taro-75e35339.js} +1 -1
- package/dist/esm/grid.taro-7fb43d02.js +90 -0
- package/dist/esm/griditem.taro-8020b409.js +98 -0
- package/dist/esm/imagepreview.taro-a0ddd8a2.js +813 -0
- package/dist/esm/{infiniteloading.taro-d2c0ca14.js → infiniteloading.taro-0a86819e.js} +1 -1
- package/dist/esm/{input.taro-2e31ebbb.js → input.taro-1d23861d.js} +1 -1
- package/dist/esm/menu.taro-03e3b011.js +153 -0
- package/dist/esm/menuitem.taro-56bf3205.js +195 -0
- package/dist/esm/{noticebar.taro-ae593896.js → noticebar.taro-1890c693.js} +3 -2
- package/dist/esm/{notify.taro-95b5f97e.js → notify.taro-22b8f4cd.js} +2 -1
- package/dist/esm/{numberkeyboard.taro-71b2e0eb.js → numberkeyboard.taro-5d685c76.js} +1 -1
- package/dist/esm/nutui-react.es.js +45 -36
- package/dist/esm/{pagination.taro-abc4a71e.js → pagination.taro-10449c4a.js} +1 -1
- package/dist/esm/{picker.taro-0eb8bfa3.js → picker.taro-216cc3cb.js} +1 -1
- package/dist/esm/{popover.taro-4c102df6.js → popover.taro-9b3da0fa.js} +17 -71
- package/dist/esm/{range.taro-034fcf7a.js → range.taro-fe08c5f4.js} +118 -110
- package/dist/esm/render-4a3856cb.js +32 -0
- package/dist/esm/{searchbar.taro-4c6091cb.js → searchbar.taro-450d2f88.js} +1 -1
- package/dist/esm/{shortpassword.taro-ce46b9cd.js → shortpassword.taro-08a05360.js} +23 -18
- package/dist/esm/{sidenavbar.taro-36f1e118.js → sidenavbar.taro-dd471476.js} +1 -1
- package/dist/esm/{signature.taro-45aedfa9.js → signature.taro-7cb77bab.js} +1 -1
- package/dist/esm/swipe.taro-dfb9a049.js +264 -0
- package/dist/esm/{swiper.taro-59bf2777.js → swiper.taro-7a2ef124.js} +2 -1
- package/dist/esm/{table.taro-49009dfc.js → table.taro-305e0317.js} +1 -1
- package/dist/esm/{textarea.taro-0c40e966.js → textarea.taro-700b04c2.js} +1 -1
- package/dist/esm/{timedetail.taro-0e31b4a5.js → timedetail.taro-7cc00243.js} +1 -1
- package/dist/esm/{timepannel.taro-2d54b3db.js → timepannel.taro-e24537e4.js} +1 -1
- package/dist/esm/{timeselect.taro-c35d3490.js → timeselect.taro-210fd548.js} +1 -1
- package/dist/esm/{toast.taro-48539c09.js → toast.taro-bb181833.js} +1 -1
- package/dist/esm/{uploader.taro-ece83a00.js → uploader.taro-f7528535.js} +1 -1
- package/dist/esm/useClientRect-8b7cc406.js +74 -0
- package/dist/esm/{virtuallist.taro-2ff1a5ad.js → virtuallist.taro-ce9619f9.js} +1 -1
- package/dist/esm/{zh-CN-f5124686.js → zh-CN-91090ae2.js} +16 -0
- package/dist/locales/base.d.ts +16 -0
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +17 -1
- package/dist/locales/id-ID.js +17 -1
- package/dist/locales/zh-CN.js +17 -1
- package/dist/locales/zh-TW.js +17 -1
- package/dist/nutui.react.es.js +5595 -4062
- package/dist/nutui.react.umd.js +20243 -30
- package/dist/packages/audio/audio.scss +80 -0
- package/dist/packages/calendar/calendar.scss +57 -36
- package/dist/packages/calendaritem/calendaritem.scss +0 -191
- package/dist/packages/cascader/cascader.scss +69 -0
- package/dist/packages/grid/grid.scss +10 -0
- package/dist/packages/griditem/griditem.scss +103 -0
- package/dist/packages/imagepreview/imagepreview.scss +51 -0
- package/dist/packages/menu/menu.scss +72 -0
- package/dist/packages/menuitem/menuitem.scss +90 -0
- package/dist/packages/popup/popup.scss +1 -1
- package/dist/packages/searchbar/searchbar.scss +1 -0
- package/dist/packages/shortpassword/shortpassword.scss +6 -1
- package/dist/packages/swipe/swipe.scss +33 -0
- package/dist/packages/textarea/textarea.scss +16 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/font/iconfont.js +20 -18
- package/dist/styles/themes/default.scss +8 -0
- package/dist/styles/variables.scss +59 -8
- package/dist/types/audio/audio.taro.d.ts +18 -0
- package/dist/types/audio/index.taro.d.ts +2 -0
- package/dist/types/cascader/cascader.taro.d.ts +25 -0
- package/dist/types/cascader/cascaderItem.taro.d.ts +25 -0
- package/dist/types/cascader/index.taro.d.ts +2 -0
- package/dist/types/checkbox/checkbox.taro.d.ts +2 -2
- package/dist/types/checkboxgroup/checkboxgroup.taro.d.ts +2 -2
- package/dist/types/dialog/dialog.taro.d.ts +2 -1
- package/dist/types/grid/grid.taro.d.ts +16 -0
- package/dist/types/grid/index.taro.d.ts +2 -0
- package/dist/types/griditem/griditem.taro.d.ts +20 -0
- package/dist/types/griditem/index.taro.d.ts +2 -0
- package/dist/types/icon/icon.taro.d.ts +1 -2
- package/dist/types/imagepreview/imagepreview.taro.d.ts +26 -0
- package/dist/types/imagepreview/index.taro.d.ts +2 -0
- package/dist/types/menu/index.taro.d.ts +2 -0
- package/dist/types/menu/menu.taro.d.ts +12 -0
- package/dist/types/menuitem/index.taro.d.ts +2 -0
- package/dist/types/menuitem/menuitem.taro.d.ts +23 -0
- package/dist/types/notify/notify.taro.d.ts +13 -0
- package/dist/types/nutui.react.d.ts +95 -1
- package/dist/types/picker/picker.taro.d.ts +2 -2
- package/dist/types/popup/popup.taro.d.ts +1 -1
- package/dist/types/shortpassword/shortpassword.taro.d.ts +3 -3
- package/dist/types/sidenavbar/sidenavbar.taro.d.ts +14 -2
- package/dist/types/sidenavbaritem/sidenavbaritem.taro.d.ts +10 -2
- package/dist/types/subsidenavbar/subsidenavbar.taro.d.ts +13 -3
- package/dist/types/swipe/index.taro.d.ts +2 -0
- package/dist/types/swipe/swipe.taro.d.ts +41 -0
- package/dist/types/table/table.taro.d.ts +2 -1
- package/dist/types/toast/toast.taro.d.ts +18 -0
- package/dist/types/virtuallist/virtuallist.taro.d.ts +2 -1
- package/package.json +4 -4
- package/dist/esm/calendar.taro-4b2103c1.js +0 -621
- package/dist/esm/raf-3fbb5f92.js +0 -126
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
|
|
4
|
+
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; }
|
|
5
|
+
|
|
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
|
+
|
|
8
|
+
import React__default, { forwardRef, useRef, useState, useMemo, useCallback, useImperativeHandle, useEffect } from 'react';
|
|
9
|
+
import { c as cn } from './bem-893ad28d.js';
|
|
10
|
+
import { u as useTouch } from './useTouch-a2ea68c6.js';
|
|
11
|
+
import { a as getRect } from './useClientRect-8b7cc406.js';
|
|
12
|
+
|
|
13
|
+
function preventDefault(event, isStopPropagation) {
|
|
14
|
+
if (typeof event.cancelable !== 'boolean' || event.cancelable) {
|
|
15
|
+
event.preventDefault();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (isStopPropagation) {
|
|
19
|
+
event.stopPropagation();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var defaultProps = {
|
|
24
|
+
name: '',
|
|
25
|
+
leftWidth: 0,
|
|
26
|
+
rightWidth: 0
|
|
27
|
+
};
|
|
28
|
+
var Swipe = forwardRef(function (props, instanceRef) {
|
|
29
|
+
var swipeBem = cn('swipe');
|
|
30
|
+
var touch = useTouch();
|
|
31
|
+
|
|
32
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
33
|
+
children = _defaultProps$props.children,
|
|
34
|
+
className = _defaultProps$props.className,
|
|
35
|
+
style = _defaultProps$props.style;
|
|
36
|
+
|
|
37
|
+
var root = useRef();
|
|
38
|
+
var opened = useRef(false);
|
|
39
|
+
var lockClick = useRef(false);
|
|
40
|
+
var startOffset = useRef(0);
|
|
41
|
+
|
|
42
|
+
var _useState = useState({
|
|
43
|
+
offset: 0,
|
|
44
|
+
dragging: false
|
|
45
|
+
}),
|
|
46
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
47
|
+
state = _useState2[0],
|
|
48
|
+
setState = _useState2[1];
|
|
49
|
+
|
|
50
|
+
var _useState3 = useState({
|
|
51
|
+
left: 0,
|
|
52
|
+
right: 0
|
|
53
|
+
}),
|
|
54
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
55
|
+
actionWidth = _useState4[0],
|
|
56
|
+
setActionWidth = _useState4[1];
|
|
57
|
+
|
|
58
|
+
var wrapperStyle = {
|
|
59
|
+
transform: "translate3d(".concat(state.offset, "px, 0, 0)"),
|
|
60
|
+
transitionDuration: state.dragging ? '0s' : '.6s'
|
|
61
|
+
};
|
|
62
|
+
var leftWidth = useMemo(function () {
|
|
63
|
+
return props.leftWidth ? props.leftWidth : actionWidth.left;
|
|
64
|
+
}, [props.leftWidth, actionWidth.left]);
|
|
65
|
+
var rightWidth = useMemo(function () {
|
|
66
|
+
return props.rightWidth ? props.rightWidth : actionWidth.right;
|
|
67
|
+
}, [props.rightWidth, actionWidth.right]);
|
|
68
|
+
|
|
69
|
+
var _onTouchStart = function onTouchStart(event) {
|
|
70
|
+
if (!props.disabled) {
|
|
71
|
+
startOffset.current = state.offset;
|
|
72
|
+
touch.start(event);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
var _onTouchMove = function onTouchMove(event) {
|
|
77
|
+
if (props.disabled) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
touch.move(event);
|
|
82
|
+
|
|
83
|
+
if (touch.isHorizontal()) {
|
|
84
|
+
lockClick.current = true;
|
|
85
|
+
|
|
86
|
+
var newState = _objectSpread(_objectSpread({}, state), {}, {
|
|
87
|
+
dragging: true
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
var isEdge = !opened || touch.deltaX * startOffset.current < 0;
|
|
91
|
+
|
|
92
|
+
if (isEdge) {
|
|
93
|
+
preventDefault(event, true);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
newState.offset = rangeCalculation(touch.deltaX + startOffset.current, -rightWidth, leftWidth);
|
|
97
|
+
setState(newState);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
var onTouchEnd = function onTouchEnd() {
|
|
102
|
+
if (state.dragging) {
|
|
103
|
+
setState(function (v) {
|
|
104
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
105
|
+
dragging: false
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
toggle(state.offset > 0 ? 'left' : 'right');
|
|
109
|
+
setTimeout(function () {
|
|
110
|
+
lockClick.current = false;
|
|
111
|
+
}, 0);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
var toggle = function toggle(side) {
|
|
116
|
+
var offset = Math.abs(state.offset);
|
|
117
|
+
var base = 0.3;
|
|
118
|
+
var baseNum = opened ? 1 - base : base;
|
|
119
|
+
var width = side === 'left' ? leftWidth : rightWidth;
|
|
120
|
+
|
|
121
|
+
if (width && offset > Number(width) * baseNum) {
|
|
122
|
+
open(side);
|
|
123
|
+
} else {
|
|
124
|
+
_close(side);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
var open = function open(side) {
|
|
129
|
+
var _props$onOpen;
|
|
130
|
+
|
|
131
|
+
opened.current = true;
|
|
132
|
+
var offset = side === 'left' ? leftWidth : -rightWidth;
|
|
133
|
+
var name = props.name;
|
|
134
|
+
(_props$onOpen = props.onOpen) === null || _props$onOpen === void 0 ? void 0 : _props$onOpen.call(props, {
|
|
135
|
+
name: name,
|
|
136
|
+
position: side
|
|
137
|
+
});
|
|
138
|
+
setState(function (v) {
|
|
139
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
140
|
+
offset: Number(offset) || 0
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
var _close = function close(position) {
|
|
146
|
+
if (opened.current) {
|
|
147
|
+
var _props$onClose;
|
|
148
|
+
|
|
149
|
+
opened.current = false;
|
|
150
|
+
(_props$onClose = props.onClose) === null || _props$onClose === void 0 ? void 0 : _props$onClose.call(props, {
|
|
151
|
+
name: props.name,
|
|
152
|
+
position: position || 'left'
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
setState(function (v) {
|
|
157
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
158
|
+
offset: 0
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
var rangeCalculation = function rangeCalculation(num, min, max) {
|
|
164
|
+
return Math.min(Math.max(Number(num), Number(min)), Number(max));
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
var getNodeWidth = function getNodeWidth(node) {
|
|
168
|
+
if (node) {
|
|
169
|
+
var ele = getRect(node);
|
|
170
|
+
return ele.width;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return 0;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
var leftRef = useCallback(function (node) {
|
|
177
|
+
if (node !== null) {
|
|
178
|
+
setActionWidth(function (v) {
|
|
179
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
180
|
+
left: getNodeWidth(node)
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}, [props.leftAction]);
|
|
185
|
+
var rightRef = useCallback(function (node) {
|
|
186
|
+
if (node !== null) {
|
|
187
|
+
setActionWidth(function (v) {
|
|
188
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
189
|
+
right: getNodeWidth(node)
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}, [props.rightAction]);
|
|
194
|
+
|
|
195
|
+
var renderActionContent = function renderActionContent(side, measuredRef) {
|
|
196
|
+
if (props["".concat(side, "Action")]) {
|
|
197
|
+
return React__default.createElement("div", {
|
|
198
|
+
ref: measuredRef,
|
|
199
|
+
className: "".concat(swipeBem(side)),
|
|
200
|
+
onClick: function onClick(e) {
|
|
201
|
+
return handleOperate(e, side);
|
|
202
|
+
}
|
|
203
|
+
}, props["".concat(side, "Action")]);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return null;
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
var handleOperate = function handleOperate(event, position) {
|
|
210
|
+
event.stopPropagation();
|
|
211
|
+
|
|
212
|
+
if (props.beforeClose) {
|
|
213
|
+
props.beforeClose(position);
|
|
214
|
+
} else {
|
|
215
|
+
props.onActionClick && props.onActionClick(event, position);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
useImperativeHandle(instanceRef, function () {
|
|
220
|
+
return {
|
|
221
|
+
open: open,
|
|
222
|
+
close: function close() {
|
|
223
|
+
return _close();
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
});
|
|
227
|
+
useEffect(function () {
|
|
228
|
+
var handler = function handler(event) {
|
|
229
|
+
var targets = [root];
|
|
230
|
+
|
|
231
|
+
if (targets.some(function (targetItem) {
|
|
232
|
+
var targetElement = targetItem.current || targetItem;
|
|
233
|
+
return !targetElement || (targetElement === null || targetElement === void 0 ? void 0 : targetElement.contains(event.target));
|
|
234
|
+
})) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
_close();
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
document.addEventListener('touchstart', handler);
|
|
242
|
+
return function () {
|
|
243
|
+
document.removeEventListener('touchstart', handler);
|
|
244
|
+
};
|
|
245
|
+
}, []);
|
|
246
|
+
return React__default.createElement("div", {
|
|
247
|
+
ref: root,
|
|
248
|
+
className: "".concat(swipeBem(), " ").concat(className),
|
|
249
|
+
onTouchStart: function onTouchStart(e) {
|
|
250
|
+
return _onTouchStart(e);
|
|
251
|
+
},
|
|
252
|
+
onTouchMove: function onTouchMove(e) {
|
|
253
|
+
return _onTouchMove(e);
|
|
254
|
+
},
|
|
255
|
+
onTouchEnd: onTouchEnd,
|
|
256
|
+
style: style
|
|
257
|
+
}, React__default.createElement("div", {
|
|
258
|
+
className: "".concat(swipeBem('wrapper')),
|
|
259
|
+
style: wrapperStyle
|
|
260
|
+
}, renderActionContent('left', leftRef), children, renderActionContent('right', rightRef)));
|
|
261
|
+
});
|
|
262
|
+
Swipe.defaultProps = defaultProps;
|
|
263
|
+
Swipe.displayName = 'NutSwipe';
|
|
264
|
+
export { Swipe as S };
|
|
@@ -14,6 +14,7 @@ import React__default, { useRef, useState, useMemo, useEffect } from 'react';
|
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import { D as DataContext } from './UserContext-b4181162.js';
|
|
16
16
|
import { c as cn } from './bem-893ad28d.js';
|
|
17
|
+
import { g as getRectByTaro } from './useClientRect-8b7cc406.js';
|
|
17
18
|
var defaultProps = {
|
|
18
19
|
width: (typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object' ? window.innerWidth : 375,
|
|
19
20
|
height: 0,
|
|
@@ -457,7 +458,7 @@ var Swiper = React__default.forwardRef(function (props, ref) {
|
|
|
457
458
|
case 0:
|
|
458
459
|
active = _args.length > 0 && _args[0] !== undefined ? _args[0] : +propSwiper.initPage;
|
|
459
460
|
_context.next = 3;
|
|
460
|
-
return container.current
|
|
461
|
+
return getRectByTaro(container.current);
|
|
461
462
|
|
|
462
463
|
case 3:
|
|
463
464
|
rect = _context.sent;
|
|
@@ -11,7 +11,7 @@ import React__default, { useState, useEffect } from 'react';
|
|
|
11
11
|
import classNames from 'classnames';
|
|
12
12
|
import { c as cn } from './bem-893ad28d.js';
|
|
13
13
|
import { I as Icon } from './icon-8dc4de10.js';
|
|
14
|
-
import { u as useConfig } from './configprovider-
|
|
14
|
+
import { u as useConfig } from './configprovider-9c393a29.js';
|
|
15
15
|
var defaultProps = {
|
|
16
16
|
className: '',
|
|
17
17
|
style: {},
|
|
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
6
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
7
|
|
|
8
8
|
import React__default, { useState, useEffect } from 'react';
|
|
9
|
-
import { u as useConfig } from './configprovider-
|
|
9
|
+
import { u as useConfig } from './configprovider-9c393a29.js';
|
|
10
10
|
import { c as cn } from './bem-893ad28d.js';
|
|
11
11
|
var defaultProps = {
|
|
12
12
|
defaultValue: '',
|
|
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
|
|
8
8
|
import React__default, { useState, useEffect } from 'react';
|
|
9
9
|
import { c as cn } from './bem-893ad28d.js';
|
|
10
|
-
import { u as useConfig } from './configprovider-
|
|
10
|
+
import { u as useConfig } from './configprovider-9c393a29.js';
|
|
11
11
|
var defaultProps = {
|
|
12
12
|
className: '',
|
|
13
13
|
currentKey: 0,
|
|
@@ -6,7 +6,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
6
6
|
|
|
7
7
|
import React__default from 'react';
|
|
8
8
|
import { c as cn } from './bem-893ad28d.js';
|
|
9
|
-
import { u as useConfig } from './configprovider-
|
|
9
|
+
import { u as useConfig } from './configprovider-9c393a29.js';
|
|
10
10
|
var defaultProps = {
|
|
11
11
|
className: '',
|
|
12
12
|
date: '',
|
|
@@ -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 { P as Popup } from './popup-67173ec6.js';
|
|
11
11
|
import { c as cn } from './bem-893ad28d.js';
|
|
12
|
-
import { u as useConfig } from './configprovider-
|
|
12
|
+
import { u as useConfig } from './configprovider-9c393a29.js';
|
|
13
13
|
var defaultProps$2 = {
|
|
14
14
|
className: '',
|
|
15
15
|
date: '',
|
|
@@ -4,7 +4,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
4
4
|
|
|
5
5
|
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; }
|
|
6
6
|
|
|
7
|
-
import { N as Notification } from './Notification-
|
|
7
|
+
import { N as Notification } from './Notification-422905bd.js';
|
|
8
8
|
var messageInstance = null;
|
|
9
9
|
var options = {
|
|
10
10
|
msg: '',
|
|
@@ -14,7 +14,7 @@ import React__default, { useState, useEffect, useImperativeHandle } from 'react'
|
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import { I as Icon } from './icon-8dc4de10.js';
|
|
16
16
|
import { c as cn } from './bem-893ad28d.js';
|
|
17
|
-
import { u as useConfig } from './configprovider-
|
|
17
|
+
import { u as useConfig } from './configprovider-9c393a29.js';
|
|
18
18
|
|
|
19
19
|
var UploadOptions = /*#__PURE__*/_createClass(function UploadOptions() {
|
|
20
20
|
_classCallCheck(this, UploadOptions);
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
获取元素的大小及其相对于视口的位置,等价于 Element.getBoundingClientRect。
|
|
6
|
+
width 宽度 number
|
|
7
|
+
height 高度 number
|
|
8
|
+
top 顶部与视图窗口左上角的距离 number
|
|
9
|
+
left 左侧与视图窗口左上角的距离 number
|
|
10
|
+
right 右侧与视图窗口左上角的距离 number
|
|
11
|
+
bottom 底部与视图窗口左上角的距离 number
|
|
12
|
+
*/
|
|
13
|
+
function isWindow(val) {
|
|
14
|
+
return val === window;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var getRect = function getRect(elementRef) {
|
|
18
|
+
var element = elementRef;
|
|
19
|
+
|
|
20
|
+
if (isWindow(element)) {
|
|
21
|
+
var width = element.innerWidth;
|
|
22
|
+
var height = element.innerHeight;
|
|
23
|
+
return {
|
|
24
|
+
top: 0,
|
|
25
|
+
left: 0,
|
|
26
|
+
right: width,
|
|
27
|
+
bottom: height,
|
|
28
|
+
width: width,
|
|
29
|
+
height: height
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (element && element.getBoundingClientRect) {
|
|
34
|
+
return element.getBoundingClientRect();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
top: 0,
|
|
39
|
+
left: 0,
|
|
40
|
+
right: 0,
|
|
41
|
+
bottom: 0,
|
|
42
|
+
width: 0,
|
|
43
|
+
height: 0
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var getRectByTaro = /*#__PURE__*/function () {
|
|
48
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(element) {
|
|
49
|
+
var res;
|
|
50
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
51
|
+
while (1) {
|
|
52
|
+
switch (_context.prev = _context.next) {
|
|
53
|
+
case 0:
|
|
54
|
+
_context.next = 2;
|
|
55
|
+
return element.getBoundingClientRect();
|
|
56
|
+
|
|
57
|
+
case 2:
|
|
58
|
+
res = _context.sent;
|
|
59
|
+
return _context.abrupt("return", res);
|
|
60
|
+
|
|
61
|
+
case 4:
|
|
62
|
+
case "end":
|
|
63
|
+
return _context.stop();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}, _callee);
|
|
67
|
+
}));
|
|
68
|
+
|
|
69
|
+
return function getRectByTaro(_x) {
|
|
70
|
+
return _ref.apply(this, arguments);
|
|
71
|
+
};
|
|
72
|
+
}();
|
|
73
|
+
|
|
74
|
+
export { getRect as a, getRectByTaro as g };
|
|
@@ -8,7 +8,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
8
8
|
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; }
|
|
9
9
|
|
|
10
10
|
import React__default, { useRef, useState, useEffect, useCallback } from 'react';
|
|
11
|
-
import { u as useConfig } from './configprovider-
|
|
11
|
+
import { u as useConfig } from './configprovider-9c393a29.js'; // 缓存列表初始化信息
|
|
12
12
|
|
|
13
13
|
var initPositinoCache = function initPositinoCache(reaItemSize) {
|
|
14
14
|
var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
@@ -105,6 +105,22 @@ var zhCN = {
|
|
|
105
105
|
title4: '搜索框文本设置',
|
|
106
106
|
title5: '自定义图标设置',
|
|
107
107
|
title6: '数据改变监听'
|
|
108
|
+
},
|
|
109
|
+
audio: {
|
|
110
|
+
back: '快退',
|
|
111
|
+
forward: '快进',
|
|
112
|
+
pause: '暂停',
|
|
113
|
+
start: '开始',
|
|
114
|
+
mute: '静音',
|
|
115
|
+
tips: 'onPlayEnd事件在loop=false时才会触发'
|
|
116
|
+
},
|
|
117
|
+
datepicker: {
|
|
118
|
+
year: '年',
|
|
119
|
+
month: '月',
|
|
120
|
+
day: '日',
|
|
121
|
+
hour: '时',
|
|
122
|
+
min: '分',
|
|
123
|
+
seconds: '秒'
|
|
108
124
|
}
|
|
109
125
|
};
|
|
110
126
|
export { zhCN as z };
|
package/dist/locales/base.d.ts
CHANGED
|
@@ -100,4 +100,20 @@ export interface BaseLang {
|
|
|
100
100
|
title5: string;
|
|
101
101
|
title6: string;
|
|
102
102
|
};
|
|
103
|
+
audio: {
|
|
104
|
+
back: string;
|
|
105
|
+
forward: string;
|
|
106
|
+
pause: string;
|
|
107
|
+
start: string;
|
|
108
|
+
mute: string;
|
|
109
|
+
tips: string;
|
|
110
|
+
};
|
|
111
|
+
datepicker: {
|
|
112
|
+
year: string;
|
|
113
|
+
month: string;
|
|
114
|
+
day: string;
|
|
115
|
+
hour: string;
|
|
116
|
+
min: string;
|
|
117
|
+
seconds: string;
|
|
118
|
+
};
|
|
103
119
|
}
|
package/dist/locales/base.js
CHANGED
package/dist/locales/en-US.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react-taro v1.3.0 Wed Aug
|
|
2
|
+
* @nutui/nutui-react-taro v1.3.1-beta.0 Wed Aug 31 2022 14:04:18 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -102,6 +102,22 @@ const enUS = {
|
|
|
102
102
|
title4: "search box text settings",
|
|
103
103
|
title5: "custom icon settings",
|
|
104
104
|
title6: "data change monitoring"
|
|
105
|
+
},
|
|
106
|
+
audio: {
|
|
107
|
+
back: "fastBack",
|
|
108
|
+
forward: "forward",
|
|
109
|
+
pause: "pause",
|
|
110
|
+
start: "start",
|
|
111
|
+
mute: "mute",
|
|
112
|
+
tips: "The onplayend event will only be triggered when loop = false"
|
|
113
|
+
},
|
|
114
|
+
datepicker: {
|
|
115
|
+
year: "Year",
|
|
116
|
+
month: "Month",
|
|
117
|
+
day: "Day",
|
|
118
|
+
hour: "Hour",
|
|
119
|
+
min: "Minute",
|
|
120
|
+
seconds: "Second"
|
|
105
121
|
}
|
|
106
122
|
};
|
|
107
123
|
export { enUS as default };
|
package/dist/locales/id-ID.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react-taro v1.3.0 Wed Aug
|
|
2
|
+
* @nutui/nutui-react-taro v1.3.1-beta.0 Wed Aug 31 2022 14:04:18 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -102,6 +102,22 @@ const idID = {
|
|
|
102
102
|
title4: "tetapan teks kotak pencarian",
|
|
103
103
|
title5: "pengaturan ikon suai",
|
|
104
104
|
title6: "Monitor perubahan data"
|
|
105
|
+
},
|
|
106
|
+
audio: {
|
|
107
|
+
back: "Fastback",
|
|
108
|
+
forward: "maju",
|
|
109
|
+
pause: "berhenti sebentar",
|
|
110
|
+
start: "Mulailah",
|
|
111
|
+
mute: "bisu",
|
|
112
|
+
tips: "Acara Onplayend hanya akan dipicu saat loop = false"
|
|
113
|
+
},
|
|
114
|
+
datepicker: {
|
|
115
|
+
year: "Tahun",
|
|
116
|
+
month: "Bulan",
|
|
117
|
+
day: "Hari",
|
|
118
|
+
hour: "Jam",
|
|
119
|
+
min: "Menit",
|
|
120
|
+
seconds: "Detik"
|
|
105
121
|
}
|
|
106
122
|
};
|
|
107
123
|
export { idID as default };
|
package/dist/locales/zh-CN.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react-taro v1.3.0 Wed Aug
|
|
2
|
+
* @nutui/nutui-react-taro v1.3.1-beta.0 Wed Aug 31 2022 14:04:18 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -104,6 +104,22 @@ const zhCN = {
|
|
|
104
104
|
title4: "\u641C\u7D22\u6846\u6587\u672C\u8BBE\u7F6E",
|
|
105
105
|
title5: "\u81EA\u5B9A\u4E49\u56FE\u6807\u8BBE\u7F6E",
|
|
106
106
|
title6: "\u6570\u636E\u6539\u53D8\u76D1\u542C"
|
|
107
|
+
},
|
|
108
|
+
audio: {
|
|
109
|
+
back: "\u5FEB\u9000",
|
|
110
|
+
forward: "\u5FEB\u8FDB",
|
|
111
|
+
pause: "\u6682\u505C",
|
|
112
|
+
start: "\u5F00\u59CB",
|
|
113
|
+
mute: "\u9759\u97F3",
|
|
114
|
+
tips: "onPlayEnd\u4E8B\u4EF6\u5728loop=false\u65F6\u624D\u4F1A\u89E6\u53D1"
|
|
115
|
+
},
|
|
116
|
+
datepicker: {
|
|
117
|
+
year: "\u5E74",
|
|
118
|
+
month: "\u6708",
|
|
119
|
+
day: "\u65E5",
|
|
120
|
+
hour: "\u65F6",
|
|
121
|
+
min: "\u5206",
|
|
122
|
+
seconds: "\u79D2"
|
|
107
123
|
}
|
|
108
124
|
};
|
|
109
125
|
export { zhCN as default };
|
package/dist/locales/zh-TW.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react-taro v1.3.0 Wed Aug
|
|
2
|
+
* @nutui/nutui-react-taro v1.3.1-beta.0 Wed Aug 31 2022 14:04:18 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -102,6 +102,22 @@ const zhTW = {
|
|
|
102
102
|
title4: "\u8490\u7D22\u6846\u6587\u5B57\u8A2D\u5B9A",
|
|
103
103
|
title5: "\u81EA\u5B9A\u7FA9\u5716\u6A19\u8A2D\u5B9A",
|
|
104
104
|
title6: "\u6578\u64DA\u6539\u8B8A\u76E3\u807D"
|
|
105
|
+
},
|
|
106
|
+
audio: {
|
|
107
|
+
back: "\u5FEB\u9000",
|
|
108
|
+
forward: "\u5FEB\u9032",
|
|
109
|
+
pause: "\u66AB\u505C",
|
|
110
|
+
start: "\u958B\u59CB",
|
|
111
|
+
mute: "\u975C\u97F3",
|
|
112
|
+
tips: "onPlayEnd\u4E8B\u4EF6\u5728loop=false\u6642\u624D\u6703\u89F8\u767C"
|
|
113
|
+
},
|
|
114
|
+
datepicker: {
|
|
115
|
+
year: "\u5E74",
|
|
116
|
+
month: "\u6708",
|
|
117
|
+
day: "\u65E5",
|
|
118
|
+
hour: "\u6642",
|
|
119
|
+
min: "\u5206",
|
|
120
|
+
seconds: "\u79D2"
|
|
105
121
|
}
|
|
106
122
|
};
|
|
107
123
|
export { zhTW as default };
|