@nutui/nutui-react 3.0.7 → 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 +30 -14
- package/dist/cjs/hooks/index.d.ts +12 -0
- package/dist/cjs/hooks/index.js +17 -0
- package/dist/cjs/hooks/index.taro.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/avatar/style/style.css +4 -0
- package/dist/cjs/packages/avatarcropper/avatarcropper.js +2 -2
- package/dist/cjs/packages/cascader/cascader.js +2 -1
- package/dist/cjs/packages/configprovider/configprovider.js +4 -4
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/dialog/style/dialog.scss +1 -0
- package/dist/cjs/packages/dialog/style/style.css +1 -0
- package/dist/cjs/packages/image/style/image.scss +4 -1
- package/dist/cjs/packages/image/style/style.css +4 -0
- package/dist/cjs/packages/imagepreview/style/style.css +4 -0
- package/dist/cjs/packages/noticebar/noticebar.js +4 -4
- 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/picker/picker.js +2 -2
- package/dist/cjs/packages/popover/popover.js +2 -2
- package/dist/cjs/packages/range/range.js +3 -3
- package/dist/cjs/packages/rate/rate.js +4 -4
- package/dist/cjs/packages/skeleton/skeleton.js +1 -2
- package/dist/cjs/packages/sticky/sticky.js +9 -9
- package/dist/cjs/packages/swipe/swipe.js +2 -2
- package/dist/cjs/packages/switch/switch.js +53 -8
- package/dist/cjs/packages/tour/tour.js +2 -2
- package/dist/cjs/utils/clamp.d.ts +1 -0
- package/dist/cjs/utils/clamp.js +13 -0
- package/dist/cjs/utils/index.d.ts +28 -6
- package/dist/cjs/utils/index.js +29 -54
- package/dist/cjs/utils/index.taro.js +39 -0
- 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/{es/utils → cjs/utils/taro}/add-color-for-harmony.d.ts +1 -2
- package/dist/cjs/utils/{add-color-for-harmony.js → taro/add-color-for-harmony.js} +5 -11
- package/dist/cjs/utils/taro/get-rect-by-id.d.ts +1 -0
- 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.d.ts → taro/get-rect.d.ts} +1 -1
- package/dist/cjs/utils/{get-rect-by-taro.js → taro/get-rect.js} +9 -10
- package/dist/cjs/utils/taro/px-transform.d.ts +1 -0
- 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 +12 -0
- package/dist/es/hooks/index.taro.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/avatar/style/style.css +4 -0
- package/dist/es/packages/avatarcropper/avatarcropper.js +1 -1
- package/dist/es/packages/cascader/cascader.js +2 -1
- package/dist/es/packages/configprovider/configprovider.js +2 -2
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/dialog/style/dialog.scss +1 -0
- package/dist/es/packages/dialog/style/style.css +1 -0
- package/dist/es/packages/image/style/image.scss +4 -1
- package/dist/es/packages/image/style/style.css +4 -0
- package/dist/es/packages/imagepreview/style/style.css +4 -0
- package/dist/es/packages/noticebar/noticebar.js +1 -1
- 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/picker/picker.js +1 -1
- package/dist/es/packages/popover/popover.js +1 -1
- package/dist/es/packages/range/range.js +1 -1
- package/dist/es/packages/rate/rate.js +2 -2
- package/dist/es/packages/skeleton/skeleton.js +1 -2
- package/dist/es/packages/sticky/sticky.js +2 -2
- package/dist/es/packages/swipe/swipe.js +1 -1
- package/dist/es/packages/switch/switch.js +53 -8
- package/dist/es/packages/tour/tour.js +1 -1
- package/dist/es/utils/clamp.d.ts +1 -0
- package/dist/es/utils/clamp.js +3 -0
- package/dist/es/utils/index.d.ts +28 -6
- package/dist/es/utils/index.js +28 -29
- package/dist/es/utils/index.taro.js +34 -0
- 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/{cjs/utils → es/utils/taro}/add-color-for-harmony.d.ts +1 -2
- package/dist/es/utils/{add-color-for-harmony.js → taro/add-color-for-harmony.js} +2 -3
- package/dist/es/utils/taro/get-rect-by-id.d.ts +1 -0
- 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.d.ts → taro/get-rect.d.ts} +1 -1
- package/dist/es/utils/{get-rect-by-taro.js → taro/get-rect.js} +4 -4
- package/dist/es/utils/taro/px-transform.d.ts +1 -0
- 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 +1014 -735
- package/dist/style.css +1 -1
- package/dist/style.scss +39 -39
- package/dist/styles/themes/dark.css +1 -1
- package/dist/styles/themes/default.css +1 -1
- package/dist/styles/themes/jmapp.css +1 -1
- package/dist/styles/themes/jrkf.css +1 -1
- package/dist/styles/variables-jmapp.scss +1 -0
- package/dist/styles/variables.scss +4 -0
- package/package.json +1 -1
- package/dist/cjs/hooks/use-taro-rect.d.ts +0 -1
- package/dist/cjs/utils/px-transform.d.ts +0 -1
- package/dist/es/hooks/use-taro-rect.d.ts +0 -1
- package/dist/es/utils/px-transform.d.ts +0 -1
- /package/dist/cjs/hooks/{use-custom-event.d.ts → taro/use-custom-event.d.ts} +0 -0
- /package/dist/cjs/hooks/{use-lock-scoll-taro.d.ts → taro/use-lock-scoll.d.ts} +0 -0
- /package/dist/cjs/utils/{test/event.d.ts → event-mocker.d.ts} +0 -0
- /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.d.ts → taro/get-system-info.d.ts} +0 -0
- /package/dist/cjs/utils/{get-system-info.js → taro/get-system-info.js} +0 -0
- /package/dist/cjs/utils/{platform-taro.d.ts → taro/platform.d.ts} +0 -0
- /package/dist/cjs/utils/{platform-taro.js → taro/platform.js} +0 -0
- /package/dist/es/hooks/{use-custom-event.d.ts → taro/use-custom-event.d.ts} +0 -0
- /package/dist/es/hooks/{use-lock-scoll-taro.d.ts → taro/use-lock-scoll.d.ts} +0 -0
- /package/dist/es/utils/{test/event.d.ts → event-mocker.d.ts} +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.d.ts → taro/get-system-info.d.ts} +0 -0
- /package/dist/es/utils/{get-system-info.js → taro/get-system-info.js} +0 -0
- /package/dist/es/utils/{platform-taro.d.ts → taro/platform.d.ts} +0 -0
- /package/dist/es/utils/{platform-taro.js → taro/platform.js} +0 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
1
2
|
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
2
3
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
3
4
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
4
5
|
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
5
6
|
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
7
|
+
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
6
8
|
import React, { useEffect, useState } from "react";
|
|
7
9
|
import classNames from "classnames";
|
|
8
10
|
import { Loading1 } from "@nutui/icons-react";
|
|
@@ -47,14 +49,57 @@ export var Switch = function(props) {
|
|
|
47
49
|
(_obj = {}, _define_property(_obj, "".concat(classPrefix, "-close"), !value), _define_property(_obj, "".concat(classPrefix, "-disabled"), disabled), _define_property(_obj, "".concat(classPrefix, "-disabled-close"), disabled && !value), _obj)
|
|
48
50
|
]);
|
|
49
51
|
};
|
|
50
|
-
var onClick = function() {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
var onClick = /*#__PURE__*/ function() {
|
|
53
|
+
var _ref = _async_to_generator(function() {
|
|
54
|
+
var e;
|
|
55
|
+
return _ts_generator(this, function(_state) {
|
|
56
|
+
switch(_state.label){
|
|
57
|
+
case 0:
|
|
58
|
+
if (disabled || changing) return [
|
|
59
|
+
2
|
|
60
|
+
];
|
|
61
|
+
if (!onChange) return [
|
|
62
|
+
3,
|
|
63
|
+
4
|
|
64
|
+
];
|
|
65
|
+
setChanging(true);
|
|
66
|
+
_state.label = 1;
|
|
67
|
+
case 1:
|
|
68
|
+
_state.trys.push([
|
|
69
|
+
1,
|
|
70
|
+
3,
|
|
71
|
+
,
|
|
72
|
+
4
|
|
73
|
+
]);
|
|
74
|
+
return [
|
|
75
|
+
4,
|
|
76
|
+
onChange(!value)
|
|
77
|
+
];
|
|
78
|
+
case 2:
|
|
79
|
+
_state.sent();
|
|
80
|
+
return [
|
|
81
|
+
3,
|
|
82
|
+
4
|
|
83
|
+
];
|
|
84
|
+
case 3:
|
|
85
|
+
e = _state.sent();
|
|
86
|
+
setChanging(false);
|
|
87
|
+
return [
|
|
88
|
+
3,
|
|
89
|
+
4
|
|
90
|
+
];
|
|
91
|
+
case 4:
|
|
92
|
+
setValue(!value);
|
|
93
|
+
return [
|
|
94
|
+
2
|
|
95
|
+
];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
return function onClick() {
|
|
100
|
+
return _ref.apply(this, arguments);
|
|
101
|
+
};
|
|
102
|
+
}();
|
|
58
103
|
var _obj, _obj1;
|
|
59
104
|
return /*#__PURE__*/ React.createElement("div", _object_spread({
|
|
60
105
|
className: classes(),
|
|
@@ -6,7 +6,7 @@ import React, { useEffect, useState } from "react";
|
|
|
6
6
|
import { Close } from "@nutui/icons-react";
|
|
7
7
|
import classNames from "classnames";
|
|
8
8
|
import Popover from "../popover";
|
|
9
|
-
import { getRect } from "../../
|
|
9
|
+
import { getRect } from "../../utils/get-rect";
|
|
10
10
|
import { ComponentDefaults } from "../../utils/typings";
|
|
11
11
|
import { useConfig } from "../configprovider";
|
|
12
12
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const clamp: (num: number, min: number, max: number) => number;
|
package/dist/es/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
1
|
+
export * from './bound';
|
|
2
|
+
export * from './camel-case';
|
|
3
|
+
export * from './can-use-dom';
|
|
4
|
+
export * from './clamp';
|
|
5
|
+
export * from './date';
|
|
6
|
+
export * from './get-rect';
|
|
7
|
+
export * from './get-scroll-parent';
|
|
8
|
+
export * from './interceptor';
|
|
9
|
+
export * from './is-date';
|
|
10
|
+
export * from './is-empty';
|
|
11
|
+
export * from './is-forward-ref-component';
|
|
12
|
+
export * from './is-function';
|
|
13
|
+
export * from './is-object';
|
|
14
|
+
export * from './is-promise';
|
|
15
|
+
export * from './lru';
|
|
16
|
+
export * from './merge';
|
|
17
|
+
export * from './merge-props';
|
|
18
|
+
export * from './pad-zero';
|
|
19
|
+
export * from './prevent-default';
|
|
20
|
+
export * from './px-check';
|
|
21
|
+
export * from './raf';
|
|
22
|
+
export * from './render';
|
|
23
|
+
export * from './rubberband';
|
|
24
|
+
export * from './sleep';
|
|
25
|
+
export * from './supports-passive';
|
|
26
|
+
export * from './to-array';
|
|
27
|
+
export * from './typings';
|
|
28
|
+
export * from './upper-case-first';
|
package/dist/es/utils/index.js
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
1
|
+
export * from "./bound";
|
|
2
|
+
export * from "./camel-case";
|
|
3
|
+
export * from "./can-use-dom";
|
|
4
|
+
export * from "./clamp";
|
|
5
|
+
export * from "./date";
|
|
6
|
+
export * from "./get-rect";
|
|
7
|
+
export * from "./get-scroll-parent";
|
|
8
|
+
export * from "./interceptor";
|
|
9
|
+
export * from "./is-date";
|
|
10
|
+
export * from "./is-empty";
|
|
11
|
+
export * from "./is-forward-ref-component";
|
|
12
|
+
export * from "./is-function";
|
|
13
|
+
export * from "./is-object";
|
|
14
|
+
export * from "./is-promise";
|
|
15
|
+
export * from "./lru";
|
|
16
|
+
export * from "./merge";
|
|
17
|
+
export * from "./merge-props";
|
|
18
|
+
export * from "./pad-zero";
|
|
19
|
+
export * from "./prevent-default";
|
|
20
|
+
export * from "./px-check";
|
|
21
|
+
export * from "./raf";
|
|
22
|
+
export * from "./render";
|
|
23
|
+
export * from "./rubberband";
|
|
24
|
+
export * from "./sleep";
|
|
25
|
+
export * from "./supports-passive";
|
|
26
|
+
export * from "./to-array";
|
|
27
|
+
export * from "./typings";
|
|
28
|
+
export * from "./upper-case-first";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export * from "./taro/add-color-for-harmony";
|
|
2
|
+
export * from "./bound";
|
|
3
|
+
export * from "./camel-case";
|
|
4
|
+
export * from "./can-use-dom";
|
|
5
|
+
export * from "./clamp";
|
|
6
|
+
export * from "./date";
|
|
7
|
+
export * from "./taro/get-rect";
|
|
8
|
+
export * from "./taro/get-rect-by-id";
|
|
9
|
+
export * from "./get-rect";
|
|
10
|
+
export * from "./get-scroll-parent";
|
|
11
|
+
export * from "./taro/get-system-info";
|
|
12
|
+
export * from "./interceptor";
|
|
13
|
+
export * from "./is-date";
|
|
14
|
+
export * from "./is-empty";
|
|
15
|
+
export * from "./is-forward-ref-component";
|
|
16
|
+
export * from "./is-function";
|
|
17
|
+
export * from "./is-object";
|
|
18
|
+
export * from "./is-promise";
|
|
19
|
+
export * from "./lru";
|
|
20
|
+
export * from "./merge";
|
|
21
|
+
export * from "./merge-props";
|
|
22
|
+
export * from "./pad-zero";
|
|
23
|
+
export * from "./taro/platform";
|
|
24
|
+
export * from "./prevent-default";
|
|
25
|
+
export * from "./px-check";
|
|
26
|
+
export * from "./taro/px-transform";
|
|
27
|
+
export * from "./raf";
|
|
28
|
+
export * from "./render";
|
|
29
|
+
export * from "./rubberband";
|
|
30
|
+
export * from "./sleep";
|
|
31
|
+
export * from "./supports-passive";
|
|
32
|
+
export * from "./to-array";
|
|
33
|
+
export * from "./typings";
|
|
34
|
+
export * from "./upper-case-first";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isPromise } from "./
|
|
1
|
+
import { isPromise } from "./is-promise";
|
|
2
2
|
export var funcInterceptor = function(interceptor, param) {
|
|
3
3
|
var _param_args = param.args, args = _param_args === void 0 ? [] : _param_args, done = param.done, canceled = param.canceled;
|
|
4
4
|
if (interceptor) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isFunction: (val: unknown) => val is Function;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isObject: (val: unknown) => val is Record<any, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
|
package/dist/es/utils/lru.d.ts
CHANGED
package/dist/es/utils/lru.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
|
|
2
2
|
import { _ as _create_class } from "@swc/helpers/_/_create_class";
|
|
3
3
|
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
4
|
-
var MiniLru = /*#__PURE__*/ function() {
|
|
4
|
+
export var MiniLru = /*#__PURE__*/ function() {
|
|
5
5
|
"use strict";
|
|
6
6
|
function MiniLru(capacity) {
|
|
7
7
|
_class_call_check(this, MiniLru);
|
|
@@ -46,4 +46,3 @@ var MiniLru = /*#__PURE__*/ function() {
|
|
|
46
46
|
]);
|
|
47
47
|
return MiniLru;
|
|
48
48
|
}();
|
|
49
|
-
export { MiniLru as default };
|
package/dist/es/utils/merge.d.ts
CHANGED
package/dist/es/utils/merge.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
2
2
|
import { _ as _type_of } from "@swc/helpers/_/_type_of";
|
|
3
|
-
export default main;
|
|
4
3
|
export function main() {
|
|
5
4
|
for(var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++){
|
|
6
5
|
items[_key] = arguments[_key];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function preventDefault(event: React.TouchEvent<HTMLElement> | TouchEvent, isStopPropagation?: boolean): void;
|
package/dist/es/utils/raf.d.ts
CHANGED
package/dist/es/utils/raf.js
CHANGED
|
@@ -5,5 +5,4 @@ import React, { ReactNode } from 'react';
|
|
|
5
5
|
* @param color - 要添加的颜色值(如:'#ff0000')
|
|
6
6
|
* @returns 处理后的 React 节点
|
|
7
7
|
*/
|
|
8
|
-
declare function addColorForHarmony(maybeElement: ReactNode, color?: string): string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined;
|
|
9
|
-
export default addColorForHarmony;
|
|
8
|
+
export declare function addColorForHarmony(maybeElement: ReactNode, color?: string): string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { harmony } from "./platform
|
|
2
|
+
import { harmony } from "./platform";
|
|
3
3
|
/**
|
|
4
4
|
* 为支持 Harmony 的 React 元素添加颜色属性
|
|
5
5
|
* @param maybeElement - 要处理的 React 节点
|
|
6
6
|
* @param color - 要添加的颜色值(如:'#ff0000')
|
|
7
7
|
* @returns 处理后的 React 节点
|
|
8
|
-
*/ function addColorForHarmony(maybeElement, color) {
|
|
8
|
+
*/ export function addColorForHarmony(maybeElement, color) {
|
|
9
9
|
if (React.isValidElement(maybeElement) && harmony()) {
|
|
10
10
|
return React.cloneElement(maybeElement, {
|
|
11
11
|
color: color
|
|
@@ -13,4 +13,3 @@ import { harmony } from "./platform-taro";
|
|
|
13
13
|
}
|
|
14
14
|
return maybeElement;
|
|
15
15
|
}
|
|
16
|
-
export default addColorForHarmony;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getRectById: (id: string) => Promise<unknown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Taro, { createSelectorQuery } from "@tarojs/taro";
|
|
2
|
-
export var
|
|
2
|
+
export var getRectById = function(id) {
|
|
3
3
|
return new Promise(function(resolve, reject) {
|
|
4
4
|
if (Taro.getEnv() === Taro.ENV_TYPE.WEB) {
|
|
5
5
|
var t = document ? document.querySelector("#".concat(id)) : '';
|
|
@@ -9,4 +9,4 @@ export interface Rect {
|
|
|
9
9
|
height: number;
|
|
10
10
|
}
|
|
11
11
|
export declare function makeRect(width: number, height: number): Rect;
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const getRectInMultiPlatform: (element: any, harmonyId?: string) => Promise<Rect>;
|
|
@@ -2,8 +2,8 @@ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
|
2
2
|
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
3
3
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
4
4
|
import { createSelectorQuery } from "@tarojs/taro";
|
|
5
|
-
import MiniLru from "
|
|
6
|
-
import { getRect, inBrowser } from "../
|
|
5
|
+
import { MiniLru } from "../lru";
|
|
6
|
+
import { getRect, inBrowser } from "../get-rect";
|
|
7
7
|
var lru = new MiniLru(10);
|
|
8
8
|
export function makeRect(width, height) {
|
|
9
9
|
return {
|
|
@@ -15,7 +15,7 @@ export function makeRect(width, height) {
|
|
|
15
15
|
height: height
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
export var
|
|
18
|
+
export var getRectInMultiPlatform = /*#__PURE__*/ function() {
|
|
19
19
|
var _ref = _async_to_generator(function(element) {
|
|
20
20
|
var harmonyId;
|
|
21
21
|
var _arguments = arguments;
|
|
@@ -52,7 +52,7 @@ export var getRectByTaro = /*#__PURE__*/ function() {
|
|
|
52
52
|
];
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
|
-
return function
|
|
55
|
+
return function getRectInMultiPlatform(element) {
|
|
56
56
|
return _ref.apply(this, arguments);
|
|
57
57
|
};
|
|
58
58
|
}();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function pxTransform(value: number, radix?: number): any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pxTransform as transform } from "@tarojs/taro";
|
|
2
|
-
import { harmony } from "./platform
|
|
3
|
-
export
|
|
2
|
+
import { harmony } from "./platform";
|
|
3
|
+
export function pxTransform(value, radix) {
|
|
4
4
|
// @ts-ignore
|
|
5
5
|
if (harmony()) return transform(value, radix || 375);
|
|
6
6
|
return "".concat(value, "px");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const upperCaseFirst: (str: string) => string;
|