UNPKG

mldong-flow-designer-plus

Version:

本项目包含了作者为B站课堂视频[《工作流设计器开发最佳实践》](https://www.bilibili.com/cheese/play/ss24484)的过程源码。教程中开发的组件也可用于实际生产环境中。以下是和使用文档和课程章节说明。 ## 实战项目 [演示地址](https://flow-pro.mldong.com/)

72 lines (71 loc) 2.17 kB
import { _ as _extends } from "./index-DMN4aeBG.js"; let supportsPassive = false; try { const opts = Object.defineProperty({}, "passive", { get() { supportsPassive = true; } }); window.addEventListener("testPassive", null, opts); window.removeEventListener("testPassive", null, opts); } catch (e) { } function addEventListenerWrap(target, eventType, cb, option) { if (target && target.addEventListener) { let opt = option; if (opt === void 0 && supportsPassive && (eventType === "touchstart" || eventType === "touchmove" || eventType === "wheel")) { opt = { passive: false }; } target.addEventListener(eventType, cb, opt); } return { remove: () => { if (target && target.removeEventListener) { target.removeEventListener(eventType, cb); } } }; } const initMotionCommon = (duration) => ({ animationDuration: duration, animationFillMode: "both" }); const initMotionCommonLeave = (duration) => ({ animationDuration: duration, animationFillMode: "both" }); const initMotion = function(motionCls, inKeyframes, outKeyframes, duration) { let sameLevel = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false; const sameLevelPrefix = sameLevel ? "&" : ""; return { [` ${sameLevelPrefix}${motionCls}-enter, ${sameLevelPrefix}${motionCls}-appear `]: _extends(_extends({}, initMotionCommon(duration)), { animationPlayState: "paused" }), [`${sameLevelPrefix}${motionCls}-leave`]: _extends(_extends({}, initMotionCommonLeave(duration)), { animationPlayState: "paused" }), [` ${sameLevelPrefix}${motionCls}-enter${motionCls}-enter-active, ${sameLevelPrefix}${motionCls}-appear${motionCls}-appear-active `]: { animationName: inKeyframes, animationPlayState: "running" }, [`${sameLevelPrefix}${motionCls}-leave${motionCls}-leave-active`]: { animationName: outKeyframes, animationPlayState: "running", pointerEvents: "none" } }; }; export { addEventListenerWrap as a, initMotion as i, supportsPassive as s }; //# sourceMappingURL=motion-DSfzeqrw.js.map