@nutui/nutui-react 4.0.0-beta.5 → 4.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/packages/animate/style/style.css +27 -9
- package/dist/cjs/packages/animate/style-jmapp/style.css +27 -9
- package/dist/cjs/packages/animate/style-jrkf/style.css +27 -9
- package/dist/cjs/packages/audio/audio.js +8 -8
- package/dist/cjs/packages/badge/badge.js +9 -9
- package/dist/cjs/packages/button/style/style.css +20 -8
- package/dist/cjs/packages/button/style-jmapp/style.css +20 -8
- package/dist/cjs/packages/button/style-jrkf/style.css +20 -8
- package/dist/cjs/packages/cascader/utils.js +3 -2
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/indicator/indicator.js +6 -6
- package/dist/cjs/packages/infiniteloading/infiniteloading.js +9 -9
- package/dist/cjs/packages/navbar/style/style.css +3 -1
- package/dist/cjs/packages/navbar/style-jmapp/style.css +3 -1
- package/dist/cjs/packages/navbar/style-jrkf/style.css +3 -1
- package/dist/cjs/packages/noticebar/noticebar.js +115 -52
- package/dist/cjs/packages/noticebar/style/noticebar.scss +130 -10
- package/dist/cjs/packages/noticebar/style/style.css +138 -35
- package/dist/cjs/packages/noticebar/style-jmapp/noticebar.scss +130 -10
- package/dist/cjs/packages/noticebar/style-jmapp/style.css +113 -10
- package/dist/cjs/packages/noticebar/style-jrkf/noticebar.scss +130 -10
- package/dist/cjs/packages/noticebar/style-jrkf/style.css +113 -10
- package/dist/cjs/packages/notify/Notification.js +8 -8
- package/dist/cjs/packages/numberkeyboard/style/style.css +6 -6
- package/dist/cjs/packages/numberkeyboard/style-jmapp/style.css +6 -6
- package/dist/cjs/packages/numberkeyboard/style-jrkf/style.css +6 -6
- package/dist/cjs/packages/popover/popover.js +46 -37
- package/dist/cjs/packages/popover/style/popover.scss +79 -54
- package/dist/cjs/packages/popover/style/style.css +73 -61
- package/dist/cjs/packages/popover/style-jmapp/popover.scss +79 -54
- package/dist/cjs/packages/popover/style-jmapp/style.css +73 -61
- package/dist/cjs/packages/popover/style-jrkf/popover.scss +79 -54
- package/dist/cjs/packages/popover/style-jrkf/style.css +73 -61
- package/dist/cjs/packages/popup/style/style.css +12 -6
- package/dist/cjs/packages/popup/style-jmapp/style.css +12 -6
- package/dist/cjs/packages/popup/style-jrkf/style.css +12 -6
- package/dist/cjs/packages/pulltorefresh/pulltorefresh.js +35 -35
- package/dist/cjs/packages/skeleton/skeleton.js +15 -15
- package/dist/cjs/packages/swiper/swiper.js +11 -11
- package/dist/cjs/packages/toast/Notification.js +8 -8
- package/dist/cjs/packages/tour/tour.js +1 -1
- package/dist/cjs/types/spec/noticebar/base.d.ts +5 -1
- package/dist/cjs/types/spec/popover/base.d.ts +4 -0
- package/dist/cjs/utils/is-forward-ref-component.js +2 -2
- package/dist/cjs/utils/render.js +1 -1
- package/dist/es/packages/animate/style/style.css +27 -9
- package/dist/es/packages/animate/style-jmapp/style.css +27 -9
- package/dist/es/packages/animate/style-jrkf/style.css +27 -9
- package/dist/es/packages/audio/audio.js +8 -8
- package/dist/es/packages/badge/badge.js +9 -9
- package/dist/es/packages/button/style/style.css +20 -8
- package/dist/es/packages/button/style-jmapp/style.css +20 -8
- package/dist/es/packages/button/style-jrkf/style.css +20 -8
- package/dist/es/packages/cascader/utils.js +3 -2
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/indicator/indicator.js +6 -6
- package/dist/es/packages/infiniteloading/infiniteloading.js +9 -9
- package/dist/es/packages/navbar/style/style.css +3 -1
- package/dist/es/packages/navbar/style-jmapp/style.css +3 -1
- package/dist/es/packages/navbar/style-jrkf/style.css +3 -1
- package/dist/es/packages/noticebar/noticebar.js +117 -55
- package/dist/es/packages/noticebar/style/noticebar.scss +130 -10
- package/dist/es/packages/noticebar/style/style.css +138 -35
- package/dist/es/packages/noticebar/style-jmapp/noticebar.scss +130 -10
- package/dist/es/packages/noticebar/style-jmapp/style.css +113 -10
- package/dist/es/packages/noticebar/style-jrkf/noticebar.scss +130 -10
- package/dist/es/packages/noticebar/style-jrkf/style.css +113 -10
- package/dist/es/packages/notify/Notification.js +8 -8
- package/dist/es/packages/numberkeyboard/style/style.css +6 -6
- package/dist/es/packages/numberkeyboard/style-jmapp/style.css +6 -6
- package/dist/es/packages/numberkeyboard/style-jrkf/style.css +6 -6
- package/dist/es/packages/popover/popover.js +46 -37
- package/dist/es/packages/popover/style/popover.scss +79 -54
- package/dist/es/packages/popover/style/style.css +73 -61
- package/dist/es/packages/popover/style-jmapp/popover.scss +79 -54
- package/dist/es/packages/popover/style-jmapp/style.css +73 -61
- package/dist/es/packages/popover/style-jrkf/popover.scss +79 -54
- package/dist/es/packages/popover/style-jrkf/style.css +73 -61
- package/dist/es/packages/popup/style/style.css +12 -6
- package/dist/es/packages/popup/style-jmapp/style.css +12 -6
- package/dist/es/packages/popup/style-jrkf/style.css +12 -6
- package/dist/es/packages/pulltorefresh/pulltorefresh.js +35 -35
- package/dist/es/packages/skeleton/skeleton.js +15 -15
- package/dist/es/packages/swiper/swiper.js +11 -11
- package/dist/es/packages/toast/Notification.js +8 -8
- package/dist/es/packages/tour/tour.js +1 -1
- package/dist/es/types/spec/noticebar/base.d.ts +19 -3
- package/dist/es/types/spec/popover/base.d.ts +17 -1
- package/dist/es/utils/render.js +1 -1
- package/dist/nutui.react.umd.js +1616 -1256
- 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 +42 -42
- package/dist/style.css +1 -1
- package/dist/style.scss +39 -39
- package/dist/styles/variables-daojia.scss +55 -9
- package/dist/styles/variables-jmapp.scss +52 -6
- package/dist/styles/variables-jrkf.scss +52 -6
- package/dist/styles/variables.scss +123 -15
- package/package.json +1 -1
|
@@ -129,12 +129,6 @@
|
|
|
129
129
|
.nut-popup-top.nut-popup-round {
|
|
130
130
|
border-radius: 0 0 var(--nutui-popup-border-radius, 12px) var(--nutui-popup-border-radius, 12px);
|
|
131
131
|
}
|
|
132
|
-
.nut-popup-slide {
|
|
133
|
-
/* 从顶部滑出 */
|
|
134
|
-
/* 从右侧滑出 */
|
|
135
|
-
/* 从底部滑出 */
|
|
136
|
-
/* 从左侧滑出 */
|
|
137
|
-
}
|
|
138
132
|
@keyframes popup-scale-fade-in {
|
|
139
133
|
from {
|
|
140
134
|
opacity: 0;
|
|
@@ -191,6 +185,9 @@
|
|
|
191
185
|
animation-name: popup-fade-out;
|
|
192
186
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
193
187
|
}
|
|
188
|
+
.nut-popup-slide {
|
|
189
|
+
/* 从顶部滑出 */
|
|
190
|
+
}
|
|
194
191
|
@keyframes popup-slide-top-enter {
|
|
195
192
|
from {
|
|
196
193
|
transform: translate3d(0, -100%, 0);
|
|
@@ -218,6 +215,9 @@
|
|
|
218
215
|
animation-name: popup-slide-top-exit;
|
|
219
216
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
220
217
|
}
|
|
218
|
+
.nut-popup-slide {
|
|
219
|
+
/* 从右侧滑出 */
|
|
220
|
+
}
|
|
221
221
|
@keyframes popup-slide-right-enter {
|
|
222
222
|
from {
|
|
223
223
|
transform: translate3d(100%, 0, 0);
|
|
@@ -245,6 +245,9 @@
|
|
|
245
245
|
animation-name: popup-slide-right-exit;
|
|
246
246
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
247
247
|
}
|
|
248
|
+
.nut-popup-slide {
|
|
249
|
+
/* 从底部滑出 */
|
|
250
|
+
}
|
|
248
251
|
@keyframes popup-slide-bottom-enter {
|
|
249
252
|
from {
|
|
250
253
|
transform: translate3d(0, 100%, 0);
|
|
@@ -272,6 +275,9 @@
|
|
|
272
275
|
animation-name: slide-bottom-exit;
|
|
273
276
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
274
277
|
}
|
|
278
|
+
.nut-popup-slide {
|
|
279
|
+
/* 从左侧滑出 */
|
|
280
|
+
}
|
|
275
281
|
@keyframes popup-slide-left-enter {
|
|
276
282
|
from {
|
|
277
283
|
transform: translate3d(-100%, 0, 0);
|
|
@@ -29,7 +29,37 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
|
29
29
|
onRefresh: function onRefresh() {}
|
|
30
30
|
});
|
|
31
31
|
export var PullToRefresh = function PullToRefresh(p) {
|
|
32
|
-
var
|
|
32
|
+
var classPrefix = 'nut-pulltorefresh';
|
|
33
|
+
var locale = useConfig().locale;
|
|
34
|
+
var props = _object_spread({}, defaultProps, p, {
|
|
35
|
+
pullingText: p.pullingText || locale.pullToRefresh.pullingText,
|
|
36
|
+
canReleaseText: p.canReleaseText || locale.pullToRefresh.canReleaseText,
|
|
37
|
+
refreshingText: p.refreshingText || locale.pullToRefresh.refreshingText,
|
|
38
|
+
completeText: p.completeText || locale.pullToRefresh.completeText
|
|
39
|
+
});
|
|
40
|
+
var classes = classNames(classPrefix, props.className, "".concat(classPrefix, "-").concat(props.type));
|
|
41
|
+
var headHeight = props.headHeight;
|
|
42
|
+
var threshold = props.threshold;
|
|
43
|
+
var _useState = _sliced_to_array(useState('pulling'), 2), status = _useState[0], setStatus = _useState[1];
|
|
44
|
+
var _useSpring = _sliced_to_array(useSpring(function() {
|
|
45
|
+
return {
|
|
46
|
+
from: {
|
|
47
|
+
height: 0
|
|
48
|
+
},
|
|
49
|
+
config: {
|
|
50
|
+
tension: 300,
|
|
51
|
+
friction: 30,
|
|
52
|
+
clamp: true
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}), 2), springStyles = _useSpring[0], api = _useSpring[1];
|
|
56
|
+
var elementRef = useRef(null);
|
|
57
|
+
var pullingRef = useRef(false);
|
|
58
|
+
useEffect(function() {
|
|
59
|
+
var _elementRef_current;
|
|
60
|
+
(_elementRef_current = elementRef.current) === null || _elementRef_current === void 0 ? void 0 : _elementRef_current.addEventListener('touchmove', function() {});
|
|
61
|
+
}, []);
|
|
62
|
+
function doRefresh() {
|
|
33
63
|
return _async_to_generator(function() {
|
|
34
64
|
var e;
|
|
35
65
|
return _ts_generator(this, function(_state) {
|
|
@@ -126,41 +156,8 @@ export var PullToRefresh = function PullToRefresh(p) {
|
|
|
126
156
|
}
|
|
127
157
|
});
|
|
128
158
|
})();
|
|
129
|
-
}
|
|
130
|
-
var classPrefix = 'nut-pulltorefresh';
|
|
131
|
-
var locale = useConfig().locale;
|
|
132
|
-
var props = _object_spread({}, defaultProps, p, {
|
|
133
|
-
pullingText: p.pullingText || locale.pullToRefresh.pullingText,
|
|
134
|
-
canReleaseText: p.canReleaseText || locale.pullToRefresh.canReleaseText,
|
|
135
|
-
refreshingText: p.refreshingText || locale.pullToRefresh.refreshingText,
|
|
136
|
-
completeText: p.completeText || locale.pullToRefresh.completeText
|
|
137
|
-
});
|
|
138
|
-
var classes = classNames(classPrefix, props.className, "".concat(classPrefix, "-").concat(props.type));
|
|
139
|
-
var headHeight = props.headHeight;
|
|
140
|
-
var threshold = props.threshold;
|
|
141
|
-
var _useState = _sliced_to_array(useState('pulling'), 2), status = _useState[0], setStatus = _useState[1];
|
|
142
|
-
var _useSpring = _sliced_to_array(useSpring(function() {
|
|
143
|
-
return {
|
|
144
|
-
from: {
|
|
145
|
-
height: 0
|
|
146
|
-
},
|
|
147
|
-
config: {
|
|
148
|
-
tension: 300,
|
|
149
|
-
friction: 30,
|
|
150
|
-
clamp: true
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
}), 2), springStyles = _useSpring[0], api = _useSpring[1];
|
|
154
|
-
var elementRef = useRef(null);
|
|
155
|
-
var pullingRef = useRef(false);
|
|
156
|
-
useEffect(function() {
|
|
157
|
-
var _elementRef_current;
|
|
158
|
-
(_elementRef_current = elementRef.current) === null || _elementRef_current === void 0 ? void 0 : _elementRef_current.addEventListener('touchmove', function() {});
|
|
159
|
-
}, []);
|
|
159
|
+
}
|
|
160
160
|
useDrag(function(state) {
|
|
161
|
-
var getScrollTop = function getScrollTop(element) {
|
|
162
|
-
return 'scrollTop' in element ? element.scrollTop : element.scrollY;
|
|
163
|
-
};
|
|
164
161
|
if (status === 'refreshing' || status === 'complete') return;
|
|
165
162
|
var event = state.event;
|
|
166
163
|
// 最后一个事件,检查是否可以刷新或是否是开始状态(第一个状态也是最后一个状态)
|
|
@@ -175,6 +172,9 @@ export var PullToRefresh = function PullToRefresh(p) {
|
|
|
175
172
|
}
|
|
176
173
|
return;
|
|
177
174
|
}
|
|
175
|
+
function getScrollTop(element) {
|
|
176
|
+
return 'scrollTop' in element ? element.scrollTop : element.scrollY;
|
|
177
|
+
}
|
|
178
178
|
// 手指位置
|
|
179
179
|
var _state_movement = _sliced_to_array(state.movement, 2), y = _state_movement[1];
|
|
180
180
|
// 第一个事件,并且手指位置大于0
|
|
@@ -14,21 +14,6 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
|
14
14
|
duration: 0.6
|
|
15
15
|
});
|
|
16
16
|
export var Skeleton = function Skeleton(props) {
|
|
17
|
-
var shapeStyle = function shapeStyle() {
|
|
18
|
-
if (shape === 'circle') return {
|
|
19
|
-
borderRadius: '50%'
|
|
20
|
-
};
|
|
21
|
-
if (shape === 'square') return {
|
|
22
|
-
borderRadius: '0'
|
|
23
|
-
};
|
|
24
|
-
return {};
|
|
25
|
-
};
|
|
26
|
-
var durationStyle = function durationStyle() {
|
|
27
|
-
if (typeof duration !== 'undefined') return {
|
|
28
|
-
animationDuration: "".concat(duration, "s")
|
|
29
|
-
};
|
|
30
|
-
return {};
|
|
31
|
-
};
|
|
32
17
|
var _$_object_spread = _object_spread({}, defaultProps, props), className = _$_object_spread.className, width = _$_object_spread.width, height = _$_object_spread.height, shape = _$_object_spread.shape, animated = _$_object_spread.animated, rows = _$_object_spread.rows, visible = _$_object_spread.visible, size = _$_object_spread.size, duration = _$_object_spread.duration, children = _$_object_spread.children, rest = _object_without_properties(_$_object_spread, [
|
|
33
18
|
"className",
|
|
34
19
|
"width",
|
|
@@ -50,6 +35,21 @@ export var Skeleton = function Skeleton(props) {
|
|
|
50
35
|
return i;
|
|
51
36
|
});
|
|
52
37
|
};
|
|
38
|
+
function shapeStyle() {
|
|
39
|
+
if (shape === 'circle') return {
|
|
40
|
+
borderRadius: '50%'
|
|
41
|
+
};
|
|
42
|
+
if (shape === 'square') return {
|
|
43
|
+
borderRadius: '0'
|
|
44
|
+
};
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
function durationStyle() {
|
|
48
|
+
if (typeof duration !== 'undefined') return {
|
|
49
|
+
animationDuration: "".concat(duration, "s")
|
|
50
|
+
};
|
|
51
|
+
return {};
|
|
52
|
+
}
|
|
53
53
|
var _useState = _sliced_to_array(useState(false), 2), animate = _useState[0], setAnimate = _useState[1];
|
|
54
54
|
var playAnimation = function playAnimation() {
|
|
55
55
|
setAnimate(false); // 首先将 animate 设置为 false
|
|
@@ -20,17 +20,6 @@ var defaultProps = {
|
|
|
20
20
|
effect: undefined
|
|
21
21
|
};
|
|
22
22
|
export var Swiper = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
23
|
-
var boundIndex = function boundIndex(current) {
|
|
24
|
-
var min = 0;
|
|
25
|
-
var max = count - 1;
|
|
26
|
-
if (current === max && !loop && props.slideSize) {
|
|
27
|
-
var slideSize = props.slideSize;
|
|
28
|
-
var swiperSize = getSwiperSize();
|
|
29
|
-
var ratio = (swiperSize - slideSize) / slideSize;
|
|
30
|
-
return bound(current, min, max - ratio);
|
|
31
|
-
}
|
|
32
|
-
return current;
|
|
33
|
-
};
|
|
34
23
|
var classPrefix = 'nut-swiper';
|
|
35
24
|
var _$_object_spread = _object_spread({}, defaultProps, props), children = _$_object_spread.children, direction = _$_object_spread.direction, indicator = _$_object_spread.indicator, loop = _$_object_spread.loop, effect = _$_object_spread.effect, autoplay = _$_object_spread.autoplay, touchable = _$_object_spread.touchable, defaultValue = _$_object_spread.defaultValue, duration = _$_object_spread.duration, style = _$_object_spread.style, className = _$_object_spread.className;
|
|
36
25
|
var isVertical = direction === 'vertical';
|
|
@@ -125,6 +114,17 @@ export var Swiper = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
|
125
114
|
count,
|
|
126
115
|
runTimeSwiper
|
|
127
116
|
]);
|
|
117
|
+
function boundIndex(current) {
|
|
118
|
+
var min = 0;
|
|
119
|
+
var max = count - 1;
|
|
120
|
+
if (current === max && !loop && props.slideSize) {
|
|
121
|
+
var slideSize = props.slideSize;
|
|
122
|
+
var swiperSize = getSwiperSize();
|
|
123
|
+
var ratio = (swiperSize - slideSize) / slideSize;
|
|
124
|
+
return bound(current, min, max - ratio);
|
|
125
|
+
}
|
|
126
|
+
return current;
|
|
127
|
+
}
|
|
128
128
|
var to = function to(index) {
|
|
129
129
|
var immediate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
130
130
|
var _props_onChange;
|
|
@@ -147,7 +147,13 @@ var Notification = /*#__PURE__*/ function(_superClass) {
|
|
|
147
147
|
_define_property(Notification, "newInstance", void 0);
|
|
148
148
|
export { Notification as default };
|
|
149
149
|
Notification.newInstance = function(properties, callback) {
|
|
150
|
-
var
|
|
150
|
+
var element = document.createElement('div');
|
|
151
|
+
var id = properties.id ? properties.id : "".concat(Date.now());
|
|
152
|
+
element.id = id;
|
|
153
|
+
properties.id = id;
|
|
154
|
+
document.body.appendChild(element);
|
|
155
|
+
var called = false;
|
|
156
|
+
function ref(instance) {
|
|
151
157
|
if (called) {
|
|
152
158
|
return;
|
|
153
159
|
}
|
|
@@ -159,13 +165,7 @@ Notification.newInstance = function(properties, callback) {
|
|
|
159
165
|
element && element.parentNode && element.parentNode.removeChild(element);
|
|
160
166
|
}
|
|
161
167
|
});
|
|
162
|
-
}
|
|
163
|
-
var element = document.createElement('div');
|
|
164
|
-
var id = properties.id ? properties.id : "".concat(Date.now());
|
|
165
|
-
element.id = id;
|
|
166
|
-
properties.id = id;
|
|
167
|
-
document.body.appendChild(element);
|
|
168
|
-
var called = false;
|
|
168
|
+
}
|
|
169
169
|
render(/*#__PURE__*/ React.createElement(Notification, _object_spread_props(_object_spread({}, properties), {
|
|
170
170
|
ref: ref
|
|
171
171
|
})), element);
|
|
@@ -147,7 +147,7 @@ export var Tour = function Tour(props) {
|
|
|
147
147
|
0,
|
|
148
148
|
12
|
|
149
149
|
],
|
|
150
|
-
arrowOffset: item.arrowOffset ||
|
|
150
|
+
arrowOffset: item.arrowOffset || 20
|
|
151
151
|
}, /*#__PURE__*/ React.createElement(React.Fragment, null), /*#__PURE__*/ React.createElement(React.Fragment, null, children || /*#__PURE__*/ React.createElement(React.Fragment, null, type === 'step' && /*#__PURE__*/ React.createElement("div", {
|
|
152
152
|
className: "nut-tour-content"
|
|
153
153
|
}, title && /*#__PURE__*/ React.createElement("div", {
|
|
@@ -31,14 +31,30 @@ export interface BaseNoticeBar extends BaseProps {
|
|
|
31
31
|
*/
|
|
32
32
|
leftIcon: ReactNode
|
|
33
33
|
/**
|
|
34
|
-
* 右边的 icon,在 closeable 模式下默认为 <
|
|
34
|
+
* 右边的 icon,在 closeable 模式下默认为 <MaskClose />
|
|
35
35
|
*/
|
|
36
36
|
rightIcon: ReactNode
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* ~~已废弃,建议使用 action 替代~~ 右边自定义区域,仅用于 direction='horizontal' 模式
|
|
39
39
|
*/
|
|
40
40
|
right: ReactNode
|
|
41
41
|
/**
|
|
42
|
+
* 副文本内容,显示在主文本下方
|
|
43
|
+
*/
|
|
44
|
+
description: ReactNode
|
|
45
|
+
/**
|
|
46
|
+
* 信息标图标,显示在文案右侧,尺寸 12×12
|
|
47
|
+
*/
|
|
48
|
+
tag: ReactNode
|
|
49
|
+
/**
|
|
50
|
+
* 操作按钮区域,支持弱行动(文字链接)和强行动(按钮),最大宽度 99px
|
|
51
|
+
*/
|
|
52
|
+
action: ReactNode
|
|
53
|
+
/**
|
|
54
|
+
* 自动关闭延时(毫秒),0 或不传为手动关闭
|
|
55
|
+
*/
|
|
56
|
+
autoClose: number
|
|
57
|
+
/**
|
|
42
58
|
* 延时多少秒
|
|
43
59
|
*/
|
|
44
60
|
delay: string | number
|
|
@@ -55,7 +71,7 @@ export interface BaseNoticeBar extends BaseProps {
|
|
|
55
71
|
/**
|
|
56
72
|
* 关闭通知栏时触发
|
|
57
73
|
*/
|
|
58
|
-
onClose?: (event
|
|
74
|
+
onClose?: (event?: any) => void
|
|
59
75
|
/**
|
|
60
76
|
* 外层点击事件回调
|
|
61
77
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { BaseProps } from '../../base/props';
|
|
3
3
|
import { FullPosition, SimpleValues, UITheme } from '../../base/atoms';
|
|
4
|
+
export type PopoverType = 'status' | 'description';
|
|
4
5
|
export interface PopoverList {
|
|
5
6
|
key?: string;
|
|
6
7
|
name: string;
|
|
@@ -20,7 +21,14 @@ export interface WrapperPosition {
|
|
|
20
21
|
right: number;
|
|
21
22
|
}
|
|
22
23
|
export type BasePopover<POPUP_PROPS> = POPUP_PROPS & BaseProps & {
|
|
23
|
-
|
|
24
|
+
/**
|
|
25
|
+
* 气泡类型,status 状态型(图标+文案+关闭),description 说明型(仅文案)
|
|
26
|
+
*/
|
|
27
|
+
type: PopoverType
|
|
28
|
+
/**
|
|
29
|
+
* 主题风格,默认 dark 为设计规范深色气泡;light 为明亮风格(白底深字)
|
|
30
|
+
*/
|
|
31
|
+
theme: UITheme
|
|
24
32
|
/**
|
|
25
33
|
* 弹出位置,里面具体的参数值可以参考上面的位置自定义例子
|
|
26
34
|
*/
|
|
@@ -57,6 +65,14 @@ export type BasePopover<POPUP_PROPS> = POPUP_PROPS & BaseProps & {
|
|
|
57
65
|
* 是否在点击选项后关闭
|
|
58
66
|
*/
|
|
59
67
|
closeOnActionClick: boolean
|
|
68
|
+
/**
|
|
69
|
+
* 是否自动弹出,需配合 onOpen 更新 visible
|
|
70
|
+
*/
|
|
71
|
+
autoShow: boolean
|
|
72
|
+
/**
|
|
73
|
+
* 自动关闭时长(ms),0 表示不自动关闭
|
|
74
|
+
*/
|
|
75
|
+
duration: number
|
|
60
76
|
children?: ReactNode;
|
|
61
77
|
/**
|
|
62
78
|
* 点击切换 popover 展示状态
|
package/dist/es/utils/render.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
2
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
3
|
-
import { _ as _type_of } from "@swc/helpers/_/_type_of";
|
|
4
3
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
4
|
+
import { _ as _type_of } from "@swc/helpers/_/_type_of";
|
|
5
5
|
import * as ReactDOM from "react-dom";
|
|
6
6
|
// Let compiler not to search module usage
|
|
7
7
|
var fullClone = _object_spread({}, ReactDOM);
|