@egjs/deview-infinite
Advanced tools
Comparing version 0.0.5 to 0.1.0
@@ -1,4 +0,4 @@ | ||
import Infinite from "./Infinite"; | ||
export default Infinite; | ||
import DeviewInfinite from "./DeviewInfinite"; | ||
export default DeviewInfinite; | ||
export * from "./consts"; | ||
export * from "./types"; |
@@ -1,2 +0,2 @@ | ||
import Infinite from "./Infinite"; | ||
export default Infinite; | ||
import DeviewInfinite from "./DeviewInfinite"; | ||
export default DeviewInfinite; |
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/NAVER-FEPlatform/deview2019-demo.git | ||
version: 0.0.5 | ||
version: 0.1.0 | ||
*/ | ||
@@ -72,8 +72,8 @@ 'use strict'; | ||
var Infinite = | ||
var DeviewInfinite = | ||
/*#__PURE__*/ | ||
function (_super) { | ||
__extends(Infinite, _super); | ||
__extends(DeviewInfinite, _super); | ||
function Infinite(container, options) { | ||
function DeviewInfinite(container, options) { | ||
if (options === void 0) { | ||
@@ -111,3 +111,3 @@ options = {}; | ||
var overflow = _this.options.overflow; | ||
_this.containerOffset = overflow ? 0 : _this.container.getBoundingClientRect().top; | ||
_this.containerOffset = overflow ? 0 : _this.container.getBoundingClientRect().top - document.body.getBoundingClientRect().top; | ||
_this.containerHeight = overflow ? _this.container.offsetHeight : window.innerHeight; | ||
@@ -143,3 +143,3 @@ | ||
var __proto = Infinite.prototype; | ||
var __proto = DeviewInfinite.prototype; | ||
@@ -245,3 +245,3 @@ __proto.insert = function (index, data) { | ||
return Infinite; | ||
return DeviewInfinite; | ||
}(Component); | ||
@@ -256,5 +256,5 @@ | ||
Infinite.DEFAULT_OPTIONS = DEFAULT_OPTIONS; | ||
DeviewInfinite.DEFAULT_OPTIONS = DEFAULT_OPTIONS; | ||
exports.default = Infinite; | ||
exports.default = DeviewInfinite; | ||
//# sourceMappingURL=infinite.cjs.js.map |
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/NAVER-FEPlatform/deview2019-demo.git | ||
version: 0.0.5 | ||
version: 0.1.0 | ||
*/ | ||
@@ -70,8 +70,8 @@ import Component from '@egjs/component'; | ||
var Infinite = | ||
var DeviewInfinite = | ||
/*#__PURE__*/ | ||
function (_super) { | ||
__extends(Infinite, _super); | ||
__extends(DeviewInfinite, _super); | ||
function Infinite(container, options) { | ||
function DeviewInfinite(container, options) { | ||
if (options === void 0) { | ||
@@ -109,3 +109,3 @@ options = {}; | ||
var overflow = _this.options.overflow; | ||
_this.containerOffset = overflow ? 0 : _this.container.getBoundingClientRect().top; | ||
_this.containerOffset = overflow ? 0 : _this.container.getBoundingClientRect().top - document.body.getBoundingClientRect().top; | ||
_this.containerHeight = overflow ? _this.container.offsetHeight : window.innerHeight; | ||
@@ -141,3 +141,3 @@ | ||
var __proto = Infinite.prototype; | ||
var __proto = DeviewInfinite.prototype; | ||
@@ -243,3 +243,3 @@ __proto.insert = function (index, data) { | ||
return Infinite; | ||
return DeviewInfinite; | ||
}(Component); | ||
@@ -254,4 +254,4 @@ | ||
export default Infinite; | ||
export default DeviewInfinite; | ||
export { DEFAULT_OPTIONS }; | ||
//# sourceMappingURL=infinite.esm.js.map |
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/NAVER-FEPlatform/deview2019-demo.git | ||
version: 0.0.5 | ||
version: 0.1.0 | ||
*/ | ||
@@ -760,8 +760,8 @@ (function (global, factory) { | ||
var Infinite = | ||
var DeviewInfinite = | ||
/*#__PURE__*/ | ||
function (_super) { | ||
__extends(Infinite, _super); | ||
__extends(DeviewInfinite, _super); | ||
function Infinite(container, options) { | ||
function DeviewInfinite(container, options) { | ||
if (options === void 0) { | ||
@@ -799,3 +799,3 @@ options = {}; | ||
var overflow = _this.options.overflow; | ||
_this.containerOffset = overflow ? 0 : _this.container.getBoundingClientRect().top; | ||
_this.containerOffset = overflow ? 0 : _this.container.getBoundingClientRect().top - document.body.getBoundingClientRect().top; | ||
_this.containerHeight = overflow ? _this.container.offsetHeight : window.innerHeight; | ||
@@ -831,3 +831,3 @@ | ||
var __proto = Infinite.prototype; | ||
var __proto = DeviewInfinite.prototype; | ||
@@ -933,3 +933,3 @@ __proto.insert = function (index, data) { | ||
return Infinite; | ||
return DeviewInfinite; | ||
}(Component); | ||
@@ -944,7 +944,7 @@ | ||
Infinite.DEFAULT_OPTIONS = DEFAULT_OPTIONS; | ||
DeviewInfinite.DEFAULT_OPTIONS = DEFAULT_OPTIONS; | ||
return Infinite; | ||
return DeviewInfinite; | ||
})); | ||
//# sourceMappingURL=infinite.js.map |
@@ -7,5 +7,5 @@ /* | ||
repository: git+https://github.com/NAVER-FEPlatform/deview2019-demo.git | ||
version: 0.0.5 | ||
version: 0.1.0 | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Infinite=e()}(this,function(){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function c(t){return void 0===t}var t=function(){var t=function(){function t(){this._eventHandler={},this.options={}}var e=t.prototype;return e.trigger=function(t,e){void 0===e&&(e={});var n=this._eventHandler[t]||[];if(!(0<n.length))return!0;n=n.concat(),e.eventType=t;var r=!1,i=[e],o=0;e.stop=function(){r=!0},e.currentTarget=this;for(var s=arguments.length,c=new Array(2<s?s-2:0),f=2;f<s;f++)c[f-2]=arguments[f];for(1<=c.length&&(i=i.concat(c)),o=0;n[o];o++)n[o].apply(this,i);return!r},e.once=function(i,o){if("object"==typeof i&&c(o)){var t,e=i;for(t in e)this.once(t,e[t]);return this}if("string"==typeof i&&"function"==typeof o){var s=this;this.on(i,function t(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];o.apply(s,n),s.off(i,t)})}return this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&c(e)){var n,r=t;for(n in r)this.on(n,r[n]);return this}if("string"==typeof t&&"function"==typeof e){var i=this._eventHandler[t];c(i)&&(this._eventHandler[t]=[],i=this._eventHandler[t]),i.push(e)}return this},e.off=function(t,e){if(c(t))return this._eventHandler={},this;if(c(e)){if("string"==typeof t)return this._eventHandler[t]=void 0,this;var n,r=t;for(n in r)this.off(n,r[n]);return this}var i,o,s=this._eventHandler[t];if(s)for(i=0;void 0!==(o=s[i]);i++)if(o===e){s=s.splice(i,1);break}return this},t}();return t.VERSION="2.1.2",t}(),m=function(){function t(){this.keys=[],this.values=[]}var e=t.prototype;return e.get=function(t){return this.values[this.keys.indexOf(t)]},e.set=function(t,e){var n=this.keys,r=this.values,i=n.indexOf(t),o=-1===i?n.length:i;n[o]=t,r[o]=e},t}(),w=function(){function t(){this.object={}}var e=t.prototype;return e.get=function(t){return this.object[t]},e.set=function(t,e){this.object[t]=e},t}(),_="function"==typeof Map,s=function(){function t(){}var e=t.prototype;return e.connect=function(t,e){this.prev=t,this.next=e,t&&(t.next=this),e&&(e.prev=this)},e.disconnect=function(){var t=this.prev,e=this.next;t&&(t.next=e),e&&(e.prev=t)},e.getIndex=function(){for(var t=this,e=-1;t;)t=t.prev,++e;return e},t}();var E=function(){function t(t,e,n,r,i,o,s,c){this.prevList=t,this.list=e,this.added=n,this.removed=r,this.changed=i,this.maintained=o,this.changedBeforeAdded=s,this.fixed=c}var e=t.prototype;return Object.defineProperty(e,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(e,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),e.caculateOrdered=function(){var t=function(t,n){var c=[],f=[];return t.forEach(function(t){var e=t[0],n=t[1],r=new s;c[e]=r,f[n]=r}),c.forEach(function(t,e){t.connect(c[e-1])}),t.filter(function(t,e){return!n[e]}).map(function(t,e){var n=t[0],r=t[1];if(n===r)return[0,0];var i=c[n],o=f[r-1],s=i.getIndex();return i.disconnect(),o?i.connect(o,o.next):i.connect(void 0,c[0]),[s,i.getIndex()]})}(this.changedBeforeAdded,this.fixed),c=this.changed,f=[];this.cacheOrdered=t.filter(function(t,e){var n=t[0],r=t[1],i=c[e],o=i[0],s=i[1];if(n!==r)return f.push([o,s]),!0}),this.cachePureChanged=f},t}();var e,n="function"==typeof Map?void 0:(e=0,function(t){return t.__DIFF_KEY__||(t.__DIFF_KEY__=++e)});function f(t,e){return function(t,e,n){var r=_?Map:n?w:m,i=n||function(t){return t},o=[],s=[],c=[],f=t.map(i),u=e.map(i),a=new r,h=new r,l=[],d=[],v={},p=[],g=0,y=0;return f.forEach(function(t,e){a.set(t,e)}),u.forEach(function(t,e){h.set(t,e)}),f.forEach(function(t,e){var n=h.get(t);void 0===n?(++y,s.push(e)):v[n]=y}),u.forEach(function(t,e){var n=a.get(t);void 0===n?(o.push(e),++g):(c.push([n,e]),y=v[e]||0,l.push([n-y,e-g]),d.push(e===n),n!==e&&p.push([n,e]))}),s.reverse(),new E(t,e,o,s,p,c,l,d)}(t,e,n)}var r=function(r){function t(t,e){void 0===e&&(e={});var n=r.call(this)||this;return n.container=t,n.items=[],n.containerOffset=0,n.containerHeight=0,n.scrollHeight=0,n.timer=0,n.onScroll=function(){var t=n.options,e=t.threshold;(t.overflow?n.container.scrollTop:document.documentElement.scrollTop)-n.containerOffset>n.scrollHeight-n.containerHeight-e&&(clearTimeout(n.timer),n.timer=window.setTimeout(function(){n.trigger("append",{requestIndex:n.items.length})},60))},n.onResize=function(){var t=n.options.overflow;n.containerOffset=t?0:n.container.getBoundingClientRect().top,n.containerHeight=t?n.container.offsetHeight:window.innerHeight,n.items.forEach(function(t){t.size=0}),n.layout()},n.options=o({threshold:100,margin:0,renderExternal:!1,overflow:!1},e),e.overflow&&(t.style.overflow="scroll"),(e.overflow?t:window).addEventListener("scroll",n.onScroll),window.addEventListener("resize",n.onResize),n.onResize(),n.onScroll(),n}!function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(t,r);var e=t.prototype;return e.insert=function(t,e){var n=this.options,r=this.items,i={el:"object"==typeof e?e:function(t){var e=document.createElement("div");return e.innerHTML=t,e.children[0]}(e),size:0,pos:0};if(r.splice(t,0,i),!n.renderExternal){var o=r[t+1];this.container.insertBefore(i.el,o?o.el:null),this.layout()}return i},e.remove=function(t){var e=this.options,n=this.items.splice(t,1)[0];return e.renderExternal||(this.container.removeChild(n.el),this.layout()),n},e.layout=function(){var t=this.options,e=t.overflow,n=t.margin,r=void 0===n?0:n,i=0;return this.items.forEach(function(t){t.size||(t.size=t.el.offsetHeight),t.pos=i,i+=t.size+r}),e||(this.container.style.height=i+"px"),this.scrollHeight=i,this.items.forEach(function(t){t.el.style.cssText+="position: absolute;top: "+t.pos+"px;"}),this.onScroll(),this},e.sync=function(t){var i=this,e=f(this.items.map(function(t){return t.el}),t),n=e.removed,r=e.ordered,o=e.added,s=e.list;return n.forEach(function(t){i.remove(t)}),r.forEach(function(t){var e=t[0],n=t[1],r=i.remove(e);i.insert(n,r.el).size=r.size}),o.forEach(function(t){i.insert(t,s[t])}),this.layout(),this},e.append=function(t){return this.insert(this.items.length,t),this},e.destroy=function(){(this.options.overflow?this.container:window).removeEventListener("scroll",this.onScroll),window.removeEventListener("resize",this.onResize)},t}(t);return r.DEFAULT_OPTIONS={threshold:100,margin:0,renderExternal:!1,overflow:!1},r}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Infinite=e()}(this,function(){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function c(t){return void 0===t}var t=function(){var t=function(){function t(){this._eventHandler={},this.options={}}var e=t.prototype;return e.trigger=function(t,e){void 0===e&&(e={});var n=this._eventHandler[t]||[];if(!(0<n.length))return!0;n=n.concat(),e.eventType=t;var r=!1,i=[e],o=0;e.stop=function(){r=!0},e.currentTarget=this;for(var s=arguments.length,c=new Array(2<s?s-2:0),f=2;f<s;f++)c[f-2]=arguments[f];for(1<=c.length&&(i=i.concat(c)),o=0;n[o];o++)n[o].apply(this,i);return!r},e.once=function(i,o){if("object"==typeof i&&c(o)){var t,e=i;for(t in e)this.once(t,e[t]);return this}if("string"==typeof i&&"function"==typeof o){var s=this;this.on(i,function t(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];o.apply(s,n),s.off(i,t)})}return this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&c(e)){var n,r=t;for(n in r)this.on(n,r[n]);return this}if("string"==typeof t&&"function"==typeof e){var i=this._eventHandler[t];c(i)&&(this._eventHandler[t]=[],i=this._eventHandler[t]),i.push(e)}return this},e.off=function(t,e){if(c(t))return this._eventHandler={},this;if(c(e)){if("string"==typeof t)return this._eventHandler[t]=void 0,this;var n,r=t;for(n in r)this.off(n,r[n]);return this}var i,o,s=this._eventHandler[t];if(s)for(i=0;void 0!==(o=s[i]);i++)if(o===e){s=s.splice(i,1);break}return this},t}();return t.VERSION="2.1.2",t}(),m=function(){function t(){this.keys=[],this.values=[]}var e=t.prototype;return e.get=function(t){return this.values[this.keys.indexOf(t)]},e.set=function(t,e){var n=this.keys,r=this.values,i=n.indexOf(t),o=-1===i?n.length:i;n[o]=t,r[o]=e},t}(),w=function(){function t(){this.object={}}var e=t.prototype;return e.get=function(t){return this.object[t]},e.set=function(t,e){this.object[t]=e},t}(),_="function"==typeof Map,s=function(){function t(){}var e=t.prototype;return e.connect=function(t,e){this.prev=t,this.next=e,t&&(t.next=this),e&&(e.prev=this)},e.disconnect=function(){var t=this.prev,e=this.next;t&&(t.next=e),e&&(e.prev=t)},e.getIndex=function(){for(var t=this,e=-1;t;)t=t.prev,++e;return e},t}();var E=function(){function t(t,e,n,r,i,o,s,c){this.prevList=t,this.list=e,this.added=n,this.removed=r,this.changed=i,this.maintained=o,this.changedBeforeAdded=s,this.fixed=c}var e=t.prototype;return Object.defineProperty(e,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(e,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),e.caculateOrdered=function(){var t=function(t,n){var c=[],f=[];return t.forEach(function(t){var e=t[0],n=t[1],r=new s;c[e]=r,f[n]=r}),c.forEach(function(t,e){t.connect(c[e-1])}),t.filter(function(t,e){return!n[e]}).map(function(t,e){var n=t[0],r=t[1];if(n===r)return[0,0];var i=c[n],o=f[r-1],s=i.getIndex();return i.disconnect(),o?i.connect(o,o.next):i.connect(void 0,c[0]),[s,i.getIndex()]})}(this.changedBeforeAdded,this.fixed),c=this.changed,f=[];this.cacheOrdered=t.filter(function(t,e){var n=t[0],r=t[1],i=c[e],o=i[0],s=i[1];if(n!==r)return f.push([o,s]),!0}),this.cachePureChanged=f},t}();var e,n="function"==typeof Map?void 0:(e=0,function(t){return t.__DIFF_KEY__||(t.__DIFF_KEY__=++e)});function f(t,e){return function(t,e,n){var r=_?Map:n?w:m,i=n||function(t){return t},o=[],s=[],c=[],f=t.map(i),u=e.map(i),a=new r,h=new r,l=[],d=[],v={},p=[],g=0,y=0;return f.forEach(function(t,e){a.set(t,e)}),u.forEach(function(t,e){h.set(t,e)}),f.forEach(function(t,e){var n=h.get(t);void 0===n?(++y,s.push(e)):v[n]=y}),u.forEach(function(t,e){var n=a.get(t);void 0===n?(o.push(e),++g):(c.push([n,e]),y=v[e]||0,l.push([n-y,e-g]),d.push(e===n),n!==e&&p.push([n,e]))}),s.reverse(),new E(t,e,o,s,p,c,l,d)}(t,e,n)}var r=function(r){function t(t,e){void 0===e&&(e={});var n=r.call(this)||this;return n.container=t,n.items=[],n.containerOffset=0,n.containerHeight=0,n.scrollHeight=0,n.timer=0,n.onScroll=function(){var t=n.options,e=t.threshold;(t.overflow?n.container.scrollTop:document.documentElement.scrollTop)-n.containerOffset>n.scrollHeight-n.containerHeight-e&&(clearTimeout(n.timer),n.timer=window.setTimeout(function(){n.trigger("append",{requestIndex:n.items.length})},60))},n.onResize=function(){var t=n.options.overflow;n.containerOffset=t?0:n.container.getBoundingClientRect().top-document.body.getBoundingClientRect().top,n.containerHeight=t?n.container.offsetHeight:window.innerHeight,n.items.forEach(function(t){t.size=0}),n.layout()},n.options=o({threshold:100,margin:0,renderExternal:!1,overflow:!1},e),e.overflow&&(t.style.overflow="scroll"),(e.overflow?t:window).addEventListener("scroll",n.onScroll),window.addEventListener("resize",n.onResize),n.onResize(),n.onScroll(),n}!function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(t,r);var e=t.prototype;return e.insert=function(t,e){var n=this.options,r=this.items,i={el:"object"==typeof e?e:function(t){var e=document.createElement("div");return e.innerHTML=t,e.children[0]}(e),size:0,pos:0};if(r.splice(t,0,i),!n.renderExternal){var o=r[t+1];this.container.insertBefore(i.el,o?o.el:null),this.layout()}return i},e.remove=function(t){var e=this.options,n=this.items.splice(t,1)[0];return e.renderExternal||(this.container.removeChild(n.el),this.layout()),n},e.layout=function(){var t=this.options,e=t.overflow,n=t.margin,r=void 0===n?0:n,i=0;return this.items.forEach(function(t){t.size||(t.size=t.el.offsetHeight),t.pos=i,i+=t.size+r}),e||(this.container.style.height=i+"px"),this.scrollHeight=i,this.items.forEach(function(t){t.el.style.cssText+="position: absolute;top: "+t.pos+"px;"}),this.onScroll(),this},e.sync=function(t){var i=this,e=f(this.items.map(function(t){return t.el}),t),n=e.removed,r=e.ordered,o=e.added,s=e.list;return n.forEach(function(t){i.remove(t)}),r.forEach(function(t){var e=t[0],n=t[1],r=i.remove(e);i.insert(n,r.el).size=r.size}),o.forEach(function(t){i.insert(t,s[t])}),this.layout(),this},e.append=function(t){return this.insert(this.items.length,t),this},e.destroy=function(){(this.options.overflow?this.container:window).removeEventListener("scroll",this.onScroll),window.removeEventListener("resize",this.onResize)},t}(t);return r.DEFAULT_OPTIONS={threshold:100,margin:0,renderExternal:!1,overflow:!1},r}); | ||
//# sourceMappingURL=infinite.min.js.map |
{ | ||
"name": "@egjs/deview-infinite", | ||
"version": "0.0.5", | ||
"version": "0.1.0", | ||
"description": "", | ||
@@ -25,3 +25,3 @@ "main": "./dist/infinite.cjs.js", | ||
"bugs": { | ||
"url": "https://github.com/daybrush/scenejs-editor/issues" | ||
"url": "https://github.com/NAVER-FEPlatform/deview2019-demo/issues" | ||
}, | ||
@@ -28,0 +28,0 @@ "homepage": "https://github.com/NAVER-FEPlatform/deview2019-demo", |
@@ -1,6 +0,6 @@ | ||
import Infinite from "./Infinite"; | ||
import DeviewInfinite from "./DeviewInfinite"; | ||
export default Infinite; | ||
export default DeviewInfinite; | ||
export * from "./consts"; | ||
export * from "./types"; |
@@ -1,6 +0,6 @@ | ||
import Infinite from "./Infinite"; | ||
import DeviewInfinite from "./DeviewInfinite"; | ||
import { DEFAULT_OPTIONS } from "./consts"; | ||
(Infinite as any).DEFAULT_OPTIONS = DEFAULT_OPTIONS; | ||
(DeviewInfinite as any).DEFAULT_OPTIONS = DEFAULT_OPTIONS; | ||
export default Infinite; | ||
export default DeviewInfinite; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
170776
25
1564