@nutui/nutui-react-taro 3.0.8 → 3.0.9-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/CHANGELOG.md +13 -14
- package/dist/cjs/hooks/index.d.ts +12 -0
- package/dist/cjs/hooks/index.js +19 -0
- package/dist/cjs/hooks/{use-custom-event.js → taro/use-custom-event.js} +1 -1
- package/dist/cjs/hooks/{use-lock-scoll-taro.js → taro/use-lock-scoll.js} +1 -1
- package/dist/cjs/hooks/use-memo.d.ts +1 -1
- package/dist/cjs/hooks/use-memo.js +1 -1
- package/dist/cjs/hooks/use-refs.d.ts +1 -1
- package/dist/cjs/hooks/use-refs.js +1 -1
- package/dist/cjs/hooks/use-uuid.d.ts +1 -1
- package/dist/cjs/hooks/use-uuid.js +1 -1
- package/dist/cjs/hooks/use-watch.d.ts +2 -2
- package/dist/cjs/hooks/use-watch.js +2 -3
- package/dist/cjs/packages/address/address.d.ts +1 -1
- package/dist/cjs/packages/avatar/avatar.js +6 -6
- package/dist/cjs/packages/avatarcropper/avatarcropper.js +1 -1
- package/dist/cjs/packages/badge/badge.js +5 -5
- package/dist/cjs/packages/barrage/barrage.js +3 -3
- package/dist/cjs/packages/button/button.js +3 -3
- package/dist/cjs/packages/cell/cell.js +2 -2
- package/dist/cjs/packages/col/col.js +3 -3
- package/dist/cjs/packages/collapseitem/collapseitem.js +4 -4
- package/dist/cjs/packages/configprovider/configprovider.js +2 -2
- package/dist/cjs/packages/countdown/countdown.js +2 -2
- package/dist/cjs/packages/dialog/dialog.js +5 -5
- package/dist/cjs/packages/drag/drag.js +5 -5
- package/dist/cjs/packages/elevator/elevator.js +4 -4
- package/dist/cjs/packages/ellipsis/ellipsis.js +4 -4
- package/dist/cjs/packages/griditem/griditem.js +4 -4
- package/dist/cjs/packages/hoverbutton/hoverbutton.js +2 -2
- package/dist/cjs/packages/hoverbuttonitem/hoverbuttonitem.js +2 -2
- package/dist/cjs/packages/image/image.js +2 -2
- package/dist/cjs/packages/indicator/indicator.js +2 -2
- package/dist/cjs/packages/infiniteloading/infiniteloading.js +2 -2
- package/dist/cjs/packages/lottie/lottiemp.js +3 -3
- package/dist/cjs/packages/menuitem/menuitem.js +4 -4
- package/dist/cjs/packages/noticebar/noticebar.js +4 -4
- package/dist/cjs/packages/notify/notify.js +5 -5
- package/dist/cjs/packages/nutui.react.build.d.ts +2 -0
- package/dist/cjs/packages/nutui.react.build.js +2 -0
- package/dist/cjs/packages/nutui.react.d.ts +2 -0
- package/dist/cjs/packages/nutui.react.js +2 -0
- package/dist/cjs/packages/overlay/overlay.js +2 -2
- package/dist/cjs/packages/pagination/pagination.js +3 -3
- package/dist/cjs/packages/picker/picker.js +2 -2
- package/dist/cjs/packages/pickerview/pickerroller.js +7 -7
- package/dist/cjs/packages/popover/popover.js +15 -15
- package/dist/cjs/packages/popup/popup.js +4 -4
- package/dist/cjs/packages/price/price.js +2 -2
- package/dist/cjs/packages/progress/progress.js +13 -13
- package/dist/cjs/packages/pulltorefresh/pulltorefresh.js +4 -4
- package/dist/cjs/packages/range/range.js +13 -13
- package/dist/cjs/packages/rate/rate.js +4 -4
- package/dist/cjs/packages/sidebar/sidebar.js +2 -2
- package/dist/cjs/packages/sticky/sticky.js +7 -7
- package/dist/cjs/packages/swipe/swipe.js +10 -10
- package/dist/cjs/packages/swiper/swiper.js +4 -4
- package/dist/cjs/packages/tabs/tabs.js +2 -2
- package/dist/cjs/packages/toast/toast.js +3 -3
- package/dist/cjs/packages/tour/tour.js +2 -2
- package/dist/cjs/packages/trendarrow/trendarrow.js +3 -3
- package/dist/cjs/packages/virtuallist/virtuallist.js +1 -1
- package/dist/cjs/utils/clamp.d.ts +1 -0
- package/dist/cjs/utils/clamp.js +13 -0
- package/dist/cjs/utils/event-mocker.d.ts +21 -0
- package/dist/cjs/utils/index.d.ts +28 -6
- package/dist/cjs/utils/index.js +35 -54
- package/dist/cjs/utils/interceptor.js +2 -2
- package/dist/cjs/utils/is-function.d.ts +1 -0
- package/dist/cjs/utils/is-function.js +14 -0
- package/dist/cjs/utils/is-object.d.ts +1 -0
- package/dist/cjs/utils/is-object.js +14 -0
- package/dist/cjs/utils/is-promise.d.ts +1 -0
- package/dist/cjs/utils/is-promise.js +15 -0
- package/dist/cjs/utils/lru.d.ts +1 -1
- package/dist/cjs/utils/lru.js +1 -1
- package/dist/cjs/utils/merge.d.ts +0 -1
- package/dist/cjs/utils/merge.js +0 -4
- package/dist/cjs/utils/prevent-default.d.ts +1 -0
- package/dist/cjs/utils/prevent-default.js +18 -0
- package/dist/cjs/utils/raf.d.ts +0 -1
- package/dist/cjs/utils/raf.js +3 -6
- package/dist/cjs/utils/{add-color-for-harmony.js → taro/add-color-for-harmony.js} +5 -11
- package/dist/cjs/{hooks/use-taro-rect.js → utils/taro/get-rect-by-id.js} +3 -3
- package/dist/cjs/utils/{get-rect-by-taro.js → taro/get-rect.js} +9 -10
- package/dist/cjs/utils/{px-transform.js → taro/px-transform.js} +3 -3
- package/dist/cjs/utils/upper-case-first.d.ts +1 -0
- package/dist/cjs/utils/upper-case-first.js +17 -0
- package/dist/es/hooks/index.d.ts +12 -0
- package/dist/es/hooks/index.js +14 -0
- package/dist/es/hooks/{use-custom-event.js → taro/use-custom-event.js} +1 -1
- package/dist/es/hooks/{use-lock-scoll-taro.js → taro/use-lock-scoll.js} +1 -1
- package/dist/es/hooks/use-memo.d.ts +1 -1
- package/dist/es/hooks/use-memo.js +1 -1
- package/dist/es/hooks/use-refs.d.ts +1 -1
- package/dist/es/hooks/use-refs.js +1 -1
- package/dist/es/hooks/use-uuid.d.ts +1 -1
- package/dist/es/hooks/use-uuid.js +1 -1
- package/dist/es/hooks/use-watch.d.ts +2 -2
- package/dist/es/hooks/use-watch.js +1 -2
- package/dist/es/packages/address/address.d.ts +1 -1
- package/dist/es/packages/avatar/avatar.js +2 -2
- package/dist/es/packages/avatarcropper/avatarcropper.js +1 -1
- package/dist/es/packages/badge/badge.js +2 -2
- package/dist/es/packages/barrage/barrage.js +3 -3
- package/dist/es/packages/button/button.js +1 -1
- package/dist/es/packages/cell/cell.js +1 -1
- package/dist/es/packages/col/col.js +1 -1
- package/dist/es/packages/collapseitem/collapseitem.js +3 -3
- package/dist/es/packages/configprovider/configprovider.js +1 -1
- package/dist/es/packages/countdown/countdown.js +1 -1
- package/dist/es/packages/dialog/dialog.js +3 -3
- package/dist/es/packages/drag/drag.js +4 -4
- package/dist/es/packages/elevator/elevator.js +2 -2
- package/dist/es/packages/ellipsis/ellipsis.js +4 -4
- package/dist/es/packages/griditem/griditem.js +1 -1
- package/dist/es/packages/hoverbutton/hoverbutton.js +1 -1
- package/dist/es/packages/hoverbuttonitem/hoverbuttonitem.js +1 -1
- package/dist/es/packages/image/image.js +1 -1
- package/dist/es/packages/indicator/indicator.js +1 -1
- package/dist/es/packages/infiniteloading/infiniteloading.js +1 -1
- package/dist/es/packages/lottie/lottiemp.js +2 -2
- package/dist/es/packages/menuitem/menuitem.js +4 -4
- package/dist/es/packages/noticebar/noticebar.js +4 -4
- package/dist/es/packages/notify/notify.js +3 -3
- package/dist/es/packages/nutui.react.build.d.ts +2 -0
- package/dist/es/packages/nutui.react.build.js +2 -0
- package/dist/es/packages/overlay/overlay.js +1 -1
- package/dist/es/packages/pagination/pagination.js +1 -1
- package/dist/es/packages/picker/picker.js +1 -1
- package/dist/es/packages/pickerview/pickerroller.js +4 -4
- package/dist/es/packages/popover/popover.js +6 -6
- package/dist/es/packages/popup/popup.js +2 -2
- package/dist/es/packages/price/price.js +1 -1
- package/dist/es/packages/progress/progress.js +3 -3
- package/dist/es/packages/pulltorefresh/pulltorefresh.js +2 -2
- package/dist/es/packages/range/range.js +5 -5
- package/dist/es/packages/rate/rate.js +3 -3
- package/dist/es/packages/sidebar/sidebar.js +1 -1
- package/dist/es/packages/sticky/sticky.js +6 -6
- package/dist/es/packages/swipe/swipe.js +7 -7
- package/dist/es/packages/swiper/swiper.js +1 -1
- package/dist/es/packages/tabs/tabs.js +1 -1
- package/dist/es/packages/toast/toast.js +2 -2
- package/dist/es/packages/tour/tour.js +2 -2
- package/dist/es/packages/trendarrow/trendarrow.js +1 -1
- package/dist/es/packages/virtuallist/virtuallist.js +1 -1
- package/dist/es/utils/clamp.d.ts +1 -0
- package/dist/es/utils/clamp.js +3 -0
- package/dist/es/utils/event-mocker.d.ts +21 -0
- package/dist/es/utils/index.d.ts +28 -6
- package/dist/es/utils/index.js +34 -29
- package/dist/es/utils/interceptor.js +1 -1
- package/dist/es/utils/is-function.d.ts +1 -0
- package/dist/es/utils/is-function.js +4 -0
- package/dist/es/utils/is-object.d.ts +1 -0
- package/dist/es/utils/is-object.js +4 -0
- package/dist/es/utils/is-promise.d.ts +1 -0
- package/dist/es/utils/is-promise.js +5 -0
- package/dist/es/utils/lru.d.ts +1 -1
- package/dist/es/utils/lru.js +1 -2
- package/dist/es/utils/merge.d.ts +0 -1
- package/dist/es/utils/merge.js +0 -1
- package/dist/es/utils/prevent-default.d.ts +1 -0
- package/dist/es/utils/prevent-default.js +8 -0
- package/dist/es/utils/raf.d.ts +0 -1
- package/dist/es/utils/raf.js +1 -1
- package/dist/es/utils/{add-color-for-harmony.js → taro/add-color-for-harmony.js} +2 -3
- package/dist/es/{hooks/use-taro-rect.js → utils/taro/get-rect-by-id.js} +1 -1
- package/dist/es/utils/{get-rect-by-taro.js → taro/get-rect.js} +4 -4
- package/dist/es/utils/{px-transform.js → taro/px-transform.js} +2 -2
- package/dist/es/utils/upper-case-first.d.ts +1 -0
- package/dist/es/utils/upper-case-first.js +7 -0
- package/dist/nutui.react.umd.js +506 -217
- package/dist/style.css +1 -1
- package/dist/style.scss +51 -51
- package/package.json +1 -1
- package/dist/cjs/hooks/use-custom-event.d.ts +0 -7
- package/dist/cjs/hooks/use-lock-scoll-taro.d.ts +0 -1
- package/dist/cjs/hooks/use-taro-rect.d.ts +0 -1
- package/dist/cjs/utils/add-color-for-harmony.d.ts +0 -9
- package/dist/cjs/utils/get-rect-by-taro.d.ts +0 -12
- package/dist/cjs/utils/get-system-info.d.ts +0 -19
- package/dist/cjs/utils/platform-taro.d.ts +0 -3
- package/dist/cjs/utils/px-transform.d.ts +0 -1
- package/dist/es/hooks/use-custom-event.d.ts +0 -7
- package/dist/es/hooks/use-lock-scoll-taro.d.ts +0 -1
- package/dist/es/hooks/use-taro-rect.d.ts +0 -1
- package/dist/es/utils/add-color-for-harmony.d.ts +0 -9
- package/dist/es/utils/get-rect-by-taro.d.ts +0 -12
- package/dist/es/utils/get-system-info.d.ts +0 -19
- package/dist/es/utils/platform-taro.d.ts +0 -3
- package/dist/es/utils/px-transform.d.ts +0 -1
- /package/dist/cjs/utils/{test/event.js → event-mocker.js} +0 -0
- /package/dist/cjs/{hooks/use-client-rect.d.ts → utils/get-rect.d.ts} +0 -0
- /package/dist/cjs/{hooks/use-client-rect.js → utils/get-rect.js} +0 -0
- /package/dist/cjs/utils/{get-system-info.js → taro/get-system-info.js} +0 -0
- /package/dist/cjs/utils/{platform-taro.js → taro/platform.js} +0 -0
- /package/dist/es/utils/{test/event.js → event-mocker.js} +0 -0
- /package/dist/es/{hooks/use-client-rect.d.ts → utils/get-rect.d.ts} +0 -0
- /package/dist/es/{hooks/use-client-rect.js → utils/get-rect.js} +0 -0
- /package/dist/es/utils/{get-system-info.js → taro/get-system-info.js} +0 -0
- /package/dist/es/utils/{platform-taro.js → taro/platform.js} +0 -0
package/dist/cjs/utils/lru.d.ts
CHANGED
package/dist/cjs/utils/lru.js
CHANGED
package/dist/cjs/utils/merge.js
CHANGED
|
@@ -12,9 +12,6 @@ _export(exports, {
|
|
|
12
12
|
clone: function() {
|
|
13
13
|
return clone;
|
|
14
14
|
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
},
|
|
18
15
|
isPlainObject: function() {
|
|
19
16
|
return isPlainObject;
|
|
20
17
|
},
|
|
@@ -30,7 +27,6 @@ _export(exports, {
|
|
|
30
27
|
});
|
|
31
28
|
var _to_consumable_array = require("@swc/helpers/_/_to_consumable_array");
|
|
32
29
|
var _type_of = require("@swc/helpers/_/_type_of");
|
|
33
|
-
var _default = main;
|
|
34
30
|
function main() {
|
|
35
31
|
for(var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++){
|
|
36
32
|
items[_key] = arguments[_key];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function preventDefault(event: React.TouchEvent<HTMLElement> | TouchEvent, isStopPropagation?: boolean): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "preventDefault", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return preventDefault;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
function preventDefault(event, isStopPropagation) {
|
|
12
|
+
if (typeof event.cancelable !== 'boolean' || event.cancelable) {
|
|
13
|
+
event.preventDefault();
|
|
14
|
+
}
|
|
15
|
+
if (isStopPropagation) {
|
|
16
|
+
event.stopPropagation();
|
|
17
|
+
}
|
|
18
|
+
}
|
package/dist/cjs/utils/raf.d.ts
CHANGED
package/dist/cjs/utils/raf.js
CHANGED
|
@@ -14,15 +14,12 @@ _export(exports, {
|
|
|
14
14
|
},
|
|
15
15
|
default: function() {
|
|
16
16
|
return _default;
|
|
17
|
-
},
|
|
18
|
-
inBrowser: function() {
|
|
19
|
-
return inBrowser;
|
|
20
17
|
}
|
|
21
18
|
});
|
|
22
|
-
var
|
|
19
|
+
var _getrect = require("./get-rect");
|
|
23
20
|
// 防频
|
|
24
21
|
function requestAniFrame() {
|
|
25
|
-
if (inBrowser) {
|
|
22
|
+
if (_getrect.inBrowser) {
|
|
26
23
|
var _window = window;
|
|
27
24
|
return _window.requestAnimationFrame || _window.webkitRequestAnimationFrame || function(callback) {
|
|
28
25
|
_window.setTimeout(callback, 1000 / 60);
|
|
@@ -33,7 +30,7 @@ function requestAniFrame() {
|
|
|
33
30
|
};
|
|
34
31
|
}
|
|
35
32
|
function cancelRaf(id) {
|
|
36
|
-
if (inBrowser) {
|
|
33
|
+
if (_getrect.inBrowser) {
|
|
37
34
|
var _window = window;
|
|
38
35
|
(_window.cancelAnimationFrame || _window.webkitCancelAnimationFrame)(id);
|
|
39
36
|
} else {
|
|
@@ -2,26 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
Object.defineProperty(exports, "
|
|
5
|
+
Object.defineProperty(exports, "addColorForHarmony", {
|
|
6
6
|
enumerable: true,
|
|
7
7
|
get: function() {
|
|
8
|
-
return
|
|
8
|
+
return addColorForHarmony;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
12
|
var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* @param maybeElement - 要处理的 React 节点
|
|
17
|
-
* @param color - 要添加的颜色值(如:'#ff0000')
|
|
18
|
-
* @returns 处理后的 React 节点
|
|
19
|
-
*/ function addColorForHarmony(maybeElement, color) {
|
|
20
|
-
if (/*#__PURE__*/ _react.default.isValidElement(maybeElement) && (0, _platformtaro.harmony)()) {
|
|
13
|
+
var _platform = require("./platform");
|
|
14
|
+
function addColorForHarmony(maybeElement, color) {
|
|
15
|
+
if (/*#__PURE__*/ _react.default.isValidElement(maybeElement) && (0, _platform.harmony)()) {
|
|
21
16
|
return /*#__PURE__*/ _react.default.cloneElement(maybeElement, {
|
|
22
17
|
color: color
|
|
23
18
|
});
|
|
24
19
|
}
|
|
25
20
|
return maybeElement;
|
|
26
21
|
}
|
|
27
|
-
var _default = addColorForHarmony;
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
Object.defineProperty(exports, "
|
|
5
|
+
Object.defineProperty(exports, "getRectById", {
|
|
6
6
|
enumerable: true,
|
|
7
7
|
get: function() {
|
|
8
|
-
return
|
|
8
|
+
return getRectById;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
12
|
var _taro = /*#__PURE__*/ _interop_require_wildcard._(require("@tarojs/taro"));
|
|
13
|
-
var
|
|
13
|
+
var getRectById = function getRectById(id) {
|
|
14
14
|
return new Promise(function(resolve, reject) {
|
|
15
15
|
if (_taro.default.getEnv() === _taro.default.ENV_TYPE.WEB) {
|
|
16
16
|
var t = document ? document.querySelector("#".concat(id)) : '';
|
|
@@ -9,21 +9,20 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
|
|
13
|
-
return
|
|
12
|
+
getRectInMultiPlatform: function() {
|
|
13
|
+
return getRectInMultiPlatform;
|
|
14
14
|
},
|
|
15
15
|
makeRect: function() {
|
|
16
16
|
return makeRect;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
19
|
var _async_to_generator = require("@swc/helpers/_/_async_to_generator");
|
|
21
20
|
var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
|
|
22
21
|
var _ts_generator = require("@swc/helpers/_/_ts_generator");
|
|
23
22
|
var _taro = require("@tarojs/taro");
|
|
24
|
-
var _lru =
|
|
25
|
-
var
|
|
26
|
-
var lru = new _lru.
|
|
23
|
+
var _lru = require("../lru");
|
|
24
|
+
var _getrect = require("../get-rect");
|
|
25
|
+
var lru = new _lru.MiniLru(10);
|
|
27
26
|
function makeRect(width, height) {
|
|
28
27
|
return {
|
|
29
28
|
top: 0,
|
|
@@ -34,17 +33,17 @@ function makeRect(width, height) {
|
|
|
34
33
|
height: height
|
|
35
34
|
};
|
|
36
35
|
}
|
|
37
|
-
var
|
|
36
|
+
var getRectInMultiPlatform = /*#__PURE__*/ function() {
|
|
38
37
|
var _ref = (0, _async_to_generator._)(function(element) {
|
|
39
38
|
var harmonyId;
|
|
40
39
|
var _arguments = arguments;
|
|
41
40
|
return (0, _ts_generator._)(this, function(_state) {
|
|
42
41
|
harmonyId = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : '';
|
|
43
42
|
if (element) {
|
|
44
|
-
if (
|
|
43
|
+
if (_getrect.inBrowser) {
|
|
45
44
|
return [
|
|
46
45
|
2,
|
|
47
|
-
Promise.resolve((0,
|
|
46
|
+
Promise.resolve((0, _getrect.getRect)(element))
|
|
48
47
|
];
|
|
49
48
|
}
|
|
50
49
|
// 小程序下的逻辑
|
|
@@ -71,7 +70,7 @@ var getRectByTaro = /*#__PURE__*/ function() {
|
|
|
71
70
|
];
|
|
72
71
|
});
|
|
73
72
|
});
|
|
74
|
-
return function
|
|
73
|
+
return function getRectInMultiPlatform(element) {
|
|
75
74
|
return _ref.apply(this, arguments);
|
|
76
75
|
};
|
|
77
76
|
}();
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
Object.defineProperty(exports, "
|
|
5
|
+
Object.defineProperty(exports, "pxTransform", {
|
|
6
6
|
enumerable: true,
|
|
7
7
|
get: function() {
|
|
8
8
|
return pxTransform;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _taro = require("@tarojs/taro");
|
|
12
|
-
var
|
|
12
|
+
var _platform = require("./platform");
|
|
13
13
|
function pxTransform(value, radix) {
|
|
14
14
|
// @ts-ignore
|
|
15
|
-
if ((0,
|
|
15
|
+
if ((0, _platform.harmony)()) return (0, _taro.pxTransform)(value, radix || 375);
|
|
16
16
|
return "".concat(value, "px");
|
|
17
17
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const upperCaseFirst: (str: string) => string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "upperCaseFirst", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return upperCaseFirst;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var upperCaseFirst = function upperCaseFirst(str) {
|
|
12
|
+
str = str.toLowerCase();
|
|
13
|
+
str = str.replace(/\b\w+\b/g, function(word) {
|
|
14
|
+
return word.substring(0, 1).toUpperCase() + word.substring(1);
|
|
15
|
+
});
|
|
16
|
+
return str;
|
|
17
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './use-click-away';
|
|
2
|
+
export * from './use-force-update';
|
|
3
|
+
export * from './use-isomprphic-layout-effect';
|
|
4
|
+
export * from './use-lock-scroll';
|
|
5
|
+
export * from './use-memo';
|
|
6
|
+
export * from './use-pagination';
|
|
7
|
+
export * from './use-props-value';
|
|
8
|
+
export * from './use-ref-state';
|
|
9
|
+
export * from './use-refs';
|
|
10
|
+
export * from './use-touch';
|
|
11
|
+
export * from './use-uuid';
|
|
12
|
+
export * from './use-watch';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./use-click-away";
|
|
2
|
+
export * from "./taro/use-custom-event";
|
|
3
|
+
export * from "./use-force-update";
|
|
4
|
+
export * from "./use-isomprphic-layout-effect";
|
|
5
|
+
export * from "./taro/use-lock-scoll";
|
|
6
|
+
export * from "./use-lock-scroll";
|
|
7
|
+
export * from "./use-memo";
|
|
8
|
+
export * from "./use-pagination";
|
|
9
|
+
export * from "./use-props-value";
|
|
10
|
+
export * from "./use-ref-state";
|
|
11
|
+
export * from "./use-refs";
|
|
12
|
+
export * from "./use-touch";
|
|
13
|
+
export * from "./use-uuid";
|
|
14
|
+
export * from "./use-watch";
|
|
@@ -2,7 +2,7 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
3
|
import isEqual from "react-fast-compare";
|
|
4
4
|
import { Events, getCurrentInstance } from "@tarojs/taro";
|
|
5
|
-
import { useForceUpdate } from "
|
|
5
|
+
import { useForceUpdate } from "../use-force-update";
|
|
6
6
|
export var customEvents = new Events();
|
|
7
7
|
export function useCustomEventsPath(selector) {
|
|
8
8
|
var _getCurrentInstance_router;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRef } from "react";
|
|
2
2
|
import { getEnv } from "@tarojs/taro";
|
|
3
|
-
import { useLockScroll } from "
|
|
3
|
+
import { useLockScroll } from "../use-lock-scroll";
|
|
4
4
|
export var useLockScrollTaro = function(shouldLock) {
|
|
5
5
|
var refObject = useRef(null);
|
|
6
6
|
if (getEnv() === 'WEB') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function useMemo<Value, Condition = any[]>(getValue: () => Value, condition: Condition, shouldUpdate: (prev: Condition, next: Condition) => boolean): Value | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export
|
|
2
|
+
export function useMemo(getValue, condition, shouldUpdate) {
|
|
3
3
|
var cacheRef = React.useRef({});
|
|
4
4
|
if (!('value' in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
|
|
5
5
|
cacheRef.current.value = getValue();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function useRefs(): any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function useUuid(): string;
|
|
@@ -2,5 +2,5 @@ type Callback<T> = (prev: T | undefined) => void;
|
|
|
2
2
|
type Config = {
|
|
3
3
|
immediate: boolean;
|
|
4
4
|
};
|
|
5
|
-
declare function useWatch<T>(dep: T, callback: Callback<T>, config?: Config): () => void;
|
|
6
|
-
export
|
|
5
|
+
export declare function useWatch<T>(dep: T, callback: Callback<T>, config?: Config): () => void;
|
|
6
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef } from "react";
|
|
2
|
-
function useWatch(dep, callback) {
|
|
2
|
+
export function useWatch(dep, callback) {
|
|
3
3
|
var config = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
|
|
4
4
|
immediate: false
|
|
5
5
|
};
|
|
@@ -29,4 +29,3 @@ function useWatch(dep, callback) {
|
|
|
29
29
|
stop.current = true;
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
export default useWatch;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AddressRef, TaroAddressProps } from "../../types";
|
|
3
|
-
export declare const Address: React.ForwardRefExoticComponent<Partial<TaroAddressProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange" | "
|
|
3
|
+
export declare const Address: React.ForwardRefExoticComponent<Partial<TaroAddressProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange" | "onClick" | "title" | "onLoad"> & React.RefAttributes<AddressRef>>;
|
|
@@ -8,9 +8,9 @@ import classNames from "classnames";
|
|
|
8
8
|
import { User } from "@nutui/icons-react-taro";
|
|
9
9
|
import { AvatarContext } from "../avatargroup/context";
|
|
10
10
|
import { ComponentDefaults } from "../../utils/typings";
|
|
11
|
-
import { harmony } from "../../utils/platform
|
|
11
|
+
import { harmony } from "../../utils/taro/platform";
|
|
12
12
|
import AvatarGroup from "../avatargroup/index";
|
|
13
|
-
import pxTransform from "../../utils/px-transform";
|
|
13
|
+
import { pxTransform } from "../../utils/taro/px-transform";
|
|
14
14
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
15
15
|
size: harmony() ? '40' : '',
|
|
16
16
|
shape: 'round',
|
|
@@ -8,7 +8,7 @@ import React, { useState, useEffect, useMemo, useCallback } from "react";
|
|
|
8
8
|
import Taro, { useReady, createSelectorQuery } from "@tarojs/taro";
|
|
9
9
|
import classNames from "classnames";
|
|
10
10
|
import { Canvas, View } from "@tarojs/components";
|
|
11
|
-
import { getWindowInfo } from "../../utils/get-system-info";
|
|
11
|
+
import { getWindowInfo } from "../../utils/taro/get-system-info";
|
|
12
12
|
import { Button } from "../button/button";
|
|
13
13
|
import { useConfig } from "../configprovider/index";
|
|
14
14
|
import { ComponentDefaults } from "../../utils/typings";
|
|
@@ -10,8 +10,8 @@ import classNames from "classnames";
|
|
|
10
10
|
import { View } from "@tarojs/components";
|
|
11
11
|
import { ComponentDefaults } from "../../utils/typings";
|
|
12
12
|
import { useRtl } from "../configprovider/index";
|
|
13
|
-
import pxTransform from "../../utils/px-transform";
|
|
14
|
-
import { harmony } from "../../utils/platform
|
|
13
|
+
import { pxTransform } from "../../utils/taro/px-transform";
|
|
14
|
+
import { harmony } from "../../utils/taro/platform";
|
|
15
15
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
16
16
|
value: '',
|
|
17
17
|
dot: false,
|
|
@@ -7,7 +7,7 @@ import React, { useEffect, useRef, useImperativeHandle } from "react";
|
|
|
7
7
|
import classNames from "classnames";
|
|
8
8
|
import { View } from "@tarojs/components";
|
|
9
9
|
import { ComponentDefaults } from "../../utils/typings";
|
|
10
|
-
import {
|
|
10
|
+
import { getRectInMultiPlatform } from "../../utils/taro/get-rect";
|
|
11
11
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
12
12
|
list: [],
|
|
13
13
|
interval: 500,
|
|
@@ -62,7 +62,7 @@ var InternalBarrage = function(props, ref) {
|
|
|
62
62
|
];
|
|
63
63
|
return [
|
|
64
64
|
4,
|
|
65
|
-
|
|
65
|
+
getRectInMultiPlatform(node)
|
|
66
66
|
];
|
|
67
67
|
case 1:
|
|
68
68
|
refe = _state.sent();
|
|
@@ -159,7 +159,7 @@ var InternalBarrage = function(props, ref) {
|
|
|
159
159
|
];
|
|
160
160
|
return [
|
|
161
161
|
4,
|
|
162
|
-
|
|
162
|
+
getRectInMultiPlatform(el)
|
|
163
163
|
];
|
|
164
164
|
case 1:
|
|
165
165
|
refe = _state.sent();
|
|
@@ -8,7 +8,7 @@ import { View, Button as TaroButton } from "@tarojs/components";
|
|
|
8
8
|
import { Loading } from "@nutui/icons-react-taro";
|
|
9
9
|
import { getEnv } from "@tarojs/taro";
|
|
10
10
|
import { ComponentDefaults } from "../../utils/typings";
|
|
11
|
-
import { harmony } from "../../utils/platform
|
|
11
|
+
import { harmony } from "../../utils/taro/platform";
|
|
12
12
|
var prefixCls = 'nut-button';
|
|
13
13
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
14
14
|
color: '',
|
|
@@ -8,7 +8,7 @@ import { ComponentDefaults } from "../../utils/typings";
|
|
|
8
8
|
import { CellGroup } from "../cellgroup/cellgroup";
|
|
9
9
|
import CellGroupContext from "../cellgroup/context";
|
|
10
10
|
import { useRtl } from "../configprovider/index";
|
|
11
|
-
import pxTransform from "../../utils/px-transform";
|
|
11
|
+
import { pxTransform } from "../../utils/taro/px-transform";
|
|
12
12
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
13
13
|
title: null,
|
|
14
14
|
description: null,
|
|
@@ -4,7 +4,7 @@ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
|
4
4
|
import React, { useContext, useEffect, useState } from "react";
|
|
5
5
|
import classNames from "classnames";
|
|
6
6
|
import { View } from "@tarojs/components";
|
|
7
|
-
import pxTransform from "../../utils/px-transform";
|
|
7
|
+
import { pxTransform } from "../../utils/taro/px-transform";
|
|
8
8
|
import { DataContext } from "../row/context";
|
|
9
9
|
import { ComponentDefaults } from "../../utils/typings";
|
|
10
10
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
@@ -11,8 +11,8 @@ import classNames from "classnames";
|
|
|
11
11
|
import { nextTick } from "@tarojs/taro";
|
|
12
12
|
import { ComponentDefaults } from "../../utils/typings";
|
|
13
13
|
import CollapseContext from "../collapse/context";
|
|
14
|
-
import {
|
|
15
|
-
import useUuid from "../../hooks/use-uuid";
|
|
14
|
+
import { getRectInMultiPlatform } from "../../utils/taro/get-rect";
|
|
15
|
+
import { useUuid } from "../../hooks/use-uuid";
|
|
16
16
|
import { useRefState } from "../../hooks/use-ref-state";
|
|
17
17
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
18
18
|
title: null,
|
|
@@ -69,7 +69,7 @@ export var CollapseItem = function(props) {
|
|
|
69
69
|
case 0:
|
|
70
70
|
return [
|
|
71
71
|
4,
|
|
72
|
-
|
|
72
|
+
getRectInMultiPlatform(contentRef.current, target)
|
|
73
73
|
];
|
|
74
74
|
case 1:
|
|
75
75
|
res = _state.sent();
|
|
@@ -6,7 +6,7 @@ import classNames from "classnames";
|
|
|
6
6
|
import kebabCase from "lodash.kebabcase";
|
|
7
7
|
import isEqual from "react-fast-compare";
|
|
8
8
|
import { View } from "@tarojs/components";
|
|
9
|
-
import useMemo from "../../hooks/use-memo";
|
|
9
|
+
import { useMemo } from "../../hooks/use-memo";
|
|
10
10
|
import zhCN from "../../locales/zh-CN";
|
|
11
11
|
var classPrefix = 'nut-configprovider';
|
|
12
12
|
export var defaultConfigRef = {
|
|
@@ -8,7 +8,7 @@ import classNames from "classnames";
|
|
|
8
8
|
import { View } from "@tarojs/components";
|
|
9
9
|
import { ComponentDefaults } from "../../utils/typings";
|
|
10
10
|
import { padZero } from "../../utils/pad-zero";
|
|
11
|
-
import { web } from "../../utils/platform
|
|
11
|
+
import { web } from "../../utils/taro/platform";
|
|
12
12
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
13
13
|
type: 'default',
|
|
14
14
|
paused: false,
|
|
@@ -14,10 +14,10 @@ import { Content, defaultContentProps } from "./content";
|
|
|
14
14
|
import { useConfig } from "../configprovider/configprovider";
|
|
15
15
|
import Overlay from "../overlay/index";
|
|
16
16
|
import { defaultOverlayProps } from "../overlay/overlay";
|
|
17
|
-
import { customEvents, useCustomEvent, useCustomEventsPath, useParams } from "../../hooks/use-custom-event";
|
|
18
|
-
import { useLockScrollTaro } from "../../hooks/use-lock-scoll
|
|
17
|
+
import { customEvents, useCustomEvent, useCustomEventsPath, useParams } from "../../hooks/taro/use-custom-event";
|
|
18
|
+
import { useLockScrollTaro } from "../../hooks/taro/use-lock-scoll";
|
|
19
19
|
import { mergeProps } from "../../utils/merge-props";
|
|
20
|
-
import { harmony } from "../../utils/platform
|
|
20
|
+
import { harmony } from "../../utils/taro/platform";
|
|
21
21
|
var defaultProps = _object_spread_props(_object_spread({}, defaultOverlayProps, defaultContentProps), {
|
|
22
22
|
title: '',
|
|
23
23
|
content: '',
|
|
@@ -6,9 +6,9 @@ import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
|
6
6
|
import React, { useState, useEffect, useRef } from "react";
|
|
7
7
|
import { View } from "@tarojs/components";
|
|
8
8
|
import { ComponentDefaults } from "../../utils/typings";
|
|
9
|
-
import {
|
|
10
|
-
import { getWindowInfo } from "../../utils/get-system-info";
|
|
11
|
-
import { web } from "../../utils/platform
|
|
9
|
+
import { getRectInMultiPlatform } from "../../utils/taro/get-rect";
|
|
10
|
+
import { getWindowInfo } from "../../utils/taro/get-system-info";
|
|
11
|
+
import { web } from "../../utils/taro/platform";
|
|
12
12
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
13
13
|
attract: false,
|
|
14
14
|
direction: undefined,
|
|
@@ -54,7 +54,7 @@ export var Drag = function(props) {
|
|
|
54
54
|
_getWindowInfo = getWindowInfo(), screenWidth = _getWindowInfo.screenWidth, windowHeight = _getWindowInfo.windowHeight;
|
|
55
55
|
return [
|
|
56
56
|
4,
|
|
57
|
-
|
|
57
|
+
getRectInMultiPlatform(dragRef.current)
|
|
58
58
|
];
|
|
59
59
|
case 1:
|
|
60
60
|
_ref = _state.sent(), width = _ref.width, height = _ref.height, dragTop = _ref.top, dragLeft = _ref.left;
|
|
@@ -9,8 +9,8 @@ import Taro, { nextTick, createSelectorQuery } from "@tarojs/taro";
|
|
|
9
9
|
import { ScrollView, View, Text } from "@tarojs/components";
|
|
10
10
|
import classNames from "classnames";
|
|
11
11
|
import { ComponentDefaults } from "../../utils/typings";
|
|
12
|
-
import { harmony } from "../../utils/platform
|
|
13
|
-
import useUuid from "../../hooks/use-uuid";
|
|
12
|
+
import { harmony } from "../../utils/taro/platform";
|
|
13
|
+
import { useUuid } from "../../hooks/use-uuid";
|
|
14
14
|
export var elevatorContext = /*#__PURE__*/ createContext({});
|
|
15
15
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
16
16
|
height: '200px',
|
|
@@ -9,7 +9,7 @@ import React, { useState, useRef, useEffect } from "react";
|
|
|
9
9
|
import { nextTick, createSelectorQuery } from "@tarojs/taro";
|
|
10
10
|
import classNames from "classnames";
|
|
11
11
|
import { View } from "@tarojs/components";
|
|
12
|
-
import {
|
|
12
|
+
import { getRectInMultiPlatform } from "../../utils/taro/get-rect";
|
|
13
13
|
import { ComponentDefaults } from "../../utils/typings";
|
|
14
14
|
import { useRtl } from "../configprovider/index";
|
|
15
15
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
@@ -98,7 +98,7 @@ export var Ellipsis = function(props) {
|
|
|
98
98
|
case 0:
|
|
99
99
|
return [
|
|
100
100
|
4,
|
|
101
|
-
|
|
101
|
+
getRectInMultiPlatform(symbolContain === null || symbolContain === void 0 ? void 0 : symbolContain.current)
|
|
102
102
|
];
|
|
103
103
|
case 1:
|
|
104
104
|
refe = _state.sent();
|
|
@@ -171,7 +171,7 @@ export var Ellipsis = function(props) {
|
|
|
171
171
|
case 0:
|
|
172
172
|
return [
|
|
173
173
|
4,
|
|
174
|
-
|
|
174
|
+
getRectInMultiPlatform(rootContain.current)
|
|
175
175
|
];
|
|
176
176
|
case 1:
|
|
177
177
|
refe = _state.sent();
|
|
@@ -217,7 +217,7 @@ export var Ellipsis = function(props) {
|
|
|
217
217
|
case 0:
|
|
218
218
|
return [
|
|
219
219
|
4,
|
|
220
|
-
|
|
220
|
+
getRectInMultiPlatform(rootContain.current)
|
|
221
221
|
];
|
|
222
222
|
case 1:
|
|
223
223
|
refe = _state.sent();
|
|
@@ -4,7 +4,7 @@ import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_
|
|
|
4
4
|
import React, { useContext } from "react";
|
|
5
5
|
import classNames from "classnames";
|
|
6
6
|
import { View } from "@tarojs/components";
|
|
7
|
-
import pxTransform from "../../utils/px-transform";
|
|
7
|
+
import { pxTransform } from "../../utils/taro/px-transform";
|
|
8
8
|
import GridContext from "../grid/context";
|
|
9
9
|
var defaultProps = {
|
|
10
10
|
text: '',
|
|
@@ -7,7 +7,7 @@ import { ComponentDefaults } from "../../utils/typings";
|
|
|
7
7
|
import { useRtl } from "../configprovider/index";
|
|
8
8
|
import HoverButtonItem from "../hoverbuttonitem/index";
|
|
9
9
|
import SafeArea from "../safearea/index";
|
|
10
|
-
import pxTransform from "../../utils/px-transform";
|
|
10
|
+
import { pxTransform } from "../../utils/taro/px-transform";
|
|
11
11
|
import { UI_BOTTOM_DISTANCE } from "./utils";
|
|
12
12
|
var defaultProps = _object_spread({}, ComponentDefaults);
|
|
13
13
|
var classPrefix = 'nut-hoverbutton';
|
|
@@ -6,7 +6,7 @@ import React, { useMemo, useState } from "react";
|
|
|
6
6
|
import classNames from "classnames";
|
|
7
7
|
import { View } from "@tarojs/components";
|
|
8
8
|
import { ComponentDefaults } from "../../utils/typings";
|
|
9
|
-
import { harmony } from "../../utils/platform
|
|
9
|
+
import { harmony } from "../../utils/taro/platform";
|
|
10
10
|
import { getIcon } from "./utils";
|
|
11
11
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
12
12
|
icon: null,
|
|
@@ -8,7 +8,7 @@ import Taro from "@tarojs/taro";
|
|
|
8
8
|
import { Image as TImage, View } from "@tarojs/components";
|
|
9
9
|
import { Image as ImageIcon, ImageError } from "@nutui/icons-react-taro";
|
|
10
10
|
import classNames from "classnames";
|
|
11
|
-
import pxTransform from "../../utils/px-transform";
|
|
11
|
+
import { pxTransform } from "../../utils/taro/px-transform";
|
|
12
12
|
var defaultProps = {
|
|
13
13
|
src: '',
|
|
14
14
|
error: true,
|