提交
This commit is contained in:
64
甲情_甲意/miniprogram/node_modules/antd-mini/less/Popup/index.js
generated
vendored
Normal file
64
甲情_甲意/miniprogram/node_modules/antd-mini/less/Popup/index.js
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
import { __awaiter, __generator } from "tslib";
|
||||
import { Component, triggerEventOnly, getValueFromProps, } from '../_util/simply';
|
||||
import { PopupDefaultProps } from './props';
|
||||
import { isOldSDKVersion } from '../_util/platform';
|
||||
var isOldVersion = isOldSDKVersion();
|
||||
Component(PopupDefaultProps, {
|
||||
onTapMask: function () {
|
||||
var closing = this.data.closing;
|
||||
if (closing) {
|
||||
return;
|
||||
}
|
||||
triggerEventOnly(this, 'close');
|
||||
},
|
||||
onAnimationEnd: function () {
|
||||
var closing = this.data.closing;
|
||||
if (closing) {
|
||||
this.setData({ closing: false });
|
||||
}
|
||||
var _a = getValueFromProps(this, [
|
||||
'visible',
|
||||
'duration',
|
||||
'animation',
|
||||
]), visible = _a[0], duration = _a[1], animation = _a[2];
|
||||
var enableAnimation = animation && duration > 0;
|
||||
if (enableAnimation) {
|
||||
triggerEventOnly(this, visible ? 'afterShow' : 'afterClose');
|
||||
}
|
||||
},
|
||||
}, {
|
||||
closing: false,
|
||||
isOldVersion: isOldVersion,
|
||||
}, undefined, {
|
||||
deriveDataFromProps: function (nextProps) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var _a, visible, duration, animation, enableAnimation;
|
||||
return __generator(this, function (_b) {
|
||||
_a = getValueFromProps(this, [
|
||||
'visible',
|
||||
'duration',
|
||||
'animation',
|
||||
]), visible = _a[0], duration = _a[1], animation = _a[2];
|
||||
enableAnimation = animation && duration > 0;
|
||||
if (nextProps.visible !== visible &&
|
||||
enableAnimation &&
|
||||
!nextProps.visible &&
|
||||
!this.data.closing) {
|
||||
this.setData({ closing: true });
|
||||
}
|
||||
return [2 /*return*/];
|
||||
});
|
||||
});
|
||||
},
|
||||
didUpdate: function (prevProps) {
|
||||
var _a = getValueFromProps(this, [
|
||||
'visible',
|
||||
'duration',
|
||||
'animation',
|
||||
]), visible = _a[0], duration = _a[1], animation = _a[2];
|
||||
var enableAnimation = animation && duration > 0;
|
||||
if (prevProps.visible !== visible && !enableAnimation) {
|
||||
triggerEventOnly(this, visible ? 'afterShow' : 'afterClose');
|
||||
}
|
||||
},
|
||||
});
|
Reference in New Issue
Block a user