@nutui/nutui-react-taro 3.0.19-cpp.11 → 3.0.19-cpp.12
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/cjs/packages/noticebar/noticebar.js +40 -30
- package/dist/cjs/packages/toast/toast.js +4 -2
- package/dist/es/packages/noticebar/noticebar.js +40 -30
- package/dist/es/packages/toast/toast.js +5 -3
- package/dist/nutui.react.umd.js +43 -28
- package/dist/style-jmapp.css +1 -1
- package/dist/style-jmapp.scss +33 -33
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +24 -24
- package/dist/style.css +1 -1
- package/dist/style.scss +25 -25
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@ var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
|
|
|
18
18
|
var _to_consumable_array = require("@swc/helpers/_/_to_consumable_array");
|
|
19
19
|
var _ts_generator = require("@swc/helpers/_/_ts_generator");
|
|
20
20
|
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
21
|
+
var _taro = require("@tarojs/taro");
|
|
21
22
|
var _components = require("@tarojs/components");
|
|
22
23
|
var _iconsreacttaro = require("@nutui/icons-react-taro");
|
|
23
24
|
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
|
|
@@ -137,42 +138,51 @@ var NoticeBar = function NoticeBar(props) {
|
|
|
137
138
|
if (showNoticeBar === false) {
|
|
138
139
|
return;
|
|
139
140
|
}
|
|
140
|
-
|
|
141
|
+
(0, _taro.nextTick)(function() {
|
|
141
142
|
return (0, _async_to_generator._)(function() {
|
|
142
143
|
var warpRes, contentRes, wrapW, offsetW, canScroll;
|
|
143
144
|
return (0, _ts_generator._)(this, function(_state) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
145
|
+
switch(_state.label){
|
|
146
|
+
case 0:
|
|
147
|
+
if (!wrapRef.current || !contentRef.current) {
|
|
148
|
+
return [
|
|
149
|
+
2
|
|
150
|
+
];
|
|
151
|
+
}
|
|
152
|
+
return [
|
|
153
|
+
4,
|
|
154
|
+
(0, _getrect.getRectInMultiPlatform)(wrapRef.current, wrapRefId)
|
|
155
|
+
];
|
|
156
|
+
case 1:
|
|
157
|
+
warpRes = _state.sent();
|
|
158
|
+
return [
|
|
159
|
+
4,
|
|
160
|
+
(0, _getrect.getRectInMultiPlatform)(contentRef.current, contentRefId)
|
|
161
|
+
];
|
|
162
|
+
case 2:
|
|
163
|
+
contentRes = _state.sent();
|
|
164
|
+
if (!warpRes || !contentRes) return [
|
|
165
|
+
2
|
|
166
|
+
];
|
|
167
|
+
wrapW = warpRes.width;
|
|
168
|
+
offsetW = contentRes.width;
|
|
169
|
+
canScroll = align === 'left' && scrollable == null ? offsetW > wrapW : scrollable;
|
|
170
|
+
SetIsCanScroll(canScroll);
|
|
171
|
+
if (canScroll) {
|
|
172
|
+
SetWrapWidth(wrapW);
|
|
173
|
+
SetOffsetW(offsetW);
|
|
174
|
+
SetAnimationDuration(offsetW / speed);
|
|
175
|
+
SetAnimationClass('play');
|
|
176
|
+
} else {
|
|
177
|
+
SetAnimationClass('');
|
|
178
|
+
}
|
|
179
|
+
return [
|
|
180
|
+
2
|
|
181
|
+
];
|
|
169
182
|
}
|
|
170
|
-
return [
|
|
171
|
-
2
|
|
172
|
-
];
|
|
173
183
|
});
|
|
174
184
|
})();
|
|
175
|
-
}
|
|
185
|
+
});
|
|
176
186
|
};
|
|
177
187
|
var handleClick = function handleClick(event) {
|
|
178
188
|
click && click(event);
|
|
@@ -158,9 +158,11 @@ var Toast = function Toast(props) {
|
|
|
158
158
|
style: (0, _object_spread._)({}, styles, contentStyle)
|
|
159
159
|
}, renderIcon(), title && /*#__PURE__*/ _react.default.createElement(_components.Text, {
|
|
160
160
|
className: "".concat(classPrefix, "-title")
|
|
161
|
-
}, title), content && /*#__PURE__*/ _react.default.createElement(_components.Text, {
|
|
161
|
+
}, title), content && ((0, _platform.td)() ? /*#__PURE__*/ _react.default.createElement(_components.Text, {
|
|
162
162
|
className: "".concat(classPrefix, "-text")
|
|
163
|
-
}, content)
|
|
163
|
+
}, content) : /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
164
|
+
className: "".concat(classPrefix, "-text")
|
|
165
|
+
}, content))))));
|
|
164
166
|
};
|
|
165
167
|
function show(selector, options) {
|
|
166
168
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -6,6 +6,7 @@ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
|
6
6
|
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
7
7
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
8
8
|
import React, { useEffect, useMemo, useRef, useState, useCallback } from "react";
|
|
9
|
+
import { nextTick } from "@tarojs/taro";
|
|
9
10
|
import { View } from "@tarojs/components";
|
|
10
11
|
import { Close, Notice } from "@nutui/icons-react-taro";
|
|
11
12
|
import classNames from "classnames";
|
|
@@ -125,42 +126,51 @@ export var NoticeBar = function(props) {
|
|
|
125
126
|
if (showNoticeBar === false) {
|
|
126
127
|
return;
|
|
127
128
|
}
|
|
128
|
-
|
|
129
|
+
nextTick(function() {
|
|
129
130
|
return _async_to_generator(function() {
|
|
130
131
|
var warpRes, contentRes, wrapW, offsetW, canScroll;
|
|
131
132
|
return _ts_generator(this, function(_state) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
133
|
+
switch(_state.label){
|
|
134
|
+
case 0:
|
|
135
|
+
if (!wrapRef.current || !contentRef.current) {
|
|
136
|
+
return [
|
|
137
|
+
2
|
|
138
|
+
];
|
|
139
|
+
}
|
|
140
|
+
return [
|
|
141
|
+
4,
|
|
142
|
+
getRectInMultiPlatform(wrapRef.current, wrapRefId)
|
|
143
|
+
];
|
|
144
|
+
case 1:
|
|
145
|
+
warpRes = _state.sent();
|
|
146
|
+
return [
|
|
147
|
+
4,
|
|
148
|
+
getRectInMultiPlatform(contentRef.current, contentRefId)
|
|
149
|
+
];
|
|
150
|
+
case 2:
|
|
151
|
+
contentRes = _state.sent();
|
|
152
|
+
if (!warpRes || !contentRes) return [
|
|
153
|
+
2
|
|
154
|
+
];
|
|
155
|
+
wrapW = warpRes.width;
|
|
156
|
+
offsetW = contentRes.width;
|
|
157
|
+
canScroll = align === 'left' && scrollable == null ? offsetW > wrapW : scrollable;
|
|
158
|
+
SetIsCanScroll(canScroll);
|
|
159
|
+
if (canScroll) {
|
|
160
|
+
SetWrapWidth(wrapW);
|
|
161
|
+
SetOffsetW(offsetW);
|
|
162
|
+
SetAnimationDuration(offsetW / speed);
|
|
163
|
+
SetAnimationClass('play');
|
|
164
|
+
} else {
|
|
165
|
+
SetAnimationClass('');
|
|
166
|
+
}
|
|
167
|
+
return [
|
|
168
|
+
2
|
|
169
|
+
];
|
|
157
170
|
}
|
|
158
|
-
return [
|
|
159
|
-
2
|
|
160
|
-
];
|
|
161
171
|
});
|
|
162
172
|
})();
|
|
163
|
-
}
|
|
173
|
+
});
|
|
164
174
|
};
|
|
165
175
|
var handleClick = function(event) {
|
|
166
176
|
click && click(event);
|
|
@@ -11,7 +11,7 @@ import { defaultOverlayProps } from "../overlay/overlay";
|
|
|
11
11
|
import { customEvents, useCustomEvent, useCustomEventsPath, useParams } from "../../hooks/taro/use-custom-event";
|
|
12
12
|
import { usePropsValue } from "../../hooks/use-props-value";
|
|
13
13
|
import { useRtl } from "../configprovider/index";
|
|
14
|
-
import { harmony } from "../../utils/taro/platform";
|
|
14
|
+
import { harmony, td } from "../../utils/taro/platform";
|
|
15
15
|
import { mergeProps } from "../../utils/merge-props";
|
|
16
16
|
var defaultProps = _object_spread_props(_object_spread({}, defaultOverlayProps), {
|
|
17
17
|
id: '',
|
|
@@ -135,9 +135,11 @@ export var Toast = function(props) {
|
|
|
135
135
|
style: _object_spread({}, styles, contentStyle)
|
|
136
136
|
}, renderIcon(), title && /*#__PURE__*/ React.createElement(Text, {
|
|
137
137
|
className: "".concat(classPrefix, "-title")
|
|
138
|
-
}, title), content && /*#__PURE__*/ React.createElement(Text, {
|
|
138
|
+
}, title), content && (td() ? /*#__PURE__*/ React.createElement(Text, {
|
|
139
139
|
className: "".concat(classPrefix, "-text")
|
|
140
|
-
}, content)
|
|
140
|
+
}, content) : /*#__PURE__*/ React.createElement(View, {
|
|
141
|
+
className: "".concat(classPrefix, "-text")
|
|
142
|
+
}, content))))));
|
|
141
143
|
};
|
|
142
144
|
export function show(selector, options) {
|
|
143
145
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
package/dist/nutui.react.umd.js
CHANGED
|
@@ -15888,38 +15888,51 @@
|
|
|
15888
15888
|
if (showNoticeBar === false) {
|
|
15889
15889
|
return;
|
|
15890
15890
|
}
|
|
15891
|
-
|
|
15891
|
+
Taro.nextTick(function() {
|
|
15892
15892
|
return _async_to_generator(function() {
|
|
15893
15893
|
var warpRes, contentRes, wrapW, offsetW, canScroll;
|
|
15894
15894
|
return __generator(this, function(_state) {
|
|
15895
|
-
|
|
15896
|
-
|
|
15897
|
-
|
|
15898
|
-
|
|
15899
|
-
|
|
15900
|
-
|
|
15901
|
-
|
|
15902
|
-
|
|
15903
|
-
|
|
15904
|
-
|
|
15905
|
-
|
|
15906
|
-
|
|
15907
|
-
|
|
15908
|
-
|
|
15909
|
-
|
|
15910
|
-
|
|
15911
|
-
|
|
15912
|
-
|
|
15913
|
-
|
|
15914
|
-
|
|
15915
|
-
|
|
15895
|
+
switch (_state.label) {
|
|
15896
|
+
case 0:
|
|
15897
|
+
if (!wrapRef.current || !contentRef.current) {
|
|
15898
|
+
return [
|
|
15899
|
+
2
|
|
15900
|
+
];
|
|
15901
|
+
}
|
|
15902
|
+
return [
|
|
15903
|
+
4,
|
|
15904
|
+
getRectInMultiPlatform(wrapRef.current, wrapRefId)
|
|
15905
|
+
];
|
|
15906
|
+
case 1:
|
|
15907
|
+
warpRes = _state.sent();
|
|
15908
|
+
return [
|
|
15909
|
+
4,
|
|
15910
|
+
getRectInMultiPlatform(contentRef.current, contentRefId)
|
|
15911
|
+
];
|
|
15912
|
+
case 2:
|
|
15913
|
+
contentRes = _state.sent();
|
|
15914
|
+
if (!warpRes || !contentRes) return [
|
|
15915
|
+
2
|
|
15916
|
+
];
|
|
15917
|
+
wrapW = warpRes.width;
|
|
15918
|
+
offsetW = contentRes.width;
|
|
15919
|
+
canScroll = align === "left" && scrollable == null ? offsetW > wrapW : scrollable;
|
|
15920
|
+
SetIsCanScroll(canScroll);
|
|
15921
|
+
if (canScroll) {
|
|
15922
|
+
SetWrapWidth(wrapW);
|
|
15923
|
+
SetOffsetW(offsetW);
|
|
15924
|
+
SetAnimationDuration(offsetW / speed);
|
|
15925
|
+
SetAnimationClass("play");
|
|
15926
|
+
} else {
|
|
15927
|
+
SetAnimationClass("");
|
|
15928
|
+
}
|
|
15929
|
+
return [
|
|
15930
|
+
2
|
|
15931
|
+
];
|
|
15916
15932
|
}
|
|
15917
|
-
return [
|
|
15918
|
-
2
|
|
15919
|
-
];
|
|
15920
15933
|
});
|
|
15921
15934
|
})();
|
|
15922
|
-
}
|
|
15935
|
+
});
|
|
15923
15936
|
};
|
|
15924
15937
|
var handleClick = function(event) {
|
|
15925
15938
|
click && click(event);
|
|
@@ -17357,9 +17370,11 @@
|
|
|
17357
17370
|
style: _object_spread({}, styles, contentStyle)
|
|
17358
17371
|
}, renderIcon(), title && /* @__PURE__ */ React.createElement(components.Text, {
|
|
17359
17372
|
className: "".concat(classPrefix2, "-title")
|
|
17360
|
-
}, title), content2 && /* @__PURE__ */ React.createElement(components.Text, {
|
|
17373
|
+
}, title), content2 && (td() ? /* @__PURE__ */ React.createElement(components.Text, {
|
|
17374
|
+
className: "".concat(classPrefix2, "-text")
|
|
17375
|
+
}, content2) : /* @__PURE__ */ React.createElement(components.View, {
|
|
17361
17376
|
className: "".concat(classPrefix2, "-text")
|
|
17362
|
-
}, content2)))));
|
|
17377
|
+
}, content2))))));
|
|
17363
17378
|
};
|
|
17364
17379
|
function show(selector, options) {
|
|
17365
17380
|
var path = useCustomEventsPath(selector);
|