From 2964557362e44bfb20b4dffc66db7dc2d2019058 Mon Sep 17 00:00:00 2001 From: dntzhang Date: Fri, 1 May 2020 09:20:30 +0800 Subject: [PATCH] publish(@omiu/transition) --- components/docs-src/src/docs/en/transition.md | 4 - .../docs-src/src/docs/zh-cn/transition.md | 4 - components/dready/index.esm.js | 18 ++ components/dready/index.js | 40 ++++ components/dready/package.json | 13 ++ components/transition/README.md | 4 - .../transition/demos/js-demo/index.html | 28 ++- components/transition/package.json | 3 +- components/transition/src/index.esm.js | 71 +++++-- components/transition/src/index.esm.js.map | 2 +- components/transition/src/index.js | 194 +++++++++++++++++- components/transition/src/index.js.map | 2 +- components/transition/src/index.tsx | 24 ++- 13 files changed, 343 insertions(+), 64 deletions(-) create mode 100644 components/dready/index.esm.js create mode 100644 components/dready/index.js create mode 100644 components/dready/package.json diff --git a/components/docs-src/src/docs/en/transition.md b/components/docs-src/src/docs/en/transition.md index 8d44b39f6..5b76dab78 100644 --- a/components/docs-src/src/docs/en/transition.md +++ b/components/docs-src/src/docs/en/transition.md @@ -48,12 +48,8 @@ Or use script tag to ref it. ### Events * BeforeEnter -* beforeEnter * AfterEnter -* afterEnter * enter * BeforeLeave -* beforeLeave * AfterLeave -* afterLeave * leave diff --git a/components/docs-src/src/docs/zh-cn/transition.md b/components/docs-src/src/docs/zh-cn/transition.md index 149d0e60a..45b5c3930 100644 --- a/components/docs-src/src/docs/zh-cn/transition.md +++ b/components/docs-src/src/docs/zh-cn/transition.md @@ -47,12 +47,8 @@ import '@omiu/transition' ``` ### 事件 * BeforeEnter -* beforeEnter * AfterEnter -* afterEnter * enter * BeforeLeave -* beforeLeave * AfterLeave -* afterLeave * leave diff --git a/components/dready/index.esm.js b/components/dready/index.esm.js new file mode 100644 index 000000000..56bbebe7c --- /dev/null +++ b/components/dready/index.esm.js @@ -0,0 +1,18 @@ +const readyCallbacks = [] +document.addEventListener('DOMContentLoaded', () => { + domReady.done = true + readyCallbacks.forEach(callback => { + callback() + }) +}) + +export default function domReady(callback) { + if (domReady.done) { + callback() + return + } + readyCallbacks.push(callback) +} + +domReady.done = false + diff --git a/components/dready/index.js b/components/dready/index.js new file mode 100644 index 000000000..5e8913e6d --- /dev/null +++ b/components/dready/index.js @@ -0,0 +1,40 @@ +// if the module has no dependencies, the above pattern can be simplified to +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define([], factory); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } else { + // Browser globals (root is window) + root.domReady = factory(); + } +}(this, function () { + + const readyCallbacks = [] + document.addEventListener('DOMContentLoaded', () => { + domReady.done = true + readyCallbacks.forEach(callback => { + callback() + }) + }) + + function domReady(callback) { + if (domReady.done) { + callback() + return + } + readyCallbacks.push(callback) + } + + domReady.done = false + + + // Just return a value to define the module export. + // This example returns an object, but the module + // can return a function as the exported value. + return domReady +})); diff --git a/components/dready/package.json b/components/dready/package.json new file mode 100644 index 000000000..92274c201 --- /dev/null +++ b/components/dready/package.json @@ -0,0 +1,13 @@ +{ + "name": "dready", + "version": "0.0.1", + "description": "Dom Ready.", + "main": "src/index.js", + "module": "src/index.esm.js", + "scripts": {}, + "keywords": [], + "author": "dntzhang", + "license": "MIT", + "devDependencies": {}, + "dependencies": {} +} diff --git a/components/transition/README.md b/components/transition/README.md index 39c24c3c6..365db24fe 100644 --- a/components/transition/README.md +++ b/components/transition/README.md @@ -45,12 +45,8 @@ Or use script tag to ref it. ### Events * BeforeEnter -* beforeEnter * AfterEnter -* afterEnter * enter * BeforeLeave -* beforeLeave * AfterLeave -* afterLeave * leave diff --git a/components/transition/demos/js-demo/index.html b/components/transition/demos/js-demo/index.html index 8186494a4..81b7e88fd 100644 --- a/components/transition/demos/js-demo/index.html +++ b/components/transition/demos/js-demo/index.html @@ -18,23 +18,21 @@ - - - - + +
aaaa
+
diff --git a/components/transition/package.json b/components/transition/package.json index 8e4f58670..25731aae0 100644 --- a/components/transition/package.json +++ b/components/transition/package.json @@ -1,6 +1,6 @@ { "name": "@omiu/transition", - "version": "0.0.1", + "version": "0.0.2", "description": "Define transition animation for entering and leaving", "docsExtend": { "cnName": "过渡动画", @@ -96,6 +96,7 @@ }, "dependencies": { "@omiu/common": "latest", + "dready": "latest", "omi": "latest" } } diff --git a/components/transition/src/index.esm.js b/components/transition/src/index.esm.js index 76564aea2..ec616d98c 100644 --- a/components/transition/src/index.esm.js +++ b/components/transition/src/index.esm.js @@ -1,5 +1,5 @@ /** - * @omiu/transition v0.0.1 http://omijs.org + * @omiu/transition v0.0.2 http://omijs.org * Front End Cross-Frameworks Framework. * By dntzhang https://github.com/dntzhang * Github: https://github.com/Tencent/omi @@ -44,6 +44,55 @@ function __decorate(decorators, target, key, desc) { return c > 3 && r && Object.defineProperty(target, key, r), r; } +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var _dready_0_0_1_dready = createCommonjsModule(function (module, exports) { +// if the module has no dependencies, the above pattern can be simplified to +(function (root, factory) { + { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } +}(commonjsGlobal, function () { + + const readyCallbacks = []; + document.addEventListener('DOMContentLoaded', () => { + domReady.done = true; + readyCallbacks.forEach(callback => { + callback(); + }); + }); + + function domReady(callback) { + if (domReady.done) { + callback(); + return + } + readyCallbacks.push(callback); + } + + domReady.done = false; + + + // Just return a value to define the module export. + // This example returns an object, but the module + // can return a function as the exported value. + return domReady +})); +}); + +var domReady = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': _dready_0_0_1_dready, + __moduleExports: _dready_0_0_1_dready +}); + /** * o-transition element based on vue-transition * Tom Fales (@enlightenmentor) @@ -60,17 +109,18 @@ var Transition = /** @class */ (function (_super) { } Transition.prototype.installed = function () { var _this = this; - this.transitionTarget = this.childNodes[0]; - this.enter(); - if (this.props.leavingTime) { - setTimeout(function () { - _this.leave(); - }, this.props.leavingTime); - } + domReady(function () { + _this.transitionTarget = _this.children[0]; + _this.enter(); + if (_this.props.leavingTime) { + setTimeout(function () { + _this.leave(); + }, _this.props.leavingTime); + } + }); }; Transition.prototype.enter = function () { this.fire('BeforeEnter'); - this.fire('beforeEnter'); this.transitionTarget.classList.remove(this.props.name + '-leave-active'); this.transitionTarget.classList.remove(this.props.name + '-leave-to'); this.transitionTarget.classList.add(this.props.name + '-enter'); @@ -78,7 +128,6 @@ var Transition = /** @class */ (function (_super) { this.callback = function () { this.transitionTarget.classList.remove(this.props.name + '-enter-active'); this.fire('AfterEnter'); - this.fire('afterEnter'); }.bind(this); this.once('transitionend', this.callback); this.once('animationend', this.callback); @@ -90,7 +139,6 @@ var Transition = /** @class */ (function (_super) { }; Transition.prototype.leave = function () { this.fire('BeforeLeave'); - this.fire('beforeLeave'); this.transitionTarget.classList.remove(this.props.name + '-enter-active'); this.transitionTarget.classList.remove(this.props.name + '-enter-to'); this.transitionTarget.classList.add(this.props.name + '-leave'); @@ -98,7 +146,6 @@ var Transition = /** @class */ (function (_super) { this.callback = function (e) { this.transitionTarget.classList.remove(this.props.name + '-leave-active'); this.fire('AfterLeave'); - this.fire('afterLeave'); if (this.props.autoRemove && this.parentNode) { this.parentNode.removeChild(this); } diff --git a/components/transition/src/index.esm.js.map b/components/transition/src/index.esm.js.map index 997d802eb..09fc1eab6 100644 --- a/components/transition/src/index.esm.js.map +++ b/components/transition/src/index.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"index.esm.js","sources":["../node_modules/_tslib@1.11.1@tslib/tslib.es6.js","index.tsx"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/**\n * o-transition element based on vue-transition\n * Tom Fales (@enlightenmentor)\n * Licensed under the MIT License\n * https://github.com/enlightenmentor/vue-transition/blob/master/LICENSE\n *\n * modified by dntzhang\n *\n */\n\n//todo duration and delay support\n\nimport { tag, WeElement } from 'omi'\n\ninterface Props {\n name: string\n leavingTime?: number\n autoRemove?: boolean\n}\n\n@tag('o-transition')\nexport default class Transition extends WeElement{\n\n static propTypes = {\n name: String,\n leavingTime: Number,\n autoRemove: Boolean\n }\n\n static isLightDom = true\n\n static defaultProps = {\n name: 'o'\n }\n\n transitionTarget\n\n installed() {\n\n this.transitionTarget = this.childNodes[0]\n this.enter()\n\n if (this.props.leavingTime) {\n setTimeout(() => {\n this.leave()\n }, this.props.leavingTime)\n }\n }\n\n callback: () => void\n\n enter() {\n\n this.fire('BeforeEnter')\n this.fire('beforeEnter')\n this.transitionTarget.classList.remove(this.props.name + '-leave-active')\n this.transitionTarget.classList.remove(this.props.name + '-leave-to')\n this.transitionTarget.classList.add(this.props.name + '-enter')\n this.transitionTarget.classList.add(this.props.name + '-enter-active')\n\n this.callback = function () {\n this.transitionTarget.classList.remove(this.props.name + '-enter-active')\n this.fire('AfterEnter')\n this.fire('afterEnter')\n }.bind(this)\n this.once('transitionend', this.callback)\n this.once('animationend', this.callback)\n\n window.setTimeout(function () {\n this.transitionTarget.classList.remove(this.props.name + '-enter')\n this.transitionTarget.classList.add(this.props.name + '-enter-to')\n this.fire('enter')\n }.bind(this), 0)\n }\n\n leave() {\n this.fire('BeforeLeave')\n this.fire('beforeLeave')\n this.transitionTarget.classList.remove(this.props.name + '-enter-active')\n this.transitionTarget.classList.remove(this.props.name + '-enter-to')\n this.transitionTarget.classList.add(this.props.name + '-leave')\n this.transitionTarget.classList.add(this.props.name + '-leave-active')\n\n this.callback = function (e) {\n\n this.transitionTarget.classList.remove(this.props.name + '-leave-active')\n\n this.fire('AfterLeave')\n this.fire('afterLeave')\n if (this.props.autoRemove && this.parentNode) {\n this.parentNode.removeChild(this)\n }\n\n }.bind(this)\n this.once('transitionend', this.callback)\n this.once('animationend', this.callback)\n\n window.setTimeout(function () {\n this.transitionTarget.classList.remove(this.props.name + '-leave')\n this.transitionTarget.classList.add(this.props.name + '-leave-to')\n this.fire('leave')\n }.bind(this), 0)\n }\n\n once(name, callback) {\n const wrapCall = function () {\n this.removeEventListener(name, wrapCall)\n callback()\n }.bind(this)\n this.addEventListener(name, wrapCall)\n }\n\n render() {\n return\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAA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C,CAAA;YAClE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;SACnB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;KACjB;IAED,yBAAI,GAAJ,UAAK,IAAI,EAAE,QAAQ;QACjB,IAAM,QAAQ,GAAG;YACf,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;YACxC,QAAQ,EAAE,CAAA;SACX,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACZ,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;KACtC;IAED,2BAAM,GAAN;QACE,OAAM;KACP;IA3FM,oBAAS,GAAG;QACjB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,MAAM;QACnB,UAAU,EAAE,OAAO;KACpB,CAAA;IAEM,qBAAU,GAAG,IAAI,CAAA;IAEjB,uBAAY,GAAG;QACpB,IAAI,EAAE,GAAG;KACV,CAAA;IAZkB,UAAU;QAD9B,GAAG,CAAC,cAAc,CAAC;OACC,UAAU,CA8F9B;IAAD,iBAAC;CAAA,CA9FuC,SAAS;;"} \ No newline at end of file +{"version":3,"file":"index.esm.js","sources":["../node_modules/_tslib@1.11.1@tslib/tslib.es6.js","../node_modules/_dready@0.0.1@dready/index.js","index.tsx"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","// if the module has no dependencies, the above pattern can be simplified to\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define([], factory);\n } else if (typeof exports === 'object') {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals (root is window)\n root.domReady = factory();\n }\n}(this, function () {\n\n const readyCallbacks = []\n document.addEventListener('DOMContentLoaded', () => {\n domReady.done = true\n readyCallbacks.forEach(callback => {\n callback()\n })\n })\n\n function domReady(callback) {\n if (domReady.done) {\n callback()\n return\n }\n readyCallbacks.push(callback)\n }\n\n domReady.done = false\n\n\n // Just return a value to define the module export.\n // This example returns an object, but the module\n // can return a function as the exported value.\n return domReady\n}));\n","/**\n * o-transition element based on vue-transition\n * Tom Fales (@enlightenmentor)\n * Licensed under the MIT License\n * https://github.com/enlightenmentor/vue-transition/blob/master/LICENSE\n *\n * modified by dntzhang\n *\n */\n\n//todo duration and delay support\n\nimport { tag, WeElement } from 'omi'\nimport * as domReady from 'dready'\n\ninterface Props {\n name: string\n leavingTime?: number\n autoRemove?: boolean\n}\n\n@tag('o-transition')\nexport default class Transition extends WeElement{\n\n static propTypes = {\n name: String,\n leavingTime: Number,\n autoRemove: Boolean\n }\n\n static isLightDom = true\n\n static defaultProps = {\n name: 'o'\n }\n\n transitionTarget\n\n installed() {\n\n domReady(() => {\n\n this.transitionTarget = this.children[0]\n\n this.enter()\n\n if (this.props.leavingTime) {\n setTimeout(() => {\n this.leave()\n }, this.props.leavingTime)\n }\n })\n\n }\n\n callback: () => void\n\n enter() {\n\n this.fire('BeforeEnter')\n this.transitionTarget.classList.remove(this.props.name + '-leave-active')\n this.transitionTarget.classList.remove(this.props.name + '-leave-to')\n this.transitionTarget.classList.add(this.props.name + '-enter')\n this.transitionTarget.classList.add(this.props.name + '-enter-active')\n\n this.callback = function () {\n this.transitionTarget.classList.remove(this.props.name + '-enter-active')\n this.fire('AfterEnter')\n }.bind(this)\n this.once('transitionend', this.callback)\n this.once('animationend', this.callback)\n\n window.setTimeout(function () {\n this.transitionTarget.classList.remove(this.props.name + '-enter')\n this.transitionTarget.classList.add(this.props.name + '-enter-to')\n this.fire('enter')\n }.bind(this), 0)\n }\n\n leave() {\n this.fire('BeforeLeave')\n this.transitionTarget.classList.remove(this.props.name + '-enter-active')\n this.transitionTarget.classList.remove(this.props.name + '-enter-to')\n this.transitionTarget.classList.add(this.props.name + '-leave')\n this.transitionTarget.classList.add(this.props.name + '-leave-active')\n\n this.callback = function (e) {\n\n this.transitionTarget.classList.remove(this.props.name + '-leave-active')\n\n this.fire('AfterLeave')\n if (this.props.autoRemove && this.parentNode) {\n this.parentNode.removeChild(this)\n }\n\n }.bind(this)\n this.once('transitionend', this.callback)\n this.once('animationend', this.callback)\n\n window.setTimeout(function () {\n this.transitionTarget.classList.remove(this.props.name + '-leave')\n this.transitionTarget.classList.add(this.props.name + '-leave-to')\n this.fire('leave')\n }.bind(this), 0)\n }\n\n once(name, callback) {\n const wrapCall = function () {\n this.removeEventListener(name, wrapCall)\n callback()\n }.bind(this)\n this.addEventListener(name, wrapCall)\n }\n\n render() {\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,oBAAS,GAAG;QACjB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,MAAM;QACnB,UAAU,EAAE,OAAO;KACpB,CAAA;IAEM,qBAAU,GAAG,IAAI,CAAA;IAEjB,uBAAY,GAAG;QACpB,IAAI,EAAE,GAAG;KACV,CAAA;IAZkB,UAAU;QAD9B,GAAG,CAAC,cAAc,CAAC;OACC,UAAU,CA+F9B;IAAD,iBAAC;CAAA,CA/FuC,SAAS;;"} \ No newline at end of file diff --git a/components/transition/src/index.js b/components/transition/src/index.js index 973314867..b0fbe5364 100644 --- a/components/transition/src/index.js +++ b/components/transition/src/index.js @@ -1,13 +1,13 @@ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); + module.exports = factory(require("omi")); else if(typeof define === 'function' && define.amd) - define([], factory); + define(["omi"], factory); else if(typeof exports === 'object') - exports["OTransition"] = factory(); + exports["OTransition"] = factory(require("omi")); else - root["OTransition"] = factory(); -})(this, function() { + root["OTransition"] = factory(root["Omi"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_omi__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -91,19 +91,191 @@ return /******/ (function(modules) { // webpackBootstrap /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./src/msg.tsx"); +/******/ return __webpack_require__(__webpack_require__.s = "./src/index.tsx"); /******/ }) /************************************************************************/ /******/ ({ -/***/ "./src/msg.tsx": -/*!*********************!*\ - !*** ./src/msg.tsx ***! - \*********************/ +/***/ "./node_modules/_dready@0.0.1@dready/index.js": +/*!****************************************************!*\ + !*** ./node_modules/_dready@0.0.1@dready/index.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// if the module has no dependencies, the above pattern can be simplified to +(function (root, factory) { + if (true) { + // AMD. Register as an anonymous module. + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}(this, function () { + + const readyCallbacks = [] + document.addEventListener('DOMContentLoaded', () => { + domReady.done = true + readyCallbacks.forEach(callback => { + callback() + }) + }) + + function domReady(callback) { + if (domReady.done) { + callback() + return + } + readyCallbacks.push(callback) + } + + domReady.done = false + + + // Just return a value to define the module export. + // This example returns an object, but the module + // can return a function as the exported value. + return domReady +})); + + +/***/ }), + +/***/ "./src/index.tsx": +/*!***********************!*\ + !*** ./src/index.tsx ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * o-transition element based on vue-transition + * Tom Fales (@enlightenmentor) + * Licensed under the MIT License + * https://github.com/enlightenmentor/vue-transition/blob/master/LICENSE + * + * modified by dntzhang + * + */ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +//todo duration and delay support +var omi_1 = __webpack_require__(/*! omi */ "omi"); +var domReady = __webpack_require__(/*! dready */ "./node_modules/_dready@0.0.1@dready/index.js"); +var Transition = /** @class */ (function (_super) { + __extends(Transition, _super); + function Transition() { + return _super !== null && _super.apply(this, arguments) || this; + } + Transition.prototype.installed = function () { + var _this = this; + domReady(function () { + _this.transitionTarget = _this.children[0]; + _this.enter(); + if (_this.props.leavingTime) { + setTimeout(function () { + _this.leave(); + }, _this.props.leavingTime); + } + }); + }; + Transition.prototype.enter = function () { + this.fire('BeforeEnter'); + this.transitionTarget.classList.remove(this.props.name + '-leave-active'); + this.transitionTarget.classList.remove(this.props.name + '-leave-to'); + this.transitionTarget.classList.add(this.props.name + '-enter'); + this.transitionTarget.classList.add(this.props.name + '-enter-active'); + this.callback = function () { + this.transitionTarget.classList.remove(this.props.name + '-enter-active'); + this.fire('AfterEnter'); + }.bind(this); + this.once('transitionend', this.callback); + this.once('animationend', this.callback); + window.setTimeout(function () { + this.transitionTarget.classList.remove(this.props.name + '-enter'); + this.transitionTarget.classList.add(this.props.name + '-enter-to'); + this.fire('enter'); + }.bind(this), 0); + }; + Transition.prototype.leave = function () { + this.fire('BeforeLeave'); + this.transitionTarget.classList.remove(this.props.name + '-enter-active'); + this.transitionTarget.classList.remove(this.props.name + '-enter-to'); + this.transitionTarget.classList.add(this.props.name + '-leave'); + this.transitionTarget.classList.add(this.props.name + '-leave-active'); + this.callback = function (e) { + this.transitionTarget.classList.remove(this.props.name + '-leave-active'); + this.fire('AfterLeave'); + if (this.props.autoRemove && this.parentNode) { + this.parentNode.removeChild(this); + } + }.bind(this); + this.once('transitionend', this.callback); + this.once('animationend', this.callback); + window.setTimeout(function () { + this.transitionTarget.classList.remove(this.props.name + '-leave'); + this.transitionTarget.classList.add(this.props.name + '-leave-to'); + this.fire('leave'); + }.bind(this), 0); + }; + Transition.prototype.once = function (name, callback) { + var wrapCall = function () { + this.removeEventListener(name, wrapCall); + callback(); + }.bind(this); + this.addEventListener(name, wrapCall); + }; + Transition.prototype.render = function () { + return; + }; + Transition.propTypes = { + name: String, + leavingTime: Number, + autoRemove: Boolean + }; + Transition.isLightDom = true; + Transition.defaultProps = { + name: 'o' + }; + Transition = __decorate([ + omi_1.tag('o-transition') + ], Transition); + return Transition; +}(omi_1.WeElement)); +exports.default = Transition; + + +/***/ }), + +/***/ "omi": +/*!******************************************************************************!*\ + !*** external {"commonjs":"omi","commonjs2":"omi","amd":"omi","root":"Omi"} ***! + \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { -throw new Error("Module build failed (from ./node_modules/_ts-loader@5.4.5@ts-loader/index.js):\nError: ENOENT: no such file or directory, open '/Users/dntzhang/Documents/GitHub/omi/components/transition/src/msg.tsx'"); +module.exports = __WEBPACK_EXTERNAL_MODULE_omi__; /***/ }) diff --git a/components/transition/src/index.js.map b/components/transition/src/index.js.map index 411cb7e22..f254cf42f 100644 --- a/components/transition/src/index.js.map +++ b/components/transition/src/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://OTransition/webpack/universalModuleDefinition","webpack://OTransition/webpack/bootstrap"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA","file":"index.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"OTransition\"] = factory();\n\telse\n\t\troot[\"OTransition\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/msg.tsx\");\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://OTransition/webpack/universalModuleDefinition","webpack://OTransition/webpack/bootstrap","webpack://OTransition/./node_modules/_dready@0.0.1@dready/index.js","webpack://OTransition/./src/index.tsx","webpack://OTransition/external {\"commonjs\":\"omi\",\"commonjs2\":\"omi\",\"amd\":\"omi\",\"root\":\"Omi\"}"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA;AACA;AACA,MAAM,IAA0C;AAChD;AACA,IAAI,iCAAO,EAAE,oCAAE,OAAO;AAAA;AAAA;AAAA,oGAAC;AACvB,GAAG,MAAM,EAQN;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACvCY;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,gBAAgB,sCAAsC,iBAAiB,EAAE;AACvF,6BAA6B,uDAAuD;AACpF;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,YAAY,mBAAO,CAAC,gBAAK;AACzB,eAAe,mBAAO,CAAC,4DAAQ;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;ACjHA,iD","file":"index.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"omi\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"omi\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"OTransition\"] = factory(require(\"omi\"));\n\telse\n\t\troot[\"OTransition\"] = factory(root[\"Omi\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_omi__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.tsx\");\n","// if the module has no dependencies, the above pattern can be simplified to\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define([], factory);\n } else if (typeof exports === 'object') {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory();\n } else {\n // Browser globals (root is window)\n root.domReady = factory();\n }\n}(this, function () {\n\n const readyCallbacks = []\n document.addEventListener('DOMContentLoaded', () => {\n domReady.done = true\n readyCallbacks.forEach(callback => {\n callback()\n })\n })\n\n function domReady(callback) {\n if (domReady.done) {\n callback()\n return\n }\n readyCallbacks.push(callback)\n }\n\n domReady.done = false\n\n\n // Just return a value to define the module export.\n // This example returns an object, but the module\n // can return a function as the exported value.\n return domReady\n}));\n","\"use strict\";\n/**\n * o-transition element based on vue-transition\n * Tom Fales (@enlightenmentor)\n * Licensed under the MIT License\n * https://github.com/enlightenmentor/vue-transition/blob/master/LICENSE\n *\n * modified by dntzhang\n *\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//todo duration and delay support\nvar omi_1 = require(\"omi\");\nvar domReady = require(\"dready\");\nvar Transition = /** @class */ (function (_super) {\n __extends(Transition, _super);\n function Transition() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Transition.prototype.installed = function () {\n var _this = this;\n domReady(function () {\n _this.transitionTarget = _this.children[0];\n _this.enter();\n if (_this.props.leavingTime) {\n setTimeout(function () {\n _this.leave();\n }, _this.props.leavingTime);\n }\n });\n };\n Transition.prototype.enter = function () {\n this.fire('BeforeEnter');\n this.transitionTarget.classList.remove(this.props.name + '-leave-active');\n this.transitionTarget.classList.remove(this.props.name + '-leave-to');\n this.transitionTarget.classList.add(this.props.name + '-enter');\n this.transitionTarget.classList.add(this.props.name + '-enter-active');\n this.callback = function () {\n this.transitionTarget.classList.remove(this.props.name + '-enter-active');\n this.fire('AfterEnter');\n }.bind(this);\n this.once('transitionend', this.callback);\n this.once('animationend', this.callback);\n window.setTimeout(function () {\n this.transitionTarget.classList.remove(this.props.name + '-enter');\n this.transitionTarget.classList.add(this.props.name + '-enter-to');\n this.fire('enter');\n }.bind(this), 0);\n };\n Transition.prototype.leave = function () {\n this.fire('BeforeLeave');\n this.transitionTarget.classList.remove(this.props.name + '-enter-active');\n this.transitionTarget.classList.remove(this.props.name + '-enter-to');\n this.transitionTarget.classList.add(this.props.name + '-leave');\n this.transitionTarget.classList.add(this.props.name + '-leave-active');\n this.callback = function (e) {\n this.transitionTarget.classList.remove(this.props.name + '-leave-active');\n this.fire('AfterLeave');\n if (this.props.autoRemove && this.parentNode) {\n this.parentNode.removeChild(this);\n }\n }.bind(this);\n this.once('transitionend', this.callback);\n this.once('animationend', this.callback);\n window.setTimeout(function () {\n this.transitionTarget.classList.remove(this.props.name + '-leave');\n this.transitionTarget.classList.add(this.props.name + '-leave-to');\n this.fire('leave');\n }.bind(this), 0);\n };\n Transition.prototype.once = function (name, callback) {\n var wrapCall = function () {\n this.removeEventListener(name, wrapCall);\n callback();\n }.bind(this);\n this.addEventListener(name, wrapCall);\n };\n Transition.prototype.render = function () {\n return;\n };\n Transition.propTypes = {\n name: String,\n leavingTime: Number,\n autoRemove: Boolean\n };\n Transition.isLightDom = true;\n Transition.defaultProps = {\n name: 'o'\n };\n Transition = __decorate([\n omi_1.tag('o-transition')\n ], Transition);\n return Transition;\n}(omi_1.WeElement));\nexports.default = Transition;\n","module.exports = __WEBPACK_EXTERNAL_MODULE_omi__;"],"sourceRoot":""} \ No newline at end of file diff --git a/components/transition/src/index.tsx b/components/transition/src/index.tsx index b6f01eef4..6d2a19d77 100644 --- a/components/transition/src/index.tsx +++ b/components/transition/src/index.tsx @@ -11,6 +11,7 @@ //todo duration and delay support import { tag, WeElement } from 'omi' +import * as domReady from 'dready' interface Props { name: string @@ -37,14 +38,19 @@ export default class Transition extends WeElement{ installed() { - this.transitionTarget = this.childNodes[0] - this.enter() + domReady(() => { + + this.transitionTarget = this.children[0] + + this.enter() + + if (this.props.leavingTime) { + setTimeout(() => { + this.leave() + }, this.props.leavingTime) + } + }) - if (this.props.leavingTime) { - setTimeout(() => { - this.leave() - }, this.props.leavingTime) - } } callback: () => void @@ -52,7 +58,6 @@ export default class Transition extends WeElement{ enter() { this.fire('BeforeEnter') - this.fire('beforeEnter') this.transitionTarget.classList.remove(this.props.name + '-leave-active') this.transitionTarget.classList.remove(this.props.name + '-leave-to') this.transitionTarget.classList.add(this.props.name + '-enter') @@ -61,7 +66,6 @@ export default class Transition extends WeElement{ this.callback = function () { this.transitionTarget.classList.remove(this.props.name + '-enter-active') this.fire('AfterEnter') - this.fire('afterEnter') }.bind(this) this.once('transitionend', this.callback) this.once('animationend', this.callback) @@ -75,7 +79,6 @@ export default class Transition extends WeElement{ leave() { this.fire('BeforeLeave') - this.fire('beforeLeave') this.transitionTarget.classList.remove(this.props.name + '-enter-active') this.transitionTarget.classList.remove(this.props.name + '-enter-to') this.transitionTarget.classList.add(this.props.name + '-leave') @@ -86,7 +89,6 @@ export default class Transition extends WeElement{ this.transitionTarget.classList.remove(this.props.name + '-leave-active') this.fire('AfterLeave') - this.fire('afterLeave') if (this.props.autoRemove && this.parentNode) { this.parentNode.removeChild(this) }